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

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_ChordTrack.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
14ChordTrack::ChordTrack (Edit& ed, const juce::ValueTree& v)
15 : ClipTrack (ed, v, false)
16{
17}
18
19ChordTrack::~ChordTrack()
20{
21 notifyListenersOfDeletion();
22}
23
24juce::String ChordTrack::getTrackWarning() const
25{
26 auto& clips = getClips();
27
28 for (int i = 0; i < clips.size(); ++i)
29 {
30 auto pos1 = clips.getUnchecked(i)->getPosition().time;
31
32 for (int j = i + 1; j < clips.size(); ++j)
33 if (pos1.overlaps (clips.getUnchecked (j)->getPosition().time.reduced (TimeDuration::fromSeconds (0.0001))))
34 return TRANS("This track contains overlapping chords. Portions of some chord are ignored.");
35 }
36
37 return {};
38}
39
40}} // namespace tracktion { inline namespace engine
#define TRANS(stringLiteral)