]> git.sesse.net Git - vlc/commitdiff
* skins2: support playlist.setRandom(true) and playlist.setRandom(false)
authorOlivier Teulière <ipkiss@videolan.org>
Mon, 9 Aug 2004 22:19:40 +0000 (22:19 +0000)
committerOlivier Teulière <ipkiss@videolan.org>
Mon, 9 Aug 2004 22:19:40 +0000 (22:19 +0000)
doc/skins/skins2-howto.xml
modules/gui/skins2/commands/cmd_playlist.cpp
modules/gui/skins2/commands/cmd_playlist.hpp
modules/gui/skins2/parser/interpreter.cpp

index 94315dc0579bfd95f544b3959ed10738146cc879..3d7c57b4ce839cbb86f1041fa2316f1fd8c98373 100644 (file)
@@ -747,6 +747,14 @@ difficulty to understand how VLC skins work.</para>
   <listitem><para>
     <emphasis>playlist.setLoop(false)</emphasis>: Do not loop at playlist end.
   </para></listitem>
+<!--  TODO: Enable it for 0.7.3
+  <listitem><para>
+    <emphasis>playlist.setRepeat(true)</emphasis>: Repeat the current playlist item.
+  </para></listitem>
+  <listitem><para>
+    <emphasis>playlist.setRepeat(false)</emphasis>: Stop repeating the current playlist item.
+  </para></listitem>
+-->
   <listitem><para>
     <emphasis>WindowID.show()</emphasis>: Show the <link linkend="Window">Window</link> whose <link linkend="windowid">id</link> attribute is 'WindowID'.
   </para></listitem>
index b5a772d2562deb6fef08149a67ddc76e06ccf369..04a9afb6987de5e321f2f5e4b85cf28020e9fe0e 100755 (executable)
@@ -88,3 +88,15 @@ void CmdPlaylistLoop::execute()
     }
 }
 
+
+void CmdPlaylistRepeat::execute()
+{
+    playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
+    if( pPlaylist != NULL )
+    {
+        vlc_value_t val;
+        val.b_bool = m_value;
+        var_Set( pPlaylist , "repeat", val);
+    }
+}
+
index 8c663e3dc1da748da4859a7b757dfd109ca362f0..2f567217140ab6178571960e5d065b2e43c42bc2 100755 (executable)
@@ -78,6 +78,7 @@ class CmdPlaylistRandom: public CmdGeneric
         bool m_value;
 };
 
+
 /// Command to set the loop state
 class CmdPlaylistLoop: public CmdGeneric
 {
@@ -98,5 +99,24 @@ class CmdPlaylistLoop: public CmdGeneric
 };
 
 
+/// Command to set the repeat state
+class CmdPlaylistRepeat: public CmdGeneric
+{
+    public:
+        CmdPlaylistRepeat( intf_thread_t *pIntf, bool value ):
+            CmdGeneric( pIntf ), m_value( value ) {}
+        virtual ~CmdPlaylistRepeat() {}
+
+        /// This method does the real job of the command
+        virtual void execute();
+
+        /// Return the type of the command
+        virtual string getType() const { return "playlist repeat"; }
+
+    private:
+        /// Repeat state
+        bool m_value;
+};
+
 
 #endif
index 19a28ad4b12a66e9d2c9ee5613db4675220cb77e..a3a916372606b4ab05c3a9e5a4a77342dda36759 100644 (file)
@@ -70,6 +70,10 @@ Interpreter::Interpreter( intf_thread_t *pIntf ): SkinObject( pIntf )
         CmdGenericPtr( new CmdPlaylistLoop( getIntf(), true ) );
     m_commandMap["playlist.setLoop(false)"] =
         CmdGenericPtr( new CmdPlaylistLoop( getIntf(), false ) );
+    m_commandMap["playlist.setRepeat(true)"] =
+        CmdGenericPtr( new CmdPlaylistRepeat( getIntf(), true ) );
+    m_commandMap["playlist.setRepeat(false)"] =
+        CmdGenericPtr( new CmdPlaylistRepeat( getIntf(), false ) );
     REGISTER_CMD( "vlc.fullscreen()", CmdFullscreen )
     REGISTER_CMD( "vlc.play()", CmdPlay )
     REGISTER_CMD( "vlc.pause()", CmdPause )