diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-12-26 16:46:31 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-12-26 16:46:31 -0800 |
commit | b63ffa1eac6f51bd66e092e4760d492bc58e3623 (patch) | |
tree | 00b69bce7473f5dfbe33997470f1a2bfbd770c6b /src | |
parent | 1778e7234547c9ab4a5001fd7e70dd5abcaac71c (diff) | |
download | dsub-b63ffa1eac6f51bd66e092e4760d492bc58e3623.tar.gz dsub-b63ffa1eac6f51bd66e092e4760d492bc58e3623.tar.bz2 dsub-b63ffa1eac6f51bd66e092e4760d492bc58e3623.zip |
Auto proceed to next song on finish
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/service/DLNAController.java | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/github/daneren2005/dsub/service/DLNAController.java b/src/github/daneren2005/dsub/service/DLNAController.java index 78f737ce..476f0626 100644 --- a/src/github/daneren2005/dsub/service/DLNAController.java +++ b/src/github/daneren2005/dsub/service/DLNAController.java @@ -39,15 +39,19 @@ import org.fourthline.cling.support.avtransport.callback.SetAVTransportURI; import org.fourthline.cling.support.avtransport.callback.Stop;
import org.fourthline.cling.support.avtransport.lastchange.AVTransportLastChangeParser;
import org.fourthline.cling.support.avtransport.lastchange.AVTransportVariable;
+import org.fourthline.cling.support.connectionmanager.callback.PrepareForConnection;
import org.fourthline.cling.support.contentdirectory.DIDLParser;
import org.fourthline.cling.support.lastchange.LastChange;
import org.fourthline.cling.support.model.DIDLContent;
+import org.fourthline.cling.support.model.PersonWithRole;
import org.fourthline.cling.support.model.PositionInfo;
+import org.fourthline.cling.support.model.Res;
import org.fourthline.cling.support.model.SeekMode;
import org.fourthline.cling.support.model.item.Item;
import org.fourthline.cling.support.model.item.MusicTrack;
import org.fourthline.cling.support.model.item.VideoItem;
import org.fourthline.cling.support.renderingcontrol.callback.SetVolume;
+import org.seamless.util.MimeType;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -138,7 +142,8 @@ public class DLNAController extends RemoteController { if(failed) {
failedLoad();
} else {
- downloadService.setPlayerState(PlayerState.STOPPED);
+ downloadService.setPlayerState(PlayerState.COMPLETED);
+ downloadService.next();
}
break;
case TRANSITIONING:
@@ -418,21 +423,8 @@ public class DLNAController extends RemoteController { lastUpdate.set(System.currentTimeMillis());
- // Playback was stopped
- if(positionInfo.getTrackURI() == null) {
- if(downloadService.getCurrentPlaying() != null && downloadService.getPlayerState() != PlayerState.IDLE) {
- Log.w(TAG, "Nothing is playing on DLNA device");
- downloadService.setCurrentPlaying(null, false);
- }
- }
- // End device started playing something else, no idea what
- else if(!positionInfo.getTrackURI().equals(currentPlayingURI) && downloadService.getPlayerState() != PlayerState.IDLE) {
- Log.w(TAG, "A different song is playing on the remote device: " + positionInfo.getTrackURI());
- downloadService.setCurrentPlaying(null, false);
- } else {
- // Let's get the updated position
- currentPosition = (int) positionInfo.getTrackElapsedSeconds();
- }
+ // Let's get the updated position
+ currentPosition = (int) positionInfo.getTrackElapsedSeconds();
downloadService.postDelayed(new Runnable() {
@Override
|