From cd72cc2b1c2145a83d819d4a682bd3ede1024d5d Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 8 Aug 2013 19:29:40 -0700 Subject: Fixes to controllers --- .../daneren2005/dsub/service/JukeboxController.java | 5 +---- .../daneren2005/dsub/service/RemoteController.java | 18 +++++++++++++----- 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) { -- cgit v1.2.3