Browse Source

Tim Blechmann JackEngine cleanup patch.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2328 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.90
sletz 17 years ago
parent
commit
b004d83a3e
3 changed files with 38 additions and 38 deletions
  1. +1
    -0
      ChangeLog
  2. +35
    -36
      common/JackLockedEngine.h
  3. +2
    -2
      common/JackServer.cpp

+ 1
- 0
ChangeLog View File

@@ -23,6 +23,7 @@ Fernando Lopez-Lezcano
2008-05-23 Stephane Letz <letz@grame.fr> 2008-05-23 Stephane Letz <letz@grame.fr>


* Use StartSync to start the client notification thread, otherwise initial notifications from the server may be lost. * Use StartSync to start the client notification thread, otherwise initial notifications from the server may be lost.
* Tim Blechmann JackEngine cleanup patch.


2008-05-22 Stephane Letz <letz@grame.fr> 2008-05-22 Stephane Letz <letz@grame.fr>




+ 35
- 36
common/JackLockedEngine.h View File

@@ -34,174 +34,173 @@ class JackLockedEngine : public JackEngineInterface, public JackLockAble
{ {
private: private:


JackEngine* fEngine;
JackEngine fEngine;
public: public:


JackLockedEngine(JackEngine* engine):fEngine(engine)
JackLockedEngine(JackGraphManager* manager, JackSynchro** table, JackEngineControl* controler):
fEngine(manager, table, controler)
{} {}
virtual ~JackLockedEngine() virtual ~JackLockedEngine()
{
delete fEngine;
}
{}


int Open() int Open()
{ {
// No lock needed // No lock needed
return fEngine->Open();
return fEngine.Open();
} }
int Close() int Close()
{ {
// No lock needed // No lock needed
return fEngine->Close();
return fEngine.Close();
} }


// Client management // Client management
int ClientCheck(const char* name, char* name_res, int protocol, int options, int* status) int ClientCheck(const char* name, char* name_res, int protocol, int options, int* status)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->ClientCheck(name, name_res, protocol, options, status);
return fEngine.ClientCheck(name, name_res, protocol, options, status);
} }
int ClientExternalOpen(const char* name, int pid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager) int ClientExternalOpen(const char* name, int pid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->ClientExternalOpen(name, pid, ref, shared_engine, shared_client, shared_graph_manager);
return fEngine.ClientExternalOpen(name, pid, ref, shared_engine, shared_client, shared_graph_manager);
} }
int ClientInternalOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, bool wait) int ClientInternalOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, bool wait)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->ClientInternalOpen(name, ref, shared_engine, shared_manager, client, wait);
return fEngine.ClientInternalOpen(name, ref, shared_engine, shared_manager, client, wait);
} }


int ClientExternalClose(int refnum) int ClientExternalClose(int refnum)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->ClientExternalClose(refnum);
return fEngine.ClientExternalClose(refnum);
} }
int ClientInternalClose(int refnum, bool wait) int ClientInternalClose(int refnum, bool wait)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->ClientInternalClose(refnum, wait);
return fEngine.ClientInternalClose(refnum, wait);
} }


int ClientActivate(int refnum, bool state) int ClientActivate(int refnum, bool state)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->ClientActivate(refnum, state);
return fEngine.ClientActivate(refnum, state);
} }
int ClientDeactivate(int refnum) int ClientDeactivate(int refnum)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->ClientDeactivate(refnum);
return fEngine.ClientDeactivate(refnum);
} }


// Internal client management // Internal client management
int GetInternalClientName(int int_ref, char* name_res) int GetInternalClientName(int int_ref, char* name_res)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->GetInternalClientName(int_ref, name_res);
return fEngine.GetInternalClientName(int_ref, name_res);
} }
int InternalClientHandle(const char* client_name, int* status, int* int_ref) int InternalClientHandle(const char* client_name, int* status, int* int_ref)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->InternalClientHandle(client_name, status, int_ref);
return fEngine.InternalClientHandle(client_name, status, int_ref);
} }
int InternalClientUnload(int refnum, int* status) int InternalClientUnload(int refnum, int* status)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->InternalClientUnload(refnum, status);
return fEngine.InternalClientUnload(refnum, status);
} }


// Port management // Port management
int PortRegister(int refnum, const char* name, const char *type, unsigned int flags, unsigned int buffer_size, unsigned int* port) int PortRegister(int refnum, const char* name, const char *type, unsigned int flags, unsigned int buffer_size, unsigned int* port)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->PortRegister(refnum, name, type, flags, buffer_size, port);
return fEngine.PortRegister(refnum, name, type, flags, buffer_size, port);
} }
int PortUnRegister(int refnum, jack_port_id_t port) int PortUnRegister(int refnum, jack_port_id_t port)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->PortUnRegister(refnum, port);
return fEngine.PortUnRegister(refnum, port);
} }


