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"
35 #include "util/qt_dirs.hpp"
39 #include <QVBoxLayout>
40 #include <QStackedWidget>
43 #include <QGridLayout>
46 #include <QToolButton>
48 #include <QPushButton>
49 #include <QHBoxLayout>
50 #include <QDateTimeEdit>
53 #include <QHeaderView>
54 #include <QScrollArea>
55 #include <QFileDialog>
58 VLMDialog::VLMDialog( intf_thread_t *_p_intf ) : QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf )
60 p_vlm = vlm_New( p_intf );
64 msg_Warn( p_intf, "Couldn't build VLM object ");
67 vlmWrapper = new VLMWrapper( p_vlm );
71 ui.saveButton->hide();
73 #define ADDMEDIATYPES( str, type ) ui.mediaType->addItem( qtr( str ), QVariant( type ) );
74 ADDMEDIATYPES( N_("Broadcast"), QVLM_Broadcast );
75 ADDMEDIATYPES( N_("Schedule"), QVLM_Schedule );
76 ADDMEDIATYPES( N_("Video On Demand ( VOD )"), QVLM_VOD );
80 QGridLayout *schetimelayout = new QGridLayout( ui.schedBox );
81 QLabel *schetimelabel = new QLabel( qtr( "Hours / Minutes / Seconds:" ) );
82 schetimelayout->addWidget( schetimelabel, 0, 0 );
83 QLabel *schedatelabel = new QLabel( qtr( "Day / Month / Year:" ) );
84 schetimelayout->addWidget( schedatelabel, 1, 0 );
85 QLabel *scherepeatLabel = new QLabel( qtr( "Repeat:" ) );
86 schetimelayout->addWidget( scherepeatLabel, 2, 0 );
87 QLabel *scherepeatTimeLabel = new QLabel( qtr( "Repeat delay:" ) );
88 schetimelayout->addWidget( scherepeatTimeLabel, 3, 0 );
90 time = new QDateTimeEdit( QTime::currentTime() );
91 time->setAlignment( Qt::AlignRight );
92 time->setDisplayFormat( "hh:mm:ss" );
93 schetimelayout->addWidget( time, 0, 1, 1, 3 );
95 date = new QDateTimeEdit( QDate::currentDate() );
96 date->setAlignment( Qt::AlignRight );
97 date->setCalendarPopup( true );
99 date->setDisplayFormat( "dd MM yyyy" );
101 date->setDisplayFormat( "dd MMMM yyyy" );
103 schetimelayout->addWidget( date, 1, 1, 1, 3 );
105 scherepeatnumber = new QSpinBox;
106 scherepeatnumber->setAlignment( Qt::AlignRight );
107 schetimelayout->addWidget( scherepeatnumber, 2, 1, 1, 3 );
109 repeatDays = new QSpinBox;
110 repeatDays->setAlignment( Qt::AlignRight );
111 schetimelayout->addWidget( repeatDays, 3, 1, 1, 1 );
112 repeatDays->setSuffix( qtr(" days") );
114 repeatTime = new QDateTimeEdit;
115 repeatTime->setAlignment( Qt::AlignRight );
116 schetimelayout->addWidget( repeatTime, 3, 2, 1, 2 );
117 repeatTime->setDisplayFormat( "hh:mm:ss" );
120 ui.vlmItemScroll->setFrameStyle( QFrame::NoFrame );
121 ui.vlmItemScroll->setWidgetResizable( true );
122 vlmItemWidget = new QWidget;
123 vlmItemLayout = new QVBoxLayout( vlmItemWidget );
124 vlmItemWidget->setLayout( vlmItemLayout );
125 ui.vlmItemScroll->setWidget( vlmItemWidget );
127 QSpacerItem *spacer =
128 new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding);
129 vlmItemLayout->addItem( spacer );
131 QPushButton *importButton = new QPushButton( qtr( "I&mport" ) );
132 ui.buttonBox->addButton( importButton, QDialogButtonBox::ActionRole );
134 QPushButton *exportButton = new QPushButton( qtr( "E&xport" ) );
135 ui.buttonBox->addButton( exportButton, QDialogButtonBox::ActionRole );
137 QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
138 ui.buttonBox->addButton( closeButton, QDialogButtonBox::AcceptRole );
141 showScheduleWidget( QVLM_Broadcast );
143 /* Connect the comboBox to show the right Widgets */
144 CONNECT( ui.mediaType, currentIndexChanged( int ),
145 this, showScheduleWidget( int ) );
147 /* Connect the leftList to show the good VLMItem */
148 CONNECT( ui.vlmListItem, currentRowChanged( int ),
149 this, selectVLMItem( int ) );
151 BUTTONACT( closeButton, close() );
152 BUTTONACT( exportButton, exportVLMConf() );
153 BUTTONACT( importButton, importVLMConf() );
154 BUTTONACT( ui.addButton, addVLMItem() );
155 BUTTONACT( ui.clearButton, clearWidgets() );
156 BUTTONACT( ui.saveButton, saveModifications() );
157 BUTTONACT( ui.inputButton, selectInput() );
158 BUTTONACT( ui.outputButton, selectOutput() );
159 //readSettings( "VLM", QSize( 700, 500 ) );
162 VLMDialog::~VLMDialog()
166 //writeSettings( "VLM" );
167 /* TODO :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( const 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;
222 outputText.remove( ":sout=" );
227 typeShortName = "Bcast";
228 vlmAwidget = new VLMBroadcast( name, inputText, outputText,
229 b_checked, b_looped, this );
232 typeShortName = "VOD";
233 vlmAwidget = new VLMVod( name, inputText, outputText,
234 b_checked, ui.muxLedit->text(), this );
237 typeShortName = "Sched";
238 vlmAwidget = new VLMSchedule( name, inputText, outputText,
239 schetime, schedate, repeatnum,
240 repeatdays, b_checked, this );
243 msg_Warn( p_intf, "Something bad happened" );
247 /* Add an Item of the Side List */
248 ui.vlmListItem->addItem( typeShortName + " : " + name );
249 ui.vlmListItem->setCurrentRow( vlmItemCount - 1 );
251 /* Add a new VLMAWidget on the main List */
253 vlmItemLayout->insertWidget( vlmItemCount, vlmAwidget );
254 vlmItems.append( vlmAwidget );
258 /* TODO : VOD are not exported to the file */
259 bool VLMDialog::exportVLMConf()
261 QString saveVLMConfFileName = QFileDialog::getSaveFileName( this,
262 qtr( "Save VLM configuration as..." ),
263 QVLCUserDir( VLC_DOCUMENTS_DIR ),
264 qtr( "VLM conf (*.vlm);;All (*)" ) );
266 if( !saveVLMConfFileName.isEmpty() )
268 vlm_message_t *message;
269 QString command = "save \"" + saveVLMConfFileName + "\"";
270 vlm_ExecuteCommand( p_vlm , qtu( command ) , &message );
271 vlm_MessageDelete( message );
278 void VLMDialog::mediasPopulator()
283 QString typeShortName;
285 vlm_media_t ***ppp_dsc = (vlm_media_t ***)malloc( sizeof( vlm_media_t ) );
287 /* Get medias informations and numbers */
288 vlm_Control( p_vlm, VLM_GET_MEDIAS, ppp_dsc, &i_nMedias );
290 /* Loop on all of them */
291 for( int i = 0; i < i_nMedias; i++ )
293 VLMAWidget * vlmAwidget;
294 vlmItemCount = vlmItems.size();
296 QString mediaName = qfu( (*ppp_dsc)[i]->psz_name );
297 /* It may have several inputs, we take the first one by default
298 - an evolution will be to manage these inputs in the gui */
299 QString inputText = qfu( (*ppp_dsc)[i]->ppsz_input[0] );
301 QString outputText = qfu( (*ppp_dsc)[i]->psz_output );
303 /* Schedule media is a quite especial, maybe there is another way to grab informations */
304 if( (*ppp_dsc)[i]->b_vod )
306 typeShortName = "VOD";
307 QString mux = qfu( (*ppp_dsc)[i]->vod.psz_mux );
308 vlmAwidget = new VLMVod( mediaName, inputText, outputText,
309 (*ppp_dsc)[i]->b_enabled, mux, this );
313 typeShortName = "Bcast";
314 vlmAwidget = new VLMBroadcast( mediaName, inputText, outputText,
315 (*ppp_dsc)[i]->b_enabled, (*ppp_dsc)[i]->broadcast.b_loop, this );
317 /* Add an Item of the Side List */
318 ui.vlmListItem->addItem( typeShortName + " : " + mediaName );
319 ui.vlmListItem->setCurrentRow( vlmItemCount - 1 );
321 /* Add a new VLMAWidget on the main List */
322 vlmItemLayout->insertWidget( vlmItemCount, vlmAwidget );
323 vlmItems.append( vlmAwidget );
330 bool VLMDialog::importVLMConf()
332 QString openVLMConfFileName = toNativeSeparators(
333 QFileDialog::getOpenFileName(
334 this, qtr( "Open VLM configuration..." ),
335 QVLCUserDir( VLC_DOCUMENTS_DIR ),
336 qtr( "VLM conf (*.vlm);;All (*)" ) ) );
338 if( !openVLMConfFileName.isEmpty() )
340 vlm_message_t *message;
342 QString command = "load \"" + openVLMConfFileName + "\"";
343 status = vlm_ExecuteCommand( p_vlm, qtu( command ) , &message );
344 vlm_MessageDelete( message );
351 msg_Warn( p_intf, "Failed to import vlm configuration file : %s", qtu( command ) );
359 void VLMDialog::clearWidgets()
361 ui.nameLedit->clear();
362 ui.inputLedit->clear();
363 ui.outputLedit->clear();
364 time->setTime( QTime::currentTime() );
365 date->setDate( QDate::currentDate() );
366 ui.enableCheck->setChecked( true );
367 ui.nameLedit->setReadOnly( false );
368 ui.loopBCast->setChecked( false );
369 ui.muxLedit->clear();
370 ui.saveButton->hide();
371 ui.addButton->show();
374 void VLMDialog::selectInput()
376 OpenDialog *o = OpenDialog::getInstance( this, p_intf, false, SELECT, true );
378 ui.inputLedit->setText( o->getMRL() );
381 void VLMDialog::selectOutput()
383 SoutDialog *s = new SoutDialog( this, p_intf );
384 if( s->exec() == QDialog::Accepted )
385 ui.outputLedit->setText( s->getMrl() );
388 /* Object Modification */
389 void VLMDialog::removeVLMItem( VLMAWidget *vlmObj )
391 int index = vlmItems.indexOf( vlmObj );
392 if( index < 0 ) return;
393 delete ui.vlmListItem->takeItem( index );
394 vlmItems.removeAt( index );
397 /* HERE BE DRAGONS VLM REQUEST */
400 void VLMDialog::startModifyVLMItem( VLMAWidget *vlmObj )
402 currentIndex = vlmItems.indexOf( vlmObj );
403 if( currentIndex < 0 ) return;
405 ui.vlmListItem->setCurrentRow( currentIndex );
406 ui.nameLedit->setText( vlmObj->name );
407 ui.inputLedit->setText( vlmObj->input );
408 ui.outputLedit->setText( vlmObj->output );
409 ui.enableCheck->setChecked( vlmObj->b_enabled );
411 switch( vlmObj->type )
414 ui.loopBCast->setChecked( (qobject_cast<VLMBroadcast *>(vlmObj))->b_looped );
417 ui.muxLedit->setText( (qobject_cast<VLMVod *>(vlmObj))->mux );
420 time->setDateTime( ( qobject_cast<VLMSchedule *>(vlmObj))->schetime );
421 date->setDateTime( ( qobject_cast<VLMSchedule *>(vlmObj))->schedate );
425 ui.nameLedit->setReadOnly( true );
426 ui.addButton->hide();
427 ui.saveButton->show();
430 void VLMDialog::saveModifications()
432 VLMAWidget *vlmObj = vlmItems.at( currentIndex );
435 vlmObj->input = ui.inputLedit->text();
436 vlmObj->output = ui.outputLedit->text().remove( ":sout=" );
437 vlmObj->setChecked( ui.enableCheck->isChecked() );
438 vlmObj->b_enabled = ui.enableCheck->isChecked();
439 switch( vlmObj->type )
442 (qobject_cast<VLMBroadcast *>(vlmObj))->b_looped = ui.loopBCast->isChecked();
445 (qobject_cast<VLMVod *>(vlmObj))->mux = ui.muxLedit->text();
448 (qobject_cast<VLMSchedule *>(vlmObj))->schetime = time->dateTime();
449 (qobject_cast<VLMSchedule *>(vlmObj))->schedate = date->dateTime();
450 (qobject_cast<VLMSchedule *>(vlmObj))->rNumber = scherepeatnumber->value();
451 (qobject_cast<VLMSchedule *>(vlmObj))->rDays = repeatDays->value();
460 /*********************************
461 * VLMAWidget - Abstract class
462 ********************************/
464 VLMAWidget::VLMAWidget( const QString& _name,
465 const QString& _input,
466 const QString& _output,
470 : QGroupBox( _name, _parent )
476 b_enabled = _enabled;
479 setCheckable( true );
480 setChecked( b_enabled );
482 objLayout = new QGridLayout( this );
483 setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum );
485 nameLabel = new QLabel;
486 objLayout->addWidget( nameLabel, 0, 0, 1, 4 );
488 /*QLabel *time = new QLabel( "--:--/--:--" );
489 objLayout->addWidget( time, 1, 3, 1, 2 );*/
491 QToolButton *modifyButton = new QToolButton;
492 modifyButton->setIcon( QIcon( ":/menu/settings" ) );
493 objLayout->addWidget( modifyButton, 0, 5 );
495 QToolButton *deleteButton = new QToolButton;
496 deleteButton->setIcon( QIcon( ":/menu/quit" ) );
497 objLayout->addWidget( deleteButton, 0, 6 );
499 BUTTONACT( modifyButton, modify() );
500 BUTTONACT( deleteButton, del() );
501 CONNECT( this, clicked( bool ), this, toggleEnabled( bool ) );
504 void VLMAWidget::modify()
506 parent->startModifyVLMItem( this );
509 void VLMAWidget::del()
511 parent->removeVLMItem( this );
514 void VLMAWidget::toggleEnabled( bool b_enable )
516 VLMWrapper::EnableItem( name, b_enable );
522 VLMBroadcast::VLMBroadcast( const QString& _name, const QString& _input,
523 const QString& _output, bool _enabled,
524 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( ":/menu/play" ) );
534 objLayout->addWidget( playButton, 1, 0 );
537 QToolButton *stopButton = new QToolButton;
538 stopButton->setIcon( QIcon( ":/toolbar/stop_b" ) );
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( ":/buttons/playlist/repeat_all" ) );
557 loopButton->setIcon( QIcon( ":/buttons/playlist/repeat_off" ) );
560 void VLMBroadcast::togglePlayPause()
564 VLMWrapper::ControlBroadcast( name, ControlBroadcastPause );
565 playButton->setIcon( QIcon( ":/menu/pause" ) );
569 VLMWrapper::ControlBroadcast( name, ControlBroadcastPlay );
570 playButton->setIcon( QIcon( ":/menu/play" ) );
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( ":/menu/play" ) );
590 VLMSchedule::VLMSchedule( const QString& name, const QString& input,
591 const QString& output, QDateTime _schetime,
592 QDateTime _schedate, int _scherepeatnumber,
593 int _repeatDays, 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( const QString& name, const QString& input, const QString& output,
615 bool enabled, const 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, const QString& input,
650 const QString& output,
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" );
697 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
698 vlm_MessageDelete( message );
701 void VLMWrapper::ControlBroadcast( const QString& name, int BroadcastStatus,
704 vlm_message_t *message;
706 QString command = "control \"" + name + "\"";
707 switch( BroadcastStatus )
709 case ControlBroadcastPlay:
712 case ControlBroadcastPause:
715 case ControlBroadcastStop:
718 case ControlBroadcastSeek:
719 command += " seek" + seek;
722 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
723 vlm_MessageDelete( message );
726 void VLMWrapper::AddVod( const QString& name, const QString& input,
727 const QString& output,
728 bool b_enabled, const QString& mux )
730 vlm_message_t *message;
731 QString command = "new \"" + name + "\" vod";
732 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
733 vlm_MessageDelete( message );
734 EditVod( name, input, output, b_enabled, mux );
737 void VLMWrapper::EditVod( const QString& name, const QString& input,
738 const QString& output,
742 vlm_message_t *message;
743 QString command = "setup \"" + name + "\" input \"" + input + "\"";
744 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
745 vlm_MessageDelete( message );
747 if( !output.isEmpty() )
749 command = "setup \"" + name + "\" output \"" + output + "\"";
750 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
751 vlm_MessageDelete( message );
756 command = "setup \"" + name + "\" enabled";
757 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
758 vlm_MessageDelete( message );
762 command = "setup \"" + name + "\" mux \"" + mux + "\"";
763 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
764 vlm_MessageDelete( message );
768 void VLMWrapper::AddSchedule( const QString& name, const QString& input,
769 const QString& output, QDateTime _schetime,
771 int _scherepeatnumber, int _repeatDays,
772 bool b_enabled, const QString& mux )
774 vlm_message_t *message;
775 QString command = "new \"" + name + "\" schedule";
776 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
777 vlm_MessageDelete( message );
778 EditSchedule( name, input, output, _schetime, _schedate,
779 _scherepeatnumber, _repeatDays, b_enabled, mux );
782 void VLMWrapper::EditSchedule( const QString& name, const QString& input,
783 const QString& output, QDateTime _schetime,
784 QDateTime _schedate, int _scherepeatnumber,
785 int _repeatDays, bool b_enabled,
788 vlm_message_t *message;
789 QString command = "setup \"" + name + "\" input \"" + input + "\"";
790 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
791 vlm_MessageDelete( message );
793 if( !output.isEmpty() )
795 command = "setup \"" + name + "\" output \"" + output + "\"";
796 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
797 vlm_MessageDelete( message );
802 command = "setup \"" + name + "\" enabled";
803 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
804 vlm_MessageDelete( message );
809 command = "setup \"" + name + "\" mux \"" + mux + "\"";
810 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
811 vlm_MessageDelete( message );
814 command = "setup \"" + name + "\" date \"" +
815 _schedate.toString( "yyyy/MM/dd" )+ "-" +
816 _schetime.toString( "hh:mm:ss" ) + "\"";
817 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
818 vlm_MessageDelete( message );
820 if( _scherepeatnumber > 0 )
822 command = "setup \"" + name + "\" repeat \"" + _scherepeatnumber + "\"";
823 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
824 vlm_MessageDelete( message );
827 if( _repeatDays > 0 )
829 command = "setup \"" + name + "\" period \"" + _repeatDays + "\"";
830 vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
831 vlm_MessageDelete( message );
835 void VLMDialog::toggleVisible()
837 QList<VLMAWidget *>::iterator it;
838 for( it = vlmItems.begin(); it != vlmItems.end(); it++ )
840 VLMAWidget *item = *it;
845 ui.vlmListItem->clear();
847 QVLCDialog::toggleVisible();