Example usage for android.media.audiofx AudioEffect ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION

List of usage examples for android.media.audiofx AudioEffect ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION

Introduction

In this page you can find the example usage for android.media.audiofx AudioEffect ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION.

Prototype

String ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION

To view the source code for android.media.audiofx AudioEffect ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION.

Click Source Link

Document

Intent to signal to the effect control application or service that an audio session is closed and that effects should not be applied anymore.

Usage

From source file:singh.amandeep.musicplayer.MusicService.java

/**
 * Temporarily pauses playback.//  ww  w .  ja  v a  2  s .  co m
 */
public void pause() {
    if (D)
        Log.d(TAG, "Pausing playback");
    synchronized (this) {
        mPlayerHandler.removeMessages(FADEUP);
        if (mIsSupposedToBePlaying) {
            final Intent intent = new Intent(AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);
            intent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, getAudioSessionId());
            intent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getPackageName());
            sendBroadcast(intent);

            mPlayer.pause();
            setIsSupposedToBePlaying(false, true);
            //stopShakeDetector(false);
        }
    }
}

From source file:com.av.remusic.service.MediaService.java

public void pause() {
    if (D)/*w  w w  .  j  a v  a 2s .c om*/
        Log.d(TAG, "Pausing playback");
    synchronized (this) {
        mPlayerHandler.removeMessages(FADEUP);
        if (mIsSupposedToBePlaying) {
            final Intent intent = new Intent(AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);
            intent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, getAudioSessionId());
            intent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getPackageName());
            sendBroadcast(intent);

            mPlayer.pause();

            setIsSupposedToBePlaying(false, true);
            notifyChange(META_CHANGED);
        }
    }
}

From source file:com.cyanogenmod.eleven.MusicPlaybackService.java

/**
 * Temporarily pauses playback./*from  w ww  . j a v  a 2s . com*/
 */
public void pause() {
    if (D)
        Log.d(TAG, "Pausing playback");
    synchronized (this) {
        mPlayerHandler.removeMessages(FADEUP);
        if (mIsSupposedToBePlaying) {
            final Intent intent = new Intent(AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);
            intent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, getAudioSessionId());
            intent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getPackageName());
            sendBroadcast(intent);

            mPlayer.pause();
            setIsSupposedToBePlaying(false, true);
            stopShakeDetector(false);
        }
    }
}