Enlightenment CVS committal Author : devilhorns Project : e_modules Module : mixer
Dir : e_modules/mixer Modified Files: e_mod_main.c alsa_mixer.c e_mod_config.c Log Message: Fixes for config of mixer module. If you are having issues w/ this module, remove any old module.cfg first. =================================================================== RCS file: /cvs/e/e_modules/mixer/e_mod_main.c,v retrieving revision 1.68 retrieving revision 1.69 diff -u -3 -r1.68 -r1.69 --- e_mod_main.c 12 Nov 2007 07:48:31 -0000 1.68 +++ e_mod_main.c 19 Nov 2007 11:04:59 -0000 1.69 @@ -385,8 +385,8 @@ return ci; } } - - card = mixer->mix_sys->cards->data; + + card = evas_list_nth(mixer->mix_sys->cards, 0); if (!card) { ci->card_id = 0; @@ -405,8 +405,8 @@ card->channels = mixer->mix_sys->get_channels(card); } if (card->channels) - { - chan = card->channels->data; + { + chan = evas_list_nth(card->channels, 0); ci->channel_id = chan->id; } else =================================================================== RCS file: /cvs/e/e_modules/mixer/alsa_mixer.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -3 -r1.28 -r1.29 --- alsa_mixer.c 19 Nov 2007 08:47:35 -0000 1.28 +++ alsa_mixer.c 19 Nov 2007 11:04:59 -0000 1.29 @@ -105,15 +105,16 @@ snd_mixer_t *handle; snd_ctl_t *control; snd_ctl_card_info_t *hw_info; - int err, i; + int err, i, cid; char buf[1024]; - - snd_ctl_card_info_alloca(&hw_info); + const char *name; for (i = 0; i < 32; i++) { Mixer_Card *card; - + + snd_ctl_card_info_alloca(&hw_info); + snprintf(buf, sizeof(buf), "hw:%d", i); if ((err = snd_ctl_open(&control, buf, 0)) < 0) break; if ((err = snd_ctl_card_info(control, hw_info)) < 0) @@ -125,33 +126,16 @@ } snd_ctl_close(control); - if ((err = snd_mixer_open(&handle, 0)) < 0) - { - printf("Cannot open mixer: %s\n", snd_strerror(err)); - continue; - } - if ((err = snd_mixer_attach(handle, buf)) < 0) - { - printf("Cannot attach mixer: %s\n", snd_strerror(err)); - snd_mixer_close(handle); - continue; - } - if ((err = snd_mixer_detach(handle, buf)) < 0) - { - printf("Cannot detach mixer: %s\n", snd_strerror(err)); - snd_mixer_close(handle); - continue; - } - snd_mixer_close(handle); + + name = snd_ctl_card_info_get_name(hw_info); + cid = _alsa_get_card_id(name); + if (cid != id) continue; card = E_NEW(Mixer_Card, 1); if (!card) continue; card->name = evas_stringshare_add(buf); - card->real = evas_stringshare_add(snd_ctl_card_info_get_name(hw_info)); - card->id = _alsa_get_card_id(card->real); - - if (!_alsa_get_card_id(card->real) == id) continue; - + card->real = evas_stringshare_add(name); + card->id = cid; card->channels = alsa_card_get_channels(card); return card; } =================================================================== RCS file: /cvs/e/e_modules/mixer/e_mod_config.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- e_mod_config.c 31 Oct 2007 14:11:55 -0000 1.22 +++ e_mod_config.c 19 Nov 2007 11:04:59 -0000 1.23 @@ -83,6 +83,7 @@ _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) { if (!mixer_config) return; + if (cfdata->app) free(cfdata->app); mixer_config->config_dialog = NULL; E_FREE(cfdata); } @@ -113,8 +114,8 @@ if (mixer->mix_sys->get_cards) mixer->mix_sys->cards = mixer->mix_sys->get_cards(); } - - if ((mixer->mix_sys->cards) && (evas_list_count(mixer->mix_sys->cards) > 1)) + + if (mixer->mix_sys->cards) { of = e_widget_framelist_add(evas, D_("Available Cards"), 0); cg = e_widget_radio_group_new(&cfdata->card_id); @@ -127,8 +128,8 @@ } e_widget_list_object_append(o, of, 1, 1, 0.5); } - - if ((mixer->mix_sys->get_card) && (ci->card_id != 0)) + + if (mixer->mix_sys->get_card) { card = mixer->mix_sys->get_card(ci->card_id); if ((mixer->mix_sys->get_channels) && (card)) ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs