summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavio Ceolin <flavio.ceolin@gmail.com>2014-09-07 18:52:33 -0300
committerFlavio Ceolin <flavio.ceolin@gmail.com>2014-09-07 18:52:33 -0300
commit2a722f6f23e57f9ef53ccfc5bca3e1b3fa613c58 (patch)
treec936e44a9ec8ac8e87333f969df350d23a7d8dc3
parent5b761f05d47e235756e83163a1880173e647cd2a (diff)
emixer: Fix port changes
-rw-r--r--src/bin/sinks_view.c16
-rw-r--r--src/lib/backends/pulseaudio/pulse.c4
2 files changed, 17 insertions, 3 deletions
diff --git a/src/bin/sinks_view.c b/src/bin/sinks_view.c
index f5a7f70..f5f7f67 100644
--- a/src/bin/sinks_view.c
+++ b/src/bin/sinks_view.c
@@ -16,7 +16,6 @@ struct Sinks_View
16 Ecore_Event_Handler *sink_removed; 16 Ecore_Event_Handler *sink_removed;
17}; 17};
18 18
19
20static Eina_Bool 19static Eina_Bool
21_disconnected_cb(void *data, int type EINA_UNUSED, void *info EINA_UNUSED) 20_disconnected_cb(void *data, int type EINA_UNUSED, void *info EINA_UNUSED)
22{ 21{
@@ -75,6 +74,21 @@ _sink_changed_cb(void *data, int type EINA_UNUSED, void *info)
75 it = elm_object_item_part_content_get(item, "mute"); 74 it = elm_object_item_part_content_get(item, "mute");
76 if (it) 75 if (it)
77 elm_check_state_set(it, sink->mute); 76 elm_check_state_set(it, sink->mute);
77
78 it = elm_object_item_part_content_get(item, "hover");
79 if (it)
80 {
81 Eina_List *l;
82 Emix_Port *sp;
83 elm_hoversel_clear(it);
84 EINA_LIST_FOREACH(sink->ports, l, sp)
85 {
86 elm_hoversel_item_add(it, sp->description, NULL,
87 ELM_ICON_NONE, NULL, sp);
88 if (sp->active)
89 elm_object_text_set(it, sp->description);
90 }
91 }
78 break; 92 break;
79 } 93 }
80 item = elm_genlist_item_next_get(item); 94 item = elm_genlist_item_next_get(item);
diff --git a/src/lib/backends/pulseaudio/pulse.c b/src/lib/backends/pulseaudio/pulse.c
index 9ec269e..1ef0dc4 100644
--- a/src/lib/backends/pulseaudio/pulse.c
+++ b/src/lib/backends/pulseaudio/pulse.c
@@ -232,8 +232,7 @@ _sink_changed_cb(pa_context *c EINA_UNUSED, const pa_sink_info *info, int eol,
232 } 232 }
233 233
234 port->available = !!info->ports[i]->available; 234 port->available = !!info->ports[i]->available;
235 port->name = eina_stringshare_add(info->ports[i]->description ?: 235 port->name = eina_stringshare_add(info->ports[i]->name);
236 info->ports[i]->name);
237 port->description = eina_stringshare_add(info->ports[i]->description); 236 port->description = eina_stringshare_add(info->ports[i]->description);
238 sink->base.ports = eina_list_append(sink->base.ports, port); 237 sink->base.ports = eina_list_append(sink->base.ports, port);
239 if (info->ports[i]->name == info->active_port->name) 238 if (info->ports[i]->name == info->active_port->name)
@@ -983,6 +982,7 @@ _sink_port_set(Emix_Sink *sink, const Emix_Port *port)
983 ERR("pa_context_set_source_port_by_index() failed"); 982 ERR("pa_context_set_source_port_by_index() failed");
984 return EINA_FALSE; 983 return EINA_FALSE;
985 } 984 }
985 pa_operation_unref(o);
986 986
987 return EINA_TRUE; 987 return EINA_TRUE;
988} 988}