Skip to content

Commit

Permalink
lib: rename libvlc_audio_set_channel to libvlc_audio_set_stereomode
Browse files Browse the repository at this point in the history
And also rename the enum.
  • Loading branch information
tguillem authored and jbkempf committed Dec 10, 2022
1 parent 996b08d commit 9d23e5b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
33 changes: 18 additions & 15 deletions include/vlc/libvlc_media_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -2217,16 +2217,16 @@ LIBVLC_API void libvlc_video_set_adjust_float( libvlc_media_player_t *p_mi,
*/

/**
* Audio channels
* Audio stereo modes
*/
typedef 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;
typedef enum libvlc_audio_output_stereomode_t {
libvlc_AudioStereoMode_Error = -1,
libvlc_AudioStereoMode_Stereo = 1,
libvlc_AudioStereoMode_RStereo = 2,
libvlc_AudioStereoMode_Left = 3,
libvlc_AudioStereoMode_Right = 4,
libvlc_AudioStereoMode_Dolbys = 5
} libvlc_audio_output_stereomode_t;


/**
Expand Down Expand Up @@ -2409,21 +2409,24 @@ LIBVLC_API int libvlc_audio_get_volume( libvlc_media_player_t *p_mi );
LIBVLC_API int libvlc_audio_set_volume( libvlc_media_player_t *p_mi, int i_volume );

/**
* Get current audio channel.
* Get current audio stereo-mode.
*
* \param p_mi media player
* \return the audio channel \see libvlc_audio_output_channel_t
* \return the audio stereo-mode, \see libvlc_audio_output_stereomode_t
* \version LibVLC 4.0.0 or later
*/
LIBVLC_API int libvlc_audio_get_channel( libvlc_media_player_t *p_mi );
LIBVLC_API libvlc_audio_output_stereomode_t libvlc_audio_get_stereomode( libvlc_media_player_t *p_mi );

/**
* Set current audio channel.
* Set current audio stereo-mode.
*
* \param p_mi media player
* \param channel the audio channel, \see libvlc_audio_output_channel_t
* \param channel the audio stereo-mode, \see libvlc_audio_output_stereomode_t
* \return 0 on success, -1 on error
* \version LibVLC 4.0.0 or later
*/
LIBVLC_API int libvlc_audio_set_channel( libvlc_media_player_t *p_mi, int channel );
LIBVLC_API int libvlc_audio_set_stereomode( libvlc_media_player_t *p_mi,
libvlc_audio_output_stereomode_t mode );

/**
* Get current audio delay.
Expand Down
12 changes: 6 additions & 6 deletions lib/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track )
}

/*****************************************************************************
* libvlc_audio_get_channel : Get the current audio channel
* libvlc_audio_get_stereomode : Get the current audio stereo-mode
*****************************************************************************/
int libvlc_audio_get_channel( libvlc_media_player_t *mp )
libvlc_audio_output_stereomode_t libvlc_audio_get_stereomode( libvlc_media_player_t *mp )
{
audio_output_t *p_aout = GetAOut( mp );
if( !p_aout )
Expand All @@ -362,19 +362,19 @@ int libvlc_audio_get_channel( libvlc_media_player_t *mp )
}

/*****************************************************************************
* libvlc_audio_set_channel : Set the current audio channel
* libvlc_audio_set_stereomode : Set the current audio stereo-mode
*****************************************************************************/
int libvlc_audio_set_channel( libvlc_media_player_t *mp, int channel )
int libvlc_audio_set_stereomode( libvlc_media_player_t *mp, libvlc_audio_output_stereomode_t mode )
{
audio_output_t *p_aout = GetAOut( mp );
int ret = 0;

if( !p_aout )
return -1;

if( var_SetInteger( p_aout, "stereo-mode", channel ) < 0 )
if( var_SetInteger( p_aout, "stereo-mode", mode ) < 0 )
{
libvlc_printerr( "Audio channel out of range" );
libvlc_printerr( "Audio stereo-mode out of range" );
ret = -1;
}
aout_Release(p_aout);
Expand Down
4 changes: 2 additions & 2 deletions lib/libvlc.sym
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ libvlc_audio_output_device_set
libvlc_audio_output_list_get
libvlc_audio_output_list_release
libvlc_audio_output_set
libvlc_audio_get_channel
libvlc_audio_get_stereomode
libvlc_audio_get_delay
libvlc_audio_get_mute
libvlc_audio_get_track
libvlc_audio_get_track_count
libvlc_audio_get_track_description
libvlc_audio_get_volume
libvlc_audio_set_channel
libvlc_audio_set_stereomode
libvlc_audio_set_delay
libvlc_audio_set_mute
libvlc_audio_set_track
Expand Down

0 comments on commit 9d23e5b

Please sign in to comment.