Esempio n. 1
0
if ($terminal['PLAYER_PASSWORD'] == '') {
    $terminal['PLAYER_PASSWORD'] = NULL;
}
include 'mpd.class.php';
if (!$terminal['PLAYER_PORT']) {
    $terminal['PLAYER_PORT'] = 6600;
}
if (!$terminal['HOST']) {
    $terminal['HOST'] = 'localhost';
}
$mpd = new mpd($terminal['HOST'], $terminal['PLAYER_PORT'], $terminal['PLAYER_PASSWORD']);
if ($mpd->connected) {
    if ($command == 'refresh') {
        $mpd->PLClear();
        $mpd->DBRefresh();
        $path = preg_replace('/\\\\$/is', '', $out['PLAY']);
        $db = SQLSelect("SELECT * FROM collections ORDER BY TITLE");
        $total = count($db);
        for ($i = 0; $i < $total; $i++) {
            if ($db[$i][PATH][0] == '/') {
                $path = str_replace($db[$i][PATH], '', $path);
                break;
            }
        }
        $path = str_replace('\\', '/', $path);
        $path = str_replace('./', '', $path);
        $mpd->PLAdd($path);
        $mpd->Play();
    }
    if ($command == 'pause') {
Esempio n. 2
0
<?php
include "mpd.class.php";
$inst = new mpd("127.0.0.1", 6600);

$inst->Stop();
$inst->DBRefresh();
//$inst->PLClear();
$inst->PLAdd($_GET["file"]);
$inst->Play();
$inst->Next();