11namespace tracktion {
inline namespace engine
15 : TrackItem (ed, {}, Type::pitch), state (v)
17 auto um = &ed.getUndoManager();
19 startBeat.referTo (state, IDs::startBeat, um);
20 pitch.referTo (state, IDs::pitch, um, 60);
21 accidentalsSharp.referTo (state, IDs::accidentalsSharp, um,
true);
22 scale.referTo (state, IDs::scale, um, Scale::major);
24 state.addListener (
this);
27PitchSetting::~PitchSetting()
29 state.removeListener (
this);
31 notifyListenersOfDeletion();
37 edit.engine.getEngineBehaviour().getMiddleCOctave());
45Track* PitchSetting::getTrack()
const
47 return edit.getTempoTrack();
52 auto& ps = edit.pitchSequence;
53 auto s = edit.tempoSequence.toTime (startBeat);
55 if (
auto i = ps.indexOfPitch (
this); i >= 0)
56 if (
auto nextPitch = ps.getPitch (i + 1))
59 return { { s, s + TimeDuration::fromSeconds (1.0) },
TimeDuration() };
65 edit.pitchSequence.sortEvents();
69void PitchSetting::setPitch (
int p)
74void PitchSetting::setScaleID (Scale::ScaleType st)
79void PitchSetting::removeFromEdit()
81 auto p = state.getParent();
83 if (p.getNumChildren() > 1)
84 p.removeChild (state, &edit.getUndoManager());
static String getMidiNoteName(int noteNumber, bool useSharps, bool includeOctaveNumber, int octaveNumForMiddleC)
Base class for tracks which contain clips and plugins and can be added to Edit[s].
#define TRANS(stringLiteral)
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Represents a position in beats.
Represents a duration in real-life time.
Represents the position of a clip on a timeline.
TimePosition getStart() const
Returns the start time.