More vlm functions added in libvlc (to play, pause and stop a broadcast)
authorFilippo Carone <littlejohn@videolan.org>
Wed, 26 Jul 2006 15:13:47 +0000 (15:13 +0000)
committerFilippo Carone <littlejohn@videolan.org>
Wed, 26 Jul 2006 15:13:47 +0000 (15:13 +0000)
include/vlc/libvlc.h
src/control/vlm.c

index 48d94d7..90b159b 100644 (file)
@@ -467,6 +467,32 @@ void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
 void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
                               int, char **, int, int, libvlc_exception_t * );
 
+/**
+ * Plays the named broadcast.
+ * \param p_instance the instance
+ * \param psz_name the name of the broadcast
+ * \param p_exception an initialized exception
+ */ 
+void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
+
+/**
+ * Stops the named broadcast.
+ * \param p_instance the instance
+ * \param psz_name the name of the broadcast
+ * \param p_exception an initialized exception
+ */ 
+void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
+
+    
+/**
+ * Pauses the named broadcast.
+ * \param p_instance the instance
+ * \param psz_name the name of the broadcast
+ * \param p_exception an initialized exception
+ */ 
+void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
+    
+    
 
 /** @} */
 /** @} */
index 0ec3d75..a770e5d 100644 (file)
@@ -236,3 +236,60 @@ void libvlc_vlm_change_media( libvlc_instance_t *p_instance, char *psz_name,
     vlc_mutex_unlock( &p_instance->p_vlm->lock );
 #endif
 }
+
+void libvlc_vlm_play_media( libvlc_instance_t *p_instance, char *psz_name,
+                            libvlc_exception_t *p_exception )
+    
+{
+    char *psz_message;
+    vlm_message_t *answer;
+    CHECK_VLM;
+#ifdef ENABLE_VLM
+    asprintf( &psz_message, "control %s play", psz_name );
+    vlm_ExecuteCommand( p_instance->p_vlm, psz_message, &answer );
+    if( answer->psz_value )
+    {
+        libvlc_exception_raise( p_exception, "Unable to play %s",
+                                psz_name );
+    }
+    free( psz_message);
+#endif
+}
+
+void libvlc_vlm_stop_media( libvlc_instance_t *p_instance, char *psz_name,
+                            libvlc_exception_t *p_exception )
+    
+{
+    char *psz_message;
+    vlm_message_t *answer;
+    CHECK_VLM;
+#ifdef ENABLE_VLM
+    asprintf( &psz_message, "control %s stop", psz_name );
+    vlm_ExecuteCommand( p_instance->p_vlm, psz_message, &answer );
+    if( answer->psz_value )
+    {
+        libvlc_exception_raise( p_exception, "Unable to stop %s",
+                                psz_name );
+    }
+    free( psz_message);
+#endif
+}
+
+void libvlc_vlm_pause_media( libvlc_instance_t *p_instance, char *psz_name,
+                            libvlc_exception_t *p_exception )
+    
+{
+    char *psz_message;
+    vlm_message_t *answer;
+    CHECK_VLM;
+#ifdef ENABLE_VLM
+    asprintf( &psz_message, "control %s pause", psz_name );
+    vlm_ExecuteCommand( p_instance->p_vlm, psz_message, &answer );
+    if( answer->psz_value )
+    {
+        libvlc_exception_raise( p_exception, "Unable to pause %s",
+                                psz_name );
+    }
+    free( psz_message);
+#endif
+}