git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1787 0c269be4-1314-0410-8aa9-9f06e86f4224tags/0.70
@@ -20,7 +20,8 @@ Tim Blechmann | |||||
2008-01-28 Stephane Letz <letz@grame.fr> | 2008-01-28 Stephane Letz <letz@grame.fr> | ||||
* Updated API to match jack 0.109.0 version (in progress). Correct checking thread in CoreAudio driver. | * Updated API to match jack 0.109.0 version (in progress). Correct checking thread in CoreAudio driver. | ||||
* Port connection callback. | |||||
* Port connection callback. | |||||
* Cleanup jack_port_connected_to implementation. | |||||
2008-01-25 Stephane Letz <letz@grame.fr> | 2008-01-25 Stephane Letz <letz@grame.fr> | ||||
@@ -338,21 +338,27 @@ EXPORT int jack_port_connected(const jack_port_t* port) | |||||
} | } | ||||
} | } | ||||
EXPORT int jack_port_connected_to(const jack_port_t* port, const char* portname) | |||||
EXPORT int jack_port_connected_to(const jack_port_t* port, const char* port_name) | |||||
{ | { | ||||
#ifdef __CLIENTDEBUG__ | #ifdef __CLIENTDEBUG__ | ||||
JackLibGlobals::CheckContext(); | JackLibGlobals::CheckContext(); | ||||
#endif | #endif | ||||
jack_port_id_t myport = (jack_port_id_t)port; | |||||
if (!CheckPort(myport)) { | |||||
jack_error("jack_port_connected_to called with an incorrect port %ld", myport); | |||||
jack_port_id_t src = (jack_port_id_t)port; | |||||
if (!CheckPort(src)) { | |||||
jack_error("jack_port_connected_to called with an incorrect port %ld", src); | |||||
return -1; | return -1; | ||||
} else if (portname == NULL) { | |||||
} else if (port_name == NULL) { | |||||
jack_error("jack_port_connected_to called with a NULL port name"); | jack_error("jack_port_connected_to called with a NULL port name"); | ||||
return -1; | return -1; | ||||
} else { | } else { | ||||
WaitGraphChange(); | WaitGraphChange(); | ||||
return GetGraphManager()->ConnectedTo(myport, portname); | |||||
jack_port_id_t dst = GetGraphManager()->GetPort(port_name); | |||||
if (dst == NO_PORT) { | |||||
jack_error("Unknown destination port port_name = %s", port_name); | |||||
return 0; | |||||
} else { | |||||
return GetGraphManager()->IsConnected(src, dst); | |||||
} | |||||
} | } | ||||
} | } | ||||
@@ -587,18 +587,10 @@ end: | |||||
} | } | ||||
// Client | // Client | ||||
int JackGraphManager::ConnectedTo(jack_port_id_t port_src, const char* port_name) | |||||
int JackGraphManager::IsConnected(jack_port_id_t port_src, jack_port_id_t port_dst) | |||||
{ | { | ||||
JackLog("JackGraphManager::ConnectedTo port_src = %ld port_name = %s\n", port_src, port_name); | |||||
JackConnectionManager* manager = ReadCurrentState(); | JackConnectionManager* manager = ReadCurrentState(); | ||||
jack_port_id_t port_dst; | |||||
if ((port_dst = GetPort(port_name)) == NO_PORT) { | |||||
jack_error("Unknown destination port port_name = %s", port_name); | |||||
return 0; | |||||
} else { | |||||
return manager->IsConnected(port_src, port_dst); | |||||
} | |||||
return manager->IsConnected(port_src, port_dst); | |||||
} | } | ||||
// Server | // Server | ||||
@@ -74,11 +74,11 @@ class JackGraphManager : public JackShmMem, public JackAtomicState<JackConnectio | |||||
// Connections management | // Connections management | ||||
int Connect(jack_port_id_t src_index, jack_port_id_t dst_index); | int Connect(jack_port_id_t src_index, jack_port_id_t dst_index); | ||||
int Disconnect(jack_port_id_t src_index, jack_port_id_t dst_index); | int Disconnect(jack_port_id_t src_index, jack_port_id_t dst_index); | ||||
int IsConnected(jack_port_id_t port_src, jack_port_id_t port_dst); | |||||
int GetConnectionsNum(jack_port_id_t port_index); | int GetConnectionsNum(jack_port_id_t port_index); | ||||
int ConnectedTo(jack_port_id_t port_src, const char* port_name); | |||||
const char** GetConnections(jack_port_id_t port_index); | const char** GetConnections(jack_port_id_t port_index); | ||||
void GetConnections(jack_port_id_t port_index, jack_int_t* connections); | |||||
void GetConnections(jack_port_id_t port_index, jack_int_t* connections); // TODO | |||||
const char** GetPorts(const char* port_name_pattern, const char* type_name_pattern, unsigned long flags); | const char** GetPorts(const char* port_name_pattern, const char* type_name_pattern, unsigned long flags); | ||||
int CheckPorts(const char* src, const char* dst, jack_port_id_t* src_index, jack_port_id_t* dst_index); | int CheckPorts(const char* src, const char* dst, jack_port_id_t* src_index, jack_port_id_t* dst_index); | ||||