Beispiel #1
0
function getTcmodsConf()
{
    if (false === ($conf = file_get_contents('/var/www/tcmods.conf'))) {
        die('Failed to read tcmods.conf');
    }
    // split config lines
    return parseMpdKeyedResponse($conf, ": ");
}
Beispiel #2
0
 case 'getupnpcoverurl':
     $rtn = sysCmd('upexplorer --album-art "' . $_SESSION['upnp_name'] . '"');
     $res = array('coverurl' => $rtn[0]);
     break;
 case 'readtcmconf':
     $res = getTcmodsConf();
     break;
 case 'updatetcmconf':
     $res = _updTcmodsConf($_POST);
     break;
 case 'getmpdstatus':
     $res = _parseStatusResponse(mpdStatus($mpd));
     break;
 case 'readstationfile':
     // misuse mpd function to split lines
     $res = parseMpdKeyedResponse(file_get_contents(MPD_LIB . $_POST['path']), '=');
     break;
 case 'readplayhistory':
     $res = explode("\n", file_get_contents('/var/www/playhistory.log'));
     break;
     // TC (Tim Curtis) 2015-06-26: TESTING ALSA-Direct volume control, requires www-data user in visudo
 // TC (Tim Curtis) 2015-06-26: TESTING ALSA-Direct volume control, requires www-data user in visudo
 case 'sendalsacmd':
     $mixername = getMixerName(getKernelVer($_SESSION['kernelver']), $_SESSION['i2s']);
     $rtn = sysCmd("sudo " . $_POST['alsacmd'] . " " . $mixername . " " . $_POST['volumelevel'] . $_POST['scale']);
     $res = $rtn[0];
     break;
 default:
     http_reponse_code(500);
     // internal server error
     exit;