<button type="button" class="btn btn-default" onclick="socket.send('MPD_API_RM_ALL');">
<span class="glyphicon glyphicon-trash"></span> Clear queue
</button>
+ <a href="#" data-toggle="modal" data-target="#savequeue" class="btn btn-default">
+ <span class="glyphicon glyphicon-save"></span> Save queue
+ </a>
</div>
<div id="btn-responsive-block" class="btn-group-vertical btn-block btn-group-lg" data-toggle="buttons">
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
+
+ <div class="modal fade" id="savequeue" tabindex="-1" role="dialog" aria-labelledby="savequeueLabel" aria-hidden="true">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+ <h2 class="modal-title" id="savequeueLabel"><span class="glyphicon glyphicon-wrench"></span> Save Queue</h2>
+ </div>
+ <div class="modal-body">
+ <form role="form">
+ <div class="row">
+ <div class="form-group col-md-9">
+ <label class="control-label" for="playlistname">Playlist Name</label>
+ <input type="text" class="form-control" id="playlistname" />
+ </div>
+ </div>
+ </form>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
+ <button type="button" class="btn btn-default" onclick="saveQueue();">Save Queue</button>
+ </div>
+ </div><!-- /.modal-content -->
+ </div><!-- /.modal-dialog -->
+ </div><!-- /.modal -->
<div class="modal fade bs-example-modal-sm" id="wait" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" aria-hidden="true">
<div class="modal-dialog">
$('#addstream').modal('hide');
}
+function saveQueue() {
+ if($('#playlistname').val().length > 0) {
+ socket.send('MPD_API_SAVE_QUEUE,'+$('#playlistname').val());
+ }
+ $('#savequeue').modal('hide');
+}
+
function confirmSettings() {
if($('#mpd_pw').val().length + $('#mpd_pw_con').val().length > 0) {
if ($('#mpd_pw').val() !== $('#mpd_pw_con').val())
out_playlist:
free(p_charbuf);
break;
+ case MPD_API_SAVE_QUEUE:
+ p_charbuf = strdup(c->content);
+ if(strcmp(strtok(p_charbuf, ","), "MPD_API_SAVE_QUEUE"))
+ goto out_save_queue;
+
+ if((token = strtok(NULL, ",")) == NULL)
+ goto out_save_queue;
+
+ mpd_run_save(mpd.conn, token);
+out_save_queue:
+ free(p_charbuf);
+ break;
case MPD_API_SEARCH:
p_charbuf = strdup(c->content);
if(strcmp(strtok(p_charbuf, ","), "MPD_API_SEARCH"))