From a7067557107fc2f01586a88bb8b0a097914798ea Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 17 Dec 2014 16:05:27 -0500 Subject: Fix various MIDI locking issues. Attempt to make mistakes much less likely in the future by statically requiring caller to pass scoped locks where necessary. --- libs/ardour/ardour/midi_model.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'libs/ardour/ardour/midi_model.h') diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h index 4d12839625..1988c1a2d1 100644 --- a/libs/ardour/ardour/midi_model.h +++ b/libs/ardour/ardour/midi_model.h @@ -238,10 +238,15 @@ public: void apply_command (Session& session, Command* cmd); void apply_command_as_subcommand (Session& session, Command* cmd); - bool sync_to_source (); - bool write_to(boost::shared_ptr source); - bool write_section_to (boost::shared_ptr source, Evoral::MusicalTime begin = Evoral::MinMusicalTime, - Evoral::MusicalTime end = Evoral::MaxMusicalTime); + bool sync_to_source (const Glib::Threads::Mutex::Lock& source_lock); + + bool write_to(boost::shared_ptr source, + const Glib::Threads::Mutex::Lock& source_lock); + + bool write_section_to(boost::shared_ptr source, + const Glib::Threads::Mutex::Lock& source_lock, + Evoral::MusicalTime begin = Evoral::MinMusicalTime, + Evoral::MusicalTime end = Evoral::MaxMusicalTime); // MidiModel doesn't use the normal AutomationList serialisation code // since controller data is stored in the .mid -- cgit v1.2.3