Skip to content

guitar_prometheus::VelocityCurveEditor

guitar_prometheus::VelocityCurveEditor

Graph editor for velocityForDynamic curves. More…

#include <VelocityCurveEditor.h>

Inherits from juce::Component

Public Types

Name
using GuitarPrometheus::MusicModels::DynamicDynamic
using std::pair< Dynamic, std::string >DisplayDynamic

Public Functions

Name
VelocityCurveEditor()
voidsetData(std::vector< DisplayDynamic > dynamics, std::map< Dynamic, int > velocities, std::function< void(std::map< Dynamic, int >)> onCommit)
Refresh the editor with the supplied dynamics + their current velocities.
voidpaint(juce::Graphics & g) override
voidmouseDown(const juce::MouseEvent & e) override
voidmouseDrag(const juce::MouseEvent & e) override
voidmouseUp(const juce::MouseEvent & e) override

Detailed Description

class guitar_prometheus::VelocityCurveEditor;

Graph editor for velocityForDynamic curves.

One control point per declared dynamic, drawn at (dynamicIndex, velocity). Click-drag a control point to change its velocity (X stays pinned to the dynamic’s enum index). The curve between control points is a straight-line interpolation; the editor uses Profiles::interpolateBetweenDynamics for visualization. Profile model is unchanged — the underlying velocityForDynamic map is the authoritative source, and the curve is just a different view on it.

Owner supplies the displayed dynamics + initial velocities and a write-back callback. The editor never touches the form-state directly; it round-trips edits through the callback so the existing tab plumbing stays in charge.

Public Types Documentation

using Dynamic

using guitar_prometheus::VelocityCurveEditor::Dynamic = GuitarPrometheus::MusicModels::Dynamic;

using DisplayDynamic

using guitar_prometheus::VelocityCurveEditor::DisplayDynamic = std::pair<Dynamic, std::string >;

Public Functions Documentation

function VelocityCurveEditor

VelocityCurveEditor()

function setData

void setData(
std::vector< DisplayDynamic > dynamics,
std::map< Dynamic, int > velocities,
std::function< void(std::map< Dynamic, int >)> onCommit
)

Refresh the editor with the supplied dynamics + their current velocities.

onCommit is invoked with the updated map whenever a drag finishes.

function paint

void paint(
juce::Graphics & g
) override

function mouseDown

void mouseDown(
const juce::MouseEvent & e
) override

function mouseDrag

void mouseDrag(
const juce::MouseEvent & e
) override

function mouseUp

void mouseUp(
const juce::MouseEvent & e
) override

Updated on 2026-05-29 at 07:39:53 +0000