]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/input_manager.hpp
Qt: SoutInputBox: show decoded mrl (fix #8436 part1)
[vlc] / modules / gui / qt4 / input_manager.hpp
index 00671846241558177cead316997f32e484d72b22..dcf23ee0f7943c8ee2acdfa2ff8105803a3e7ecc 100644 (file)
 
 #include "qt4.hpp"
 #include "util/singleton.hpp"
-#include "util/uniqueevent.hpp"
-#include "variables.hpp"
+#include "adapters/variables.hpp"
 
 #include <QObject>
 #include <QEvent>
 
-enum {
-    PositionUpdate_Type = QEvent::User + IMEventTypeOffset + 1,
-    ItemChanged_Type,
-    ItemStateChanged_Type,
-    ItemTitleChanged_Type,
-    ItemRateChanged_Type,
-    ItemEsChanged_Type,
-    ItemTeletextChanged_Type,
-    InterfaceVoutUpdate_Type,
-    StatisticsUpdate_Type, /*10*/
-    InterfaceAoutUpdate_Type,
-    MetaChanged_Type,
-    NameChanged_Type,
-    InfoChanged_Type,
-    SynchroChanged_Type,
-    CachingEvent_Type,
-    BookmarksChanged_Type,
-    RecordingEvent_Type,
-    ProgramChanged_Type,
-    RandomChanged_Type,
-    LoopOrRepeatChanged_Type,
-    EPGEvent_Type,
-/*    SignalChanged_Type, */
-
-    FullscreenControlToggle_Type = QEvent::User + IMEventTypeOffset + 20,
-    FullscreenControlShow_Type,
-    FullscreenControlHide_Type,
-    FullscreenControlPlanHide_Type,
-};
-
 enum { NORMAL,    /* loop: 0, repeat: 0 */
        REPEAT_ONE,/* loop: 0, repeat: 1 */
        REPEAT_ALL,/* loop: 1, repeat: 0 */
 };
 
-class IMEvent : public UniqueEvent
+class IMEvent : public QEvent
 {
-    public:
-    IMEvent( int type, input_item_t *p_input = NULL )
-        : UniqueEvent( (QEvent::Type)(type) )
+public:
+    enum event_types {
+        PositionUpdate = QEvent::User + IMEventTypeOffset + 1,
+        ItemChanged,
+        ItemStateChanged,
+        ItemTitleChanged,
+        ItemRateChanged,
+        ItemEsChanged,
+        ItemTeletextChanged,
+        InterfaceVoutUpdate,
+        StatisticsUpdate, /*10*/
+        InterfaceAoutUpdate,
+        MetaChanged,
+        NameChanged,
+        InfoChanged,
+        SynchroChanged,
+        CachingEvent,
+        BookmarksChanged,
+        RecordingEvent,
+        ProgramChanged,
+        RandomChanged,
+        LoopOrRepeatChanged,
+        EPGEvent,
+    /*    SignalChanged, */
+
+        FullscreenControlToggle = QEvent::User + IMEventTypeOffset + 20,
+        FullscreenControlShow,
+        FullscreenControlHide,
+        FullscreenControlPlanHide,
+    };
+
+    IMEvent( event_types type, input_item_t *p_input = NULL )
+        : QEvent( (QEvent::Type)(type) )
     {
         if( (p_item = p_input) != NULL )
             vlc_gc_incref( p_item );
     }
+
     virtual ~IMEvent()
     {
         if( p_item )
             vlc_gc_decref( p_item );
     }
+
     input_item_t *item() const { return p_item; };
-    virtual bool equals(UniqueEvent *e) const
-    {
-        IMEvent *ev = static_cast<IMEvent *>(e);
-        return ( ev->item() == p_item && ev->type() == type() );
-    }
+
 private:
     input_item_t *p_item;
 };
@@ -103,15 +100,17 @@ class PLEvent : public QEvent
 public:
     enum PLEventTypes
     {
-        PLItemAppended_Type = QEvent::User + PLEventTypeOffset + 1,
-        PLItemRemoved_Type,
-        LeafToParent_Type,
-        PLEmpty_Type
+        PLItemAppended = QEvent::User + PLEventTypeOffset + 1,
+        PLItemRemoved,
+        LeafToParent,
+        PLEmpty
     };
+
     PLEvent( PLEventTypes t, int i, int p = 0 )
         : QEvent( (QEvent::Type)(t) ), i_item(i), i_parent(p) {}
     int getItemId() const { return i_item; };
     int getParentId() const { return i_parent; };
+
 private:
     /* Needed for "playlist-item*" and "leaf-to-parent" callbacks
      * !! Can be a input_item_t->i_id or a playlist_item_t->i_id */
@@ -134,8 +133,7 @@ public:
     {
         return p_input /* We have an input */
             && !p_input->b_dead /* not dead yet, */
-            && !p_input->b_eof  /* not EOF either, */
-            && vlc_object_alive (p_input); /* and the VLC object is alive */
+            && !p_input->b_eof  /* not EOF either */;
     }
 
     int playingStatus();
@@ -143,10 +141,10 @@ public:
     bool hasVideo() { return hasInput() && b_video; }
     bool hasVisualisation();
     void requestArtUpdate( input_item_t *p_item );
+    void setArt( input_item_t *p_item, QString fileUrl );
 
     QString getName() { return oldName; }
     static const QString decodeArtURL( input_item_t *p_item );
-    void postUniqueEvent( QObject *, UniqueEvent * );
 
 private:
     intf_thread_t  *p_intf;
@@ -162,7 +160,6 @@ private:
     mtime_t         timeA, timeB;
 
     void customEvent( QEvent * );
-    RateLimitedEventPoster *rateLimitedEventPoster;
 
     void addCallbacks();
     void delCallbacks();
@@ -256,6 +253,7 @@ class MainInputManager : public QObject, public Singleton<MainInputManager>
 {
     Q_OBJECT
     friend class Singleton<MainInputManager>;
+
 public:
     input_thread_t *getInput() { return p_input; }
     InputManager *getIM() { return im; }
@@ -271,6 +269,7 @@ public:
     bool hasEmptyPlaylist();
 
     void requestVoutUpdate() { return im->UpdateVout(); }
+
 private:
     MainInputManager( intf_thread_t * );
     virtual ~MainInputManager();
@@ -296,11 +295,13 @@ public slots:
     void activatePlayQuit( bool );
 
     void loopRepeatLoopStatus();
+
 private slots:
     void notifyRandom( bool );
     void notifyRepeatLoop( bool );
     void notifyVolume( float );
     void notifyMute( bool );
+
 signals:
     void inputChanged( input_thread_t * );
     void volumeChanged( float );