def _query_clients(self): self._clients = {} S.snd_seq_drop_output(self.client) cinfo = S.new_client_info() pinfo = S.new_port_info() S.snd_seq_client_info_set_client(cinfo, -1) # for each client while S.snd_seq_query_next_client(self.client, cinfo) >= 0: client = S.snd_seq_client_info_get_client(cinfo) cname = S.snd_seq_client_info_get_name(cinfo) cobj = self.Client(client, cname) self._clients[cname] = cobj # get port data S.snd_seq_port_info_set_client(pinfo, client) S.snd_seq_port_info_set_port(pinfo, -1) while (S.snd_seq_query_next_port(self.client, pinfo) >= 0): cap = S.snd_seq_port_info_get_capability(pinfo) client = S.snd_seq_port_info_get_client(pinfo) port = S.snd_seq_port_info_get_port(pinfo) pname = S.snd_seq_port_info_get_name(pinfo) cobj.add_port(port, pname, cap)