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

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_LaunchQuantisation.h
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
14//==============================================================================
15//==============================================================================
16enum class LaunchQType
17{
18 none,
19 eightBars,
20 fourBars,
21 twoBars,
22 bar,
23 halfT,
24 half,
25 halfD,
26 quarterT,
27 quarter,
28 quarterD,
29 eighthT,
30 eighth,
31 eighthD,
32 sixteenthT,
33 sixteenth,
34 sixteenthD,
35 thirtySecondT,
36 thirtySecond,
37 thirtySecondD,
38 sixtyFourthT,
39 sixtyFourth,
40 sixtyFourthD
41};
42
43//==============================================================================
46
49
51juce::String getName (LaunchQType);
52
54double toBarFraction (LaunchQType) noexcept;
55
57LaunchQType fromBarFraction (double) noexcept;
58
60BeatPosition getNext (LaunchQType, const TempoSequence&, BeatPosition) noexcept;
61
63BeatPosition getNext (LaunchQType, const tempo::Sequence&, BeatPosition) noexcept;
64
65//==============================================================================
66//==============================================================================
72{
73public:
78
80 BeatPosition getNext (BeatPosition) const noexcept;
81
82 //==============================================================================
85};
86
87}} // namespace tracktion { inline namespace engine
88
89
90//==============================================================================
91//==============================================================================
92namespace juce
93{
94template <>
95struct VariantConverter<tracktion::engine::LaunchQType>
96{
97 static tracktion::engine::LaunchQType fromVar (const juce::var& v) { return tracktion::engine::fromBarFraction (v); }
98 static juce::var toVar (const tracktion::engine::LaunchQType& v) { return tracktion::engine::toBarFraction (v); }
99};
100}
The Tracktion Edit class!
BeatPosition getNext(BeatPosition) const noexcept
Returns the next beat quantised to the current type.
juce::CachedValue< LaunchQType > type
The current type property.
juce::String getName(LaunchQType t)
Retuns the name of a LaunchQType for display purposes.
double toBarFraction(LaunchQType q) noexcept
Returns the fraction of a bar to be used for a given rate type.
BeatPosition getNext(LaunchQType q, const tempo::Sequence &ts, BeatPosition pos) noexcept
Returns the next quantised position.
std::optional< LaunchQType > launchQTypeFromName(const juce::String &name)
Returns a the launch Q from a string returned from getLaunchQTypeChoices().
LaunchQType fromBarFraction(double f) noexcept
Returns the fraction of a bar to be used for a given rate type.
juce::StringArray getLaunchQTypeChoices()
Returns a list of quantisation type options in the order of LaunchQType.
Represents a position in beats.