From 909aedf9de6444a79a281d788cfe80fa14b5c4c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Teuli=C3=A8re?= Date: Mon, 9 Aug 2004 22:19:40 +0000 Subject: [PATCH] * skins2: support playlist.setRandom(true) and playlist.setRandom(false) --- doc/skins/skins2-howto.xml | 8 ++++++++ modules/gui/skins2/commands/cmd_playlist.cpp | 12 ++++++++++++ modules/gui/skins2/commands/cmd_playlist.hpp | 20 ++++++++++++++++++++ modules/gui/skins2/parser/interpreter.cpp | 4 ++++ 4 files changed, 44 insertions(+) diff --git a/doc/skins/skins2-howto.xml b/doc/skins/skins2-howto.xml index 94315dc057..3d7c57b4ce 100644 --- a/doc/skins/skins2-howto.xml +++ b/doc/skins/skins2-howto.xml @@ -747,6 +747,14 @@ difficulty to understand how VLC skins work. playlist.setLoop(false): Do not loop at playlist end. + WindowID.show(): Show the Window whose id attribute is 'WindowID'. diff --git a/modules/gui/skins2/commands/cmd_playlist.cpp b/modules/gui/skins2/commands/cmd_playlist.cpp index b5a772d256..04a9afb698 100755 --- a/modules/gui/skins2/commands/cmd_playlist.cpp +++ b/modules/gui/skins2/commands/cmd_playlist.cpp @@ -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); + } +} + diff --git a/modules/gui/skins2/commands/cmd_playlist.hpp b/modules/gui/skins2/commands/cmd_playlist.hpp index 8c663e3dc1..2f56721714 100755 --- a/modules/gui/skins2/commands/cmd_playlist.hpp +++ b/modules/gui/skins2/commands/cmd_playlist.hpp @@ -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 diff --git a/modules/gui/skins2/parser/interpreter.cpp b/modules/gui/skins2/parser/interpreter.cpp index 19a28ad4b1..a3a9163726 100644 --- a/modules/gui/skins2/parser/interpreter.cpp +++ b/modules/gui/skins2/parser/interpreter.cpp @@ -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 ) -- 2.39.2