12 addMouseListener(
this,
true);
18 m_editableLabelX->getLabel().setColour(juce::Label::textColourId, juce::Colours::lightgrey);
19 m_editableLabelX->getLabel().setJustificationType(Justification::centredRight);
25 m_editableLabelY->getLabel().setColour(juce::Label::textColourId, juce::Colours::lightgrey);
26 m_editableLabelY->getLabel().setJustificationType(Justification::centredLeft);
37 m_xyButton.
createMask(KrotosBinaryData::XYPad_Distance_svg, KrotosBinaryData::XYPad_Distance_svgSize);
39 m_editableLabelX->getLabel().setJustificationType(Justification::centredLeft);
46 m_editableLabelW->getLabel().setColour(juce::Label::textColourId, juce::Colours::lightgrey);
53 m_editableLabelZ->getLabel().setColour(juce::Label::textColourId, juce::Colours::lightgrey);
54 m_editableLabelZ->getLabel().setJustificationType(Justification::centredLeft);
62 m_editableLabelX->getLabel().setJustificationType(Justification::centredLeft);
63 m_editableLabelY->getLabel().setJustificationType(Justification::centredRight);
69 m_editableLabelW->getLabel().setColour(juce::Label::textColourId, juce::Colours::lightgrey);
70 m_editableLabelW->getLabel().setJustificationType(Justification::centredRight);
76 m_editableLabelZ->getLabel().setColour(juce::Label::textColourId, juce::Colours::lightgrey);
77 m_editableLabelZ->getLabel().setJustificationType(Justification::centredLeft);
84 m_editableLabelX->getLabel().setJustificationType(Justification::centredLeft);
85 m_editableLabelY->getLabel().setJustificationType(Justification::centredRight);
91 m_editableLabelW->getLabel().setColour(juce::Label::textColourId, juce::Colours::lightgrey);
92 m_editableLabelW->getLabel().setJustificationType(Justification::centredRight);
98 m_editableLabelZ->getLabel().setColour(juce::Label::textColourId, juce::Colours::lightgrey);
99 m_editableLabelZ->getLabel().setJustificationType(Justification::centredLeft);
105 m_xyButton.
createMask(KrotosBinaryData::XYPad_2Zone_svg, KrotosBinaryData::XYPad_2Zone_svgSize);
115 m_toggleLabel.setJustificationType(Justification::centredBottom);
117 m_toggleLabel.setColour(Label::textColourId, Colours::white.withAlpha(0.3f));
118 m_toggleLabel.setText(
"Click or drag\nto trigger a performance", dontSendNotification);
138 startTimerSlow(
true);
262 int maxDimension = jmax(xyButtonBounds.getWidth(), xyButtonBounds.getHeight());
263 float radius = 0.7f * maxDimension;
274 static_cast<float>(xyButtonBounds.getTopLeft().getX()),
275 static_cast<float>(xyButtonBounds.getTopLeft().getY()),
278 MathConstants<float>::halfPi,
280 MathConstants<float>::halfPi,
282 g.setColour(Colours::lightgrey);
283 g.strokePath(path, PathStrokeType(
static_cast<float>(3.0f)));
287 static_cast<float>(xyButtonBounds.getTopRight().getX()),
288 static_cast<float>(xyButtonBounds.getTopRight().getY()),
291 MathConstants<float>::twoPi,
293 MathConstants<float>::halfPi * 3.0f,
295 g.setColour(Colours::darkgrey);
296 g.strokePath(path1, PathStrokeType(
static_cast<float>(3.0f)));
300 static_cast<float>(xyButtonBounds.getBottomLeft().getX()),
301 static_cast<float>(xyButtonBounds.getBottomLeft().getY()),
304 MathConstants<float>::twoPi,
306 MathConstants<float>::halfPi,
308 g.setColour(Colours::blanchedalmond);
309 g.strokePath(path2, PathStrokeType(
static_cast<float>(3.0f)));
313 static_cast<float>(xyButtonBounds.getBottomRight().getX()),
314 static_cast<float>(xyButtonBounds.getBottomRight().getY()),
317 MathConstants<float>::twoPi,
318 MathConstants<float>::halfPi * 3.0f,
319 MathConstants<float>::twoPi,
321 g.setColour(Colours::darkcyan);
322 g.strokePath(path3, PathStrokeType(
static_cast<float>(3.0f)));
329 g.setColour(Colours::lightgrey);
330 auto lineHeight =
static_cast<float>(xyButtonBounds.getHeight() + xyButtonBounds.getHeight() / 8.0f);
331 auto linePoint = xyButtonBounds.getWidth() / 2;
332 auto start =
static_cast<float>(xyButtonBounds.getTopLeft().getY());
333 g.drawVerticalLine(linePoint, start, lineHeight);
346 float masterWidth = (float)mainRect.getWidth();
347 float masterHeight = (float)mainRect.getHeight();
354 masterWidth = (float)mainRect.getWidth();
355 masterHeight = (float)mainRect.getHeight();
362 auto xyButtonCenter = mainRect.getCentre().toFloat();
363 auto xyButtonBounds = Rectangle<float>()
364 .withCentre(xyButtonCenter)
366 m_xyButton.setBounds(xyButtonBounds.toNearestInt());
374 int labelWidth = mainRect.getWidth() / 2;
377 auto toggleLabelBounds =
380 toggleLabelBounds.removeFromBottom(
static_cast<int>(toggleLabelBounds.getHeight() * 0.3f)));
384 Rectangle<int> toggleButtonBounds;
389 Rectangle<int> labelBoundsX;
390 Rectangle<int> labelBoundsY;
395 labelBoundsX = Rectangle<int>(mainRect.getWidth() - labelWidth, mainRect.getHeight() - labelHeight,
396 labelWidth, labelHeight);
399 labelBoundsY = Rectangle<int>(mainRect.getX(), mainRect.getY(), labelWidth, labelHeight);
404 int labelCenterX = mainRect.getX() + mainRect.getWidth() / 2;
407 int halfLabelWidth = labelWidth / 2;
410 int labelYPosition = mainRect.getY();
413 labelBoundsX = Rectangle<int>(labelCenterX - halfLabelWidth, mainRect.getHeight() - labelHeight,
414 labelWidth, labelHeight);
417 labelBoundsY = Rectangle<int>(labelCenterX - halfLabelWidth, labelYPosition, labelWidth, labelHeight);
428 Rectangle<int>(mainRect.getX(), mainRect.getHeight() - labelHeight, labelWidth / 3, labelHeight);
433 Rectangle<int> labelBoundsX = Rectangle<int>(mainRect.getX(), mainRect.getY(), labelWidth, labelHeight);
438 Rectangle<int> labelBoundsY =
439 Rectangle<int>((mainRect.getWidth() / 2.0f) - 50, mainRect.getY(), labelWidth, labelHeight);
444 Rectangle<int> labelBoundsW = Rectangle<int>((mainRect.getWidth() / 2.0f) - 50,
445 mainRect.getHeight() - labelHeight, labelWidth, labelHeight);
450 Rectangle<int> labelBoundsZ = Rectangle<int>(mainRect.getX(), mainRect.getHeight() - labelHeight,
456 toggleButtonBounds = Rectangle<int>(0, mainRect.getHeight() - labelHeight, labelWidth / 3, labelHeight);
462 Rectangle<int> labelBoundsX = Rectangle<int>(mainRect.getX(), mainRect.getY(), labelWidth, labelHeight);
467 Rectangle<int> labelBoundsY =
468 Rectangle<int>(mainRect.getWidth() - labelWidth, mainRect.getY(), labelWidth, labelHeight);
473 Rectangle<int> labelBoundsW = Rectangle<int>(mainRect.getWidth() - labelWidth,
474 mainRect.getHeight() - labelHeight, labelWidth, labelHeight);
479 Rectangle<int> labelBoundsZ = Rectangle<int>(mainRect.getX(), mainRect.getHeight() - labelHeight,
486 mainRect.getHeight() - labelHeight, labelWidth / 3, labelHeight);
491 Rectangle<int> labelBoundsX = Rectangle<int>(mainRect.getX(), mainRect.getY(), labelWidth, labelHeight);
496 Rectangle<int> labelBoundsY =
497 Rectangle<int>(mainRect.getWidth() - labelWidth, mainRect.getY(), labelWidth, labelHeight);
502 Rectangle<int> labelBoundsW = Rectangle<int>(mainRect.getWidth() - labelWidth,
503 mainRect.getHeight() - labelHeight, labelWidth, labelHeight);
508 Rectangle<int> labelBoundsZ = Rectangle<int>(mainRect.getX(), mainRect.getHeight() - labelHeight,
515 mainRect.getHeight() - labelHeight, labelWidth / 3, labelHeight);
519 Rectangle<int> labelBoundsX;
520 Rectangle<int> labelBoundsY;
524 labelBoundsX = Rectangle<int>(mainRect.getWidth() - labelWidth, mainRect.getHeight() - labelHeight,
525 labelWidth, labelHeight);
527 labelBoundsY = Rectangle<int>(mainRect.getX(), mainRect.getY(), labelWidth, labelHeight);
532 int labelCenterX = mainRect.getX() + mainRect.getWidth() / 2;
534 int halfLabelWidth = labelWidth / 2;
536 int labelYPosition = mainRect.getY();
538 labelBoundsX = Rectangle<int>(labelCenterX - halfLabelWidth, mainRect.getHeight() - labelHeight,
539 labelWidth, labelHeight);
541 labelBoundsY = Rectangle<int>(labelCenterX - halfLabelWidth, labelYPosition, labelWidth, labelHeight);
549 Rectangle<int>(mainRect.getX(), mainRect.getHeight() - labelHeight, labelWidth / 3, labelHeight);