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_
34 #include "util/qvlcframe.hpp"
44 ControlBroadcastPause,
66 class VLMDialog : public QVLCFrame
70 static VLMDialog * getInstance( intf_thread_t *p_intf )
73 instance = new VLMDialog( p_intf );
78 VLMWrapper *vlmWrapper;
81 VLMDialog( intf_thread_t * );
82 static VLMDialog *instance;
85 QList<VLMAWidget *> vlmItems;
88 QVBoxLayout *vlmItemLayout;
89 QWidget *vlmItemWidget;
92 QDateTimeEdit *time, *date, *repeatTime;
93 QSpinBox *scherepeatnumber, *repeatDays;
94 bool isNameGenuine( QString );
96 void removeVLMItem( VLMAWidget * );
97 void startModifyVLMItem( VLMAWidget * );
101 void saveModifications();
102 void showScheduleWidget( int );
103 void selectVLMItem( int );
111 VLMWrapper( vlm_t * );
112 virtual ~VLMWrapper();
114 static void AddBroadcast( const QString, const QString, const QString,
115 bool b_enabled = true,
116 bool b_loop = false );
117 static void EditBroadcast( const QString, const QString, const QString,
118 bool b_enabled = true,
119 bool b_loop = false );
120 static void AddVod( const QString, const QString, const QString,
121 bool b_enabled = true, QString mux = "" );
122 static void EditVod( const QString, const QString, const QString,
123 bool b_enabled = true, QString mux = "" );
125 static void ControlBroadcast( const QString, int, unsigned int seek = 0 );
126 static void EnableItem( const QString, bool );
128 /* We don't have yet the accessors in the core, so the following is commented */
129 //unsigned int NbMedia() { if( p_vlm ) return p_vlm->i_media; return 0; }
130 /* vlm_media_t *GetMedia( int i )
131 { if( p_vlm ) return p_vlm->media[i]; return NULL; }*/
137 class VLMAWidget : public QGroupBox
140 friend class VLMDialog;
142 VLMAWidget( QString name, QString input, QString output,
143 bool _enable, VLMDialog *parent, int _type = QVLM_Broadcast );
144 virtual void update() = 0;
153 virtual void enterEvent( QEvent * );
154 QGridLayout *objLayout;
156 virtual void modify();
158 virtual void toggleEnabled( bool );
161 class VLMBroadcast : public VLMAWidget
164 friend class VLMDialog;
166 VLMBroadcast( QString name, QString input, QString output,
167 bool _enable, bool _loop, VLMDialog *parent );
172 QToolButton *loopButton, *playButton;
175 void togglePlayPause();
179 class VLMVod : public VLMAWidget
182 friend class VLMDialog;
184 VLMVod( QString name, QString input, QString output,
185 bool _enable, QString _mux, VLMDialog *parent );
192 class VLMSchedule : public VLMAWidget
194 friend class VLMDialog;
196 VLMSchedule( QString name, QString input, QString output, bool _enable, VLMDialog *parent );
202 #endif /* ENABLE_VLM*/