Browse Source

Merge JackGraphManager Remove and Release method in a unique Release method.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1437 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.63
sletz 18 years ago
parent
commit
b352efd13c
5 changed files with 19 additions and 16 deletions
  1. +4
    -0
      ChangeLog
  2. +3
    -3
      common/JackAudioDriver.cpp
  3. +1
    -2
      common/JackEngine.cpp
  4. +6
    -5
      common/JackGraphManager.cpp
  5. +5
    -6
      common/JackGraphManager.h

+ 4
- 0
ChangeLog View File

@@ -2,6 +2,10 @@
Jackdmp changes log Jackdmp changes log
--------------------------- ---------------------------


2007-04-01 Stephane Letz <letz@grame.fr>

* Merge JackGraphManager Remove and Release method in a unique Release method.

2007-03-04 Stephane Letz <letz@grame.fr> 2007-03-04 Stephane Letz <letz@grame.fr>


* Dmitry Baikov patch for JackGraphManager.cpp. * Dmitry Baikov patch for JackGraphManager.cpp.


+ 3
- 3
common/JackAudioDriver.cpp View File

@@ -122,13 +122,13 @@ int JackAudioDriver::Detach()
JackLog("JackAudioDriver::Detach\n"); JackLog("JackAudioDriver::Detach\n");


for (i = 0; i < fCaptureChannels; i++) { for (i = 0; i < fCaptureChannels; i++) {
fGraphManager->RemovePort(fClientControl->fRefNum, fCapturePortList[i]);
fGraphManager->ReleasePort(fClientControl->fRefNum, fCapturePortList[i]);
} }


for (i = 0; i < fPlaybackChannels; i++) { for (i = 0; i < fPlaybackChannels; i++) {
fGraphManager->RemovePort(fClientControl->fRefNum, fPlaybackPortList[i]);
fGraphManager->ReleasePort(fClientControl->fRefNum, fPlaybackPortList[i]);
if (fWithMonitorPorts) if (fWithMonitorPorts)
fGraphManager->RemovePort(fClientControl->fRefNum, fMonitorPortList[i]);
fGraphManager->ReleasePort(fClientControl->fRefNum, fMonitorPortList[i]);
} }


return 0; return 0;


+ 1
- 2
common/JackEngine.cpp View File

@@ -560,8 +560,7 @@ int JackEngine::PortUnRegister(int refnum, jack_port_id_t port_index)
JackLog("JackEngine::PortUnRegister ref = %ld port_index = %ld\n", refnum, port_index); JackLog("JackEngine::PortUnRegister ref = %ld port_index = %ld\n", refnum, port_index);
assert(fClientTable[refnum]); assert(fClientTable[refnum]);


if (fGraphManager->RemovePort(refnum, port_index) == 0) {
fGraphManager->ReleasePort(port_index);
if (fGraphManager->ReleasePort(refnum, port_index) == 0) {
NotifyPortRegistation(port_index, false); NotifyPortRegistation(port_index, false);
return 0; return 0;
} else { } else {


+ 6
- 5
common/JackGraphManager.cpp View File

@@ -310,14 +310,16 @@ jack_port_id_t JackGraphManager::AllocatePort(int refnum, const char* port_name,
} }


// Server // Server
/*
void JackGraphManager::ReleasePort(jack_port_id_t port_index) void JackGraphManager::ReleasePort(jack_port_id_t port_index)
{ {
JackPort* port = GetPort(port_index); JackPort* port = GetPort(port_index);
port->Release(); port->Release();
} }
*/


// Server // Server
int JackGraphManager::RemovePort(int refnum, jack_port_id_t port_index)
int JackGraphManager::ReleasePort(int refnum, jack_port_id_t port_index)
{ {
JackConnectionManager* manager = WriteNextStateStart(); JackConnectionManager* manager = WriteNextStateStart();
JackPort* port = GetPort(port_index); JackPort* port = GetPort(port_index);
@@ -331,6 +333,7 @@ int JackGraphManager::RemovePort(int refnum, jack_port_id_t port_index)
res = manager->RemoveInputPort(refnum, port_index); res = manager->RemoveInputPort(refnum, port_index);
} }


port->Release();
WriteNextStateStop(); WriteNextStateStop();
return res; return res;
} }
@@ -345,15 +348,13 @@ void JackGraphManager::RemoveAllPorts(int refnum)
// Warning : RemovePort shift port to left, thus we always remove the first port until the "input" table is empty // Warning : RemovePort shift port to left, thus we always remove the first port until the "input" table is empty
const jack_int_t* input = manager->GetInputPorts(refnum); const jack_int_t* input = manager->GetInputPorts(refnum);
while ((port_index = input[0]) != EMPTY) { while ((port_index = input[0]) != EMPTY) {
RemovePort(refnum, port_index);
ReleasePort(port_index);
ReleasePort(refnum, port_index);
} }


// Warning : RemovePort shift port to left, thus we always remove the first port until the "output" table is empty // Warning : RemovePort shift port to left, thus we always remove the first port until the "output" table is empty
const jack_int_t* output = manager->GetOutputPorts(refnum); const jack_int_t* output = manager->GetOutputPorts(refnum);
while ((port_index = output[0]) != EMPTY) { while ((port_index = output[0]) != EMPTY) {
RemovePort(refnum, port_index);
ReleasePort(port_index);
ReleasePort(refnum, port_index);
} }


WriteNextStateStop(); WriteNextStateStop();


+ 5
- 6
common/JackGraphManager.h View File

@@ -58,7 +58,10 @@ class JackGraphManager : public JackShmMem, public JackAtomicState<JackConnectio


// Ports management // Ports management
jack_port_id_t AllocatePort(int refnum, const char* port_name, JackPortFlags flags); jack_port_id_t AllocatePort(int refnum, const char* port_name, JackPortFlags flags);
void ReleasePort(jack_port_id_t port_index);
int ReleasePort(int refnum, jack_port_id_t port_index);
void RemoveAllPorts(int refnum);
void DisconnectAllPorts(int refnum);
JackPort* GetPort(jack_port_id_t index); JackPort* GetPort(jack_port_id_t index);
jack_port_id_t GetPort(const char* name); jack_port_id_t GetPort(const char* name);
jack_nframes_t GetTotalLatency(jack_port_id_t port_index); jack_nframes_t GetTotalLatency(jack_port_id_t port_index);
@@ -84,11 +87,7 @@ class JackGraphManager : public JackShmMem, public JackAtomicState<JackConnectio
bool IsDirectConnection(int ref1, int ref2); bool IsDirectConnection(int ref1, int ref2);
void DirectConnect(int ref1, int ref2); void DirectConnect(int ref1, int ref2);
void DirectDisconnect(int ref1, int ref2); void DirectDisconnect(int ref1, int ref2);

int RemovePort(int refnum, jack_port_id_t port_index);
void RemoveAllPorts(int refnum);
void DisconnectAllPorts(int refnum);
void Activate(int refnum); void Activate(int refnum);
void Deactivate(int refnum); void Deactivate(int refnum);




Loading…
Cancel
Save