Java Code Examples for android.media.audiofx.AudioEffect#ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL

The following examples show how to use android.media.audiofx.AudioEffect#ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NavigationUtil.java    From Music-Player with GNU General Public License v3.0 5 votes vote down vote up
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();
        }
    }
}
 
Example 2
Source File: NavigationUtil.java    From MusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
public static void openEqualizer(@NonNull final Activity activity) {
    final int sessionId = MusicPlayerRemote.getAudioSessionId();
    if (sessionId == AudioEffect.ERROR_BAD_VALUE) {
        Toasty.error(activity, activity.getResources().getString(R.string.no_audio_ID)).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) {
            Toasty.error(activity, activity.getResources().getString(R.string.no_equalizer)).show();
        }
    }
}
 
Example 3
Source File: NavigationUtil.java    From Orin with GNU General Public License v3.0 5 votes vote down vote up
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();
        }
    }
}
 
Example 4
Source File: SettingsActivity.java    From VinylMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
private boolean hasEqualizer() {
    final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
    if (getActivity() != null) {
        PackageManager pm = getActivity().getPackageManager();
        ResolveInfo ri = pm.resolveActivity(effects, 0);
        return ri != null;
    }
    return false;
}
 
Example 5
Source File: NavigationUtil.java    From VinylMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
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();
        }
    }
}
 
Example 6
Source File: MusicLibrary.java    From mobile-manager-tool with MIT License 5 votes vote down vote up
/**
 * 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;
}
 
Example 7
Source File: NavigationUtil.java    From Phonograph with GNU General Public License v3.0 5 votes vote down vote up
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();
        }
    }
}
 
Example 8
Source File: Util.java    From Jockey with Apache License 2.0 5 votes vote down vote up
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;
    }
}
 
Example 9
Source File: SettingsActivity.java    From Orin with GNU General Public License v3.0 4 votes vote down vote up
private boolean hasEqualizer() {
    final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
    PackageManager pm = getActivity().getPackageManager();
    ResolveInfo ri = pm.resolveActivity(effects, 0);
    return ri != null;
}
 
Example 10
Source File: AbsPlayerFragment.java    From VinylMusicPlayer with GNU General Public License v3.0 4 votes vote down vote up
protected boolean hasEqualizer() {
    final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
    PackageManager pm = getActivity().getPackageManager();
    ResolveInfo ri = pm.resolveActivity(effects, 0);
    return ri != null;
}
 
Example 11
Source File: TimberUtils.java    From Muzesto with GNU General Public License v3.0 4 votes vote down vote up
public static Intent createEffectsIntent() {
    final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
    effects.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, MusicPlayer.getAudioSessionId());
    return effects;
}
 
Example 12
Source File: SettingsActivity.java    From Phonograph with GNU General Public License v3.0 4 votes vote down vote up
private boolean hasEqualizer() {
    final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
    PackageManager pm = getActivity().getPackageManager();
    ResolveInfo ri = pm.resolveActivity(effects, 0);
    return ri != null;
}