diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-01-31 18:44:09 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-01-31 18:44:09 -0800 |
commit | 5caffddaf8c4a83132ca87f68dc0926b66a81c62 (patch) | |
tree | 32d645f38c9a9c371b72b6ec8d766071767024df /subsonic-android/src | |
parent | d74ccceed909d22a52b08a1f6050ad97324ee88d (diff) | |
download | dsub-5caffddaf8c4a83132ca87f68dc0926b66a81c62.tar.gz dsub-5caffddaf8c4a83132ca87f68dc0926b66a81c62.tar.bz2 dsub-5caffddaf8c4a83132ca87f68dc0926b66a81c62.zip |
Fix broadcasting at regular interval
Diffstat (limited to 'subsonic-android/src')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 2 | ||||
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/util/Util.java | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index 3d1813ba..f639e666 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -755,7 +755,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { if(mediaPlayer != null && getPlayerState() == STARTED) { try { cachedPosition = mediaPlayer.getCurrentPosition(); - Util.broadcastCurrentPosition(DownloadServiceImpl.this, cachedPosition); + Util.broadcastNewTrackInfo(DownloadServiceImpl.this, currentPlaying.getSong()); } catch(Exception e) { executorService.shutdown(); } diff --git a/subsonic-android/src/github/daneren2005/dsub/util/Util.java b/subsonic-android/src/github/daneren2005/dsub/util/Util.java index 1936c3f3..83a9c988 100644 --- a/subsonic-android/src/github/daneren2005/dsub/util/Util.java +++ b/subsonic-android/src/github/daneren2005/dsub/util/Util.java @@ -879,6 +879,7 @@ public final class Util { avrcpIntent.putExtra("id", (long) downloadService.getCurrentPlayingIndex()+1); avrcpIntent.putExtra("duration", (long) downloadService.getPlayerDuration()); avrcpIntent.putExtra("position", (long) downloadService.getPlayerPosition()); + avrcpIntent.putExtra("coverart", albumArtFile.getAbsolutePath()); } else { intent.putExtra("title", ""); intent.putExtra("artist", ""); @@ -892,6 +893,7 @@ public final class Util { avrcpIntent.putExtra("id", (long) 0); avrcpIntent.putExtra("duration", (long )0); avrcpIntent.putExtra("position", (long) 0); + avrcpIntent.putExtra("coverart", ""); } context.sendBroadcast(intent); @@ -929,12 +931,6 @@ public final class Util { context.sendBroadcast(intent); context.sendBroadcast(avrcpIntent); } - - public static void broadcastCurrentPosition(Context context, int currentPosition){ - Intent avrcpIntent = new Intent(AVRCP_METADATA_CHANGED); - avrcpIntent.putExtra("position", (long)currentPosition); - context.sendBroadcast(avrcpIntent); - } /** * Resolves the default text color for notifications. |