expand SessionEvent API to allow ::clear_events() to work correctly.
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 5 Feb 2015 21:20:09 +0000 (16:20 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 5 Feb 2015 21:32:21 +0000 (16:32 -0500)
commit6790f8342aa9dd0897336b420f7bc19d40884f55
tree671efbd96f7e7849e090214fc96f0e2a899e8c7f
parent4010884a5b898e79c32984a9355c37ad0a01a67b
expand SessionEvent API to allow ::clear_events() to work correctly.

clear_events() must run in realtime context, which is likely to be asynchronous
with respect to the thread that calls it. So allow caller to pass in a functor
that will be executed (also in realtime context) after the clear is done.

Additionally, allow for a cross-thread callback to the event loop/thread which
initiated/allocated the clear event request so that it can flush its own pending
loop. This part probably isn't necessary but doesn't hurt and is a useful model.
The event would be placed back in the free list at the next event allocation
by the calling thread anyway.
libs/ardour/ardour/session_event.h
libs/ardour/session_events.cc