]> git.sesse.net Git - vlc/commitdiff
Qt4 - VLM. enable/disable from the list controls the VLM. small fixes and correction...
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 15 Dec 2007 22:38:31 +0000 (22:38 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 15 Dec 2007 22:38:31 +0000 (22:38 +0000)
modules/gui/qt4/dialogs/vlm.cpp
modules/gui/qt4/dialogs/vlm.hpp

index 4f892793f9819c91e4ab676c5d74397e096f1820..10e63136dcfe86ca64ad0bc28c06aa561df0ade0 100644 (file)
@@ -195,13 +195,13 @@ void VLMDialog::addVLMItem()
         typeShortName = "Bcast";
         vlmAwidget = new VLMBroadcast( name, inputText, outputText,
                                   b_checked, b_looped, this );
-        //VLMWrapper::AddBroadcast( vlmWrapper->p_vlc, name, inputText, outputText, b_checked, b_looped ); 
+        VLMWrapper::AddBroadcast( name, inputText, outputText, b_checked, b_looped ); 
     break;
     case QVLM_VOD:
         typeShortName = "VOD";
         vlmAwidget = new VLMVod( name, inputText, outputText,
                                  b_checked, ui.muxLedit->text(), this );
-        ///VLMWrapper::AddVod( vlmWrapper->GetVLM(), name, inputText, outputText, b_checked );
+        VLMWrapper::AddVod( name, inputText, outputText, b_checked );
         break;
     case QVLM_Schedule:
         typeShortName = "Sched";
@@ -352,6 +352,7 @@ VLMAWidget::VLMAWidget( QString _name,
 
     BUTTONACT( modifyButton, modify() );
     BUTTONACT( deleteButton, del() );
+    CONNECT( this, clicked( bool ), this, toggleEnabled( bool ) );
 }
 
 void VLMAWidget::modify()
@@ -370,6 +371,11 @@ void VLMAWidget::enterEvent( QEvent *event )
     printf( "test" );
 }
 
+void VLMAWidget::toggleEnabled( bool b_enable )
+{
+    VLMWrapper::EnableItem( name, b_enable );
+}
+
 /****************
  * VLMBroadcast 
  ****************/
@@ -403,7 +409,7 @@ VLMBroadcast::VLMBroadcast( QString _name, QString _input, QString _output,
 
 void VLMBroadcast::update()
 {
-    //VLMWrapper::EditBroadcast( VLMWrapper::p_vlm, name, input, output, b_enabled, b_looped );
+    VLMWrapper::EditBroadcast( name, input, output, b_enabled, b_looped );
     if( b_looped )
         loopButton->setIcon( QIcon( QPixmap( ":/pixmaps/playlist_repeat_all.png" ) ) );
     else
@@ -414,12 +420,12 @@ void VLMBroadcast::togglePlayPause()
 {
     if( b_playing = true )
     {
-      //  VLMWrapper::ControlBroadcast( VLMWrapper::p_vlm, name, ControlBroadcastPause );
+        VLMWrapper::ControlBroadcast( name, ControlBroadcastPause );
         playButton->setIcon( QIcon( QPixmap( ":/pixmaps/pause_16px.png" ) ) );
     }
     else
     {
-        //VLMWrapper::ControlBroadcast( VLMWrapper::p_vlm, name, ControlBroadcastPlay );
+        VLMWrapper::ControlBroadcast( name, ControlBroadcastPlay );
         playButton->setIcon( QIcon( QPixmap( ":/pixmaps/play_16px.png" ) ) );
     }
     b_playing = !b_playing;
@@ -433,7 +439,7 @@ void VLMBroadcast::toggleLoop()
 
 void VLMBroadcast::stop()
 {
-    //VLMWrapper::ControlBroadcast( VLMWrapper::p_vlm, name, ControlBroadcastStop );
+    VLMWrapper::ControlBroadcast( name, ControlBroadcastStop );
     playButton->setIcon( QIcon( QPixmap( ":/pixmaps/play_16px.png" ) ) );
 }
 
@@ -470,7 +476,7 @@ VLMVod::VLMVod( QString name, QString input, QString output,
 void VLMVod::update()
 {
     muxLabel->setText( mux );
-    //VLMWrapper::EditVod( p_vlm, name, input, output, b_enabled, mux );
+    VLMWrapper::EditVod( name, input, output, b_enabled, mux );
 }
 
 
@@ -531,12 +537,18 @@ void VLMWrapper::EditBroadcast( const QString name, const QString input,
     }
 }
 
+void VLMWrapper::EnableItem( const QString name, bool b_enable )
+{
+    vlm_message_t *message;
+    QString command = "setup \"" + name + ( b_enable ? " enable" : " disable" );
+}
+
 void VLMWrapper::ControlBroadcast( const QString name, int BroadcastStatus, 
                                    unsigned int seek )
 {
     vlm_message_t *message;
 
-    QString command = "setup \"" + name;
+    QString command = "control \"" + name;
     switch( BroadcastStatus )
     {
     case ControlBroadcastPlay:
index 6143b48bf3eca0af784381cc5b82bd15745c1865..59b658b73ae6a2c9357a43cd5b1a59fd05b02569 100644 (file)
@@ -119,6 +119,7 @@ public:
                        bool b_enabled = true, QString mux = "" );
 
     static void ControlBroadcast( const QString, int, unsigned int seek = 0 );
+    static void EnableItem( const QString, bool );
 
     /* We don't have yet the accessors in the core, so the following is commented */
     //unsigned int NbMedia() { if( p_vlm ) return p_vlm->i_media; return 0; }
@@ -150,6 +151,7 @@ protected:
 private slots:
     virtual void modify();
     virtual void del();
+    virtual void toggleEnabled( bool );
 };
 
 class VLMBroadcast : public VLMAWidget