[vlc-devel] commit: (qt4) Enable reverse playback direction button in qt4 interface. ( Jean-Paul Saman )
git version control
git at videolan.org
Thu Nov 20 17:11:30 CET 2008
vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Thu Nov 20 17:10:47 2008 +0100| [d63e1d8135d5d8f1e849669bb04ff69f445d3b3d] | committer: Jean-Paul Saman
(qt4) Enable reverse playback direction button in qt4 interface.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d63e1d8135d5d8f1e849669bb04ff69f445d3b3d
---
modules/gui/qt4/components/controller.cpp | 19 +++++++++++++++++--
modules/gui/qt4/components/controller.hpp | 5 ++++-
modules/gui/qt4/input_manager.cpp | 10 +++++++++-
modules/gui/qt4/input_manager.hpp | 1 +
4 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index 7e0f51b..95991df 100644
--- a/modules/gui/qt4/components/controller.cpp
+++ b/modules/gui/qt4/components/controller.cpp
@@ -378,6 +378,15 @@ QWidget *AbstractController::createWidget( buttonType_e button, int* i_size,
widget = advControls;
*i_size = advControls->getWidth();
}
+ case REVERSE_BUTTON:{
+ QToolButton *reverseButton = new QToolButton;
+ setupButton( reverseButton );
+ CONNECT_MAP_SET( reverseButton, REVERSE_ACTION );
+ BUTTON_SET_BAR( reverseButton, reverse, qtr( "Reverse" ) );
+ ENABLE_ON_INPUT( reverseButton );
+ widget = reverseButton;
+ }
+ break;
default:
msg_Warn( p_intf, "This should not happen" );
break;
@@ -665,6 +674,8 @@ void AbstractController::doAction( int id_action )
THEMIM->getIM()->setAtoB(); break;
case FRAME_ACTION:
frame(); break;
+ case REVERSE_ACTION:
+ reverse(); break;
default:
msg_Dbg( p_intf, "Action: %i", id_action );
break;
@@ -730,6 +741,11 @@ void AbstractController::extSettings()
THEDP->extendedDialog();
}
+void AbstractController::reverse()
+{
+ THEMIM->getIM()->reverse();
+}
+
void AbstractController::slower()
{
THEMIM->getIM()->slower();
@@ -1226,7 +1242,6 @@ static int FullscreenControllerWidgetMouseMoved( vlc_object_t *vlc_object, const
return VLC_SUCCESS;
}
-
/**
* It is called when video start
*/
@@ -1246,6 +1261,7 @@ void FullscreenControllerWidget::attachVout( vout_thread_t *p_nvout )
var_GetInteger( p_vout, "mouse-hide-timeout" ) );
vlc_mutex_unlock( &lock );
}
+
/**
* It is called after turn off video.
*/
@@ -1294,4 +1310,3 @@ void FullscreenControllerWidget::fullscreenChanged( vout_thread_t *p_vout,
}
vlc_mutex_unlock( &lock );
}
-
diff --git a/modules/gui/qt4/components/controller.hpp b/modules/gui/qt4/components/controller.hpp
index 68be2e5..4b2515f 100644
--- a/modules/gui/qt4/components/controller.hpp
+++ b/modules/gui/qt4/components/controller.hpp
@@ -83,6 +83,7 @@ typedef enum buttonType_e
TIME_LABEL,
SPLITTER,
ADVANCED_CONTROLLER,
+ REVERSE_BUTTON,
} buttonType_e;
typedef enum actionType_e
@@ -100,7 +101,8 @@ typedef enum actionType_e
SNAPSHOT_ACTION,
RECORD_ACTION,
FRAME_ACTION,
- ATOB_ACTION
+ ATOB_ACTION,
+ REVERSE_ACTION,
} actionType_e;
enum
@@ -147,6 +149,7 @@ protected slots:
void extSettings();
void faster();
void slower();
+ void reverse();
void playlist();
void snapshot();
void record();
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 9f65f79..d27ec71 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -572,6 +572,15 @@ void InputManager::activateTeletext( bool b_enable )
}
}
+void InputManager::reverse()
+{
+ if( hasInput() )
+ {
+ int i_rate = var_GetInteger( p_input, "rate" );
+ var_SetInteger( p_input, "rate", -i_rate );
+ }
+}
+
void InputManager::slower()
{
if( hasInput() )
@@ -869,4 +878,3 @@ static int VolumeChanged( vlc_object_t *p_this, const char *psz_var,
QApplication::postEvent( mim, static_cast<QEvent*>(event) );
return VLC_SUCCESS;
}
-
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index 8e728cb..904fe93 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -116,6 +116,7 @@ public slots:
void setInput( input_thread_t * ); ///< Our controlled input changed
void sliderUpdate( float ); ///< User dragged the slider. We get new pos
/* SpeedRate Rate Management */
+ void reverse();
void slower();
void faster();
void normalRate();
More information about the vlc-devel
mailing list