summaryrefslogtreecommitdiffstats
path: root/raul/TimeSlice.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'raul/TimeSlice.hpp')
-rw-r--r--raul/TimeSlice.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/raul/TimeSlice.hpp b/raul/TimeSlice.hpp
index c2f1da3..05ed170 100644
--- a/raul/TimeSlice.hpp
+++ b/raul/TimeSlice.hpp
@@ -58,23 +58,23 @@ public:
, _offset_ticks(TimeUnit(TimeUnit::FRAMES, rate), 0, 0)
{}
-
/** Set the start and length of the slice.
*
* Note that external offset is not affected by this, don't forget to reset
* the offset each cycle!
*/
- void set_window(TimeStamp start, TimeDuration length) {
+ void set_slice(TimeStamp start, TimeDuration length) {
+ assert(start.unit() == ticks_unit());
+ assert(length.unit() == ticks_unit());
_start_ticks = start;
_length_ticks = length;
update_beat_time();
}
- void set_slice(TimeStamp start, TimeDuration length) {
- assert(start.unit() == length.unit());
- _start_ticks = start;
+ void set_length(TimeDuration length) {
+ assert(length.unit() == ticks_unit());
_length_ticks = length;
- update_beat_time();
+ _length_beats = ticks_to_beats(_length_ticks);
}
bool contains(TimeStamp time) {