|
|
|
|
@@ -270,7 +270,10 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
|
|
|
|
|
|
|
|
|
|
MIDI::Name::MasterDeviceNames::Models::const_iterator m = patch_manager.all_models().begin();
|
|
|
|
|
for (; m != patch_manager.all_models().end(); ++m) {
|
|
|
|
|
_midnam_model_selector.append_text(m->c_str());
|
|
|
|
|
_midnam_model_selector.AddMenuElem(
|
|
|
|
|
Gtk::Menu_Helpers::MenuElem(m->c_str(),
|
|
|
|
|
sigc::bind(sigc::mem_fun(*this, &MidiTimeAxisView::model_changed),
|
|
|
|
|
m->c_str())));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (gui_property (X_("midnam-model-name")).empty()) {
|
|
|
|
|
@@ -285,9 +288,6 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_midnam_model_selector.set_active_text (gui_property (X_("midnam-model-name")));
|
|
|
|
|
_midnam_custom_device_mode_selector.set_active_text (gui_property (X_("midnam-custom-device-mode")));
|
|
|
|
|
|
|
|
|
|
ARDOUR_UI::instance()->set_tip (_midnam_model_selector, _("External MIDI Device"));
|
|
|
|
|
ARDOUR_UI::instance()->set_tip (_midnam_custom_device_mode_selector, _("External Device Mode"));
|
|
|
|
|
|
|
|
|
|
@@ -326,13 +326,8 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
|
|
|
|
|
_midi_controls_box.pack_start (_midnam_custom_device_mode_selector, false, false, 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model_changed();
|
|
|
|
|
custom_device_mode_changed();
|
|
|
|
|
|
|
|
|
|
_midnam_model_selector.signal_changed().connect(
|
|
|
|
|
sigc::mem_fun(*this, &MidiTimeAxisView::model_changed));
|
|
|
|
|
_midnam_custom_device_mode_selector.signal_changed().connect(
|
|
|
|
|
sigc::mem_fun(*this, &MidiTimeAxisView::custom_device_mode_changed));
|
|
|
|
|
model_changed(gui_property(X_("midnam-model-name")));
|
|
|
|
|
custom_device_mode_changed(gui_property(X_("midnam-custom-device-mode")));
|
|
|
|
|
|
|
|
|
|
controls_vbox.pack_start(_midi_controls_box, false, false);
|
|
|
|
|
|
|
|
|
|
@@ -419,26 +414,35 @@ MidiTimeAxisView::check_step_edit ()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MidiTimeAxisView::model_changed()
|
|
|
|
|
MidiTimeAxisView::model_changed(const std::string& model)
|
|
|
|
|
{
|
|
|
|
|
const Glib::ustring model = _midnam_model_selector.get_active_text();
|
|
|
|
|
set_gui_property (X_("midnam-model-name"), model);
|
|
|
|
|
|
|
|
|
|
const std::list<std::string> device_modes = MIDI::Name::MidiPatchManager::instance()
|
|
|
|
|
.custom_device_mode_names_by_model(model);
|
|
|
|
|
|
|
|
|
|
_midnam_model_selector.set_text(model);
|
|
|
|
|
_midnam_custom_device_mode_selector.clear_items();
|
|
|
|
|
|
|
|
|
|
for (std::list<std::string>::const_iterator i = device_modes.begin();
|
|
|
|
|
i != device_modes.end(); ++i) {
|
|
|
|
|
_midnam_custom_device_mode_selector.append_text(*i);
|
|
|
|
|
_midnam_custom_device_mode_selector.AddMenuElem(
|
|
|
|
|
Gtk::Menu_Helpers::MenuElem(
|
|
|
|
|
*i, sigc::bind(sigc::mem_fun(*this, &MidiTimeAxisView::custom_device_mode_changed),
|
|
|
|
|
*i)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_midnam_custom_device_mode_selector.set_active(0);
|
|
|
|
|
|
|
|
|
|
_route->instrument_info().set_external_instrument (
|
|
|
|
|
_midnam_model_selector.get_active_text(),
|
|
|
|
|
_midnam_custom_device_mode_selector.get_active_text());
|
|
|
|
|
if (!device_modes.empty()) {
|
|
|
|
|
custom_device_mode_changed(device_modes.front());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (device_modes.size() > 1) {
|
|
|
|
|
_midnam_custom_device_mode_selector.show();
|
|
|
|
|
} else {
|
|
|
|
|
_midnam_custom_device_mode_selector.hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_route->instrument_info().set_external_instrument (model, device_modes.front());
|
|
|
|
|
|
|
|
|
|
// Rebuild controller menu
|
|
|
|
|
_controller_menu_map.clear ();
|
|
|
|
|
@@ -448,12 +452,13 @@ MidiTimeAxisView::model_changed()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MidiTimeAxisView::custom_device_mode_changed()
|
|
|
|
|
MidiTimeAxisView::custom_device_mode_changed(const std::string& mode)
|
|
|
|
|
{
|
|
|
|
|
const Glib::ustring mode = _midnam_custom_device_mode_selector.get_active_text();
|
|
|
|
|
const std::string model = gui_property (X_("midnam-model-name"));
|
|
|
|
|
|
|
|
|
|
set_gui_property (X_("midnam-custom-device-mode"), mode);
|
|
|
|
|
_route->instrument_info().set_external_instrument (
|
|
|
|
|
_midnam_model_selector.get_active_text(), mode);
|
|
|
|
|
_midnam_custom_device_mode_selector.set_text(mode);
|
|
|
|
|
_route->instrument_info().set_external_instrument (model, mode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MidiStreamView*
|
|
|
|
|
@@ -1119,7 +1124,7 @@ MidiTimeAxisView::show_all_automation (bool apply_to_selection)
|
|
|
|
|
boost::shared_ptr<MasterDeviceNames> device_names = get_device_names();
|
|
|
|
|
if (gui_property (X_("midnam-model-name")) != "Generic" &&
|
|
|
|
|
device_names && !device_names->controls().empty()) {
|
|
|
|
|
const std::string device_mode = _midnam_custom_device_mode_selector.get_active_text();
|
|
|
|
|
const std::string device_mode = gui_property (X_("midnam-custom-device-mode"));
|
|
|
|
|
const uint16_t selected_channels = midi_track()->get_playback_channel_mask();
|
|
|
|
|
for (uint32_t chn = 0; chn < 16; ++chn) {
|
|
|
|
|
if ((selected_channels & (0x0001 << chn)) == 0) {
|
|
|
|
|
|