1 /*****************************************************************************
2 * vlm.hpp : VLM Management
3 ****************************************************************************
4 * Copyright ( C ) 2006 the VideoLAN team
5 * $Id: vlm.hpp 21875 2007-09-08 16:01:33Z jb $
7 * Authors: Jean-François Massol <jf.massol@gmail.com>
8 * Jean-Baptiste Kempf <jb@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * ( at your option ) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #ifndef _VLM_DIALOG_H_
26 #define _VLM_DIALOG_H_
39 #include "util/qvlcframe.hpp"
49 ControlBroadcastPause,
71 class VLMDialog : public QVLCDialog
75 static VLMDialog * getInstance( intf_thread_t *p_intf )
78 instance = new VLMDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf );
83 VLMWrapper *vlmWrapper;
86 VLMDialog( QWidget *, intf_thread_t * );
87 static VLMDialog *instance;
90 QList<VLMAWidget *> vlmItems;
93 QVBoxLayout *vlmItemLayout;
94 QWidget *vlmItemWidget;
97 QDateTimeEdit *time, *date, *repeatTime;
98 QSpinBox *scherepeatnumber, *repeatDays;
99 bool isNameGenuine( QString );
101 void removeVLMItem( VLMAWidget * );
102 void startModifyVLMItem( VLMAWidget * );
106 void saveModifications();
107 void showScheduleWidget( int );
108 void selectVLMItem( int );
116 VLMWrapper( vlm_t * );
117 virtual ~VLMWrapper();
119 static void AddBroadcast( const QString, const QString, const QString,
120 bool b_enabled = true,
121 bool b_loop = false );
122 static void EditBroadcast( const QString, const QString, const QString,
123 bool b_enabled = true,
124 bool b_loop = false );
125 static void AddVod( const QString, const QString, const QString,
126 bool b_enabled = true, QString mux = "" );
127 static void EditVod( const QString, const QString, const QString,
128 bool b_enabled = true, QString mux = "" );
130 static void ControlBroadcast( const QString, int, unsigned int seek = 0 );
131 static void EnableItem( const QString, bool );
133 /* We don't have yet the accessors in the core, so the following is commented */
134 //unsigned int NbMedia() { if( p_vlm ) return p_vlm->i_media; return 0; }
135 /* vlm_media_t *GetMedia( int i )
136 { if( p_vlm ) return p_vlm->media[i]; return NULL; }*/
142 class VLMAWidget : public QGroupBox
145 friend class VLMDialog;
147 VLMAWidget( QString name, QString input, QString output,
148 bool _enable, VLMDialog *parent, int _type = QVLM_Broadcast );
149 virtual void update() = 0;
158 virtual void enterEvent( QEvent * );
159 QGridLayout *objLayout;
161 virtual void modify();
163 virtual void toggleEnabled( bool );
166 class VLMBroadcast : public VLMAWidget
169 friend class VLMDialog;
171 VLMBroadcast( QString name, QString input, QString output,
172 bool _enable, bool _loop, VLMDialog *parent );
177 QToolButton *loopButton, *playButton;
180 void togglePlayPause();
184 class VLMVod : public VLMAWidget
187 friend class VLMDialog;
189 VLMVod( QString name, QString input, QString output,
190 bool _enable, QString _mux, VLMDialog *parent );
197 class VLMSchedule : public VLMAWidget
199 friend class VLMDialog;
201 VLMSchedule( QString name, QString input, QString output, bool _enable, VLMDialog *parent );