]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/controller.hpp
Qt: FSC, don't move if you clicked on a button (and not the plain controller )
[vlc] / modules / gui / qt4 / components / controller.hpp
index 759ccd6cea372c028f0ae9264d6132fc96e5e5ed..4b43d56175530fe738a210c61d249ededa31223b 100644 (file)
@@ -21,8 +21,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#ifndef _CONTROLLER_H_
-#define _CONTROLLER_H_
+#ifndef QVLC_CONTROLLER_H_
+#define QVLC_CONTROLLER_H_
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #include <QFrame>
 #include <QString>
 
-#define I_PLAY_TOOLTIP N_("Play\nIf the playlist is empty, open a media")
-
-#define MAIN_TB1_DEFAULT "64;38;64;37-4;65"
-#define MAIN_TB2_DEFAULT "0-2;64;3;1;4;64;7;10;9;64-4;36-4;65;35-4"
+#define MAIN_TB1_DEFAULT "64;39;64;38;65"
+#define MAIN_TB2_DEFAULT "0-2;64;3;1;4;64;7;10;9;64-4;37;65;35-4"
 #define ADV_TB_DEFAULT "12;11;13;14"
-#define INPT_TB_DEFAULT "5-1;33;6-1"
-#define FSC_TB_DEFAULT "0-2;64;3;1;4;64;36;64;37;64;8;65;35-4;34"
+#define INPT_TB_DEFAULT "5-1;15-1;33;6-1"
+#define FSC_TB_DEFAULT "0-2;64;3;1;4;64;37;64;38;64;8;65;35-4;34"
 
+#define I_PLAY_TOOLTIP N_("Play\nIf the playlist is empty, open a medium")
 
 class QPixmap;
 class QLabel;
@@ -52,6 +51,7 @@ class QBoxLayout;
 class QAbstractSlider;
 class QAbstractButton;
 class InputSlider;
+class QToolButton;
 
 class VolumeClickHandler;
 class WidgetListing;
@@ -79,12 +79,14 @@ typedef enum buttonType_e
     REVERSE_BUTTON,
     SKIP_BACK_BUTTON,
     SKIP_FW_BUTTON,
+    QUIT_BUTTON,
     BUTTON_MAX,
 
     SPLITTER = 0x20,
     INPUT_SLIDER,
     TIME_LABEL,
     VOLUME,
+    VOLUME_SPECIAL,
     MENU_BUTTONS,
     TELETEXT_BUTTONS,
     ADVANCED_CONTROLLER,
@@ -96,22 +98,25 @@ typedef enum buttonType_e
 } buttonType_e;
 
 
-static const QString nameL[BUTTON_MAX] = { "Play", "Stop", "Open",
-    "Previous", "Next", "Slower", "Faster", "Fullscreen", "De-Fullscreen",
-    "Extended panel", "Playlist", "Snapshot", "Record", "A->B Loop",
-    "Frame By Frame", "Reverse", "Skip backward" , "Skip forward" };
-static const QString tooltipL[BUTTON_MAX] = { I_PLAY_TOOLTIP,
-    _("Stop playback"), _("Open a media"),
-    _("Previous media in the playlist"),
-    _("Next media in the playlist"), _("Slower"), _("Faster"),
-    _("Toggle the video in fullscreen"), _("Toggle the video out fullscreen"),
-    _("Show extended settings" ), _( "Show playlist" ), _( "Take a snapshot" ),
-    _( "Record" ), _( "Loop from point A to point B continuously." ),
-    _("Frame by frame"), _("Reverse"), _("Skip backward"), _("Skip forward") };
+static const char* nameL[BUTTON_MAX] = { N_("Play"), N_("Stop"), N_("Open"),
+    N_("Previous"), N_("Next"), N_("Slower"), N_("Faster"), N_("Fullscreen"),
+   N_("De-Fullscreen"), N_("Extended panel"), N_("Playlist"), N_("Snapshot"),
+   N_("Record"), N_("A->B Loop"), N_("Frame By Frame"), N_("Trickplay Reverse"),
+   N_("Step backward" ), N_("Step forward"), N_("Quit") };
+static const char* tooltipL[BUTTON_MAX] = { I_PLAY_TOOLTIP,
+    N_("Stop playback"), N_("Open a medium"),
+    N_("Previous media in the playlist"),
+    N_("Next media in the playlist"), N_("Slower"), N_("Faster"),
+    N_("Toggle the video in fullscreen"), N_("Toggle the video out fullscreen"),
+    N_("Show extended settings" ), N_( "Show playlist" ),
+    N_( "Take a snapshot" ), N_( "Record" ),
+    N_( "Loop from point A to point B continuously." ), N_("Frame by frame"),
+    N_("Reverse"), N_("Step backward"), N_("Step forward"), N_("Quit") };
 static const QString iconL[BUTTON_MAX] ={ ":/play_b", ":/stop_b", ":/eject",
     ":/previous_b", ":/next_b", ":/slower", ":/faster", ":/fullscreen",
     ":/defullscreen", ":/extended", ":/playlist", ":/snapshot", ":/record",
-    ":/atob_nob", ":/frame", ":/reverse", ":/skip_back", ":/skip_fw" };
+    ":/atob_nob", ":/frame", ":/reverse", ":/skip_back", ":/skip_fw",
+    ":/clear" };
 
 enum
 {
@@ -139,7 +144,7 @@ protected:
 
     AdvControlsWidget   *advControls;
 
-    void parseAndCreate( QString config, QBoxLayout *controlLayout );
+    void parseAndCreate( const QString& config, QBoxLayout *controlLayout );
 
     virtual void createAndAddWidget( QBoxLayout *controlLayout, int i_index,
                                      buttonType_e i_type, int i_option );
@@ -149,7 +154,7 @@ private:
     static void setupButton( QAbstractButton * );
     QFrame *discFrame();
     QFrame *telexFrame();
-
+    void applyAttributes( QToolButton *, bool b_flat, bool b_big );
 protected slots:
     virtual void setStatus( int );
 
@@ -157,6 +162,8 @@ signals:
     void inputExists( bool ); /// This might be usefull in the IM ?
     void inputPlaying( bool ); /// This might be usefull in the IM ?
     void inputIsRecordable( bool ); /// same ?
+    void inputIsTrickPlayable( bool ); /// same ?
+    void sizeChanged();
 };
 
 /* Advanced Button Bar */
@@ -237,6 +244,7 @@ protected:
 
     virtual void mouseMoveEvent( QMouseEvent *event );
     virtual void mousePressEvent( QMouseEvent *event );
+    virtual void mouseReleaseEvent( QMouseEvent *event );
     virtual void enterEvent( QEvent *event );
     virtual void leaveEvent( QEvent *event );
     virtual void keyPressEvent( QKeyEvent *event );
@@ -246,6 +254,7 @@ private slots:
     void planHideFSC();
     void hideFSC();
     void slowHideFSC();
+    void centerFSC( int );
 
 private:
     virtual void customEvent( QEvent *event );
@@ -260,6 +269,7 @@ private:
     int i_mouse_last_x, i_mouse_last_y;
     bool b_mouse_over;
     int i_screennumber;
+    QRect screenRes;
 
 #ifdef WIN32TRICK
     bool b_fscHidden;