Commit 909aedf9 authored by Olivier Teulière's avatar Olivier Teulière

* skins2: support playlist.setRandom(true) and playlist.setRandom(false)

parent 81cc781d
......@@ -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>
......
......@@ -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);
}
}
......@@ -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
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment