/*****************************************************************************
* waveout.c : Windows waveOut plugin for vlc
*****************************************************************************
/*****************************************************************************
* waveout.c : Windows waveOut plugin for vlc
*****************************************************************************
*
* 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
*
* 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
static int OpenWaveOut ( aout_instance_t *, uint32_t,
int, int, int, int, bool );
static int OpenWaveOutPCM( aout_instance_t *, uint32_t,
static int OpenWaveOut ( aout_instance_t *, uint32_t,
int, int, int, int, bool );
static int OpenWaveOutPCM( aout_instance_t *, uint32_t,
- int*, int, int, int, bool );
+ vlc_fourcc_t*, int, int, int, bool );
static int PlayWaveOut ( aout_instance_t *, HWAVEOUT, WAVEHDR *,
aout_buffer_t *, bool );
static void CALLBACK WaveOutCallback ( HWAVEOUT, UINT, DWORD, DWORD, DWORD );
static void* WaveOutThread( vlc_object_t * );
static int PlayWaveOut ( aout_instance_t *, HWAVEOUT, WAVEHDR *,
aout_buffer_t *, bool );
static void CALLBACK WaveOutCallback ( HWAVEOUT, UINT, DWORD, DWORD, DWORD );
static void* WaveOutThread( vlc_object_t * );
static int VolumeGet( aout_instance_t *, audio_volume_t * );
static int VolumeSet( aout_instance_t *, audio_volume_t );
static int VolumeGet( aout_instance_t *, audio_volume_t * );
static int VolumeSet( aout_instance_t *, audio_volume_t );
-vlc_module_begin();
- set_shortname( "WaveOut" );
- set_description( N_("Win32 waveOut extension output") );
- set_capability( "audio output", 50 );
- set_category( CAT_AUDIO );
- set_subcategory( SUBCAT_AUDIO_AOUT );
- add_bool( "waveout-float32", 1, 0, FLOAT_TEXT, FLOAT_LONGTEXT, true );
+vlc_module_begin ()
+ set_shortname( "WaveOut" )
+ set_description( N_("Win32 waveOut extension output") )
+ set_capability( "audio output", 50 )
+ set_category( CAT_AUDIO )
+ set_subcategory( SUBCAT_AUDIO_AOUT )
+ add_bool( "waveout-float32", true, NULL, FLOAT_TEXT, FLOAT_LONGTEXT, true )
add_string( "waveout-audio-device", "wavemapper", NULL,
add_string( "waveout-audio-device", "wavemapper", NULL,
- DEVICE_TEXT, DEVICE_LONG, false );
- change_string_list( ppsz_adev, ppsz_adev_text, ReloadWaveoutDevices );
- change_need_restart();
- change_action_add( ReloadWaveoutDevices, N_("Refresh list") );
+ DEVICE_TEXT, DEVICE_LONG, false )
+ add_deprecated_alias( "waveout-dev" ) /* deprecated since 0.9.3 */
+ change_string_list( ppsz_adev, ppsz_adev_text, ReloadWaveoutDevices )
+ change_need_restart ()
+ change_action_add( ReloadWaveoutDevices, N_("Refresh list") )
/*****************************************************************************
* aout_sys_t: waveOut audio output method descriptor
/*****************************************************************************
* aout_sys_t: waveOut audio output method descriptor
p_aout->output.output.i_physical_channels,
aout_FormatNbChannels( &p_aout->output.output ),
p_aout->output.output.i_rate, false )
p_aout->output.output.i_physical_channels,
aout_FormatNbChannels( &p_aout->output.output ),
p_aout->output.output.i_rate, false )
- = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
- | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT
- | AOUT_CHAN_LFE;
- }
- else if( val.i_int == AOUT_VAR_2F2R )
- {
+ = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
+ | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT
+ | AOUT_CHAN_LFE;
+ break;
+ case AOUT_VAR_2F2R:
- = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT
- | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT;
- }
- else if( val.i_int == AOUT_VAR_MONO )
- {
+ = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT
+ | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT;
+ break;
+ case AOUT_VAR_MONO:
/* Then launch the notification thread */
if( vlc_thread_create( p_aout->output.p_sys->p_notif,
"waveOut Notification Thread", WaveOutThread,
/* Then launch the notification thread */
if( vlc_thread_create( p_aout->output.p_sys->p_notif,
"waveOut Notification Thread", WaveOutThread,
unsigned int i_physical_channels;
var_Create( p_aout, "audio-device", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
unsigned int i_physical_channels;
var_Create( p_aout, "audio-device", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
var_Change( p_aout, "audio-device",
VLC_VAR_ADDCHOICE, &val, &text );
msg_Dbg( p_aout, "device supports 5.1 channels" );
var_Change( p_aout, "audio-device",
VLC_VAR_ADDCHOICE, &val, &text );
msg_Dbg( p_aout, "device supports 5.1 channels" );
var_Change( p_aout, "audio-device",
VLC_VAR_ADDCHOICE, &val, &text );
msg_Dbg( p_aout, "device supports 4 channels" );
var_Change( p_aout, "audio-device",
VLC_VAR_ADDCHOICE, &val, &text );
msg_Dbg( p_aout, "device supports 4 channels" );
var_Change( p_aout, "audio-device", VLC_VAR_ADDCHOICE, &val, &text );
msg_Dbg( p_aout, "device supports 2 channels" );
}
var_Change( p_aout, "audio-device", VLC_VAR_ADDCHOICE, &val, &text );
msg_Dbg( p_aout, "device supports 2 channels" );
}
var_Change( p_aout, "audio-device", VLC_VAR_ADDCHOICE, &val, &text );
msg_Dbg( p_aout, "device supports 1 channel" );
}
var_Change( p_aout, "audio-device", VLC_VAR_ADDCHOICE, &val, &text );
msg_Dbg( p_aout, "device supports 1 channel" );
}
p_aout->output.output.i_physical_channels,
aout_FormatNbChannels( &p_aout->output.output ),
p_aout->output.output.i_rate, true )
p_aout->output.output.i_physical_channels,
aout_FormatNbChannels( &p_aout->output.output ),
p_aout->output.output.i_rate, true )
{
msg_Dbg( p_aout, "device supports A/52 over S/PDIF" );
val.i_int = AOUT_VAR_SPDIF;
{
msg_Dbg( p_aout, "device supports A/52 over S/PDIF" );
val.i_int = AOUT_VAR_SPDIF;
var_Change( p_aout, "audio-device",
VLC_VAR_ADDCHOICE, &val, &text );
if( config_GetInt( p_aout, "spdif" ) )
var_Change( p_aout, "audio-device",
VLC_VAR_ADDCHOICE, &val, &text );
if( config_GetInt( p_aout, "spdif" ) )
}
var_AddCallback( p_aout, "audio-device", aout_ChannelsRestart, NULL );
}
var_AddCallback( p_aout, "audio-device", aout_ChannelsRestart, NULL );
i_nb_channels = 2;
/* To prevent channel re-ordering */
waveformat.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT;
i_nb_channels = 2;
/* To prevent channel re-ordering */
waveformat.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT;
waveformat.Format.wBitsPerSample = sizeof(float) * 8;
waveformat.Samples.wValidBitsPerSample =
waveformat.Format.wBitsPerSample;
waveformat.Format.wBitsPerSample = sizeof(float) * 8;
waveformat.Samples.wValidBitsPerSample =
waveformat.Format.wBitsPerSample;
waveformat.Format.wBitsPerSample = 16;
waveformat.Samples.wValidBitsPerSample =
waveformat.Format.wBitsPerSample;
waveformat.Format.wBitsPerSample = 16;
waveformat.Samples.wValidBitsPerSample =
waveformat.Format.wBitsPerSample;
/*****************************************************************************
* OpenWaveOutPCM: open a PCM waveout sound device
****************************************************************************/
/*****************************************************************************
* OpenWaveOutPCM: open a PCM waveout sound device
****************************************************************************/
-static int OpenWaveOutPCM( aout_instance_t *p_aout, uint32_t i_device_id, int *i_format,
+static int OpenWaveOutPCM( aout_instance_t *p_aout, uint32_t i_device_id,
+ vlc_fourcc_t *i_format,
int i_channels, int i_nb_channels, int i_rate,
bool b_probe )
{
bool b_use_float32 = var_CreateGetBool( p_aout, "waveout-float32");
int i_channels, int i_nb_channels, int i_rate,
bool b_probe )
{
bool b_use_float32 = var_CreateGetBool( p_aout, "waveout-float32");
- if( !b_use_float32 || OpenWaveOut( p_aout, i_device_id, VLC_FOURCC('f','l','3','2'),
+ if( !b_use_float32 || OpenWaveOut( p_aout, i_device_id, VLC_CODEC_FL32,
i_channels, i_nb_channels, i_rate, b_probe )
!= VLC_SUCCESS )
{
i_channels, i_nb_channels, i_rate, b_probe )
!= VLC_SUCCESS )
{
- if ( OpenWaveOut( p_aout, i_device_id, VLC_FOURCC('s','1','6','l'),
+ if ( OpenWaveOut( p_aout, i_device_id, VLC_CODEC_S16L,
i_channels, i_nb_channels, i_rate, b_probe )
!= VLC_SUCCESS )
{
i_channels, i_nb_channels, i_rate, b_probe )
!= VLC_SUCCESS )
{
static int ReloadWaveoutDevices( vlc_object_t *p_this, char const *psz_name,
vlc_value_t newval, vlc_value_t oldval, void *data )
{
static int ReloadWaveoutDevices( vlc_object_t *p_this, char const *psz_name,
vlc_value_t newval, vlc_value_t oldval, void *data )
{
module_config_t *p_item = config_FindConfig( p_this, psz_name );
if( !p_item ) return VLC_SUCCESS;
module_config_t *p_item = config_FindConfig( p_this, psz_name );
if( !p_item ) return VLC_SUCCESS;