daemon: get jack client pid on appear

This commit is contained in:
Nedko Arnaudov 2009-12-10 23:20:20 +02:00
parent dd46f403a9
commit bb854a8fd2
3 changed files with 21 additions and 0 deletions

View File

@ -58,9 +58,17 @@ static void client_appeared(void * context, uint64_t id, const char * name)
ladish_client_handle client;
const char * a2j_name;
bool is_a2j;
int64_t pid;
log_info("client_appeared(%"PRIu64", %s)", id, name);
if (!graph_proxy_get_client_pid(virtualizer_ptr->jack_graph_proxy, id, &pid))
{
pid = 0;
}
log_info("client pid is %"PRId64, pid);
a2j_name = a2j_proxy_get_jack_client_name_cached();
is_a2j = a2j_name != NULL && strcmp(a2j_name, name) == 0;

View File

@ -862,3 +862,14 @@ graph_proxy_dict_entry_drop(
return true;
}
bool graph_proxy_get_client_pid(graph_proxy_handle graph, uint64_t client_id, int64_t * pid_ptr)
{
if (!dbus_call(graph_ptr->service, graph_ptr->object, JACKDBUS_IFACE_PATCHBAY, "GetClientPID", "t", &client_id, "x", pid_ptr))
{
log_error("GetClientPID() failed.");
return false;
}
return true;
}

View File

@ -108,6 +108,8 @@ graph_proxy_dict_entry_drop(
uint64_t object_id,
const char * key);
bool graph_proxy_get_client_pid(graph_proxy_handle graph, uint64_t client_id, int64_t * pid_ptr);
#if 0
{ /* Adjust editor indent */
#endif