#include "pbd/stacktrace.h"
#include "pbd/unknown_type.h"
-#include "midi++/jack.h"
+#include "midi++/port.h"
+#include "midi++/mmc.h"
+#include "midi++/manager.h"
#include "ardour/amp.h"
#include "ardour/audio_port.h"
SessionEvent::create_per_thread_pool (X_("Audioengine"), 512);
- MIDI::JACK_MidiPort::set_process_thread (pthread_self());
+ MIDI::Port::set_process_thread (pthread_self());
}
typedef void (*_JackInfoShutdownCallback)(jack_status_t code, const char* reason, void *arg);
} else {
jack_deactivate (_priv_jack);
Stopped(); /* EMIT SIGNAL */
- MIDI::JACK_MidiPort::JackHalted (); /* EMIT SIGNAL */
+ MIDI::Port::JackHalted (); /* EMIT SIGNAL */
}
}
if (was_running) {
ae->Halted(""); /* EMIT SIGNAL */
- MIDI::JACK_MidiPort::JackHalted (); /* EMIT SIGNAL */
+ MIDI::Port::JackHalted (); /* EMIT SIGNAL */
}
}
{
GET_PRIVATE_JACK_POINTER_RET (_jack,0);
const char ** ports;
- uint32_t i = 0;
+ uint32_t cnt = 0;
if ((ports = jack_get_ports (_priv_jack, NULL, type.to_jack_type(), JackPortIsPhysical|JackPortIsInput)) == 0) {
return 0;
}
- for (i = 0; ports[i]; ++i) {}
+ for (uint32_t i = 0; ports[i]; ++i) {
+ if (!strstr (ports[i], "Midi-Through")) {
+ cnt++;
+ }
+ }
+
free (ports);
- return i;
+ return cnt;
}
uint32_t
{
GET_PRIVATE_JACK_POINTER_RET (_jack,0);
const char ** ports;
- uint32_t i = 0;
-
+ uint32_t cnt = 0;
+
if ((ports = jack_get_ports (_priv_jack, NULL, type.to_jack_type(), JackPortIsPhysical|JackPortIsOutput)) == 0) {
return 0;
}
- for (i = 0; ports[i]; ++i) {}
+ for (uint32_t i = 0; ports[i]; ++i) {
+ if (!strstr (ports[i], "Midi-Through")) {
+ cnt++;
+ }
+ }
+
free (ports);
- return i;
+ return cnt;
}
void
if (ports) {
for (uint32_t i = 0; ports[i]; ++i) {
+ if (strstr (ports[i], "Midi-Through")) {
+ continue;
+ }
ins.push_back (ports[i]);
}
free (ports);
}
for (i = 0; ports[i]; ++i) {
+ if (strstr (ports[i], "Midi-Through")) {
+ continue;
+ }
outs.push_back (ports[i]);
}
free (ports);
GET_PRIVATE_JACK_POINTER_RET (_jack,"");
const char ** ports;
uint32_t i;
+ uint32_t idx;
string ret;
assert(type != DataType::NIL);
return ret;
}
- for (i = 0; i < n && ports[i]; ++i) {}
+ for (i = 0, idx = 0; idx < n && ports[i]; ++i) {
+ if (!strstr (ports[i], "Midi-Through")) {
+ ++idx;
+ }
+ }
- if (ports[i]) {
- ret = ports[i];
+ if (ports[idx]) {
+ ret = ports[idx];
}
free ((const char **) ports);
if (_running) {
_running = false;
Stopped(); /* EMIT SIGNAL */
- MIDI::JACK_MidiPort::JackHalted (); /* EMIT SIGNAL */
+ MIDI::Port::JackHalted (); /* EMIT SIGNAL */
}
return 0;
GET_PRIVATE_JACK_POINTER_RET (_jack,-1);
+ MIDI::Manager::instance()->reestablish (_priv_jack);
+
if (_session) {
_session->reset_jack_connection (_priv_jack);
jack_bufsize_callback (jack_get_buffer_size (_priv_jack));
(*i)->reconnect ();
}
+ MIDI::Manager::instance()->reconnect ();
+
Running (); /* EMIT SIGNAL*/
start_metering_thread ();