Browse Source

Make Rename a method of JackPort class, call it from driver Attach method.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1535 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.65
sletz 17 years ago
parent
commit
1231a5d893
11 changed files with 18 additions and 46 deletions
  1. +4
    -0
      ChangeLog
  2. +4
    -23
      common/JackAudioDriver.cpp
  3. +0
    -2
      common/JackAudioDriver.h
  4. +1
    -3
      common/JackDriver.h
  5. +0
    -3
      common/JackFreewheelDriver.h
  6. +1
    -1
      common/JackGraphManager.h
  7. +3
    -4
      common/JackPort.cpp
  8. +1
    -1
      common/JackPort.h
  9. +0
    -2
      common/JackServer.cpp
  10. +1
    -6
      common/JackThreadedDriver.h
  11. +3
    -1
      macosx/JackCoreAudioDriver.cpp

+ 4
- 0
ChangeLog View File

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

2007-08-26 Stephane Letz <letz@grame.fr>
* Make "Rename" a method of JackPort class, call it from driver Attach method.

2007-08-24 Stephane Letz <letz@grame.fr>
* Implement server temporary (-T) mode.


+ 4
- 23
common/JackAudioDriver.cpp View File

@@ -90,7 +90,8 @@ int JackAudioDriver::Attach()
jack_error("driver: cannot register port for %s", buf);
return -1;
}
port = fGraphManager->GetPort(port_index);
port = fGraphManager->GetPort(port_index);
port->Rename("system:capture_%d", i + 1);
port->SetLatency(fEngineControl->fBufferSize + fCaptureLatency);
fCapturePortList[i] = port_index;
JackLog("JackAudioDriver::Attach fCapturePortList[i] %ld = \n", port_index);
@@ -104,7 +105,8 @@ int JackAudioDriver::Attach()
jack_error("driver: cannot register port for %s", buf);
return -1;
}
port = fGraphManager->GetPort(port_index);
port = fGraphManager->GetPort(port_index);
port->Rename("system:playback_%d", i + 1);
port->SetLatency(fEngineControl->fBufferSize + fPlaybackLatency);
fPlaybackPortList[i] = port_index;
JackLog("JackAudioDriver::Attach fPlaybackPortList[i] %ld = \n", port_index);
@@ -224,27 +226,6 @@ int JackAudioDriver::ProcessSync()
return 0;
}

void JackAudioDriver::RenamePorts()
{
JackPort* port;
char buf[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
int i;
for (i = 0; i < fCaptureChannels; i++) {
port = fGraphManager->GetPort(fCapturePortList[i]);
port->SetAlias(port->GetName());
snprintf(buf, sizeof(buf) - 1, "system:capture_%d", i + 1);
port->SetFullName(buf);
}

for (i = 0; i < fPlaybackChannels; i++) {
port = fGraphManager->GetPort(fPlaybackPortList[i]);
port->SetAlias(port->GetName());
snprintf(buf, sizeof(buf) - 1, "system:playback_%d", i + 1);
port->SetFullName(buf);
}
}

void JackAudioDriver::NotifyXRun(jack_time_t callback_usecs)
{
fEngine->NotifyXRun(callback_usecs);


+ 0
- 2
common/JackAudioDriver.h View File

@@ -55,8 +55,6 @@ class EXPORT JackAudioDriver : public JackDriver

int ProcessAsync();
int ProcessSync();
void RenamePorts();

public:



+ 1
- 3
common/JackDriver.h View File

@@ -65,9 +65,7 @@ class EXPORT JackDriverInterface

virtual int Attach() = 0;
virtual int Detach() = 0;
virtual void RenamePorts() = 0;

virtual int Read() = 0;
virtual int Write() = 0;


+ 0
- 3
common/JackFreewheelDriver.h View File

@@ -45,9 +45,6 @@ class JackFreewheelDriver : public JackDriver
return false;
}
void RenamePorts()
{}
int Process();
};



+ 1
- 1
common/JackGraphManager.h View File

@@ -59,7 +59,7 @@ class JackGraphManager : public JackShmMem, public JackAtomicState<JackConnectio
// Ports management
jack_port_id_t AllocatePort(int refnum, const char* port_name, JackPortFlags flags);
int ReleasePort(int refnum, jack_port_id_t port_index);
void RemoveAllPorts(int refnum);
void RemoveAllPorts(int refnum);
void DisconnectAllPorts(int refnum);
JackPort* GetPort(jack_port_id_t index);


+ 3
- 4
common/JackPort.cpp View File

@@ -187,11 +187,10 @@ int JackPort::SetName(const char* new_name)
return 0;
}

int JackPort::SetFullName(const char* new_name)
void JackPort::Rename(const char* name, int index)
{
assert(strlen(new_name) < JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE);
strcpy(fName, new_name);
return 0;
SetAlias(GetName());
snprintf(fName, sizeof(fName) - 1, name, index);
}

bool JackPort::NameEquals(const char* target)


+ 1
- 1
common/JackPort.h View File

@@ -78,7 +78,7 @@ class JackPort
const char* GetName() const;
const char* GetShortName() const;
int SetName(const char* name);
int SetFullName(const char* new_name);
void Rename(const char* name, int index);
int GetAliases(char* const aliases[2]);
int SetAlias(const char* alias);


+ 0
- 2
common/JackServer.cpp View File

@@ -123,8 +123,6 @@ int JackServer::Open(jack_driver_desc_t* driver_desc, JSList* driver_params)
return -1;
}
fAudioDriver->RenamePorts();

if (fLoopback > 0 && fLoopbackDriver->Attach() != 0) {
jack_error("Cannot attach loopback driver");
return -1;


+ 1
- 6
common/JackThreadedDriver.h View File

@@ -83,12 +83,7 @@ class JackThreadedDriver : public JackDriverClientInterface, public JackRunnable
return fDriver->Detach();
}
virtual void RenamePorts()
{
fDriver->RenamePorts();
}

virtual int Read()
virtual int Read()
{
return fDriver->Read();
}


+ 3
- 1
macosx/JackCoreAudioDriver.cpp View File

@@ -835,6 +835,7 @@ int JackCoreAudioDriver::Attach()
JackLog("AudioDeviceGetProperty kAudioDevicePropertySafetyOffset error \n");
port = fGraphManager->GetPort(port_index);
port->Rename("system:capture_%d", i + 1);
port->SetLatency(fEngineControl->fBufferSize + value1 + value2 + fCaptureLatency);
fCapturePortList[i] = port_index;
}
@@ -870,7 +871,8 @@ int JackCoreAudioDriver::Attach()
if (err != noErr)
JackLog("AudioDeviceGetProperty kAudioDevicePropertySafetyOffset error \n");

port = fGraphManager->GetPort(port_index);
port = fGraphManager->GetPort(port_index);
port->Rename("system:playback_%d", i + 1);
port->SetLatency(fEngineControl->fBufferSize + value1 + value2 + fPlaybackLatency);
fPlaybackPortList[i] = port_index;



Loading…
Cancel
Save