summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/soundmanager.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/soundmanager.c b/src/soundmanager.c
index cb2815d..9d72547 100644
--- a/src/soundmanager.c
+++ b/src/soundmanager.c
@@ -257,17 +257,16 @@ void getListMainConnections(struct afb_req request)
if(!SEND_RESULT(ec, request)) return;
/* create response */
- struct json_object *array_res = json_object_new_array();
+ struct json_object *response = json_object_new_object();
gsize size = g_variant_n_children(mainConnectionList);
AFB_DEBUG("mainConnectionList size is %u",(uint16_t)size);
- struct json_object *verb_obj = json_object_new_object();
- sm_add_object_to_json_object_func(verb_obj, __FUNCTION__, 0);
- json_object_array_add(array_res, verb_obj);
+ sm_add_object_to_json_object_func(response, __FUNCTION__, 0);
if(size <= 0)
{
AFB_NOTICE( "mainConnectionList size is 0");
}
else{
+ struct json_object *array_res = json_object_new_array();
for(int i = 0; i < size; ++i)
{
guint16 mcid, srcid, sinkid;
@@ -287,9 +286,10 @@ void getListMainConnections(struct afb_req request)
);
json_object_array_add(array_res,res_obj);
}
+ json_object_object_add(response, "connections", array_res);
}
- AFB_DEBUG("json object :%s:",json_object_to_json_string(array_res));
- afb_req_success(request, array_res, "Success to get main connection list");
+ AFB_DEBUG("json object :%s:",json_object_to_json_string(response));
+ afb_req_success(request, response, "Success to get main connection list");
}
void getListMainSources(struct afb_req request)
@@ -337,7 +337,7 @@ void getListMainSources(struct afb_req request)
json_object_array_add(array_res,res_obj);
g_variant_unref(child);
}
- json_object_object_add(response, "sinks", array_res);
+ json_object_object_add(response, "sources", array_res);
}
afb_req_success(request, response, "Success to get main source list");
g_variant_unref(mainSourceList);
@@ -1222,4 +1222,4 @@ int sm_init()
void onevent(const char *event, struct json_object *object)
{
AFB_NOTICE("on_event %s", event);
-} \ No newline at end of file
+}