Commit e1bc46e7 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Change the event numbers and add more debug to find the IM/Rate bugs.

parent b7a979cd
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include <vlc_playlist.h> #include <vlc_playlist.h>
#include "playlist_item.hpp" #include "playlist_item.hpp"
#include "qt4.hpp"
#include <QModelIndex> #include <QModelIndex>
#include <QObject> #include <QObject>
#include <QEvent> #include <QEvent>
...@@ -48,10 +50,10 @@ class PLItem; ...@@ -48,10 +50,10 @@ class PLItem;
#define DEPTH_PL -1 #define DEPTH_PL -1
#define DEPTH_SEL 1 #define DEPTH_SEL 1
static int ItemUpdate_Type = QEvent::User + 2; static int ItemUpdate_Type = QEvent::User + PLEventType + 2;
static int ItemDelete_Type = QEvent::User + 3; static int ItemDelete_Type = QEvent::User + PLEventType + 3;
static int ItemAppend_Type = QEvent::User + 4; static int ItemAppend_Type = QEvent::User + PLEventType + 4;
static int PLUpdate_Type = QEvent::User + 5; static int PLUpdate_Type = QEvent::User + PLEventType + 5;
class PLEvent : public QEvent class PLEvent : public QEvent
{ {
......
...@@ -82,8 +82,8 @@ public slots: ...@@ -82,8 +82,8 @@ public slots:
#ifdef UPDATE_CHECK #ifdef UPDATE_CHECK
static int UDOkEvent = QEvent::User + 1; static int UDOkEvent = QEvent::User + DialogEventType + 21;
static int UDErrorEvent = QEvent::User + 2; static int UDErrorEvent = QEvent::User + DialogEventType + 22;
class UpdateDialog : public QVLCFrame class UpdateDialog : public QVLCFrame
{ {
......
...@@ -159,6 +159,7 @@ void InputManager::delCallbacks() ...@@ -159,6 +159,7 @@ void InputManager::delCallbacks()
void InputManager::customEvent( QEvent *event ) void InputManager::customEvent( QEvent *event )
{ {
int type = event->type(); int type = event->type();
msg_Dbg( p_intf, "New Event: type %i", type );
IMEvent *ple = static_cast<IMEvent *>(event); IMEvent *ple = static_cast<IMEvent *>(event);
//msg_Dbg( p_intf, "New IM Event of type: %i", type ); //msg_Dbg( p_intf, "New IM Event of type: %i", type );
if ( type != PositionUpdate_Type && if ( type != PositionUpdate_Type &&
...@@ -170,7 +171,8 @@ void InputManager::customEvent( QEvent *event ) ...@@ -170,7 +171,8 @@ void InputManager::customEvent( QEvent *event )
if( !p_input || p_input->b_die || p_input->b_dead ) if( !p_input || p_input->b_die || p_input->b_dead )
return; return;
if( type != PositionUpdate_Type && ( i_input_id != ple->i_id ) ) if( ( type != PositionUpdate_Type && type != ItemRateChanged_Type )
&& ( i_input_id != ple->i_id ) )
return; return;
if( type != PositionUpdate_Type ) if( type != PositionUpdate_Type )
msg_Dbg( p_intf, "New Event: type %i", type ); msg_Dbg( p_intf, "New Event: type %i", type );
...@@ -304,6 +306,8 @@ void InputManager::UpdateTracks() ...@@ -304,6 +306,8 @@ void InputManager::UpdateTracks()
var_Change( p_input, "video-es", VLC_VAR_CHOICESCOUNT, &val, NULL ); var_Change( p_input, "video-es", VLC_VAR_CHOICESCOUNT, &val, NULL );
b_has_video = val.i_int > 0; b_has_video = val.i_int > 0;
msg_Dbg( p_input, "I have audio-video: %i %i", b_has_audio, b_has_video );
/* Update ZVBI status */ /* Update ZVBI status */
#ifdef ZVBI_COMPILED #ifdef ZVBI_COMPILED
/* Update teletext status*/ /* Update teletext status*/
...@@ -487,10 +491,10 @@ MainInputManager::~MainInputManager() ...@@ -487,10 +491,10 @@ MainInputManager::~MainInputManager()
void MainInputManager::customEvent( QEvent *event ) void MainInputManager::customEvent( QEvent *event )
{ {
int type = event->type(); int type = event->type();
//msg_Dbg( p_intf, "New MainIM Event of type: %i", type );
if ( type != ItemChanged_Type && type != VolumeChanged_Type ) if ( type != ItemChanged_Type && type != VolumeChanged_Type )
return; return;
// msg_Dbg( p_intf, "New MainIM Event of type: %i", type );
if( type == VolumeChanged_Type ) if( type == VolumeChanged_Type )
{ {
emit volumeChanged(); emit volumeChanged();
......
...@@ -31,15 +31,17 @@ ...@@ -31,15 +31,17 @@
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <vlc_input.h> #include <vlc_input.h>
#include "qt4.hpp"
#include <QObject> #include <QObject>
#include <QEvent> #include <QEvent>
static int const PositionUpdate_Type = QEvent::User + 6; static int const PositionUpdate_Type = QEvent::User + IMEventType + 1;
static int const ItemChanged_Type = QEvent::User + 7; static int const ItemChanged_Type = QEvent::User + IMEventType + 2;
static int const ItemRateChanged_Type = QEvent::User + 8; static int const ItemStateChanged_Type = QEvent::User + IMEventType + 3;
static int const ItemTitleChanged_Type = QEvent::User + 9; static int const ItemTitleChanged_Type = QEvent::User + IMEventType + 4;
static int const ItemStateChanged_Type = QEvent::User + 10; static int const ItemRateChanged_Type = QEvent::User + IMEventType + 5;
static int const VolumeChanged_Type = QEvent::User + 11; static int const VolumeChanged_Type = QEvent::User + IMEventType + 6;
class IMEvent : public QEvent class IMEvent : public QEvent
{ {
......
...@@ -104,10 +104,16 @@ struct intf_sys_t ...@@ -104,10 +104,16 @@ struct intf_sys_t
#define TOGGLEV( x ) { if( x->isVisible() ) x->hide(); \ #define TOGGLEV( x ) { if( x->isVisible() ) x->hide(); \
else x->show(); } else x->show(); }
static int DialogEvent_Type = QEvent::User + 1; enum {
//static int PLUndockEvent_Type = QEvent::User + 2; DialogEventType = 0,
//static int PLDockEvent_Type = QEvent::User + 3; IMEventType = 100,
static int SetVideoOnTopEvent_Type = QEvent::User + 4; PLEventType = 200
};
static int DialogEvent_Type = QEvent::User + DialogEventType + 1;
//static int PLUndockEvent_Type = QEvent::User + DialogEventType + 2;
//static int PLDockEvent_Type = QEvent::User + DialogEventType + 3;
static int SetVideoOnTopEvent_Type = QEvent::User + DialogEventType + 4;
class DialogEvent : public QEvent class DialogEvent : public QEvent
{ {
......
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