Commit 6c3d9910 authored by Clément Stenac's avatar Clément Stenac

Cleanup

parent 0bfccfad
...@@ -40,9 +40,8 @@ InputManager::~InputManager() ...@@ -40,9 +40,8 @@ InputManager::~InputManager()
void InputManager::setInput( input_thread_t *_p_input ) void InputManager::setInput( input_thread_t *_p_input )
{ {
fprintf( stderr, "[IM] Got input\n");
p_input = _p_input; p_input = _p_input;
emit reset(); emit positionUpdated( 0.0,0,0 );
} }
void InputManager::update() void InputManager::update()
...@@ -51,7 +50,7 @@ void InputManager::update() ...@@ -51,7 +50,7 @@ void InputManager::update()
if( p_input->b_dead ) if( p_input->b_dead )
{ {
//emit statusChanged( 0 ); emit positionUpdated( 0.0, 0, 0 );
} }
mtime_t i_length, i_time; mtime_t i_length, i_time;
float f_pos; float f_pos;
...@@ -59,12 +58,10 @@ void InputManager::update() ...@@ -59,12 +58,10 @@ void InputManager::update()
i_time = var_GetTime( p_input, "time") / 1000000; i_time = var_GetTime( p_input, "time") / 1000000;
f_pos = var_GetFloat( p_input, "position" ); f_pos = var_GetFloat( p_input, "position" );
fprintf( stderr, "Changing pos\n");
emit positionUpdated( f_pos, i_time, i_length ); emit positionUpdated( f_pos, i_time, i_length );
} }
void InputManager::sliderUpdate( float new_pos ) void InputManager::sliderUpdate( float new_pos )
{ {
fprintf( stderr, "Seek to %f\n", new_pos );
var_SetFloat( p_input, "position", new_pos ); var_SetFloat( p_input, "position", new_pos );
} }
...@@ -45,7 +45,6 @@ public slots: ...@@ -45,7 +45,6 @@ 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 reset(); ///< Input changed, tell others to reset
}; };
......
...@@ -30,10 +30,8 @@ ...@@ -30,10 +30,8 @@
MainInterface::MainInterface( intf_thread_t *_p_intf ) : MainInterface::MainInterface( intf_thread_t *_p_intf ) :
QWidget( NULL ), p_intf( _p_intf) QWidget( NULL ), p_intf( _p_intf)
{ {
fprintf( stderr, "QT Main interface\n" );
/* Init UI */ /* Init UI */
slider = new InputSlider( Qt::Horizontal, this ); slider->init(); slider = new InputSlider( Qt::Horizontal, this );
/* Init input manager */ /* Init input manager */
p_input = NULL; p_input = NULL;
...@@ -49,7 +47,7 @@ void MainInterface::init() ...@@ -49,7 +47,7 @@ void MainInterface::init()
QObject::connect( this, SIGNAL( inputChanged( input_thread_t * ) ), QObject::connect( this, SIGNAL( inputChanged( input_thread_t * ) ),
main_input_manager, SLOT( setInput( input_thread_t * ) ) ); main_input_manager, SLOT( setInput( input_thread_t * ) ) );
/* Connect the slider and the input manager */ /* Connect the slider and the input manager (both ways) */
QObject::connect( main_input_manager, SIGNAL(positionUpdated( QObject::connect( main_input_manager, SIGNAL(positionUpdated(
float, int, int ) ), slider, SLOT( setPosition( float,int, float, int, int ) ), slider, SLOT( setPosition( float,int,
int ) ) ); int ) ) );
...@@ -88,7 +86,6 @@ void MainInterface::updateOnTimer() ...@@ -88,7 +86,6 @@ void MainInterface::updateOnTimer()
if( p_input ) if( p_input )
{ {
vlc_object_yield( p_input ); vlc_object_yield( p_input );
fprintf( stderr, "Sending input\n");
emit inputChanged( p_input ); emit inputChanged( p_input );
} }
......
...@@ -23,7 +23,13 @@ ...@@ -23,7 +23,13 @@
#include "util/input_slider.hpp" #include "util/input_slider.hpp"
void InputSlider::init() InputSlider::InputSlider( QWidget *_parent ) : DirectSlider( _parent )
{
InputSlider::InputSlider( Qt::Horizontal, _parent );
}
InputSlider::InputSlider( Qt::Orientation q,QWidget *_parent ) :
DirectSlider( q, _parent )
{ {
mymove = false; mymove = false;
setMinimum( 0 ); setMinimum( 0 );
...@@ -37,7 +43,6 @@ void InputSlider::init() ...@@ -37,7 +43,6 @@ void InputSlider::init()
void InputSlider::setPosition( float pos, int a, int b ) void InputSlider::setPosition( float pos, int a, int b )
{ {
fprintf( stderr, "Set pos %f\n", pos );
mymove = true; mymove = true;
setValue( (int)(pos * 1000.0 ) ); setValue( (int)(pos * 1000.0 ) );
mymove = false; mymove = false;
...@@ -48,7 +53,6 @@ void InputSlider::userDrag( int new_value ) ...@@ -48,7 +53,6 @@ void InputSlider::userDrag( int new_value )
float f_pos = (float)(new_value)/1000.0; float f_pos = (float)(new_value)/1000.0;
if( !mymove ) if( !mymove )
{ {
fprintf( stderr, "Emitting %f\n", f_pos );
emit sliderDragged( f_pos ); emit sliderDragged( f_pos );
} }
} }
...@@ -29,11 +29,9 @@ class InputSlider : public DirectSlider ...@@ -29,11 +29,9 @@ class InputSlider : public DirectSlider
{ {
Q_OBJECT Q_OBJECT
public: public:
InputSlider( QWidget *_parent ) : DirectSlider( _parent ) {}; InputSlider( QWidget *_parent );
InputSlider( Qt::Orientation q,QWidget *_parent ) : DirectSlider( q,_parent ) InputSlider( Qt::Orientation q,QWidget *_parent );
{};
virtual ~InputSlider() {}; virtual ~InputSlider() {};
void init();
private: private:
bool mymove; bool mymove;
public slots: public slots:
......
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