X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fsession_event.h;h=8bb160b90e2abde07b308d7f9334028790043557;hb=79245a296b73c4ad49bc9b5a204cdda120e1ab90;hp=d4102a62eff2b779043e2ea548e092a02a8b7ab1;hpb=8648a8a13b04549362f14a0738947d997ef1abc7;p=ardour.git diff --git a/libs/ardour/ardour/session_event.h b/libs/ardour/ardour/session_event.h index d4102a62ef..8bb160b90e 100644 --- a/libs/ardour/ardour/session_event.h +++ b/libs/ardour/ardour/session_event.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -54,10 +54,12 @@ public: Audition, InputConfigurationChange, SetPlayAudioRange, + CancelPlayAudioRange, RealTimeOperation, AdjustPlaybackBuffering, AdjustCaptureBuffering, SetTimecodeTransmission, + Skip, /* only one of each of these events can be queued at any one time */ @@ -82,26 +84,28 @@ public: union { void* ptr; bool yes_or_no; - framepos_t target2_frame; + framepos_t target2_frame; Slave* slave; Route* route; }; union { bool second_yes_or_no; + double control_value; }; union { bool third_yes_or_no; }; - /* 4 members to handle a multi-group event handled in RT context */ + /* 5 members to handle a multi-group event handled in RT context */ typedef boost::function RTeventCallback; - boost::shared_ptr routes; /* apply to */ - boost::function rt_slot; /* what to call in RT context */ - RTeventCallback rt_return; /* called after rt_slot, with this event as an argument */ + boost::shared_ptr controls; /* apply to */ + boost::shared_ptr routes; /* apply to */ + boost::function rt_slot; /* what to call in RT context */ + RTeventCallback rt_return; /* called after rt_slot, with this event as an argument */ PBD::EventLoop* event_loop; std::list audio_range; @@ -109,16 +113,7 @@ public: boost::shared_ptr region; - SessionEvent (Type t, Action a, framepos_t when, framepos_t where, double spd, bool yn = false, bool yn2 = false, bool yn3 = false) - : type (t) - , action (a) - , action_frame (when) - , target_frame (where) - , speed (spd) - , yes_or_no (yn) - , second_yes_or_no (yn2) - , third_yes_or_no (yn3) - , event_loop (0) {} + SessionEvent (Type t, Action a, framepos_t when, framepos_t where, double spd, bool yn = false, bool yn2 = false, bool yn3 = false); void set_ptr (void* p) { ptr = p; @@ -139,11 +134,14 @@ public: void* operator new (size_t); void operator delete (void *ptr, size_t /*size*/); - static const framepos_t Immediate = 0; + static const framepos_t Immediate = -1; + static bool has_per_thread_pool (); static void create_per_thread_pool (const std::string& n, uint32_t nitems); static void init_event_pool (); + CrossThreadPool* event_pool() const { return own_pool; } + private: static PerThreadPool* pool; CrossThreadPool* own_pool; @@ -151,7 +149,7 @@ private: friend class Butler; }; -class LIBARDOUR_API SessionEventManager { +class SessionEventManager { public: SessionEventManager () : pending_events (2048), auto_loop_event(0), punch_out_event(0), punch_in_event(0) {} @@ -159,6 +157,7 @@ public: virtual void queue_event (SessionEvent *ev) = 0; void clear_events (SessionEvent::Type type); + void clear_events (SessionEvent::Type type, boost::function after); protected: RingBuffer pending_events;