]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/interface_widgets.hpp
Qt: sorry guys, record works very fine actually...
[vlc] / modules / gui / qt4 / components / interface_widgets.hpp
index 911eb89bac5e70d016315b43bfc8565b1655a46c..85d50e1ce8102b8250869c84f100231a662a6d90 100644 (file)
 #include <QWidget>
 #include <QFrame>
 
-#define VOLUME_MAX 200
-
-/* on WIN32 hide() for fullscreen controller doesnt work, so it have to be
-   done by trick with setting the opacity of window */
-#ifdef WIN32
-    #define WIN32TRICK
-#endif
-
-/* to trying transparency with fullscreen controller on windows enable that */
-/* it can be enabled on-non windows systems,
-   but it will be transparent only with composite manager */
-#ifndef WIN32
-    #define HAVE_TRANSPARENCY 1
-#else
-    #define HAVE_TRANSPARENCY 0
-#endif
-
-/* Default value of opacity for FS controller */
-#define DEFAULT_OPACITY 0.75
-
 class ResizeEvent;
 class QPalette;
 class QPixmap;
@@ -120,9 +100,10 @@ private:
     virtual void resizeEvent( QResizeEvent * event );
 public slots:
     void toggle(){ TOGGLEV( this ); }
-    void updateArt( QString );
+    void updateArt( input_item_t* );
 };
 
+#if 0
 class VisualSelector : public QFrame
 {
     Q_OBJECT
@@ -136,6 +117,7 @@ private slots:
     void prev();
     void next();
 };
+#endif
 
 /* Advanced Button Bar */
 class QPushButton;
@@ -143,7 +125,7 @@ class AdvControlsWidget : public QFrame
 {
     Q_OBJECT
 public:
-    AdvControlsWidget( intf_thread_t *);
+    AdvControlsWidget( intf_thread_t *, bool );
     virtual ~AdvControlsWidget();
 
     void enableInput( bool );
@@ -154,7 +136,8 @@ private:
     QPushButton *recordButton, *ABButton;
     QPushButton *snapshotButton, *frameButton;
 
-    mtime_t timeA, timeB;
+    static mtime_t timeA, timeB;
+    int i_last_input_id;
 
 private slots:
     void snapshot();
@@ -164,6 +147,10 @@ private slots:
     void fromAtoB();
     void record();
     void AtoBLoop( float, int, int );
+    void setIcon();
+
+signals:
+    void timeChanged();
 };
 
 /* Button Bar */
@@ -187,7 +174,6 @@ public:
     QPushButton *playlistButton;
     void setStatus( int );
     void enableInput( bool );
-    void enableVideo( bool );
 public slots:
     void setNavigation( int );
 protected:
@@ -229,10 +215,29 @@ protected slots:
     void toggleTeletext();
     void toggleTeletextTransparency();
     void enableTeletext( bool );
+    void enableVideo( bool );
 signals:
     void advancedControlsToggled( bool );
 };
 
+/* on WIN32 hide() for fullscreen controller doesnt work, so it have to be
+   done by trick with setting the opacity of window */
+#ifdef WIN32
+    #define WIN32TRICK
+#endif
+
+/* to trying transparency with fullscreen controller on windows enable that */
+/* it can be enabled on-non windows systems,
+   but it will be transparent only with composite manager */
+#ifndef WIN32
+    #define HAVE_TRANSPARENCY 1
+#else
+    #define HAVE_TRANSPARENCY 0
+#endif
+
+/* Default value of opacity for FS controller */
+#define DEFAULT_OPACITY 0.75
+
 /***********************************
  * Fullscreen controller
  ***********************************/
@@ -245,7 +250,7 @@ public:
 
     /* */
     void attachVout( vout_thread_t *p_vout );
-    void detachVout( vout_thread_t *p_vout );
+    void detachVout();
     void fullscreenChanged( vout_thread_t *, bool b_fs, int i_timeout );
 
 protected:
@@ -281,11 +286,13 @@ private:
     int  i_slow_hide_timeout;
 
 #ifdef WIN32TRICK
-    bool fscHidden;
+    bool b_fscHidden;
 #endif
 
     virtual void customEvent( QEvent *event );
 
+    vout_thread_t *p_vout;
+
     /* Shared variable between FSC and VLC (protected by a lock) */
     vlc_mutex_t lock;
     bool        b_fullscreen;
@@ -293,7 +300,7 @@ private:
 };
 
 
-
+#define VOLUME_MAX 200
 class VolumeClickHandler : public QObject
 {
 public:
@@ -369,4 +376,33 @@ private slots:
     void resetRate();
 };
 
+class CoverArtLabel : public QLabel
+{
+    Q_OBJECT
+public:
+    CoverArtLabel( QWidget *parent,
+                   vlc_object_t *p_this,
+                   input_item_t *p_input = NULL );
+    virtual ~CoverArtLabel()
+            { if( p_input ) vlc_gc_decref( p_input ); };
+private:
+    input_item_t *p_input;
+    vlc_object_t *p_this;
+    QString prevArt;
+
+public slots:
+    void requestUpdate() { emit updateRequested(); };
+    void update( input_item_t* p_item )
+            { if( p_input ) vlc_gc_decref( p_input );
+              if( ( p_input = p_item ) ) vlc_gc_incref( p_input );
+              requestUpdate(); }
+
+private slots:
+    void doUpdate();
+    void downloadCover();
+
+signals:
+    void updateRequested();
+};
+
 #endif