Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
support for CM DSP-Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-bl committed May 18, 2013
1 parent b178023 commit 141aef2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/ch/blinkenlights/android/vanilla/PlaybackService.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.media.audiofx.AudioEffect;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.os.Build;
Expand Down Expand Up @@ -543,6 +544,10 @@ public void onDestroy()

if (mMediaPlayer != null) {
saveState(mMediaPlayer.getCurrentPosition());
Intent i = new Intent(AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);
i.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, mMediaPlayer.getAudioSessionId());
i.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getPackageName());
sendBroadcast(i);
mMediaPlayer.release();
mMediaPlayer = null;
}
Expand Down Expand Up @@ -578,6 +583,12 @@ private MediaPlayer getNewMediaPlayer() {
public void prepareMediaPlayer(MediaPlayer mp, String path) throws IOException{
mp.setDataSource(path);
mp.prepare();

Intent i = new Intent(AudioEffect.ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION);
i.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, mp.getAudioSessionId());
i.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getPackageName());
sendBroadcast(i);

applyReplayGain(mp, path);
}

Expand Down

0 comments on commit 141aef2

Please sign in to comment.