git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1524 0c269be4-1314-0410-8aa9-9f06e86f4224tags/0.65
@@ -4,10 +4,14 @@ | |||||
2007-08-21 Stephane Letz <letz@grame.fr> | 2007-08-21 Stephane Letz <letz@grame.fr> | ||||
* Automatic server launch. Removes unneeded 'volatile' for JackTransportEngine::fWriteCounter. | |||||
* Fix backend port alias management (renaming in system:xxx). | |||||
2007-08-20 Stephane Letz <letz@grame.fr> | 2007-08-20 Stephane Letz <letz@grame.fr> | ||||
* Automatic server launch. Removes unneeded 'volatile' for JackTransportEngine::fWriteCounter. | |||||
2007-08-19 Stephane Letz <letz@grame.fr> | |||||
* Add "systemic" latencies management in CoreAudio driver. | * Add "systemic" latencies management in CoreAudio driver. | ||||
2007-08-16 Stephane Letz <letz@grame.fr> | 2007-08-16 Stephane Letz <letz@grame.fr> | ||||
@@ -78,7 +78,7 @@ int JackAudioDriver::Attach() | |||||
{ | { | ||||
JackPort* port; | JackPort* port; | ||||
jack_port_id_t port_index; | jack_port_id_t port_index; | ||||
char buf[JACK_PORT_NAME_SIZE]; | |||||
char buf[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE]; | |||||
unsigned long port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal; | unsigned long port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal; | ||||
int i; | int i; | ||||
@@ -224,6 +224,27 @@ int JackAudioDriver::ProcessSync() | |||||
return 0; | 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) | void JackAudioDriver::NotifyXRun(jack_time_t callback_usecs) | ||||
{ | { | ||||
fEngine->NotifyXRun(callback_usecs); | fEngine->NotifyXRun(callback_usecs); | ||||
@@ -55,6 +55,8 @@ class EXPORT JackAudioDriver : public JackDriver | |||||
int ProcessAsync(); | int ProcessAsync(); | ||||
int ProcessSync(); | int ProcessSync(); | ||||
void RenamePorts(); | |||||
public: | public: | ||||
@@ -65,9 +65,12 @@ class EXPORT JackDriverInterface | |||||
virtual int Attach() = 0; | virtual int Attach() = 0; | ||||
virtual int Detach() = 0; | virtual int Detach() = 0; | ||||
virtual void RenamePorts() = 0; | |||||
virtual int Read() = 0; | virtual int Read() = 0; | ||||
virtual int Write() = 0; | virtual int Write() = 0; | ||||
virtual int Start() = 0; | virtual int Start() = 0; | ||||
virtual int Stop() = 0; | virtual int Stop() = 0; | ||||
virtual int SetBufferSize(jack_nframes_t buffer_size) = 0; | virtual int SetBufferSize(jack_nframes_t buffer_size) = 0; | ||||
@@ -44,8 +44,11 @@ class JackFreewheelDriver : public JackDriver | |||||
{ | { | ||||
return false; | return false; | ||||
} | } | ||||
int Process(); | |||||
void RenamePorts() | |||||
{} | |||||
int Process(); | |||||
}; | }; | ||||
} // end of namespace | } // end of namespace | ||||
@@ -52,6 +52,8 @@ void JackPort::Release() | |||||
fLocked = false; | fLocked = false; | ||||
fLatency = 0; | fLatency = 0; | ||||
fTied = NO_PORT; | fTied = NO_PORT; | ||||
fAlias1[0] = '\0'; | |||||
fAlias2[0] = '\0'; | |||||
} | } | ||||
bool JackPort::IsUsed() const | bool JackPort::IsUsed() const | ||||
@@ -184,6 +186,13 @@ int JackPort::SetName(const char* new_name) | |||||
return 0; | return 0; | ||||
} | } | ||||
int JackPort::SetFullName(const char* new_name) | |||||
{ | |||||
assert(strlen(new_name) < JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE); | |||||
strcpy(fName, new_name); | |||||
return 0; | |||||
} | |||||
bool JackPort::NameEquals(const char* target) | bool JackPort::NameEquals(const char* target) | ||||
{ | { | ||||
return (strcmp(fName, target) == 0 | return (strcmp(fName, target) == 0 | ||||
@@ -78,6 +78,7 @@ class JackPort | |||||
const char* GetName() const; | const char* GetName() const; | ||||
const char* GetShortName() const; | const char* GetShortName() const; | ||||
int SetName(const char* name); | int SetName(const char* name); | ||||
int SetFullName(const char* new_name); | |||||
int GetAliases(char* const aliases[2]); | int GetAliases(char* const aliases[2]); | ||||
int SetAlias(const char* alias); | int SetAlias(const char* alias); | ||||
@@ -122,6 +122,8 @@ int JackServer::Open(jack_driver_desc_t* driver_desc, JSList* driver_params) | |||||
jack_error("Cannot attach audio driver"); | jack_error("Cannot attach audio driver"); | ||||
return -1; | return -1; | ||||
} | } | ||||
fAudioDriver->RenamePorts(); | |||||
if (fLoopback > 0 && fLoopbackDriver->Attach() != 0) { | if (fLoopback > 0 && fLoopbackDriver->Attach() != 0) { | ||||
jack_error("Cannot attach loopback driver"); | jack_error("Cannot attach loopback driver"); | ||||
@@ -82,6 +82,11 @@ class JackThreadedDriver : public JackDriverClientInterface, public JackRunnable | |||||
{ | { | ||||
return fDriver->Detach(); | return fDriver->Detach(); | ||||
} | } | ||||
virtual void RenamePorts() | |||||
{ | |||||
fDriver->RenamePorts(); | |||||
} | |||||
virtual int Read() | virtual int Read() | ||||
{ | { | ||||
@@ -2074,7 +2074,7 @@ int JackAlsaDriver::Attach() | |||||
int port_index; | int port_index; | ||||
unsigned long port_flags; | unsigned long port_flags; | ||||
char buf[JACK_PORT_NAME_SIZE]; | |||||
char buf[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE]; | |||||
port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal; | port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal; | ||||
@@ -800,7 +800,7 @@ int JackCoreAudioDriver::Attach() | |||||
UInt32 size; | UInt32 size; | ||||
Boolean isWritable; | Boolean isWritable; | ||||
char channel_name[64]; | char channel_name[64]; | ||||
char buf[JACK_PORT_NAME_SIZE]; | |||||
char buf[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE]; | |||||
unsigned long port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal; | unsigned long port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal; | ||||
JackLog("JackCoreAudioDriver::Attach fBufferSize %ld fSampleRate %ld\n", fEngineControl->fBufferSize, fEngineControl->fSampleRate); | JackLog("JackCoreAudioDriver::Attach fBufferSize %ld fSampleRate %ld\n", fEngineControl->fBufferSize, fEngineControl->fSampleRate); | ||||