[vlc-devel] commit: Simplify/fix InputManager::customEvent. (Laurent Aimar )

git version control git at videolan.org
Fri Feb 13 00:19:23 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Feb 13 00:18:21 2009 +0100| [9b9b344e94397b839a8cabcddec22641b9cc8cb0] | committer: Laurent Aimar 

Simplify/fix InputManager::customEvent.

The DVD boutons (prev|menu|next)are now working again.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9b9b344e94397b839a8cabcddec22641b9cc8cb0
---

 modules/gui/qt4/input_manager.cpp |   51 ++++++------------------------------
 1 files changed, 9 insertions(+), 42 deletions(-)

diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 2dc83e7..7ab3202 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -143,45 +143,7 @@ void InputManager::customEvent( QEvent *event )
     int i_type = event->type();
     IMEvent *ple = static_cast<IMEvent *>(event);
 
-    assert( !( i_type != PositionUpdate_Type &&
-         i_type != ItemChanged_Type &&
-         i_type != ItemRateChanged_Type &&
-         i_type != ItemTitleChanged_Type &&
-         i_type != ItemEsChanged_Type &&
-         i_type != ItemTeletextChanged_Type &&
-         i_type != ItemStateChanged_Type &&
-         i_type != StatisticsUpdate_Type &&
-         i_type != InterfaceVoutUpdate_Type &&
-         i_type != MetaChanged_Type &&
-         i_type != NameChanged_Type &&
-         i_type != InfoChanged_Type &&
-         i_type != SynchroChanged_Type &&
-         i_type != CachingEvent_Type &&
-         i_type != BookmarksChanged_Type &&
-         i_type != InterfaceAoutUpdate_Type &&
-         i_type != RecordingEvent_Type ) );
-
-    if( !hasInput() ) return;
-
-    if( i_type == CachingEvent_Type )
-        UpdateCaching();
-
-    if( ( i_type != PositionUpdate_Type  &&
-          i_type != ItemRateChanged_Type &&
-          i_type != ItemEsChanged_Type &&
-          i_type != ItemTeletextChanged_Type &&
-          i_type != ItemStateChanged_Type &&
-          i_type != StatisticsUpdate_Type &&
-          i_type != InterfaceVoutUpdate_Type &&
-          i_type != MetaChanged_Type &&
-          i_type != NameChanged_Type &&
-          i_type != InfoChanged_Type &&
-          i_type != SynchroChanged_Type &&
-          i_type != BookmarksChanged_Type &&
-          i_type != InterfaceAoutUpdate_Type &&
-          i_type != RecordingEvent_Type
-        )
-        && ( i_input_id != ple->i_id ) )
+    if( !hasInput() )
         return;
 
 #ifndef NDEBUG
@@ -200,9 +162,13 @@ void InputManager::customEvent( QEvent *event )
         UpdateStats();
         break;
     case ItemChanged_Type:
-        UpdateStatus();
-        // UpdateName();
-        UpdateArt();
+        /* Ignore ItemChanged_Type event that does not apply to our input */
+        if( i_input_id == ple->i_id )
+        {
+            UpdateStatus();
+            // UpdateName();
+            UpdateArt();
+        }
         break;
     case ItemStateChanged_Type:
         // TODO: Fusion with above state
@@ -255,6 +221,7 @@ void InputManager::customEvent( QEvent *event )
         break;
     default:
         msg_Warn( p_intf, "This shouldn't happen: %i", i_type );
+        assert(0);
     }
 }
 




More information about the vlc-devel mailing list