本文整理汇总了Java中android.media.audiofx.AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL属性的典型用法代码示例。如果您正苦于以下问题:Java AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL属性的具体用法?Java AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL怎么用?Java AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.media.audiofx.AudioEffect
的用法示例。
在下文中一共展示了AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openEqualizer
public static void openEqualizer(@NonNull final Activity activity) {
final int sessionId = MusicPlayerRemote.getAudioSessionId();
if (sessionId == AudioEffect.ERROR_BAD_VALUE) {
Toast.makeText(activity, activity.getResources().getString(R.string.no_audio_ID), Toast.LENGTH_LONG).show();
} else {
try {
final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
effects.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, sessionId);
effects.putExtra(AudioEffect.EXTRA_CONTENT_TYPE, AudioEffect.CONTENT_TYPE_MUSIC);
activity.startActivityForResult(effects, 0);
} catch (@NonNull final ActivityNotFoundException notFound) {
Toast.makeText(activity, activity.getResources().getString(R.string.no_equalizer), Toast.LENGTH_SHORT).show();
}
}
}
示例2: startEffectsPanel
private void startEffectsPanel() {
try {
final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
effects.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getContext().getPackageName());
effects.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, MusicUtils.getAudioSessionId());
effects.putExtra(AudioEffect.EXTRA_CONTENT_TYPE, AudioEffect.CONTENT_TYPE_MUSIC);
startActivityForResult(effects, REQUEST_EQ);
} catch (final ActivityNotFoundException ignored) {
Toast.makeText(getActivity(), "No system equalizer found", Toast.LENGTH_SHORT).show();
}
}
示例3: onOptionsItemSelected
@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();
} 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);
}
示例4: onCreateOptionsMenu
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.starred, menu);
MenuInflater inflater2 = getMenuInflater();
inflater2.inflate(R.menu.share, menu);
Intent i = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
if (getPackageManager().resolveActivity(i, 0) != null) {
MenuInflater inflater1 = getMenuInflater();
inflater1.inflate(R.menu.equalizer, menu);
}
MenuInflater inflater3 = getMenuInflater();
inflater3.inflate(R.menu.settings, menu);
if (!MusicUtils.getBooleanPref(this, "radiomode", false)) {
SubMenu menu1 = menu.addSubMenu(0, ADD_TO_PLAYLIST, 0,
R.string.add_to_playlist);
if (!MusicUtils.getBooleanPref(this, "radiomode", false)) {
MusicUtils.makePlaylistMenuOnline(this, menu1);
}
menu.add(1, SEARCH_LYRICS, 0, R.string.search_lyrics_menu_short);
}
menu.add(1, ABOUT + 2, 0, R.string.carmode_menu_short);
if (mSettings.getBoolean(PreferencesActivity.POPUP_ON, false))
menu.add(1, ABOUT + 1, 0, R.string.go_popup);
menu.add(1, ABOUT, 0, R.string.about_menu_short);
menu.add(1, EXIT, 0, R.string.exit_menu);
return true;
}
示例5: onOptionsItemSelected
/**
* Respond to clicks on actionbar options
*/
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_search:
onSearchRequested();
break;
case R.id.action_settings:
startActivityForResult(new Intent(this, SettingsHolder.class),0);
break;
case R.id.action_eqalizer:
final Intent intent = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
if (getPackageManager().resolveActivity(intent, 0) == null) {
startActivity(new Intent(this, SimpleEq.class));
}
else{
intent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, MusicUtils.getCurrentAudioId());
startActivity(intent);
}
break;
case R.id.action_shuffle_all:
shuffleAll();
break;
default:
return super.onOptionsItemSelected(item);
}
return true;
}
示例6: getSystemEqIntent
public static Intent getSystemEqIntent(Context c) {
Intent systemEq = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
systemEq.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, c.getPackageName());
ActivityInfo info = systemEq.resolveActivityInfo(c.getPackageManager(), 0);
if (info != null && !info.name.startsWith("com.android.musicfx")) {
return systemEq;
} else {
return null;
}
}
示例7: onOptionsItemSelected
/**
* Respond to clicks on actionbar options
*/
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_search:
onSearchRequested();
break;
case R.id.action_settings:
startActivityForResult(new Intent(this, SettingsHolder.class),0);
break;
case R.id.action_eqalizer:
Intent i = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
i.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, MusicUtils.getCurrentAudioId());
startActivityForResult(i, 0);
break;
case R.id.action_shuffle_all:
shuffleAll();
break;
default:
return super.onOptionsItemSelected(item);
}
return true;
}
示例8: onPreferenceClick
@Override
public boolean onPreferenceClick(Preference preference) {
if (preference == mEqualizer) {
try {
final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
effects.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getActivity().getPackageName());
effects.putExtra(AudioEffect.EXTRA_CONTENT_TYPE, AudioEffect.CONTENT_TYPE_MUSIC);
mActivytResultsController.startActivityForResult(effects, 0, null);
} catch (final ActivityNotFoundException notFound) {
Toast.makeText(getActivity(), getString(R.string.no_effects_for_you), Toast.LENGTH_LONG).show();
}
return true;
}
return false;
}
示例9: resolveEqualizer
private void resolveEqualizer() {
final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
PackageManager pm = getActivity().getPackageManager();
ResolveInfo ri = pm.resolveActivity(effects, 0);
if (ri == null) {
mEqualizer.setEnabled(false);
mEqualizer.setSummary(R.string.settings_equalizer_none);
}
}
示例10: openEffectsPanel
/**
* Opens the sound effects panel or DSP manager in CM
*
* @param context The {@link SherlockFragmentActivity} to use.
*/
public static void openEffectsPanel(final SherlockFragmentActivity context) {
try {
final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
effects.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, MusicUtils.getCurrentAudioId());
context.startActivityForResult(effects, 0);
// Make sure the notification starts
MusicUtils.startBackgroundService(context);
} catch (final ActivityNotFoundException e) {
Crouton.makeText(context, context.getString(R.string.no_effects_for_you),
Crouton.STYLE_ALERT);
}
}
示例11: onPrepareOptionsMenu
/**
* {@inheritDoc}
*/
@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;
}
示例12: onCreateOptionsMenu
@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);
}
return true;
}
return false;
}
开发者ID:AndroidLearnerchn,项目名称:Android-Application-Using-CAF-Library,代码行数:28,代码来源:MediaPlaybackActivity.java
示例13: onOptionsItemSelected
/**
* Respond to clicks on actionbar options
*/
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_search:
onSearchRequested();
break;
case R.id.action_settings:
startActivityForResult(new Intent(this, SettingsHolder.class),0);
break;
case R.id.action_eqalizer:
final Intent intent = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
if (getPackageManager().resolveActivity(intent, 0) == null) {
startActivity(new Intent(this, SimpleEq.class));
}
else{
intent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, MusicUtils.getCurrentAudioId());
startActivity(intent);
}
break;
case R.id.action_shuffle_all:
shuffleAll();
break;
case R.id.exit_app:
System.exit(1);
break;
default:
return super.onOptionsItemSelected(item);
}
return true;
}
示例14: createDisplayIntent
private static Intent createDisplayIntent() {
final Intent intent = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
intent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, BuildConfig.APPLICATION_ID);
intent.putExtra(AudioEffect.EXTRA_CONTENT_TYPE, AudioEffect.CONTENT_TYPE_MUSIC);
intent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, Player.audioSessionId);
return intent;
}
示例15: isEqualizerAvailable
private boolean isEqualizerAvailable() {
Intent intent = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
PackageManager manager = getActivity().getPackageManager();
List<ResolveInfo> infos = manager.queryIntentActivities(intent, 0);
return infos.size() > 0;
}