Skip to content

Commit

Permalink
Implement playQueue functionality
Browse files Browse the repository at this point in the history
Signed-off-by: Karel Goderis <[email protected]>
  • Loading branch information
kgoderis committed Feb 20, 2015
1 parent e5fc3eb commit 195f846
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<channel id="mute" typeId="mute" />
<channel id="playlinein" typeId="playlinein" />
<channel id="playlist" typeId="playlist" />
<channel id="playqueue" typeId="playqueue" />
<channel id="playuri" typeId="playuri" />
<channel id="publicaddress" typeId="publicaddress" />
<channel id="radio" typeId="radio" />
Expand Down Expand Up @@ -150,6 +151,13 @@
<description>Play the given playlist. The playlist has to predefined in the Sonos Controller app</description>
</channel-type>

<channel-type id="playqueue" advanced="true">
<item-type>Switch</item-type>
<label>Play Queue</label>
<description>Play the songs from the current queue</description>
</channel-type>


<channel-type id="playuri" advanced="true">
<item-type>String</item-type>
<label>Play URI</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class SonosBindingConstants {
public final static String MUTE = "mute";
public final static String PLAYLINEIN = "playlinein";
public final static String PLAYLIST = "playlist";
public final static String PLAYQUEUE = "playqueue";
public final static String PLAYURI = "playuri";
public final static String PUBLICADDRESS = "publicaddress";
public final static String RADIO = "radio";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ public void handleCommand(ChannelUID channelUID, Command command) {
case PLAYLIST:
playPlayList(command);
break;
case PLAYQUEUE:
playQueue(command);
break;
case PLAYURI:
playURI(command);
break;
Expand Down Expand Up @@ -1638,6 +1641,19 @@ public void playURI(Command command) {
}

}

public void playQueue(Command command) {
ZonePlayerHandler coordinator = getHandlerByName(getCoordinator());

// set the current playlist to our new queue
coordinator.setCurrentURI("x-rincon-queue:" + getUDN() + "#0", "");

// take the system off mute
coordinator.setMute(OnOffType.OFF);

// start jammin'
coordinator.play();
}

public void setLed(Command command) {
if (command != null) {
Expand Down

0 comments on commit 195f846

Please sign in to comment.