]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/input_manager.hpp
Typo
[vlc] / modules / gui / qt4 / input_manager.hpp
index 79efe6cebab2c5cd0ba5d8b6fd80d142c02c2c56..26f1ea90b90905e096de2d8021d2bb27791431be 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * input_manager.hpp : Manage an input and interact with its GUI elements
  ****************************************************************************
- * Copyright (C) 2000-2005 the VideoLAN team
- * $Id: wxwidgets.cpp 15731 2006-05-25 14:43:53Z zorglub $
+ * Copyright (C) 2006-2007 the VideoLAN team
+ * $Id$
  *
  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
  *
 #ifndef _INPUT_MANAGER_H_
 #define _INPUT_MANAGER_H_
 
-#include <QObject>
 #include <vlc/vlc.h>
+#include <vlc_input.h>
+
+#include <QObject>
 
 class InputManager : public QObject
 {
@@ -33,19 +35,74 @@ class InputManager : public QObject
 public:
     InputManager( QObject *, intf_thread_t *);
     virtual ~InputManager();
-    void setInput( input_thread_t * );
 
+    void delInput();
+    bool hasInput() { return p_input && !p_input->b_dead && !p_input->b_die; }
+    bool hasAudio() { return b_has_audio; }
+    bool hasVideo() { return b_has_video; }
+    bool b_has_audio, b_has_video, b_had_audio, b_had_video;
 private:
     intf_thread_t *p_intf;
     input_thread_t *p_input;
-
+    int i_old_playing_status;
+    QString old_name;
+    int i_rate;
 public slots:
+    void togglePlayPause();
     void update(); ///< Periodic updates
+    void setInput( input_thread_t * ); ///< Our controlled input changed
     void sliderUpdate( float ); ///< User dragged the slider. We get new pos
+    void slower();
+    void faster();
+    void normalRate();
+    void setRate( int );
+    void sectionNext();
+    void sectionPrev();
+    void sectionMenu();
 signals:
     /// Send new position, new time and new length
     void positionUpdated( float , int, int );
-    void reset(); ///< Input changed, tell others to reset
+    void rateChanged( int );
+    void nameChanged( QString );
+    /// Used to signal whether we should show navigation buttons
+    void navigationChanged( int );
+    /// Play/pause status
+    void statusChanged( int );
+};
+
+class MainInputManager : public QObject
+{
+    Q_OBJECT;
+public:
+    static MainInputManager *getInstance( intf_thread_t *_p_intf )
+    {
+        if( !instance )
+            instance = new MainInputManager( _p_intf );
+        return instance;
+    }
+    static void killInstance()
+    {
+        if( instance ) delete instance;
+    }
+    virtual ~MainInputManager();
+    input_thread_t *getInput() { return p_input; };
+    InputManager *getIM() { return im; };
+
+private:
+    InputManager *im;
+    intf_thread_t *p_intf;
+    input_thread_t *p_input;
+    static MainInputManager *instance;
+    MainInputManager( intf_thread_t *);
+public slots:
+    void togglePlayPause();
+    void stop();
+    void next();
+    void prev();
+private slots:
+    void updateInput();
+signals:
+    void inputChanged( input_thread_t *);
 };