comparison base/EventSeries.h @ 1656:e4084bc60fe8 single-point

Test & fixes for getEventsStartingAt
author Chris Cannam
date Wed, 20 Mar 2019 14:58:56 +0000
parents 26aa42fd60e9
children 69ab62d378bf
comparison
equal deleted inserted replaced
1655:0cfb882155a6 1656:e4084bc60fe8
91 */ 91 */
92 EventVector getEventsSpanning(sv_frame_t frame, 92 EventVector getEventsSpanning(sv_frame_t frame,
93 sv_frame_t duration) const; 93 sv_frame_t duration) const;
94 94
95 /** 95 /**
96 * Retrieve all events that cover the given frame. An event without
97 * duration covers a frame if its own frame is equal to it. An event
98 * with duration covers a frame if its start frame is less than or
99 * equal to it and its end frame (start + duration) is greater
100 * than it.
101 */
102 EventVector getEventsCovering(sv_frame_t frame) const;
103
104 /**
96 * Retrieve all events falling wholly within the range in frames 105 * Retrieve all events falling wholly within the range in frames
97 * defined by the given frame f and duration d. 106 * defined by the given frame f and duration d.
98 * 107 *
99 * - An event without duration is within the range if its own 108 * - An event without duration is within the range if its own
100 * frame is greater than or equal to f and less than f + d. 109 * frame is greater than or equal to f and less than f + d.
111 sv_frame_t duration, 120 sv_frame_t duration,
112 int overspill = 0) const; 121 int overspill = 0) const;
113 122
114 /** 123 /**
115 * Retrieve all events starting within the range in frames defined 124 * Retrieve all events starting within the range in frames defined
116 * by the given frame f and duration d. 125 * by the given frame f and duration d. An event (regardless of
117 * 126 * whether it has duration or not) starts within the range if its
118 * - An event without duration starts within the range if its own 127 * start frame is greater than or equal to f and less than f + d.
119 * frame is greater than or equal to f and less than f + d.
120 *
121 * - An event with duration starts within the range if its start
122 * frame is greater than or equal to f.
123 */ 128 */
124 EventVector getEventsStartingWithin(sv_frame_t frame, 129 EventVector getEventsStartingWithin(sv_frame_t frame,
125 sv_frame_t duration) const; 130 sv_frame_t duration) const;
126 131
127 /** 132 /**
128 * Retrieve all events that cover the given frame. An event without 133 * Retrieve all events starting at exactly the given frame.
129 * duration covers a frame if its own frame is equal to it. An event 134 */
130 * with duration covers a frame if its start frame is less than or 135 EventVector getEventsStartingAt(sv_frame_t frame) const {
131 * equal to it and its end frame (start + duration) is greater 136 return getEventsStartingWithin(frame, 1);
132 * than it. 137 }
133 */
134 EventVector getEventsCovering(sv_frame_t frame) const;
135 138
136 /** 139 /**
137 * Retrieve all events, in their natural order. 140 * Retrieve all events, in their natural order.
138 */ 141 */
139 EventVector getAllEvents() const; 142 EventVector getAllEvents() const;