aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-08-08 19:29:40 -0700
committerScott Jackson <daneren2005@gmail.com>2013-08-08 19:29:40 -0700
commitcd72cc2b1c2145a83d819d4a682bd3ede1024d5d (patch)
treea41aee2af51628a6d78a5d40eaf281358e2dfac5
parent4439f100c8a24f0e94d1300eff58d004007fa847 (diff)
downloaddsub-cd72cc2b1c2145a83d819d4a682bd3ede1024d5d.tar.gz
dsub-cd72cc2b1c2145a83d819d4a682bd3ede1024d5d.tar.bz2
dsub-cd72cc2b1c2145a83d819d4a682bd3ede1024d5d.zip
Fixes to controllers
-rw-r--r--src/github/daneren2005/dsub/service/JukeboxController.java5
-rw-r--r--src/github/daneren2005/dsub/service/RemoteController.java18
2 files changed, 14 insertions, 9 deletions
diff --git a/src/github/daneren2005/dsub/service/JukeboxController.java b/src/github/daneren2005/dsub/service/JukeboxController.java
index f4751efb..4a3d4d40 100644
--- a/src/github/daneren2005/dsub/service/JukeboxController.java
+++ b/src/github/daneren2005/dsub/service/JukeboxController.java
@@ -114,14 +114,11 @@ public class JukeboxController extends RemoteController {
tasks.remove(Start.class);
startStatusUpdate();
- if (jukeboxStatus != null) {
- jukeboxStatus.setPositionSeconds(seconds);
- }
tasks.add(new Skip(index, 0));
downloadService.setPlayerState(PlayerState.STARTED);
}
@Override
- public void setVolume(float up) {
+ public void setVolume(boolean up) {
float delta = up ? 0.1f : -0.1f;
gain += delta;
gain = Math.max(gain, 0.0f);
diff --git a/src/github/daneren2005/dsub/service/RemoteController.java b/src/github/daneren2005/dsub/service/RemoteController.java
index ec44cdaa..717c2c72 100644
--- a/src/github/daneren2005/dsub/service/RemoteController.java
+++ b/src/github/daneren2005/dsub/service/RemoteController.java
@@ -19,28 +19,36 @@
package github.daneren2005.dsub.service;
-public class RemoteController {
+import android.content.Context;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.ProgressBar;
+import android.widget.Toast;
+import github.daneren2005.dsub.R;
+
+public abstract class RemoteController {
protected DownloadServiceImpl downloadService;
private VolumeToast volumeToast;
public abstract void start();
public abstract void stop();
- public abstract public abstract void updatePlaylist();
+ public abstract void updatePlaylist();
public abstract void changePosition(int seconds);
public abstract void changeTrack(int index, DownloadFile song);
- public abstract void setVolume(float gain);
+ public abstract void setVolume(boolean up);
public abstract int getRemotePosition();
protected VolumeToast getVolumeToast() {
if(volumeToast == null) {
- volumeToast == new VolumeToast(downloadService);
+ volumeToast = new VolumeToast(downloadService);
}
return volumeToast;
}
- private static class VolumeToast extends Toast {
+ public static class VolumeToast extends Toast {
private final ProgressBar progressBar;
public VolumeToast(Context context) {