Add tracklist single mode

This commit is contained in:
kingosticks 2015-03-05 00:28:49 +00:00
parent 7322aa40d7
commit b19d275b6c
5 changed files with 20 additions and 0 deletions

View File

@ -442,6 +442,7 @@
<a href="#" onclick="doRandom(); return false" title="Random"><i class="fa fa-random" id="randombt"></i></a>
&nbsp; <a href="#" onclick="doRepeat(); return false" title="Repeat"><i class="fa fa-repeat" id="repeatbt"></i></a>
&nbsp; <a href="#" onclick="doConsume(); return false" title="Consume"><i class="fa fa-cutlery" id="consumebt"></i></a>
&nbsp; <a href="#" onclick="doSingle(); return false" title="Single"><i class="fa fa-dot-circle-o" id="singlebt"></i></a>
&nbsp; <a href="#" onclick="doShuffle(); return false" title="Shuffle"><i class="fa fa-arrows-v" id="shufflebt"></i></a>
</p>

View File

@ -335,6 +335,12 @@ function setConsume(nwconsume) {
}
}
function setSingle(nwsingle) {
if (single != nwsingle) {
single = setTracklistOption("single", nwsingle);
}
}
function doRandom() {
mopidy.tracklist.setRandom(!random).then();
}
@ -347,6 +353,10 @@ function doConsume() {
mopidy.tracklist.setConsume(!consume).then();
}
function doSingle() {
mopidy.tracklist.setSingle(!single).then();
}
/*********************
* Track Slider

View File

@ -17,6 +17,7 @@ var play = false;
var random;
var repeat;
var consume;
var single;
var currentVolume = -1;
var muteVolume = -1;
var volumeChanging = false;

View File

@ -345,6 +345,7 @@ function updateOptions() {
mopidy.tracklist.getRepeat().then(processRepeat, console.error);
mopidy.tracklist.getRandom().then(processRandom, console.error);
mopidy.tracklist.getConsume().then(processConsume, console.error);
mopidy.tracklist.getSingle().then(processSingle, console.error);
}
//update everything as if reloaded

View File

@ -42,6 +42,13 @@ function processConsume(data) {
setConsume(data);
}
/********************************************************
* process results of single
*********************************************************/
function processSingle(data) {
setSingle(data);
}
/********************************************************
* process results of current position
*********************************************************/