/*****************************************************************************
- * interface_widgets.hpp : Custom widgets for the main interface
+ * Controller.hpp : Controller 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>
- * Jean-Baptiste Kempf <jb@videolan.org>
- * Rafaël Carré <funman@videolanorg>
+ * Authors: Jean-Baptiste Kempf <jb@videolan.org>
*
* 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
# include "config.h"
#endif
-#include <vlc_common.h>
-#include <vlc_interface.h>
-
#include "qt4.hpp"
-#include "main_interface.hpp"
-#include "input_manager.hpp"
-#include <QWidget>
#include <QFrame>
-#include <QToolButton>
+#include <QString>
#define I_PLAY_TOOLTIP N_("Play\nIf the playlist is empty, open a media")
+#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;37;64;38;64;8;65;35-4;34"
+
+
class QPixmap;
class QLabel;
+
class QGridLayout;
+class QHBoxLayout;
+class QBoxLayout;
-class InputSlider;
class QAbstractSlider;
-
class QAbstractButton;
+class InputSlider;
class VolumeClickHandler;
-class QSignalMapper;
+class WidgetListing;
+class QSignalMapper;
class QTimer;
-class WidgetListing;
typedef enum buttonType_e
{
REVERSE_BUTTON,
SKIP_BACK_BUTTON,
SKIP_FW_BUTTON,
+ QUIT_BUTTON,
BUTTON_MAX,
SPLITTER = 0x20,
INPUT_SLIDER,
- VOLUME,
TIME_LABEL,
+ VOLUME,
+ VOLUME_SPECIAL,
MENU_BUTTONS,
TELETEXT_BUTTONS,
ADVANCED_CONTROLLER,
WIDGET_MAX,
} buttonType_e;
-#include <QString>
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" };
+ "Frame By Frame", "Reverse", "Skip backward" , "Skip forward",
+ "Quit" };
static const QString tooltipL[BUTTON_MAX] = { I_PLAY_TOOLTIP,
_("Stop playback"), _("Open a media"),
_("Previous media in the playlist"),
_("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") };
+ _("Frame by frame"), _("Reverse"), _("Skip backward"), _("Skip forward"),
+ _("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" };
-
-typedef enum actionType_e
-{
- PLAY_ACTION,
- STOP_ACTION,
- PREVIOUS_ACTION,
- NEXT_ACTION,
- SLOWER_ACTION,
- FASTER_ACTION,
- FULLSCREEN_ACTION,
- EXTENDED_ACTION,
- PLAYLIST_ACTION,
- SNAPSHOT_ACTION,
- RECORD_ACTION,
- FRAME_ACTION,
- ATOB_ACTION,
- REVERSE_ACTION,
- SKIP_BACK_ACTION,
- SKIP_FW_ACTION,
-} actionType_e;
+ ":/atob_nob", ":/frame", ":/reverse", ":/skip_back", ":/skip_fw",
+ ":/clear" };
enum
{
WIDGET_SHINY = 0x4,
};
+class AdvControlsWidget;
class AbstractController : public QFrame
{
friend class WidgetListing; /* For ToolBar Edition HACKS */
QWidget *createWidget( buttonType_e, int options = WIDGET_NORMAL );
private:
static void setupButton( QAbstractButton * );
- QWidget *discFrame();
- QWidget *telexFrame();
+ QFrame *discFrame();
+ QFrame *telexFrame();
protected slots:
- virtual void doAction( int );
-
-protected slots:
- void play();
- void stop();
- void prev();
- void next();
- void fullscreen();
- void extSettings();
- void faster();
- void slower();
- void reverse();
- void playlist();
- void snapshot();
- void record();
- void frame();
-
virtual void setStatus( int );
signals:
void inputIsRecordable( bool ); /// same ?
};
-/**
- * SPECIAL Widgets that are a bit more than just a ToolButton
- * and have an icon/behaviour that changes depending on the context:
- * - playButton
- * - A->B Button
- * - Teletext group buttons
- * - Sound Widget group
- **/
-class PlayButton : public QToolButton
-{
- Q_OBJECT
-private slots:
- void updateButton( bool );
-};
-
-class AtoB_Button : public QToolButton
-{
- Q_OBJECT
-private slots:
- void setIcons( bool, bool );
-};
-
-class TeletextController : public QWidget
-{
- Q_OBJECT
- friend class AbstractController;
-private:
- QToolButton *telexTransparent, *telexOn;
- QSpinBox *telexPage;
-
-private slots:
- void enableTeletextButtons( bool );
- void toggleTeletextTransparency( bool );
-};
-
-class SoundWidget : public QWidget
-{
- Q_OBJECT
- friend class VolumeClickHandler;
-
-public:
- SoundWidget( QWidget *parent, intf_thread_t *_p_i, bool );
-
-private:
- intf_thread_t *p_intf;
- QLabel *volMuteLabel;
- QAbstractSlider *volumeSlider;
- VolumeClickHandler *hVolLabel;
- bool b_my_volume;
-
-protected slots:
- void updateVolume( int );
- void updateVolume( void );
-};
-
/* Advanced Button Bar */
class AdvControlsWidget : public AbstractController
{
virtual ~FullscreenControllerWidget();
/* Vout */
- vout_thread_t *p_vout;
- void attachVout( vout_thread_t *p_vout );
- void detachVout();
void fullscreenChanged( vout_thread_t *, bool b_fs, int i_timeout );
+ void mouseChanged( vout_thread_t *, int i_mousex, int i_mousey );
- int i_mouse_last_move_x;
- int i_mouse_last_move_y;
+public slots:
+ void setVoutList( vout_thread_t **, int );
protected:
friend class MainInterface;
int i_mouse_last_x, i_mouse_last_y;
bool b_mouse_over;
int i_screennumber;
+ QRect screenRes;
#ifdef WIN32TRICK
bool b_fscHidden;
#endif
+ /* List of vouts currently tracked */
+ QList<vout_thread_t *> vout;
+
/* Shared variable between FSC and VLC (protected by a lock) */
vlc_mutex_t lock;
bool b_fullscreen;
int i_hide_timeout; /* FSC hiding timeout, same as mouse hiding timeout */
+ int i_mouse_last_move_x;
+ int i_mouse_last_move_y;
};
#endif