X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fdialogs%2Fvlm.hpp;h=cf0cb148fcae14d2d331789c665fa2b8eade81ff;hb=b5077c0ef45f56e5b4126f78b71aadecf8f2857f;hp=70134d51a411ecd4345aef48ad45b49eb0b127b6;hpb=0d41ec4cbbca945805f6f2c48b7da610974054be;p=vlc diff --git a/modules/gui/qt4/dialogs/vlm.hpp b/modules/gui/qt4/dialogs/vlm.hpp index 70134d51a4..cf0cb148fc 100644 --- a/modules/gui/qt4/dialogs/vlm.hpp +++ b/modules/gui/qt4/dialogs/vlm.hpp @@ -1,8 +1,8 @@ /***************************************************************************** - * vlm.hpp : Stream output dialog ( old-style, ala WX ) + * vlm.hpp : VLM Management **************************************************************************** * Copyright ( C ) 2006 the VideoLAN team - * $Id: vlm.hpp 21875 2007-09-08 16:01:33Z jb $ + * $Id$ * * Authors: Jean-François Massol * Jean-Baptiste Kempf @@ -25,16 +25,37 @@ #ifndef _VLM_DIALOG_H_ #define _VLM_DIALOG_H_ -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include + +#ifdef ENABLE_VLM + +#include #include "ui/vlm.h" #include "util/qvlcframe.hpp" +#include + +enum{ + QVLM_Broadcast, + QVLM_Schedule, + QVLM_VOD +}; + +enum{ + ControlBroadcastPlay, + ControlBroadcastPause, + ControlBroadcastStop, + ControlBroadcastSeek +}; class QComboBox; class QVBoxLayout; class QStackedWidget; class QLabel; -class QWidget; class QGridLayout; class QLineEdit; class QCheckBox; @@ -42,47 +63,165 @@ class QToolButton; class QGroupBox; class QPushButton; class QHBoxLayout; +class QDateTimeEdit; +class QSpinBox; +class VLMAWidget; +class VLMWrapper; + -class VLMDialog : public QVLCFrame +class VLMDialog : public QVLCDialog { Q_OBJECT; public: static VLMDialog * getInstance( intf_thread_t *p_intf ) { if( !instance) - instance = new VLMDialog( p_intf ); + instance = new VLMDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf ); return instance; }; virtual ~VLMDialog(); - + + VLMWrapper *vlmWrapper; + vlm_t *p_vlm; private: - VLMDialog( intf_thread_t *); + VLMDialog( QWidget *, intf_thread_t * ); static VLMDialog *instance; Ui::Vlm ui; - void makeBcastPage(); - void makeVODPage(); - void makeSchedulePage(); + QList vlmItems; + int currentIndex; + + QVBoxLayout *vlmItemLayout; + QWidget *vlmItemWidget; QComboBox *mediatype; - QVBoxLayout *layout; - QHBoxLayout *bcastgbox; - QStackedWidget *slayout; - QWidget *pBcast, *pVod, *pSchedule; - QGridLayout *bcastlayout, *vodlayout, *schelayout; - QLabel *bcastname, *vodname, *schename,*bcastinput, *vodinput, *scheinput; - QLabel *bcastoutput, *vodoutput, *scheoutput; - QCheckBox *bcastenable, *vodenable, *scheenable; - QLineEdit *bcastnameledit, *vodnameledit, *schenameledit, *bcastinputledit, *vodinputledit, *scheinputledit; - QLineEdit *bcastoutputledit, *vodoutputledit, *scheoutputledit; - QToolButton *bcastinputtbutton, *vodinputtbutton, *scheinputtbutton; - QToolButton *bcastoutputtbutton, *vodoutputtbutton, *scheoutputtbutton; - QGroupBox *bcastcontrol, *schecontrol; - QPushButton *bcastplay, *bcastpause, *bcaststop; - QPushButton *bcastadd, *vodadd, *scheadd, *bcastremove, *vodremove, *scheremove; + QDateTimeEdit *time, *date, *repeatTime; + QSpinBox *scherepeatnumber, *repeatDays; + bool isNameGenuine( QString ); + void mediasPopulator(); +public slots: + void removeVLMItem( VLMAWidget * ); + void startModifyVLMItem( VLMAWidget * ); +private slots: + void addVLMItem(); + void clearWidgets(); + void saveModifications(); + void showScheduleWidget( int ); + void selectVLMItem( int ); + void selectInput(); + void selectOutput(); + bool exportVLMConf(); + bool importVLMConf(); +}; + +class VLMWrapper +{ +public: + VLMWrapper( vlm_t * ); + virtual ~VLMWrapper(); + + static void AddBroadcast( const QString, const QString, const QString, + bool b_enabled = true, + bool b_loop = false ); + static void EditBroadcast( const QString, const QString, const QString, + bool b_enabled = true, + bool b_loop = false ); + static void EditSchedule( const QString, const QString, const QString, + QDateTime _schetime, QDateTime _schedate, + int _scherepeatnumber, int _repeatDays, + bool b_enabled = true, QString mux = "" ); + static void AddVod( const QString, const QString, const QString, + bool b_enabled = true, QString mux = "" ); + static void EditVod( const QString, const QString, const QString, + bool b_enabled = true, QString mux = "" ); + static void AddSchedule( const QString, const QString, const QString, + QDateTime _schetime, QDateTime _schedate, + int _scherepeatnumber, int _repeatDays, + bool b_enabled = true, QString mux = "" ); + + static void ControlBroadcast( const QString, int, unsigned int seek = 0 ); + static void EnableItem( const QString, bool ); + + /* We don't have yet the accessors in the core, so the following is commented */ + //unsigned int NbMedia() { if( p_vlm ) return p_vlm->i_media; return 0; } + /* vlm_media_t *GetMedia( int i ) + { if( p_vlm ) return p_vlm->media[i]; return NULL; }*/ + +private: + static vlm_t *p_vlm; +}; +class VLMAWidget : public QGroupBox +{ + Q_OBJECT + friend class VLMDialog; +public: + VLMAWidget( QString name, QString input, QString output, + bool _enable, VLMDialog *parent, int _type = QVLM_Broadcast ); + virtual void update() = 0; +protected: + QLabel *nameLabel; + QString name; + QString input; + QString output; + bool b_enabled; + int type; + VLMDialog *parent; + QGridLayout *objLayout; private slots: - void close(); + virtual void modify(); + virtual void del(); + virtual void toggleEnabled( bool ); +}; + +class VLMBroadcast : public VLMAWidget +{ + Q_OBJECT + friend class VLMDialog; +public: + VLMBroadcast( QString name, QString input, QString output, + bool _enable, bool _loop, VLMDialog *parent ); + void update(); +private: + bool b_looped; + bool b_playing; + QToolButton *loopButton, *playButton; +private slots: + void stop(); + void togglePlayPause(); + void toggleLoop(); +}; + +class VLMVod : public VLMAWidget +{ + Q_OBJECT + friend class VLMDialog; +public: + VLMVod( QString name, QString input, QString output, + bool _enable, QString _mux, VLMDialog *parent ); + void update(); +private: + QString mux; + QLabel *muxLabel; +}; + +class VLMSchedule : public VLMAWidget +{ + Q_OBJECT + friend class VLMDialog; +public: + VLMSchedule( QString name, QString input, QString output, + QDateTime schetime, QDateTime schedate, int repeatnumber, + int repeatdays, bool enabled, VLMDialog *parent ); + void update(); +private: + QDateTime schetime; + QDateTime schedate; + int rNumber; + int rDays; }; #endif + +#endif +