<button id="btnsingle" type="button" class="btn btn-default">
<span class="glyphicon glyphicon-star"></span> Single
</button>
+ <button id="btncrossfade" type="button" class="btn btn-default">
+ <span class="glyphicon glyphicon-link"></span> Crossfade
+ </button>
<button id="btnrepeat" type="button" class="btn btn-default">
<span class="glyphicon glyphicon-repeat"></span> Repeat
</button>
else
$('#btnsingle').removeClass("active");
+ if(obj.data.crossfade)
+ $('#btncrossfade').addClass("active")
+ else
+ $('#btncrossfade').removeClass("active");
+
if(obj.data.repeat)
$('#btnrepeat').addClass("active")
else
$('#btnsingle').on('click', function (e) {
socket.send("MPD_API_TOGGLE_SINGLE," + ($(this).hasClass('active') ? 0 : 1));
});
+$('#btncrossfade').on('click', function(e) {
+ socket.send("MPD_API_TOGGLE_CROSSFADE," + ($(this).hasClass('active') ? 0 : 1));
+});
$('#btnrepeat').on('click', function (e) {
socket.send("MPD_API_TOGGLE_REPEAT," + ($(this).hasClass('active') ? 0 : 1));
});
if(sscanf(c->content, "MPD_API_TOGGLE_SINGLE,%u", &uint_buf))
mpd_run_single(mpd.conn, uint_buf);
break;
+ case MPD_API_TOGGLE_CROSSFADE:
+ if(sscanf(c->content, "MPD_API_TOGGLE_CROSSFADE,%u", &uint_buf))
+ mpd_run_crossfade(mpd.conn, uint_buf);
+ break;
case MPD_API_SET_VOLUME:
if(sscanf(c->content, "MPD_API_SET_VOLUME,%ud", &uint_buf) && uint_buf <= 100)
mpd_run_set_volume(mpd.conn, uint_buf);
len = snprintf(buffer, MAX_SIZE,
"{\"type\":\"state\", \"data\":{"
" \"state\":%d, \"volume\":%d, \"repeat\":%d,"
- " \"single\":%d, \"consume\":%d, \"random\":%d, "
+ " \"single\":%d, \"crossfade\":%d, \"consume\":%d, \"random\":%d, "
" \"songpos\": %d, \"elapsedTime\": %d, \"totalTime\":%d, "
" \"currentsongid\": %d"
"}}",
mpd_status_get_volume(status),
mpd_status_get_repeat(status),
mpd_status_get_single(status),
+ mpd_status_get_crossfade(status),
mpd_status_get_consume(status),
mpd_status_get_random(status),
mpd_status_get_song_pos(status),