List of usage examples for android.media.audiofx AudioEffect ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL
String ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL
To view the source code for android.media.audiofx AudioEffect ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL.
Click Source Link
From source file:the.joeapollo.ui.activities.AudioPlayerActivity.java
/** * {@inheritDoc}//from w w w. j a va 2s . c o m */ @Override public boolean onPrepareOptionsMenu(final Menu menu) { mResources.setFavoriteIcon(menu); // Hide the EQ option if it can't be opened final MenuItem effects = menu.findItem(R.id.menu_audio_player_equalizer); final Intent intent = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL); if (getPackageManager().resolveActivity(intent, 0) == null) { effects.setVisible(false); } return true; }
From source file:com.boko.vimusic.ui.activities.AudioPlayerActivity.java
/** * {@inheritDoc}/*from w ww .j a va2 s . c o m*/ */ @Override public boolean onPrepareOptionsMenu(final Menu menu) { // Hide the EQ option if it can't be opened final Intent intent = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL); if (getPackageManager().resolveActivity(intent, 0) == null) { final MenuItem effects = menu.findItem(R.id.menu_audio_player_equalizer); effects.setVisible(false); } mResources.setFavoriteIcon(menu); return true; }
From source file:com.ksharkapps.musicnow.ui.activities.AudioPlayerActivity.java
/** * {@inheritDoc}/*from w w w. j ava 2s.c o m*/ */ @Override public boolean onPrepareOptionsMenu(final Menu menu) { // Hide the EQ option if it can't be opened MenuItem fav = menu.findItem(R.id.menu_favorite); final Intent intent = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL); if (getPackageManager().resolveActivity(intent, 0) == null) { final MenuItem effects = menu.findItem(R.id.menu_audio_player_equalizer); effects.setVisible(false); } if (MusicUtils.mService != null && MusicUtils.getCurrentAudioId() != -1) { if (MusicUtils.isFavorite()) { fav.setIcon(R.drawable.ic_favorited); } else { fav.setIcon(R.drawable.ic_unfavorited); // Theme chooser } } return true; }
From source file:org.gateshipone.odyssey.views.NowPlayingView.java
/** * Menu click listener. This method gets called when the user selects an item of the popup menu (right top corner). * * @param item MenuItem that was clicked. * @return Returns true if the item was handled by this method. False otherwise. *//*w w w . j a v a 2 s .co m*/ @Override public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { case R.id.view_nowplaying_action_shuffleplaylist: try { mServiceConnection.getPBS().shufflePlaylist(); } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } return true; case R.id.view_nowplaying_action_clearplaylist: try { mServiceConnection.getPBS().clearPlaylist(); } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } return true; case R.id.view_nowplaying_action_saveplaylist: // open dialog in order to save the current playlist as a playlist in the mediastore ChoosePlaylistDialog choosePlaylistDialog = new ChoosePlaylistDialog(); choosePlaylistDialog.show(((AppCompatActivity) getContext()).getSupportFragmentManager(), "ChoosePlaylistDialog"); return true; case R.id.view_nowplaying_action_createbookmark: // open dialog in order to save the current playlist as a bookmark in the odyssey db ChooseBookmarkDialog chooseBookmarkDialog = new ChooseBookmarkDialog(); chooseBookmarkDialog.show(((AppCompatActivity) getContext()).getSupportFragmentManager(), "ChooseBookmarkDialog"); return true; case R.id.view_nowplaying_action_startequalizer: // start the audio equalizer Activity activity = (Activity) getContext(); if (activity != null) { Intent startEqualizerIntent = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL); try { activity.startActivityForResult(startEqualizerIntent, 0); } catch (ActivityNotFoundException e) { ErrorDialog equalizerNotFoundDlg = ErrorDialog.newInstance( R.string.dialog_equalizer_not_found_title, R.string.dialog_equalizer_not_found_message); equalizerNotFoundDlg.show(((AppCompatActivity) getContext()).getSupportFragmentManager(), "EqualizerNotFoundDialog"); } } return true; default: return false; } }
From source file:com.rks.musicx.ui.activities.MainActivity.java
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); switch (id) { case android.R.id.home: FragmentManager fm = getSupportFragmentManager(); if (fm.getBackStackEntryCount() > 0) { fm.popBackStack();/*from ww w .j a v a 2 s . com*/ } else { fragmentLoader(setContainerId(), setFragment()); } return true; case R.id.system_eq: Intent intent = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL); if (intent.getAction() != null && Helper.isActivityPresent(MainActivity.this, intent)) { intent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, musicXService.audioSession()); startActivityForResult(intent, EQ); } else { Toast.makeText(this, "No app found to handle equalizer", Toast.LENGTH_SHORT).show(); } break; case R.id.play_save_queue: multiQueuePlay(); break; } return super.onOptionsItemSelected(item); }
From source file:org.mariotaku.harmony.activity.MusicPlaybackActivity.java
@Override public boolean onOptionsItemSelected(MenuItem item) { if (mService == null) return true; switch (item.getItemId()) { case MENU_ADD_TO_PLAYLIST: { final Intent intent = new Intent(INTENT_ADD_TO_PLAYLIST); long[] list_to_be_added = new long[1]; //list_to_be_added[0] = MusicUtils.getCurrentAudioId(); intent.putExtra(INTENT_KEY_LIST, list_to_be_added); startActivity(intent);//from w w w. ja v a2 s.co m break; } case EQUALIZER: { final Intent intent = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL); intent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getPackageName()); intent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, mService.getAudioSessionId()); intent.putExtra(AudioEffect.EXTRA_CONTENT_TYPE, AudioEffect.CONTENT_TYPE_MUSIC); startActivityForResult(intent, REQUEST_EQUALIZER); break; } case MENU_SLEEP_TIMER: { final Intent intent = new Intent(INTENT_SLEEP_TIMER); startActivity(intent); break; } case DELETE_ITEMS: { final Intent intent = new Intent(INTENT_DELETE_ITEMS); Bundle bundle = new Bundle(); // bundle.putString( // INTENT_KEY_PATH, // Uri.withAppendedPath(Audio.Media.EXTERNAL_CONTENT_URI, // Uri.encode(String.valueOf(MusicUtils.getCurrentAudioId()))) // .toString()); intent.putExtras(bundle); startActivity(intent); break; } case SETTINGS: { final Intent intent = new Intent(INTENT_APPEARANCE_SETTINGS); startActivity(intent); break; } case MENU_HOME: { overridePendingTransition(R.anim.music_playback_activity_enter, R.anim.music_playback_activity_exit); NavUtils.navigateUpTo(this, new Intent(this, MusicBrowserActivity.class)); break; } case ADD_TO_FAVORITES: { toggleFavorite(); break; } case MENU_SHUFFLE_MODE_NONE: { mService.setShuffleMode(SHUFFLE_MODE_NONE); break; } case MENU_SHUFFLE_MODE_ALL: { mService.setShuffleMode(SHUFFLE_MODE_ALL); break; } case MENU_REPEAT_MODE_NONE: { mService.setRepeatMode(REPEAT_MODE_NONE); break; } case MENU_REPEAT_MODE_ALL: { mService.setRepeatMode(REPEAT_MODE_ALL); break; } case MENU_REPEAT_MODE_CURRENT: { mService.setRepeatMode(REPEAT_MODE_CURRENT); break; } } return true; }
From source file:org.mariotaku.harmony.activity.MusicPlaybackActivity.java
@Override public boolean onPrepareOptionsMenu(Menu menu) { final MenuItem equalizer = menu.findItem(EQUALIZER); if (equalizer != null) { final PackageManager pm = getPackageManager(); final Intent intent = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL); equalizer.setVisible(!pm.queryIntentActivities(intent, 0).isEmpty()); }/*from www. j a va 2 s . c o m*/ // final MenuItem item = menu.findItem(ADD_TO_FAVORITES); // try { // if (item != null && mService != null) // item.setIcon(mService.isFavorite(mService.getAudioId()) ? R.drawable.ic_menu_star // : R.drawable.ic_menu_star_off); // } catch (RemoteException e) { // e.printStackTrace(); // } if (mService != null) { switch (mService.getShuffleMode()) { case SHUFFLE_MODE_ALL: { menu.findItem(MENU_SHUFFLE_MODE_ALL).setChecked(true); break; } default: { menu.findItem(MENU_SHUFFLE_MODE_NONE).setChecked(true); break; } } switch (mService.getRepeatMode()) { case REPEAT_MODE_ALL: { menu.findItem(MENU_REPEAT_MODE_ALL).setChecked(true); break; } case REPEAT_MODE_CURRENT: { menu.findItem(MENU_REPEAT_MODE_CURRENT).setChecked(true); break; } default: { menu.findItem(MENU_REPEAT_MODE_NONE).setChecked(true); break; } } } return true; }
From source file:com.android.music.MediaPlaybackActivity.java
@Override public boolean onOptionsItemSelected(MenuItem item) { badSymptoms.saveMenu("menu", item.toString()); Intent intent;//from w w w .j av a2 s .c o m try { switch (item.getItemId()) { case GOTO_START: intent = new Intent(); intent.setClass(this, MusicBrowserActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); finish(); break; case USE_AS_RINGTONE: { // Set the system setting to make this the current ringtone if (mService != null) { MusicUtils.setRingtone(this, mService.getAudioId()); } return true; } case PARTY_SHUFFLE: MusicUtils.togglePartyShuffle(); setShuffleButtonImage(); break; case NEW_PLAYLIST: { intent = new Intent(); intent.setClass(this, CreatePlaylist.class); startActivityForResult(intent, NEW_PLAYLIST); return true; } case PLAYLIST_SELECTED: { long[] list = new long[1]; list[0] = MusicUtils.getCurrentAudioId(); long playlist = item.getIntent().getLongExtra("playlist", 0); MusicUtils.addToPlaylist(this, list, playlist); return true; } case DELETE_ITEM: { if (mService != null) { long[] list = new long[1]; list[0] = MusicUtils.getCurrentAudioId(); Bundle b = new Bundle(); String f; if (android.os.Environment.isExternalStorageRemovable()) { f = getString(R.string.delete_song_desc, mService.getTrackName()); } else { f = getString(R.string.delete_song_desc_nosdcard, mService.getTrackName()); } b.putString("description", f); b.putLongArray("items", list); intent = new Intent(); intent.setClass(this, DeleteItems.class); intent.putExtras(b); startActivityForResult(intent, -1); } return true; } case EFFECTS_PANEL: { Intent i = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL); i.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, mService.getAudioSessionId()); startActivityForResult(i, EFFECTS_PANEL); return true; } } } catch (RemoteException ex) { } return super.onOptionsItemSelected(item); }
From source file:com.android.app.MediaPlaybackActivity.java
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); // Don't show the menu items if we got launched by path/filedescriptor, or // if we're in one shot mode. In most cases, these menu items are not // useful in those modes, so for consistency we never show them in these // modes, instead of tailoring them to the specific file being played. if (MusicUtils.getCurrentAudioId() >= 0) { menu.add(0, GOTO_START, 0, R.string.goto_start).setIcon(R.drawable.ic_menu_music_library); menu.add(0, PARTY_SHUFFLE, 0, R.string.party_shuffle); // icon will be set in onPrepareOptionsMenu() SubMenu sub = menu.addSubMenu(0, ADD_TO_PLAYLIST, 0, R.string.add_to_playlist) .setIcon(android.R.drawable.ic_menu_add); // these next two are in a separate group, so they can be shown/hidden as needed // based on the keyguard state menu.add(1, USE_AS_RINGTONE, 0, R.string.ringtone_menu_short) .setIcon(R.drawable.ic_menu_set_as_ringtone); menu.add(1, DELETE_ITEM, 0, R.string.delete_item).setIcon(R.drawable.ic_menu_delete); Intent i = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL); if (getPackageManager().resolveActivity(i, 0) != null) { menu.add(0, EFFECTS_PANEL, 0, R.string.effectspanel).setIcon(R.drawable.ic_menu_eq); }/* w ww . j a v a2 s . c o m*/ return true; } return false; }
From source file:com.android.app.MediaPlaybackActivity.java
@Override public boolean onOptionsItemSelected(MenuItem item) { Intent intent;//from w ww . ja v a 2 s. c o m try { switch (item.getItemId()) { case GOTO_START: intent = new Intent(); intent.setClass(this, MusicBrowserActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); finish(); break; case USE_AS_RINGTONE: { // Set the system setting to make this the current ringtone if (mService != null) { MusicUtils.setRingtone(this, mService.getAudioId()); } return true; } case PARTY_SHUFFLE: MusicUtils.togglePartyShuffle(); setShuffleButtonImage(); break; case NEW_PLAYLIST: { intent = new Intent(); intent.setClass(this, CreatePlaylist.class); startActivityForResult(intent, NEW_PLAYLIST); return true; } case PLAYLIST_SELECTED: { long[] list = new long[1]; list[0] = MusicUtils.getCurrentAudioId(); long playlist = item.getIntent().getLongExtra("playlist", 0); MusicUtils.addToPlaylist(this, list, playlist); return true; } case DELETE_ITEM: { if (mService != null) { long[] list = new long[1]; list[0] = MusicUtils.getCurrentAudioId(); Bundle b = new Bundle(); String f; if (android.os.Environment.isExternalStorageRemovable()) { f = getString(R.string.delete_song_desc, mService.getTrackName()); } else { f = getString(R.string.delete_song_desc_nosdcard, mService.getTrackName()); } b.putString("description", f); b.putLongArray("items", list); intent = new Intent(); intent.setClass(this, DeleteItems.class); intent.putExtras(b); startActivityForResult(intent, -1); } return true; } case EFFECTS_PANEL: { Intent i = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL); i.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, mService.getAudioSessionId()); startActivityForResult(i, EFFECTS_PANEL); return true; } } } catch (RemoteException ex) { } return super.onOptionsItemSelected(item); }