Search
lxdream.org :: lxdream :: r1073:92dfe34665ed
lxdream 0.9.1
released Jun 29
Download Now
changeset1073:92dfe34665ed
parent1072:d82e04e6d497
child1074:397d77b6e346
authornkeynes
dateTue Jul 21 20:52:03 2009 +1000 (11 years ago)
Update ALSA driver to the new config regime
src/drivers/audio_alsa.c
1.1 --- a/src/drivers/audio_alsa.c Tue Jul 21 20:33:21 2009 +1000
1.2 +++ b/src/drivers/audio_alsa.c Tue Jul 21 20:52:03 2009 +1000
1.3 @@ -31,10 +31,10 @@
1.4 static int frame_bytes;
1.5
1.6
1.7 -static struct lxdream_config_entry alsa_config[] = {
1.8 - {"device", N_("Audio output device"), CONFIG_TYPE_FILE, "default"},
1.9 - {NULL, CONFIG_TYPE_NONE}
1.10 -};
1.11 +static struct lxdream_config_group alsa_config = {
1.12 + "alsa", NULL, NULL, NULL,
1.13 + {{"device", N_("Audio output device"), CONFIG_TYPE_FILE, "default"},
1.14 + {NULL, CONFIG_TYPE_NONE}} };
1.15
1.16
1.17 static gboolean audio_alsa_init( )
1.18 @@ -50,13 +50,13 @@
1.19
1.20
1.21 // Open the device we were told to open.
1.22 - err = snd_pcm_open( &_soundDevice, alsa_config[0].value,
1.23 + err = snd_pcm_open( &_soundDevice, alsa_config.params[0].value,
1.24 SND_PCM_STREAM_PLAYBACK, 0 );
1.25
1.26 // Check for error on open.
1.27 if ( err < 0 ) {
1.28 ERROR( "Init: cannot open audio device %s (%s)\n",
1.29 - alsa_config[0].value, snd_strerror( err ) );
1.30 + alsa_config.params[0].value, snd_strerror( err ) );
1.31 return FALSE;
1.32 } else {
1.33 DEBUG( "Audio device opened successfully." );
1.34 @@ -197,7 +197,7 @@
1.35
1.36 static gboolean audio_alsa_static_init( void )
1.37 {
1.38 - lxdream_register_config_group( "alsa", alsa_config );
1.39 + lxdream_register_config_group( "alsa", &alsa_config );
1.40 audio_register_driver( &audio_alsa_driver );
1.41 return TRUE;
1.42 }
.