]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/input_manager.hpp
Fix sorting of plugin scores in the QT plugin dialog.
[vlc] / modules / gui / qt4 / input_manager.hpp
index a55c3fd149074a64edb1ff2f72273194d153a2ca..522f02f59434771fa2fcdb8c665bd870a0a335d7 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#ifndef _INPUT_MANAGER_H_
-#define _INPUT_MANAGER_H_
+#ifndef QVLC_INPUT_MANAGER_H_
+#define QVLC_INPUT_MANAGER_H_
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
 
 #include <vlc_input.h>
-#include <vlc_vout.h>
 
 #include "qt4.hpp"
 
@@ -56,9 +55,9 @@ enum {
     SynchroChanged_Type,
     CachingEvent_Type,
     BookmarksChanged_Type,
-/*    RecordingEvent_Type,
+    RecordingEvent_Type,
     ProgramChanged_Type,
-    SignalChanged_Type, */
+/*    SignalChanged_Type, */
 
     FullscreenControlToggle_Type = QEvent::User + IMEventType + 20,
     FullscreenControlShow_Type,
@@ -70,12 +69,20 @@ class IMEvent : public QEvent
 {
 friend class InputManager;
     public:
-    IMEvent( int type, int id ) : QEvent( (QEvent::Type)(type) )
-    { i_id = id ; } ;
-    virtual ~IMEvent() {};
+    IMEvent( int 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 );
+    }
 
 private:
-    int i_id;
+    input_item_t *p_item;
 };
 
 class InputManager : public QObject
@@ -105,7 +112,7 @@ public:
 private:
     intf_thread_t  *p_intf;
     input_thread_t *p_input;
-    int             i_input_id;
+    input_item_t   *p_item;
     int             i_old_playing_status;
     QString         oldName;
     QString         artUrl;
@@ -128,12 +135,13 @@ private:
     void UpdateArt();
     void UpdateInfo();
     void UpdateMeta();
+    void UpdateMeta(input_item_t *);
     void UpdateVout();
     void UpdateAout();
     void UpdateStats();
     void UpdateCaching();
-
-    void AtoBLoop( int );
+    void UpdateRecord();
+    void UpdateProgramEvent();
 
 public slots:
     void setInput( input_thread_t * ); ///< Our controlled input changed
@@ -142,8 +150,13 @@ public slots:
     void reverse();
     void slower();
     void faster();
+    void littlefaster();
+    void littleslower();
     void normalRate();
     void setRate( int );
+    /* Jumping */
+    void jumpFwd();
+    void jumpBwd();
     /* Menus */
     void sectionNext();
     void sectionPrev();
@@ -151,29 +164,31 @@ public slots:
     /* Teletext */
     void telexSetPage( int );          ///< Goto teletext page
     void telexSetTransparency( bool ); ///< Transparency on teletext background
-    void telexActivation( bool );      ///< Enable disable teletext buttons
     void activateTeletext( bool );     ///< Toggle buttons after click
     /* A to B Loop */
     void setAtoB();
 
 private slots:
     void togglePlayPause();
+    void AtoBLoop( float, int, int );
 
 signals:
     /// Send new position, new time and new length
     void positionUpdated( float , int, int );
     void rateChanged( int );
-    void nameChanged( QString );
+    void nameChanged( const QString& );
     /// Used to signal whether we should show navigation buttons
     void titleChanged( bool );
     void chapterChanged( bool );
     /// Statistics are updated
     void statisticsUpdated( input_item_t* );
     void infoChanged( input_item_t* );
-    void metaChanged( input_item_t* );
+    void currentMetaChanged( input_item_t* );
+    void metaChanged( input_item_t *);
     void artChanged( QString );
     /// Play/pause status
     void statusChanged( int );
+    void recordingStateChanged( bool );
     /// Teletext
     void teletextPossible( bool );
     void teletextActivated( bool );
@@ -183,10 +198,13 @@ signals:
     void AtoBchanged( bool, bool );
     /// Vout
     void voutChanged( bool );
+    void voutListChanged( vout_thread_t **pp_vout, int i_vout );
+    /// Other
     void synchroChanged();
     void bookmarksChanged();
     void cachingChanged( float );
-    void voutListChanged( vout_thread_t **pp_vout, int i_vout );
+    /// Program Event changes
+    void encryptionChanged( bool );
 };
 
 class MainInputManager : public QObject
@@ -201,27 +219,20 @@ public:
     }
     static void killInstance()
     {
-        if( instance ) delete instance;
+        delete instance;
+        instance = NULL;
     }
-    virtual ~MainInputManager();
 
     input_thread_t *getInput() { return p_input; };
     InputManager *getIM() { return im; };
-    vout_thread_t * getVout()
-    {
-        vout_thread_t **pp_vout; int i_vout;
-        if( !input_Control( p_input, INPUT_GET_VOUTS, &pp_vout, &i_vout ) )
-        {
-            for( int i = 1; i < i_vout; i++ ) vlc_object_release( pp_vout[i]);
-            vout_thread_t *p_tmp = pp_vout[0];
-            free( pp_vout );
-            return p_tmp;
-        }
-        return NULL;
-    }
+
+    vout_thread_t* getVout();
+    aout_instance_t *getAout();
 
 private:
     MainInputManager( intf_thread_t * );
+    virtual ~MainInputManager();
+
     static MainInputManager *instance;
 
     void customEvent( QEvent * );
@@ -235,6 +246,7 @@ public slots:
     void stop();
     void next();
     void prev();
+    void activatePlayQuit( bool );
 
 signals:
     void inputChanged( input_thread_t * );