Browse Source

Poor man's no-self-connect code

(cherry picked from commit d160dd3c67)
tags/v1.9.10
Nedko Arnaudov 16 years ago
parent
commit
5d3c8acafb
2 changed files with 11 additions and 3 deletions
  1. +10
    -3
      common/JackLibClient.cpp
  2. +1
    -0
      common/JackLibClient.h

+ 10
- 3
common/JackLibClient.cpp View File

@@ -209,7 +209,7 @@ JackLibClient::NoSelfConnectCheck(const char* src, const char* dst)
// 2 means client is connecting its own ports (i.e. for app internal functionality)
// TODO: Make this check an engine option and more tweakable (return error or success)
// MAYBE: make the engine option changable on the fly and expose it through client or control API
if (src_self + dst_self == 1)
if (src_self + dst_self != 0)
{
jack_info("ignoring self hook to other client ports ('%s': '%s' -> '%s')", client_name_ptr, src, dst);
return 0;
@@ -223,7 +223,7 @@ int JackLibClient::PortConnect(const char* src, const char* dst)
{
int ret;

//jack_info("Client connecting '%s' to '%s'");
//jack_info("Client connecting '%s' to '%s'", src, dst);

ret = NoSelfConnectCheck(src, dst);
if (ret > 0)
@@ -238,7 +238,7 @@ int JackLibClient::PortDisconnect(const char* src, const char* dst)
{
int ret;

//jack_info("Client disconnecting '%s' to '%s'");
//jack_info("Client disconnecting '%s' to '%s'", src, dst);

ret = NoSelfConnectCheck(src, dst);
if (ret > 0)
@@ -249,6 +249,13 @@ int JackLibClient::PortDisconnect(const char* src, const char* dst)
return ret;
}

int JackLibClient::PortDisconnect(jack_port_id_t src)
{
jack_info("Ignoring port disconnect request");

return 0;
}

} // end of namespace




+ 1
- 0
common/JackLibClient.h View File

@@ -55,6 +55,7 @@ class JackLibClient : public JackClient
int NoSelfConnectCheck(const char* src, const char* dst);
virtual int PortConnect(const char* src, const char* dst);
virtual int PortDisconnect(const char* src, const char* dst);
virtual int PortDisconnect(jack_port_id_t src);
};




Loading…
Cancel
Save