Commit c970e7e0 authored by sletz's avatar sletz
Browse files

JackLoopbackDriver reborn as a dynamicalled loadable separated backend.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3605 0c269be4-1314-0410-8aa9-9f06e86f4224
parent bfecb007
......@@ -25,15 +25,19 @@ Paul Davis
Jackdmp changes log
---------------------------
2009-07-17 Stephane Letz <letz@grame.fr>
* JackLoopbackDriver reborn as a dynamicalled loadable separated backend.
2009-07-17 Stephane Letz <letz@grame.fr>
* Big rewrite of Solaris boomer driver, seems to work in duplex mode at least.
2009-07-17 Stephane Letz <letz@grame.fr>
2009-07-16 Stephane Letz <letz@grame.fr>
* In combined --dbus and --classic compilation code, use PulseAudio acquire/release code.
2009-07-16 Stephane Letz <letz@grame.fr>
2009-07-15 Stephane Letz <letz@grame.fr>
* Rename JackDriver::Init method to JackDriver::Initialize (to avoid confusion with JackThread::Init method).
* Update Solaris boomer driver.
......
......@@ -19,7 +19,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "JackSystemDeps.h"
#include "JackServerGlobals.h"
#include "JackLoopbackDriver.h"
#include "JackDriverLoader.h"
#include "JackEngineControl.h"
#include "JackGraphManager.h"
#include "JackError.h"
......@@ -31,8 +33,6 @@ namespace Jack
int JackLoopbackDriver::Process()
{
assert(fCaptureChannels == fPlaybackChannels);
// Loopback copy
for (int i = 0; i < fCaptureChannels; i++) {
memcpy(GetInputBuffer(i), GetOutputBuffer(i), sizeof(float) * fEngineControl->fBufferSize);
......@@ -40,7 +40,7 @@ int JackLoopbackDriver::Process()
fGraphManager->ResumeRefNum(&fClientControl, fSynchroTable); // Signal all clients
if (fEngineControl->fSyncMode) {
if (fGraphManager->SuspendRefNum(&fClientControl, fSynchroTable, fEngineControl->fTimeOutUsecs) < 0) {
if (fGraphManager->SuspendRefNum(&fClientControl, fSynchroTable, DRIVER_TIMEOUT_FACTOR * fEngineControl->fTimeOutUsecs) < 0) {
jack_error("JackLoopbackDriver::ProcessSync SuspendRefNum error");
return -1;
}
......@@ -49,3 +49,66 @@ int JackLoopbackDriver::Process()
}
} // end of namespace
#ifdef __cplusplus
extern "C"
{
#endif
SERVER_EXPORT jack_driver_desc_t * driver_get_descriptor()
{
jack_driver_desc_t * desc;
unsigned int i;
desc = (jack_driver_desc_t*)calloc (1, sizeof (jack_driver_desc_t));
strcpy(desc->name, "loopback"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy(desc->desc, "Loppback backend"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1
desc->nparams = 1;
desc->params = (jack_driver_param_desc_t*)calloc (desc->nparams, sizeof (jack_driver_param_desc_t));
i = 0;
strcpy(desc->params[i].name, "channels");
desc->params[i].character = 'c';
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.ui = 0;
strcpy(desc->params[i].short_desc, "Loopback ports");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
return desc;
}
SERVER_EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine* engine, Jack::JackSynchro* table, const JSList* params)
{
const JSList * node;
const jack_driver_param_t * param;
int channels = 2;
for (node = params; node; node = jack_slist_next (node)) {
param = (const jack_driver_param_t *) node->data;
switch (param->character) {
case 'c':
channels = param->value.ui;
break;
}
}
Jack::JackDriverClientInterface* driver = new Jack::JackLoopbackDriver(engine, table);
if (driver->Open(Jack::JackServerGlobals::fInstance->GetEngineControl()->fBufferSize,
Jack::JackServerGlobals::fInstance->GetEngineControl()->fSampleRate,
1, 1,
channels, channels,
false,
"loopback", "loopback", 0, 0) == 0) {
return driver;
} else {
delete driver;
return NULL;
}
}
#ifdef __cplusplus
}
#endif
......@@ -58,6 +58,8 @@ def build(bld):
create_jack_driver_obj(bld, 'dummy', '../common/JackDummyDriver.cpp')
create_jack_driver_obj(bld, 'loopback', '../common/JackLoopbackDriver.cpp')
create_jack_audio_driver_obj(bld, 'coreaudio', 'coreaudio/JackCoreAudioDriver.cpp')
create_jack_midi_driver_obj(bld, 'coremidi', 'coremidi/JackCoreMidiDriver.cpp')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment