Add services discovery handling in http interface.
authorAntoine Cellerier <dionoea@videolan.org>
Sat, 18 Mar 2006 00:29:57 +0000 (00:29 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Sat, 18 Mar 2006 00:29:57 +0000 (00:29 +0000)
share/http/dialogs/playlist
share/http/images/sd.png [new file with mode: 0644]
share/http/js/functions.js
share/http/requests/status.xml
share/http/style.css

index 40ba0a0..4eb89f5 100644 (file)
@@ -65,6 +65,16 @@ This dialog needs the following dialogs to be fully functional: <none>
         <button onclick="pl_sort(0,1);hide_menu('menu_sort');" onmouseover="button_over(this);" onmouseout="button_out_menu(this);" title="Sort by Id descending" >Id reverse</button><br/>
       </div>
     </button>
+    <button id="btn_sd" onmouseover="show_menu('menu_sd');" onmouseout="hide_menu('menu_sd');" title="Services Discovery" >
+      <img src="images/sd.png" alt="Services Discovery" />
+      <span class="btn_text">Services Discovery</span>
+      <div id="menu_sd" class="menu" >
+        <vlc id="rpn" param1="services_discovery" />
+        <vlc id="foreach" param1="sd" param2="object" />
+        <button onclick="pl_sd('<vlc id="value" param1="sd" />');hide_menu('menu_sd');" onmouseover="button_over(this);" onmouseout="button_out_menu(this);" title="<vlc id="value" param1="sd.name" />" ><vlc id="value" param1="sd.name" /></button><br/>
+        <vlc id="end" />
+      </div>
+    </button>
   </div>
   <div id="playtree">
     (?)
diff --git a/share/http/images/sd.png b/share/http/images/sd.png
new file mode 100644 (file)
index 0000000..6e72704
Binary files /dev/null and b/share/http/images/sd.png differ
index 0e3d06c..5bab869 100644 (file)
@@ -330,6 +330,10 @@ function pl_repeat()
 {
     loadXMLDoc( 'requests/status.xml?command=pl_repeat', parse_status );
 }
+function pl_sd( value )
+{
+    loadXMLDoc( 'requests/status.xml?command=pl_sd&val='+value, parse_status );
+}
 
 /* misc actions */
 function volume_down()
index 4f5f931..5ee7a05 100644 (file)
   <vlc id="if" param1="command value 'pl_repeat' strcmp 0 =" />
     <vlc id="rpn" param1="'repeat' 'VLC_OBJECT_PLAYLIST' vlc_var_get 1 + 2 % 'repeat' 'VLC_OBJECT_PLAYLIST' vlc_var_set" />
   <vlc id="end" />
+  <vlc id="if" param1="command value 'pl_sd' strcmp 0 =" />
+    <vlc id="if" param1="val value services_discovery_is_loaded" />
+      <vlc id="rpn" param1="val value services_discovery_remove" />
+    <vlc id="else" />
+      <vlc id="rpn" param1="val value services_discovery_add" />
+    <vlc id="end" />
+  <vlc id="end" />
 
   <!-- misc commands -->
   <vlc id="if" param1="command value 'fullscreen' strcmp 0 =" />
index 0b35346..56d4a30 100644 (file)
@@ -124,6 +124,9 @@ div#infotree dt {
        text-decoration: underline;
 }
 
+div#playtree {
+       min-height: 150px;
+}
 div.pl_node {
        padding-left: 20px;
        font-style: italic;