summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/session_event.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/ardour/session_event.h')
-rw-r--r--libs/ardour/ardour/session_event.h206
1 files changed, 103 insertions, 103 deletions
diff --git a/libs/ardour/ardour/session_event.h b/libs/ardour/ardour/session_event.h
index 738de46a86..27f778b8ac 100644
--- a/libs/ardour/ardour/session_event.h
+++ b/libs/ardour/ardour/session_event.h
@@ -17,117 +17,117 @@ class Slave;
class Region;
struct SessionEvent {
- enum Type {
- SetTransportSpeed,
- SetTrackSpeed,
- Locate,
- LocateRoll,
- LocateRollLocate,
- SetLoop,
- PunchIn,
- PunchOut,
- RangeStop,
- RangeLocate,
- Overwrite,
- SetSyncSource,
- Audition,
- InputConfigurationChange,
- SetPlayAudioRange,
- RealTimeOperation,
- AdjustPlaybackBuffering,
- AdjustCaptureBuffering,
- SetTimecodeTransmission,
-
- /* only one of each of these events can be queued at any one time */
-
- StopOnce,
- AutoLoop
- };
-
- enum Action {
- Add,
- Remove,
- Replace,
- Clear
- };
-
- Type type;
- Action action;
- framepos_t action_frame;
- framepos_t target_frame;
- double speed;
-
- union {
- void* ptr;
- bool yes_or_no;
- framepos_t target2_frame;
- Slave* slave;
- Route* route;
- };
-
- union {
- bool second_yes_or_no;
- };
-
- /* 4 members to handle a multi-group event handled in RT context */
-
- typedef boost::function<void (SessionEvent*)> RTeventCallback;
-
- boost::shared_ptr<RouteList> routes; /* apply to */
- boost::function<void (void)> 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<AudioRange> audio_range;
- std::list<MusicRange> music_range;
-
- boost::shared_ptr<Region> region;
-
- SessionEvent (Type t, Action a, framepos_t when, framepos_t where, double spd, bool yn = false, bool yn2 = false)
- : type (t)
- , action (a)
- , action_frame (when)
- , target_frame (where)
- , speed (spd)
- , yes_or_no (yn)
- , second_yes_or_no (yn2)
- , event_loop (0) {}
-
- void set_ptr (void* p) {
- ptr = p;
- }
-
- bool before (const SessionEvent& other) const {
- return action_frame < other.action_frame;
- }
-
- bool after (const SessionEvent& other) const {
- return action_frame > other.action_frame;
- }
-
- static bool compare (const SessionEvent *e1, const SessionEvent *e2) {
- return e1->before (*e2);
- }
-
- void* operator new (size_t);
- void operator delete (void *ptr, size_t /*size*/);
-
- static const framepos_t Immediate = 0;
-
- static void create_per_thread_pool (const std::string& n, uint32_t nitems);
- static void init_event_pool ();
+ enum Type {
+ SetTransportSpeed,
+ SetTrackSpeed,
+ Locate,
+ LocateRoll,
+ LocateRollLocate,
+ SetLoop,
+ PunchIn,
+ PunchOut,
+ RangeStop,
+ RangeLocate,
+ Overwrite,
+ SetSyncSource,
+ Audition,
+ InputConfigurationChange,
+ SetPlayAudioRange,
+ RealTimeOperation,
+ AdjustPlaybackBuffering,
+ AdjustCaptureBuffering,
+ SetTimecodeTransmission,
+
+ /* only one of each of these events can be queued at any one time */
+
+ StopOnce,
+ AutoLoop
+ };
+
+ enum Action {
+ Add,
+ Remove,
+ Replace,
+ Clear
+ };
+
+ Type type;
+ Action action;
+ framepos_t action_frame;
+ framepos_t target_frame;
+ double speed;
+
+ union {
+ void* ptr;
+ bool yes_or_no;
+ framepos_t target2_frame;
+ Slave* slave;
+ Route* route;
+ };
+
+ union {
+ bool second_yes_or_no;
+ };
+
+ /* 4 members to handle a multi-group event handled in RT context */
+
+ typedef boost::function<void (SessionEvent*)> RTeventCallback;
+
+ boost::shared_ptr<RouteList> routes; /* apply to */
+ boost::function<void (void)> 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<AudioRange> audio_range;
+ std::list<MusicRange> music_range;
+
+ boost::shared_ptr<Region> region;
+
+ SessionEvent (Type t, Action a, framepos_t when, framepos_t where, double spd, bool yn = false, bool yn2 = false)
+ : type (t)
+ , action (a)
+ , action_frame (when)
+ , target_frame (where)
+ , speed (spd)
+ , yes_or_no (yn)
+ , second_yes_or_no (yn2)
+ , event_loop (0) {}
+
+ void set_ptr (void* p) {
+ ptr = p;
+ }
+
+ bool before (const SessionEvent& other) const {
+ return action_frame < other.action_frame;
+ }
+
+ bool after (const SessionEvent& other) const {
+ return action_frame > other.action_frame;
+ }
+
+ static bool compare (const SessionEvent *e1, const SessionEvent *e2) {
+ return e1->before (*e2);
+ }
+
+ void* operator new (size_t);
+ void operator delete (void *ptr, size_t /*size*/);
+
+ static const framepos_t Immediate = 0;
+
+ static void create_per_thread_pool (const std::string& n, uint32_t nitems);
+ static void init_event_pool ();
private:
- static PerThreadPool* pool;
- CrossThreadPool* own_pool;
+ static PerThreadPool* pool;
+ CrossThreadPool* own_pool;
- friend class Butler;
+ friend class Butler;
};
class SessionEventManager {
public:
SessionEventManager () : pending_events (2048),
- auto_loop_event(0), punch_out_event(0), punch_in_event(0) {}
+ auto_loop_event(0), punch_out_event(0), punch_in_event(0) {}
virtual ~SessionEventManager() {}
virtual void queue_event (SessionEvent *ev) = 0;