]> git.sesse.net Git - vlc/commitdiff
* skins2/src/vlcproc.cpp: New "dvd.isActive" boolean variable
authorOlivier Teulière <ipkiss@videolan.org>
Mon, 13 Feb 2006 07:18:42 +0000 (07:18 +0000)
committerOlivier Teulière <ipkiss@videolan.org>
Mon, 13 Feb 2006 07:18:42 +0000 (07:18 +0000)
 * doc/skins/skins2-howto.xml: Updated doc

doc/skins/skins2-howto.xml
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.hpp

index c74e1b18ca0ca27618986bd1651d18f64f9736e2..5c1311aa36f1dafedb7c4b0f9fdf0dddf52d2e5c 100644 (file)
@@ -861,7 +861,7 @@ difficulty to understand how VLC skins work.</para>
   <listitem><para>
     <emphasis>playlist.save()</emphasis>: Save the current playlist (since VLC 0.8.0).
   </para></listitem>
-  <listitem><para>
+  <listitem id="dvdactions"><para>
     <emphasis>dvd.nextTitle()</emphasis>: Go to the next title of the DVD (since VLC 0.8.5).
   </para></listitem>
   <listitem><para>
@@ -966,6 +966,9 @@ difficulty to understand how VLC skins work.</para>
   <listitem><para>
     <emphasis>playlist.isRepeat</emphasis>: True when the current playlist item is being repeated, false otherwise (since VLC 0.8.0).
   </para></listitem>
+  <listitem><para>
+          <emphasis>dvd.isActive</emphasis>: True when a DVD is currently playing. This variable can be used to display buttons associated to the <link linkend="dvdactions">dvd.* actions</link> only when needed (since VLC 0.8.5).
+  </para></listitem>
   <listitem><para>
     <emphasis>window_name.isVisible</emphasis>: True when the window whose <link linkend="windowid">id</link> is "window_name" is visible, false otherwise.
   </para></listitem>
index 8f2d815c9864fb7249d870f3341456c9864a7549..596fb16856359b59480240696c83ec14cca24672 100644 (file)
@@ -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 );
     }
 
index 363b23343c83fbfdc79357e6d1c4109fea8603fe..09cac396a886c4cafa44dcf3d9f1b504d04358d7 100644 (file)
@@ -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
         /**