+
+void VLMWrapper::AddSchedule( const QString& name, const QString& input,
+ const QString& output, QDateTime _schetime,
+ QDateTime _schedate,
+ int _scherepeatnumber, int _repeatDays,
+ bool b_enabled, const QString& mux )
+{
+ vlm_message_t *message;
+ QString command = "new \"" + name + "\" schedule";
+ vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
+ vlm_MessageDelete( message );
+ EditSchedule( name, input, output, _schetime, _schedate,
+ _scherepeatnumber, _repeatDays, b_enabled, mux );
+}
+
+void VLMWrapper::EditSchedule( const QString& name, const QString& input,
+ const QString& output, QDateTime _schetime,
+ QDateTime _schedate, int _scherepeatnumber,
+ int _repeatDays, bool b_enabled,
+ const QString& mux )
+{
+ vlm_message_t *message;
+ QString command = "setup \"" + name + "\" input \"" + input + "\"";
+ vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
+ vlm_MessageDelete( message );
+
+ if( !output.isEmpty() )
+ {
+ command = "setup \"" + name + "\" output \"" + output + "\"";
+ vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
+ vlm_MessageDelete( message );
+ }
+
+ if( b_enabled )
+ {
+ command = "setup \"" + name + "\" enabled";
+ vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
+ vlm_MessageDelete( message );
+ }
+
+ if( !mux.isEmpty() )
+ {
+ command = "setup \"" + name + "\" mux \"" + mux + "\"";
+ vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
+ vlm_MessageDelete( message );
+ }
+
+ command = "setup \"" + name + "\" date \"" +
+ _schedate.toString( "yyyy/MM/dd" )+ "-" +
+ _schetime.toString( "hh:mm:ss" ) + "\"";
+ vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
+ vlm_MessageDelete( message );
+
+ if( _scherepeatnumber > 0 )
+ {
+ command = "setup \"" + name + "\" repeat \"" + _scherepeatnumber + "\"";
+ vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
+ vlm_MessageDelete( message );
+ }
+
+ if( _repeatDays > 0 )
+ {
+ command = "setup \"" + name + "\" period \"" + _repeatDays + "\"";
+ vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
+ vlm_MessageDelete( message );
+ }
+}
+
+void VLMDialog::toggleVisible()
+{
+ QList<VLMAWidget *>::iterator it;
+ for( it = vlmItems.begin(); it != vlmItems.end(); it++ )
+ {
+ VLMAWidget *item = *it;
+ delete item;
+ item = NULL;
+ }
+ vlmItems.clear();
+ ui.vlmListItem->clear();
+ mediasPopulator();
+ QVLCDialog::toggleVisible();
+}
+
+
+#endif