diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2019-12-23 10:26:05 -0700 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2019-12-23 10:27:00 -0700 |
commit | 61aeb05f2ee244a2af2c5656fe73391f1209b138 (patch) | |
tree | e5e4431b4b2c347ddfc85f3b6acdce3e05666ad5 /libs/ardour/ardour | |
parent | 63ba8da3e12ab6a1a1a0118fbffceb3881b26a85 (diff) |
add a mechanism to use existing MIDNAM info and connect to PatchesChanged in future, atomically
The atomically is with respect to the initial thread-based MIDNAM loading
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/midi_patch_manager.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/ardour/ardour/midi_patch_manager.h b/libs/ardour/ardour/midi_patch_manager.h index b450fac2ea..1e1d262439 100644 --- a/libs/ardour/ardour/midi_patch_manager.h +++ b/libs/ardour/ardour/midi_patch_manager.h @@ -23,8 +23,11 @@ #ifndef MIDI_PATCH_MANAGER_H_ #define MIDI_PATCH_MANAGER_H_ +#include <glibmm/threads.h> + #include "midi++/midnam_patch.h" +#include "pbd/event_loop.h" #include "pbd/signals.h" #include "pbd/search_path.h" @@ -147,7 +150,10 @@ public: const DeviceNamesByMaker& devices_by_manufacturer() const { return _devices_by_manufacturer; } void load_midnams_in_thread (); - + void maybe_use (PBD::ScopedConnectionList& clist, + PBD::EventLoop::InvalidationRecord* ir, + const boost::function<void()>& slot, + PBD::EventLoop* event_loop); private: bool load_midi_name_document(const std::string& file_path); bool add_midi_name_document(boost::shared_ptr<MIDINameDocument>); @@ -164,6 +170,7 @@ private: DeviceNamesByMaker _devices_by_manufacturer; MasterDeviceNames::Models _all_models; + Glib::Threads::Mutex _lock; bool no_patch_changed_messages; pthread_t _midnam_load_thread; static void* _midnam_load (void *); @@ -175,4 +182,3 @@ private: } // namespace MIDI #endif /* MIDI_PATCH_MANAGER_H_ */ - |