]> git.sesse.net Git - vlc/commitdiff
"[PATCH] http interface : fix the shuffle/loop/repeat buttons" by Laurent Mutricy
authorAntoine Cellerier <dionoea@videolan.org>
Wed, 15 Mar 2006 19:33:10 +0000 (19:33 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Wed, 15 Mar 2006 19:33:10 +0000 (19:33 +0000)
share/http/js/functions.js
share/http/requests/status.xml

index f0b2bd1b2ee48ec570dd9d70fb42156cc5206a6f..78d6b1bd0571be46179b188be5117642b23ae78b 100644 (file)
@@ -433,6 +433,21 @@ function parse_status()
                 document.getElementById( 'btn_pause' ).setAttribute( 'title', 'Play' );
             }
 
+            if( status.getElementsByTagName( 'random' )[0].firstChild.data == "1" )
+                document.getElementById( 'btn_shuffle').style.background = 'rgb( 170, 170, 170 )';
+            else
+                document.getElementById( 'btn_shuffle').style.background = '';
+
+            if( status.getElementsByTagName( 'loop' )[0].firstChild.data == "1" )
+                document.getElementById( 'btn_loop').style.background = 'rgb( 170, 170, 170 )';
+            else
+                document.getElementById( 'btn_loop').style.background = '';
+
+            if( status.getElementsByTagName( 'repeat' )[0].firstChild.data == "1" )
+                document.getElementById( 'btn_repeat').style.background = 'rgb( 170, 170, 170 )';
+            else
+                document.getElementById( 'btn_repeat').style.background = '';
+
             var tree = document.createElement( "ul" );
             var categories = status.getElementsByTagName( 'category' );
             var i;
index 334b6d14dc48180f460f7813d0c57a67c9c05293..a0f70e5c0bd432a74be96d804defa52c6c0eec49 100644 (file)
     <vlc id="rpn" param1="" /> <!-- FIXME -->
   <vlc id="end" />
   <vlc id="if" param1="command value 'pl_random' strcmp 0 =" />
-    <vlc id="rpn" param1="'random' 'VLC_OBJECT_PLAYLIST' vlc_var_get ! 'random' 'VLC_OBJECT_PLAYLIST' vlc_var_set" />
+    <vlc id="rpn" param1="'random' 'VLC_OBJECT_PLAYLIST' vlc_var_get 1 + 2 % 'random' 'VLC_OBJECT_PLAYLIST' vlc_var_set" />
   <vlc id="end" />
   <vlc id="if" param1="command value 'pl_loop' strcmp 0 =" />
-    <vlc id="rpn" param1="'loop' 'VLC_OBJECT_PLAYLIST' vlc_var_get ! 'loop' 'VLC_OBJECT_PLAYLIST' vlc_var_set" />
+    <vlc id="rpn" param1="'loop' 'VLC_OBJECT_PLAYLIST' vlc_var_get 1 + 2 %  'loop' 'VLC_OBJECT_PLAYLIST' vlc_var_set" />
   <vlc id="end" />
   <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" />
@@ -99,7 +99,8 @@
   <state><vlc id="value" param1="stream_state" /></state>
   <position><vlc id="value" param1="stream_position" /></position>
   <fullscreen><vlc id="if" param1="'VLC_OBJECT_VOUT' vlc_obj_exists" /><vlc id="value" param1="'fullscreen' 'VLC_OBJECT_VOUT' vlc_var_get" /><vlc id="end" /></fullscreen>
-  <loop><vlc id="value" param1="'loop' 'VLC_OBJECT_PLAYLIST' vlc_var_get"/></loop>
+  <random><vlc id="value" param1="'random' 'VLC_OBJECT_PLAYLIST' vlc_var_get" /></random>
+  <loop><vlc id="value" param1="'loop' 'VLC_OBJECT_PLAYLIST' vlc_var_get" /></loop>
   <repeat><vlc id="value" param1="'repeat' 'VLC_OBJECT_PLAYLIST' vlc_var_get" /></repeat>
   <information>
     <vlc id="foreach" param1="inf" param2="information" />