[vlc-devel] commit: Improve behavour on teletext buttons. (Jean-Paul Saman )

git version control git at videolan.org
Fri Jun 20 09:51:17 CEST 2008


vlc | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Fri Jun 20 09:52:13 2008 +0200| [c49d12129a0d9835d56a1879b02643b99515ab2c]

Improve behavour on teletext buttons.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c49d12129a0d9835d56a1879b02643b99515ab2c
---

 modules/gui/qt4/components/interface_widgets.cpp |    4 ----
 modules/gui/qt4/input_manager.cpp                |   14 +++++---------
 modules/gui/qt4/input_manager.hpp                |   11 ++++-------
 modules/gui/qt4/menus.cpp                        |    2 +-
 4 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 565e6c0..a085216 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -468,7 +468,6 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
      * Telextext QFrame
      * TODO: Merge with upper menu in a StackLayout
      **/
-#ifdef ZVBI_COMPILED
     telexFrame = new QWidget( this );
     QHBoxLayout *telexLayout = new QHBoxLayout( telexFrame );
     telexLayout->setSpacing( 0 );
@@ -504,7 +503,6 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
              THEMIM->getIM(), telexSetTransparency( bool ) );
     CONNECT( THEMIM->getIM(), teletextEnabled( bool ),
              telexFrame, setVisible( bool ) );
-#endif
 
     /** Play Buttons **/
     QSizePolicy sizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
@@ -839,9 +837,7 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i,
 
     fsLayout->addWidget( discFrame, 1, 4 );
 
-    #ifdef ZVBI_COMPILED
     fsLayout->addWidget( telexFrame, 1, 5 );
-    #endif
 
     fsLayout->addWidget( advControls, 1, 6, Qt::AlignVCenter );
 
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 57774c4..0ee8e0d 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -325,22 +325,16 @@ bool InputManager::hasVideo()
 
 void InputManager::UpdateSPU()
 {
-#ifdef ZVBI_COMPILED
     if( hasInput() )
     {
         vlc_value_t val;
         var_Change( p_input, "spu-es", VLC_VAR_CHOICESCOUNT, &val, NULL );
-
-        /* Update teletext status*/
-        emit teletextEnabled( val.i_int > 0 );/* FIXME */
-        telexToggle( true );
+        telexToggle( val.i_int > 0 );
     }
     else
     {
-        emit teletextEnabled( false );
         telexToggle( false );
     }
-#endif
 }
 
 void InputManager::UpdateArt()
@@ -408,7 +402,6 @@ void InputManager::sectionMenu()
     }
 }
 
-#ifdef ZVBI_COMPILED
 void InputManager::telexGotoPage( int page )
 {
     if( hasInput() )
@@ -430,6 +423,7 @@ void InputManager::telexToggle( bool b_enabled )
 
     if( hasInput() )
     {
+        vlc_value_t val;
         vlc_object_t *p_vbi;
         p_vbi = (vlc_object_t *) vlc_object_find_name( p_input,
                     "zvbi", FIND_ANYWHERE );
@@ -438,7 +432,10 @@ void InputManager::telexToggle( bool b_enabled )
             i_page = var_GetInteger( p_vbi, "vbi-page" );
             vlc_object_release( p_vbi );
         }
+        var_Change( p_input, "spu-es", VLC_VAR_CHOICESCOUNT, &val, NULL );
+        b_enabled = (val.i_int > 0);
     }
+    emit teletextEnabled( b_enabled );
     i_page = b_enabled ? i_page : 0;
     telexGotoPage( i_page );
 }
@@ -457,7 +454,6 @@ void InputManager::telexSetTransparency( bool b_transp )
         }
     }
 }
-#endif
 
 void InputManager::slower()
 {
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index 3c4f351..b5ea638 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -100,11 +100,9 @@ public slots:
     void sectionNext();
     void sectionPrev();
     void sectionMenu();
-#ifdef ZVBI_COMPILED
-    void telexGotoPage( int );
-    void telexToggle( bool );
-    void telexSetTransparency( bool );
-#endif
+    void telexGotoPage( int ); ///< Goto teletext page
+    void telexToggle( bool );  ///< Enable disable teletext buttons
+    void telexSetTransparency( bool ); ///< Set transparency on teletext background
 
 signals:
     /// Send new position, new time and new length
@@ -118,9 +116,8 @@ signals:
     void artChanged( QString );
     /// Controll of fullscreen controller
     void inputUnset();
-#ifdef ZVBI_COMPILED
+    /// Teletext
     void teletextEnabled( bool );
-#endif
 };
 
 class MainInputManager : public QObject
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 3fbd74f..7a9cb33 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -665,7 +665,7 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu,
             ":/pixmaps/previous_16px.png", SLOT( prev() ) );
     addMIMStaticEntry( p_intf, menu, qtr( "Next" ), "",
             ":/pixmaps/next_16px.png", SLOT( next() ) );
-    }
+}
 
 void QVLCMenu::PopupMenuStaticEntries( intf_thread_t *p_intf, QMenu *menu )
 {




More information about the vlc-devel mailing list