Use AsyncMIDIPort API
This commit is contained in:
parent
eade673771
commit
f0d2327af0
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
#include "midi++/mmc.h"
|
#include "midi++/mmc.h"
|
||||||
|
|
||||||
|
#include "ardour/async_midi_port.h"
|
||||||
#include "ardour/audioengine.h"
|
#include "ardour/audioengine.h"
|
||||||
#include "ardour/auditioner.h"
|
#include "ardour/auditioner.h"
|
||||||
#include "ardour/bundle.h"
|
#include "ardour/bundle.h"
|
||||||
|
@ -490,16 +491,13 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtual keyboard */
|
/* virtual keyboard */
|
||||||
if ((type == DataType::MIDI || type == DataType::NIL)) {
|
if (!inputs && (type == DataType::MIDI || type == DataType::NIL)) {
|
||||||
|
boost::shared_ptr<ARDOUR::Port> ap = boost::dynamic_pointer_cast<ARDOUR::Port> (session->vkbd_output_port());
|
||||||
AudioEngine* ae = AudioEngine::instance();
|
AudioEngine* ae = AudioEngine::instance();
|
||||||
if (!inputs) {
|
|
||||||
boost::shared_ptr<Bundle> vm (new Bundle (_("Virtual MIDI"), inputs));
|
boost::shared_ptr<Bundle> vm (new Bundle (_("Virtual MIDI"), inputs));
|
||||||
vm->add_channel (
|
vm->add_channel (_("Virtual Keyboard"), DataType::MIDI, ae->make_port_name_non_relative (ap->name()));
|
||||||
_("Virtual Keyboard"), DataType::MIDI, ae->make_port_name_non_relative (session->vkbd_output_port()->name())
|
|
||||||
);
|
|
||||||
program->add_bundle (vm);
|
program->add_bundle (vm);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* our sync ports */
|
/* our sync ports */
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ VirtualKeyboardWindow::note_on_event_handler (int note)
|
||||||
ev[0] = (MIDI_CMD_NOTE_ON | channel);
|
ev[0] = (MIDI_CMD_NOTE_ON | channel);
|
||||||
ev[1] = note;
|
ev[1] = note;
|
||||||
ev[2] = _piano_velocity.get_value_as_int ();
|
ev[2] = _piano_velocity.get_value_as_int ();
|
||||||
boost::dynamic_pointer_cast<ARDOUR::AsyncMIDIPort>(_session->vkbd_output_port())->write (ev, 3, 0);
|
_session->vkbd_output_port()->write (ev, 3, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -107,5 +107,5 @@ VirtualKeyboardWindow::note_off_event_handler (int note)
|
||||||
ev[0] = (MIDI_CMD_NOTE_OFF | channel);
|
ev[0] = (MIDI_CMD_NOTE_OFF | channel);
|
||||||
ev[1] = note;
|
ev[1] = note;
|
||||||
ev[2] = 0;
|
ev[2] = 0;
|
||||||
boost::dynamic_pointer_cast<ARDOUR::AsyncMIDIPort>(_session->vkbd_output_port())->write (ev, 3, 0);
|
_session->vkbd_output_port()->write (ev, 3, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user