function rp_addPlay($path, $mpd, $pos)
{
    $song = parseFileStr($path, "/");
    $ramplaypath = "ramplay/" . $song;
    $_SESSION['DEBUG'] .= "rp_addPlay:{$id} {$song} {$path} {$pos}|";
    addQueue($mpd, $ramplaypath);
    sendMpdCommand($mpd, 'play ' . $pos);
}
Beispiel #2
0
         echo json_encode(addQueue($mpd, $_POST['path']));
     }
     break;
 case 'addplay':
     if (isset($_POST['path']) && $_POST['path'] != '') {
         $status = _parseStatusResponse(MpdStatus($mpd));
         $pos = $status['playlistlength'];
         addQueue($mpd, $_POST['path']);
         sendMpdCommand($mpd, 'play ' . $pos);
         echo json_encode(readMpdResponse($mpd));
     }
     break;
 case 'addreplaceplay':
     if (isset($_POST['path']) && $_POST['path'] != '') {
         sendMpdCommand($mpd, 'clear');
         addQueue($mpd, $_POST['path']);
         sendMpdCommand($mpd, 'play');
         echo json_encode(readMpdResponse($mpd));
     }
     break;
 case 'update':
     if (isset($_POST['path']) && $_POST['path'] != '') {
         sendMpdCommand($mpd, "update \"" . html_entity_decode($_POST['path']) . "\"");
         echo json_encode(readMpdResponse($mpd));
     }
     break;
 case 'trackremove':
     if (isset($_GET['songid']) && $_GET['songid'] != '') {
         echo json_encode(remTrackQueue($mpd, $_GET['songid']));
     }
     break;