On Fri, 15 Feb 2013 08:53:04 -0800 "Enlightenment SVN"
<no-re...@enlightenment.org> said:

you know this series of "clean up mixer" has nicely totally broken pulse audio
support... like its no longer detected at all and i'm left with all my audio
muted and no sound coming out and no way to fix it. totally appreciate the
effort to clean/fix/work on mixer... not good if it makes things massively
worse to the point of audio being useless in e17 :) (if you use pulse.. which i
think happens to be most people).

i'm reverting your changes back to r83903 (which was harmless spacing changes).
can you take your changesets and go over them.. and test with pulseaudio
support too... and re-apply when you have stuff working... in all cases. :)

> Log:
> e_mixer: cleanup mixer card and channel selection code path
> 
> Author:       jeyzu
> Date:         2013-02-15 08:53:04 -0800 (Fri, 15 Feb 2013)
> New Revision: 83959
> Trac:         http://trac.enlightenment.org/e/changeset/83959
> 
> Modified:
>   trunk/e/src/modules/mixer/app_mixer.c
> trunk/e/src/modules/mixer/e_mod_main.c 
> 
> Modified: trunk/e/src/modules/mixer/app_mixer.c
> ===================================================================
> --- trunk/e/src/modules/mixer/app_mixer.c     2013-02-15 15:47:41 UTC (rev
> 83958) +++ trunk/e/src/modules/mixer/app_mixer.c      2013-02-15 16:53:04
> UTC (rev 83959) @@ -5,7 +5,7 @@
>  typedef struct E_Mixer_App_Dialog_Data
>  {
>     E_Mixer_System       *sys;
> -   const char           *card;
> +   const char           *sys_card_name;
>     const char           *channel_name;
>     int                   lock_sliders;
>     Eina_List            *cards;
> @@ -165,19 +165,14 @@
>  {
>     struct e_mixer_app_ui_channel_editor *ui = &app->ui.channel_editor;
>     E_Mixer_Channel_State state;
> -   const char *card_name;
>  
> -   card_name = e_mod_mixer_card_name_get(app->card);
> -
> -   if (!card_name)
> +   if ((!app->sys_card_name) || (!app->channel_name))
>       {
>          _disable_channel_editor(app);
>          return;
>       }
>  
> -   e_widget_entry_text_set(ui->card, card_name);
> -   eina_stringshare_del(card_name);
> -
> +   e_widget_entry_text_set(ui->card, app->sys_card_name);
>     e_widget_entry_text_set(ui->channel, app->channel_name);
>  
>     if (e_mod_mixer_channel_is_boost(app->channel_info))
> @@ -261,7 +256,7 @@
>     Eina_List *l;
>     Evas_Object *ilist;
>     int header_input;
> -   int i;
> +   int i, selected;
>  
>     ilist = app->ui.channels.list;
>     edje_freeze();
> @@ -270,18 +265,16 @@
>  
>     if (app->sys)
>       e_mod_mixer_del(app->sys);
> -   app->sys = e_mod_mixer_new(app->card);
> +   app->sys = e_mod_mixer_new(app->sys_card_name);
>     if (_mixer_using_default)
>       e_mixer_alsa_callback_set(app->sys, _cb_system_update, app);
>  
> -   eina_stringshare_del(app->channel_name);
> -   app->channel_name = e_mod_mixer_channel_default_name_get(app->sys);
> -
>     if (app->channel_infos)
>       e_mod_mixer_channel_infos_free(app->channel_infos);
>     app->channel_infos = e_mod_mixer_channel_infos_get(app->sys);
>  
>     i = 0;
> +   selected = 0;
>     header_input = 0;
>     for (l = app->channel_infos; l; l = l->next, i++)
>       {
> @@ -304,33 +297,29 @@
>          info->app = app;
>          e_widget_ilist_append(ilist, NULL, info->name, _cb_channel_selected,
>                                info, info->name);
> -        if (app->channel_name && info->name &&
> +        if ((selected == 0) && app->channel_name && info->name &&
>              (strcmp(app->channel_name, info->name) == 0))
>            {
>               e_widget_ilist_selected_set(ilist, i);
>               app->channel_info = info;
> +             selected = 1;
>            }
>       }
>  
> +   if ((selected == 0) && (i > 0))
> +     e_widget_ilist_selected_set(ilist, 0);
> +   else
> +     app->channel_name = NULL;
> +
>     e_widget_ilist_go(ilist);
>     e_widget_ilist_thaw(ilist);
>     edje_thaw();
>  }
>  
>  static void
> -select_card(E_Mixer_App_Dialog_Data *app)
> -{
> -   _populate_channels(app);
> -   if (e_widget_ilist_count(app->ui.channels.list) > 0)
> -     e_widget_ilist_selected_set(app->ui.channels.list, 1);
> -   else
> -     _disable_channel_editor(app);
> -}
> -
> -static void
>  _cb_card_selected(void *data)
>  {
> -   select_card(data);
> +   _populate_channels(data);
>  }
>  
>  static void
> @@ -340,12 +329,11 @@
>     const char *card;
>     Eina_List *l;
>  
> -   app->card = e_mod_mixer_card_default_get();
>     app->cards = e_mod_mixer_card_names_get();
>     if (eina_list_count(app->cards) < 2)
>       return;
>  
> -   ui->list = e_widget_ilist_add(evas, 32, 32, &app->card);
> +   ui->list = e_widget_ilist_add(evas, 32, 32, &app->sys_card_name);
>     e_widget_size_min_set(ui->list, 180, 100);
>     e_widget_ilist_go(ui->list);
>     EINA_LIST_FOREACH(app->cards, l, card)
> @@ -446,12 +434,6 @@
>     _create_channels(dialog, evas, app);
>     _create_channel_editor(dialog, evas, app);
>  
> -   if (ui->cards.list)
> -     e_widget_ilist_selected_set(ui->cards.list, 0);
> -   else
> -     select_card(app);
> -   e_widget_ilist_selected_set(ui->channels.list, 1);
> -
>     e_widget_size_min_get(ui->hlayout, &mw, &mh);
>     if (mw < 300)
>       mw = 300;
> @@ -466,8 +448,9 @@
>     if (app->del.func)
>       app->del.func(dialog, app->del.data);
>  
> -   eina_stringshare_del(app->card);
> -   eina_stringshare_del(app->channel_name);
> +   if ((!app->ui.cards.list) && (app->ui.channels.list))
> +     eina_stringshare_del(app->sys_card_name);
> +
>     if (app->cards)
>       e_mod_mixer_card_names_free(app->cards);
>     if (app->channel_infos)
> @@ -531,78 +514,48 @@
>     return dialog;
>  }
>  
> -static inline int
> -_find_card_by_name(E_Mixer_App_Dialog_Data *app, const char *card_name)
> -{
> -   Eina_List *l;
> -   int i;
> -
> -   if (!card_name)
> -     return 0;
> -
> -   for (i = 0, l = app->cards; l; i++, l = l->next)
> -     if (strcmp(card_name, l->data) == 0)
> -       return i;
> -
> -   return -1;
> -}
> -
> -static inline int
> -_find_channel_by_name(E_Mixer_App_Dialog_Data *app, const char *channel_name)
> -{
> -   E_Mixer_Channel_Info *info;
> -   Eina_List *l;
> -   int i = 0;
> -   int header_input;
> -
> -   if (!channel_name)
> -     return 0;
> -
> -   header_input = 0;
> -   EINA_LIST_FOREACH(app->channel_infos, l, info)
> -     {
> -        if (header_input != e_mod_mixer_channel_group_get(info))
> -          {
> -             header_input = e_mod_mixer_channel_group_get(info);
> -             i++;
> -          }
> -
> -        if (strcmp(channel_name, info->name) == 0)
> -          return i;
> -
> -        ++i;
> -     }
> -
> -   return -1;
> -}
> -
>  int
> -e_mixer_app_dialog_select(E_Dialog *dialog, const char *card_name, const
> char *channel_name) +e_mixer_app_dialog_select(E_Dialog *dialog, const char
> *sys_card_name, const char *channel_name) {
> +   int n, i;
> +   Eina_List *l;
>     E_Mixer_App_Dialog_Data *app;
> -   int n;
>  
>     if (!dialog)
>       return 0;
>  
> -   if ((!card_name) || (!channel_name))
> +   if ((!sys_card_name) || (!channel_name))
>       return 0;
>  
>     app = dialog->data;
>     if (!app)
>       return 0;
>  
> -   n = _find_card_by_name(app, card_name);
> +   n = -1;
> +   for (i = 0, l = app->cards; l; i++, l = l->next)
> +     {
> +        if (strcmp(sys_card_name, l->data) == 0)
> +          n = i;
> +          break;
> +     }
> +
>     if (n < 0)
> -     return 0;
> +     {
> +        /* FIXME device disappeared, very bad !! */
> +        return 0;
> +     }
> +
> +   /* app->channel_name will be overriden by selection in _populate_channels
> */
> +   app->channel_name = channel_name;
> +
>     if (app->ui.cards.list)
>       e_widget_ilist_selected_set(app->ui.cards.list, n);
> +   else if (app->ui.channels.list)
> +     {
> +        app->sys_card_name = eina_stringshare_add(sys_card_name);
> +        _populate_channels(app);
> +     }
>  
> -   n = _find_channel_by_name(app, channel_name);
> -   if (n < 0)
> -     return 0;
> -   e_widget_ilist_selected_set(app->ui.channels.list, n);
> -
>     return 1;
>  }
>  
> 
> Modified: trunk/e/src/modules/mixer/e_mod_main.c
> ===================================================================
> --- trunk/e/src/modules/mixer/e_mod_main.c    2013-02-15 15:47:41 UTC
> (rev 83958) +++ trunk/e/src/modules/mixer/e_mod_main.c        2013-02-15
> 16:53:04 UTC (rev 83959) @@ -619,7 +619,8 @@
>     ctxt = mixer_mod->data;
>     if (ctxt->mixer_dialog)
>       {
> -        _mixer_app_select_current(ctxt->mixer_dialog, inst);
> +        /* maybe not update mixer dialog current selection */
> +        /* _mixer_app_select_current(ctxt->mixer_dialog, inst); */
>          e_dialog_show(ctxt->mixer_dialog);
>          return;
>       }
> 
> 
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013 
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> enlightenment-svn mailing list
> enlightenment-...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    ras...@rasterman.com


------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to