Commit a48fea3c authored by Stephane Letz's avatar Stephane Letz
Browse files

Correct JackWinMMEDriver and JackALSARawMidiDriver creation.

parent e24717e3
......@@ -624,6 +624,9 @@ JackALSARawMidiDriver::Write()
#ifdef __cplusplus
extern "C" {
#endif
// singleton kind of driver
static Jack::JackALSARawMidiDriver* driver = NULL;
SERVER_EXPORT jack_driver_desc_t *
driver_get_descriptor()
......@@ -639,14 +642,19 @@ extern "C" {
driver_initialize(Jack::JackLockedEngine *engine, Jack::JackSynchro *table,
const JSList *params)
{
Jack::JackDriverClientInterface *driver =
new Jack::JackALSARawMidiDriver("system_midi", "alsarawmidi",
engine, table);
if (driver->Open(0, 0, 1, 1, 0, 0, false, "midi in", "midi out", 0, 0)) {
delete driver;
driver = 0;
// singleton kind of driver
if (!driver) {
driver = new Jack::JackALSARawMidiDriver("system_midi", "alsarawmidi", engine, table);
if (driver->Open(1, 1, 0, 0, false, "midi in", "midi out", 0, 0) == 0) {
return driver;
} else {
delete driver;
return NULL;
}
} else {
jack_info("JackALSARawMidiDriver already allocated, cannot be loaded twice");
return NULL;
}
return driver;
}
#ifdef __cplusplus
......
......@@ -359,7 +359,7 @@ extern "C"
#endif
// singleton kind of driver
static Jack::JackDriverClientInterface* driver = NULL;
static Jack::JackWinMMEDriver* driver = NULL;
SERVER_EXPORT jack_driver_desc_t * driver_get_descriptor()
{
......@@ -411,7 +411,7 @@ extern "C"
// singleton kind of driver
if (!driver) {
driver = new Jack::JackWinMMEDriver("system_midi", "winmme", engine, table);
if (driver->Open(0, 0, 1, 1, 0, 0, false, "in", "out", 0, 0) == 0) {
if (driver->Open(1, 1, 0, 0, false, "in", "out", 0, 0) == 0) {
return driver;
} else {
delete driver;
......
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