tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_EditTime.cpp
Go to the documentation of this file.
1 /*
2 ,--. ,--. ,--. ,--.
3 ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2024
4 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
5 | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
6 `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
7
8 Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details.
9*/
10
11namespace tracktion { inline namespace engine
12{
13
15{
16 return ts.toBeats (tp);
17}
18
20{
21 return ts.toTime (bp);
22}
23
24BeatRange toBeats (TimeRange r, const TempoSequence& ts)
25{
26 return { toBeats (r.getStart(), ts), toBeats (r.getEnd(), ts) };
27}
28
29TimeRange toTime (BeatRange r, const TempoSequence& ts)
30{
31 return { toTime (r.getStart(), ts), toTime (r.getEnd(), ts) };
32}
33
35{
36 return { range, offset };
37}
38
39ClipPosition createClipPosition (const TempoSequence& ts, BeatRange range, BeatDuration offset)
40{
41 return { ts.toTime (range), toDuration (ts.toTime (toPosition (offset))) };
42}
43
44
45
46}} // namespace tracktion { inline namespace engine
Holds a list of TempoSetting objects, to form a sequence of tempo changes.
TimePosition toTime(BeatPosition) const
Converts a number of beats a time.
BeatPosition toBeats(TimePosition) const
Converts a time to a number of beats.
BeatPosition toBeats(TimePosition tp, const TempoSequence &ts)
Converts a TimePosition to a BeatPosition given a TempoSequence.
ClipPosition createClipPosition(const TempoSequence &, TimeRange range, TimeDuration offset)
Creates a ClipPosition from either a time or beat range.
TimePosition toTime(BeatPosition bp, const TempoSequence &ts)
Converts a BeatPosition to a TimePosition given a TempoSequence.
Represents a duration in beats.
Represents a position in beats.
Represents a duration in real-life time.
Represents a position in real-life time.
Represents the position of a clip on a timeline.