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_
32 #include "util/qvlcframe.hpp"
42 ControlBroadcastPause,
64 class VLMDialog : public QVLCFrame
68 static VLMDialog * getInstance( intf_thread_t *p_intf )
71 instance = new VLMDialog( p_intf );
76 VLMWrapper *vlmWrapper;
79 VLMDialog( intf_thread_t * );
80 static VLMDialog *instance;
83 QList<VLMAWidget *> vlmItems;
86 QVBoxLayout *vlmItemLayout;
87 QWidget *vlmItemWidget;
90 QDateTimeEdit *time, *date, *repeatTime;
91 QSpinBox *scherepeatnumber, *repeatDays;
92 bool isNameGenuine( QString );
94 void removeVLMItem( VLMAWidget * );
95 void startModifyVLMItem( VLMAWidget * );
99 void saveModifications();
100 void showScheduleWidget( int );
101 void selectVLMItem( int );
107 VLMWrapper( vlm_t * );
108 virtual ~VLMWrapper();
110 static void AddBroadcast( const QString, const QString, const QString,
111 bool b_enabled = true,
112 bool b_loop = false );
113 static void EditBroadcast( const QString, const QString, const QString,
114 bool b_enabled = true,
115 bool b_loop = false );
116 static void AddVod( const QString, const QString, const QString,
117 bool b_enabled = true, QString mux = "" );
118 static void EditVod( const QString, const QString, const QString,
119 bool b_enabled = true, QString mux = "" );
121 static void ControlBroadcast( const QString, int, unsigned int seek = 0 );
123 /* We don't have yet the accessors in the core, so the following is commented */
124 //unsigned int NbMedia() { if( p_vlm ) return p_vlm->i_media; return 0; }
125 /* vlm_media_t *GetMedia( int i )
126 { if( p_vlm ) return p_vlm->media[i]; return NULL; }*/
132 class VLMAWidget : public QGroupBox
135 friend class VLMDialog;
137 VLMAWidget( QString name, QString input, QString output,
138 bool _enable, VLMDialog *parent, int _type = QVLM_Broadcast );
139 virtual void update() = 0;
148 virtual void enterEvent( QEvent * );
149 QGridLayout *objLayout;
151 virtual void modify();
155 class VLMBroadcast : public VLMAWidget
158 friend class VLMDialog;
160 VLMBroadcast( QString name, QString input, QString output,
161 bool _enable, bool _loop, VLMDialog *parent );
166 QToolButton *loopButton, *playButton;
169 void togglePlayPause();
173 class VLMVod : public VLMAWidget
176 friend class VLMDialog;
178 VLMVod( QString name, QString input, QString output,
179 bool _enable, QString _mux, VLMDialog *parent );
186 class VLMSchedule : public VLMAWidget
188 friend class VLMDialog;
190 VLMSchedule( QString name, QString input, QString output, bool _enable, VLMDialog *parent );