Commit 9cbb99e3 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - MainInterface and InputManager: setRate actually shows something in the interface.

parent 4c48570a
...@@ -101,7 +101,10 @@ void InputManager::update() ...@@ -101,7 +101,10 @@ void InputManager::update()
f_pos = var_GetFloat( p_input, "position" ); f_pos = var_GetFloat( p_input, "position" );
emit positionUpdated( f_pos, i_time, i_length ); emit positionUpdated( f_pos, i_time, i_length );
/* Update disc status */ /* Update rate */
emit rateChanged( var_GetInteger( p_input, "rate") );
/* Update navigation status */
vlc_value_t val; val.i_int = 0; vlc_value_t val; val.i_int = 0;
var_Change( p_input, "title", VLC_VAR_CHOICESCOUNT, &val, NULL ); var_Change( p_input, "title", VLC_VAR_CHOICESCOUNT, &val, NULL );
if( val.i_int > 0 ) if( val.i_int > 0 )
......
...@@ -60,6 +60,7 @@ public slots: ...@@ -60,6 +60,7 @@ public slots:
signals: signals:
/// Send new position, new time and new length /// Send new position, new time and new length
void positionUpdated( float , int, int ); void positionUpdated( float , int, int );
void rateChanged( int );
void nameChanged( QString ); void nameChanged( QString );
/// Used to signal whether we should show navigation buttons /// Used to signal whether we should show navigation buttons
void navigationChanged( int ); void navigationChanged( int );
......
...@@ -183,7 +183,9 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -183,7 +183,9 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
/* Connect the input manager to the GUI elements it manages */ /* Connect the input manager to the GUI elements it manages */
/* It is also connected to the control->slider, see the ControlsWidget */ /* It is also connected to the control->slider, see the ControlsWidget */
CONNECT( THEMIM->getIM(), positionUpdated( float, int, int ), CONNECT( THEMIM->getIM(), positionUpdated( float, int, int ),
this, setDisplay( float, int, int ) ); this, setDisplayPosition( float, int, int ) );
CONNECT( THEMIM->getIM(), rateChanged( int ), this, setRate( int ) );
/** Connects on nameChanged() */ /** Connects on nameChanged() */
/* Naming in the controller statusbar */ /* Naming in the controller statusbar */
...@@ -655,7 +657,7 @@ bool MainInterface::isAdvancedVisible() ...@@ -655,7 +657,7 @@ bool MainInterface::isAdvancedVisible()
/************************************************************************ /************************************************************************
* Other stuff * Other stuff
************************************************************************/ ************************************************************************/
void MainInterface::setDisplay( float pos, int time, int length ) void MainInterface::setDisplayPosition( float pos, int time, int length )
{ {
char psz_length[MSTRTIME_MAX_SIZE], psz_time[MSTRTIME_MAX_SIZE]; char psz_length[MSTRTIME_MAX_SIZE], psz_time[MSTRTIME_MAX_SIZE];
secstotimestr( psz_length, length ); secstotimestr( psz_length, length );
...@@ -686,6 +688,15 @@ void MainInterface::setStatus( int status ) ...@@ -686,6 +688,15 @@ void MainInterface::setStatus( int status )
updateSystrayMenu( status ); updateSystrayMenu( status );
} }
void MainInterface::setRate( int rate )
{
msg_Dbg( p_intf, "raaahhh %i", rate );
QString str;
str.setNum( ( 1000/(double)rate), 'f', 2 );
str.append( "x" );
speedLabel->setText( str );
}
void MainInterface::updateOnTimer() void MainInterface::updateOnTimer()
{ {
/* \todo Make this event-driven */ /* \todo Make this event-driven */
......
...@@ -128,10 +128,12 @@ public slots: ...@@ -128,10 +128,12 @@ public slots:
void toggleAdvanced(); void toggleAdvanced();
private slots: private slots:
void updateOnTimer(); void updateOnTimer();
void setStatus( int ); void setStatus( int );
void setRate( int );
void setName( QString ); void setName( QString );
void setVLCWindowsTitle( QString title = "" ); void setVLCWindowsTitle( QString title = "" );
void setDisplay( float, int, int ); void setDisplayPosition( float, int, int );
void toggleTimeDisplay(); void toggleTimeDisplay();
void setElapsedTime(); void setElapsedTime();
void setRemainTime(); void setRemainTime();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment