function NetPlayer_LoadFiles ($cd_path) { //Get Directory to Load SetValue(NP_ID_CDDIRECTORYPATH, $cd_path); // Get PlayList $playlist = array(); NetPlayer_GetPlayList ($cd_path, $playlist); NetPlayer_CopyCoverFile ($cd_path); // Leeren der vorher bestehenden Playlist: $player = NetPlayer_GetIPSComponentPlayer(); $player->ClearPlaylist(); $tracklist = ""; // Durchlaufen des Playlist-Arrays und anhängen an die Mediaplayer-Instanz-Playlist $idx = 1; foreach($playlist as $data) { IPSLogger_Dbg(__file__, "Add File=".$data); $player->AddPlaylist($data); $tracklist.='<tr><td><div id="rc_mp_track'.$idx.'" track="'.$idx.'" class="containerControlTrack">'.convert(basename($data))."</div></td></tr>"; $idx++; } SetValue(NP_ID_CDTRACKLISTHTML, $tracklist); $player->Play(); $Directory = basename($cd_path); SetValue(NP_ID_CDINTERPRET, substr($Directory,0,strpos($Directory, "["))); SetValue(NP_ID_CDALBUM, substr($Directory,strpos($Directory, "[")+1, strpos($Directory, "]")-strpos($Directory, "[")-1)); }
function NetPlayer_RefreshTrackListValue() { $currentIdx = -1; $player = NetPlayer_GetIPSComponentPlayer(); $currentName = $player->GetTrackName(); $currentName = NetPlayer_GetTrackName($currentName); $currentName = str_replace(GetValue(NP_ID_CDINTERPRET).' - ', '', $currentName); $profileData = IPS_GetVariableProfile('NetPlayer_CDTrackList'); $associations = $profileData['Associations']; foreach ($associations as $idx=>$data) { IPSLogger_Trc(__file__, "Idx=$idx, '$currentName' --> '".$data['Name']."'"); if ($currentName == $data['Name']) { $currentIdx = $data['Value']; } } if (GetValue(NP_ID_CDTRACKLIST)<>$currentIdx ) { SetValue(NP_ID_CDTRACKLIST, $currentIdx); } }
$player = NetPlayer_GetIPSComponentPlayer(); $titel = $player->GetTrackName(); //$titel = NetPlayer_GetMediaPlayerValue("Titel"); $Interpret = GetValue(NP_ID_CDINTERPRET); $titel = str_replace(trim($Interpret, " "), "", $titel); $titel = trim ($titel,"? -"); $titel = trim ($titel," -"); echo htmlentities(html_entity_decode($titel), ENT_COMPAT, 'ISO-8859-1'); } else if ($id=="rc_mp_current") { echo NetPlayer_GetIPSComponentPlayer()->GetTrackPosition(); //echo NetPlayer_GetMediaPlayerValue('Titelposition'); } else if ($id=="rc_mp_status") { echo GetValue(NP_ID_CONTROL); //echo NetPlayer_GetMediaPlayerValue('Status'); } else if ($id=="rc_mp_length") { echo NetPlayer_GetIPSComponentPlayer()->GetTrackLength(); //echo NetPlayer_GetMediaPlayerValue('Titellänge'); } else if ($id=="rc_mp_interpret") { echo htmlentities(GetValue(NP_ID_CDINTERPRET), ENT_COMPAT, 'ISO-8859-1'); } else if ($id=="rc_mp_album") { echo htmlentities(GetValue(NP_ID_CDALBUM), ENT_COMPAT, 'ISO-8859-1'); // Mediaplayer Source } else if ($id=="rc_mp_player") { NetPlayer_SwitchToMP3Player(); } else if ($id=="rc_mp_select") { NetPlayer_SwitchToMP3Selection(); } else if ($id=="rc_mp_radio") { NetPlayer_SwitchToRadio(); // CD Selection - List CDs in MP3 Repository
function NetPlayer_Power($value) { // Set Power State if ($value != GetValue(NP_ID_POWER)) { SetValue(NP_ID_POWER, $value); NetPlayer_RefreshRemoteControl(); } $plaverState = GetValue(NP_ID_CONTROL); // Set Player Control if ($value and $plaverState<>NP_IDX_CONTROLPLAY) { IPSLogger_Trc(__file__, 'Start Netplayer'); SetValue(NP_ID_CONTROL, NP_IDX_CONTROLPLAY); NetPlayer_GetIPSComponentPlayer()->Play(); } if (!$value and $plaverState<>NP_IDX_CONTROLSTOP) { IPSLogger_Trc(__file__, 'Stop Netplayer'); SetValue(NP_ID_CONTROL, NP_IDX_CONTROLSTOP); NetPlayer_GetIPSComponentPlayer()->Stop(); } }