]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/interface_widgets.hpp
Qt4 - Update check every x days. Put it in the preferences, and in the privacy Dialog...
[vlc] / modules / gui / qt4 / components / interface_widgets.hpp
index 2b11a50a22ea29977f7bb1e060f6689c0bcabb1d..9ef01c11ac7d7c81cf2862eb6a794cd0b5d2ee2b 100644 (file)
@@ -6,6 +6,7 @@
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Jean-Baptiste Kempf <jb@videolan.org>
+ *          Rafaël Carré <funman@videolanorg>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #ifndef _INTFWIDGETS_H_
 #define _INTFWIDGETS_H_
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 #include <vlc_interface.h>
 
@@ -33,6 +38,7 @@
 
 #include <QWidget>
 #include <QFrame>
+#define VOLUME_MAX 200
 
 class ResizeEvent;
 class QPalette;
@@ -50,43 +56,40 @@ public:
 
     void *request( vout_thread_t *, int *, int *,
                    unsigned int *, unsigned int * );
-    void release( void * );
-    int control( void *, int, va_list );
+    void  release( void * );
+    int   control( void *, int, va_list );
 
-    int i_video_height, i_video_width;
-    vout_thread_t *p_vout;
-
-    QSize widgetSize;
-    virtual QSize sizeHint() const;
 private:
-    QWidget *frame;
     intf_thread_t *p_intf;
+    vout_thread_t *p_vout;
+
     vlc_mutex_t lock;
+
 signals:
-    void askResize();
-private slots:
-    void SetMinSize();
+    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;
-    virtual QSize sizeHint() const;
+
 private:
     QPalette plt;
     QLabel *label;
-    QHBoxLayout *backgroundLayout;
-    virtual void resizeEvent( QResizeEvent *e );
-    int DrawBackground();
-    int CleanBackground();
+    virtual void contextMenuEvent( QContextMenuEvent *event );
     intf_thread_t *p_intf;
-private slots:
-    void setArt( QString );
+
+public slots:
+    void toggle(){ TOGGLEV( this ); }
+    void update( QString );
 };
 
 class VisualSelector : public QFrame
@@ -103,6 +106,7 @@ private slots:
     void next();
 };
 
+/* Advanced Button Bar */
 class QPushButton;
 class AdvControlsWidget : public QFrame
 {
@@ -110,59 +114,82 @@ class AdvControlsWidget : public QFrame
 public:
     AdvControlsWidget( intf_thread_t *);
     virtual ~AdvControlsWidget();
+
     void enableInput( bool );
     void enableVideo( bool );
+
 private:
     intf_thread_t *p_intf;
-    QPushButton *normalButton;
-    QPushButton *snapshotButton;
+    QPushButton *recordButton, *ABButton;
+    QPushButton *snapshotButton, *frameButton;
+
+    mtime_t timeA, timeB;
+
 private slots:
-    void normal();
     void snapshot();
-    void fullscreen();
+#if 0
+    void frame();
+#endif
+    void fromAtoB();
+    void record();
+    void AtoBLoop( float, int, int );
 };
 
+/* Button Bar */
 class InputSlider;
 class QSlider;
 class QGridLayout;
 class VolumeClickHandler;
+class SoundSlider;
+class QAbstractSlider;
+class QToolButton;
+
 class ControlsWidget : public QFrame
 {
     Q_OBJECT
 public:
-    ControlsWidget( intf_thread_t *);
+    /* p_intf, advanced control visible or not, blingbling or not */
+    ControlsWidget( intf_thread_t *, MainInterface*, bool, bool );
     virtual ~ControlsWidget();
 
     QPushButton *playlistButton;
-    QSlider *volumeSlider;
     void setStatus( int );
     void enableInput( bool );
     void enableVideo( bool );
 public slots:
     void setNavigation( int );
-    void updateOnTimer();
 protected:
     friend class MainInterface;
     friend class VolumeClickHandler;
 private:
-    intf_thread_t *p_intf;
-    QFrame *discFrame;
-    QGridLayout *controlLayout;
+    intf_thread_t       *p_intf;
+    QWidget             *discFrame;
+    QWidget             *telexFrame;
+    QGridLayout         *controlLayout;
     InputSlider         *slider;
-    QPushButton *prevSectionButton, *nextSectionButton, *menuButton;
-    QPushButton *playButton, *fullscreenButton;
-    QPushButton *slowerButton, *fasterButton;
+    QPushButton         *prevSectionButton, *nextSectionButton, *menuButton;
+    QPushButton         *playButton, *fullscreenButton;
+    QToolButton         *slowerButton, *fasterButton;
+    AdvControlsWidget   *advControls;
+    QLabel              *volMuteLabel;
+    QAbstractSlider     *volumeSlider;
+
+    bool                 b_advancedVisible;
 private slots:
     void play();
     void stop();
     void prev();
     void next();
     void updateVolume( int );
+    void updateVolume( void );
+    void updateInput();
     void fullscreen();
     void extSettings();
-    void prefs();
     void faster();
     void slower();
+    void toggleAdvanced();
+signals:
+    void advancedControlsToggled( bool );
 };
 
 class VolumeClickHandler : public QObject
@@ -173,9 +200,12 @@ public:
     virtual ~VolumeClickHandler() {};
     bool eventFilter( QObject *obj, QEvent *e )
     {
-        if (e->type() == QEvent::MouseButtonPress )
+        if (e->type() == QEvent::MouseButtonPress  )
         {
             aout_VolumeMute( p_intf, NULL );
+            audio_volume_t i_volume;
+            aout_VolumeGet( p_intf, &i_volume );
+            m->updateVolume( i_volume *  VOLUME_MAX / (AOUT_VOLUME_MAX/2) );
             return true;
         }
         return false;
@@ -185,36 +215,39 @@ private:
     intf_thread_t *p_intf;
 };
 
+#include <QLabel>
+#include <QMouseEvent>
+class TimeLabel : public QLabel
+{
+    Q_OBJECT
+    void mousePressEvent( QMouseEvent *event )
+    {
+        emit timeLabelClicked();
+    }
+    void mouseDoubleClickEvent( QMouseEvent *event )
+    {
+        emit timeLabelDoubleClicked();
+    }
+signals:
+    void timeLabelClicked();
+    void timeLabelDoubleClicked();
+};
 
-/******************** Playlist Widgets ****************/
-#include <QModelIndex>
-#include <QSplitter>
-class QSignalMapper;
-class PLSelector;
-class PLPanel;
-class QPushButton;
 
-class PlaylistWidget : public QSplitter
+/******************** Speed Control Widgets ****************/
+class SpeedControlWidget : public QFrame
 {
-    Q_OBJECT;
+    Q_OBJECT
 public:
-    PlaylistWidget( intf_thread_t *_p_i ) ;
-    virtual ~PlaylistWidget();
-    QSize widgetSize;
-    virtual QSize sizeHint() const;
+    SpeedControlWidget( intf_thread_t *);
+    virtual ~SpeedControlWidget();
+    void updateControls( int );
 private:
-    PLSelector *selector;
-    PLPanel *rightPanel;
-    QPushButton *addButton;
-    QLabel *art;
-    QString prevArt;
-protected:
-     intf_thread_t *p_intf;
+    intf_thread_t *p_intf;
+    QSlider *speedSlider;
 private slots:
-    void setArt( QString );
-signals:
-    void rootChanged( int );
-    void artSet( QString );
+    void updateRate( int );
+    void resetRate();
 };
 
 #endif