summaryrefslogtreecommitdiff
path: root/src/bin/sinks_view.c
diff options
context:
space:
mode:
authorFlavio Ceolin <flavio.ceolin@gmail.com>2014-03-24 14:39:17 -0300
committerFlavio Ceolin <flavio.ceolin@gmail.com>2014-04-03 16:23:19 -0300
commit4ac33e16ddb3efe95edffab6c67c7bbbd9ffe452 (patch)
treeba39d07e326be9dc5bd8c7e172adcde24f929f38 /src/bin/sinks_view.c
parent196cdb70b84958dd827797f86e78abd798e48cf7 (diff)
[epulse] Fixing the sink port changing
Diffstat (limited to '')
-rw-r--r--src/bin/sinks_view.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/bin/sinks_view.c b/src/bin/sinks_view.c
index 7ddea2c..57bca43 100644
--- a/src/bin/sinks_view.c
+++ b/src/bin/sinks_view.c
@@ -18,6 +18,7 @@ struct Sink
18struct Sink_Port 18struct Sink_Port
19{ 19{
20 char *name; 20 char *name;
21 char *description;
21 Eina_Bool active; 22 Eina_Bool active;
22}; 23};
23 24
@@ -54,6 +55,7 @@ _sink_add_cb(void *data, int type EINA_UNUSED, void *info)
54 { 55 {
55 sp = calloc(1, sizeof(struct Sink_Port)); 56 sp = calloc(1, sizeof(struct Sink_Port));
56 sp->name = strdup(port->name); 57 sp->name = strdup(port->name);
58 sp->description = strdup(port->description);
57 if (port->active) 59 if (port->active)
58 sp->active = EINA_TRUE; 60 sp->active = EINA_TRUE;
59 sink->ports = eina_list_append(sink->ports, sp); 61 sink->ports = eina_list_append(sink->ports, sp);
@@ -166,6 +168,7 @@ _item_del(void *data, Evas_Object *obj EINA_UNUSED)
166 EINA_LIST_FREE(sink->ports, port) 168 EINA_LIST_FREE(sink->ports, port)
167 { 169 {
168 free(port->name); 170 free(port->name);
171 free(port->description);
169 free(port); 172 free(port);
170 } 173 }
171 free(sink); 174 free(sink);
@@ -209,7 +212,7 @@ _port_selected_cb(void *data, Evas_Object *o,
209 if (!epulse_sink_port_set(sink->index, port->name)) 212 if (!epulse_sink_port_set(sink->index, port->name))
210 ERR("Could not change the port"); 213 ERR("Could not change the port");
211 else 214 else
212 elm_object_text_set(o, port->name); 215 elm_object_text_set(o, port->description);
213} 216}
214 217
215static Evas_Object * 218static Evas_Object *
@@ -256,10 +259,10 @@ _item_content_get(void *data, Evas_Object *obj, const char *part)
256 259
257 EINA_LIST_FOREACH(sink->ports, l, sp) 260 EINA_LIST_FOREACH(sink->ports, l, sp)
258 { 261 {
259 elm_hoversel_item_add(item, sp->name, NULL, 262 elm_hoversel_item_add(item, sp->description, NULL,
260 ELM_ICON_NONE, NULL, sp); 263 ELM_ICON_NONE, NULL, sp);
261 if (sp->active) 264 if (sp->active)
262 elm_object_text_set(item, sp->name); 265 elm_object_text_set(item, sp->description);
263 } 266 }
264 evas_object_smart_callback_add(item, "selected", 267 evas_object_smart_callback_add(item, "selected",
265 _port_selected_cb, sink); 268 _port_selected_cb, sink);