]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/interface_widgets.hpp
Qt4: remove bogus vlc_aout.h dependencies
[vlc] / modules / gui / qt4 / components / interface_widgets.hpp
index 13eecc9b50b1d58012a8bb87eaf63ebcd9cd85e2..f80aab3d837cac026e69d041faec6376e9b3aba7 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * interface_widgets.hpp : Custom widgets for the main interface
  ****************************************************************************
- * Copyright (C) 2006 the VideoLAN team
+ * Copyright (C) 2006-2008 the VideoLAN team
  * $Id$
  *
  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
 # include "config.h"
 #endif
 
-#include <vlc_common.h>
-#include <vlc_interface.h>
-#include <vlc_aout.h>
+#include "main_interface.hpp" /* Interface integration */
+#include "input_manager.hpp"  /* Speed control */
 
-#include "qt4.hpp"
-#include "main_interface.hpp"
 #include "components/controller.hpp"
+#include "components/controller_widget.hpp"
 
 #include <QWidget>
 #include <QFrame>
@@ -47,19 +45,21 @@ class ResizeEvent;
 class QPalette;
 class QPixmap;
 class QHBoxLayout;
+class QMenu;
+class ReparentableWidget;
 
 /******************** Video Widget ****************/
 class VideoWidget : public QFrame
 {
     Q_OBJECT
-friend class MainInterface;
+friend class ReparentableWidget;
 
 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 );
 
@@ -71,20 +71,19 @@ protected:
         return NULL;
     }
 
-    virtual void paintEvent(QPaintEvent *);
-
 private:
     intf_thread_t *p_intf;
-    vout_thread_t *p_vout;
 
     QSize videoSize;
+    QWidget *reparentable;
+    QLayout *layout;
 
 signals:
-    void askVideoWidgetToShow( unsigned int, unsigned int );
+    void keyPressed( QKeyEvent * );
 
 public slots:
     void SetSizing( unsigned int, unsigned int );
-
+    void SetFullScreen( bool );
 };
 
 /******************** Background Widget ****************/
@@ -104,7 +103,7 @@ private:
 
 public slots:
     void toggle(){ TOGGLEV( this ); }
-    void updateArt( input_item_t* );
+    void updateArt( const QString& );
 };
 
 #if 0
@@ -123,19 +122,6 @@ private slots:
 };
 #endif
 
-#define VOLUME_MAX 200
-class VolumeClickHandler : public QObject
-{
-public:
-    VolumeClickHandler( intf_thread_t *_p_intf, SoundWidget *_m ) : QObject(_m)
-    {m = _m; p_intf = _p_intf; }
-    virtual ~VolumeClickHandler() {};
-    virtual bool eventFilter( QObject *obj, QEvent *e );
-private:
-    SoundWidget *m;
-    intf_thread_t *p_intf;
-};
-
 class TimeLabel : public QLabel
 {
     Q_OBJECT
@@ -145,9 +131,11 @@ protected:
     virtual void mousePressEvent( QMouseEvent *event )
     {
         toggleTimeDisplay();
+        event->accept();
     }
     virtual void mouseDoubleClickEvent( QMouseEvent *event )
     {
+        event->accept();
         toggleTimeDisplay();
         emit timeLabelDoubleClicked();
     }
@@ -159,22 +147,28 @@ signals:
     void timeLabelDoubleClicked();
 private slots:
     void setDisplayPosition( float pos, int time, int length );
+    void setCaching( float );
 };
 
 class SpeedLabel : public QLabel
 {
     Q_OBJECT
 public:
-    SpeedLabel( intf_thread_t *_p_intf, const QString text ): QLabel( text)
-    { p_intf = _p_intf; }
+    SpeedLabel( intf_thread_t *, const QString&, 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 );
 private:
     intf_thread_t *p_intf;
+    QMenu *speedControlMenu;
+    SpeedControlWidget *speedControl;
 };
 
 /******************** Speed Control Widgets ****************/
@@ -182,14 +176,15 @@ class SpeedControlWidget : public QFrame
 {
     Q_OBJECT
 public:
-    SpeedControlWidget( intf_thread_t *);
-    virtual ~SpeedControlWidget();
+    SpeedControlWidget( intf_thread_t *, QWidget * );
     void updateControls( int );
 private:
     intf_thread_t *p_intf;
     QSlider *speedSlider;
+
 public slots:
-    void setEnable( bool );
+    void activateOnState();
+
 private slots:
     void updateRate( int );
     void resetRate();
@@ -199,26 +194,22 @@ 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 ); };
+    CoverArtLabel( QWidget *parent, intf_thread_t * );
+    virtual ~CoverArtLabel();
+
 private:
-    input_item_t *p_input;
-    vlc_object_t *p_this;
-    QString prevArt;
+    intf_thread_t *p_intf;
 
 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(); }
+    void update( )
+    {
+        requestUpdate();
+    }
+    void showArtUpdate( const QString& );
 
 private slots:
-    void doUpdate();
-    void downloadCover();
+    void askForUpdate();
 
 signals:
     void updateRequested();