Browse Source

SaveConnections/RestoreConnections in NetDriver.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4453 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.8
sletz 14 years ago
parent
commit
d6b65585bf
3 changed files with 97 additions and 2 deletions
  1. +32
    -0
      ChangeLog
  2. +58
    -0
      common/JackNetDriver.cpp
  3. +7
    -2
      common/JackNetDriver.h

+ 32
- 0
ChangeLog View File

@@ -35,6 +35,38 @@ Chris Caudle
Jackdmp changes log
---------------------------

2011-06-10 Stephane Letz <letz@grame.fr>

* SaveConnections/RestoreConnections in NetDriver.

2011-06-09 Stephane Letz <letz@grame.fr>

* Correct NetJack2 connection handling

2011-05-27 Stephane Letz <letz@grame.fr>

* Correct rd_acquire in dbus code.

2011-05-16 Stephane Letz <letz@grame.fr>

* Correct OSX real-time thread setup.

2011-05-11 Stephane Letz <letz@grame.fr>

* Correct MIDI in NetJack2.

2011-05-05 Stephane Letz <letz@grame.fr>

* Libjacknet in progress.

2011-05-02 Stephane Letz <letz@grame.fr>

* Merge branch 'switch-master-port-registration-notifications : correct driver port registration.

2011-04-21 Stephane Letz <letz@grame.fr>

* CELT code for NetJack2.

2011-04-20 Stephane Letz <letz@grame.fr>

* Add XRun detection in PortAudio driver.


+ 58
- 0
common/JackNetDriver.cpp View File

@@ -121,6 +121,7 @@ namespace Jack
bool JackNetDriver::Initialize()
{
jack_log("JackNetDriver::Initialize()");
SaveConnections();
FreePorts();

//new loading, but existing socket, restart the driver
@@ -223,6 +224,8 @@ namespace Jack

//transport engine parametering
fEngineControl->fTransport.SetNetworkSync(fParams.fTransportSync);

RestoreConnections();
return true;
}

@@ -405,6 +408,61 @@ namespace Jack
return 0;
}

void JackNetDriver::SaveConnections()
{
const char** connections;
fConnections.clear();

for (int i = 0; i < fCaptureChannels; ++i) {
if (fCapturePortList[i] && (connections = fGraphManager->GetConnections(fCapturePortList[i])) != 0) {
for (int j = 0; connections[j]; j++) {
fConnections.push_back(make_pair(fGraphManager->GetPort(fCapturePortList[i])->GetName(), connections[j]));
jack_info("Save connection: %s %s", fGraphManager->GetPort(fCapturePortList[i])->GetName(), connections[j]);
}
free(connections);
}
}

for (int i = 0; i < fPlaybackChannels; ++i) {
if (fPlaybackPortList[i] && (connections = fGraphManager->GetConnections(fPlaybackPortList[i])) != 0) {
for (int j = 0; connections[j]; j++) {
fConnections.push_back(make_pair(connections[j], fGraphManager->GetPort(fPlaybackPortList[i])->GetName()));
jack_info("Save connection: %s %s", connections[j], fGraphManager->GetPort(fPlaybackPortList[i])->GetName());
}
free(connections);
}
}

for (int i = 0; i < fParams.fSendMidiChannels; ++i) {
if (fCapturePortList[i] && (connections = fGraphManager->GetConnections(fMidiCapturePortList[i])) != 0) {
for (int j = 0; connections[j]; j++) {
fConnections.push_back(make_pair(fGraphManager->GetPort(fMidiCapturePortList[i])->GetName(), connections[j]));
}
free(connections);
}
}

for (int i = 0; i < fParams.fReturnMidiChannels; ++i) {
if (fPlaybackPortList[i] && (connections = fGraphManager->GetConnections(fMidiPlaybackPortList[i])) != 0) {
for (int j = 0; connections[j]; j++) {
fConnections.push_back(make_pair(connections[j], fGraphManager->GetPort(fMidiPlaybackPortList[i])->GetName()));
}
free(connections);
}
}
}

void JackNetDriver::RestoreConnections()
{
list<pair<string, string> >::const_iterator it;

for (it = fConnections.begin(); it != fConnections.end(); it++) {
pair<string, string> connection = *it;
jack_info("Restore connection: %s %s", connection.first.c_str(), connection.second.c_str());
fEngine->PortConnect(fClientControl.fRefNum, connection.first.c_str(), connection.second.c_str());
}
}

JackMidiBuffer* JackNetDriver::GetMidiInputBuffer(int port_index)
{
return static_cast<JackMidiBuffer*>(fGraphManager->GetBuffer(fMidiCapturePortList[port_index], fEngineControl->fBufferSize));


+ 7
- 2
common/JackNetDriver.h View File

@@ -47,6 +47,8 @@ namespace Jack
int fLastTransportState;
int fLastTimebaseMaster;

std::list<std::pair<std::string, std::string> > fConnections; // Connections list

//monitoring
#ifdef JACK_MONITOR
JackGnuPlotMonitor<float>* fNetTimeMon;
@@ -63,8 +65,11 @@ namespace Jack
void EncodeTransportData();
void DecodeTransportData();

JackMidiBuffer* GetMidiInputBuffer ( int port_index );
JackMidiBuffer* GetMidiOutputBuffer ( int port_index );
JackMidiBuffer* GetMidiInputBuffer(int port_index);
JackMidiBuffer* GetMidiOutputBuffer(int port_index);

void SaveConnections();
void RestoreConnections();

public:



Loading…
Cancel
Save