[vlc-devel] commit: Simplify a bit Qt4 teletext. (Laurent Aimar )
git version control
git at videolan.org
Sat Feb 14 00:46:33 CET 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Feb 14 00:12:58 2009 +0100| [f5ca137c2e460bfdaf80a68309eb913a05d1337f] | committer: Laurent Aimar
Simplify a bit Qt4 teletext.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f5ca137c2e460bfdaf80a68309eb913a05d1337f
---
modules/gui/qt4/input_manager.cpp | 64 +++++++++++++++++--------------------
modules/gui/qt4/input_manager.hpp | 1 -
2 files changed, 29 insertions(+), 36 deletions(-)
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index f29a9ae..a0a4ca1 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -456,9 +456,36 @@ bool InputManager::hasAudio()
void InputManager::UpdateTeletext()
{
if( hasInput() )
- telexActivation( var_CountChoices( p_input, "teletext-es" ) > 0 );
+ {
+ const bool b_enabled = var_CountChoices( p_input, "teletext-es" ) > 0;
+ const int i_teletext_es = var_GetInteger( p_input, "teletext-es" );
+
+ /* Teletext is possible. Show the buttons */
+ emit teletextPossible( b_enabled );
+
+ msg_Err( p_intf, "InputManager::UpdateTeletext: %d %d", b_enabled, i_teletext_es );
+ /* If Teletext is selected */
+ if( b_enabled && i_teletext_es >= 0 )
+ {
+
+ /* Then, find the current page */
+ int i_page = 100;
+ vlc_object_t *p_vbi = (vlc_object_t *)
+ vlc_object_find_name( p_input, "zvbi", FIND_ANYWHERE );
+ if( p_vbi )
+ {
+ i_page = var_GetInteger( p_vbi, "vbi-page" );
+ vlc_object_release( p_vbi );
+ emit newTelexPageSet( i_page );
+ }
+ }
+ emit teletextActivated( b_enabled && i_teletext_es >= 0 );
+ }
else
- telexActivation( false );
+ {
+ emit teletextActivated( false );
+ emit teletextPossible( false );
+ }
}
void InputManager::UpdateVout()
@@ -671,39 +698,6 @@ void InputManager::telexSetTransparency( bool b_transparentTelextext )
}
}
-void InputManager::telexActivation( bool b_enabled )
-{
- if( hasInput() )
- {
- const int i_teletext_es = var_GetInteger( p_input, "teletext-es" );
-
- /* Teletext is possible. Show the buttons */
- b_enabled = var_CountChoices( p_input, "teletext-es" ) > 0;
- emit teletextPossible( b_enabled );
- if( !b_enabled ) return;
-
- /* If Teletext is selected */
- if( i_teletext_es >= 0 )
- {
- /* Activate the buttons */
- emit teletextActivated( true );
-
- /* Then, find the current page */
- int i_page = 100;
- vlc_object_t *p_vbi = (vlc_object_t *)
- vlc_object_find_name( p_input, "zvbi", FIND_ANYWHERE );
- if( p_vbi )
- {
- i_page = var_GetInteger( p_vbi, "vbi-page" );
- vlc_object_release( p_vbi );
- emit newTelexPageSet( i_page );
- }
- }
- }
- else
- emit teletextPossible( b_enabled );
-}
-
void InputManager::activateTeletext( bool b_enable )
{
vlc_value_t list;
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index 4112d0b..3228873 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -153,7 +153,6 @@ public slots:
/* Teletext */
void telexSetPage( int ); ///< Goto teletext page
void telexSetTransparency( bool ); ///< Transparency on teletext background
- void telexActivation( bool ); ///< Enable disable teletext buttons
void activateTeletext( bool ); ///< Toggle buttons after click
/* A to B Loop */
void setAtoB();
More information about the vlc-devel
mailing list