diff --git a/3rdparty/mmu_man/onlinedemo/haiku.php b/3rdparty/mmu_man/onlinedemo/haiku.php index 630cf134de..a708781495 100755 --- a/3rdparty/mmu_man/onlinedemo/haiku.php +++ b/3rdparty/mmu_man/onlinedemo/haiku.php @@ -379,7 +379,7 @@ function output_options_form() echo "\n\n"; - $enable_sound = 0; + $enable_sound = 1; echo ""; @@ -490,9 +490,18 @@ function start_qemu() return $idx; } $pidfile = make_qemu_pidfile_name($idx); - $cmd = QEMU_BIN . " " . QEMU_ARGS; + $cmd = ''; + if (isset($_GET['sound'])) { + $cmd .= "QEMU_AUDIO_DRV=twolame "; + //$cmd .= "QEMU_TWOLAME_SAMPLES=" . 4096 . " "; + $cmd .= "QEMU_TWOLAME_PORT=" . audio_port() . " "; + } + $cmd .= QEMU_BIN . " " . QEMU_ARGS; if ($cpucount > 1) $cmd .= " -smp " . $cpucount; + if (isset($_GET['sound'])) { + $cmd .= " -soundhw hda"; + } if (isset($_GET['serial'])) { $cmd .= " -serial telnet::"; $cmd .= (SERIALPORTBASE + qemu_slot()); @@ -582,6 +591,9 @@ function output_vnc_info_file() if (!is_my_session_valid()) die("Bad request"); + header("Pragma: public"); + header("Expires: 0"); + header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-type: application/x-vnc"); header('Content-Disposition: attachment; filename="onlinedemo.vnc"'); @@ -598,40 +610,89 @@ function output_vnc_info_file() function output_audio_player_code($external_only=false) { - if (true) + if (!isset($_GET['sound'])) return; $port = audio_port(); $url = "http://" . $_SERVER['HTTP_HOST'] . ":$port/"; $icy = "icy://" . $_SERVER['HTTP_HOST'] . ":$port/"; + $use_html5 = true; + if (!$external_only) { - echo ""; + if ($use_html5) { + echo ""; + } } out("You can use an external audio play at " . - "$url or $icy, or use " . - "this playlist."); + "$url or $icy, or use one of the playlists: " . + "[M3U] " . + "[PLS]"); } -function output_audio_player_file() +function output_audio_player_file_m3u() { if (!is_my_session_valid()) die("Bad request"); + header("Pragma: public"); + header("Expires: 0"); + header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-type: audio/x-mpegurl"); //header("Content-type: text/plain"); - //header('Content-Disposition: attachment; filename="onlinedemo.m3u"'); + header('Content-Disposition: attachment; filename="onlinedemo.m3u"'); $port = audio_port(); $url = "http://" . $_SERVER['HTTP_HOST'] . ":$port/"; - //echo "#EXTM3U\n"; - //echo "#EXTINF:0," . PAGE_TITLE . "\n"; + // cf. http://hanna.pyxidis.org/tech/m3u.html + echo "#EXTM3U\n"; + echo "#EXTINF:0," . PAGE_TITLE . "\n"; echo "$url\n"; //echo "\n"; } +function output_audio_player_file_pls() +{ + if (!is_my_session_valid()) + die("Bad request"); + + header("Pragma: public"); + header("Expires: 0"); + header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); + header("Content-type: audio/x-scpls"); + //header("Content-type: text/plain"); + header('Content-Disposition: attachment; filename="onlinedemo.pls"'); + + $port = audio_port(); + $url = "http://" . $_SERVER['HTTP_HOST'] . ":$port/"; + + echo "[playlist]\n"; + echo "numberofentries=1\n"; + echo "File1=$url\n"; + echo "Title1=" . PAGE_TITLE . "\n"; + echo "Length1=-1\n"; + echo "version=2\n"; + //echo "\n"; +} + function output_applet_code($external_only=false) { $w = APPLET_WIDTH; @@ -710,8 +771,11 @@ if (isset($_GET['getfile'])) { case "vncinfo": output_vnc_info_file(); break; + case "audiom3u": + output_audio_player_file_m3u(); + break; case "audiopls": - output_audio_player_file(); + output_audio_player_file_pls(); break; default: die("Bad request"); @@ -739,7 +803,7 @@ if (isset($_GET['frame'])) {} <?php echo PAGE_TITLE; ?> - +