(not writing); use VarBoolImpl instead to instanciate read/write variables.
Bool variables can now be combined with VarNotBool and VarBoolAndBool
(TODO: VarBoolOrBool)
* commands/cmd_show_window.hpp: the commands now call directly
GenericWindow::show/hide, because the visibility variable of a
window is a VarBool (so, read-only)
* commands/cmd_input.hpp: added Play and Pause commands
* parser/interpreter.cpp: beginning of support of boolean expressions,
like "vlc.isSeekable and not vlc.isStopped" (operator precedence is
not really well handled yet)
* src/vlcproc.*: new variables "vlc.isSeekable", "vlc.isStopped" and
"vlc.isPaused"
* controls/ctrl_checkbox.cpp: the "state" variable of a checkbox is
now a passive VarBool, so actions must be explicitely set with
'action1="..." action2="..."' in the xml file
* removed src/vlcvars.* => "vlc.isMute" doesn't work any more
(anyway it didn't work well...)
* theme/theme.xml: updated with the new VarBool behaviour
vars/time.hpp \
vars/volume.cpp \
vars/volume.hpp \
- vars/vlcvars.cpp \
- vars/vlcvars.hpp \
\
win32/win32_dragdrop.cpp \
win32/win32_dragdrop.hpp \
* cmd_input.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: cmd_input.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
+ * $Id: cmd_input.cpp,v 1.2 2004/01/18 19:54:45 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
#include "cmd_input.hpp"
+void CmdPlay::execute()
+{
+ playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
+ if( pPlaylist == NULL )
+ {
+ return;
+ }
+
+ playlist_Play( pPlaylist );
+}
+
+
+void CmdPause::execute()
+{
+ playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
+ if( pPlaylist == NULL )
+ {
+ return;
+ }
+
+ playlist_Pause( pPlaylist );
+}
+
+
void CmdStop::execute()
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
* cmd_input.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: cmd_input.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
+ * $Id: cmd_input.hpp,v 1.2 2004/01/18 19:54:45 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
#include "cmd_generic.hpp"
/// Commands to control the input
+DEFINE_COMMAND( Play, "play" )
+DEFINE_COMMAND( Pause, "pause" )
DEFINE_COMMAND( Stop, "stop" )
DEFINE_COMMAND( Slower, "slower" )
DEFINE_COMMAND( Faster, "faster" )
* cmd_show_window.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: cmd_show_window.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
+ * $Id: cmd_show_window.hpp,v 1.2 2004/01/18 19:54:45 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
#define CMD_SHOW_WINDOW_HPP
#include "cmd_generic.hpp"
-#include "../utils/var_bool.hpp"
+#include "../src/generic_window.hpp"
-template<bool newValue> class CmdShowHideWindow;
+/// Command to show a window
+class CmdShowWindow: public CmdGeneric
+{
+ public:
+ CmdShowWindow( intf_thread_t *pIntf, GenericWindow &rWin ):
+ CmdGeneric( pIntf ), m_rWin( rWin ) {}
+ virtual ~CmdShowWindow() {}
-typedef CmdShowHideWindow<true> CmdShowWindow;
-typedef CmdShowHideWindow<false> CmdHideWindow;
+ /// This method does the real job of the command
+ virtual void execute() { m_rWin.show(); }
+ /// Return the type of the command
+ virtual string getType() const { return "show window"; }
-/// "Show/Hide window" command
-template<bool newValue>
-class CmdShowHideWindow: public CmdGeneric
+ private:
+ /// Reference to the window
+ GenericWindow &m_rWin;
+};
+
+
+/// Command to hide a window
+class CmdHideWindow: public CmdGeneric
{
public:
- CmdShowHideWindow( intf_thread_t *pIntf, VarBool &rVariable ):
- CmdGeneric( pIntf ), m_rVariable( rVariable ) {}
- virtual ~CmdShowHideWindow() {}
+ CmdHideWindow( intf_thread_t *pIntf, GenericWindow &rWin ):
+ CmdGeneric( pIntf ), m_rWin( rWin ) {}
+ virtual ~CmdHideWindow() {}
/// This method does the real job of the command
- virtual void execute() { m_rVariable.set( newValue ); }
+ virtual void execute() { m_rWin.hide(); }
/// Return the type of the command
- virtual string getType() const { return "show/hide window"; }
+ virtual string getType() const { return "hide window"; }
private:
- /// Reference to the observed variable
- VarBool &m_rVariable;
+ /// Reference to the window
+ GenericWindow &m_rWin;
};
+
#endif
* ctrl_checkbox.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: ctrl_checkbox.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
+ * $Id: ctrl_checkbox.cpp,v 1.2 2004/01/18 19:54:46 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
pThis->releaseMouse();
// Invert the state variable
- pThis->m_rVariable.set( !pThis->m_rVariable.get() );
pThis->m_pImgCurrent = pThis->m_pImgUp;
pThis->notifyLayout();
* interpreter.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: interpreter.cpp,v 1.3 2004/01/11 17:12:17 asmax Exp $
+ * $Id: interpreter.cpp,v 1.4 2004/01/18 19:54:46 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
#include "../commands/cmd_quit.hpp"
#include "../commands/cmd_input.hpp"
#include "../commands/cmd_fullscreen.hpp"
+#include "../commands/cmd_show_window.hpp"
#include "../src/theme.hpp"
#include "../src/var_manager.hpp"
#include "../src/vlcproc.hpp"
-#include "../vars/playlist.hpp"
-#include "../vars/vlcvars.hpp"
-#include "../vars/time.hpp"
-#include "../vars/volume.hpp"
Interpreter::Interpreter( intf_thread_t *pIntf ): SkinObject( pIntf )
REGISTER_CMD( "playlist.previous()", CmdPlaylistPrevious )
REGISTER_CMD( "playlist.sort()", CmdPlaylistSort )
REGISTER_CMD( "vlc.fullscreen()", CmdFullscreen )
+ REGISTER_CMD( "vlc.play()", CmdPlay )
+ REGISTER_CMD( "vlc.pause()", CmdPause )
REGISTER_CMD( "vlc.quit()", CmdQuit )
REGISTER_CMD( "vlc.faster()", CmdFaster )
REGISTER_CMD( "vlc.slower()", CmdSlower )
rightPos - (windowId.size() + 11) );
pCommand = new CmdLayout( getIntf(), windowId, layoutId );
}
+ else if( rAction.find( ".show()" ) != string::npos )
+ {
+ int leftPos = rAction.find( ".show()" );
+ string windowId = rAction.substr( 0, leftPos );
+ GenericWindow *pWin = pTheme->getWindowById( windowId );
+ if( pWin )
+ {
+ pCommand = new CmdShowWindow( getIntf(), *pWin );
+ }
+ else
+ {
+ msg_Err( getIntf(), "Unknown window (%s)", windowId.c_str() );
+ }
+ }
+ else if( rAction.find( ".hide()" ) != string::npos )
+ {
+ int leftPos = rAction.find( ".hide()" );
+ string windowId = rAction.substr( 0, leftPos );
+ GenericWindow *pWin = pTheme->getWindowById( windowId );
+ if( pWin )
+ {
+ pCommand = new CmdHideWindow( getIntf(), *pWin );
+ }
+ else
+ {
+ msg_Err( getIntf(), "Unknown window (%s)", windowId.c_str() );
+ }
+ }
if( pCommand )
{
{
return pVar;
}
+ else if( rName.find( " and " ) != string::npos )
+ {
+ int leftPos = rName.find( " and " );
+ string name1 = rName.substr( 0, leftPos );
+ int rightPos = leftPos + 5; // 5 is the size of " and "
+ string name2 = rName.substr( rightPos, rName.size() - rightPos );
+ // Retrive the two boolean variables
+ VarBool *pVar1 = getVarBool( name1, pTheme );
+ VarBool *pVar2 = getVarBool( name2, pTheme );
+ // Create a composite boolean variable
+ if( pVar1 && pVar2 )
+ {
+ VarBool *pNewVar = new VarBoolAndBool( getIntf(), *pVar1, *pVar2 );
+ // Register this variable in the manager
+ pVarManager->registerVar( VariablePtr( pNewVar ), rName );
+ return pNewVar;
+ }
+ else
+ {
+ return NULL;
+ }
+ }
+ else if( rName.find( "not " ) != string::npos )
+ {
+ int rightPos = rName.find( "not " ) + 4;
+ string name = rName.substr( rightPos, rName.size() - rightPos );
+ // Retrive the boolean variable
+ VarBool *pVar = getVarBool( name, pTheme );
+ // Create a composite boolean variable
+ if( pVar )
+ {
+ VarBool *pNewVar = new VarNotBool( getIntf(), *pVar );
+ // Register this variable in the manager
+ pVarManager->registerVar( VariablePtr( pNewVar ), rName );
+ return pNewVar;
+ }
+ else
+ {
+ return NULL;
+ }
+ }
else if( rName.find( ".isVisible" ) != string::npos )
{
int leftPos = rName.find( ".isVisible" );
string windowId = rName.substr( 0, leftPos );
- // XXX Need to check the IDs (isalpha())?
GenericWindow *pWin = pTheme->getWindowById( windowId );
if( pWin )
{
}
else
{
- msg_Warn( getIntf(), "Unknown window (%s)", windowId.c_str() );
+ msg_Err( getIntf(), "Unknown window (%s)", windowId.c_str() );
return NULL;
}
}
* generic_window.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: generic_window.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
+ * $Id: generic_window.hpp,v 1.2 2004/01/18 19:54:46 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
/// Tooltip
Tooltip *m_pTooltip;
/// Variable for the visibility of the window
- VarBool m_varVisible;
+ VarBoolImpl m_varVisible;
/// Method called when the observed variable is modified
virtual void onUpdate( Subject<VarBool> &rVariable );
* vlcproc.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: vlcproc.cpp,v 1.3 2004/01/11 17:12:17 asmax Exp $
+ * $Id: vlcproc.cpp,v 1.4 2004/01/18 19:54:46 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
#include "../commands/async_queue.hpp"
#include "../commands/cmd_notify_playlist.hpp"
#include "../commands/cmd_quit.hpp"
+#include "../utils/var_bool.hpp"
VlcProc *VlcProc::instance( intf_thread_t *pIntf )
// Create and register VLC variables
VarManager *pVarManager = VarManager::instance( getIntf() );
-#define REGISTER_VAR( name, var, type ) \
- name = VariablePtr( new var( getIntf() ) ); \
- pVarManager->registerVar( name, type );
+#define REGISTER_VAR( var, type, name ) \
+ var = VariablePtr( new type( getIntf() ) ); \
+ pVarManager->registerVar( var, name );
REGISTER_VAR( m_cPlaylist, Playlist, "playlist" )
pVarManager->registerVar( getPlaylistVar().getPositionVarPtr(),
"playlist.slider" );
REGISTER_VAR( m_cVarTime, Time, "time" )
REGISTER_VAR( m_cVarVolume, Volume, "volume" )
- REGISTER_VAR( m_cVarMute, VlcIsMute, "vlc.isMute" )
- REGISTER_VAR( m_cVarPlaying, VlcIsPlaying, "vlc.isPlaying" )
- REGISTER_VAR( m_cVarSeekablePlaying, VlcIsSeekablePlaying,
- "vlc.isSeekablePlaying" )
+ REGISTER_VAR( m_cVarMute, VarBoolImpl, "vlc.isMute" ) // XXX broken
+ REGISTER_VAR( m_cVarPlaying, VarBoolImpl, "vlc.isPlaying" )
+ REGISTER_VAR( m_cVarStopped, VarBoolImpl, "vlc.isStopped" )
+ REGISTER_VAR( m_cVarPaused, VarBoolImpl, "vlc.isPaused" )
+ REGISTER_VAR( m_cVarSeekable, VarBoolImpl, "vlc.isSeekable" )
// Called when the playlist changes
var_AddCallback( pIntf->p_sys-> p_playlist, "intf-change",
// Get the VLC variables
Time *pTime = (Time*)m_cVarTime.get();
Volume *pVolume = (Volume*)m_cVarVolume.get();
- VlcIsPlaying *pVarPlaying = (VlcIsPlaying*)m_cVarPlaying.get();
- VarBool *pVarSeekablePlaying = (VarBool*)m_cVarSeekablePlaying.get();
+ VarBoolImpl *pVarPlaying = (VarBoolImpl*)m_cVarPlaying.get();
+ VarBoolImpl *pVarStopped = (VarBoolImpl*)m_cVarStopped.get();
+ VarBoolImpl *pVarPaused = (VarBoolImpl*)m_cVarPaused.get();
+ VarBoolImpl *pVarSeekable = (VarBoolImpl*)m_cVarSeekable.get();
// Refresh sound volume
audio_volume_t volume;
// Get the status of the playlist
playlist_status_t status = getIntf()->p_sys->p_playlist->i_status;
- pVarPlaying->set( status == PLAYLIST_RUNNING, false );
- if( pInput->stream.b_seekable )
- {
- pVarSeekablePlaying->set( status != PLAYLIST_STOPPED );
- }
- else
- {
- pVarSeekablePlaying->set( false );
- }
+ pVarPlaying->set( status == PLAYLIST_RUNNING );
+ pVarStopped->set( status == PLAYLIST_STOPPED );
+ pVarPaused->set( status == PLAYLIST_PAUSED );
+ pVarSeekable->set( pInput->stream.b_seekable );
}
else
{
- pVarPlaying->set( false, false );
- pVarSeekablePlaying->set( false );
+ pVarPlaying->set( false );
+ pVarPaused->set( false );
+ pVarStopped->set( true );
+ pVarSeekable->set( false );
pTime->set( 0, false );
}
}
* vlcproc.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: vlcproc.hpp,v 1.3 2004/01/11 17:12:17 asmax Exp $
+ * $Id: vlcproc.hpp,v 1.4 2004/01/18 19:54:46 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
#include "../vars/playlist.hpp"
#include "../vars/time.hpp"
#include "../vars/volume.hpp"
-#include "../vars/vlcvars.hpp"
class OSTimer;
+class VarBool;
/// Singleton object handling VLC internal state and playlist
/// Getter for the playing variable
VarBool &getIsPlayingVar() { return *((VarBool*)(m_cVarPlaying.get())); }
- /// Getter for the seekable/playing variable
- VarBool &getIsSeekablePlayingVar()
- { return *((VarBool*)(m_cVarSeekablePlaying.get())); }
+ /// Getter for the stopped variable
+ VarBool &getIsStoppedVar() { return *((VarBool*)(m_cVarStopped.get())); }
+
+ /// Getter for the paused variable
+ VarBool &getIsPausedVar() { return *((VarBool*)(m_cVarPaused.get())); }
+
+ /// Getter for the seekable variable
+ VarBool &getIsSeekableVar() { return *((VarBool*)(m_cVarSeekable.get())); }
protected:
// Protected because it is a singleton
VariablePtr m_cVarMute;
/// Variables related to the input
VariablePtr m_cVarPlaying;
- VariablePtr m_cVarSeekablePlaying;
+ VariablePtr m_cVarStopped;
+ VariablePtr m_cVarPaused;
+ VariablePtr m_cVarSeekable;
/// Poll VLC internals to update the status (volume, current time in
/// the stream, current filename, play/pause/stop status, ...)
<Text font="default_font" width="70" x="287" y="79" text="$T"/>\r
<Button x="42" y="42" up="preferences" down="preferences_onclick" over="preferences" action="dialogs.prefs()" tooltiptext="Preferences"/>\r
<Button x="17" y="64" up="stop" down="stop_onclick" over="stop" action="vlc.stop()" tooltiptext="Stop"/>\r
- <CheckBox x="42" y="87" up1="playlist_button" down1="playlist_button_onclick" up2="playlist_button2" down2="playlist_button_onclick2" state="playlist_window.isVisible" tooltiptext1="Show Playlist" tooltiptext2="Hide Playlist"/>\r
- <CheckBox x="83" y="44" up1="play" up2="pause" down1="play_onclick" down2="pause_onclick" state="vlc.isPlaying" tooltiptext1="Play" tooltiptext2="Pause"/>\r
+ <CheckBox x="42" y="87" up1="playlist_button" down1="playlist_button_onclick" up2="playlist_button2" down2="playlist_button_onclick2" state="playlist_window.isVisible" action1="playlist_window.show()" action2="playlist_window.hide()" tooltiptext1="Show Playlist" tooltiptext2="Hide Playlist"/>\r
+ <CheckBox x="83" y="44" up1="play" up2="pause" down1="play_onclick" down2="pause_onclick" state="vlc.isPlaying" action1="vlc.play()" action2="vlc.pause()" tooltiptext1="Play" tooltiptext2="Pause"/>\r
<Button x="159" y="37" up="rev" down="rev_click" over="rev" action="vlc.slower()" tooltiptext="Slower"/>\r
<Button x="159" y="89" up="fast" down="fast_click" over="fast" action="vlc.faster()" tooltiptext="Faster"/>\r
<Button x="196" y="46" up="previous" down="previous_onclick" over="previous" action="playlist.previous()" tooltiptext="Previous Item"/>\r
<Button x="196" y="79" up="next" down="next_onclick" over="next" action="playlist.next()" tooltiptext="Next Item"/>\r
<Button x="8" y="5" up="close" down="close_onclick" over="close_mouseover" action="vlc.quit()" tooltiptext="Quit VLC" help="quit"/>\r
<Image x="29" y="5" image="reduce_disabled"/>\r
- <Slider id="time_slider" x="24" y="130" up="slider" down="slider_onclick" points="(0,0),(366,0)" value="time" visible="vlc.isSeekablePlaying" tooltiptext="Time: $T"/>\r
+ <Slider id="time_slider" x="24" y="130" up="slider" down="slider_onclick" points="(0,0),(366,0)" value="time" visible="vlc.isSeekable and not vlc.isStopped" tooltiptext="Time: $T"/>\r
<Slider id="volume_slider" x="391" y="53" up="slider_volume" down="slider_volume_onclick" points="(0,47),(0,0)" value="volume" tooltiptext="Volume: $V%"/>\r
</Group>\r
</Layout>\r
* var_bool.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: var_bool.cpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
+ * $Id: var_bool.cpp,v 1.3 2004/01/18 19:54:46 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
const string VarBool::m_type = "bool";
-VarBool::VarBool( intf_thread_t *pIntf ): Variable( pIntf ), m_value( false )
+VarBoolImpl::VarBoolImpl( intf_thread_t *pIntf ):
+ VarBool( pIntf ), m_value( false )
{
}
-void VarBool::set( bool value )
+void VarBoolImpl::set( bool value )
{
if( value != m_value )
{
}
}
+
+VarBoolAndBool::VarBoolAndBool( intf_thread_t *pIntf, VarBool &rVar1,
+ VarBool &rVar2 ):
+ VarBool( pIntf ), m_rVar1( rVar1 ), m_rVar2( rVar2 )
+{
+ m_rVar1.addObserver( this );
+ m_rVar2.addObserver( this );
+}
+
+
+VarBoolAndBool::~VarBoolAndBool()
+{
+ m_rVar1.delObserver( this );
+ m_rVar2.delObserver( this );
+}
+
+
+void VarBoolAndBool::onUpdate( Subject<VarBool> &rVariable )
+{
+ notify();
+}
+
+
+VarNotBool::VarNotBool( intf_thread_t *pIntf, VarBool &rVar ):
+ VarBool( pIntf ), m_rVar( rVar )
+{
+ m_rVar.addObserver( this );
+}
+
+
+VarNotBool::~VarNotBool()
+{
+ m_rVar.delObserver( this );
+}
+
+
+void VarNotBool::onUpdate( Subject<VarBool> &rVariable )
+{
+ notify();
+}
+
+
* var_bool.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: var_bool.hpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
+ * $Id: var_bool.hpp,v 1.3 2004/01/18 19:54:46 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
#include "observer.hpp"
-/// Percentage variable
+/// Interface for read-only boolean variable
class VarBool: public Variable, public Subject<VarBool>
{
public:
- VarBool( intf_thread_t *pIntf );
- virtual ~VarBool() {}
-
/// Get the variable type
virtual const string &getType() const { return m_type; }
- /// Set the internal value
- virtual void set( bool value );
- virtual bool get() const { return m_value; }
+ /// Get the boolean value
+ virtual bool get() const = 0;
+
+ protected:
+ VarBool( intf_thread_t *pIntf ): Variable( pIntf ) {}
+ virtual ~VarBool() {}
private:
/// Variable type
static const string m_type;
+};
+
+
+/// Boolean variable implementation (read/write)
+class VarBoolImpl: public VarBool
+{
+ public:
+ VarBoolImpl( intf_thread_t *pIntf );
+ virtual ~VarBoolImpl() {}
+
+ // Get the boolean value
+ virtual bool get() const { return m_value; }
+
+ /// Set the internal value
+ virtual void set( bool value );
+
+ private:
/// Boolean value
bool m_value;
};
+
+/// Conjunction of two boolean variables (AND)
+class VarBoolAndBool: public VarBool, public Observer<VarBool>
+{
+ public:
+ VarBoolAndBool( intf_thread_t *pIntf, VarBool &rVar1, VarBool &rVar2 );
+ virtual ~VarBoolAndBool();
+
+ // Get the boolean value
+ virtual bool get() const { return m_rVar1.get() && m_rVar2.get(); }
+
+ // Called when one of the observed variables is changed
+ void onUpdate( Subject<VarBool> &rVariable );
+
+ private:
+ /// Boolean variables
+ VarBool &m_rVar1, &m_rVar2;
+};
+
+
+/// Negation of a boolean variable (NOT)
+class VarNotBool: public VarBool, public Observer<VarBool>
+{
+ public:
+ VarNotBool( intf_thread_t *pIntf, VarBool &rVar );
+ virtual ~VarNotBool();
+
+ // Get the boolean value
+ virtual bool get() const { return !m_rVar.get(); }
+
+ // Called when the observed variable is changed
+ void onUpdate( Subject<VarBool> &rVariable );
+
+ private:
+ /// Boolean variable
+ VarBool &m_rVar;
+};
+
+
#endif
+++ /dev/null
-/*****************************************************************************
- * vlcvars.cpp
- *****************************************************************************
- * Copyright (C) 2003 VideoLAN
- * $Id: vlcvars.cpp,v 1.1 2004/01/03 23:31:34 asmax Exp $
- *
- * Authors: Cyril Deguet <asmax@via.ecp.fr>
- * Olivier Teulière <ipkiss@via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- *****************************************************************************/
-
-#include "vlcvars.hpp"
-#include <vlc/aout.h>
-
-
-void VlcIsMute::set( bool value )
-{
- VarBool::set( value );
-
- aout_VolumeMute( getIntf(), NULL );
-}
-
-
-void VlcIsPlaying::set( bool value, bool updateVLC )
-{
- VarBool::set( value );
-
- if( !updateVLC )
- {
- return;
- }
-
- if( value )
- {
- //XXX use a command
- playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
- if( pPlaylist == NULL )
- {
- return;
- }
- playlist_Play( pPlaylist );
- }
- else
- {
- //XXX use a command
- playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
- if( pPlaylist == NULL )
- {
- return;
- }
- playlist_Pause( pPlaylist );
- }
-}
+++ /dev/null
-/*****************************************************************************
- * vlcvars.hpp
- *****************************************************************************
- * Copyright (C) 2003 VideoLAN
- * $Id: vlcvars.hpp,v 1.1 2004/01/03 23:31:34 asmax Exp $
- *
- * Authors: Cyril Deguet <asmax@via.ecp.fr>
- * Olivier Teulière <ipkiss@via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- *****************************************************************************/
-
-#ifndef VLCVARS_HPP
-#define VLCVARS_HPP
-
-#include "../utils/var_bool.hpp"
-
-
-class VlcIsMute: public VarBool
-{
- public:
- VlcIsMute( intf_thread_t *pIntf ): VarBool( pIntf ) {}
- virtual ~VlcIsMute() {}
-
- virtual void set( bool value );
-};
-
-
-class VlcIsPlaying: public VarBool
-{
- public:
- VlcIsPlaying( intf_thread_t *pIntf ): VarBool( pIntf ) {}
- virtual ~VlcIsPlaying() {}
-
- virtual void set( bool value, bool updateVLC );
-
- virtual void set( bool value ) { set( value, true ); }
-};
-
-
-class VlcIsSeekablePlaying: public VarBool
-{
- public:
- VlcIsSeekablePlaying( intf_thread_t *pIntf ): VarBool( pIntf ) {}
- virtual ~VlcIsSeekablePlaying() {}
-};
-
-
-#endif