From e2c1bb0195c930aa52cd6a6bfb75034fa8c13fd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C3=96nnerby?= Date: Mon, 31 Aug 2009 15:24:18 +0000 Subject: [PATCH] More workout mode fixes. --- src/android/AndroidManifest.xml | 2 +- .../src/org/musikcube/core/Workout.java | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/android/AndroidManifest.xml b/src/android/AndroidManifest.xml index 48ae30eb9..6a8c1f944 100644 --- a/src/android/AndroidManifest.xml +++ b/src/android/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:versionName="1.0.5" android:versionCode="5"> diff --git a/src/android/src/org/musikcube/core/Workout.java b/src/android/src/org/musikcube/core/Workout.java index 2cf77a4a4..83d4c3284 100644 --- a/src/android/src/org/musikcube/core/Workout.java +++ b/src/android/src/org/musikcube/core/Workout.java @@ -111,6 +111,7 @@ public class Workout implements OnBPMListener, Runnable, OnQueryResultListener { public void SetBPM(float bpm){ synchronized(lock){ if(this.paceDetector==null){ + this.reportBPM = bpm; this.bpm = bpm; if(this.active){ this.QueryTracks(true); @@ -180,14 +181,16 @@ public class Workout implements OnBPMListener, Runnable, OnQueryResultListener { public void OnQueryResults(IQuery query) { synchronized(this.lock){ - this.lastQueryTime = android.os.SystemClock.elapsedRealtime(); - BPMQuery bpmQuery = (BPMQuery)query; - if(!bpmQuery.trackList.isEmpty() && this.context!=null){ - Intent intent = new Intent(this.context, org.musikcube.Service.class); - intent.putExtra("org.musikcube.Service.tracklist", bpmQuery.trackList); - intent.putExtra("org.musikcube.Service.position", 0); - intent.putExtra("org.musikcube.Service.action", "playlist_prepare"); - this.context.startService(intent); + if(this.active){ + this.lastQueryTime = android.os.SystemClock.elapsedRealtime(); + BPMQuery bpmQuery = (BPMQuery)query; + if(!bpmQuery.trackList.isEmpty() && this.context!=null){ + Intent intent = new Intent(this.context, org.musikcube.Service.class); + intent.putExtra("org.musikcube.Service.tracklist", bpmQuery.trackList); + intent.putExtra("org.musikcube.Service.position", 0); + intent.putExtra("org.musikcube.Service.action", "playlist_prepare"); + this.context.startService(intent); + } } } }