@@ -5,6 +5,7 @@ PluginEditor::PluginEditor (PluginProcessor& p)
55{
66 juce::ignoreUnused (processorRef);
77
8+ // INSPECTOR IS ONLY USED IN DEBUG BUILD
89 #ifndef NDEBUG
910 addAndMakeVisible (inspectButton);
1011
@@ -17,8 +18,8 @@ PluginEditor::PluginEditor (PluginProcessor& p)
1718 }
1819
1920 inspector->setVisible (true );
20- #endif
2121 };
22+ #endif
2223
2324 // ================= PARAMETER CONTROLS ========================================
2425 // Header parameters
@@ -117,7 +118,7 @@ PluginEditor::PluginEditor (PluginProcessor& p)
117118 knobWhiteImage = juce::ImageCache::getFromMemory (BinaryData::knobWhite_png, BinaryData::knobWhite_pngSize);
118119 switchImage = juce::ImageCache::getFromMemory (BinaryData::switch_png, BinaryData::switch_pngSize);
119120
120- // Size should be set in the Wrapper to allow resizing
121+ // FIXME: Size should be set in a Wrapper to allow resizing
121122 setSize (980 , 580 );
122123}
123124
@@ -303,11 +304,7 @@ void PluginEditor::paint (juce::Graphics& g)
303304 // Draw f(x) in the graph panel
304305 functionGrapher (g, driveGainKnob.getValue (), driveBiasKnob.getValue ());
305306
306- //
307- // ====================================================================
308- // TODO: WHEN MY EDITOR IS READY, I SHOULD DELETE EVERYTHING DOWN BELOW
309- // ====================================================================
310- //
307+ // INSPECTOR IS ONLY USED IN DEBUG BUILD
311308 #ifndef NDEBUG
312309 auto area = getLocalBounds ();
313310 g.setColour (juce::Colours::white);
@@ -383,12 +380,7 @@ void PluginEditor::resized()
383380 compAttKnob.setBounds (780 , 470 , 75 , 75 );
384381 compRelKnob.setBounds (880 , 470 , 75 , 75 );
385382
386- //
387- // ====================================================================
388- // TODO: WHEN MY EDITOR IS READY, I SHOULD DELETE EVERYTHING DOWN BELOW
389- // ====================================================================
390- //
391- // layout the positions of your child components here
383+ // INSPECTOR IS ONLY USED IN DEBUG BUILD
392384 #ifndef NDEBUG
393385 auto area = getLocalBounds ();
394386 area.removeFromBottom (50 );
@@ -532,6 +524,7 @@ juce::AffineTransform PluginEditor::scaledDown(float scaleFactor, float posX, fl
532524void PluginEditor::functionGrapher (juce::Graphics& g, float driveVal, float biasVal)
533525{
534526 float gainLinear = juce::Decibels::decibelsToGain (driveVal);
527+ int xBias = (int ) juce::jmap ((float ) biasVal, -1 .f , 1 .f , 350 .f , 630 .f );
535528
536529 // Draw f(x)
537530 g.setColour (juce::Colours::coral);
@@ -543,11 +536,17 @@ void PluginEditor::functionGrapher(juce::Graphics& g, float driveVal, float bias
543536
544537 juce::Point<float > p (x, y);
545538 x == 350 ? fxPath.startNewSubPath (p) : fxPath.lineTo (p);
539+
540+ // Draw intersection between bias and f(x)
541+ if (x == xBias) {
542+ g.setColour (juce::Colours::peachpuff);
543+ g.drawEllipse (x - 2 .5f , y - 2 .5f , 5 .f , 5 .f , 2 .f );
544+ g.setColour (juce::Colours::coral);
545+ }
546546 }
547547 g.strokePath (fxPath, juce::PathStrokeType (2 .0f ));
548548
549549 // Draw bias line
550- int xBias = (int ) juce::jmap ((float ) biasVal, -1 .f , 1 .f , 350 .f , 630 .f );
551550 float dashLengths[] = {10 .f , 5 .f };
552551 g.setColour (juce::Colours::peachpuff);
553552 g.drawDashedLine (juce::Line<float >(xBias, 50 , xBias, 330 ), dashLengths, 2 , 1 .5f );
0 commit comments