Commit 1dbee658 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

[Qt] Rewrite of the controller and ToolBar edition.

This is a big chunk, and is very experimental.
Functionnalities are (at best) very limited.
parent 51727206
...@@ -29,6 +29,7 @@ nodist_SOURCES_qt4 = \ ...@@ -29,6 +29,7 @@ nodist_SOURCES_qt4 = \
dialogs/sout.moc.cpp \ dialogs/sout.moc.cpp \
dialogs/help.moc.cpp \ dialogs/help.moc.cpp \
dialogs/gototime.moc.cpp \ dialogs/gototime.moc.cpp \
dialogs/toolbar.moc.cpp \
dialogs/open.moc.cpp \ dialogs/open.moc.cpp \
dialogs/podcast_configuration.moc.cpp \ dialogs/podcast_configuration.moc.cpp \
dialogs/vlm.moc.cpp \ dialogs/vlm.moc.cpp \
...@@ -209,6 +210,7 @@ SOURCES_qt4 = qt4.cpp \ ...@@ -209,6 +210,7 @@ SOURCES_qt4 = qt4.cpp \
dialogs/sout.cpp \ dialogs/sout.cpp \
dialogs/help.cpp \ dialogs/help.cpp \
dialogs/gototime.cpp \ dialogs/gototime.cpp \
dialogs/toolbar.cpp \
dialogs/open.cpp \ dialogs/open.cpp \
dialogs/vlm.cpp \ dialogs/vlm.cpp \
dialogs/podcast_configuration.cpp \ dialogs/podcast_configuration.cpp \
...@@ -247,6 +249,7 @@ noinst_HEADERS = \ ...@@ -247,6 +249,7 @@ noinst_HEADERS = \
dialogs/sout.hpp \ dialogs/sout.hpp \
dialogs/help.hpp \ dialogs/help.hpp \
dialogs/gototime.hpp \ dialogs/gototime.hpp \
dialogs/toolbar.hpp \
dialogs/open.hpp \ dialogs/open.hpp \
dialogs/vlm.hpp \ dialogs/vlm.hpp \
dialogs/podcast_configuration.hpp \ dialogs/podcast_configuration.hpp \
......
This diff is collapsed.
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
#include <QFrame> #include <QFrame>
#include <QToolButton> #include <QToolButton>
#define I_PLAY_TOOLTIP N_("Play\nIf the playlist is empty, open a media")
class QPixmap; class QPixmap;
class QLabel; class QLabel;
class QGridLayout; class QGridLayout;
...@@ -54,11 +56,11 @@ class VolumeClickHandler; ...@@ -54,11 +56,11 @@ class VolumeClickHandler;
class QSignalMapper; class QSignalMapper;
class QTimer; class QTimer;
class WidgetListing;
typedef enum buttonType_e typedef enum buttonType_e
{ {
PLAY_BUTTON, PLAY_BUTTON,
PAUSE_BUTTON,
STOP_BUTTON, STOP_BUTTON,
OPEN_BUTTON, OPEN_BUTTON,
PREVIOUS_BUTTON, PREVIOUS_BUTTON,
...@@ -73,23 +75,45 @@ typedef enum buttonType_e ...@@ -73,23 +75,45 @@ typedef enum buttonType_e
RECORD_BUTTON, RECORD_BUTTON,
ATOB_BUTTON, ATOB_BUTTON,
FRAME_BUTTON, FRAME_BUTTON,
REVERSE_BUTTON,
BUTTON_MAX,
SPLITTER = 0x20,
INPUT_SLIDER, INPUT_SLIDER,
VOLUME_SLIDER,
MENU_BUTTONS,
TELETEXT_BUTTONS,
VOLUME, VOLUME,
WIDGET_SPACER,
WIDGET_SPACER_EXTEND,
TIME_LABEL, TIME_LABEL,
SPLITTER, MENU_BUTTONS,
TELETEXT_BUTTONS,
ADVANCED_CONTROLLER, ADVANCED_CONTROLLER,
REVERSE_BUTTON, SPECIAL_MAX,
WIDGET_SPACER = 0x40,
WIDGET_SPACER_EXTEND,
WIDGET_MAX,
} buttonType_e; } 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" };
static const QString tooltipL[BUTTON_MAX] = { I_PLAY_TOOLTIP,
_("Stop playback"),
_("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") };
static const QString iconL[BUTTON_MAX] ={ ":/play_b", ":/stop_b", "",
":/previous_b", ":/next_b", ":/slower", ":/faster", ":/fullscreen",
":/defullscreen", ":/extended", ":/playlist", ":/snapshot", ":/record",
":/atob_nob", ":/frame", ":/reverse" };
typedef enum actionType_e typedef enum actionType_e
{ {
PLAY_ACTION, PLAY_ACTION,
PAUSE_ACTION,
STOP_ACTION, STOP_ACTION,
PREVIOUS_ACTION, PREVIOUS_ACTION,
NEXT_ACTION, NEXT_ACTION,
...@@ -115,30 +139,34 @@ enum ...@@ -115,30 +139,34 @@ enum
class AbstractController : public QFrame class AbstractController : public QFrame
{ {
friend class WidgetListing; /* For ToolBar Edition HACKS */
Q_OBJECT Q_OBJECT
public: public:
AbstractController( intf_thread_t *_p_i ); AbstractController( intf_thread_t *_p_i );
int getWidth() { return controlLayout->columnCount(); }
protected: protected:
intf_thread_t *p_intf; intf_thread_t *p_intf;
QSignalMapper *toolbarActionsMapper; QSignalMapper *toolbarActionsMapper;
QGridLayout *controlLayout; QHBoxLayout *controlLayout;
/* Change to BoxLayout if both dir are needed */
AdvControlsWidget *advControls; AdvControlsWidget *advControls;
void parseAndCreateLine( QString config, int i_line ); void parseAndCreate( QString config, QBoxLayout *controlLayout );
virtual void createAndAddWidget( QBoxLayout *controlLayout, int i_index,
buttonType_e i_type, int i_option );
QWidget *createWidget( buttonType_e, int options = WIDGET_NORMAL );
private: private:
QWidget *createWidget( buttonType_e, int *i_size, static void setupButton( QAbstractButton * );
int options = WIDGET_NORMAL );
void setupButton( QAbstractButton * );
QWidget *discFrame(); QWidget *discFrame();
QWidget *telexFrame(); QWidget *telexFrame();
private slots: protected slots:
void doAction( int ); virtual void doAction( int );
protected slots: protected slots:
void play(); void play();
...@@ -204,7 +232,7 @@ class SoundWidget : public QWidget ...@@ -204,7 +232,7 @@ class SoundWidget : public QWidget
friend class VolumeClickHandler; friend class VolumeClickHandler;
public: public:
SoundWidget( intf_thread_t *_p_i, bool ); SoundWidget( QWidget *parent, intf_thread_t *_p_i, bool );
private: private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment