summaryrefslogtreecommitdiff
path: root/android/src/org/rockbox/RockboxPCM.java
diff options
context:
space:
mode:
authorAntoine Cellerier <dionoea@videolan.org>2011-01-29 20:47:32 +0000
committerAntoine Cellerier <dionoea@videolan.org>2011-01-29 20:47:32 +0000
commitc0c769c5a86c56c2ab2c9e88515a64da98575182 (patch)
tree24e84b2d146bf3da39d93983d5656061e3c88ecb /android/src/org/rockbox/RockboxPCM.java
parente9749d1b93f23b3bc36305ad1d39ca5e5c0cb3a8 (diff)
Add widgets to android port.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29170 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'android/src/org/rockbox/RockboxPCM.java')
-rw-r--r--android/src/org/rockbox/RockboxPCM.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/android/src/org/rockbox/RockboxPCM.java b/android/src/org/rockbox/RockboxPCM.java
index 146e639a08..c1fecbcc15 100644
--- a/android/src/org/rockbox/RockboxPCM.java
+++ b/android/src/org/rockbox/RockboxPCM.java
@@ -23,9 +23,11 @@ package org.rockbox;
import java.util.Arrays;
+import android.content.Intent;
import android.media.AudioFormat;
import android.media.AudioManager;
import android.media.AudioTrack;
+import android.net.Uri;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Process;
@@ -80,10 +82,16 @@ public class RockboxPCM extends AudioTrack
private void play_pause(boolean pause) {
if (pause)
{
+ Intent widgetUpdate = new Intent("org.rockbox.UpdateState");
+ widgetUpdate.putExtra("state", "pause");
+ RockboxService.get_instance().sendBroadcast(widgetUpdate);
pause();
}
else
{
+ Intent widgetUpdate = new Intent("org.rockbox.UpdateState");
+ widgetUpdate.putExtra("state", "play");
+ RockboxService.get_instance().sendBroadcast(widgetUpdate);
if (getPlayState() == AudioTrack.PLAYSTATE_STOPPED)
{
RockboxService.get_instance().startForeground();
@@ -114,6 +122,9 @@ public class RockboxPCM extends AudioTrack
throw new IllegalStateException(e);
}
RockboxService.get_instance().stopForeground();
+ Intent widgetUpdate = new Intent("org.rockbox.UpdateState");
+ widgetUpdate.putExtra("state", "stop");
+ RockboxService.get_instance().sendBroadcast(widgetUpdate);
}
@SuppressWarnings("unused")