Commit 3d0ef016 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove enums from public APIs

parent 352bf617
......@@ -111,14 +111,14 @@ enum libvlc_event_type_t {
struct libvlc_event_t
{
libvlc_event_type_t type;
unsigned type;
void * p_obj;
union event_type_specific
{
/* media descriptor */
struct
{
libvlc_meta_t meta_type;
unsigned meta_type;
} media_meta_changed;
struct
{
......@@ -138,7 +138,7 @@ struct libvlc_event_t
} media_freed;
struct
{
libvlc_state_t new_state;
unsigned new_state;
} media_state_changed;
/* media instance */
......
......@@ -49,7 +49,7 @@ typedef struct libvlc_media_t libvlc_media_t;
* @{
*/
typedef enum libvlc_meta_t {
enum libvlc_meta_t {
libvlc_meta_Title,
libvlc_meta_Artist,
libvlc_meta_Genre,
......@@ -68,7 +68,7 @@ typedef enum libvlc_meta_t {
libvlc_meta_ArtworkURL,
libvlc_meta_TrackID,
/* Add new meta types HERE */
} libvlc_meta_t;
};
/** @}*/
......@@ -81,7 +81,7 @@ typedef enum libvlc_meta_t {
* IDLE/CLOSE=0, OPENING=1, BUFFERING=2, PLAYING=3, PAUSED=4,
* STOPPING=5, ENDED=6, ERROR=7
*/
typedef enum libvlc_state_t
enum libvlc_state_t
{
libvlc_NothingSpecial=0,
libvlc_Opening,
......@@ -91,13 +91,13 @@ typedef enum libvlc_state_t
libvlc_Stopped,
libvlc_Ended,
libvlc_Error
} libvlc_state_t;
};
typedef enum libvlc_media_option_t
enum libvlc_media_option_t
{
libvlc_media_option_trusted = 0x2,
libvlc_media_option_unique = 0x100
} libvlc_media_option_t;
};
/**
* Create a media with the given MRL.
......@@ -159,7 +159,7 @@ VLC_PUBLIC_API void libvlc_media_add_option(
VLC_PUBLIC_API void libvlc_media_add_option_flag(
libvlc_media_t * p_md,
const char * ppsz_options,
libvlc_media_option_t i_flags,
unsigned i_flags,
libvlc_exception_t * p_e );
......@@ -213,7 +213,7 @@ VLC_PUBLIC_API libvlc_media_t * libvlc_media_duplicate( libvlc_media_t * );
*/
VLC_PUBLIC_API char * libvlc_media_get_meta(
libvlc_media_t *p_meta_desc,
libvlc_meta_t e_meta,
unsigned e_meta,
libvlc_exception_t *p_e );
/**
* Get current state of media descriptor object. Possible media states
......@@ -227,7 +227,7 @@ VLC_PUBLIC_API char * libvlc_media_get_meta(
* \param p_e an initialized exception object
* \return state of media descriptor object
*/
VLC_PUBLIC_API libvlc_state_t libvlc_media_get_state(
VLC_PUBLIC_API unsigned libvlc_media_get_state(
libvlc_media_t *p_meta_desc,
libvlc_exception_t *p_e );
......
......@@ -121,7 +121,7 @@ VLC_PUBLIC_API int
* \param p_e initialized exception instance
* \return libvlc_state_t for media list player
*/
VLC_PUBLIC_API libvlc_state_t
VLC_PUBLIC_API unsigned
libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp,
libvlc_exception_t * p_e );
......
......@@ -79,7 +79,7 @@ typedef struct libvlc_rectangle_t
/**
* Marq int options definition
*/
typedef enum libvlc_video_marquee_int_option_t {
enum libvlc_video_marquee_int_option_t {
libvlc_marquee_Enabled = 0,
libvlc_marquee_Color,
libvlc_marquee_Opacity,
......@@ -88,15 +88,15 @@ typedef enum libvlc_video_marquee_int_option_t {
libvlc_marquee_Size,
libvlc_marquee_Timeout,
libvlc_marquee_X,
libvlc_marquee_Y
} libvlc_video_marquee_int_option_t;
libvlc_marquee_Y,
};
/**
* Marq string options definition
*/
typedef enum libvlc_video_marquee_string_option_t {
libvlc_marquee_Text = 0
} libvlc_video_marquee_string_option_t;
enum libvlc_video_marquee_string_option_t {
libvlc_marquee_Text = 0,
};
/**
......@@ -436,7 +436,7 @@ VLC_PUBLIC_API void libvlc_media_player_set_rate( libvlc_media_player_t *, float
* \param p_e an initialized exception pointer
* \return current movie state as libvlc_state_t
*/
VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *, libvlc_exception_t *);
VLC_PUBLIC_API unsigned libvlc_media_player_get_state( libvlc_media_player_t *, libvlc_exception_t *);
/**
* Get movie fps rate
......@@ -756,7 +756,7 @@ VLC_PUBLIC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *,
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API int libvlc_video_get_marquee_option_as_int( libvlc_media_player_t *,
libvlc_video_marquee_int_option_t,
unsigned,
libvlc_exception_t * );
/**
......@@ -767,7 +767,7 @@ VLC_PUBLIC_API int libvlc_video_get_marquee_option_as_int( libvlc_media_player_t
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API char *libvlc_video_get_marquee_option_as_string( libvlc_media_player_t *,
libvlc_video_marquee_string_option_t,
unsigned,
libvlc_exception_t * );
/**
......@@ -779,7 +779,7 @@ VLC_PUBLIC_API char *libvlc_video_get_marquee_option_as_string( libvlc_media_pla
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API void libvlc_video_set_marquee_option_as_int( libvlc_media_player_t *,
libvlc_video_marquee_int_option_t,
unsigned,
int, libvlc_exception_t * );
/**
......@@ -791,7 +791,7 @@ VLC_PUBLIC_API void libvlc_video_set_marquee_option_as_int( libvlc_media_player_
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API void libvlc_video_set_marquee_option_as_string( libvlc_media_player_t *,
libvlc_video_marquee_string_option_t,
unsigned,
const char *,
libvlc_exception_t * );
......@@ -806,7 +806,7 @@ VLC_PUBLIC_API void libvlc_video_set_marquee_option_as_string( libvlc_media_play
/**
* Audio device types
*/
typedef enum libvlc_audio_output_device_types_t {
enum libvlc_audio_output_device_types_t {
libvlc_AudioOutputDevice_Error = -1,
libvlc_AudioOutputDevice_Mono = 1,
libvlc_AudioOutputDevice_Stereo = 2,
......@@ -815,20 +815,20 @@ typedef enum libvlc_audio_output_device_types_t {
libvlc_AudioOutputDevice_5_1 = 6,
libvlc_AudioOutputDevice_6_1 = 7,
libvlc_AudioOutputDevice_7_1 = 8,
libvlc_AudioOutputDevice_SPDIF = 10
} libvlc_audio_output_device_types_t;
libvlc_AudioOutputDevice_SPDIF = 10,
};
/**
* Audio channels
*/
typedef enum libvlc_audio_output_channel_t {
enum libvlc_audio_output_channel_t {
libvlc_AudioChannel_Error = -1,
libvlc_AudioChannel_Stereo = 1,
libvlc_AudioChannel_RStereo = 2,
libvlc_AudioChannel_Left = 3,
libvlc_AudioChannel_Right = 4,
libvlc_AudioChannel_Dolbys = 5
} libvlc_audio_output_channel_t;
libvlc_AudioChannel_Dolbys = 5,
};
/**
......
......@@ -61,7 +61,7 @@ static const vlc_meta_type_t libvlc_to_vlc_meta[] =
[libvlc_meta_TrackID] = vlc_meta_TrackID
};
static const libvlc_meta_t vlc_to_libvlc_meta[] =
static const enum libvlc_meta_t vlc_to_libvlc_meta[] =
{
[vlc_meta_Title] = libvlc_meta_Title,
[vlc_meta_Artist] = libvlc_meta_Artist,
......@@ -366,7 +366,7 @@ void libvlc_media_add_option(
void libvlc_media_add_option_flag(
libvlc_media_t * p_md,
const char * ppsz_option,
libvlc_media_option_t i_flags,
unsigned i_flags,
libvlc_exception_t *p_e )
{
VLC_UNUSED(p_e);
......@@ -442,8 +442,7 @@ libvlc_media_get_mrl( libvlc_media_t * p_md,
* Getter for meta information
**************************************************************************/
char * libvlc_media_get_meta( libvlc_media_t *p_md,
libvlc_meta_t e_meta,
char * libvlc_media_get_meta( libvlc_media_t *p_md, unsigned e_meta,
libvlc_exception_t *p_e )
{
char * psz_meta;
......@@ -478,7 +477,7 @@ char * libvlc_media_get_meta( libvlc_media_t *p_md,
* Can be error, playing, buffering, NothingSpecial.
**************************************************************************/
libvlc_state_t
unsigned
libvlc_media_get_state( libvlc_media_t *p_md,
libvlc_exception_t *p_e )
{
......@@ -491,8 +490,7 @@ libvlc_media_get_state( libvlc_media_t *p_md,
**************************************************************************/
void
libvlc_media_set_state( libvlc_media_t *p_md,
libvlc_state_t state,
libvlc_media_set_state( libvlc_media_t *p_md, enum libvlc_state_t state,
libvlc_exception_t *p_e )
{
libvlc_event_t event;
......
......@@ -38,7 +38,7 @@ struct libvlc_media_t
input_item_t *p_input_item;
int i_refcount;
libvlc_instance_t *p_libvlc_instance;
libvlc_state_t state;
enum libvlc_state_t state;
VLC_FORWARD_DECLARE_OBJECT(libvlc_media_list_t*) p_subitems; /* A media descriptor can have Sub items. This is the only dependancy we really have on media_list */
void *p_user_data;
};
......@@ -49,7 +49,7 @@ libvlc_media_t * libvlc_media_new_from_input_item(
libvlc_exception_t * );
void libvlc_media_set_state(
libvlc_media_t *, libvlc_state_t,
libvlc_media_t *, enum libvlc_state_t,
libvlc_exception_t * );
#endif
......@@ -436,7 +436,9 @@ int
libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp,
libvlc_exception_t * p_e )
{
libvlc_state_t state = libvlc_media_player_get_state( p_mlp->p_mi, p_e );
enum libvlc_state_t state;
state = libvlc_media_player_get_state( p_mlp->p_mi, p_e );
return (state == libvlc_Opening) || (state == libvlc_Buffering) ||
(state == libvlc_Playing);
}
......@@ -444,7 +446,7 @@ libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp,
/**************************************************************************
* State (Public)
**************************************************************************/
libvlc_state_t
enum libvlc_state_t
libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp,
libvlc_exception_t * p_e )
{
......
......@@ -57,7 +57,7 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd,
static int SnapshotTakenCallback( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data );
static const libvlc_state_t vlc_to_libvlc_state_array[] =
static const enum libvlc_state_t vlc_to_libvlc_state_array[] =
{
[INIT_S] = libvlc_NothingSpecial,
[OPENING_S] = libvlc_Opening,
......@@ -67,7 +67,7 @@ static const libvlc_state_t vlc_to_libvlc_state_array[] =
[ERROR_S] = libvlc_Error,
};
static inline libvlc_state_t vlc_to_libvlc_state( int vlc_state )
static enum libvlc_state_t vlc_to_libvlc_state( int vlc_state )
{
if( vlc_state < 0 || vlc_state > 6 )
return libvlc_Ended;
......@@ -190,7 +190,7 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd,
if( newval.i_int == INPUT_EVENT_STATE )
{
libvlc_state_t libvlc_state;
enum libvlc_state_t libvlc_state;
switch ( var_GetInteger( p_input, "state" ) )
{
......@@ -623,7 +623,7 @@ void libvlc_media_player_pause( libvlc_media_player_t *p_mi,
if( !p_input_thread )
return;
libvlc_state_t state = libvlc_media_player_get_state( p_mi, p_e );
enum libvlc_state_t state = libvlc_media_player_get_state( p_mi, p_e );
if( state == libvlc_Playing || state == libvlc_Buffering )
{
if( libvlc_media_player_can_pause( p_mi, p_e ) )
......@@ -645,7 +645,7 @@ void libvlc_media_player_pause( libvlc_media_player_t *p_mi,
int libvlc_media_player_is_playing( libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
{
libvlc_state_t state = libvlc_media_player_get_state( p_mi, p_e );
enum libvlc_state_t state = libvlc_media_player_get_state( p_mi, p_e );
return (libvlc_Playing == state) || (libvlc_Buffering == state);
}
......@@ -655,7 +655,7 @@ int libvlc_media_player_is_playing( libvlc_media_player_t *p_mi,
void libvlc_media_player_stop( libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
{
libvlc_state_t state = libvlc_media_player_get_state( p_mi, p_e );
enum libvlc_state_t state = libvlc_media_player_get_state( p_mi, p_e );
if( state == libvlc_Playing ||
state == libvlc_Paused ||
......@@ -1121,12 +1121,12 @@ float libvlc_media_player_get_rate(
return (float)1000.0f/val.i_int;
}
libvlc_state_t libvlc_media_player_get_state(
enum libvlc_state_t libvlc_media_player_get_state(
libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
{
input_thread_t *p_input_thread;
libvlc_state_t state = libvlc_Ended;
enum libvlc_state_t state;
vlc_value_t val;
p_input_thread = libvlc_get_input_thread ( p_mi, p_e );
......@@ -1135,7 +1135,7 @@ libvlc_state_t libvlc_media_player_get_state(
/* We do return the right value, no need to throw an exception */
if( libvlc_exception_raised( p_e ) )
libvlc_exception_clear( p_e );
return state;
return libvlc_Ended;
}
var_Get( p_input_thread, "state", &val );
......
......@@ -365,7 +365,7 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
}
else
{
libvlc_state_t state;
enum libvlc_state_t state;
state = libvlc_media_player_get_state( self->p_media_player, &ex );
if( libvlc_exception_raised( &ex ) )
......
......@@ -683,7 +683,7 @@ static vlc_object_t *get_marquee_object( libvlc_media_player_t * p_mi )
* libvlc_video_get_marquee_option_as_int : get a marq option value
*****************************************************************************/
int libvlc_video_get_marquee_option_as_int( libvlc_media_player_t *p_mi,
libvlc_video_marquee_int_option_t option,
unsigned option,
libvlc_exception_t *p_e )
{
const char * identifier = get_marquee_int_option_identifier(option);
......@@ -717,7 +717,7 @@ int libvlc_video_get_marquee_option_as_int( libvlc_media_player_t *p_mi,
* libvlc_video_get_marquee_option_as_string : get a marq option value
*****************************************************************************/
char * libvlc_video_get_marquee_option_as_string( libvlc_media_player_t *p_mi,
libvlc_video_marquee_string_option_t option,
unsigned option,
libvlc_exception_t *p_e )
{
const char * identifier = get_marquee_string_option_identifier(option);
......@@ -742,7 +742,7 @@ char * libvlc_video_get_marquee_option_as_string( libvlc_media_player_t *p_mi,
* libvlc_video_set_marquee_option_as_int: enable, disable or set an int option
*****************************************************************************/
void libvlc_video_set_marquee_option_as_int( libvlc_media_player_t *p_mi,
libvlc_video_marquee_int_option_t option,
unsigned option,
int value, libvlc_exception_t *p_e )
{
const char * identifier = get_marquee_int_option_identifier(option);
......@@ -781,7 +781,7 @@ void libvlc_video_set_marquee_option_as_int( libvlc_media_player_t *p_mi,
* libvlc_video_set_marquee_option_as_string: set a string option
*****************************************************************************/
void libvlc_video_set_marquee_option_as_string( libvlc_media_player_t *p_mi,
libvlc_video_marquee_string_option_t option,
unsigned option,
const char * value,
libvlc_exception_t *p_e )
{
......
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