Commit c45fb127 authored by Cyril Deguet's avatar Cyril Deguet
Browse files

* modules/gui/skins/*:

 - huge cleaning of the interpreter; all the variables are stored in
 the container VarManager, and can be retrieved by their name (with
 type checking if needed). Some variables are still owned by VlcProc
 for technical reasons (their interface is not compliant with normal
 variable, because of the "updateVLC" trick)
 - replaced double by float
parent effba799
......@@ -2,7 +2,7 @@
* ctrl_radialslider.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: ctrl_radialslider.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
* $Id: ctrl_radialslider.cpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -35,8 +35,8 @@
CtrlRadialSlider::CtrlRadialSlider( intf_thread_t *pIntf,
const GenericBitmap &rBmpSeq, int numImg,
VarPercent &rVariable, double minAngle,
double maxAngle, const UString &rHelp ):
VarPercent &rVariable, float minAngle,
float maxAngle, const UString &rHelp ):
CtrlGeneric( pIntf, rHelp ), m_fsm( pIntf ), m_numImg( numImg ),
m_rVariable( rVariable ), m_minAngle( minAngle ), m_maxAngle( maxAngle ),
m_cmdUpDown( this, &transUpDown ), m_cmdDownUp( this, &transDownUp ),
......@@ -150,12 +150,12 @@ void CtrlRadialSlider::setCursor( int posX, int posY, bool blocking )
int y = posY - pPos->getTop() - m_width / 2;
// Compute the polar coordinates. angle is -(-j,OM)
double r = sqrt(x*x + y*y);
float r = sqrt(x*x + y*y);
if( r == 0 )
{
return;
}
double angle = acos(y/r);
float angle = acos(y/r);
if( x > 0 )
{
angle = 2*M_PI - angle;
......@@ -163,7 +163,7 @@ void CtrlRadialSlider::setCursor( int posX, int posY, bool blocking )
if( angle >= m_minAngle && angle <= m_maxAngle )
{
double newVal = (angle - m_minAngle) / (m_maxAngle - m_minAngle);
float newVal = (angle - m_minAngle) / (m_maxAngle - m_minAngle);
// Avoid too fast moves of the cursor if blocking mode
if( !blocking || fabs( m_rVariable.get() - newVal ) < 0.5 )
{
......
......@@ -2,7 +2,7 @@
* ctrl_radialslider.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: ctrl_radialslider.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
* $Id: ctrl_radialslider.hpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
......@@ -42,8 +42,8 @@ class CtrlRadialSlider: public CtrlGeneric, public Observer<VarPercent>
/// Create a radial slider with the given image, which must be
/// composed of numImg subimages of the same size
CtrlRadialSlider( intf_thread_t *pIntf, const GenericBitmap &rBmpSeq,
int numImg, VarPercent &rVariable, double minAngle,
double maxAngle, const UString &rHelp );
int numImg, VarPercent &rVariable, float minAngle,
float maxAngle, const UString &rHelp );
virtual ~CtrlRadialSlider();
......@@ -64,7 +64,7 @@ class CtrlRadialSlider: public CtrlGeneric, public Observer<VarPercent>
/// Variable associated to the slider
VarPercent &m_rVariable;
/// Min and max angles of the button
double m_minAngle, m_maxAngle;
float m_minAngle, m_maxAngle;
/// Callbacks objects
Callback m_cmdUpDown;
Callback m_cmdDownUp;
......
......@@ -2,7 +2,7 @@
* ctrl_slider.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: ctrl_slider.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
* $Id: ctrl_slider.cpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -133,7 +133,7 @@ bool CtrlSliderCursor::mouseOver( int x, int y ) const
m_curve.getPoint( m_rVariable.get(), xPos, yPos );
// Compute the resize factors
double factorX = 0, factorY = 0;
float factorX = 0, factorY = 0;
getResizeFactors( factorX, factorY );
xPos = (int)(xPos * factorX);
yPos = (int)(yPos * factorY);
......@@ -157,7 +157,7 @@ void CtrlSliderCursor::draw( OSGraphics &rImage, int xDest, int yDest )
m_curve.getPoint( m_rVariable.get(), xPos, yPos );
// Compute the resize factors
double factorX = 0, factorY = 0;
float factorX = 0, factorY = 0;
getResizeFactors( factorX, factorY );
xPos = (int)(xPos * factorX);
yPos = (int)(yPos * factorY);
......@@ -190,7 +190,7 @@ void CtrlSliderCursor::transOverDown( SkinObject *pCtrl )
EvtMouse *pEvtMouse = (EvtMouse*)pThis->m_pEvt;
// Compute the resize factors
double factorX = 0, factorY = 0;
float factorX = 0, factorY = 0;
pThis->getResizeFactors( factorX, factorY );
// Compute the offset
......@@ -245,7 +245,7 @@ void CtrlSliderCursor::transMove( SkinObject *pCtrl )
const Position *pPos = pThis->getPosition();
// Compute the resize factors
double factorX = 0, factorY = 0;
float factorX = 0, factorY = 0;
pThis->getResizeFactors( factorX, factorY );
// XXX: This could be optimized a little bit
......@@ -253,7 +253,7 @@ void CtrlSliderCursor::transMove( SkinObject *pCtrl )
(int)((pEvtMouse->getXPos() - pPos->getLeft()) / factorX),
(int)((pEvtMouse->getYPos() - pPos->getTop()) / factorY) ) < RANGE )
{
double percentage = pThis->m_curve.getNearestPercent(
float percentage = pThis->m_curve.getNearestPercent(
(int)((pEvtMouse->getXPos() - pThis->m_xOffset) / factorX),
(int)((pEvtMouse->getYPos() - pThis->m_yOffset) / factorY) );
pThis->m_rVariable.set( percentage );
......@@ -271,7 +271,7 @@ void CtrlSliderCursor::transScroll( SkinObject *pCtrl )
int direction = pEvtScroll->getDirection();
double percentage = pThis->m_rVariable.get();
float percentage = pThis->m_rVariable.get();
if( direction == EvtScroll::kUp )
{
percentage += SCROLL_STEP;
......@@ -285,8 +285,8 @@ void CtrlSliderCursor::transScroll( SkinObject *pCtrl )
}
void CtrlSliderCursor::getResizeFactors( double &rFactorX,
double &rFactorY ) const
void CtrlSliderCursor::getResizeFactors( float &rFactorX,
float &rFactorY ) const
{
// Get the position of the control
const Position *pPos = getPosition();
......@@ -297,11 +297,11 @@ void CtrlSliderCursor::getResizeFactors( double &rFactorX,
// Compute the resize factors
if( m_width > 0 )
{
rFactorX = (double)pPos->getWidth() / (double)m_width;
rFactorX = (float)pPos->getWidth() / (float)m_width;
}
if( m_height > 0 )
{
rFactorY = (double)pPos->getHeight() / (double)m_height;
rFactorY = (float)pPos->getHeight() / (float)m_height;
}
}
......@@ -326,7 +326,7 @@ bool CtrlSliderBg::mouseOver( int x, int y ) const
}
// Compute the resize factors
double factorX = 0, factorY = 1.0;
float factorX = 0, factorY = 1.0;
getResizeFactors( factorX, factorY );
return (m_curve.getMinDist( (int)(x / factorY),
......@@ -339,7 +339,7 @@ void CtrlSliderBg::handleEvent( EvtGeneric &rEvent )
if( rEvent.getAsString().find( "mouse:left:down" ) != string::npos )
{
// Compute the resize factors
double factorX = 0, factorY = 1.0;
float factorX = 0, factorY = 1.0;
getResizeFactors( factorX, factorY );
// Get the position of the control
......@@ -368,7 +368,7 @@ void CtrlSliderBg::handleEvent( EvtGeneric &rEvent )
{
int direction = ((EvtScroll&)rEvent).getDirection();
double percentage = m_rVariable.get();
float percentage = m_rVariable.get();
if( direction == EvtScroll::kUp )
{
percentage += SCROLL_STEP;
......@@ -390,7 +390,7 @@ void CtrlSliderBg::onUpdate( Subject<VarBool> &rVariable )
}
void CtrlSliderBg::getResizeFactors( double &rFactorX, double &rFactorY ) const
void CtrlSliderBg::getResizeFactors( float &rFactorX, float &rFactorY ) const
{
// Get the position of the control
const Position *pPos = getPosition();
......@@ -401,11 +401,11 @@ void CtrlSliderBg::getResizeFactors( double &rFactorX, double &rFactorY ) const
// Compute the resize factors
if( m_width > 0 )
{
rFactorX = (double)pPos->getWidth() / (double)m_width;
rFactorX = (float)pPos->getWidth() / (float)m_width;
}
if( m_height > 0 )
{
rFactorY = (double)pPos->getHeight() / (double)m_height;
rFactorY = (float)pPos->getHeight() / (float)m_height;
}
}
......@@ -2,7 +2,7 @@
* ctrl_slider.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: ctrl_slider.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
* $Id: ctrl_slider.hpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -86,7 +86,7 @@ class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>,
/// Position of the cursor
int m_xPosition, m_yPosition;
/// Last saved position of the cursor (stored as a percentage)
double m_lastPercentage;
float m_lastPercentage;
/// Offset between the mouse pointer and the center of the cursor
int m_xOffset, m_yOffset;
/// The last received event
......@@ -113,7 +113,7 @@ class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>,
virtual void onUpdate( Subject<VarBool> &rVariable );
/// Methode to compute the resize factors
void getResizeFactors( double &rFactorX, double &rFactorY ) const;
void getResizeFactors( float &rFactorX, float &rFactorY ) const;
};
......@@ -148,7 +148,7 @@ class CtrlSliderBg: public CtrlGeneric
int m_width, m_height;
/// Methode to compute the resize factors
void getResizeFactors( double &rFactorX, double &rFactorY ) const;
void getResizeFactors( float &rFactorX, float &rFactorY ) const;
/// Method called when the visibility variable is modified
virtual void onUpdate( Subject<VarBool> &rVariable );
......
......@@ -2,7 +2,7 @@
* builder.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: builder.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
* $Id: builder.cpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -48,15 +48,14 @@
Builder::Builder( intf_thread_t *pIntf, BuilderData &rData):
SkinObject( pIntf ), m_rData( rData ), m_interpreter( pIntf ),
m_pTheme( NULL )
SkinObject( pIntf ), m_rData( rData ), m_pTheme( NULL )
{
}
CmdGeneric *Builder::parseAction( const string &rAction )
{
return m_interpreter.parseAction( rAction, m_pTheme );
return Interpreter::instance( getIntf() )->parseAction( rAction, m_pTheme );
}
......@@ -275,7 +274,8 @@ void Builder::addCheckbox( const BuilderData::Checkbox &rData )
}
// Get the state variable
VarBool *pVar = m_interpreter.getVarBool( rData.m_state, m_pTheme );
Interpreter *pInterpreter = Interpreter::instance( getIntf() );
VarBool *pVar = pInterpreter->getVarBool( rData.m_state, m_pTheme );
if( pVar == NULL )
{
// TODO: default state
......@@ -402,7 +402,8 @@ void Builder::addRadialSlider( const BuilderData::RadialSlider &rData )
}
// Get the variable associated to the slider
VarPercent *pVar = m_interpreter.getVarPercent( rData.m_value, m_pTheme );
Interpreter *pInterpreter = Interpreter::instance( getIntf() );
VarPercent *pVar = pInterpreter->getVarPercent( rData.m_value, m_pTheme );
if( pVar == NULL )
{
msg_Err( getIntf(), "Unknown slider value: %s", rData.m_value.c_str() );
......@@ -458,10 +459,11 @@ void Builder::addSlider( const BuilderData::Slider &rData )
// Get the visibility variable
// XXX check when it is null
VarBool *pVisible = m_interpreter.getVarBool( rData.m_visible, m_pTheme );
Interpreter *pInterpreter = Interpreter::instance( getIntf() );
VarBool *pVisible = pInterpreter->getVarBool( rData.m_visible, m_pTheme );
// Get the variable associated to the slider
VarPercent *pVar = m_interpreter.getVarPercent( rData.m_value, m_pTheme );
VarPercent *pVar = pInterpreter->getVarPercent( rData.m_value, m_pTheme );
if( pVar == NULL )
{
msg_Err( getIntf(), "Unknown slider value: %s", rData.m_value.c_str() );
......@@ -510,7 +512,8 @@ void Builder::addList( const BuilderData::List &rData )
}
// Get the list variable
VarList *pVar = m_interpreter.getVarList( rData.m_var, m_pTheme );
Interpreter *pInterpreter = Interpreter::instance( getIntf() );
VarList *pVar = pInterpreter->getVarList( rData.m_var, m_pTheme );
if( pVar == NULL )
{
msg_Err( getIntf(), "No such list variable: %s", rData.m_var.c_str() );
......@@ -645,7 +648,7 @@ const Position Builder::makePosition( const string &rLeftTop,
Bezier *Builder::getPoints( const char *pTag ) const
{
vector<double> xBez, yBez;
vector<float> xBez, yBez;
int x, y, n;
while( 1 )
{
......
......@@ -2,7 +2,7 @@
* builder.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: builder.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
* $Id: builder.hpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -26,7 +26,6 @@
#define BUILDER_HPP
#include "builder_data.hpp"
#include "interpreter.hpp"
#include "../src/os_graphics.hpp"
#include "../src/generic_window.hpp"
#include "../src/generic_layout.hpp"
......@@ -62,9 +61,6 @@ class Builder: public SkinObject
/// Data from the XML
BuilderData &m_rData;
/// Script interpreter
Interpreter m_interpreter;
/// Theme under construction
Theme *m_pTheme;
......
......@@ -2,7 +2,7 @@
* builder_data.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: builder_data.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
* $Id: builder_data.hpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
......@@ -227,7 +227,7 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_fontId( fontId ), m_text( text ),
/// Type definition
struct RadialSlider
{
RadialSlider( const string & id, const string & visible, int xPos, int yPos, const string & leftTop, const string & rightBottom, const string & sequence, int nbImages, double minAngle, double maxAngle, const string & value, const string & tooltip, const string & help, int layer, const string & windowId, const string & layoutId ):
RadialSlider( const string & id, const string & visible, int xPos, int yPos, const string & leftTop, const string & rightBottom, const string & sequence, int nbImages, float minAngle, float maxAngle, const string & value, const string & tooltip, const string & help, int layer, const string & windowId, const string & layoutId ):
m_id( id ), m_visible( visible ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_sequence( sequence ), m_nbImages( nbImages ), m_minAngle( minAngle ), m_maxAngle( maxAngle ), m_value( value ), m_tooltip( tooltip ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
const string m_id;
......@@ -238,8 +238,8 @@ m_id( id ), m_visible( visible ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( lef
const string m_rightBottom;
const string m_sequence;
int m_nbImages;
double m_minAngle;
double m_maxAngle;
float m_minAngle;
float m_maxAngle;
const string m_value;
const string m_tooltip;
const string m_help;
......
......@@ -2,7 +2,7 @@
* interpreter.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: interpreter.cpp,v 1.2 2004/01/05 22:17:32 asmax Exp $
* $Id: interpreter.cpp,v 1.3 2004/01/11 17:12:17 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -31,6 +31,7 @@
#include "../commands/cmd_input.hpp"
#include "../commands/cmd_fullscreen.hpp"
#include "../src/theme.hpp"
#include "../src/var_manager.hpp"
#include "../src/vlcproc.hpp"
#include "../vars/playlist.hpp"
#include "../vars/vlcvars.hpp"
......@@ -40,95 +41,71 @@
Interpreter::Interpreter( intf_thread_t *pIntf ): SkinObject( pIntf )
{
/// Create the generic commands
#define REGISTER_CMD( name, cmd ) \
m_commandMap[name] = CmdGenericPtr( new cmd( getIntf() ) );
REGISTER_CMD( "none", CmdDummy )
REGISTER_CMD( "dialogs.changeSkin()", CmdDlgChangeSkin )
REGISTER_CMD( "dialogs.fileSimple()", CmdDlgFileSimple )
REGISTER_CMD( "dialogs.file()", CmdDlgFile )
REGISTER_CMD( "dialogs.disc()", CmdDlgDisc )
REGISTER_CMD( "dialogs.net()", CmdDlgNet )
REGISTER_CMD( "dialogs.messages()", CmdDlgMessages )
REGISTER_CMD( "dialogs.prefs()", CmdDlgPrefs )
REGISTER_CMD( "dialogs.fileInfo()", CmdDlgFileInfo )
REGISTER_CMD( "dialogs.popup()", CmdDlgPopupMenu )
REGISTER_CMD( "playlist.add()", CmdDlgAdd )
VarList &rVar = VlcProc::instance( getIntf() )->getPlaylistVar();
m_commandMap["playlist.del()"] =
CmdGenericPtr( new CmdPlaylistDel( getIntf(), rVar ) );
REGISTER_CMD( "playlist.next()", CmdPlaylistNext )
REGISTER_CMD( "playlist.previous()", CmdPlaylistPrevious )
REGISTER_CMD( "playlist.sort()", CmdPlaylistSort )
REGISTER_CMD( "vlc.fullscreen()", CmdFullscreen )
REGISTER_CMD( "vlc.quit()", CmdQuit )
REGISTER_CMD( "vlc.faster()", CmdFaster )
REGISTER_CMD( "vlc.slower()", CmdSlower )
REGISTER_CMD( "vlc.stop()", CmdStop )
}
CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme )
Interpreter *Interpreter::instance( intf_thread_t *pIntf )
{
// XXX should not be so hardcoded!
CmdGeneric *pCommand = NULL;
if( rAction == "none" )
{
pCommand = new CmdDummy( getIntf() );
}
else if( rAction == "dialogs.changeSkin()" )
{
pCommand = new CmdDlgChangeSkin( getIntf() );
}
else if( rAction == "dialogs.fileSimple()" )
{
pCommand = new CmdDlgFileSimple( getIntf() );
}
else if( rAction == "dialogs.file()" )
{
pCommand = new CmdDlgFile( getIntf() );
}
else if( rAction == "dialogs.disc()" )
{
pCommand = new CmdDlgDisc( getIntf() );
}
else if( rAction == "dialogs.net()" )
{
pCommand = new CmdDlgNet( getIntf() );
}
else if( rAction == "dialogs.messages()" )
{
pCommand = new CmdDlgMessages( getIntf() );
}
else if( rAction == "dialogs.prefs()" )
{
pCommand = new CmdDlgPrefs( getIntf() );
}
else if( rAction == "dialogs.fileInfo()" )
{
pCommand = new CmdDlgFileInfo( getIntf() );
}
else if( rAction == "dialogs.popup()" )
{
pCommand = new CmdDlgPopupMenu( getIntf() );
}
else if( rAction == "playlist.add()" )
{
pCommand = new CmdDlgAdd( getIntf() );
}
else if( rAction == "playlist.del()" )
{
VarList &rVar = VlcProc::instance( getIntf() )->getPlaylistVar();
pCommand = new CmdPlaylistDel( getIntf(), rVar );
}
else if( rAction == "playlist.next()" )
{
pCommand = new CmdPlaylistNext( getIntf() );
}
else if( rAction == "playlist.previous()" )
{
pCommand = new CmdPlaylistPrevious( getIntf() );
}
else if( rAction == "playlist.sort()" )
{
pCommand = new CmdPlaylistSort( getIntf() );
}
else if( rAction == "vlc.fullscreen()" )
{
pCommand = new CmdFullscreen( getIntf() );
}
else if( rAction == "vlc.quit()" )
{
pCommand = new CmdQuit( getIntf() );
}
else if( rAction == "vlc.stop()" )
if( ! pIntf->p_sys->p_interpreter )
{
pCommand = new CmdStop( getIntf() );
Interpreter *pInterpreter;
pInterpreter = new Interpreter( pIntf );
if( pInterpreter )
{
pIntf->p_sys->p_interpreter = pInterpreter;
}
}
else if( rAction == "vlc.slower()" )
return pIntf->p_sys->p_interpreter;
}
void Interpreter::destroy( intf_thread_t *pIntf )
{
if( pIntf->p_sys->p_interpreter )
{
pCommand = new CmdSlower( getIntf() );
delete pIntf->p_sys->p_interpreter;
pIntf->p_sys->p_interpreter = NULL;
}
else if( rAction == "vlc.faster()" )
}
CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme )
{
// Try to find the command in the global command map
if( m_commandMap.find( rAction ) != m_commandMap.end() )
{
pCommand = new CmdFaster( getIntf() );
return m_commandMap[rAction].get();
}
else if( rAction.find( ".setLayout(" ) != string::npos )
CmdGeneric *pCommand = NULL;
if( rAction.find( ".setLayout(" ) != string::npos )
{
int leftPos = rAction.find( ".setLayout(" );
string windowId = rAction.substr( 0, leftPos );
......@@ -136,7 +113,6 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme )
int rightPos = rAction.find( ")", windowId.size() + 11 );
string layoutId = rAction.substr( windowId.size() + 11,
rightPos - (windowId.size() + 11) );
// XXX check the IDs (isalpha())
pCommand = new CmdLayout( getIntf(), windowId, layoutId );
}
......@@ -152,19 +128,13 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme )
VarBool *Interpreter::getVarBool( const string &rName, Theme *pTheme )
{
VarBool *pVar = NULL;
// Try to get the variable from the variable manager
VarManager *pVarManager = VarManager::instance( getIntf() );
VarBool *pVar = (VarBool*)pVarManager->getVar( rName, "bool" );
if( rName == "vlc.isPlaying" )
{
pVar = &VlcProc::instance( getIntf() )->getIsPlayingVar();
}
else if( rName == "vlc.isSeekablePlaying" )
if( pVar )
{
pVar = &VlcProc::instance( getIntf() )->getIsSeekablePlayingVar();
}
else if( rName == "vlc.isMute" )
{
pVar = &VlcProc::instance( getIntf() )->getIsMuteVar();
return pVar;
}
else if( rName.find( ".isVisible" ) != string::npos )
{
......@@ -174,49 +144,35 @@ VarBool *Interpreter::getVarBool( const string &rName, Theme *pTheme )
GenericWindow *pWin = pTheme->getWindowById( windowId );
if( pWin )
{
pVar = &pWin->getVisibleVar();
return &pWin->getVisibleVar();
}
else
{
msg_Warn( getIntf(), "Unknown window (%s)", windowId.c_str() );
return NULL;
}
}
return pVar;
else
{
return NULL;
}
}
VarPercent *Interpreter::getVarPercent( const string &rName, Theme *pTheme )
{
VarPercent *pVar = NULL;
if( rName == "time" )
{
pVar = &VlcProc::instance( getIntf() )->getTimeVar();
}
else if( rName == "volume" )
{