Hi everyone,
Could someone explain to me how to implement the pure virtual function
Selectable* CurveEditor::getItem()
Thxs.
Hi everyone,
Could someone explain to me how to implement the pure virtual function
Selectable* CurveEditor::getItem()
Thxs.
It should return the “thing” (Selectable) that the curve represents. The CurveEditor will select it if clicked in the right place. I.e. for an automation curve it would be the AutomatableParameter
, for a tempo curve, the TempoSequence
.
Thanks for the quick response.
Selectable* AutomationCurveEditorComponent::getItem()
{
if(pointUnderMouse != -1)
return curveEditorPoints.add(new AutomationCurveEditorPoint(pointUnderMouse, this));
if (curveUnderMouse != -1)
return curveEditorPoints.add(new AutomationCurveEditorPoint(curveUnderMouse, this));
return autParam;
};
I had thought something like this… so it’s a pleasure to hear that i was on the right way
What about the curveEditor for the control changes ? Should i use the te::CurveEditor even here ? how it works in Waveform ?
What do you mean by “control changes”? MIDI CC?
If so, we don’t use automation curves in Waveform for those, they’re just points.
There is some hint in the tracktion libraries ( such as CurveEditor ) where i can get something or i must do all from scratch ?
That could help me a lot.
Thxs
Sorry, I’m still not clear exactly what you’re trying to do?
Well,
It’s simpler than you probably think. CurveEditor is for bezier curves like automation or tempo changes.
For MIDI it’s just a point (i.e. beat time with a y-value). So all you need to do is convert the beat position to a pixel on the screen and draw a horizontal line between that point and the next event.
For that kind of drawing, there are great examples in the SamplerPluginDemo from Juce.
OK i found a way to deal with it.
MidiList& MidiClip::getSequence() const noexcept
{
if (! hasValidSequence())
{
jassertfalse; // This shouldn't get hit, let Dave know if it does
static MidiList dummyList;
return dummyList;
}
jassert (channelSequence.size() > 0);
return *channelSequence.getUnchecked (currentTake);
}
I’m in troubles with this problem…
The comment just say
“This shouldn’t get hit, let Dave know if it does”
so can you explain me this error ? ( i hit that using the undo manager while i was doing undo operations on midi clip ).