Commit bc133f33 authored by Filippo Carone's avatar Filippo Carone

More vlm functions added in libvlc (to play, pause and stop a broadcast)

parent 0e977f2f
...@@ -467,6 +467,32 @@ void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int, ...@@ -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* , void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
int, char **, int, int, libvlc_exception_t * ); 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 * );
/** @} */ /** @} */
/** @} */ /** @} */
......
...@@ -236,3 +236,60 @@ void libvlc_vlm_change_media( libvlc_instance_t *p_instance, char *psz_name, ...@@ -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 ); vlc_mutex_unlock( &p_instance->p_vlm->lock );
#endif #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
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment