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
......@@ -100,8 +100,11 @@ void InputManager::update()
i_time = var_GetTime( p_input, "time") / 1000000;
f_pos = var_GetFloat( p_input, "position" );
emit positionUpdated( f_pos, i_time, i_length );
/* Update rate */
emit rateChanged( var_GetInteger( p_input, "rate") );
/* Update disc status */
/* Update navigation status */
vlc_value_t val; val.i_int = 0;
var_Change( p_input, "title", VLC_VAR_CHOICESCOUNT, &val, NULL );
if( val.i_int > 0 )
......
......@@ -60,6 +60,7 @@ public slots:
signals:
/// Send new position, new time and new length
void positionUpdated( float , int, int );
void rateChanged( int );
void nameChanged( QString );
/// Used to signal whether we should show navigation buttons
void navigationChanged( int );
......
......@@ -183,8 +183,10 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
/* Connect the input manager to the GUI elements it manages */
/* It is also connected to the control->slider, see the ControlsWidget */
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() */
/* Naming in the controller statusbar */
CONNECT( THEMIM->getIM(), nameChanged( QString ), this,
......@@ -655,7 +657,7 @@ bool MainInterface::isAdvancedVisible()
/************************************************************************
* 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];
secstotimestr( psz_length, length );
......@@ -686,6 +688,15 @@ void MainInterface::setStatus( int 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()
{
/* \todo Make this event-driven */
......
......@@ -128,10 +128,12 @@ public slots:
void toggleAdvanced();
private slots:
void updateOnTimer();
void setStatus( int );
void setRate( int );
void setName( QString );
void setVLCWindowsTitle( QString title = "" );
void setDisplay( float, int, int );
void setDisplayPosition( float, int, int );
void toggleTimeDisplay();
void setElapsedTime();
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