]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/interface_widgets.hpp
Qt4 - Fix art display in the bgWidget, fix one volume bug, fix fullscreen button
[vlc] / modules / gui / qt4 / components / interface_widgets.hpp
index 3a079c63bd2c2b4ecebba914ecd22bbbdf21ea2a..f81197bd18efb5a828190d5867e59e2b21a0bf4c 100644 (file)
 #ifndef _INTFWIDGETS_H_
 #define _INTFWIDGETS_H_
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 #include <vlc_interface.h>
-
 #include <vlc_aout.h>
+
 #include "qt4.hpp"
+#include "main_interface.hpp"
+#include "input_manager.hpp"
 
 #include <QWidget>
 #include <QFrame>
@@ -46,51 +52,50 @@ class QHBoxLayout;
 class VideoWidget : public QFrame
 {
     Q_OBJECT
+friend class MainInterface;
+
 public:
     VideoWidget( intf_thread_t * );
     virtual ~VideoWidget();
 
     void *request( vout_thread_t *, int *, int *,
                    unsigned int *, unsigned int * );
-    void release( void * );
-    int control( void *, int, va_list );
-
-    int i_video_height, i_video_width;
-    vout_thread_t *p_vout;
+    void  release( void * );
+    int   control( void *, int, va_list );
 
-    QSize widgetSize;
-    QSize sizeHint() const;
+    virtual QSize sizeHint() const;
 private:
-    QWidget *frame;
     intf_thread_t *p_intf;
+    vout_thread_t *p_vout;
+
     vlc_mutex_t lock;
+    QSize videoSize;
+
 signals:
-    void askResize();
     void askVideoWidgetToShow();
+    //void askResize();
+
 public slots:
     void SetSizing( unsigned int, unsigned int );
 };
 
 /******************** Background Widget ****************/
-class BackgroundWidget : public QFrame
+class BackgroundWidget : public QWidget
 {
     Q_OBJECT
 public:
     BackgroundWidget( intf_thread_t * );
     virtual ~BackgroundWidget();
-    QSize widgetSize;
-    QSize sizeHint() const;
-    bool b_need_update;
+
 private:
     QPalette plt;
     QLabel *label;
-    virtual void resizeEvent( QResizeEvent *e );
     virtual void contextMenuEvent( QContextMenuEvent *event );
     intf_thread_t *p_intf;
-    int i_runs;
+    virtual void resizeEvent( QResizeEvent * event );
 public slots:
     void toggle(){ TOGGLEV( this ); }
-    void update( input_thread_t * );
+    void updateArt( QString );
 };
 
 class VisualSelector : public QFrame
@@ -128,7 +133,9 @@ private:
 
 private slots:
     void snapshot();
+#if 0
     void frame();
+#endif
     void fromAtoB();
     void record();
     void AtoBLoop( float, int, int );
@@ -141,6 +148,7 @@ class QGridLayout;
 class VolumeClickHandler;
 class SoundSlider;
 class QAbstractSlider;
+class QToolButton;
 
 class ControlsWidget : public QFrame
 {
@@ -148,7 +156,6 @@ class ControlsWidget : public QFrame
 public:
     /* p_intf, advanced control visible or not, blingbling or not */
     ControlsWidget( intf_thread_t *, MainInterface*, bool, bool );
-//    QSize sizeHint() const;
     virtual ~ControlsWidget();
 
     QPushButton *playlistButton;
@@ -157,7 +164,6 @@ public:
     void enableVideo( bool );
 public slots:
     void setNavigation( int );
-    void updateOnTimer();
 protected:
     friend class MainInterface;
     friend class VolumeClickHandler;
@@ -169,7 +175,7 @@ private:
     InputSlider         *slider;
     QPushButton         *prevSectionButton, *nextSectionButton, *menuButton;
     QPushButton         *playButton, *fullscreenButton;
-    QPushButton         *slowerButton, *fasterButton;
+    QToolButton         *slowerButton, *fasterButton;
     AdvControlsWidget   *advControls;
     QLabel              *volMuteLabel;
     QAbstractSlider     *volumeSlider;
@@ -181,6 +187,8 @@ private slots:
     void prev();
     void next();
     void updateVolume( int );
+    void updateVolume( void );
+    void updateInput();
     void fullscreen();
     void extSettings();
     void faster();
@@ -231,6 +239,21 @@ signals:
     void timeLabelDoubleClicked();
 };
 
+class SpeedLabel : public QLabel
+{
+    Q_OBJECT
+public:
+    SpeedLabel( intf_thread_t *_p_intf, const QString text ): QLabel( text)
+    { p_intf = _p_intf; }
+
+protected:
+    virtual void mouseDoubleClickEvent ( QMouseEvent * event )
+    {
+        THEMIM->getIM()->setRate( INPUT_RATE_DEFAULT );
+    }
+private:
+    intf_thread_t *p_intf;
+};
 
 /******************** Speed Control Widgets ****************/
 class SpeedControlWidget : public QFrame
@@ -243,7 +266,8 @@ public:
 private:
     intf_thread_t *p_intf;
     QSlider *speedSlider;
-    QPushButton *normalSpeedButton;
+public slots:
+    void setEnable( bool );
 private slots:
     void updateRate( int );
     void resetRate();