com.virtual.tour.road.com.virtual.tour.road.vista

## Class MusicPlayer

- java.lang.Object
- - android.content.Context
  - - android.content.ContextWrapper
    - - android.view.ContextThemeWrapper
      - - android.app.Activity
        - - android.support.v4.app.FragmentActivity
          - - android.support.v7.app.ActionBarActivity
            - - com.virtual.tour.road.com.virtual.tour.road.vista.MusicPlayer

- All Implemented Interfaces:
    android.content.ComponentCallbacks, android.content.ComponentCallbacks2, android.support.v4.app.ActionBarDrawerToggle.DelegateProvider, android.support.v4.app.TaskStackBuilder.SupportParentable, android.view.KeyEvent.Callback, android.view.LayoutInflater.Factory, android.view.LayoutInflater.Factory2, android.view.View.OnCreateContextMenuListener, android.view.Window.Callback, android.view.Window.OnWindowDismissedCallback, android.widget.MediaController.MediaPlayerControl

      public class MusicPlayer
      extends android.support.v7.app.ActionBarActivity
      implements android.widget.MediaController.MediaPlayerControl

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class android.app.Activity

      `android.app.Activity.TranslucentConversionListener`

    - ### Nested classes/interfaces inherited from class android.content.Context

      `android.content.Context.BindServiceFlags, android.content.Context.CreatePackageOptions, android.content.Context.ServiceName`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private Controlador` | `controlador`
    `private MusicController` | `controller`
    `private boolean` | `musicBound`
    `private android.content.ServiceConnection` | `musicConnection`
    `private MusicService` | `musicSrv`
    `private android.content.BroadcastReceiver` | `onPrepareReceiver`
    `private boolean` | `paused`
    `private boolean` | `playbackPaused`
    `private android.content.Intent` | `playIntent`
    `private boolean` | `propia`
    `private java.util.ArrayList<Song>` | `songList`
    `private android.widget.ListView` | `songView`

    - ### Fields inherited from class android.app.Activity

      `DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK`

    - ### Fields inherited from class android.content.Context

      `ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, APPWIDGET_SERVICE, AUDIO_SERVICE, BACKUP_SERVICE, BATTERY_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_NOT_VISIBLE, BIND_SHOWING_UI, BIND_TREAT_LIKE_ACTIVITY, BIND_VISIBLE, BIND_WAIVE_PRIORITY, BLUETOOTH_SERVICE, CAMERA_SERVICE, CAPTIONING_SERVICE, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_REGISTER_PACKAGE, CONTEXT_RESTRICTED, COUNTRY_DETECTOR, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, ETHERNET_SERVICE, FINGERPRINT_SERVICE, HDMI_CONTROL_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, JOB_SCHEDULER_SERVICE, KEYGUARD_SERVICE, LAUNCHER_APPS_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_PROJECTION_SERVICE, MEDIA_ROUTER_SERVICE, MEDIA_SESSION_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_PRIVATE, NETWORK_POLICY_SERVICE, NETWORK_SCORE_SERVICE, NETWORK_STATS_SERVICE, NETWORKMANAGEMENT_SERVICE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, PERSISTENT_DATA_BLOCK_SERVICE, POWER_SERVICE, PRINT_SERVICE, RESTRICTIONS_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, SERIAL_SERVICE, SIP_SERVICE, STATUS_BAR_SERVICE, STORAGE_SERVICE, TELECOM_SERVICE, TELEPHONY_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, TRUST_SERVICE, TV_INPUT_SERVICE, UI_MODE_SERVICE, UPDATE_LOCK_SERVICE, USAGE_STATS_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, VOICE_INTERACTION_MANAGER_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_PASSPOINT_SERVICE, WIFI_RTT_SERVICE, WIFI_SCANNING_SERVICE, WIFI_SERVICE, WINDOW_SERVICE`

    - ### Fields inherited from interface android.content.ComponentCallbacks2

      `TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MusicPlayer()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canPause()`
    `boolean` | `canSeekBackward()`
    `boolean` | `canSeekForward()`
    `int` | `getAudioSessionId()` Get the audio session id for the player used by this VideoView.
    `int` | `getBufferPercentage()`
    `int` | `getCurrentPosition()`
    `int` | `getDuration()`
    `android.support.v4.app.FragmentManager` | `getSupportFragmentManager()`
    `boolean` | `isPlaying()`
    `protected void` | `onCreate(android.os.Bundle savedInstanceState)` Perform initialization of all fragments and loaders.
    `boolean` | `onCreateOptionsMenu(android.view.Menu menu)` Initialize the contents of the Activity's standard options menu.
    `protected void` | `onDestroy()` Destroy all fragments and loaders.
    `boolean` | `onOptionsItemSelected(android.view.MenuItem item)` This hook is called whenever an item in your options menu is selected.
    `protected void` | `onPause()` Dispatch onPause() to fragments.
    `protected void` | `onResume()` Dispatch onResume() to fragments.
    `protected void` | `onStart()` Dispatch onStart() to all fragments.
    `protected void` | `onStop()` Dispatch onStop() to all fragments.
    `void` | `pause()`
    `private void` | `playNext()`
    `private void` | `playPrev()`
    `void` | `seekTo(int pos)`
    `private void` | `setController()`
    `void` | `songPicked(android.view.View view)`
    `void` | `start()`

    - ### Methods inherited from class android.support.v7.app.ActionBarActivity

      `addContentView, getDrawerToggleDelegate, getMenuInflater, getSupportActionBar, getSupportParentActivityIntent, getV7DrawerToggleDelegate, invalidateOptionsMenu, onBackPressed, onConfigurationChanged, onContentChanged, onCreatePanelMenu, onCreatePanelView, onCreateSupportNavigateUpTaskStack, onCreateView, onKeyDown, onKeyShortcut, onMenuItemSelected, onMenuOpened, onPanelClosed, onPostResume, onPrepareOptionsPanel, onPreparePanel, onPrepareSupportNavigateUpTaskStack, onSupportActionModeFinished, onSupportActionModeStarted, onSupportContentChanged, onSupportNavigateUp, onTitleChanged, setContentView, setContentView, setContentView, setSupportActionBar, setSupportProgress, setSupportProgressBarIndeterminate, setSupportProgressBarIndeterminateVisibility, setSupportProgressBarVisibility, startSupportActionMode, supportInvalidateOptionsMenu, supportNavigateUpTo, supportRequestWindowFeature, supportShouldUpRecreateTask`

    - ### Methods inherited from class android.support.v4.app.FragmentActivity

      `dump, getLastCustomNonConfigurationInstance, getSupportFragmentManager, getSupportLoaderManager, onActivityResult, onAttachFragment, onLowMemory, onNewIntent, onResumeFragments, onRetainCustomNonConfigurationInstance, onRetainNonConfigurationInstance, onSaveInstanceState, setEnterSharedElementCallback, setExitSharedElementCallback, startActivityForResult, startActivityFromFragment, supportFinishAfterTransition, supportPostponeEnterTransition, supportStartPostponedEnterTransition`

    - ### Methods inherited from class android.app.Activity

      `closeContextMenu, closeOptionsMenu, convertFromTranslucent, convertToTranslucent, createPendingResult, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, findViewById, finish, finishActivity, finishActivityFromChild, finishAffinity, finishAfterTransition, finishAndRemoveTask, finishFromChild, getActionBar, getActivityToken, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getContentScene, getContentTransitionManager, getCurrentFocus, getFragmentManager, getIntent, getLayoutInflater, getLoaderManager, getLocalClassName, getMediaController, getParent, getParentActivityIntent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVoiceInteractor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, isBackgroundVisibleBehind, isChangingConfigurations, isChild, isDestroyed, isFinishing, isImmersive, isResumed, isTaskRoot, isVoiceInteraction, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onActivityReenter, onApplyThemeResource, onAttachedToWindow, onAttachFragment, onBackgroundVisibleBehindChanged, onChildTitleChanged, onContextItemSelected, onContextMenuClosed, onCreate, onCreateContextMenu, onCreateDescription, onCreateNavigateUpTaskStack, onCreateThumbnail, onCreateView, onDetachedFromWindow, onEnterAnimationComplete, onGenericMotionEvent, onKeyLongPress, onKeyMultiple, onKeyUp, onNavigateUp, onNavigateUpFromChild, onNewActivityOptions, onOptionsMenuClosed, onPostCreate, onPostCreate, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onProvideAssistData, onRestart, onRestoreInstanceState, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onUserLeaveHint, onVisibleBehindCanceled, onWindowAttributesChanged, onWindowDismissed, onWindowFocusChanged, onWindowStartingActionMode, openContextMenu, openOptionsMenu, overridePendingTransition, postponeEnterTransition, recreate, registerForContextMenu, releaseInstance, reportFullyDrawn, requestVisibleBehind, requestWindowFeature, runOnUiThread, setActionBar, setContentTransitionManager, setDefaultKeyMode, setEnterSharedElementCallback, setExitSharedElementCallback, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setImmersive, setIntent, setMediaController, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTaskDescription, setTitle, setTitle, setVisible, setVolumeControlStream, shouldUpRecreateTask, startActionMode, startActivities, startActivities, startActivity, startActivity, startActivityAsCaller, startActivityAsUser, startActivityAsUser, startActivityForResult, startActivityForResultAsUser, startActivityForResultAsUser, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSender, startIntentSender, startIntentSenderForResult, startIntentSenderForResult, startIntentSenderFromChild, startIntentSenderFromChild, startLockTask, startNextMatchingActivity, startNextMatchingActivity, startPostponedEnterTransition, startSearch, stopLockTask, takeKeyEvents, triggerSearch, unregisterForContextMenu`

    - ### Methods inherited from class android.view.ContextThemeWrapper

      `applyOverrideConfiguration, attachBaseContext, getResources, getTheme, getThemeResId, setTheme`

    - ### Methods inherited from class android.content.ContextWrapper

      `bindService, bindServiceAsUser, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createApplicationContext, createConfigurationContext, createDisplayContext, createPackageContext, createPackageContextAsUser, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getBasePackageName, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDatabasePath, getDir, getDisplayAdjustments, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFilesDir, getFileStreamPath, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getSharedPreferences, getSharedPrefsFile, getUserId, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, registerReceiverAsUser, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setWallpaper, setWallpaper, startActivitiesAsUser, startInstrumentation, startService, startServiceAsUser, stopService, stopServiceAsUser, unbindService, unregisterReceiver`

    - ### Methods inherited from class android.content.Context

      `getDrawable, getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### controlador

          private Controlador controlador

    - #### controller

          private MusicController controller

    - #### musicBound

          private boolean musicBound

    - #### musicConnection

          private android.content.ServiceConnection musicConnection

    - #### musicSrv

          private MusicService musicSrv

    - #### onPrepareReceiver

          private android.content.BroadcastReceiver onPrepareReceiver

    - #### paused

          private boolean paused

    - #### playbackPaused

          private boolean playbackPaused

    - #### playIntent

          private android.content.Intent playIntent

    - #### propia

          private boolean propia

    - #### songList

          private java.util.ArrayList<Song> songList

    - #### songView

          private android.widget.ListView songView

  - ### Constructor Detail

    - #### MusicPlayer

          public MusicPlayer()

  - ### Method Detail

    - #### canPause

          public boolean canPause()

      Specified by:
        `canPause` in interface `android.widget.MediaController.MediaPlayerControl`

    - #### canSeekBackward

          public boolean canSeekBackward()

      Specified by:
        `canSeekBackward` in interface `android.widget.MediaController.MediaPlayerControl`

    - #### canSeekForward

          public boolean canSeekForward()

      Specified by:
        `canSeekForward` in interface `android.widget.MediaController.MediaPlayerControl`

    - #### getAudioSessionId

          public int getAudioSessionId()

      Description copied from interface: `android.widget.MediaController.MediaPlayerControl`
      Get the audio session id for the player used by this VideoView. This can be used to apply audio effects to the audio track of a video.
      Specified by:
        `getAudioSessionId` in interface `android.widget.MediaController.MediaPlayerControl`
      Returns:
        The audio session, or 0 if there was an error.

    - #### getBufferPercentage

          public int getBufferPercentage()

      Specified by:
        `getBufferPercentage` in interface `android.widget.MediaController.MediaPlayerControl`

    - #### getCurrentPosition

          public int getCurrentPosition()

      Specified by:
        `getCurrentPosition` in interface `android.widget.MediaController.MediaPlayerControl`

    - #### getDuration

          public int getDuration()

      Specified by:
        `getDuration` in interface `android.widget.MediaController.MediaPlayerControl`

    - #### isPlaying

          public boolean isPlaying()

      Specified by:
        `isPlaying` in interface `android.widget.MediaController.MediaPlayerControl`

    - #### onCreate

          protected void onCreate(android.os.Bundle savedInstanceState)

      Description copied from class: `android.support.v4.app.FragmentActivity`
      Perform initialization of all fragments and loaders.
      Overrides:
        `onCreate` in class `android.support.v7.app.ActionBarActivity`
      Parameters:
        `savedInstanceState` - If the activity is being re-initialized after previously being shut down then this Bundle contains the data it most recently supplied in `Activity.onSaveInstanceState(android.os.Bundle)`. Note: Otherwise it is null.
      See Also:
        `Activity.onStart()`, `Activity.onSaveInstanceState(android.os.Bundle)`, `Activity.onRestoreInstanceState(android.os.Bundle)`, `Activity.onPostCreate(android.os.Bundle)`

    - #### onCreateOptionsMenu

          public boolean onCreateOptionsMenu(android.view.Menu menu)

      Description copied from class: `android.app.Activity`
      Initialize the contents of the Activity's standard options menu. You should place your menu items in to menu.

      This is only called once, the first time the options menu is displayed. To update the menu every time it is displayed, see `Activity.onPrepareOptionsMenu(android.view.Menu)`.

      The default implementation populates the menu with standard system menu items. These are placed in the `Menu.CATEGORY_SYSTEM` group so that they will be correctly ordered with application-defined menu items. Deriving classes should always call through to the base implementation.

      You can safely hold on to menu (and any items created from it), making modifications to it as desired, until the next time onCreateOptionsMenu() is called.

      When you add items to the menu, you can implement the Activity's `Activity.onOptionsItemSelected(android.view.MenuItem)` method to handle them there.

      Overrides:
        `onCreateOptionsMenu` in class `android.app.Activity`
      Parameters:
        `menu` - The options menu in which you place your items.
      Returns:
        You must return true for the menu to be displayed; if you return false it will not be shown.
      See Also:
        `Activity.onPrepareOptionsMenu(android.view.Menu)`, `Activity.onOptionsItemSelected(android.view.MenuItem)`

    - #### onDestroy

          protected void onDestroy()

      Description copied from class: `android.support.v4.app.FragmentActivity`
      Destroy all fragments and loaders.
      Overrides:
        `onDestroy` in class `android.support.v7.app.ActionBarActivity`
      See Also:
        `Activity.onPause()`, `Activity.onStop()`, `Activity.finish(boolean)`, `Activity.isFinishing()`

    - #### onOptionsItemSelected

          public boolean onOptionsItemSelected(android.view.MenuItem item)

      Description copied from class: `android.app.Activity`
      This hook is called whenever an item in your options menu is selected. The default implementation simply returns false to have the normal processing happen (calling the item's Runnable or sending a message to its Handler as appropriate). You can use this method for any items for which you would like to do processing without those other facilities.

      Derived classes should call through to the base class for it to perform the default menu handling.

      Overrides:
        `onOptionsItemSelected` in class `android.app.Activity`
      Parameters:
        `item` - The menu item that was selected.
      Returns:
        boolean Return false to allow normal menu processing to proceed, true to consume it here.
      See Also:
        `Activity.onCreateOptionsMenu(android.view.Menu)`

    - #### onPause

          protected void onPause()

      Description copied from class: `android.support.v4.app.FragmentActivity`
      Dispatch onPause() to fragments.
      Overrides:
        `onPause` in class `android.support.v4.app.FragmentActivity`
      See Also:
        `Activity.onResume()`, `Activity.onSaveInstanceState(android.os.Bundle)`, `Activity.onStop()`

    - #### onResume

          protected void onResume()

      Description copied from class: `android.support.v4.app.FragmentActivity`
      Dispatch onResume() to fragments. Note that for better inter-operation with older versions of the platform, at the point of this call the fragments attached to the activity are not resumed. This means that in some cases the previous state may still be saved, not allowing fragment transactions that modify the state. To correctly interact with fragments in their proper state, you should instead override `FragmentActivity.onResumeFragments()`.
      Overrides:
        `onResume` in class `android.support.v4.app.FragmentActivity`
      See Also:
        `Activity.onRestoreInstanceState(android.os.Bundle)`, `Activity.onRestart()`, `Activity.onPostResume()`, `Activity.onPause()`

    - #### onStart

          protected void onStart()

      Description copied from class: `android.support.v4.app.FragmentActivity`
      Dispatch onStart() to all fragments. Ensure any created loaders are now started.
      Overrides:
        `onStart` in class `android.support.v4.app.FragmentActivity`
      See Also:
        `Activity.onCreate(android.os.Bundle)`, `Activity.onStop()`, `Activity.onResume()`

    - #### onStop

          protected void onStop()

      Description copied from class: `android.support.v4.app.FragmentActivity`
      Dispatch onStop() to all fragments. Ensure all loaders are stopped.
      Overrides:
        `onStop` in class `android.support.v7.app.ActionBarActivity`
      See Also:
        `Activity.onRestart()`, `Activity.onResume()`, `Activity.onSaveInstanceState(android.os.Bundle)`, `Activity.onDestroy()`

    - #### pause

          public void pause()

      Specified by:
        `pause` in interface `android.widget.MediaController.MediaPlayerControl`

    - #### playNext

          private void playNext()

    - #### playPrev

          private void playPrev()

    - #### seekTo

          public void seekTo(int pos)

      Specified by:
        `seekTo` in interface `android.widget.MediaController.MediaPlayerControl`

    - #### setController

          private void setController()

    - #### songPicked

          public void songPicked(android.view.View view)

    - #### start

          public void start()

      Specified by:
        `start` in interface `android.widget.MediaController.MediaPlayerControl`

    - #### getSupportFragmentManager

          public android.support.v4.app.FragmentManager getSupportFragmentManager()