Add tooltips to fixed rotate and edit buttons

pull/170/head
James Ball 2023-12-17 22:46:24 +00:00
rodzic 633723f1ba
commit 07a35e709e
4 zmienionych plików z 42 dodań i 17 usunięć

Wyświetl plik

@ -83,6 +83,9 @@ MainComponent::MainComponent(OscirenderAudioProcessor& p, OscirenderAudioProcess
pluginEditor.fileUpdated(fileName);
};
fileName.setFont(juce::Font(16.0f, juce::Font::plain));
fileName.setText("filename");
fileName.onReturnKey = [this] {
createFile.triggerClick();
};

Wyświetl plik

@ -73,6 +73,11 @@ ObjComponent::ObjComponent(OscirenderAudioProcessor& p, OscirenderAudioProcessor
rotateX.setComponent(fixedRotateX);
rotateY.setComponent(fixedRotateY);
rotateZ.setComponent(fixedRotateZ);
juce::String tooltip = "Toggles whether the rotation around this axis is fixed, or changes according to the rotation speed.";
fixedRotateX->setTooltip(tooltip);
fixedRotateY->setTooltip(tooltip);
fixedRotateZ->setTooltip(tooltip);
}
ObjComponent::~ObjComponent() {

Wyświetl plik

@ -36,56 +36,62 @@ OscirenderAudioProcessor::OscirenderAudioProcessor()
toggleableEffects.push_back(std::make_shared<Effect>(
std::make_shared<BitCrushEffect>(),
new EffectParameter("Bit Crush", "description", "bitCrush", VERSION_HINT, 0.0, 0.0, 1.0)
new EffectParameter("Bit Crush", "Limits the resolution of points drawn to the screen, making the image look pixelated, and making the audio sound more 'digital' and distorted.", "bitCrush", VERSION_HINT, 0.0, 0.0, 1.0)
));
toggleableEffects.push_back(std::make_shared<Effect>(
std::make_shared<BulgeEffect>(),
new EffectParameter("Bulge", "description", "bulge", VERSION_HINT, 0.0, 0.0, 1.0)
new EffectParameter("Bulge", "Applies a bulge that makes the centre of the image larger, and squishes the edges of the image. This applies a distortion to the audio.", "bulge", VERSION_HINT, 0.0, 0.0, 1.0)
));
toggleableEffects.push_back(std::make_shared<Effect>(
std::make_shared<RotateEffect>(),
new EffectParameter("2D Rotate", "description", "2DRotateSpeed", VERSION_HINT, 0.0, 0.0, 1.0)
new EffectParameter("2D Rotate", "Rotates the image, and pans the audio.", "2DRotateSpeed", VERSION_HINT, 0.0, 0.0, 1.0)
));
toggleableEffects.push_back(std::make_shared<Effect>(
std::make_shared<VectorCancellingEffect>(),
new EffectParameter("Vector Cancelling", "description", "vectorCancelling", VERSION_HINT, 0.0, 0.0, 1.0)
new EffectParameter("Vector Cancelling", "Inverts the audio and image every few samples to 'cancel out' the audio, making the audio quiet, and distorting the image.", "vectorCancelling", VERSION_HINT, 0.0, 0.0, 1.0)
));
toggleableEffects.push_back(std::make_shared<Effect>(
std::make_shared<DistortEffect>(false),
new EffectParameter("Distort X", "description", "distortX", VERSION_HINT, 0.0, 0.0, 1.0)
new EffectParameter("Distort X", "Distorts the image in the horizontal direction by jittering the audio sample being drawn.", "distortX", VERSION_HINT, 0.0, 0.0, 1.0)
));
toggleableEffects.push_back(std::make_shared<Effect>(
std::make_shared<DistortEffect>(true),
new EffectParameter("Distort Y", "description", "distortY", VERSION_HINT, 0.0, 0.0, 1.0)
new EffectParameter("Distort Y", "Distorts the image in the vertical direction by jittering the audio sample being drawn.", "distortY", VERSION_HINT, 0.0, 0.0, 1.0)
));
toggleableEffects.push_back(std::make_shared<Effect>(
[this](int index, Vector2 input, const std::vector<double>& values, double sampleRate) {
input.x += values[0];
input.y += values[1];
return input;
}, std::vector<EffectParameter*>{new EffectParameter("Translate X", "description", "translateX", VERSION_HINT, 0.0, -1.0, 1.0), new EffectParameter("Translate Y", "description", "translateY", VERSION_HINT, 0.0, -1.0, 1.0)}
}, std::vector<EffectParameter*>{
new EffectParameter("Translate X", "Moves the image horizontally.", "translateX", VERSION_HINT, 0.0, -1.0, 1.0),
new EffectParameter("Translate Y", "Moves the image vertically.", "translateY", VERSION_HINT, 0.0, -1.0, 1.0)
}
));
toggleableEffects.push_back(std::make_shared<Effect>(
std::make_shared<SmoothEffect>(),
new EffectParameter("Smoothing", "description", "smoothing", VERSION_HINT, 0.0, 0.0, 1.0)
new EffectParameter("Smoothing", "This works as a low-pass frequency filter that removes high frequencies, making the image look smoother, and audio sound less harsh.", "smoothing", VERSION_HINT, 0.0, 0.0, 1.0)
));
toggleableEffects.push_back(std::make_shared<Effect>(
wobbleEffect,
new EffectParameter("Wobble", "description", "wobble", VERSION_HINT, 0.0, 0.0, 1.0)
new EffectParameter("Wobble", "Adds a sine wave of the prominent frequency in the audio currently playing. The sine wave's frequency is slightly offset to create a subtle 'wobble' in the image. Increasing the slider increases the strength of the wobble.", "wobble", VERSION_HINT, 0.0, 0.0, 1.0)
));
toggleableEffects.push_back(std::make_shared<Effect>(
delayEffect,
std::vector<EffectParameter*>{new EffectParameter("Delay Decay", "description", "delayDecay", VERSION_HINT, 0.0, 0.0, 1.0), new EffectParameter("Delay Length", "description", "delayLength", VERSION_HINT, 0.5, 0.0, 1.0)}
std::vector<EffectParameter*>{
new EffectParameter("Delay Decay", "Adds repetitions, delays, or echos to the audio. This slider controls the volume of the echo.", "delayDecay", VERSION_HINT, 0.0, 0.0, 1.0),
new EffectParameter("Delay Length", "Controls the time in seconds between echos.", "delayLength", VERSION_HINT, 0.5, 0.0, 1.0)
}
));
toggleableEffects.push_back(std::make_shared<Effect>(
perspectiveEffect,
std::vector<EffectParameter*>{
new EffectParameter("3D Perspective", "description", "perspectiveStrength", VERSION_HINT, 0.0, 0.0, 1.0),
new EffectParameter("Depth (z)", "description", "perspectiveZPos", VERSION_HINT, 0.1, 0.0, 1.0),
new EffectParameter("Rotate Speed", "description", "perspectiveRotateSpeed", VERSION_HINT, 0.0, -1.0, 1.0),
new EffectParameter("Rotate X", "description", "perspectiveRotateX", VERSION_HINT, 1.0, -1.0, 1.0),
new EffectParameter("Rotate Y", "description", "perspectiveRotateY", VERSION_HINT, 1.0, -1.0, 1.0),
new EffectParameter("Rotate Z", "description", "perspectiveRotateZ", VERSION_HINT, 0.0, -1.0, 1.0),
new EffectParameter("3D Perspective", "Controls the strength of the 3D perspective effect which treats the image as a 3D object that can be rotated.", "perspectiveStrength", VERSION_HINT, 0.0, 0.0, 1.0),
new EffectParameter("Depth (z)", "Controls how far away the 3D object is drawn away from the camera (the Z position).", "perspectiveZPos", VERSION_HINT, 0.1, 0.0, 1.0),
new EffectParameter("Rotate Speed", "Controls how fast the 3D object rotates in the direction determined by the rotation sliders below.", "perspectiveRotateSpeed", VERSION_HINT, 0.0, -1.0, 1.0),
new EffectParameter("Rotate X", "Controls the rotation of the object in the X axis.", "perspectiveRotateX", VERSION_HINT, 1.0, -1.0, 1.0),
new EffectParameter("Rotate Y", "Controls the rotation of the object in the Y axis.", "perspectiveRotateY", VERSION_HINT, 1.0, -1.0, 1.0),
new EffectParameter("Rotate Z", "Controls the rotation of the object in the Z axis.", "perspectiveRotateZ", VERSION_HINT, 0.0, -1.0, 1.0),
}
));
toggleableEffects.push_back(traceMax);
@ -264,7 +270,12 @@ void OscirenderAudioProcessor::addLuaSlider() {
luaEffects.push_back(std::make_shared<Effect>(
std::make_shared<LuaEffect>(sliderName, *this),
new EffectParameter("Lua " + sliderName, "description", "lua" + sliderName, VERSION_HINT, 0.0, 0.0, 1.0, 0.001, false)
new EffectParameter(
"Lua Slider " + sliderName,
"Controls the value of the Lua variable called slider_" + sliderName + ".",
"lua" + sliderName,
VERSION_HINT, 0.0, 0.0, 1.0, 0.001, false
)
));
auto& effect = luaEffects.back();

Wyświetl plik

@ -86,14 +86,19 @@ void EffectsListComponent::resized() {
std::shared_ptr<juce::Component> EffectsListComponent::createComponent(EffectParameter* parameter) {
if (parameter->paramID == "perspectiveRotateX" || parameter->paramID == "perspectiveRotateY" || parameter->paramID == "perspectiveRotateZ") {
BooleanParameter* toggle;
juce::String axis;
if (parameter->paramID == "perspectiveRotateX") {
toggle = audioProcessor.perspectiveEffect->fixedRotateX;
axis = "X";
} else if (parameter->paramID == "perspectiveRotateY") {
toggle = audioProcessor.perspectiveEffect->fixedRotateY;
axis = "Y";
} else if (parameter->paramID == "perspectiveRotateZ") {
toggle = audioProcessor.perspectiveEffect->fixedRotateZ;
axis = "Z";
}
std::shared_ptr<SvgButton> button = std::make_shared<SvgButton>(parameter->name, BinaryData::fixed_rotate_svg, "white", "red", toggle);
button->setTooltip("Toggles whether the rotation around the " + axis + " axis is fixed, or changes according to the rotation speed.");
button->onClick = [this, toggle] {
toggle->setBoolValueNotifyingHost(!toggle->getBoolValue());
};
@ -103,6 +108,7 @@ std::shared_ptr<juce::Component> EffectsListComponent::createComponent(EffectPar
std::weak_ptr<SvgButton> weakButton = button;
button->setEdgeIndent(5);
button->setToggleState(editor.editingPerspective, juce::dontSendNotification);
button->setTooltip("Toggles whether the text editor is editing the currently open file, or the Lua 3D perspective function.");
button->onClick = [this, weakButton] {
if (auto button = weakButton.lock()) {
editor.editPerspectiveFunction(button->getToggleState());