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