Commit e178b0ac authored by Ilkka Ollakka's avatar Ilkka Ollakka

change input_manager to event-based instead of polling, this is one

biggest polls in qt4-interface, still maybe few to go. ref 1365
parent d1057723
This diff is collapsed.
...@@ -28,6 +28,23 @@ ...@@ -28,6 +28,23 @@
#include <vlc_input.h> #include <vlc_input.h>
#include <QObject> #include <QObject>
#include <QEvent>
static int PositionUpdate_Type = QEvent::User + 6;
static int ItemChanged_Type = QEvent::User + 7;
static int ItemRateChanged_Type = QEvent::User + 8;
static int ItemTitleChanged_Type = QEvent::User + 9;
static int ItemStateChanged_Type = QEvent::User + 10;
class IMEvent : public QEvent
{
public:
IMEvent( int type, int id ) : QEvent( (QEvent::Type)(type) )
{ i_id = id ; } ;
virtual ~IMEvent() {};
int i_id;
};
class InputManager : public QObject class InputManager : public QObject
{ {
...@@ -42,6 +59,14 @@ public: ...@@ -42,6 +59,14 @@ public:
bool hasVideo() { return b_has_video; } bool hasVideo() { return b_has_video; }
bool b_has_audio, b_has_video, b_had_audio, b_had_video; bool b_has_audio, b_has_video, b_had_audio, b_had_video;
private: private:
void customEvent( QEvent * );
void addCallbacks( void );
void delCallbacks( void );
void UpdateRate( void );
void UpdateMeta( void );
void UpdateStatus( void );
void UpdateTitle( void );
void UpdatePosition( void );
intf_thread_t *p_intf; intf_thread_t *p_intf;
input_thread_t *p_input; input_thread_t *p_input;
int i_old_playing_status; int i_old_playing_status;
...@@ -99,6 +124,7 @@ public: ...@@ -99,6 +124,7 @@ public:
InputManager *getIM() { return im; }; InputManager *getIM() { return im; };
private: private:
void customEvent( QEvent * );
MainInputManager( intf_thread_t * ); MainInputManager( intf_thread_t * );
InputManager *im; InputManager *im;
...@@ -111,7 +137,7 @@ public slots: ...@@ -111,7 +137,7 @@ public slots:
void next(); void next();
void prev(); void prev();
private slots: private slots:
void updateInput(); //void updateInput();
signals: signals:
void inputChanged( input_thread_t * ); void inputChanged( input_thread_t * );
}; };
......
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