int PortConnect(int refnum, const char* src, const char* dst) int PortConnect(int refnum, const char* src, const char* dst)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->PortConnect(refnum, src, dst);
return fEngine.PortConnect(refnum, src, dst);
} }
int PortDisconnect(int refnum, const char* src, const char* dst) int PortDisconnect(int refnum, const char* src, const char* dst)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->PortDisconnect(refnum, src, dst);
return fEngine.PortDisconnect(refnum, src, dst);
} }


int PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst) int PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->PortConnect(refnum, src, dst);
return fEngine.PortConnect(refnum, src, dst);
} }
int PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst) int PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->PortDisconnect(refnum, src, dst);
return fEngine.PortDisconnect(refnum, src, dst);
} }


// Graph // Graph
bool Process(jack_time_t callback_usecs) bool Process(jack_time_t callback_usecs)
{ {
// RT : no lock // RT : no lock
return fEngine->Process(callback_usecs);
return fEngine.Process(callback_usecs);
} }


// Notifications // Notifications
void NotifyXRun(jack_time_t callback_usecs, float delayed_usecs) void NotifyXRun(jack_time_t callback_usecs, float delayed_usecs)
{ {
// RT : no lock // RT : no lock
fEngine->NotifyXRun(callback_usecs, delayed_usecs);
fEngine.NotifyXRun(callback_usecs, delayed_usecs);
} }


void NotifyXRun(int refnum) void NotifyXRun(int refnum)
{ {
JackLock lock(this); JackLock lock(this);
fEngine->NotifyXRun(refnum);
fEngine.NotifyXRun(refnum);
} }
void NotifyGraphReorder() void NotifyGraphReorder()
{ {
JackLock lock(this); JackLock lock(this);
fEngine->NotifyGraphReorder();
fEngine.NotifyGraphReorder();
} }
void NotifyBufferSize(jack_nframes_t nframes) void NotifyBufferSize(jack_nframes_t nframes)
{ {
JackLock lock(this); JackLock lock(this);
fEngine->NotifyBufferSize(nframes);
fEngine.NotifyBufferSize(nframes);
} }
void NotifyFreewheel(bool onoff) void NotifyFreewheel(bool onoff)
{ {
JackLock lock(this); JackLock lock(this);
fEngine->NotifyFreewheel(onoff);
fEngine.NotifyFreewheel(onoff);
} }
void NotifyPortRegistation(jack_port_id_t port_index, bool onoff) void NotifyPortRegistation(jack_port_id_t port_index, bool onoff)
{ {
JackLock lock(this); JackLock lock(this);
fEngine->NotifyPortRegistation(port_index, onoff);
fEngine.NotifyPortRegistation(port_index, onoff);
} }
void NotifyPortConnect(jack_port_id_t src, jack_port_id_t dst, bool onoff) void NotifyPortConnect(jack_port_id_t src, jack_port_id_t dst, bool onoff)
{ {
JackLock lock(this); JackLock lock(this);
fEngine->NotifyPortConnect(src, dst, onoff);
fEngine.NotifyPortConnect(src, dst, onoff);
} }
void NotifyActivate(int refnum) void NotifyActivate(int refnum)
{ {
JackLock lock(this); JackLock lock(this);
fEngine->NotifyActivate(refnum);
fEngine.NotifyActivate(refnum);
} }
int GetClientPID(const char* name) int GetClientPID(const char* name)
{ {
JackLock lock(this); JackLock lock(this);
return fEngine->GetClientPID(name);
return fEngine.GetClientPID(name);
} }
}; };






+ 2
- 2
common/JackServer.cpp View File

@@ -49,7 +49,7 @@ JackServer::JackServer(bool sync, bool temporary, long timeout, bool rt, long pr
fSynchroTable[i] = JackGlobals::MakeSynchro(); fSynchroTable[i] = JackGlobals::MakeSynchro();
fGraphManager = new JackGraphManager(); fGraphManager = new JackGraphManager();
fEngineControl = new JackEngineControl(sync, temporary, timeout, rt, priority, verbose, server_name); fEngineControl = new JackEngineControl(sync, temporary, timeout, rt, priority, verbose, server_name);
fEngine = new JackLockedEngine(new JackEngine(fGraphManager, fSynchroTable, fEngineControl));
fEngine = new JackLockedEngine(fGraphManager, fSynchroTable, fEngineControl);
fFreewheelDriver = new JackThreadedDriver(new JackFreewheelDriver(fEngine, fSynchroTable)); fFreewheelDriver = new JackThreadedDriver(new JackFreewheelDriver(fEngine, fSynchroTable));
fLoopbackDriver = new JackLoopbackDriver(fEngine, fSynchroTable); fLoopbackDriver = new JackLoopbackDriver(fEngine, fSynchroTable);
fChannel = JackGlobals::MakeServerChannel(); fChannel = JackGlobals::MakeServerChannel();
@@ -303,7 +303,7 @@ JackGraphManager* JackServer::GetGraphManager()
{ {
return fGraphManager; return fGraphManager;
} }


} // end of namespace } // end of namespace



Loading…
Cancel
Save