Beispiel #1
0
/**
 * Returns the currently playing tracks path so we can get the node
 * 
 * @author Ross Carlson
 * @version 2/9/05
 * @since 2/9/05
 * @param return Returns the currently playling track's path
 */
function getCurTrackPath()
{
    global $jbArr, $media_dirs;
    $myMpd = _mpdConnection();
    if (isset($jbArr[$_SESSION['jb_id']]['prefix']) && $jbArr[$_SESSION['jb_id']]['prefix'] == "http") {
        $id = getTrackIdFromURL($myMpd->playlist[$myMpd->current_track_id]['file']);
        $track = new jzMediaTrack($id, "id");
        return $track->getFilename("server");
    }
    $num = getCurPlayingTrack();
    $pArray = $myMpd->GetPlaylist();
    if (false === stristr($media_dirs, "|")) {
        $base = $media_dirs . "/";
    } else {
        $base = "";
    }
    return $base . $pArray[$num]['file'];
}