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>
57 VLMDialog *VLMDialog::instance = NULL;
59 VLMDialog::VLMDialog( QWidget *parent, intf_thread_t *_p_intf ) : QVLCDialog( parent, _p_intf )
61 p_vlm = vlm_New( p_intf );
65 msg_Warn( p_intf, "Couldn't build VLM object ");
68 vlmWrapper = new VLMWrapper( p_vlm );
72 ui.saveButton->hide();
74 #define ADDMEDIATYPES( str, type ) ui.mediaType->addItem( qtr( str ), QVariant( type ) );
75 ADDMEDIATYPES( N_("Broadcast"), QVLM_Broadcast );
76 ADDMEDIATYPES( N_("Schedule"), QVLM_Schedule );
77 ADDMEDIATYPES( N_("Video On Demand ( VOD )"), QVLM_VOD );
81 QGridLayout *schetimelayout = new QGridLayout( ui.schedBox );
82 QLabel *schetimelabel = new QLabel( qtr( "Hours / Minutes / Seconds:" ) );
83 schetimelayout->addWidget( schetimelabel, 0, 0 );
84 QLabel *schedatelabel = new QLabel( qtr( "Day / Month / Year:" ) );
85 schetimelayout->addWidget( schedatelabel, 1, 0 );
86 QLabel *scherepeatLabel = new QLabel( qtr( "Repeat:" ) );
87 schetimelayout->addWidget( scherepeatLabel, 2, 0 );
88 QLabel *scherepeatTimeLabel = new QLabel( qtr( "Repeat delay:" ) );
89 schetimelayout->addWidget( scherepeatTimeLabel, 3, 0 );
91 time = new QDateTimeEdit( QTime::currentTime() );
92 time->setAlignment( Qt::AlignRight );
93 time->setDisplayFormat( "hh:mm:ss" );
94 schetimelayout->addWidget( time, 0, 1, 1, 3 );
96 date = new QDateTimeEdit( QDate::currentDate() );
97 date->setAlignment( Qt::AlignRight );
98 date->setCalendarPopup( true );
100 date->setDisplayFormat( "dd MM yyyy" );
102 date->setDisplayFormat( "dd MMMM yyyy" );
104 schetimelayout->addWidget( date, 1, 1, 1, 3 );
106 scherepeatnumber = new QSpinBox;
107 scherepeatnumber->setAlignment( Qt::AlignRight );
108 schetimelayout->addWidget( scherepeatnumber, 2, 1, 1, 3 );
110 repeatDays = new QSpinBox;
111 repeatDays->setAlignment( Qt::AlignRight );
112 schetimelayout->addWidget( repeatDays, 3, 1, 1, 1 );
113 repeatDays->setSuffix( qtr(" days") );
115 repeatTime = new QDateTimeEdit;
116 repeatTime->setAlignment( Qt::AlignRight );
117 schetimelayout->addWidget( repeatTime, 3, 2, 1, 2 );
118 repeatTime->setDisplayFormat( "hh:mm:ss" );
121 ui.vlmItemScroll->setFrameStyle( QFrame::NoFrame );
122 ui.vlmItemScroll->setWidgetResizable( true );
123 vlmItemWidget = new QWidget;
124 vlmItemLayout = new QVBoxLayout( vlmItemWidget );
125 vlmItemWidget->setLayout( vlmItemLayout );
126 ui.vlmItemScroll->setWidget( vlmItemWidget );
128 QSpacerItem *spacer =
129 new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding);
130 vlmItemLayout->addItem( spacer );
132 QPushButton *importButton = new QPushButton( qtr( "I&mport" ) );
133 ui.buttonBox->addButton( importButton, QDialogButtonBox::ActionRole );
135 QPushButton *exportButton = new QPushButton( qtr( "E&xport" ) );
136 ui.buttonBox->addButton( exportButton, QDialogButtonBox::ActionRole );
138 QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
139 ui.buttonBox->addButton( closeButton, QDialogButtonBox::AcceptRole );
142 showScheduleWidget( QVLM_Broadcast );
144 /* Connect the comboBox to show the right Widgets */
145 CONNECT( ui.mediaType, currentIndexChanged( int ),
146 this, showScheduleWidget( int ) );
148 /* Connect the leftList to show the good VLMItem */
149 CONNECT( ui.vlmListItem, currentRowChanged( int ),
150 this, selectVLMItem( int ) );
152 BUTTONACT( closeButton, close() );
153 BUTTONACT( exportButton, exportVLMConf() );
154 BUTTONACT( importButton, importVLMConf() );
155 BUTTONACT( ui.addButton, addVLMItem() );
156 BUTTONACT( ui.clearButton, clearWidgets() );
157 BUTTONACT( ui.saveButton, saveModifications() );
158 BUTTONACT( ui.inputButton, selectInput() );
159 BUTTONACT( ui.outputButton, selectOutput() );
162 VLMDialog::~VLMDialog()
166 /* TODO :you have to destroy vlm here to close
167 * but we shouldn't destroy vlm here in case somebody else wants it */
174 void VLMDialog::showScheduleWidget( int i )
176 ui.schedBox->setVisible( ( i == QVLM_Schedule ) );
177 ui.loopBCast->setVisible( ( i == QVLM_Broadcast ) );
178 ui.vodBox->setVisible( ( i == QVLM_VOD ) );
181 void VLMDialog::selectVLMItem( int i )
184 ui.vlmItemScroll->ensureWidgetVisible( vlmItems.at( i ) );
187 bool VLMDialog::isNameGenuine( QString name )
189 for( int i = 0; i < vlmItems.size(); i++ )
191 if( vlmItems.at( i )->name == name )
197 void VLMDialog::addVLMItem()
199 int vlmItemCount = vlmItems.size();
201 /* Take the name and Check it */
202 QString name = ui.nameLedit->text();
203 if( name.isEmpty() || !isNameGenuine( name ) )
205 msg_Err( p_intf, "VLM Name is empty or already exists, I can't do it" );
209 int type = ui.mediaType->itemData( ui.mediaType->currentIndex() ).toInt();
211 QString typeShortName;
212 QString inputText = ui.inputLedit->text();
213 QString outputText = ui.outputLedit->text();
214 bool b_checked = ui.enableCheck->isChecked();
215 bool b_looped = ui.loopBCast->isChecked();
216 QDateTime schetime = time->dateTime();
217 QDateTime schedate = date->dateTime();
218 int repeatnum = scherepeatnumber->value();
219 int repeatdays = repeatDays->value();
220 VLMAWidget * vlmAwidget;
225 typeShortName = "Bcast";
226 vlmAwidget = new VLMBroadcast( name, inputText, outputText,
227 b_checked, b_looped, this );
228 VLMWrapper::AddBroadcast( name, inputText, outputText, b_checked,
232 typeShortName = "VOD";
233 vlmAwidget = new VLMVod( name, inputText, outputText,
234 b_checked, ui.muxLedit->text(), this );
235 VLMWrapper::AddVod( name, inputText, outputText, b_checked );
238 typeShortName = "Sched";
239 vlmAwidget = new VLMSchedule( name, inputText, outputText,
240 schetime, schedate, repeatnum,
241 repeatdays, b_checked, this );
242 VLMWrapper::AddSchedule( name, inputText, outputText, schetime,
243 schedate, repeatnum, repeatdays, b_checked);
246 msg_Warn( p_intf, "Something bad happened" );
250 /* Add an Item of the Side List */
251 ui.vlmListItem->addItem( typeShortName + " : " + name );
252 ui.vlmListItem->setCurrentRow( vlmItemCount - 1 );
254 /* Add a new VLMAWidget on the main List */
256 vlmItemLayout->insertWidget( vlmItemCount, vlmAwidget );
257 vlmItems.append( vlmAwidget );
261 /* TODO : VOD are not exported to the file */
262 bool VLMDialog::exportVLMConf()
264 QString saveVLMConfFileName = QFileDialog::getSaveFileName(
265 this, qtr( "Save VLM configuration as..." ),
266 qfu( config_GetHomeDir() ),
267 qtr( "VLM conf (*.vlm);;All (*.*)" ) );
269 if( !saveVLMConfFileName.isEmpty() )
271 vlm_message_t *message;
272 QString command = "save \"" + saveVLMConfFileName + "\"";
273 vlm_ExecuteCommand( p_vlm , qtu( command ) , &message );
274 vlm_MessageDelete( message );
280 void VLMDialog::mediasPopulator()
285 QString typeShortName;
287 vlm_media_t ***ppp_dsc = (vlm_media_t ***)malloc( sizeof( vlm_media_t ) );
289 /* Get medias informations and numbers */
290 vlm_Control( p_vlm, VLM_GET_MEDIAS, ppp_dsc, &i_nMedias );
292 /* Loop on all of them */
293 for( int i = 0; i < i_nMedias; i++ )
295 VLMAWidget * vlmAwidget;
296 vlmItemCount = vlmItems.size();
298 QString mediaName = qfu( (*ppp_dsc)[i]->psz_name );
299 /* It may have several inputs, we take the first one by default
300 - an evolution will be to manage these inputs in the gui */
301 QString inputText = qfu( (*ppp_dsc)[i]->ppsz_input[0] );
303 QString outputText = qfu( (*ppp_dsc)[i]->psz_output );
305 /* Schedule media is a quite especial, maybe there is another way to grab informations */
306 if( (*ppp_dsc)[i]->b_vod )
308 typeShortName = "VOD";
309 QString mux = qfu( (*ppp_dsc)[i]->vod.psz_mux );
310 vlmAwidget = new VLMVod( mediaName, inputText, outputText,
311 (*ppp_dsc)[i]->b_enabled, mux, this );
315 typeShortName = "Bcast";
316 vlmAwidget = new VLMBroadcast( mediaName, inputText, outputText,
317 (*ppp_dsc)[i]->b_enabled, (*ppp_dsc)[i]->broadcast.b_loop, this );
319 /* Add an Item of the Side List */
320 ui.vlmListItem->addItem( typeShortName + " : " + mediaName );
321 ui.vlmListItem->setCurrentRow( vlmItemCount - 1 );
323 /* Add a new VLMAWidget on the main List */
324 vlmItemLayout->insertWidget( vlmItemCount, vlmAwidget );
325 vlmItems.append( vlmAwidget );
332 bool VLMDialog::importVLMConf()
334 QString openVLMConfFileName = QFileDialog::getOpenFileName(
335 this, qtr( "Open VLM configuration..." ),
336 qfu( config_GetHomeDir() ),
337 qtr( "VLM conf (*.vlm) ;; All (*.*)" ) );
339 if( !openVLMConfFileName.isEmpty() )
341 vlm_message_t *message;
343 QString command = "load \"" + openVLMConfFileName + "\"";
344 status = vlm_ExecuteCommand( p_vlm, qtu( command ) , &message );
345 vlm_MessageDelete( message );
352 msg_Warn( p_intf, "Failed to import vlm configuration file : %s", qtu( command ) );
360 void VLMDialog::clearWidgets()
362 ui.nameLedit->clear();
363 ui.inputLedit->clear();
364 ui.outputLedit->clear();
365 time->setTime( QTime::currentTime() );
366 date->setDate( QDate::currentDate() );
367 ui.enableCheck->setChecked( true );
368 ui.nameLedit->setReadOnly( false );
369 ui.loopBCast->setChecked( false );
370 ui.muxLedit->clear();
371 ui.saveButton->hide();
372 ui.addButton->show();
375 void VLMDialog::selectInput()
377 OpenDialog *o = OpenDialog::getInstance( this, p_intf, false, SELECT, true );
379 ui.inputLedit->setText( o->getMRL() );
382 void VLMDialog::selectOutput()
384 SoutDialog *s = SoutDialog::getInstance( this, p_intf, false );
385 if( s->exec() == QDialog::Accepted )
386 ui.outputLedit->setText( s->getMrl() );
389 /* Object Modification */
390 void VLMDialog::removeVLMItem( VLMAWidget *vlmObj )
392 int index = vlmItems.indexOf( vlmObj );
393 if( index < 0 ) return;
394 delete ui.vlmListItem->takeItem( index );
395 vlmItems.removeAt( index );
398 /* HERE BE DRAGONS VLM REQUEST */
401 void VLMDialog::startModifyVLMItem( VLMAWidget *vlmObj )
403 currentIndex = vlmItems.indexOf( vlmObj );
404 if( currentIndex < 0 ) return;
406 ui.vlmListItem->setCurrentRow( currentIndex );
407 ui.nameLedit->setText( vlmObj->name );
408 ui.inputLedit->setText( vlmObj->input );
409 ui.outputLedit->setText( vlmObj->output );
410 ui.enableCheck->setChecked( vlmObj->b_enabled );
412 switch( vlmObj->type )
415 ui.loopBCast->setChecked( (qobject_cast<VLMBroadcast *>(vlmObj))->b_looped );
418 ui.muxLedit->setText( (qobject_cast<VLMVod *>(vlmObj))->mux );
421 time->setDateTime( ( qobject_cast<VLMSchedule *>(vlmObj))->schetime );
422 date->setDateTime( ( qobject_cast<VLMSchedule *>(vlmObj))->schedate );
426 ui.nameLedit->setReadOnly( true );
427 ui.addButton->hide();
428 ui.saveButton->show();
431 void VLMDialog::saveModifications()
433 VLMAWidget *vlmObj = vlmItems.at( currentIndex );
436 vlmObj->input = ui.inputLedit->text();
437 vlmObj->output = ui.outputLedit->text();
438 vlmObj->setChecked( ui.enableCheck->isChecked() );
439 vlmObj->b_enabled = ui.enableCheck->isChecked();
440 switch( vlmObj->type )
443 (qobject_cast<VLMBroadcast *>(vlmObj))->b_looped = ui.loopBCast->isChecked();
446 (qobject_cast<VLMVod *>(vlmObj))->mux = ui.muxLedit->text();
449 (qobject_cast<VLMSchedule *>(vlmObj))->schetime = time->dateTime();
450 (qobject_cast<VLMSchedule *>(vlmObj))->schedate = date->dateTime();
451 (qobject_cast<VLMSchedule *>(vlmObj))->rNumber = scherepeatnumber->value();
452 (qobject_cast<VLMSchedule *>(vlmObj))->rDays = repeatDays->value();
461 /*********************************
462 * VLMAWidget - Abstract class
463 ********************************/
465 VLMAWidget::VLMAWidget( QString _name,
471 : QGroupBox( _name, _parent )
477 b_enabled = _enabled;
480 setCheckable( true );
481 setChecked( b_enabled );
483 objLayout = new QGridLayout( this );
484 setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum );
486 nameLabel = new QLabel;
487 objLayout->addWidget( nameLabel, 0, 0, 1, 4 );
489 /*QLabel *time = new QLabel( "--:--/--:--" );
490 objLayout->addWidget( time, 1, 3, 1, 2 );*/
492 QToolButton *modifyButton = new QToolButton;
493 modifyButton->setIcon( QIcon( QPixmap( ":/settings" ) ) );
494 objLayout->addWidget( modifyButton, 0, 5 );
496 QToolButton *deleteButton = new QToolButton;
497 deleteButton->setIcon( QIcon( QPixmap( ":/quit" ) ) );
498 objLayout->addWidget( deleteButton, 0, 6 );
500 BUTTONACT( modifyButton, modify() );
501 BUTTONACT( deleteButton, del() );
502 CONNECT( this, clicked( bool ), this, toggleEnabled( bool ) );
505 void VLMAWidget::modify()
507 parent->startModifyVLMItem( this );
510 void VLMAWidget::del()
512 parent->removeVLMItem( this );
515 void VLMAWidget::toggleEnabled( bool b_enable )
517 VLMWrapper::EnableItem( name, b_enable );
523 VLMBroadcast::VLMBroadcast( QString _name, QString _input, QString _output,
524 bool _enabled, bool _looped, VLMDialog *_parent)
525 : VLMAWidget( _name, _input, _output,
526 _enabled, _parent, QVLM_Broadcast )
528 nameLabel->setText( qtr("Broadcast: ") + name );
529 type = QVLM_Broadcast;
532 playButton = new QToolButton;
533 playButton->setIcon( QIcon( QPixmap( ":/play_16px" ) ) );
534 objLayout->addWidget( playButton, 1, 0 );
537 QToolButton *stopButton = new QToolButton;
538 stopButton->setIcon( QIcon( QPixmap( ":/stop_16px" ) ) );
539 objLayout->addWidget( stopButton, 1, 1 );
541 loopButton = new QToolButton;
542 objLayout->addWidget( loopButton, 1, 2 );
544 BUTTONACT( playButton, togglePlayPause() );
545 BUTTONACT( stopButton, stop() );
546 BUTTONACT( loopButton, toggleLoop() );
551 void VLMBroadcast::update()
553 VLMWrapper::EditBroadcast( name, input, output, b_enabled, b_looped );
555 loopButton->setIcon( QIcon( QPixmap( ":/repeat_all" ) ) );
557 loopButton->setIcon( QIcon( QPixmap( ":/repeat_off" ) ) );
560 void VLMBroadcast::togglePlayPause()
562 if( b_playing = true )
564 VLMWrapper::ControlBroadcast( name, ControlBroadcastPause );
565 playButton->setIcon( QIcon( QPixmap( ":/pause_16px" ) ) );
569 VLMWrapper::ControlBroadcast( name, ControlBroadcastPlay );
570 playButton->setIcon( QIcon( QPixmap( ":/play_16px" ) ) );
572 b_playing = !b_playing;
575 void VLMBroadcast::toggleLoop()
577 b_enabled = !b_enabled;
581 void VLMBroadcast::stop()
583 VLMWrapper::ControlBroadcast( name, ControlBroadcastStop );
584 playButton->setIcon( QIcon( QPixmap( ":/play_16px" ) ) );
590 VLMSchedule::VLMSchedule( QString name, QString input, QString output,
591 QDateTime _schetime, QDateTime _schedate,
592 int _scherepeatnumber, int _repeatDays,
593 bool enabled, VLMDialog *parent )
594 : VLMAWidget( name, input, output, enabled, parent, QVLM_Schedule )
596 nameLabel->setText( qtr("Schedule: ") + name );
597 schetime = _schetime;
598 schedate = _schedate;
599 rNumber = _scherepeatnumber;
601 type = QVLM_Schedule;
605 void VLMSchedule::update()
607 VLMWrapper::EditSchedule( name, input, output, schetime, schedate,
608 rNumber, rDays, b_enabled);
614 VLMVod::VLMVod( QString name, QString input, QString output,
615 bool enabled, QString _mux, VLMDialog *parent)
616 : VLMAWidget( name, input, output, enabled, parent, QVLM_VOD )
618 nameLabel->setText( qtr("VOD: ") + name );
621 muxLabel = new QLabel;
622 objLayout->addWidget( muxLabel, 1, 0 );
627 void VLMVod::update()
629 muxLabel->setText( mux );
630 VLMWrapper::EditVod( name, input, output, b_enabled, mux );
637 vlm_t * VLMWrapper::p_vlm = NULL;
639 VLMWrapper::VLMWrapper( vlm_t *_p_vlm )
644 VLMWrapper::~VLMWrapper()
649 void VLMWrapper::AddBroadcast( const QString name, QString input,
651 bool b_enabled, bool b_loop )
653 vlm_message_t *message;
654 QString command = "new \"" + name + "\" broadcast";
655 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
656 vlm_MessageDelete( message );
657 EditBroadcast( name, input, output, b_enabled, b_loop );
660 void VLMWrapper::EditBroadcast( const QString name, const QString input,
661 const QString output,
662 bool b_enabled, bool b_loop )
664 vlm_message_t *message;
667 command = "setup \"" + name + "\" inputdel all";
668 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
669 vlm_MessageDelete( message );
670 command = "setup \"" + name + "\" input \"" + input + "\"";
671 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
672 vlm_MessageDelete( message );
673 if( !output.isEmpty() )
675 command = "setup \"" + name + "\" output \"" + output + "\"";
676 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
677 vlm_MessageDelete( message );
681 command = "setup \"" + name + "\" enabled";
682 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
683 vlm_MessageDelete( message );
687 command = "setup \"" + name + "\" loop";
688 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
689 vlm_MessageDelete( message );
693 void VLMWrapper::EnableItem( const QString name, bool b_enable )
695 vlm_message_t *message;
696 QString command = "setup \"" + name + ( b_enable ? " enable" : " disable" );
699 void VLMWrapper::ControlBroadcast( const QString name, int BroadcastStatus,
702 vlm_message_t *message;
704 QString command = "control \"" + name;
705 switch( BroadcastStatus )
707 case ControlBroadcastPlay:
710 case ControlBroadcastPause:
713 case ControlBroadcastStop:
716 case ControlBroadcastSeek:
717 command += " seek" + seek;
720 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
721 vlm_MessageDelete( message );
724 void VLMWrapper::AddVod( const QString name, const QString input,
725 const QString output,
726 bool b_enabled, const QString mux )
728 vlm_message_t *message;
729 QString command = "new \"" + name + "\" vod";
730 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
731 vlm_MessageDelete( message );
732 EditVod( name, input, output, b_enabled, mux );
735 void VLMWrapper::EditVod( const QString name, const QString input,
736 const QString output,
740 vlm_message_t *message;
741 QString command = "setup \"" + name + "\" input \"" + input + "\"";
742 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
743 vlm_MessageDelete( message );
745 if( !output.isEmpty() )
747 command = "setup \"" + name + "\" output \"" + output + "\"";
748 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
749 vlm_MessageDelete( message );
754 command = "setup \"" + name + "\" enabled";
755 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
756 vlm_MessageDelete( message );
760 command = "setup \"" + name + "\" mux \"" + mux + "\"";
761 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
762 vlm_MessageDelete( message );
766 void VLMWrapper::AddSchedule( const QString name, const QString input,
767 const QString output, QDateTime _schetime,
769 int _scherepeatnumber, int _repeatDays,
770 bool b_enabled, const QString mux )
772 vlm_message_t *message;
773 QString command = "new \"" + name + "\" schedule";
774 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
775 vlm_MessageDelete( message );
776 EditSchedule( name, input, output, _schetime, _schedate,
777 _scherepeatnumber, _repeatDays, b_enabled, mux );
780 void VLMWrapper::EditSchedule( const QString name, const QString input,
781 const QString output, QDateTime _schetime,
782 QDateTime _schedate, int _scherepeatnumber,
783 int _repeatDays, bool b_enabled,
786 vlm_message_t *message;
787 QString command = "setup \"" + name + "\" input \"" + input + "\"";
788 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
789 vlm_MessageDelete( message );
791 if( !output.isEmpty() )
793 command = "setup \"" + name + "\" output \"" + output + "\"";
794 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
795 vlm_MessageDelete( message );
800 command = "setup \"" + name + "\" enabled";
801 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
802 vlm_MessageDelete( message );
807 command = "setup \"" + name + "\" mux \"" + mux + "\"";
808 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
809 vlm_MessageDelete( message );
812 command = "setup \"" + name + "\" date \"" +
813 _schedate.toString( "yyyy/MM/dd" )+ "-" +
814 _schetime.toString( "hh:mm:ss" ) + "\"";
815 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
816 vlm_MessageDelete( message );
817 if( _scherepeatnumber > 0 )
819 command = "setup \"" + name + "\" repeat \"" + _scherepeatnumber + "\"";
820 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
821 vlm_MessageDelete( message );