diff --git a/ChangeLog b/ChangeLog index fce364c5..c43d8a70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,8 @@ Fernando Lopez-Lezcano 2008-06-02 Stephane Letz * Cleanup and correct wscript for example-clients. + * Add a test for coherent freewheel state in JackDebugClient. + * Cleanup JackMutex class. 2008-05-31 Stephane Letz diff --git a/common/JackDebugClient.cpp b/common/JackDebugClient.cpp index f527c370..4b444ea6 100644 --- a/common/JackDebugClient.cpp +++ b/common/JackDebugClient.cpp @@ -41,6 +41,7 @@ JackDebugClient::JackDebugClient(JackClient * client) fIsDeactivated = 0; fIsClosed = 0; fClient = client; + fFreewheel = false; } JackDebugClient::~JackDebugClient() @@ -321,6 +322,11 @@ int JackDebugClient::SetBufferSize(jack_nframes_t buffer_size) int JackDebugClient::SetFreeWheel(int onoff) { CheckClient(); + if (onoff && fFreewheel) + *fStream << "!!! ERROR !!! : Freewheel setup seems incorrect : set = ON while FW is already ON " << endl; + if (!onoff && !fFreewheel) + *fStream << "!!! ERROR !!! : Freewheel setup seems incorrect : set = OFF while FW is already OFF " << endl; + fFreewheel = onoff; return fClient->SetFreeWheel(onoff); } diff --git a/common/JackDebugClient.h b/common/JackDebugClient.h index f70c130b..e4f937dd 100644 --- a/common/JackDebugClient.h +++ b/common/JackDebugClient.h @@ -58,6 +58,7 @@ class JackDebugClient : public JackClient int fIsActivated; int fIsDeactivated; int fIsClosed; + bool fFreewheel; char fClientName[JACK_CLIENT_NAME_SIZE + 1]; JackProcessCallback fProcessTimeCallback; void* fProcessTimeCallbackArg; diff --git a/common/JackMutex.h b/common/JackMutex.h index 53c31c79..d97d1dd0 100644 --- a/common/JackMutex.h +++ b/common/JackMutex.h @@ -54,7 +54,7 @@ class JackMutex // In recursive mode by default fMutex = CreateMutex(0, FALSE, 0); } - virtual ~JackMutex() + ~JackMutex() { CloseHandle(fMutex); } @@ -90,7 +90,7 @@ class JackMutex res = pthread_mutexattr_destroy(&mutex_attr); assert(res == 0); } - virtual ~JackMutex() + ~JackMutex() { pthread_mutex_destroy(&fMutex); } @@ -124,13 +124,15 @@ class JackLockAble JackMutex fMutex; - public: + protected: JackLockAble() {} - virtual ~JackLockAble() + ~JackLockAble() {} + public: + void Lock() { fMutex.Lock(); @@ -166,7 +168,7 @@ class JackLock fObj->Lock(); } - virtual ~JackLock() + ~JackLock() { fObj->Unlock(); } diff --git a/common/JackServer.cpp b/common/JackServer.cpp index 67ec4e56..9613f930 100644 --- a/common/JackServer.cpp +++ b/common/JackServer.cpp @@ -224,7 +224,7 @@ no graph state change can be done during freewheel mode. int JackServer::SetFreewheel(bool onoff) { - jack_log("JackServer::SetFreewheel state = %ld", onoff); + jack_log("JackServer::SetFreewheel is = %ld want = %ld", fFreewheel, onoff); if (fFreewheel) { if (onoff) { diff --git a/macosx/Jackdmp.xcodeproj/project.pbxproj b/macosx/Jackdmp.xcodeproj/project.pbxproj index e05da491..c740c640 100644 --- a/macosx/Jackdmp.xcodeproj/project.pbxproj +++ b/macosx/Jackdmp.xcodeproj/project.pbxproj @@ -1139,6 +1139,7 @@ 4BC2168D0A444BED00BDA09F /* JackServerGlobals.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JackServerGlobals.h; path = ../common/JackServerGlobals.h; sourceTree = SOURCE_ROOT; }; 4BC3988908B3CF6C00B6F371 /* JackDummyDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = JackDummyDriver.cpp; path = ../common/JackDummyDriver.cpp; sourceTree = SOURCE_ROOT; }; 4BC3988A08B3CF6C00B6F371 /* JackDummyDriver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JackDummyDriver.h; path = ../common/JackDummyDriver.h; sourceTree = SOURCE_ROOT; }; + 4BC8326D0DF42C7D00DD1C93 /* JackMutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JackMutex.h; path = ../common/JackMutex.h; sourceTree = SOURCE_ROOT; }; 4BCC87950D57168300A7FEB1 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; sourceTree = ""; }; 4BD4B4D409BACD9600750C0F /* JackTransportEngine.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JackTransportEngine.h; path = ../common/JackTransportEngine.h; sourceTree = SOURCE_ROOT; }; 4BD4B4D509BACD9600750C0F /* JackTransportEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = JackTransportEngine.cpp; path = ../common/JackTransportEngine.cpp; sourceTree = SOURCE_ROOT; }; @@ -1968,6 +1969,7 @@ 4BA3874007947A46008D8992 /* Synchro */ = { isa = PBXGroup; children = ( + 4BC8326D0DF42C7D00DD1C93 /* JackMutex.h */, 4B02069D0DC0BAB400319AF1 /* JackProcessSync.cpp */, 4BF8D1A70834EEB400C94B91 /* JackActivationCount.h */, 4BF8D1A80834EEB400C94B91 /* JackActivationCount.cpp */,