*
* \return vlc object id or an error code
*/
-int VLC_Create ( void );
+int VLC_Create( void );
/**
* Initialize a vlc_t structure
* \param ppsz_argv an array of arguments
* \return VLC_SUCCESS on success
*/
-int VLC_Init ( int, int, char *[] );
+int VLC_Init( int, int, char *[] );
/**
* Add an interface
* \param b_play start playing when the interface is done loading
* \return VLC_SUCCESS on success
*/
-int VLC_AddIntf ( int, char const *, vlc_bool_t, vlc_bool_t );
+int VLC_AddIntf( int, char const *, vlc_bool_t, vlc_bool_t );
/**
* Ask vlc to die
* \param i_object a vlc object id
* \return VLC_SUCCESS on success
*/
-int VLC_Die ( int );
+int VLC_Die( int );
/**
* Clean up all the intf, playlist, vout and aout
* This function requests all intf, playlist, vout and aout objects to finish
* and CleanUp. Only a blank VLC object should remain after this.
*
+ * \note This function was previously called VLC_Stop
+ *
* \param i_object a vlc object id
* \return VLC_SUCCESS on success
*/
-int VLC_CleanUp ( int );
+int VLC_CleanUp( int );
/**
* Destroy all threads and the VLC object
* \param i_object a vlc object id
* \return VLC_SUCCESS on success
*/
-int VLC_Destroy ( int );
+int VLC_Destroy( int );
/**
* Set a VLC variable
*
* This function sets a variable of VLC
*
+ * \note Was previously called VLC_Set
+ *
* \param i_object a vlc object id
* \param psz_var a vlc variable name
* \param value a vlc_value_t structure
* \return VLC_SUCCESS on success
*/
-int VLC_Set ( int, char const *, vlc_value_t );
+int VLC_VariableSet( int, char const *, vlc_value_t );
/**
* Get a VLC variable
* This function gets the value of a variable of VLC
* It stores it in the p_value argument
*
+ * \note Was previously called VLC_Get
+ *
* \param i_object a vlc object id
* \param psz_var a vlc variable name
* \param p_value a pointer to a vlc_value_t structure
* \return VLC_SUCCESS on success
*/
-int VLC_Get ( int, char const *, vlc_value_t * );
+int VLC_VariableGet( int, char const *, vlc_value_t * );
/**
* Add a target to the current playlist
* \param i_pos the position at which to add the new target (PLAYLIST_END for end)
* \return VLC_SUCCESS on success
*/
-int VLC_AddTarget ( int, char const *, const char **, int, int, int );
+int VLC_AddTarget( int, char const *, const char **, int, int, int );
/**
* Start the playlist and play the currently selected playlist item
* \param i_object a vlc object id
* \return VLC_SUCCESS on success
*/
-int VLC_Play ( int );
+int VLC_Play( int );
/**
* Pause the currently playing item. Resume it if already paused
* \param i_object a vlc object id
* \return VLC_SUCCESS on success
*/
-int VLC_Pause ( int );
+int VLC_Pause( int );
/**
* Stop the playlist
* If an item is currently playing then stop it.
* Set the playlist to a stopped state.
*
+ * \note This function is new. The old VLC_Stop is now called VLC_CleanUp
+ *
* \param i_object a vlc object id
* \return VLC_SUCCESS on success
*/
-int VLC_Stop ( int );
+int VLC_Stop( int );
/**
* Stop the playlist
* \param i_object a vlc object id
* \return VLC_SUCCESS on success
*/
-vlc_bool_t VLC_IsPlaying ( int );
+vlc_bool_t VLC_IsPlaying( int );
+
+/**
+ * Get the current position in a input
+ *
+ * Return the current position as a float
+ * This method should be used for time sliders etc
+ * \note For some inputs, this will be unknown.
+ *
+ * \param i_object a vlc object id
+ * \return a float in the range of 0.0 - 1.0
+ */
+float VLC_PositionGet( int );
+
+/**
+ * Set the current position in a input
+ *
+ * Set the current position as a float
+ * This method should be used for time sliders etc
+ * \note For some inputs, this will be unknown.
+ *
+ * \param i_object a vlc object id
+ * \param i_position a float in the range of 0.0 - 1.0
+ * \return a float in the range of 0.0 - 1.0
+ */
+float VLC_PositionSet( int, float );
+
+/**
+ * Get the current position in a input
+ *
+ * Return the current position in seconds from the start.
+ * \note For some inputs, this will be unknown.
+ *
+ * \param i_object a vlc object id
+ * \return the offset from 0:00 in seconds
+ */
+int VLC_TimeGet( int );
+
+/**
+ * Seek to a position in the current input
+ *
+ * Seek i_seconds in the current input. If b_relative is set,
+ * then the seek will be relative to the current position, otherwise
+ * it will seek to i_seconds from the beginning of the input.
+ * \note For some inputs, this will be unknown.
+ *
+ * \param i_object a vlc object id
+ * \param i_seconds seconds from current position or from beginning of input
+ * \param b_relative seek relative from current position
+ * \return VLC_SUCCESS on success
+ */
+int VLC_TimeSet( int, int, vlc_bool_t );
+
+/**
+ * Get the total length of a input
+ *
+ * Return the total length in seconds from the current input.
+ * \note For some inputs, this will be unknown.
+ *
+ * \param i_object a vlc object id
+ * \return the length in seconds
+ */
+int VLC_LengthGet( int );
+
+/**
+ * Play the input faster than realtime
+ *
+ * 2x, 4x, 8x faster than realtime
+ * \note For some inputs, this will be impossible.
+ *
+ * \param i_object a vlc object id
+ * \return the current speedrate
+ */
+float VLC_SpeedFaster( int );
+
+/**
+ * Play the input slower than realtime
+ *
+ * 1/2x, 1/4x, 1/8x slower than realtime
+ * \note For some inputs, this will be impossible.
+ *
+ * \param i_object a vlc object id
+ * \return the current speedrate
+ */
+float VLC_SpeedSlower( int );
+
+/**
+ * Return the current playlist item
+ *
+ * \param i_object a vlc object id
+ * \return the index of the playlistitem that is currently selected for play
+ */
+int VLC_PlaylistIndex( int );
+
+/**
+ * Total amount of items in the playlist
+ *
+ * \param i_object a vlc object id
+ * \return amount of playlist items
+ */
+int VLC_PlaylistNumberOfItems( int );
+
+/**
+ * Next playlist item
+ *
+ * Skip to the next playlistitem and play it.
+ *
+ * \param i_object a vlc object id
+ * \return VLC_SUCCESS on success
+ */
+int VLC_PlaylistNext( int );
+
+/**
+ * Previous playlist item
+ *
+ * Skip to the previous playlistitem and play it.
+ *
+ * \param i_object a vlc object id
+ * \return VLC_SUCCESS on success
+ */
+int VLC_PlaylistPrev( int );
/**
* Clear the contents of the playlist
*
* Completly empty the entire playlist.
*
+ * \note Was previously called VLC_ClearPlaylist
+ *
+ * \param i_object a vlc object id
+ * \return VLC_SUCCESS on success
+ */
+int VLC_PlaylistClear( int );
+
+/**
+ * Change the volume
+ *
+ * \param i_object a vlc object id
+ * \param i_volume something in a range from 0-200
+ * \return the new volume (range 0-200 %)
+ */
+int VLC_VolumeSet( int );
+
+/**
+ * Get the current volume
+ *
+ * Retrieve the current volume.
+ *
+ * \param i_object a vlc object id
+ * \return the current volume (range 0-200 %)
+ */
+int VLC_VolumeGet( int );
+
+/**
+ * Mute/Unmute the volume
+ *
* \param i_object a vlc object id
* \return VLC_SUCCESS on success
*/
-int VLC_ClearPlaylist( int );
+int VLC_VolumeMute( int );
/**
* Toggle Fullscreen mode
* \param i_object a vlc object id
* \return VLC_SUCCESS on success
*/
-int VLC_FullScreen ( int );
+int VLC_FullScreen( int );
# ifdef __cplusplus
if (pouetEvent->what == 6)
{
value.i_int = 1;
- VLC_Set( p_plugin->i_vlc, "drawableredraw", value );
+ VLC_VariableSet( p_plugin->i_vlc, "drawableredraw", value );
return true;
}
}
value.psz_string = "dummy";
- VLC_Set( p_plugin->i_vlc, "conf::intf", value );
+ VLC_VariableSet( p_plugin->i_vlc, "conf::intf", value );
value.psz_string = VOUT_PLUGINS;
- VLC_Set( p_plugin->i_vlc, "conf::vout", value );
+ VLC_VariableSet( p_plugin->i_vlc, "conf::vout", value );
value.psz_string = AOUT_PLUGINS;
- VLC_Set( p_plugin->i_vlc, "conf::aout", value );
+ VLC_VariableSet( p_plugin->i_vlc, "conf::aout", value );
#else
p_plugin->i_vlc = 1;
if( !strcmp( argv[i], "yes" ) )
{
value.b_bool = VLC_TRUE;
- VLC_Set( p_plugin->i_vlc, "conf::loop", value );
+ VLC_VariableSet( p_plugin->i_vlc, "conf::loop", value );
}
}
else if( !strcmp( argn[i], "fullscreen" ) )
if( !strcmp( argv[i], "yes" ) )
{
value.b_bool = VLC_TRUE;
- VLC_Set( p_plugin->i_vlc, "conf::fullscreen", value );
+ VLC_VariableSet( p_plugin->i_vlc, "conf::fullscreen", value );
}
}
#endif
#ifdef XP_MACOSX
value.i_int = ((NP_Port*) (window->window))->port;
- VLC_Set( p_plugin->i_vlc, "drawable", value );
+ VLC_VariableSet( p_plugin->i_vlc, "drawable", value );
valueportx.i_int = ((NP_Port*) (window->window))->portx;
valueporty.i_int = ((NP_Port*) (window->window))->porty;
- VLC_Set( p_plugin->i_vlc, "drawableportx", valueportx );
- VLC_Set( p_plugin->i_vlc, "drawableporty", valueporty );
+ VLC_VariableSet( p_plugin->i_vlc, "drawableportx", valueportx );
+ VLC_VariableSet( p_plugin->i_vlc, "drawableporty", valueporty );
valuex.i_int = window->x;
valuey.i_int = window->y;
valueb.i_int = window->clipRect.bottom;
valuer.i_int = window->clipRect.right;
- VLC_Set( p_plugin->i_vlc, "drawablet", valuet );
- VLC_Set( p_plugin->i_vlc, "drawablel", valuel );
- VLC_Set( p_plugin->i_vlc, "drawableb", valueb );
- VLC_Set( p_plugin->i_vlc, "drawabler", valuer );
- VLC_Set( p_plugin->i_vlc, "drawablex", valuex );
- VLC_Set( p_plugin->i_vlc, "drawabley", valuey );
- VLC_Set( p_plugin->i_vlc, "drawablew", valuew );
- VLC_Set( p_plugin->i_vlc, "drawableh", valueh );
+ VLC_VariableSet( p_plugin->i_vlc, "drawablet", valuet );
+ VLC_VariableSet( p_plugin->i_vlc, "drawablel", valuel );
+ VLC_VariableSet( p_plugin->i_vlc, "drawableb", valueb );
+ VLC_VarialbeSet( p_plugin->i_vlc, "drawabler", valuer );
+ VLC_VariableSet( p_plugin->i_vlc, "drawablex", valuex );
+ VLC_VariableSet( p_plugin->i_vlc, "drawabley", valuey );
+ VLC_VariableSet( p_plugin->i_vlc, "drawablew", valuew );
+ VLC_VariableSet( p_plugin->i_vlc, "drawableh", valueh );
p_plugin->window = window;
#else
/* FIXME: this cast sucks */
value.i_int = (int) (ptrdiff_t) (void *) window->window;
- VLC_Set( p_plugin->i_vlc, "drawable", value );
+ VLC_VariableSet( p_plugin->i_vlc, "drawable", value );
#endif
#endif
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Gildas Bazin <gbazin@netcourrier.com>
+ * Derk-Jan Hartman <hartman at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
}
/*****************************************************************************
- * VLC_Set: set a vlc variable
+ * VLC_VariableSet: set a vlc variable
*****************************************************************************/
-int VLC_Set( int i_object, char const *psz_var, vlc_value_t value )
+int VLC_VariableSet( int i_object, char const *psz_var, vlc_value_t value )
{
vlc_t *p_vlc = vlc_current_object( i_object );
int i_ret;
}
/*****************************************************************************
- * VLC_Get: get a vlc variable
+ * VLC_VariableGet: get a vlc variable
*****************************************************************************/
int VLC_Get( int i_object, char const *psz_var, vlc_value_t *p_value )
{
}
b_playing = playlist_IsPlaying( p_playlist );
+ vlc_object_release( p_playlist );
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return b_playing;
+}
+
+/**
+ * Get the current position in a input
+ *
+ * Return the current position as a float
+ * \note For some inputs, this will be unknown.
+ *
+ * \param i_object a vlc object id
+ * \return a float in the range of 0.0 - 1.0
+ */
+float VLC_PositionGet( int i_object )
+{
+ input_thread_t *p_input;
+ vlc_value_t val;
+ vlc_t *p_vlc = vlc_current_object( i_object );
+
+ /* Check that the handle is valid */
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ p_input = vlc_object_find( p_vlc, VLC_OBJECT_INPUT, FIND_CHILD );
+
+ if( !p_input )
+ {
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_ENOOBJ;
+ }
+
+ var_Get( p_input, "position", &val );
+ vlc_object_release( p_input );
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return val.f_float;
+}
+
+/**
+ * Set the current position in a input
+ *
+ * Set the current position in a input and then return
+ * the current position as a float.
+ * \note For some inputs, this will be unknown.
+ *
+ * \param i_object a vlc object id
+ * \param i_position a float in the range of 0.0 - 1.0
+ * \return a float in the range of 0.0 - 1.0
+ */
+float VLC_PositionSet( int i_object, float i_position )
+{
+ input_thread_t *p_input;
+ vlc_value_t val;
+ vlc_t *p_vlc = vlc_current_object( i_object );
+
+ /* Check that the handle is valid */
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ p_input = vlc_object_find( p_vlc, VLC_OBJECT_INPUT, FIND_CHILD );
+
+ if( !p_input )
+ {
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_ENOOBJ;
+ }
+
+ val.f_float = i_position;
+ var_Set( p_input, "position", val );
+ var_Get( p_input, "position", &val );
+ vlc_object_release( p_input );
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return val.f_float;
+}
+
+/**
+ * Get the current position in a input
+ *
+ * Return the current position in seconds from the start.
+ * \note For some inputs, this will be unknown.
+ *
+ * \param i_object a vlc object id
+ * \return the offset from 0:00 in seconds
+ */
+int VLC_TimeGet( int i_object )
+{
+ input_thread_t *p_input;
+ vlc_value_t val;
+ vlc_t *p_vlc = vlc_current_object( i_object );
+
+ /* Check that the handle is valid */
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ p_input = vlc_object_find( p_vlc, VLC_OBJECT_INPUT, FIND_CHILD );
+
+ if( !p_input )
+ {
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_ENOOBJ;
+ }
+
+ var_Get( p_input, "time", &val );
+ vlc_object_release( p_input );
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return val.i_time / 1000000;
+}
+
+/**
+ * Seek to a position in the current input
+ *
+ * Seek i_seconds in the current input. If b_relative is set,
+ * then the seek will be relative to the current position, otherwise
+ * it will seek to i_seconds from the beginning of the input.
+ * \note For some inputs, this will be unknown.
+ *
+ * \param i_object a vlc object id
+ * \param i_seconds seconds from current position or from beginning of input
+ * \param b_relative seek relative from current position
+ * \return VLC_SUCCESS on success
+ */
+int VLC_TimeSet( int i_object, int i_seconds, vlc_bool_t b_relative )
+{
+ input_thread_t *p_input;
+ vlc_value_t val;
+ vlc_t *p_vlc = vlc_current_object( i_object );
+
+ /* Check that the handle is valid */
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ p_input = vlc_object_find( p_vlc, VLC_OBJECT_INPUT, FIND_CHILD );
+
+ if( !p_input )
+ {
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_ENOOBJ;
+ }
+
+ if( b_relative )
+ {
+ val.i_time = i_seconds * 1000000;
+ var_Set( p_input, "time-offset", val );
+ }
+ else
+ {
+ val.i_time = i_seconds * 1000000;
+ var_Set( p_input, "time", val );
+ }
+ vlc_object_release( p_input );
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_SUCCESS;
+}
+
+/**
+ * Get the total length of a input
+ *
+ * Return the total length in seconds from the current input.
+ * \note For some inputs, this will be unknown.
+ *
+ * \param i_object a vlc object id
+ * \return the length in seconds
+ */
+int VLC_LengthGet( int i_object )
+{
+ input_thread_t *p_input;
+ vlc_value_t val;
+ vlc_t *p_vlc = vlc_current_object( i_object );
+
+ /* Check that the handle is valid */
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ p_input = vlc_object_find( p_vlc, VLC_OBJECT_INPUT, FIND_CHILD );
+
+ if( !p_input )
+ {
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_ENOOBJ;
+ }
+
+ var_Get( p_input, "length", &val );
+ vlc_object_release( p_input );
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return val.i_time / 1000000;
+}
+
+/**
+ * Play the input faster than realtime
+ *
+ * 2x, 4x, 8x faster than realtime
+ * \note For some inputs, this will be impossible.
+ *
+ * \param i_object a vlc object id
+ * \return the current speedrate
+ */
+float VLC_SpeedFaster( int i_object )
+{
+ input_thread_t *p_input;
+ vlc_value_t val;
+ vlc_t *p_vlc = vlc_current_object( i_object );
+
+ /* Check that the handle is valid */
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ p_input = vlc_object_find( p_vlc, VLC_OBJECT_INPUT, FIND_CHILD );
+
+ if( !p_input )
+ {
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_ENOOBJ;
+ }
+
+ val.b_bool = VLC_TRUE;
+ var_Set( p_input, "rate-faster", val );
+ var_Get( p_input, "rate", &val );
+ vlc_object_release( p_input );
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return val.f_float / DEFAULT_RATE;
+}
+
+/**
+ * Play the input slower than realtime
+ *
+ * 1/2x, 1/4x, 1/8x slower than realtime
+ * \note For some inputs, this will be impossible.
+ *
+ * \param i_object a vlc object id
+ * \return the current speedrate
+ */
+float VLC_SpeedSlower( int i_object )
+{
+ input_thread_t *p_input;
+ vlc_value_t val;
+ vlc_t *p_vlc = vlc_current_object( i_object );
+
+ /* Check that the handle is valid */
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ p_input = vlc_object_find( p_vlc, VLC_OBJECT_INPUT, FIND_CHILD );
+
+ if( !p_input )
+ {
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_ENOOBJ;
+ }
+
+ val.b_bool = VLC_TRUE;
+ var_Set( p_input, "rate-slower", val );
+ var_Get( p_input, "rate", &val );
+ vlc_object_release( p_input );
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return val.f_float / DEFAULT_RATE;
+}
+
+/**
+ * Return the current playlist item
+ *
+ * Returns the index of the playlistitem that is currently selected for play.
+ * This is valid even if nothing is currently playing.
+ *
+ * \param i_object a vlc object id
+ * \return the current index
+ */
+int VLC_PlaylistIndex( int i_object )
+{
+ int i_index;
+ playlist_t * p_playlist;
+ vlc_t *p_vlc = vlc_current_object( i_object );
+
+ /* Check that the handle is valid */
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST, FIND_CHILD );
+
+ if( !p_playlist )
+ {
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_ENOOBJ;
+ }
+ i_index = p_playlist->i_index;
vlc_object_release( p_playlist );
if( i_object ) vlc_object_release( p_vlc );
+ return i_index;
+}
- return b_playing;
+/**
+ * Total amount of items in the playlist
+ *
+ * \param i_object a vlc object id
+ * \return amount of playlist items
+ */
+int VLC_PlaylistNumberOfItems( int i_object )
+{
+ int i_size;
+ playlist_t * p_playlist;
+ vlc_t *p_vlc = vlc_current_object( i_object );
+
+ /* Check that the handle is valid */
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST, FIND_CHILD );
+
+ if( !p_playlist )
+ {
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_ENOOBJ;
+ }
+
+ i_size = p_playlist->i_size;
+ vlc_object_release( p_playlist );
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return i_size;
}
+/**
+ * Next playlist item
+ *
+ * Skip to the next playlistitem and play it.
+ *
+ * \param i_object a vlc object id
+ * \return VLC_SUCCESS on success
+ */
+int VLC_PlaylistNext( int i_object )
+{
+ playlist_t * p_playlist;
+ vlc_t *p_vlc = vlc_current_object( i_object );
+
+ /* Check that the handle is valid */
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST, FIND_CHILD );
+
+ if( !p_playlist )
+ {
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_ENOOBJ;
+ }
+
+ playlist_Next( p_playlist );
+ vlc_object_release( p_playlist );
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_SUCCESS;
+}
+
+/**
+ * Previous playlist item
+ *
+ * Skip to the previous playlistitem and play it.
+ *
+ * \param i_object a vlc object id
+ * \return VLC_SUCCESS on success
+ */
+int VLC_PlaylistPrev( int i_object )
+{
+ playlist_t * p_playlist;
+ vlc_t *p_vlc = vlc_current_object( i_object );
+
+ /* Check that the handle is valid */
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST, FIND_CHILD );
+
+ if( !p_playlist )
+ {
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_ENOOBJ;
+ }
+
+ playlist_Prev( p_playlist );
+ vlc_object_release( p_playlist );
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_SUCCESS;
+}
+
+
/*****************************************************************************
- * VLC_ClearPlaylist: Empty the playlist
+ * VLC_PlaylistClear: Empty the playlist
*****************************************************************************/
-int VLC_ClearPlaylist( int i_object )
+int VLC_PlaylistClear( int i_object )
{
int i_err;
playlist_t * p_playlist;
return VLC_ENOOBJ;
}
- i_err = playlist_Clear(p_playlist);
+ i_err = playlist_Clear( p_playlist );
vlc_object_release( p_playlist );
return i_err;
}
+/**
+ * Change the volume
+ *
+ * \param i_object a vlc object id
+ * \param i_volume something in a range from 0-200
+ * \return the new volume (range 0-200 %)
+ */
+int VLC_VolumeSet( int i_object, int i_volume )
+{
+ audio_volume_t i_vol;
+ vlc_t *p_vlc = vlc_current_object( i_object );
+
+ /* Check that the handle is valid */
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ if( 0 >= i_volume && i_volume <= 200 )
+ {
+ i_vol = i_volume * AOUT_VOLUME_MAX / 200;
+ aout_VolumeSet( p_vlc, i_vol );
+ }
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return i_vol * 200 / AOUT_VOLUME_MAX;
+}
+
+/**
+ * Get the current volume
+ *
+ * Retrieve the current volume.
+ *
+ * \param i_object a vlc object id
+ * \return the current volume (range 0-200 %)
+ */
+int VLC_VolumeGet( int i_object )
+{
+ audio_volume_t i_volume;
+ vlc_t *p_vlc = vlc_current_object( i_object );
+
+ /* Check that the handle is valid */
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ aout_VolumeGet( p_vlc, &i_volume );
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return i_volume*200/AOUT_VOLUME_MAX;
+}
+
+/**
+ * Mute/Unmute the volume
+ *
+ * \param i_object a vlc object id
+ * \return VLC_SUCCESS on success
+ */
+int VLC_VolumeMute( int i_object )
+{
+ vlc_t *p_vlc = vlc_current_object( i_object );
+
+ /* Check that the handle is valid */
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ aout_VolumeMute( p_vlc, NULL );
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_SUCCESS;
+}
+
/*****************************************************************************
* VLC_FullScreen: toggle fullscreen mode
*****************************************************************************/