Commit 347e1ecf authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* WARNING: Libvlc API change

 - VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
 - VLC_ClearPlaylist was changed to VLC_PlaylistClear
 - Added a lot of new calls: 
   VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
   VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
   VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev, 
   VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
 - everything doxygenized.
 - There are NO mozilla functions of these additions yet. (someone else please?) 
parent b4e738fd
...@@ -155,7 +155,7 @@ char const * VLC_Error ( int i_err ); ...@@ -155,7 +155,7 @@ char const * VLC_Error ( int i_err );
* *
* \return vlc object id or an error code * \return vlc object id or an error code
*/ */
int VLC_Create ( void ); int VLC_Create( void );
/** /**
* Initialize a vlc_t structure * Initialize a vlc_t structure
...@@ -171,7 +171,7 @@ int VLC_Create ( void ); ...@@ -171,7 +171,7 @@ int VLC_Create ( void );
* \param ppsz_argv an array of arguments * \param ppsz_argv an array of arguments
* \return VLC_SUCCESS on success * \return VLC_SUCCESS on success
*/ */
int VLC_Init ( int, int, char *[] ); int VLC_Init( int, int, char *[] );
/** /**
* Add an interface * Add an interface
...@@ -187,7 +187,7 @@ int VLC_Init ( int, int, char *[] ); ...@@ -187,7 +187,7 @@ int VLC_Init ( int, int, char *[] );
* \param b_play start playing when the interface is done loading * \param b_play start playing when the interface is done loading
* \return VLC_SUCCESS on success * \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 * Ask vlc to die
...@@ -198,7 +198,7 @@ int VLC_AddIntf ( int, char const *, vlc_bool_t, vlc_bool_t ); ...@@ -198,7 +198,7 @@ int VLC_AddIntf ( int, char const *, vlc_bool_t, vlc_bool_t );
* \param i_object a vlc object id * \param i_object a vlc object id
* \return VLC_SUCCESS on success * \return VLC_SUCCESS on success
*/ */
int VLC_Die ( int ); int VLC_Die( int );
/** /**
* Clean up all the intf, playlist, vout and aout * Clean up all the intf, playlist, vout and aout
...@@ -206,10 +206,12 @@ int VLC_Die ( int ); ...@@ -206,10 +206,12 @@ int VLC_Die ( int );
* This function requests all intf, playlist, vout and aout objects to finish * This function requests all intf, playlist, vout and aout objects to finish
* and CleanUp. Only a blank VLC object should remain after this. * 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 * \param i_object a vlc object id
* \return VLC_SUCCESS on success * \return VLC_SUCCESS on success
*/ */
int VLC_CleanUp ( int ); int VLC_CleanUp( int );
/** /**
* Destroy all threads and the VLC object * Destroy all threads and the VLC object
...@@ -221,19 +223,21 @@ int VLC_CleanUp ( int ); ...@@ -221,19 +223,21 @@ int VLC_CleanUp ( int );
* \param i_object a vlc object id * \param i_object a vlc object id
* \return VLC_SUCCESS on success * \return VLC_SUCCESS on success
*/ */
int VLC_Destroy ( int ); int VLC_Destroy( int );
/** /**
* Set a VLC variable * Set a VLC variable
* *
* This function sets a variable of VLC * This function sets a variable of VLC
* *
* \note Was previously called VLC_Set
*
* \param i_object a vlc object id * \param i_object a vlc object id
* \param psz_var a vlc variable name * \param psz_var a vlc variable name
* \param value a vlc_value_t structure * \param value a vlc_value_t structure
* \return VLC_SUCCESS on success * \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 * Get a VLC variable
...@@ -241,12 +245,14 @@ int VLC_Set ( int, char const *, vlc_value_t ); ...@@ -241,12 +245,14 @@ int VLC_Set ( int, char const *, vlc_value_t );
* This function gets the value of a variable of VLC * This function gets the value of a variable of VLC
* It stores it in the p_value argument * It stores it in the p_value argument
* *
* \note Was previously called VLC_Get
*
* \param i_object a vlc object id * \param i_object a vlc object id
* \param psz_var a vlc variable name * \param psz_var a vlc variable name
* \param p_value a pointer to a vlc_value_t structure * \param p_value a pointer to a vlc_value_t structure
* \return VLC_SUCCESS on success * \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 * Add a target to the current playlist
...@@ -262,7 +268,7 @@ int VLC_Get ( int, char const *, vlc_value_t * ); ...@@ -262,7 +268,7 @@ int VLC_Get ( int, char const *, vlc_value_t * );
* \param i_pos the position at which to add the new target (PLAYLIST_END for end) * \param i_pos the position at which to add the new target (PLAYLIST_END for end)
* \return VLC_SUCCESS on success * \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 * Start the playlist and play the currently selected playlist item
...@@ -274,7 +280,7 @@ int VLC_AddTarget ( int, char const *, const char **, int, int, int ); ...@@ -274,7 +280,7 @@ int VLC_AddTarget ( int, char const *, const char **, int, int, int );
* \param i_object a vlc object id * \param i_object a vlc object id
* \return VLC_SUCCESS on success * \return VLC_SUCCESS on success
*/ */
int VLC_Play ( int ); int VLC_Play( int );
/** /**
* Pause the currently playing item. Resume it if already paused * Pause the currently playing item. Resume it if already paused
...@@ -285,7 +291,7 @@ int VLC_Play ( int ); ...@@ -285,7 +291,7 @@ int VLC_Play ( int );
* \param i_object a vlc object id * \param i_object a vlc object id
* \return VLC_SUCCESS on success * \return VLC_SUCCESS on success
*/ */
int VLC_Pause ( int ); int VLC_Pause( int );
/** /**
* Stop the playlist * Stop the playlist
...@@ -293,10 +299,12 @@ int VLC_Pause ( int ); ...@@ -293,10 +299,12 @@ int VLC_Pause ( int );
* If an item is currently playing then stop it. * If an item is currently playing then stop it.
* Set the playlist to a stopped state. * 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 * \param i_object a vlc object id
* \return VLC_SUCCESS on success * \return VLC_SUCCESS on success
*/ */
int VLC_Stop ( int ); int VLC_Stop( int );
/** /**
* Stop the playlist * Stop the playlist
...@@ -307,17 +315,166 @@ int VLC_Stop ( int ); ...@@ -307,17 +315,166 @@ int VLC_Stop ( int );
* \param i_object a vlc object id * \param i_object a vlc object id
* \return VLC_SUCCESS on success * \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 * Clear the contents of the playlist
* *
* Completly empty the entire 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 * \param i_object a vlc object id
* \return VLC_SUCCESS on success * \return VLC_SUCCESS on success
*/ */
int VLC_ClearPlaylist( int ); int VLC_VolumeMute( int );
/** /**
* Toggle Fullscreen mode * Toggle Fullscreen mode
...@@ -327,7 +484,7 @@ int VLC_ClearPlaylist( int ); ...@@ -327,7 +484,7 @@ int VLC_ClearPlaylist( int );
* \param i_object a vlc object id * \param i_object a vlc object id
* \return VLC_SUCCESS on success * \return VLC_SUCCESS on success
*/ */
int VLC_FullScreen ( int ); int VLC_FullScreen( int );
# ifdef __cplusplus # ifdef __cplusplus
......
...@@ -196,7 +196,7 @@ int16 NPP_HandleEvent( NPP instance, void * event ) ...@@ -196,7 +196,7 @@ int16 NPP_HandleEvent( NPP instance, void * event )
if (pouetEvent->what == 6) if (pouetEvent->what == 6)
{ {
value.i_int = 1; value.i_int = 1;
VLC_Set( p_plugin->i_vlc, "drawableredraw", value ); VLC_VariableSet( p_plugin->i_vlc, "drawableredraw", value );
return true; return true;
} }
...@@ -342,11 +342,11 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ...@@ -342,11 +342,11 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
} }
value.psz_string = "dummy"; 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; 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; value.psz_string = AOUT_PLUGINS;
VLC_Set( p_plugin->i_vlc, "conf::aout", value ); VLC_VariableSet( p_plugin->i_vlc, "conf::aout", value );
#else #else
p_plugin->i_vlc = 1; p_plugin->i_vlc = 1;
...@@ -392,7 +392,7 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ...@@ -392,7 +392,7 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
if( !strcmp( argv[i], "yes" ) ) if( !strcmp( argv[i], "yes" ) )
{ {
value.b_bool = VLC_TRUE; 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" ) ) else if( !strcmp( argn[i], "fullscreen" ) )
...@@ -400,7 +400,7 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ...@@ -400,7 +400,7 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
if( !strcmp( argv[i], "yes" ) ) if( !strcmp( argv[i], "yes" ) )
{ {
value.b_bool = VLC_TRUE; value.b_bool = VLC_TRUE;
VLC_Set( p_plugin->i_vlc, "conf::fullscreen", value ); VLC_VariableSet( p_plugin->i_vlc, "conf::fullscreen", value );
} }
} }
#endif #endif
...@@ -478,12 +478,12 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -478,12 +478,12 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
#ifdef XP_MACOSX #ifdef XP_MACOSX
value.i_int = ((NP_Port*) (window->window))->port; 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; valueportx.i_int = ((NP_Port*) (window->window))->portx;
valueporty.i_int = ((NP_Port*) (window->window))->porty; valueporty.i_int = ((NP_Port*) (window->window))->porty;
VLC_Set( p_plugin->i_vlc, "drawableportx", valueportx ); VLC_VariableSet( p_plugin->i_vlc, "drawableportx", valueportx );
VLC_Set( p_plugin->i_vlc, "drawableporty", valueporty ); VLC_VariableSet( p_plugin->i_vlc, "drawableporty", valueporty );
valuex.i_int = window->x; valuex.i_int = window->x;
valuey.i_int = window->y; valuey.i_int = window->y;
...@@ -494,14 +494,14 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -494,14 +494,14 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
valueb.i_int = window->clipRect.bottom; valueb.i_int = window->clipRect.bottom;
valuer.i_int = window->clipRect.right; valuer.i_int = window->clipRect.right;
VLC_Set( p_plugin->i_vlc, "drawablet", valuet ); VLC_VariableSet( p_plugin->i_vlc, "drawablet", valuet );
VLC_Set( p_plugin->i_vlc, "drawablel", valuel ); VLC_VariableSet( p_plugin->i_vlc, "drawablel", valuel );
VLC_Set( p_plugin->i_vlc, "drawableb", valueb ); VLC_VariableSet( p_plugin->i_vlc, "drawableb", valueb );
VLC_Set( p_plugin->i_vlc, "drawabler", valuer ); VLC_VarialbeSet( p_plugin->i_vlc, "drawabler", valuer );
VLC_Set( p_plugin->i_vlc, "drawablex", valuex ); VLC_VariableSet( p_plugin->i_vlc, "drawablex", valuex );
VLC_Set( p_plugin->i_vlc, "drawabley", valuey ); VLC_VariableSet( p_plugin->i_vlc, "drawabley", valuey );
VLC_Set( p_plugin->i_vlc, "drawablew", valuew ); VLC_VariableSet( p_plugin->i_vlc, "drawablew", valuew );
VLC_Set( p_plugin->i_vlc, "drawableh", valueh ); VLC_VariableSet( p_plugin->i_vlc, "drawableh", valueh );
p_plugin->window = window; p_plugin->window = window;
...@@ -527,7 +527,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -527,7 +527,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
#else #else
/* FIXME: this cast sucks */ /* FIXME: this cast sucks */
value.i_int = (int) (ptrdiff_t) (void *) window->window; 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
#endif #endif
......
This diff is collapsed.
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