Skip to content

Commit bfec1f5

Browse files
committed
improved function grapher
1 parent 3c0a803 commit bfec1f5

File tree

3 files changed

+26
-27
lines changed

3 files changed

+26
-27
lines changed

.github/workflows/cmake_ctest.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -198,20 +198,20 @@ jobs:
198198
working-directory: ${{ env.ARTIFACTS_PATH }}
199199
run: 7z a -tzip "${{ env.ARTIFACT_NAME }}.zip" .
200200

201-
- name: Generate Installer and Sign with EV cert on Azure (Windows)
202-
if: ${{ matrix.name == 'Windows' }}
203-
shell: bash
204-
run: |
205-
iscc "packaging\installer.iss"
206-
mv "packaging/Output/${{ env.ARTIFACT_NAME }}.exe" "${{ env.ARTIFACTS_PATH }}/"
207-
dotnet tool install --global AzureSignTool
208-
AzureSignTool sign -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" -kvi "${{ secrets.AZURE_CLIENT_ID }}" -kvt "${{ secrets.AZURE_TENANT_ID }}" -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.digicert.com -v "${{ env.ARTIFACTS_PATH }}/${{ env.ARTIFACT_NAME }}.exe"
209-
210-
- name: Upload Exe (Windows)
201+
# - name: Generate Installer and Sign with EV cert on Azure (Windows)
202+
# if: ${{ matrix.name == 'Windows' }}
203+
# shell: bash
204+
# run: |
205+
# iscc "packaging\installer.iss"
206+
# mv "packaging/Output/${{ env.ARTIFACT_NAME }}.exe" "${{ env.ARTIFACTS_PATH }}/"
207+
# dotnet tool install --global AzureSignTool
208+
# AzureSignTool sign -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" -kvi "${{ secrets.AZURE_CLIENT_ID }}" -kvt "${{ secrets.AZURE_TENANT_ID }}" -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.digicert.com -v "${{ env.ARTIFACTS_PATH }}/${{ env.ARTIFACT_NAME }}.exe"
209+
210+
- name: Upload VST3 (Windows)
211211
if: ${{ matrix.name == 'Windows' }}
212212
uses: actions/upload-artifact@v3
213213
with:
214-
name: ${{ env.ARTIFACT_NAME }}.exe
214+
name: ${{ env.ARTIFACT_NAME }}.vst3
215215
path: '${{ env.ARTIFACTS_PATH }}/${{ env.ARTIFACT_NAME }}.exe'
216216

217217
- name: Upload Zip (Linux)

source/PluginEditor.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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
532524
void 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);

source/PluginEditor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "PluginProcessor.h"
44
#include "BinaryData.h"
5-
// DELETE WHEN PLUGIN FINISHED
5+
// INSPECTOR IS ONLY USED IN DEBUG BUILD
66
#ifndef NDEBUG
77
#include "melatonin_inspector/melatonin_inspector.h"
88
#endif
@@ -204,7 +204,7 @@ class PluginEditor : public juce::AudioProcessorEditor, public juce::Button::Lis
204204
// access the processor object that created it.
205205
PluginProcessor& processorRef;
206206

207-
// DELETE WHEN PLUGIN FINISHED
207+
// INSPECTOR IS ONLY USED IN DEBUG BUILD
208208
#ifndef NDEBUG
209209
std::unique_ptr<melatonin::Inspector> inspector;
210210
juce::TextButton inspectButton { "Inspect the UI" };

0 commit comments

Comments
 (0)