1 /*****************************************************************************
2 * vlm.cpp : VLM Management
3 ****************************************************************************
4 * Copyright © 2008 the VideoLAN team
7 * Authors: Jean-Baptiste Kempf <jb@videolan.org>
8 * Jean-François Massol <jf.massol -at- gmail.com>
9 * Clément Sténac <zorglub@videolan.org>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * ( at your option ) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
30 #include "dialogs/vlm.hpp"
33 #include "dialogs/open.hpp"
34 #include "dialogs/sout.hpp"
38 #include <QVBoxLayout>
39 #include <QStackedWidget>
42 #include <QGridLayout>
45 #include <QToolButton>
47 #include <QPushButton>
48 #include <QHBoxLayout>
49 #include <QDateTimeEdit>
52 #include <QHeaderView>
53 #include <QScrollArea>
54 #include <QFileDialog>
56 static const char *psz_type[] = { "Broadcast", "Schedule", "VOD" };
58 VLMDialog *VLMDialog::instance = NULL;
60 VLMDialog::VLMDialog( QWidget *parent, intf_thread_t *_p_intf ) : QVLCDialog( parent, _p_intf )
62 p_vlm = vlm_New( p_intf );
66 msg_Warn( p_intf, "Couldn't build VLM object ");
69 vlmWrapper = new VLMWrapper( p_vlm );
73 ui.saveButton->hide();
75 #define ADDMEDIATYPES( str, type ) ui.mediaType->addItem( qtr( str ), QVariant( type ) );
76 ADDMEDIATYPES( "Broadcast", QVLM_Broadcast );
77 ADDMEDIATYPES( "Schedule", QVLM_Schedule );
78 ADDMEDIATYPES( "Video On Demand ( VOD )", QVLM_VOD );
82 QGridLayout *schetimelayout = new QGridLayout( ui.schedBox );
83 QLabel *schetimelabel = new QLabel( qtr( "Hours / Minutes / Seconds:" ) );
84 schetimelayout->addWidget( schetimelabel, 0, 0 );
85 QLabel *schedatelabel = new QLabel( qtr( "Day / Month / Year:" ) );
86 schetimelayout->addWidget( schedatelabel, 1, 0 );
87 QLabel *scherepeatLabel = new QLabel( qtr( "Repeat:" ) );
88 schetimelayout->addWidget( scherepeatLabel, 2, 0 );
89 QLabel *scherepeatTimeLabel = new QLabel( qtr( "Repeat delay:" ) );
90 schetimelayout->addWidget( scherepeatTimeLabel, 3, 0 );
92 time = new QDateTimeEdit( QTime::currentTime() );
93 time->setAlignment( Qt::AlignRight );
94 time->setDisplayFormat( "hh:mm:ss" );
95 schetimelayout->addWidget( time, 0, 1, 1, 3 );
97 date = new QDateTimeEdit( QDate::currentDate() );
98 date->setAlignment( Qt::AlignRight );
99 date->setCalendarPopup( true );
101 date->setDisplayFormat( "dd MM yyyy" );
103 date->setDisplayFormat( "dd MMMM yyyy" );
105 schetimelayout->addWidget( date, 1, 1, 1, 3 );
107 scherepeatnumber = new QSpinBox;
108 scherepeatnumber->setAlignment( Qt::AlignRight );
109 schetimelayout->addWidget( scherepeatnumber, 2, 1, 1, 3 );
111 repeatDays = new QSpinBox;
112 repeatDays->setAlignment( Qt::AlignRight );
113 schetimelayout->addWidget( repeatDays, 3, 1, 1, 1 );
114 repeatDays->setSuffix( qtr(" days") );
116 repeatTime = new QDateTimeEdit;
117 repeatTime->setAlignment( Qt::AlignRight );
118 schetimelayout->addWidget( repeatTime, 3, 2, 1, 2 );
119 repeatTime->setDisplayFormat( "hh:mm:ss" );
122 ui.vlmItemScroll->setFrameStyle( QFrame::NoFrame );
123 ui.vlmItemScroll->setWidgetResizable( true );
124 vlmItemWidget = new QWidget;
125 vlmItemLayout = new QVBoxLayout( vlmItemWidget );
126 vlmItemWidget->setLayout( vlmItemLayout );
127 ui.vlmItemScroll->setWidget( vlmItemWidget );
129 QSpacerItem *spacer =
130 new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding);
131 vlmItemLayout->addItem( spacer );
133 QPushButton *importButton = new QPushButton( qtr( "Import" ) );
134 ui.buttonBox->addButton( importButton, QDialogButtonBox::ActionRole );
136 QPushButton *exportButton = new QPushButton( qtr( "Export" ) );
137 ui.buttonBox->addButton( exportButton, QDialogButtonBox::ActionRole );
139 QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
140 ui.buttonBox->addButton( closeButton, QDialogButtonBox::AcceptRole );
143 showScheduleWidget( QVLM_Broadcast );
145 /* Connect the comboBox to show the right Widgets */
146 CONNECT( ui.mediaType, currentIndexChanged( int ),
147 this, showScheduleWidget( int ) );
149 /* Connect the leftList to show the good VLMItem */
150 CONNECT( ui.vlmListItem, currentRowChanged( int ),
151 this, selectVLMItem( int ) );
153 BUTTONACT( closeButton, close() );
154 BUTTONACT( exportButton, exportVLMConf() );
155 BUTTONACT( importButton, importVLMConf() );
156 BUTTONACT( ui.addButton, addVLMItem() );
157 BUTTONACT( ui.clearButton, clearWidgets() );
158 BUTTONACT( ui.saveButton, saveModifications() );
159 BUTTONACT( ui.inputButton, selectInput() );
160 BUTTONACT( ui.outputButton, selectOutput() );
163 VLMDialog::~VLMDialog()
167 /* FIXME :you have to destroy vlm here to close
168 * but we shouldn't destroy vlm here in case somebody else wants it */
175 void VLMDialog::showScheduleWidget( int i )
177 ui.schedBox->setVisible( ( i == QVLM_Schedule ) );
178 ui.loopBCast->setVisible( ( i == QVLM_Broadcast ) );
179 ui.vodBox->setVisible( ( i == QVLM_VOD ) );
182 void VLMDialog::selectVLMItem( int i )
185 ui.vlmItemScroll->ensureWidgetVisible( vlmItems.at( i ) );
188 bool VLMDialog::isNameGenuine( QString name )
190 for( int i = 0; i < vlmItems.size(); i++ )
192 if( vlmItems.at( i )->name == name )
198 void VLMDialog::addVLMItem()
200 int vlmItemCount = vlmItems.size();
202 /* Take the name and Check it */
203 QString name = ui.nameLedit->text();
204 if( name.isEmpty() || !isNameGenuine( name ) )
206 msg_Err( p_intf, "VLM Name is empty or already exists, I can't do it" );
210 int type = ui.mediaType->itemData( ui.mediaType->currentIndex() ).toInt();
212 QString typeShortName;
213 QString inputText = ui.inputLedit->text();
214 QString outputText = ui.outputLedit->text();
215 bool b_checked = ui.enableCheck->isChecked();
216 bool b_looped = ui.loopBCast->isChecked();
217 QDateTime schetime = time->dateTime();
218 QDateTime schedate = date->dateTime();
219 int repeatnum = scherepeatnumber->value();
220 int repeatdays = repeatDays->value();
221 VLMAWidget * vlmAwidget;
226 typeShortName = "Bcast";
227 vlmAwidget = new VLMBroadcast( name, inputText, outputText,
228 b_checked, b_looped, this );
229 VLMWrapper::AddBroadcast( name, inputText, outputText, b_checked,
233 typeShortName = "VOD";
234 vlmAwidget = new VLMVod( name, inputText, outputText,
235 b_checked, ui.muxLedit->text(), this );
236 VLMWrapper::AddVod( name, inputText, outputText, b_checked );
239 typeShortName = "Sched";
240 vlmAwidget = new VLMSchedule( name, inputText, outputText,
241 schetime, schedate, repeatnum,
242 repeatdays, b_checked, this );
243 VLMWrapper::AddSchedule( name, inputText, outputText, schetime,
244 schedate, repeatnum, repeatdays, b_checked);
247 msg_Warn( p_intf, "Something bad happened" );
251 /* Add an Item of the Side List */
252 ui.vlmListItem->addItem( typeShortName + " : " + name );
253 ui.vlmListItem->setCurrentRow( vlmItemCount - 1 );
255 /* Add a new VLMAWidget on the main List */
257 vlmItemLayout->insertWidget( vlmItemCount, vlmAwidget );
258 vlmItems.append( vlmAwidget );
262 // FIXME : VOD are not exported to the file
263 bool VLMDialog::exportVLMConf()
265 QString saveVLMConfFileName = QFileDialog::getSaveFileName(
266 this, qtr( "Choose a filename to save the VLM configuration..." ),
267 qfu( config_GetHomeDir() ),
268 qtr( "VLM conf (*.vlm) ;; All (*.*)" ) );
270 if( !saveVLMConfFileName.isEmpty() )
272 vlm_message_t *message;
273 QString command = "save \"" + saveVLMConfFileName + "\"";
274 vlm_ExecuteCommand( p_vlm , qtu( command ) , &message );
275 vlm_MessageDelete( message );
281 void VLMDialog::mediasPopulator()
286 QString typeShortName;
288 vlm_media_t ***ppp_dsc = (vlm_media_t ***)malloc( sizeof( vlm_media_t ) );
290 /* Get medias informations and numbers */
291 vlm_Control( p_vlm, VLM_GET_MEDIAS, ppp_dsc, &i_nMedias );
293 /* Loop on all of them */
294 for( int i = 0; i < i_nMedias; i++ )
296 VLMAWidget * vlmAwidget;
297 vlmItemCount = vlmItems.size();
299 QString mediaName = qfu( (*ppp_dsc)[i]->psz_name );
300 /* It may have several inputs, we take the first one by default
301 - an evolution will be to manage these inputs in the gui */
302 QString inputText = qfu( (*ppp_dsc)[i]->ppsz_input[0] );
304 QString outputText = qfu( (*ppp_dsc)[i]->psz_output );
306 /* Schedule media is a quite especial, maybe there is another way to grab informations */
307 if( (*ppp_dsc)[i]->b_vod )
309 typeShortName = "VOD";
310 QString mux = qfu( (*ppp_dsc)[i]->vod.psz_mux );
311 vlmAwidget = new VLMVod( mediaName, inputText, outputText,
312 (*ppp_dsc)[i]->b_enabled, mux, this );
316 typeShortName = "Bcast";
317 vlmAwidget = new VLMBroadcast( mediaName, inputText, outputText,
318 (*ppp_dsc)[i]->b_enabled, (*ppp_dsc)[i]->broadcast.b_loop, this );
320 /* Add an Item of the Side List */
321 ui.vlmListItem->addItem( typeShortName + " : " + mediaName );
322 ui.vlmListItem->setCurrentRow( vlmItemCount - 1 );
324 /* Add a new VLMAWidget on the main List */
325 vlmItemLayout->insertWidget( vlmItemCount, vlmAwidget );
326 vlmItems.append( vlmAwidget );
333 bool VLMDialog::importVLMConf()
335 QString openVLMConfFileName = QFileDialog::getOpenFileName(
336 this, qtr( "Open a VLM Configuration File" ),
337 qfu( config_GetHomeDir() ),
338 qtr( "VLM conf (*.vlm) ;; All (*.*)" ) );
340 if( !openVLMConfFileName.isEmpty() )
342 vlm_message_t *message;
344 QString command = "load \"" + openVLMConfFileName + "\"";
345 status = vlm_ExecuteCommand( p_vlm, qtu( command ) , &message );
346 vlm_MessageDelete( message );
353 msg_Warn( p_intf, "Failed to import vlm configuration file : %s", qtu( command ) );
361 void VLMDialog::clearWidgets()
363 ui.nameLedit->clear();
364 ui.inputLedit->clear();
365 ui.outputLedit->clear();
366 time->setTime( QTime::currentTime() );
367 date->setDate( QDate::currentDate() );
368 ui.enableCheck->setChecked( true );
369 ui.nameLedit->setReadOnly( false );
370 ui.loopBCast->setChecked( false );
371 ui.muxLedit->clear();
372 ui.saveButton->hide();
373 ui.addButton->show();
376 void VLMDialog::selectInput()
378 OpenDialog *o = OpenDialog::getInstance( this, p_intf, SELECT, true );
380 ui.inputLedit->setText( o->getMRL() );
383 void VLMDialog::selectOutput()
385 SoutDialog *s = SoutDialog::getInstance( this, p_intf, false );
386 if( s->exec() == QDialog::Accepted )
387 ui.outputLedit->setText( s->getMrl() );
390 /* Object Modification */
391 void VLMDialog::removeVLMItem( VLMAWidget *vlmObj )
393 int index = vlmItems.indexOf( vlmObj );
394 if( index < 0 ) return;
395 delete ui.vlmListItem->takeItem( index );
396 vlmItems.removeAt( index );
399 /* HERE BE DRAGONS VLM REQUEST */
402 void VLMDialog::startModifyVLMItem( VLMAWidget *vlmObj )
404 currentIndex = vlmItems.indexOf( vlmObj );
405 if( currentIndex < 0 ) return;
407 ui.vlmListItem->setCurrentRow( currentIndex );
408 ui.nameLedit->setText( vlmObj->name );
409 ui.inputLedit->setText( vlmObj->input );
410 ui.outputLedit->setText( vlmObj->output );
411 ui.enableCheck->setChecked( vlmObj->b_enabled );
413 switch( vlmObj->type )
416 ui.loopBCast->setChecked( (qobject_cast<VLMBroadcast *>(vlmObj))->b_looped );
419 ui.muxLedit->setText( (qobject_cast<VLMVod *>(vlmObj))->mux );
422 time->setDateTime( ( qobject_cast<VLMSchedule *>(vlmObj))->schetime );
423 date->setDateTime( ( qobject_cast<VLMSchedule *>(vlmObj))->schedate );
427 ui.nameLedit->setReadOnly( true );
428 ui.addButton->hide();
429 ui.saveButton->show();
432 void VLMDialog::saveModifications()
434 VLMAWidget *vlmObj = vlmItems.at( currentIndex );
437 vlmObj->input = ui.inputLedit->text();
438 vlmObj->output = ui.outputLedit->text();
439 vlmObj->setChecked( ui.enableCheck->isChecked() );
440 vlmObj->b_enabled = ui.enableCheck->isChecked();
441 switch( vlmObj->type )
444 (qobject_cast<VLMBroadcast *>(vlmObj))->b_looped = ui.loopBCast->isChecked();
447 (qobject_cast<VLMVod *>(vlmObj))->mux = ui.muxLedit->text();
450 (qobject_cast<VLMSchedule *>(vlmObj))->schetime = time->dateTime();
451 (qobject_cast<VLMSchedule *>(vlmObj))->schedate = date->dateTime();
452 (qobject_cast<VLMSchedule *>(vlmObj))->rNumber = scherepeatnumber->value();
453 (qobject_cast<VLMSchedule *>(vlmObj))->rDays = repeatDays->value();
457 vlmObj->update(); /* It should call the correct function is VLMAWidget
458 is abstract, but I am far from sure... FIXME ? */
463 /*********************************
464 * VLMAWidget - Abstract class
465 ********************************/
467 VLMAWidget::VLMAWidget( QString _name,
473 : QGroupBox( _name, _parent )
479 b_enabled = _enabled;
482 setCheckable( true );
483 setChecked( b_enabled );
485 objLayout = new QGridLayout( this );
486 setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum );
488 nameLabel = new QLabel;
489 objLayout->addWidget( nameLabel, 0, 0, 1, 4 );
491 /*QLabel *time = new QLabel( "--:--/--:--" );
492 objLayout->addWidget( time, 1, 3, 1, 2 );*/
494 QToolButton *modifyButton = new QToolButton;
495 modifyButton->setIcon( QIcon( QPixmap( ":/pixmaps/menus_settings_16px.png" ) ) );
496 objLayout->addWidget( modifyButton, 0, 5 );
498 QToolButton *deleteButton = new QToolButton;
499 deleteButton->setIcon( QIcon( QPixmap( ":/pixmaps/menus_quit_16px.png" ) ) );
500 objLayout->addWidget( deleteButton, 0, 6 );
502 BUTTONACT( modifyButton, modify() );
503 BUTTONACT( deleteButton, del() );
504 CONNECT( this, clicked( bool ), this, toggleEnabled( bool ) );
507 void VLMAWidget::modify()
509 parent->startModifyVLMItem( this );
512 void VLMAWidget::del()
514 parent->removeVLMItem( this );
517 //FIXME, remove me before release
518 void VLMAWidget::enterEvent( QEvent *event )
523 void VLMAWidget::toggleEnabled( bool b_enable )
525 VLMWrapper::EnableItem( name, b_enable );
531 VLMBroadcast::VLMBroadcast( QString _name, QString _input, QString _output,
532 bool _enabled, bool _looped, VLMDialog *_parent)
533 : VLMAWidget( _name, _input, _output,
534 _enabled, _parent, QVLM_Broadcast )
536 nameLabel->setText( "Broadcast: " + name );
537 type = QVLM_Broadcast;
540 playButton = new QToolButton;
541 playButton->setIcon( QIcon( QPixmap( ":/pixmaps/play_16px.png" ) ) );
542 objLayout->addWidget( playButton, 1, 0 );
545 QToolButton *stopButton = new QToolButton;
546 stopButton->setIcon( QIcon( QPixmap( ":/pixmaps/stop_16px.png" ) ) );
547 objLayout->addWidget( stopButton, 1, 1 );
549 loopButton = new QToolButton;
550 objLayout->addWidget( loopButton, 1, 2 );
552 BUTTONACT( playButton, togglePlayPause() );
553 BUTTONACT( stopButton, stop() );
554 BUTTONACT( loopButton, toggleLoop() );
559 void VLMBroadcast::update()
561 VLMWrapper::EditBroadcast( name, input, output, b_enabled, b_looped );
563 loopButton->setIcon( QIcon( QPixmap( ":/pixmaps/playlist_repeat_all.png" ) ) );
565 loopButton->setIcon( QIcon( QPixmap( ":/pixmaps/playlist_repeat_off.png" ) ) );
568 void VLMBroadcast::togglePlayPause()
570 if( b_playing = true )
572 VLMWrapper::ControlBroadcast( name, ControlBroadcastPause );
573 playButton->setIcon( QIcon( QPixmap( ":/pixmaps/pause_16px.png" ) ) );
577 VLMWrapper::ControlBroadcast( name, ControlBroadcastPlay );
578 playButton->setIcon( QIcon( QPixmap( ":/pixmaps/play_16px.png" ) ) );
580 b_playing = !b_playing;
583 void VLMBroadcast::toggleLoop()
585 b_enabled = !b_enabled;
589 void VLMBroadcast::stop()
591 VLMWrapper::ControlBroadcast( name, ControlBroadcastStop );
592 playButton->setIcon( QIcon( QPixmap( ":/pixmaps/play_16px.png" ) ) );
598 VLMSchedule::VLMSchedule( QString name, QString input, QString output,
599 QDateTime _schetime, QDateTime _schedate,
600 int _scherepeatnumber, int _repeatDays,
601 bool enabled, VLMDialog *parent )
602 : VLMAWidget( name, input, output, enabled, parent, QVLM_Schedule )
604 nameLabel->setText( "Schedule: " + name );
605 schetime = _schetime;
606 schedate = _schedate;
607 rNumber = _scherepeatnumber;
609 type = QVLM_Schedule;
613 void VLMSchedule::update()
615 VLMWrapper::EditSchedule( name, input, output, schetime, schedate,
616 rNumber, rDays, b_enabled);
622 VLMVod::VLMVod( QString name, QString input, QString output,
623 bool enabled, QString _mux, VLMDialog *parent)
624 : VLMAWidget( name, input, output, enabled, parent, QVLM_VOD )
626 nameLabel->setText( "VOD:" + name );
629 muxLabel = new QLabel;
630 objLayout->addWidget( muxLabel, 1, 0 );
635 void VLMVod::update()
637 muxLabel->setText( mux );
638 VLMWrapper::EditVod( name, input, output, b_enabled, mux );
645 vlm_t * VLMWrapper::p_vlm = NULL;
647 VLMWrapper::VLMWrapper( vlm_t *_p_vlm )
652 VLMWrapper::~VLMWrapper()
657 void VLMWrapper::AddBroadcast( const QString name, QString input,
659 bool b_enabled, bool b_loop )
661 vlm_message_t *message;
662 QString command = "new \"" + name + "\" broadcast";
663 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
664 vlm_MessageDelete( message );
665 EditBroadcast( name, input, output, b_enabled, b_loop );
668 void VLMWrapper::EditBroadcast( const QString name, const QString input,
669 const QString output,
670 bool b_enabled, bool b_loop )
672 vlm_message_t *message;
675 command = "setup \"" + name + "\" inputdel all";
676 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
677 vlm_MessageDelete( message );
678 command = "setup \"" + name + "\" input \"" + input + "\"";
679 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
680 vlm_MessageDelete( message );
681 if( !output.isEmpty() )
683 command = "setup \"" + name + "\" output \"" + output + "\"";
684 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
685 vlm_MessageDelete( message );
689 command = "setup \"" + name + "\" enabled";
690 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
691 vlm_MessageDelete( message );
695 command = "setup \"" + name + "\" loop";
696 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
697 vlm_MessageDelete( message );
701 void VLMWrapper::EnableItem( const QString name, bool b_enable )
703 vlm_message_t *message;
704 QString command = "setup \"" + name + ( b_enable ? " enable" : " disable" );
707 void VLMWrapper::ControlBroadcast( const QString name, int BroadcastStatus,
710 vlm_message_t *message;
712 QString command = "control \"" + name;
713 switch( BroadcastStatus )
715 case ControlBroadcastPlay:
718 case ControlBroadcastPause:
721 case ControlBroadcastStop:
724 case ControlBroadcastSeek:
725 command += " seek" + seek;
728 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
729 vlm_MessageDelete( message );
732 void VLMWrapper::AddVod( const QString name, const QString input,
733 const QString output,
734 bool b_enabled, const QString mux )
736 vlm_message_t *message;
737 QString command = "new \"" + name + "\" vod";
738 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
739 vlm_MessageDelete( message );
740 EditVod( name, input, output, b_enabled, mux );
743 void VLMWrapper::EditVod( const QString name, const QString input,
744 const QString output,
748 vlm_message_t *message;
749 QString command = "setup \"" + name + "\" input \"" + input + "\"";
750 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
751 vlm_MessageDelete( message );
753 if( !output.isEmpty() )
755 command = "setup \"" + name + "\" output \"" + output + "\"";
756 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
757 vlm_MessageDelete( message );
762 command = "setup \"" + name + "\" enabled";
763 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
764 vlm_MessageDelete( message );
768 command = "setup \"" + name + "\" mux \"" + mux + "\"";
769 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
770 vlm_MessageDelete( message );
774 void VLMWrapper::AddSchedule( const QString name, const QString input,
775 const QString output, QDateTime _schetime,
777 int _scherepeatnumber, int _repeatDays,
778 bool b_enabled, const QString mux )
780 vlm_message_t *message;
781 QString command = "new \"" + name + "\" schedule";
782 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
783 vlm_MessageDelete( message );
784 EditSchedule( name, input, output, _schetime, _schedate,
785 _scherepeatnumber, _repeatDays, b_enabled, mux );
788 void VLMWrapper::EditSchedule( const QString name, const QString input,
789 const QString output, QDateTime _schetime,
790 QDateTime _schedate, int _scherepeatnumber,
791 int _repeatDays, bool b_enabled,
794 vlm_message_t *message;
795 QString command = "setup \"" + name + "\" input \"" + input + "\"";
796 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
797 vlm_MessageDelete( message );
799 if( !output.isEmpty() )
801 command = "setup \"" + name + "\" output \"" + output + "\"";
802 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
803 vlm_MessageDelete( message );
808 command = "setup \"" + name + "\" enabled";
809 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
810 vlm_MessageDelete( message );
815 command = "setup \"" + name + "\" mux \"" + mux + "\"";
816 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
817 vlm_MessageDelete( message );
820 command = "setup \"" + name + "\" date \"" +
821 _schedate.toString( "yyyy/MM/dd" )+ "-" +
822 _schetime.toString( "hh:mm:ss" ) + "\"";
823 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
824 vlm_MessageDelete( message );
825 if( _scherepeatnumber > 0 )
827 command = "setup \"" + name + "\" repeat \"" + _scherepeatnumber + "\"";
828 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
829 vlm_MessageDelete( message );