Esempio n. 1
0
                 $addArr[] = $addRow['file'];
             }
             $mpd->PLAddBulk($addArr);
             break;
         } else {
             $songs = explode(',', $object);
             $mpd->PLAddBulk($songs);
             break;
         }
     }
     $mpd->SendCommand('update');
     header('Location: ./#current');
 }
 switch ($_GET['a']) {
     case 'volup':
         $mpd->AdjustVolume($volUpSteps);
         break;
     case 'voldown':
         $mpd->AdjustVolume('-' . $volDownSteps);
         break;
     case 'play':
         $mpd->Play();
         header('Location: ./#current');
         break;
     case 'pause':
         $mpd->Pause();
         header('Location: ./#current');
         break;
     case 'prev':
         $mpd->Previous();
         header('Location: ./#current');
Esempio n. 2
0
    $Mpd->Stop();
}
if ($_GET["action"] == "next") {
    $Mpd->Next();
}
if ($_GET["action"] == "previous") {
    $Mpd->Previous();
}
if ($_GET["action"] == "totalqueue") {
    echo "Playlist ";
    echo "<br />";
    echo $playlistcount . " songs";
}
if ($_GET["action"] == "play") {
    if (preg_match('/^\\d+$/', $_GET["num"])) {
        $Mpd->SkipTo($_GET["num"]);
    }
}
if ($_GET["action"] == "volume") {
    if (!$_GET["set"]) {
        if ($Mpd->volume != -1) {
            echo $Mpd->volume;
        } else {
            echo "N/A";
        }
    } elseif ($_GET["set"] == "up") {
        $Mpd->AdjustVolume(+5);
    } elseif ($_GET["set"] == "down") {
        $Mpd->AdjustVolume(-5);
    }
}
Esempio n. 3
0
BLK1;
require_once 'mpd-class/mpd.class.php';
$mpd = new mpd($host, $port, $password);
if (isset($_GET['pause'])) {
    $mpd->Pause();
} elseif (isset($_GET['prev'])) {
    $mpd->Previous();
} elseif (isset($_GET['play'])) {
    $mpd->Play();
} elseif (isset($_GET['next'])) {
    $mpd->Next();
} elseif (isset($_GET['stop'])) {
    $mpd->Stop();
} elseif (isset($_GET['voldn'])) {
    $mpd->AdjustVolume(-5);
} elseif (isset($_GET['volup'])) {
    $mpd->AdjustVolume(+5);
} elseif (isset($_GET['stovr'])) {
    $mpd->SeekTo(0);
}
switch ($mpd->state) {
    case MPD_STATE_PLAYING:
        $stat = 'Playing: ';
        break;
    case MPD_STATE_STOPPED:
        $stat = 'Stopped';
        break;
    case MPD_STATE_PAUSED:
        $stat = 'Paused: ';
        break;