From 799ec6a8f133c58a86e0173f4c50490ccc31a9c2 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 23 Dec 2019 10:26:33 -0700 Subject: use new method in MidiPatchManager to use MIDNAM data when setting a MidiTimeAxisView --- gtk2_ardour/midi_time_axis.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'gtk2_ardour/midi_time_axis.cc') diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 2b6827a5c4..888bf3ee02 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -274,12 +274,7 @@ MidiTimeAxisView::set_route (boost::shared_ptr rt) _midi_controls_box.set_homogeneous(false); _midi_controls_box.set_border_width (2); - MIDI::Name::MidiPatchManager::instance().PatchesChanged.connect (*this, invalidator (*this), - boost::bind (&MidiTimeAxisView::setup_midnam_patches, this), - gui_context()); - - setup_midnam_patches (); - update_patch_selector (); + MIDI::Name::MidiPatchManager::instance().maybe_use (*this, invalidator (*this), boost::bind (&MidiTimeAxisView::use_midnam_info, this), gui_context()); model_changed (gui_property(X_("midnam-model-name"))); custom_device_mode_changed (gui_property(X_("midnam-custom-device-mode"))); @@ -359,6 +354,15 @@ MidiTimeAxisView::check_step_edit () _step_editor->check_step_edit (); } + +void +MidiTimeAxisView::use_midnam_info () +{ + std::cerr << "Using MIDNAM info from " << pthread_name() << endl; + setup_midnam_patches (); + update_patch_selector (); +} + void MidiTimeAxisView::setup_midnam_patches () { -- cgit v1.2.3