Cleanup JackEngine::PortRename.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2860 0c269be4-1314-0410-8aa9-9f06e86f4224
This commit is contained in:
sletz 2008-09-01 20:31:45 +00:00
parent f9d1d6b708
commit 7a635969f8
6 changed files with 24 additions and 16 deletions

View File

@ -833,12 +833,9 @@ int JackEngine::PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t ds
int JackEngine::PortRename(int refnum, jack_port_id_t port, const char* name)
{
if (fGraphManager->GetPort(port)->SetName(name) == 0) {
NotifyPortRename(port);
return 0;
} else {
return -1;
}
fGraphManager->GetPort(port)->SetName(name);
NotifyPortRename(port);
return 0;
}
} // end of namespace

View File

@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <stdio.h>
#include <assert.h>
namespace Jack
{
@ -193,12 +192,11 @@ const char* JackPort::GetType() const
return type->name;
}
int JackPort::SetName(const char* new_name)
void JackPort::SetName(const char* new_name)
{
char* colon = strchr(fName, ':');
int len = sizeof(fName) - ((int) (colon - fName)) - 2;
snprintf(colon + 1, len, "%s", new_name);
return 0;
}
bool JackPort::NameEquals(const char* target)

View File

@ -80,7 +80,7 @@ class EXPORT JackPort
void Release();
const char* GetName() const;
const char* GetShortName() const;
int SetName(const char* name);
void SetName(const char* name);
int GetAliases(char* const aliases[2]);
int SetAlias(const char* alias);

View File

@ -263,7 +263,8 @@ void JackPosixThread::Terminate()
} // end of namespace
EXPORT bool jack_tls_allocate_key(jack_tls_key *key_ptr)
//EXPORT bool jack_tls_allocate_key(jack_tls_key *key_ptr)
bool jack_tls_allocate_key(jack_tls_key *key_ptr)
{
int ret;
@ -277,7 +278,8 @@ EXPORT bool jack_tls_allocate_key(jack_tls_key *key_ptr)
return true;
}
EXPORT bool jack_tls_free_key(jack_tls_key key)
//EXPORT bool jack_tls_free_key(jack_tls_key key)
bool jack_tls_free_key(jack_tls_key key)
{
int ret;
@ -291,7 +293,8 @@ EXPORT bool jack_tls_free_key(jack_tls_key key)
return true;
}
EXPORT bool jack_tls_set(jack_tls_key key, void *data_ptr)
//EXPORT bool jack_tls_set(jack_tls_key key, void *data_ptr)
bool jack_tls_set(jack_tls_key key, void *data_ptr)
{
int ret;
@ -305,7 +308,8 @@ EXPORT bool jack_tls_set(jack_tls_key key, void *data_ptr)
return true;
}
EXPORT void *jack_tls_get(jack_tls_key key)
//EXPORT void *jack_tls_get(jack_tls_key key)
void *jack_tls_get(jack_tls_key key)
{
return pthread_getspecific(key);
}

View File

@ -110,10 +110,19 @@ typedef DWORD jack_tls_key;
typedef pthread_key_t jack_tls_key;
#endif
/*
EXPORT bool jack_tls_allocate_key(jack_tls_key *key_ptr);
EXPORT bool jack_tls_free_key(jack_tls_key key);
EXPORT bool jack_tls_set(jack_tls_key key, void *data_ptr);
EXPORT void *jack_tls_get(jack_tls_key key);
*/
bool jack_tls_allocate_key(jack_tls_key *key_ptr);
bool jack_tls_free_key(jack_tls_key key);
bool jack_tls_set(jack_tls_key key, void *data_ptr);
void *jack_tls_get(jack_tls_key key);
#endif

View File

@ -1267,7 +1267,7 @@
4B3F49070AD8503300491C6E /* jack_cpu.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = jack_cpu.c; path = ../tests/jack_cpu.c; sourceTree = SOURCE_ROOT; };
4B4259E5076B635E00C1ECE1 /* JackMacEngineRPC.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JackMacEngineRPC.cpp; sourceTree = SOURCE_ROOT; };
4B44FAE50C7598370033A72C /* JackServerLaunch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = JackServerLaunch.cpp; path = ../common/JackServerLaunch.cpp; sourceTree = SOURCE_ROOT; };
4B464301076CAC7700E5077C /* Jack-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "Jack-Info.plist"; sourceTree = SOURCE_ROOT; };
4B464301076CAC7700E5077C /* Jack-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Jack-Info.plist"; sourceTree = SOURCE_ROOT; };
4B4CA9730E02CF9600F4BFDA /* JackRestartThreadedDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JackRestartThreadedDriver.h; path = ../common/JackRestartThreadedDriver.h; sourceTree = SOURCE_ROOT; };
4B4CA9740E02CF9600F4BFDA /* JackRestartThreadedDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackRestartThreadedDriver.cpp; path = ../common/JackRestartThreadedDriver.cpp; sourceTree = SOURCE_ROOT; };
4B4E9AF80E5F1090000A3278 /* JackControlAPI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackControlAPI.cpp; path = ../common/JackControlAPI.cpp; sourceTree = SOURCE_ROOT; };
@ -1383,7 +1383,7 @@
4BD6240C0CBCF16600DE782F /* inprocess.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = inprocess.c; path = "../example-clients/inprocess.c"; sourceTree = SOURCE_ROOT; };
4BE4CBFF0CDA153400CCF5BB /* JackTools.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = JackTools.cpp; path = ../common/JackTools.cpp; sourceTree = SOURCE_ROOT; };
4BE4CC000CDA153400CCF5BB /* JackTools.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JackTools.h; path = ../common/JackTools.h; sourceTree = SOURCE_ROOT; };
4BE50F8F0B01EE8000C05E63 /* Jackwrapper-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Jackwrapper-Info.plist"; sourceTree = "<group>"; };
4BE50F8F0B01EE8000C05E63 /* Jackwrapper-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Jackwrapper-Info.plist"; sourceTree = "<group>"; };
4BE6C6A30A3E096F005A203A /* jack_test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jack_test; sourceTree = BUILT_PRODUCTS_DIR; };
4BE6C6AC0A3E0A65005A203A /* jack_test.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = jack_test.cpp; path = ../tests/jack_test.cpp; sourceTree = SOURCE_ROOT; };
4BE99D300AD7A04800C59091 /* jack_cpu */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jack_cpu; sourceTree = BUILT_PRODUCTS_DIR; };