From: James Courtier-D. <Ja...@su...> - 2004-05-05 20:15:25
|
Michael Roitzsch wrote: > Hi James, > > >>>>Modified Files: >>>> audio_alsa_out.c >>>>Log Message: >>>>Implement a more user friendly "Speaker arrangement" config item. >>> >>>Thanks, you just broke my front-end... :/ >> >>Sorry, but no pain, no gain. It should be better having 1 config item >>instead of 5 previously. > > > Thanks for the usability improvement. I just extended the help text a bit. > Would you agree to the attached patch? > > Michael You patch will not work. The speaker_arrangement list has to match the #define statements. If you change the speaker_arrangements list, you have to make #define match it. You have missed out item 3. > > > > ------------------------------------------------------------------------ > > Index: src/audio_out/audio_alsa_out.c > =================================================================== > RCS file: /cvsroot/xine/xine-lib/src/audio_out/audio_alsa_out.c,v > retrieving revision 1.138 > diff -u -r1.138 audio_alsa_out.c > --- src/audio_out/audio_alsa_out.c 30 Apr 2004 03:07:33 -0000 1.138 > +++ src/audio_out/audio_alsa_out.c 5 May 2004 18:56:31 -0000 > @@ -1287,20 +1287,22 @@ > int err; > char *pcm_device; > snd_pcm_hw_params_t *params; > - static char *speaker_arrangement[] = {"Mono", "Stereo", "Headphones", "A52_Passthru", "Surround21", "Surround3", "Surround4", "Surround41", "Surround5", "Surround51", "Surround6", "Surround61", "Surround71", NULL}; > - #define MONO 0 > - #define STEREO 1 > - #define HEADPHONES 2 > - #define A52_PASSTHRU 3 > - #define SURROUND21 4 > - #define SURROUND3 5 > - #define SURROUND4 6 > - #define SURROUND41 7 > - #define SURROUND5 8 > - #define SURROUND51 9 > - #define SURROUND6 10 > - #define SURROUND61 11 > - #define SURROUND71 12 > + static char *speaker_arrangement[] = {"Mono 1.0", "Stereo 2.0", "Headphones 2.0", "Stereo 2.1", > + "Surround 3.0", "Surround 4.0", "Surround 4.1", "Surround 5.0", "Surround 5.1", "Surround 6.0", > + "Surround 6.1", "Surround 7.1", "Pass Through", NULL}; > + #define MONO 0 > + #define STEREO 1 > + #define HEADPHONES 2 > + #define SURROUND21 4 > + #define SURROUND3 5 > + #define SURROUND4 6 > + #define SURROUND41 7 > + #define SURROUND5 8 > + #define SURROUND51 9 > + #define SURROUND6 10 > + #define SURROUND61 11 > + #define SURROUND71 12 > + #define A52_PASSTHRU 13 > int speakers; > > this = (alsa_driver_t *) xine_xmalloc (sizeof (alsa_driver_t)); > @@ -1410,11 +1412,36 @@ > > this->capabilities = 0; > > - speakers = config->register_enum(config, "audio.speaker_arrangement", 1, > + speakers = config->register_enum(config, "audio.speaker_arrangement", STEREO, > speaker_arrangement, > - _("Speaker arrangement"), > - _("Select how your speakers are arranged." > - "This determines which speakers xine uses for output"), > + _("speaker arrangement"), > + _("Select how your speakers are arranged, " > + "this determines which speakers xine uses for sound output. " > + "The individual values are:\n\n" > + "Mono 1.0: You have only one speaker.\n" > + "Stereo 2.0: You have two speakers for left and right channel.\n" > + "Headphones 2.0: You use headphones.\n" > + "Stereo 2.1: You have two speakers for left and right channel, and one " > + "subwoofer for the low frequencies.\n" > + "Surround 3.0: You have three speakers for left, right and rear channel.\n" > + "Surround 4.0: You have four speakers for front left and right and rear " > + "left and right channels.\n" > + "Surround 4.1: You have four speakers for front left and right and rear " > + "left and right channels, and one subwoofer for the low frequencies.\n" > + "Surround 5.0: You have five speakers for front left, center and right and " > + "rear left and right channels.\n" > + "Surround 5.1: You have five speakers for front left, center and right and " > + "rear left and right channels, and one subwoofer for the low frequencies.\n" > + "Surround 6.0: You have six speakers for front left, center and right and " > + "rear left, center and right channels.\n" > + "Surround 6.1: You have six speakers for front left, center and right and " > + "rear left, center and right channels, and one subwoofer for the low frequencies.\n" > + "Surround 7.1: You have seven speakers for front left, center and right, " > + "left and right and rear left and right channels, and one subwoofer for the " > + "low frequencies.\n" > + "Pass Through: Your sound system will receive undecoded digital sound from xine. " > + "You need to connect a digital surround decoder capable of decoding the " > + "formats you want to play to your sound card's digital output."), > 0, alsa_speaker_arrangement_cb, this); > > xprintf(class->xine, XINE_VERBOSITY_LOG, _("audio_alsa_out : supported modes are ")); > Index: src/audio_out/audio_oss_out.c > =================================================================== > RCS file: /cvsroot/xine/xine-lib/src/audio_out/audio_oss_out.c,v > retrieving revision 1.107 > diff -u -r1.107 audio_oss_out.c > --- src/audio_out/audio_oss_out.c 30 Apr 2004 12:57:47 -0000 1.107 > +++ src/audio_out/audio_oss_out.c 5 May 2004 18:56:33 -0000 > @@ -727,20 +727,22 @@ > static char *sync_methods[] = {"auto", "getodelay", "getoptr", "softsync", "probebuffer", NULL}; > static char *devname_opts[] = {"auto", "/dev/dsp", "/dev/sound/dsp", NULL}; > int devname_val, devname_num; > - static char *speaker_arrangement[] = {"Mono", "Stereo", "Headphones", "A52_Passthru", "Surround21", "Surround3", "Surround4", "Surround41", "Surround5", "Surround51", "Surround6", "Surround61", "Surround71", NULL}; > - #define MONO 0 > - #define STEREO 1 > - #define HEADPHONES 2 > - #define A52_PASSTHRU 3 > - #define SURROUND21 4 > - #define SURROUND3 5 > - #define SURROUND4 6 > - #define SURROUND41 7 > - #define SURROUND5 8 > - #define SURROUND51 9 > - #define SURROUND6 10 > - #define SURROUND61 11 > - #define SURROUND71 12 > + static char *speaker_arrangement[] = {"Mono 1.0", "Stereo 2.0", "Headphones 2.0", "Stereo 2.1", > + "Surround 3.0", "Surround 4.0", "Surround 4.1", "Surround 5.0", "Surround 5.1", "Surround 6.0", > + "Surround 6.1", "Surround 7.1", "Pass Through", NULL}; > + #define MONO 0 > + #define STEREO 1 > + #define HEADPHONES 2 > + #define SURROUND21 4 > + #define SURROUND3 5 > + #define SURROUND4 6 > + #define SURROUND41 7 > + #define SURROUND5 8 > + #define SURROUND51 9 > + #define SURROUND6 10 > + #define SURROUND61 11 > + #define SURROUND71 12 > + #define A52_PASSTHRU 13 > int speakers; > > > @@ -935,11 +937,36 @@ > return NULL; > } > > - speakers = config->register_enum(config, "audio.speaker_arrangement", 1, > + speakers = config->register_enum(config, "audio.speaker_arrangement", STEREO, > speaker_arrangement, > - _("Speaker arrangement"), > - _("Select how your speakers are arranged." > - "This determines which speakers xine uses for output"), > + _("speaker arrangement"), > + _("Select how your speakers are arranged, " > + "this determines which speakers xine uses for sound output. " > + "The individual values are:\n\n" > + "Mono 1.0: You have only one speaker.\n" > + "Stereo 2.0: You have two speakers for left and right channel.\n" > + "Headphones 2.0: You use headphones.\n" > + "Stereo 2.1: You have two speakers for left and right channel, and one " > + "subwoofer for the low frequencies.\n" > + "Surround 3.0: You have three speakers for left, right and rear channel.\n" > + "Surround 4.0: You have four speakers for front left and right and rear " > + "left and right channels.\n" > + "Surround 4.1: You have four speakers for front left and right and rear " > + "left and right channels, and one subwoofer for the low frequencies.\n" > + "Surround 5.0: You have five speakers for front left, center and right and " > + "rear left and right channels.\n" > + "Surround 5.1: You have five speakers for front left, center and right and " > + "rear left and right channels, and one subwoofer for the low frequencies.\n" > + "Surround 6.0: You have six speakers for front left, center and right and " > + "rear left, center and right channels.\n" > + "Surround 6.1: You have six speakers for front left, center and right and " > + "rear left, center and right channels, and one subwoofer for the low frequencies.\n" > + "Surround 7.1: You have seven speakers for front left, center and right, " > + "left and right and rear left and right channels, and one subwoofer for the " > + "low frequencies.\n" > + "Pass Through: Your sound system will receive undecoded digital sound from xine. " > + "You need to connect a digital surround decoder capable of decoding the " > + "formats you want to play to your sound card's digital output."), > 0, oss_speaker_arrangement_cb, this); > > |