[vlc-commits] Qt: input_manager: merge loop&repeat events.
Francois Cartegnie
git at videolan.org
Mon Dec 5 22:08:56 CET 2011
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Dec 3 22:21:39 2011 +0100| [7cf467ae4446a54c1e5fbce3ada5701ef22f6ee8] | committer: Francois Cartegnie
Qt: input_manager: merge loop&repeat events.
Definitively doing the same thing.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7cf467ae4446a54c1e5fbce3ada5701ef22f6ee8
---
modules/gui/qt4/input_manager.cpp | 33 ++++++++-------------------------
modules/gui/qt4/input_manager.hpp | 3 +--
2 files changed, 9 insertions(+), 27 deletions(-)
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 1022266..5deab33 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -58,11 +58,8 @@ static int SoundMuteChanged( vlc_object_t *, const char *,
static int RandomChanged( vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void * );
-static int LoopChanged( vlc_object_t *, const char *,
+static int LoopOrRepeatChanged( vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void * );
-static int RepeatChanged( vlc_object_t *, const char *,
- vlc_value_t, vlc_value_t, void * );
-
static int InputEvent( vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void * );
@@ -956,8 +953,8 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
var_AddCallback( THEPL, "playlist-item-append", PLItemAppended, this );
var_AddCallback( THEPL, "playlist-item-deleted", PLItemRemoved, this );
var_AddCallback( THEPL, "random", RandomChanged, this );
- var_AddCallback( THEPL, "repeat", RepeatChanged, this );
- var_AddCallback( THEPL, "loop", LoopChanged, this );
+ var_AddCallback( THEPL, "repeat", LoopOrRepeatChanged, this );
+ var_AddCallback( THEPL, "loop", LoopOrRepeatChanged, this );
var_AddCallback( THEPL, "volume", VolumeChanged, this );
var_AddCallback( THEPL, "mute", SoundMuteChanged, this );
@@ -988,8 +985,8 @@ MainInputManager::~MainInputManager()
var_DelCallback( THEPL, "playlist-item-append", PLItemAppended, this );
var_DelCallback( THEPL, "playlist-item-deleted", PLItemRemoved, this );
var_DelCallback( THEPL, "random", RandomChanged, this );
- var_DelCallback( THEPL, "repeat", RepeatChanged, this );
- var_DelCallback( THEPL, "loop", LoopChanged, this );
+ var_DelCallback( THEPL, "repeat", LoopOrRepeatChanged, this );
+ var_DelCallback( THEPL, "loop", LoopOrRepeatChanged, this );
/* Save some interface state in configuration, at module quit */
config_PutInt( p_intf, "random", var_GetBool( THEPL, "random" ) );
@@ -1040,8 +1037,7 @@ void MainInputManager::customEvent( QEvent *event )
case RandomChanged_Type:
emit randomChanged( var_GetBool( THEPL, "random" ) );
return;
- case LoopChanged_Type:
- case RepeatChanged_Type:
+ case LoopOrRepeatChanged_Type:
notifyRepeatLoop();
return;
case LeafToParent_Type:
@@ -1286,27 +1282,14 @@ static int RandomChanged
return VLC_SUCCESS;
}
-/* Probably could be merged with next callback */
-static int LoopChanged
-( vlc_object_t * obj, const char *var, vlc_value_t old, vlc_value_t cur, void *data )
-{
- VLC_UNUSED( obj ); VLC_UNUSED( var ); VLC_UNUSED( old ); VLC_UNUSED( cur );
-
- MainInputManager *mim = static_cast<MainInputManager*>(data);
-
- IMEvent *event = new IMEvent( LoopChanged_Type );
- QApplication::postEvent( mim, event );
- return VLC_SUCCESS;
-}
-
-static int RepeatChanged
+static int LoopOrRepeatChanged
( vlc_object_t * obj, const char *var, vlc_value_t old, vlc_value_t cur, void *data )
{
VLC_UNUSED( obj ); VLC_UNUSED( var ); VLC_UNUSED( old ); VLC_UNUSED( cur );
MainInputManager *mim = static_cast<MainInputManager*>(data);
- IMEvent *event = new IMEvent( RepeatChanged_Type );
+ IMEvent *event = new IMEvent( LoopOrRepeatChanged_Type );
QApplication::postEvent( mim, event );
return VLC_SUCCESS;
}
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index 406911c..396b32d 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -60,8 +60,7 @@ enum {
RecordingEvent_Type,
ProgramChanged_Type,
RandomChanged_Type,
- LoopChanged_Type,
- RepeatChanged_Type,
+ LoopOrRepeatChanged_Type,
LeafToParent_Type,
EPGEvent_Type,
/* SignalChanged_Type, */
More information about the vlc-commits
mailing list