]> git.sesse.net Git - vlc/commitdiff
Qt4 - Change the event numbers and add more debug to find the IM/Rate bugs.
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 12 Feb 2008 08:00:59 +0000 (08:00 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 12 Feb 2008 08:00:59 +0000 (08:00 +0000)
modules/gui/qt4/components/playlist/playlist_model.hpp
modules/gui/qt4/dialogs/help.hpp
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/qt4.hpp

index 183aab9ad7a6ed3532648c6ad3129c7b94e7cdea..b7af5bb461aa3b1e87646d10f0a8f5702f45672a 100644 (file)
@@ -33,6 +33,8 @@
 #include <vlc_playlist.h>
 #include "playlist_item.hpp"
 
+#include "qt4.hpp"
+
 #include <QModelIndex>
 #include <QObject>
 #include <QEvent>
@@ -48,10 +50,10 @@ class PLItem;
 #define DEPTH_PL -1
 #define DEPTH_SEL 1
 
-static int ItemUpdate_Type = QEvent::User + 2;
-static int ItemDelete_Type = QEvent::User + 3;
-static int ItemAppend_Type = QEvent::User + 4;
-static int PLUpdate_Type = QEvent::User + 5;
+static int ItemUpdate_Type = QEvent::User + PLEventType + 2;
+static int ItemDelete_Type = QEvent::User + PLEventType + 3;
+static int ItemAppend_Type = QEvent::User + PLEventType + 4;
+static int PLUpdate_Type   = QEvent::User + PLEventType + 5;
 
 class PLEvent : public QEvent
 {
index fb336215e8bc15bd2510afbb75d8a6741aecb402..8600593a132a569879d52d5bf9c2641ef81eaace 100644 (file)
@@ -82,8 +82,8 @@ public slots:
 
 #ifdef UPDATE_CHECK
 
-static int UDOkEvent = QEvent::User + 1;
-static int UDErrorEvent = QEvent::User + 2;
+static int UDOkEvent = QEvent::User + DialogEventType + 21;
+static int UDErrorEvent = QEvent::User + DialogEventType + 22;
 
 class UpdateDialog : public QVLCFrame
 {
index 1b2830b679cb62caa9c9bbf4c708fd039d89544a..f79e40c7fe6a1e9122c07eb8aaad33b27024e2e1 100644 (file)
@@ -159,6 +159,7 @@ void InputManager::delCallbacks()
 void InputManager::customEvent( QEvent *event )
 {
     int type = event->type();
+        msg_Dbg( p_intf, "New Event: type %i", type );
     IMEvent *ple = static_cast<IMEvent *>(event);
     //msg_Dbg( p_intf, "New IM Event of type: %i", type );
     if ( type != PositionUpdate_Type &&
@@ -170,7 +171,8 @@ void InputManager::customEvent( QEvent *event )
 
     if( !p_input || p_input->b_die || p_input->b_dead )
         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;
     if( type != PositionUpdate_Type )
         msg_Dbg( p_intf, "New Event: type %i", type );
@@ -196,9 +198,9 @@ void InputManager::customEvent( QEvent *event )
         UpdateMeta();
         break;
     case ItemStateChanged_Type:
-       UpdateStatus();
-       UpdateTracks();
-       break;
+        UpdateStatus();
+        UpdateTracks();
+        break;
     }
 }
 
@@ -304,6 +306,8 @@ void InputManager::UpdateTracks()
     var_Change( p_input, "video-es", VLC_VAR_CHOICESCOUNT, &val, NULL );
     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 */
 #ifdef ZVBI_COMPILED
     /* Update teletext status*/
@@ -487,10 +491,10 @@ MainInputManager::~MainInputManager()
 void MainInputManager::customEvent( QEvent *event )
 {
     int type = event->type();
-    //msg_Dbg( p_intf, "New MainIM Event of type: %i", type );
     if ( type != ItemChanged_Type && type != VolumeChanged_Type )
         return;
 
+    // msg_Dbg( p_intf, "New MainIM Event of type: %i", type );
     if( type == VolumeChanged_Type )
     {
         emit volumeChanged();
index 1532a294b3b7cfe74fba9d115d6b10210220e7c8..03907e4c98ca7f82c29696df3b39aadc268bb68d 100644 (file)
 #include <vlc/vlc.h>
 #include <vlc_input.h>
 
+#include "qt4.hpp"
+
 #include <QObject>
 #include <QEvent>
 
-static int const PositionUpdate_Type = QEvent::User + 6;
-static int const ItemChanged_Type = QEvent::User + 7;
-static int const ItemRateChanged_Type = QEvent::User + 8;
-static int const ItemTitleChanged_Type = QEvent::User + 9;
-static int const ItemStateChanged_Type = QEvent::User + 10;
-static int const VolumeChanged_Type = QEvent::User + 11;
+static int const PositionUpdate_Type = QEvent::User + IMEventType + 1;
+static int const ItemChanged_Type = QEvent::User + IMEventType + 2;
+static int const ItemStateChanged_Type = QEvent::User + IMEventType + 3;
+static int const ItemTitleChanged_Type = QEvent::User + IMEventType + 4;
+static int const ItemRateChanged_Type = QEvent::User + IMEventType + 5;
+static int const VolumeChanged_Type = QEvent::User + IMEventType + 6;
 
 class IMEvent : public QEvent
 {
index dc0fe959cdd09adf56d2f33a4a5ace1a78e50f77..220fc2822d6d8418c99f10e6be0671b93a23b1fa 100644 (file)
@@ -104,10 +104,16 @@ struct intf_sys_t
 #define TOGGLEV( x ) { if( x->isVisible() ) x->hide();          \
             else  x->show(); }
 
-static int DialogEvent_Type = QEvent::User + 1;
-//static int PLUndockEvent_Type = QEvent::User + 2;
-//static int PLDockEvent_Type = QEvent::User + 3;
-static int SetVideoOnTopEvent_Type = QEvent::User + 4;
+enum {
+DialogEventType = 0,
+IMEventType     = 100,
+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
 {