]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/interface_widgets.hpp
Simplified/fixed qt4 fullscreen implementation.
[vlc] / modules / gui / qt4 / components / interface_widgets.hpp
index 269f79a9a7bd8deee1770ab1c584a6dd1f9e614b..16af5fe99effbdadfcfe28ea6e0f7d74c31be6b3 100644 (file)
 #include "components/controller.hpp"
 #include "components/controller_widget.hpp"
 
-//#include <vlc_aout.h> Visualizer
-
 #include <QWidget>
 #include <QFrame>
 #include <QLabel>
 #include <QMouseEvent>
 
 class ResizeEvent;
-class QPalette;
 class QPixmap;
 class QHBoxLayout;
 class QMenu;
+class QSlider;
 
 /******************** Video Widget ****************/
 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 * );
+    WId request( int *, int *, unsigned int *, unsigned int *, bool );
     void  release( void );
     int   control( void *, int, va_list );
-
-    virtual QSize sizeHint() const;
+    void  sync( void );
 
 protected:
     virtual QPaintEngine *paintEngine() const
@@ -72,20 +66,16 @@ protected:
         return NULL;
     }
 
-    virtual void paintEvent(QPaintEvent *);
-
 private:
     intf_thread_t *p_intf;
-    vout_thread_t *p_vout;
-
-    QSize videoSize;
 
+    QWidget *stable;
+    QLayout *layout;
 signals:
-    void askVideoWidgetToShow( unsigned int, unsigned int );
+    void sizeChanged( int, int );
 
 public slots:
     void SetSizing( unsigned int, unsigned int );
-
 };
 
 /******************** Background Widget ****************/
@@ -94,18 +84,18 @@ class BackgroundWidget : public QWidget
     Q_OBJECT
 public:
     BackgroundWidget( intf_thread_t * );
-    virtual ~BackgroundWidget();
-
+    void setExpandstoHeight( bool b_expand ) { b_expandPixmap = b_expand; }
 private:
-    QPalette plt;
-    QLabel *label;
+    QString pixmapUrl;
+    bool b_expandPixmap;
     virtual void contextMenuEvent( QContextMenuEvent *event );
     intf_thread_t *p_intf;
-    virtual void resizeEvent( QResizeEvent * event );
-
+protected:
+    void paintEvent( QPaintEvent *e );
+    static const int MARGIN = 5;
 public slots:
     void toggle(){ TOGGLEV( this ); }
-    void updateArt( QString );
+    void updateArt( const QString& );
 };
 
 #if 0
@@ -133,40 +123,54 @@ protected:
     virtual void mousePressEvent( QMouseEvent *event )
     {
         toggleTimeDisplay();
+        event->accept();
     }
     virtual void mouseDoubleClickEvent( QMouseEvent *event )
     {
+        event->accept();
         toggleTimeDisplay();
         emit timeLabelDoubleClicked();
     }
 private:
     intf_thread_t *p_intf;
     bool b_remainingTime;
+    int cachedLength;
+    QTimer *bufTimer;
+    float bufVal;
+    bool buffering;
+    bool showBuffering;
+    char psz_length[MSTRTIME_MAX_SIZE];
+    char psz_time[MSTRTIME_MAX_SIZE];
     void toggleTimeDisplay();
+    void paintEvent( QPaintEvent* );
 signals:
     void timeLabelDoubleClicked();
 private slots:
-    void setDisplayPosition( float pos, int time, int length );
-    void setCaching( float );
+    void setDisplayPosition( float pos, int64_t time, int length );
+    void setDisplayPosition( float pos );
+    void updateBuffering( float );
+    void updateBuffering();
 };
 
 class SpeedLabel : public QLabel
 {
     Q_OBJECT
 public:
-    SpeedLabel( intf_thread_t *, const QString );
+    SpeedLabel( intf_thread_t *, QWidget * );
+    virtual ~SpeedLabel();
 
 protected:
-    virtual void mouseDoubleClickEvent ( QMouseEvent * event )
+    virtual void mousePressEvent ( QMouseEvent * event )
     {
-        THEMIM->getIM()->setRate( INPUT_RATE_DEFAULT );
+        showSpeedMenu( event->pos() );
     }
 private slots:
     void showSpeedMenu( QPoint );
-    void setRate( int );
+    void setRate( float );
 private:
     intf_thread_t *p_intf;
     QMenu *speedControlMenu;
+    QString tooltipStringPattern;
     SpeedControlWidget *speedControl;
 };
 
@@ -176,10 +180,11 @@ class SpeedControlWidget : public QFrame
     Q_OBJECT
 public:
     SpeedControlWidget( intf_thread_t *, QWidget * );
-    void updateControls( int );
+    void updateControls( float );
 private:
     intf_thread_t *p_intf;
     QSlider *speedSlider;
+    int lastValue;
 
 public slots:
     void activateOnState();
@@ -200,15 +205,15 @@ private:
     intf_thread_t *p_intf;
 
 public slots:
-    void requestUpdate() { emit updateRequested(); };
+    void requestUpdate() { emit updateRequested(); }
     void update( )
     {
         requestUpdate();
     }
+    void showArtUpdate( const QString& );
 
 private slots:
-    void doUpdate();
-    void doUpdate(QString);
+    void askForUpdate();
 
 signals:
     void updateRequested();