Exemple #1
0
function mpdMonitorState($sock)
{
    execMpdCommand($sock, "idle");
    return _parseStatusResponse(mpdStatus($sock));
}
Exemple #2
0
    $audioinfo_hwparams_format .= $_hwparams['rate'] . " kHz";
    $audioinfo_hwparams_calcrate = $_hwparams['calcrate'] . " mbps";
} else {
    $audioinfo_hwparams_format = '';
    $audioinfo_hwparams_calcrate = '0 bps';
}
// INPUT INFO: mpd currentsong and status cmds
if (!$mpd) {
    $audioinfo_mpdstatus = 'Error Connecting to MPD daemon';
} else {
    // mpd currentsong
    $res = execMpdCommand($mpd, 'currentsong');
    $_mpdcurrentsong = _parseMpdCurrentSong($res);
    $audioinfo_mpdcurrentsong_file = $_mpdcurrentsong['file'];
    // mpd status
    $_mpdstatus = _parseStatusResponse(mpdStatus($mpd));
    if ($_hwparams['status'] == 'active') {
        // source format
        $audioinfo_mpdstatus_format = $_mpdstatus['audio_channels'] . ", ";
        // TC (Tim Curtis) 2015-07-31: format when "dsd" (for dsf files)
        $audioinfo_mpdstatus_format .= $_mpdstatus['audio_sample_depth'];
        $audioinfo_mpdstatus_format .= $_mpdstatus['audio_sample_depth'] == "dsd" ? ", " : " bit, ";
        $audioinfo_mpdstatus_format .= $_mpdstatus['audio_sample_rate'] . " kHz";
        // bit rate
        $audioinfo_mpdstatus_bitrate = $_mpdstatus['bitrate'] . " kbps";
    } else {
        $audioinfo_mpdstatus_format = '';
        $audioinfo_mpdstatus_bitrate = "0 bps";
    }
}
// DSP INFO: mpd.conf, configured SRC output format and converter