Warum nicht einfach "Klartext" senden (itunes/volume=50)
Der Wert 50 ist halt dynamisch - kann zwischen 0 und 100 liegen … den kann ich nicht hardcodieren ...
Hier der HTTP von EDOMI an MBP (Apache):
Code:
http://10.0.100.150/~dariusz/iControl.php?[B]c[/B]=[COLOR=#FF0000]apvolume[/COLOR]&[B]p1[/B]=Computer&[B]p2[/B]=30
Und hier der PHP am MBP:
Code:
<head> </head> <body> <? $command = $_GET['[B]c[/B]']; $[COLOR=#0000FF]par1[/COLOR] = $_GET['[B]p1[/B]']; $[COLOR=#0000FF]par2[/COLOR] = $_GET['[B]p2[/B]']; switch ($command) { break; case "play": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/iTunesPlay.scpt"); echo "Playing"; break; case "pause": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/iTunesPause.scpt"); echo "Pausing"; break; case "next": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/iTunesSkipForward.scpt"); echo "Next Track"; break; case "prev": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/iTunesSkipBack.scpt"); echo "Previous Track"; break; case "stop": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/iTunesStop.scpt"); echo "iTunes Stop"; break; case "playpause": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/iTunesPlayPause.scpt"); echo "iTunes PlayPause"; break; case "apdevice": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/ApSpeakerOnOff.scpt $par1"); echo "Turning AP Speaker $par1 OnOff"; break; case "[COLOR=#FF0000]apvolume[/COLOR]": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/SetApDeviceVolumeEDOMI.scpt $[COLOR=#0000FF][B]par1[/B][/COLOR] $[COLOR=#0000FF][B]par2[/B][/COLOR]"); echo "Set AP Speaker Volume $par1 to $par2"; break; case "equalizer": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/SetEQPreset.scpt $par1"); echo "Select Equalizer $par1"; break; case "playlist": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/SetPlayList.scpt '$par1'"); echo "Play Playlist $par1"; break; case "mainvolume": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/SetMasterVolume.scpt '$par1'"); echo "Set Main Volume to $par1"; break; case "mainlouder": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/SetMasterVolumePlus.scpt"); echo "Turning Up Main Volume"; break; case "mainquieter": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/SetMasterVolumeMinus.scpt"); echo "Turning Down Main Volume"; break; case "aplouder": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/SetApDeviceVolumePlus.scpt '$par1'"); echo "Turning Up AP Volume"; break; case "apquieter": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/SetMasterVolumeMinus.scpt '$par1'"); echo "Turning Down AP Volume"; break; case "mute": exec("osascript /Applications/MiniMMC/HsRepeat/TriggeredScripts/ApSpeakerMute.scpt '$par1'"); echo "Mute $par1"; break; case "shutdown": exec("osascript -e 'tell app \"System Events\"' -e 'shut down' -e 'end tell'"); echo "Shutting down..."; break; case "sleep": exec("osascript -e 'tell app \"System Events\"' -e 'sleep' -e 'end tell'"); echo "Sending to sleep..."; break; case "restart": exec("osascript -e 'tell app \"System Events\"' -e 'restart' -e 'end tell'"); echo "Restarting..."; break; case "dencom": exec("osascript /Applications/MiniMMC/HsRepeat/HsDenonSet.app $par1 '$par2'"); echo "Denon AVR: $par1 $par2"; break; case "onkcom": exec("osascript /Applications/MiniMMC/HsRepeat/HsOnkyoSet.app $par1 '$par2'"); echo "Onkyo AVR: $par1 $par2"; break; } ?> </body>
Kommentar