From: Olivier Teulière Date: Mon, 13 Feb 2006 07:18:42 +0000 (+0000) Subject: * skins2/src/vlcproc.cpp: New "dvd.isActive" boolean variable X-Git-Tag: 0.9.0-test0~12371 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=8a1c45dff8c198bf15626a10093ce45a7a114c20;p=vlc * skins2/src/vlcproc.cpp: New "dvd.isActive" boolean variable * doc/skins/skins2-howto.xml: Updated doc --- diff --git a/doc/skins/skins2-howto.xml b/doc/skins/skins2-howto.xml index c74e1b18ca..5c1311aa36 100644 --- a/doc/skins/skins2-howto.xml +++ b/doc/skins/skins2-howto.xml @@ -861,7 +861,7 @@ difficulty to understand how VLC skins work. playlist.save(): Save the current playlist (since VLC 0.8.0). - + dvd.nextTitle(): Go to the next title of the DVD (since VLC 0.8.5). @@ -966,6 +966,9 @@ difficulty to understand how VLC skins work. playlist.isRepeat: True when the current playlist item is being repeated, false otherwise (since VLC 0.8.0). + + dvd.isActive: True when a DVD is currently playing. This variable can be used to display buttons associated to the dvd.* actions only when needed (since VLC 0.8.5). + window_name.isVisible: True when the window whose id is "window_name" is visible, false otherwise. diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp index 8f2d815c98..596fb16856 100644 --- a/modules/gui/skins2/src/vlcproc.cpp +++ b/modules/gui/skins2/src/vlcproc.cpp @@ -100,6 +100,7 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ), REGISTER_VAR( m_cVarSeekable, VarBoolImpl, "vlc.isSeekable" ) REGISTER_VAR( m_cVarEqualizer, VarBoolImpl, "equalizer.isEnabled" ) REGISTER_VAR( m_cVarEqPreamp, EqualizerPreamp, "equalizer.preamp" ) + REGISTER_VAR( m_cVarDvdActive, VarBoolImpl, "dvd.isActive" ) #undef REGISTER_VAR m_cVarStreamName = VariablePtr( new VarText( getIntf(), false ) ); pVarManager->registerVar( m_cVarStreamName, "streamName" ); @@ -233,6 +234,7 @@ void VlcProc::manage() VarBoolImpl *pVarRandom = (VarBoolImpl*)m_cVarRandom.get(); VarBoolImpl *pVarLoop = (VarBoolImpl*)m_cVarLoop.get(); VarBoolImpl *pVarRepeat = (VarBoolImpl*)m_cVarRepeat.get(); + VarBoolImpl *pVarDvdActive = (VarBoolImpl*)m_cVarDvdActive.get(); // Refresh audio variables refreshAudio(); @@ -268,6 +270,12 @@ void VlcProc::manage() pVarPaused->set( status == PLAYLIST_PAUSED ); pVarSeekable->set( pos.f_float != 0.0 ); + + // Refresh DVD detection + vlc_value_t chapters_count; + var_Change( pInput, "chapter", VLC_VAR_CHOICESCOUNT, + &chapters_count, NULL ); + pVarDvdActive->set( chapters_count.i_int > 0 ); } else { @@ -275,6 +283,7 @@ void VlcProc::manage() pVarPaused->set( false ); pVarStopped->set( true ); pVarSeekable->set( false ); + pVarDvdActive->set( false ); pTime->set( 0, false ); } diff --git a/modules/gui/skins2/src/vlcproc.hpp b/modules/gui/skins2/src/vlcproc.hpp index 363b23343c..09cac396a8 100644 --- a/modules/gui/skins2/src/vlcproc.hpp +++ b/modules/gui/skins2/src/vlcproc.hpp @@ -123,6 +123,8 @@ class VlcProc: public SkinObject EqualizerBands m_varEqBands; VariablePtr m_cVarEqPreamp; VariablePtr m_cVarEqualizer; + /// Variable for DVD detection + VariablePtr m_cVarDvdActive; /// Set of handles of vout windows /**