From aa3e14ea705bc6705c7378097d336e02be3df8c1 Mon Sep 17 00:00:00 2001 From: bsutherland Date: Tue, 28 Nov 2017 22:10:16 +0900 Subject: [PATCH] Commit unfinished work in progress from June. --- JuceOPLVSTi.jucer | 42 ++-- Source/ChannelButtonLookAndFeel.cpp | 66 +++++ Source/ChannelButtonLookAndFeel.h | 29 +++ Source/OPLLookAndFeel.cpp | 1 + Source/OPLLookAndFeel.h | 1 + Source/PluginGui.cpp | 362 +++++++++++++++------------- Source/PluginGui.h | 8 +- Source/PluginProcessor.cpp | 5 + Source/PluginProcessor.h | 1 + img/yamaha.png | Bin 0 -> 2605 bytes 10 files changed, 322 insertions(+), 193 deletions(-) create mode 100644 Source/ChannelButtonLookAndFeel.cpp create mode 100644 Source/ChannelButtonLookAndFeel.h create mode 100644 img/yamaha.png diff --git a/JuceOPLVSTi.jucer b/JuceOPLVSTi.jucer index 40bfc56..47caba9 100644 --- a/JuceOPLVSTi.jucer +++ b/JuceOPLVSTi.jucer @@ -7,12 +7,17 @@ pluginIsSynth="1" pluginWantsMidiIn="1" pluginProducesMidiOut="0" pluginSilenceInIsSilenceOut="0" pluginEditorRequiresKeys="0" pluginAUExportPrefix="JuceOPLVSTiAU" pluginRTASCategory="" aaxIdentifier="com.plainweave.JuceOPLVSTi" - pluginAAXCategory="AAX_ePlugInCategory_Dynamics" jucerVersion="4.3.1" + pluginAAXCategory="AAX_ePlugInCategory_Dynamics" jucerVersion="5.0.2" buildVST3="0" buildRTAS="0" buildAAX="0" includeBinaryInAppConfig="1" pluginIsMidiEffectPlugin="0" companyWebsite="https://bsutherland.github.io/JuceOPLVSTi/" - buildAUv3="0"> + buildAUv3="0" displaySplashScreen="1" reportAppUsage="1" splashScreenColour="Dark" + buildStandalone="0" enableIAA="0"> + + - + @@ -93,24 +98,25 @@ warningsAreErrors="1" headerPath=""/> - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + diff --git a/Source/ChannelButtonLookAndFeel.cpp b/Source/ChannelButtonLookAndFeel.cpp new file mode 100644 index 0000000..2f32abd --- /dev/null +++ b/Source/ChannelButtonLookAndFeel.cpp @@ -0,0 +1,66 @@ +/* + ============================================================================== + + ChannelButtonLookAndFeel.cpp + Created: 10 Oct 2016 9:38:20pm + Author: bruce + + ============================================================================== +*/ + +#include "ChannelButtonLookAndFeel.h" +#include "PluginGui.h" + +ChannelButtonLookAndFeel::ChannelButtonLookAndFeel() +{ + + +} + +static void drawButtonShape(Graphics& g, const Path& outline, Colour baseColour, float height) +{ + const float mainBrightness = baseColour.getBrightness(); + const float mainAlpha = baseColour.getFloatAlpha(); + + g.setFillType(FillType(baseColour)); + g.fillPath(outline); + + //g.setColour(Colours::white.withAlpha(0.4f * mainAlpha * mainBrightness * mainBrightness)); + //g.strokePath(outline, PathStrokeType(1.0f), AffineTransform::translation(0.0f, 1.0f) + // .scaled(1.0f, (height - 1.6f) / height)); + + //g.setColour(Colours::black.withAlpha(0.4f * mainAlpha)); + //g.strokePath(outline, PathStrokeType(1.0f)); +} + +void ChannelButtonLookAndFeel::drawButtonBackground(Graphics& g, Button& button, const Colour& backgroundColour, + bool isMouseOverButton, bool isButtonDown) +{ + Colour baseColour(backgroundColour.withMultipliedSaturation(button.hasKeyboardFocus(true) ? 1.3f : 0.9f) + .withMultipliedAlpha(button.isEnabled() ? 0.9f : 0.5f)); + + if (isButtonDown || isMouseOverButton) + baseColour = baseColour.contrasting(isButtonDown ? 0.2f : 0.1f); + + const bool flatOnLeft = button.isConnectedOnLeft(); + const bool flatOnRight = button.isConnectedOnRight(); + const bool flatOnTop = button.isConnectedOnTop(); + const bool flatOnBottom = button.isConnectedOnBottom(); + + const float width = button.getWidth() - 1.0f; + const float height = button.getHeight() - 1.0f; + + if (width > 0 && height > 0) + { + const float cornerSize = 4.0f; + + Path outline; + outline.addRoundedRectangle(0.5f, 0.5f, width, height, cornerSize, cornerSize, + !(flatOnLeft || flatOnTop), + !(flatOnRight || flatOnTop), + !(flatOnLeft || flatOnBottom), + !(flatOnRight || flatOnBottom)); + + drawButtonShape(g, outline, baseColour, height); + } +} diff --git a/Source/ChannelButtonLookAndFeel.h b/Source/ChannelButtonLookAndFeel.h new file mode 100644 index 0000000..ab8f5e7 --- /dev/null +++ b/Source/ChannelButtonLookAndFeel.h @@ -0,0 +1,29 @@ +/* + ============================================================================== + + ChannelButtonLookAndFeel.h + Created: 10 Oct 2016 9:38:20pm + Author: bruce + + ============================================================================== +*/ + +#ifndef ChannelButtonLookAndFeel_H_INCLUDED +#define ChannelButtonLookAndFeel_H_INCLUDED + +#include "JuceHeader.h" + +class ChannelButtonLookAndFeel : public LookAndFeel_V3 +{ + +public: + ChannelButtonLookAndFeel(); + void drawButtonBackground(Graphics& g, Button& button, const Colour& backgroundColour, + bool isMouseOverButton, bool isButtonDown); + +}; + + + + +#endif // ChannelButtonLookAndFeel_H_INCLUDED diff --git a/Source/OPLLookAndFeel.cpp b/Source/OPLLookAndFeel.cpp index ad6c5cb..f8a5847 100644 --- a/Source/OPLLookAndFeel.cpp +++ b/Source/OPLLookAndFeel.cpp @@ -12,6 +12,7 @@ #include "PluginGui.h" const Colour OPLLookAndFeel::DOS_GREEN = Colour(0xff007f00); +const Colour OPLLookAndFeel::DOS_GREEN_DARK = Colour(0xff003f00); OPLLookAndFeel::OPLLookAndFeel() { diff --git a/Source/OPLLookAndFeel.h b/Source/OPLLookAndFeel.h index 88c4c42..a39272d 100644 --- a/Source/OPLLookAndFeel.h +++ b/Source/OPLLookAndFeel.h @@ -22,6 +22,7 @@ private: public: static const Colour DOS_GREEN; + static const Colour DOS_GREEN_DARK; OPLLookAndFeel(); diff --git a/Source/PluginGui.cpp b/Source/PluginGui.cpp index cf3a15b..26607ef 100644 --- a/Source/PluginGui.cpp +++ b/Source/PluginGui.cpp @@ -7,7 +7,7 @@ the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded and re-saved. - Created with Projucer version: 4.3.1 + Created with Projucer version: 5.0.2 ------------------------------------------------------------------------------ @@ -19,6 +19,7 @@ //[Headers] You can add your own extra header files here... #include "OPLLookAndFeel.h" +#include "ChannelButtonLookAndFeel.h" //[/Headers] #include "PluginGui.h" @@ -212,7 +213,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (frequencyLabel = new Label ("frequency label", TRANS("Frequency Multiplier"))); frequencyLabel->setTooltip (TRANS("Multiplier applied to base note frequency")); - frequencyLabel->setFont (Font (15.00f, Font::plain)); + frequencyLabel->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); frequencyLabel->setJustificationType (Justification::centredLeft); frequencyLabel->setEditable (false, false, false); frequencyLabel->setColour (Label::textColourId, Colour (0xff007f00)); @@ -234,7 +235,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (aLabel = new Label ("a label", TRANS("A"))); aLabel->setTooltip (TRANS("Attack rate")); - aLabel->setFont (Font (15.00f, Font::plain)); + aLabel->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); aLabel->setJustificationType (Justification::centred); aLabel->setEditable (false, false, false); aLabel->setColour (Label::textColourId, Colour (0xff007f00)); @@ -256,7 +257,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (dLabel = new Label ("d label", TRANS("D"))); dLabel->setTooltip (TRANS("Decay rate")); - dLabel->setFont (Font (15.00f, Font::plain)); + dLabel->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); dLabel->setJustificationType (Justification::centred); dLabel->setEditable (false, false, false); dLabel->setColour (Label::textColourId, Colour (0xff007f00)); @@ -278,7 +279,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (dLabel2 = new Label ("d label", TRANS("S"))); dLabel2->setTooltip (TRANS("Sustain level")); - dLabel2->setFont (Font (15.00f, Font::plain)); + dLabel2->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); dLabel2->setJustificationType (Justification::centred); dLabel2->setEditable (false, false, false); dLabel2->setColour (Label::textColourId, Colour (0xff007f00)); @@ -300,7 +301,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (rLabel = new Label ("r label", TRANS("R"))); rLabel->setTooltip (TRANS("Release rate")); - rLabel->setFont (Font (15.00f, Font::plain)); + rLabel->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); rLabel->setJustificationType (Justification::centred); rLabel->setEditable (false, false, false); rLabel->setColour (Label::textColourId, Colour (0xff007f00)); @@ -321,7 +322,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (attenuationLabel = new Label ("attenuation label", TRANS("Attenuation"))); attenuationLabel->setTooltip (TRANS("Final output level adjustment")); - attenuationLabel->setFont (Font (15.00f, Font::plain)); + attenuationLabel->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); attenuationLabel->setJustificationType (Justification::centred); attenuationLabel->setEditable (false, false, false); attenuationLabel->setColour (Label::textColourId, Colour (0xff007f00)); @@ -330,7 +331,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (dbLabel = new Label ("db label", TRANS("dB"))); - dbLabel->setFont (Font (15.00f, Font::plain)); + dbLabel->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); dbLabel->setJustificationType (Justification::centred); dbLabel->setEditable (false, false, false); dbLabel->setColour (Label::textColourId, Colour (0xff007f00)); @@ -376,7 +377,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) Image(), 1.000f, Colour (0x00000000)); addAndMakeVisible (waveLabel = new Label ("wave label", TRANS("Wave"))); - waveLabel->setFont (Font (15.00f, Font::plain)); + waveLabel->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); waveLabel->setJustificationType (Justification::centredLeft); waveLabel->setEditable (false, false, false); waveLabel->setColour (Label::textColourId, Colour (0xff007f00)); @@ -409,7 +410,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (dbLabel2 = new Label ("db label", TRANS("dB/8ve\n"))); - dbLabel2->setFont (Font (15.00f, Font::plain)); + dbLabel2->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); dbLabel2->setJustificationType (Justification::centred); dbLabel2->setEditable (false, false, false); dbLabel2->setColour (Label::textColourId, Colour (0xff007f00)); @@ -427,7 +428,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (frequencyLabel3 = new Label ("frequency label", TRANS("Frequency Multiplier"))); frequencyLabel3->setTooltip (TRANS("Multiplier applied to base note frequency")); - frequencyLabel3->setFont (Font (15.00f, Font::plain)); + frequencyLabel3->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); frequencyLabel3->setJustificationType (Justification::centredLeft); frequencyLabel3->setEditable (false, false, false); frequencyLabel3->setColour (Label::textColourId, Colour (0xff007f00)); @@ -448,7 +449,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (aLabel2 = new Label ("a label", TRANS("A"))); aLabel2->setTooltip (TRANS("Attack rate")); - aLabel2->setFont (Font (15.00f, Font::plain)); + aLabel2->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); aLabel2->setJustificationType (Justification::centred); aLabel2->setEditable (false, false, false); aLabel2->setColour (Label::textColourId, Colour (0xff007f00)); @@ -469,7 +470,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (dLabel3 = new Label ("d label", TRANS("D"))); dLabel3->setTooltip (TRANS("Decay rate")); - dLabel3->setFont (Font (15.00f, Font::plain)); + dLabel3->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); dLabel3->setJustificationType (Justification::centred); dLabel3->setEditable (false, false, false); dLabel3->setColour (Label::textColourId, Colour (0xff007f00)); @@ -490,7 +491,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (dLabel4 = new Label ("d label", TRANS("S"))); dLabel4->setTooltip (TRANS("Sustain level")); - dLabel4->setFont (Font (15.00f, Font::plain)); + dLabel4->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); dLabel4->setJustificationType (Justification::centred); dLabel4->setEditable (false, false, false); dLabel4->setColour (Label::textColourId, Colour (0xff007f00)); @@ -511,7 +512,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (rLabel2 = new Label ("r label", TRANS("R"))); rLabel2->setTooltip (TRANS("Release rate")); - rLabel2->setFont (Font (15.00f, Font::plain)); + rLabel2->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); rLabel2->setJustificationType (Justification::centred); rLabel2->setEditable (false, false, false); rLabel2->setColour (Label::textColourId, Colour (0xff007f00)); @@ -532,7 +533,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (attenuationLabel2 = new Label ("attenuation label", TRANS("Attenuation"))); attenuationLabel2->setTooltip (TRANS("Final output level adjustment")); - attenuationLabel2->setFont (Font (15.00f, Font::plain)); + attenuationLabel2->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); attenuationLabel2->setJustificationType (Justification::centred); attenuationLabel2->setEditable (false, false, false); attenuationLabel2->setColour (Label::textColourId, Colour (0xff007f00)); @@ -541,7 +542,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (dbLabel3 = new Label ("db label", TRANS("dB"))); - dbLabel3->setFont (Font (15.00f, Font::plain)); + dbLabel3->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); dbLabel3->setJustificationType (Justification::centred); dbLabel3->setEditable (false, false, false); dbLabel3->setColour (Label::textColourId, Colour (0xff007f00)); @@ -587,7 +588,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) Image(), 1.000f, Colour (0x00000000)); addAndMakeVisible (waveLabel2 = new Label ("wave label", TRANS("Wave"))); - waveLabel2->setFont (Font (15.00f, Font::plain)); + waveLabel2->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); waveLabel2->setJustificationType (Justification::centredLeft); waveLabel2->setEditable (false, false, false); waveLabel2->setColour (Label::textColourId, Colour (0xff007f00)); @@ -621,7 +622,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (frequencyLabel4 = new Label ("frequency label", TRANS("Keyscale Attenuation"))); frequencyLabel4->setTooltip (TRANS("Attenuate amplitude with note frequency in dB per octave")); - frequencyLabel4->setFont (Font (15.00f, Font::plain)); + frequencyLabel4->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); frequencyLabel4->setJustificationType (Justification::centred); frequencyLabel4->setEditable (false, false, false); frequencyLabel4->setColour (Label::textColourId, Colour (0xff007f00)); @@ -648,7 +649,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (frequencyLabel5 = new Label ("frequency label", TRANS("Tremolo\n"))); frequencyLabel5->setTooltip (TRANS("OPL global tremolo depth")); - frequencyLabel5->setFont (Font (15.00f, Font::plain)); + frequencyLabel5->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); frequencyLabel5->setJustificationType (Justification::centredLeft); frequencyLabel5->setEditable (false, false, false); frequencyLabel5->setColour (Label::textColourId, Colour (0xff007f00)); @@ -657,7 +658,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (dbLabel5 = new Label ("db label", TRANS("dB"))); - dbLabel5->setFont (Font (15.00f, Font::plain)); + dbLabel5->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); dbLabel5->setJustificationType (Justification::centredLeft); dbLabel5->setEditable (false, false, false); dbLabel5->setColour (Label::textColourId, Colour (0xff007f00)); @@ -679,7 +680,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (frequencyLabel6 = new Label ("frequency label", TRANS("Vibrato"))); frequencyLabel6->setTooltip (TRANS("OPL global vibrato depth")); - frequencyLabel6->setFont (Font (15.00f, Font::plain)); + frequencyLabel6->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); frequencyLabel6->setJustificationType (Justification::centredLeft); frequencyLabel6->setEditable (false, false, false); frequencyLabel6->setColour (Label::textColourId, Colour (0xff007f00)); @@ -689,7 +690,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (dbLabel6 = new Label ("db label", TRANS("cents\n"))); dbLabel6->setTooltip (TRANS("A unit of pitch; 100 cents per semitone")); - dbLabel6->setFont (Font (15.00f, Font::plain)); + dbLabel6->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); dbLabel6->setJustificationType (Justification::centredLeft); dbLabel6->setEditable (false, false, false); dbLabel6->setColour (Label::textColourId, Colour (0xff007f00)); @@ -713,7 +714,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (frequencyLabel7 = new Label ("frequency label", TRANS("Feedback"))); frequencyLabel7->setTooltip (TRANS("Extent to which modulator output is fed back into itself")); - frequencyLabel7->setFont (Font (15.00f, Font::plain)); + frequencyLabel7->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); frequencyLabel7->setJustificationType (Justification::centred); frequencyLabel7->setEditable (false, false, false); frequencyLabel7->setColour (Label::textColourId, Colour (0xff007f00)); @@ -743,7 +744,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (attenuationLabel4 = new Label ("attenuation label", TRANS("Velocity Sensitivity"))); attenuationLabel4->setTooltip (TRANS("Set or disable velocity senstivity")); - attenuationLabel4->setFont (Font (15.00f, Font::plain)); + attenuationLabel4->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); attenuationLabel4->setJustificationType (Justification::centred); attenuationLabel4->setEditable (false, false, false); attenuationLabel4->setColour (Label::textColourId, Colour (0xff007f00)); @@ -824,7 +825,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) Image(), 1.000f, Colour (0x00000000)); addAndMakeVisible (dbLabel4 = new Label ("db label", TRANS("dB/8ve\n"))); - dbLabel4->setFont (Font (15.00f, Font::plain)); + dbLabel4->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); dbLabel4->setJustificationType (Justification::centred); dbLabel4->setEditable (false, false, false); dbLabel4->setColour (Label::textColourId, Colour (0xff007f00)); @@ -848,10 +849,10 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) keyscaleAttenuationComboBox->setJustificationType (Justification::centredLeft); keyscaleAttenuationComboBox->setTextWhenNothingSelected (String()); keyscaleAttenuationComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); - keyscaleAttenuationComboBox->addItem (TRANS("-0.0 db/8ve"), 1); - keyscaleAttenuationComboBox->addItem (TRANS("-3.0 db/8ve"), 2); - keyscaleAttenuationComboBox->addItem (TRANS("-1.5 db/8ve"), 3); - keyscaleAttenuationComboBox->addItem (TRANS("-6.0 db/8ve"), 4); + keyscaleAttenuationComboBox->addItem (TRANS("-0.0"), 1); + keyscaleAttenuationComboBox->addItem (TRANS("-3.0"), 2); + keyscaleAttenuationComboBox->addItem (TRANS("-1.5"), 3); + keyscaleAttenuationComboBox->addItem (TRANS("-6.0"), 4); keyscaleAttenuationComboBox->addListener (this); addAndMakeVisible (groupComponent5 = new GroupComponent ("new group", @@ -874,7 +875,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (emulatorLabel = new Label ("emulator label", TRANS("DOSBox"))); emulatorLabel->setTooltip (TRANS("Use the OPL emulator from the DOSBox project")); - emulatorLabel->setFont (Font (15.00f, Font::plain)); + emulatorLabel->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); emulatorLabel->setJustificationType (Justification::centredRight); emulatorLabel->setEditable (false, false, false); emulatorLabel->setColour (Label::textColourId, Colour (0xff007f00)); @@ -884,7 +885,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (emulatorLabel2 = new Label ("emulator label", TRANS("ZDoom"))); emulatorLabel2->setTooltip (TRANS("Use the OPL emulator from the ZDoom project")); - emulatorLabel2->setFont (Font (15.00f, Font::plain)); + emulatorLabel2->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); emulatorLabel2->setJustificationType (Justification::centredLeft); emulatorLabel2->setEditable (false, false, false); emulatorLabel2->setColour (Label::textColourId, Colour (0xff007f00)); @@ -913,7 +914,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (versionLabel = new Label ("version label", String())); - versionLabel->setFont (Font (12.00f, Font::plain)); + versionLabel->setFont (Font (12.00f, Font::plain).withTypefaceStyle ("Regular")); versionLabel->setJustificationType (Justification::centredRight); versionLabel->setEditable (false, false, false); versionLabel->setColour (Label::textColourId, Colour (0xff007f00)); @@ -938,7 +939,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) Image(), 1.000f, Colour (0x00000000)); addAndMakeVisible (label = new Label ("new label", TRANS("Toggle buttons"))); - label->setFont (Font (15.00f, Font::plain)); + label->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label->setJustificationType (Justification::centred); label->setEditable (false, false, false); label->setColour (Label::textColourId, Colours::green); @@ -947,7 +948,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label2 = new Label ("new label", TRANS("Line borders"))); - label2->setFont (Font (15.00f, Font::plain)); + label2->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label2->setJustificationType (Justification::centred); label2->setEditable (false, false, false); label2->setColour (Label::textColourId, Colours::green); @@ -977,7 +978,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) ImageCache::getFromMemory (line_border_vert_png, line_border_vert_pngSize), 0.600f, Colour (0x00000000)); addAndMakeVisible (label3 = new Label ("new label", TRANS("Temporarily removed labels to avoid making wider boxes."))); - label3->setFont (Font (15.00f, Font::plain)); + label3->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label3->setJustificationType (Justification::centred); label3->setEditable (false, false, false); label3->setColour (Label::textColourId, Colours::green); @@ -1053,7 +1054,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) ImageCache::getFromMemory (algo_switch_on_png, algo_switch_on_pngSize), 1.000f, Colour (0x00000000)); addAndMakeVisible (label4 = new Label ("new label", TRANS("AM"))); - label4->setFont (Font (15.00f, Font::plain)); + label4->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label4->setJustificationType (Justification::centredLeft); label4->setEditable (false, false, false); label4->setColour (Label::textColourId, Colours::green); @@ -1062,7 +1063,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label5 = new Label ("new label", TRANS("FM"))); - label5->setFont (Font (15.00f, Font::plain)); + label5->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label5->setJustificationType (Justification::centredLeft); label5->setEditable (false, false, false); label5->setColour (Label::textColourId, Colours::green); @@ -1071,7 +1072,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label6 = new Label ("new label", TRANS("AM"))); - label6->setFont (Font (15.00f, Font::plain)); + label6->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label6->setJustificationType (Justification::centredLeft); label6->setEditable (false, false, false); label6->setColour (Label::textColourId, Colours::black); @@ -1080,7 +1081,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label7 = new Label ("new label", TRANS("FM"))); - label7->setFont (Font (15.00f, Font::plain)); + label7->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label7->setJustificationType (Justification::centredLeft); label7->setEditable (false, false, false); label7->setColour (Label::textColourId, Colours::black); @@ -1089,7 +1090,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label8 = new Label ("new label", TRANS("Example AM/FM switches"))); - label8->setFont (Font (15.00f, Font::plain)); + label8->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label8->setJustificationType (Justification::centred); label8->setEditable (false, false, false); label8->setColour (Label::textColourId, Colours::green); @@ -1114,7 +1115,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) ImageCache::getFromMemory (algo_switch_on2_png, algo_switch_on2_pngSize), 1.000f, Colour (0x00000000)); addAndMakeVisible (label9 = new Label ("new label", TRANS("AM"))); - label9->setFont (Font (15.00f, Font::plain)); + label9->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label9->setJustificationType (Justification::centredLeft); label9->setEditable (false, false, false); label9->setColour (Label::textColourId, Colours::black); @@ -1123,7 +1124,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label10 = new Label ("new label", TRANS("FM"))); - label10->setFont (Font (15.00f, Font::plain)); + label10->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label10->setJustificationType (Justification::centredLeft); label10->setEditable (false, false, false); label10->setColour (Label::textColourId, Colours::black); @@ -1148,7 +1149,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) ImageCache::getFromMemory (algo_switch_on3_png, algo_switch_on3_pngSize), 1.000f, Colour (0x00000000)); addAndMakeVisible (label11 = new Label ("new label", TRANS("AM"))); - label11->setFont (Font (15.00f, Font::plain)); + label11->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label11->setJustificationType (Justification::centredLeft); label11->setEditable (false, false, false); label11->setColour (Label::textColourId, Colours::black); @@ -1157,7 +1158,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label12 = new Label ("new label", TRANS("FM"))); - label12->setFont (Font (15.00f, Font::plain)); + label12->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label12->setJustificationType (Justification::centredLeft); label12->setEditable (false, false, false); label12->setColour (Label::textColourId, Colours::black); @@ -1182,7 +1183,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) ImageCache::getFromMemory (twoopFm_png, twoopFm_pngSize), 1.000f, Colour (0x00000000)); addAndMakeVisible (label13 = new Label ("new label", TRANS("M"))); - label13->setFont (Font (15.00f, Font::plain)); + label13->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label13->setJustificationType (Justification::centred); label13->setEditable (false, false, false); label13->setColour (TextEditor::textColourId, Colours::black); @@ -1190,7 +1191,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label14 = new Label ("new label", TRANS("C"))); - label14->setFont (Font (15.00f, Font::plain)); + label14->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label14->setJustificationType (Justification::centred); label14->setEditable (false, false, false); label14->setColour (TextEditor::textColourId, Colours::black); @@ -1198,7 +1199,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label15 = new Label ("new label", TRANS("M"))); - label15->setFont (Font (15.00f, Font::plain)); + label15->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label15->setJustificationType (Justification::centred); label15->setEditable (false, false, false); label15->setColour (TextEditor::textColourId, Colours::black); @@ -1206,7 +1207,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label16 = new Label ("new label", TRANS("C"))); - label16->setFont (Font (15.00f, Font::plain)); + label16->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label16->setJustificationType (Justification::centred); label16->setEditable (false, false, false); label16->setColour (TextEditor::textColourId, Colours::black); @@ -1214,7 +1215,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label17 = new Label ("new label", TRANS("Example Algorithms"))); - label17->setFont (Font (15.00f, Font::plain)); + label17->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label17->setJustificationType (Justification::centred); label17->setEditable (false, false, false); label17->setColour (Label::textColourId, Colours::green); @@ -1235,7 +1236,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) ImageCache::getFromMemory (algo_switch_on_png, algo_switch_on_pngSize), 1.000f, Colour (0x00000000)); addAndMakeVisible (label18 = new Label ("new label", TRANS("AM"))); - label18->setFont (Font (15.00f, Font::plain)); + label18->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label18->setJustificationType (Justification::centredLeft); label18->setEditable (false, false, false); label18->setColour (Label::textColourId, Colours::black); @@ -1252,7 +1253,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) ImageCache::getFromMemory (algo_switch_off_png, algo_switch_off_pngSize), 1.000f, Colour (0x00000000)); addAndMakeVisible (label19 = new Label ("new label", TRANS("FM"))); - label19->setFont (Font (15.00f, Font::plain)); + label19->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label19->setJustificationType (Justification::centredLeft); label19->setEditable (false, false, false); label19->setColour (Label::textColourId, Colours::green); @@ -1269,7 +1270,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) ImageCache::getFromMemory (twoopAm_png, twoopAm_pngSize), 1.000f, Colour (0x00000000)); addAndMakeVisible (label20 = new Label ("new label", TRANS("M"))); - label20->setFont (Font (15.00f, Font::plain)); + label20->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label20->setJustificationType (Justification::centred); label20->setEditable (false, false, false); label20->setColour (TextEditor::textColourId, Colours::black); @@ -1277,7 +1278,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label21 = new Label ("new label", TRANS("C"))); - label21->setFont (Font (15.00f, Font::plain)); + label21->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label21->setJustificationType (Justification::centred); label21->setEditable (false, false, false); label21->setColour (TextEditor::textColourId, Colours::black); @@ -1285,7 +1286,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label22 = new Label ("new label", TRANS("Example Algo Sections w/ Diagram"))); - label22->setFont (Font (15.00f, Font::plain)); + label22->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label22->setJustificationType (Justification::centred); label22->setEditable (false, false, false); label22->setColour (Label::textColourId, Colours::green); @@ -1302,7 +1303,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) ImageCache::getFromMemory (algo_switch_off_png, algo_switch_off_pngSize), 1.000f, Colour (0x00000000)); addAndMakeVisible (label23 = new Label ("new label", TRANS("AM"))); - label23->setFont (Font (15.00f, Font::plain)); + label23->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label23->setJustificationType (Justification::centredLeft); label23->setEditable (false, false, false); label23->setColour (Label::textColourId, Colours::green); @@ -1319,7 +1320,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) ImageCache::getFromMemory (algo_switch_on3_png, algo_switch_on3_pngSize), 1.000f, Colour (0x00000000)); addAndMakeVisible (label24 = new Label ("new label", TRANS("FM"))); - label24->setFont (Font (15.00f, Font::plain)); + label24->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label24->setJustificationType (Justification::centredLeft); label24->setEditable (false, false, false); label24->setColour (Label::textColourId, Colours::black); @@ -1336,7 +1337,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) ImageCache::getFromMemory (twoopFm_png, twoopFm_pngSize), 1.000f, Colour (0x00000000)); addAndMakeVisible (label25 = new Label ("new label", TRANS("M"))); - label25->setFont (Font (15.00f, Font::plain)); + label25->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label25->setJustificationType (Justification::centred); label25->setEditable (false, false, false); label25->setColour (TextEditor::textColourId, Colours::black); @@ -1344,7 +1345,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label26 = new Label ("new label", TRANS("C"))); - label26->setFont (Font (15.00f, Font::plain)); + label26->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label26->setJustificationType (Justification::centred); label26->setEditable (false, false, false); label26->setColour (TextEditor::textColourId, Colours::black); @@ -1364,7 +1365,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) ImageCache::getFromMemory (algo_switch_off_png, algo_switch_off_pngSize), 1.000f, Colour (0x00000000)); addAndMakeVisible (label27 = new Label ("new label", TRANS("AM"))); - label27->setFont (Font (15.00f, Font::plain)); + label27->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label27->setJustificationType (Justification::centredLeft); label27->setEditable (false, false, false); label27->setColour (Label::textColourId, Colours::green); @@ -1381,7 +1382,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) ImageCache::getFromMemory (algo_switch_on3_png, algo_switch_on3_pngSize), 1.000f, Colour (0x00000000)); addAndMakeVisible (label28 = new Label ("new label", TRANS("FM"))); - label28->setFont (Font (15.00f, Font::plain)); + label28->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label28->setJustificationType (Justification::centredLeft); label28->setEditable (false, false, false); label28->setColour (Label::textColourId, Colours::black); @@ -1395,7 +1396,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (frequencyLabel9 = new Label ("frequency label", TRANS("Algorithm"))); frequencyLabel9->setTooltip (TRANS("In additive mode, carrier and modulator output are simply summed rather than modulated")); - frequencyLabel9->setFont (Font (15.00f, Font::plain)); + frequencyLabel9->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); frequencyLabel9->setJustificationType (Justification::centredLeft); frequencyLabel9->setEditable (false, false, false); frequencyLabel9->setColour (Label::textColourId, Colour (0xff007f00)); @@ -1404,7 +1405,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label29 = new Label ("new label", TRANS("Example Algo Section w/o Diagram"))); - label29->setFont (Font (15.00f, Font::plain)); + label29->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label29->setJustificationType (Justification::centred); label29->setEditable (false, false, false); label29->setColour (Label::textColourId, Colours::green); @@ -1413,7 +1414,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (label30 = new Label ("new label", TRANS("Off On (Bright) On (Dark) On (Solid)"))); - label30->setFont (Font (15.00f, Font::plain)); + label30->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); label30->setJustificationType (Justification::centred); label30->setEditable (false, false, false); label30->setColour (Label::textColourId, Colours::green); @@ -1423,7 +1424,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (frequencyLabel10 = new Label ("frequency label", TRANS("Keyscale Attenuation"))); frequencyLabel10->setTooltip (TRANS("Attenuate amplitude with note frequency in dB per octave")); - frequencyLabel10->setFont (Font (15.00f, Font::plain)); + frequencyLabel10->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); frequencyLabel10->setJustificationType (Justification::centred); frequencyLabel10->setEditable (false, false, false); frequencyLabel10->setColour (Label::textColourId, Colour (0xff007f00)); @@ -1433,7 +1434,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (attenuationLabel5 = new Label ("attenuation label", TRANS("Velocity Sensitivity"))); attenuationLabel5->setTooltip (TRANS("Set or disable velocity senstivity")); - attenuationLabel5->setFont (Font (15.00f, Font::plain)); + attenuationLabel5->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); attenuationLabel5->setJustificationType (Justification::centred); attenuationLabel5->setEditable (false, false, false); attenuationLabel5->setColour (Label::textColourId, Colour (0xff007f00)); @@ -1522,7 +1523,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) Image(), 1.000f, Colour (0x00000000)); addAndMakeVisible (dbLabel7 = new Label ("db label", TRANS("FM"))); - dbLabel7->setFont (Font (15.00f, Font::plain)); + dbLabel7->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); dbLabel7->setJustificationType (Justification::centredLeft); dbLabel7->setEditable (false, false, false); dbLabel7->setColour (Label::textColourId, Colour (0xff007f00)); @@ -1532,7 +1533,7 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) addAndMakeVisible (dbLabel8 = new Label ("db label", TRANS("Additive"))); - dbLabel8->setFont (Font (15.00f, Font::plain)); + dbLabel8->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); dbLabel8->setJustificationType (Justification::centred); dbLabel8->setEditable (false, false, false); dbLabel8->setColour (Label::textColourId, Colour (0xff007f00)); @@ -1540,12 +1541,6 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) dbLabel8->setColour (TextEditor::textColourId, Colours::black); dbLabel8->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - addAndMakeVisible (imageButton = new ImageButton ("new button")); - - imageButton->setImages (false, true, true, - ImageCache::getFromMemory (adlib_png, adlib_pngSize), 1.000f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); //[UserPreSize] LookAndFeel::setDefaultLookAndFeel(new OPLLookAndFeel()); @@ -1675,10 +1670,16 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) sustainButton2->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); Font fw(Font::getDefaultMonospacedFontName(), 14, Font::bold); + ChannelButtonLookAndFeel *channelButtonLookAndFeel = new ChannelButtonLookAndFeel(); + String context = String("Disable channel "); for (unsigned int i = 0; i < channels.size(); ++i) { - TextButton *channel = new TextButton(TRANS("-"), String("Disable channel %d", i + 1)); - channel->setColour(Label::textColourId, Colour(COLOUR_MID)); + TextButton *channel = new TextButton(TRANS("-"), context + (i + 1)); + channel->setLookAndFeel(channelButtonLookAndFeel); + channel->setColour(TextButton::ColourIds::buttonColourId, Colours::black); + channel->setColour(TextButton::ColourIds::buttonOnColourId, Colours::black); + channel->setColour(TextButton::ColourIds::textColourOnId, OPLLookAndFeel::DOS_GREEN); + channel->setColour(TextButton::ColourIds::textColourOffId, OPLLookAndFeel::DOS_GREEN); channel->addListener(this); addAndMakeVisible(channel); channels[i] = channel; @@ -1857,7 +1858,6 @@ PluginGui::~PluginGui() hiHatButton = nullptr; dbLabel7 = nullptr; dbLabel8 = nullptr; - imageButton = nullptr; //[Destructor]. You can add your own custom destruction code here.. @@ -1897,8 +1897,8 @@ void PluginGui::resized() dLabel2->setBounds (136, 304, 30, 24); rSlider->setBounds (184, 208, 30, 88); rLabel->setBounds (184, 304, 30, 24); - attenuationSlider->setBounds (328, 200, 56, 126); - attenuationLabel->setBounds (304, 168, 112, 24); + attenuationSlider->setBounds (328, 184, 56, 142); + attenuationLabel->setBounds (304, 160, 112, 24); dbLabel->setBounds (384, 304, 32, 24); sineImageButton->setBounds (88, 113, 34, 30); halfsineImageButton->setBounds (128, 113, 34, 30); @@ -1920,8 +1920,8 @@ void PluginGui::resized() dLabel4->setBounds (560, 304, 30, 24); rSlider2->setBounds (608, 208, 30, 88); rLabel2->setBounds (608, 304, 30, 24); - attenuationSlider2->setBounds (752, 200, 56, 126); - attenuationLabel2->setBounds (728, 168, 112, 24); + attenuationSlider2->setBounds (752, 184, 56, 142); + attenuationLabel2->setBounds (728, 160, 112, 24); dbLabel3->setBounds (800, 304, 40, 24); sineImageButton2->setBounds (512, 113, 34, 30); halfsineImageButton2->setBounds (552, 113, 34, 30); @@ -2038,7 +2038,6 @@ void PluginGui::resized() hiHatButton->setBounds (632, 512, 30, 30); dbLabel7->setBounds (320, 520, 32, 40); dbLabel8->setBounds (392, 520, 72, 40); - imageButton->setBounds (656, 232, 64, 64); //[UserResized] Add your own custom resize handling here.. for (unsigned int i = 0; i < channels.size(); ++i) channels[i]->setBounds(64+88*i, 30, 28, 28); @@ -2197,24 +2196,19 @@ void PluginGui::buttonClicked (Button* buttonThatWasClicked) { //[UserbuttonClicked_Pre] // TODO: - // - prevent all channels from being disabled // - fix button tooltip text - // - button styling - // - automatically select channel(s) by default + // - automatically select channel(s) by default? // - record output to file for (int i = 1; i <= Hiopl::CHANNELS; ++i) { Button* channelButton = channels[i - 1]; if (buttonThatWasClicked == channelButton) { - processor->toggleChannel(i); + if (processor->nChannelsEnabled() > 1 || !processor->isChannelEnabled(i)) { + processor->toggleChannel(i); + } const bool channelEnabled = processor->isChannelEnabled(i); - const Colour fg = channelEnabled ? Colours::black : OPLLookAndFeel::DOS_GREEN; - const Colour bg = channelEnabled ? OPLLookAndFeel::DOS_GREEN : Colours::black; - - channelButton->setColour(TextButton::ColourIds::buttonColourId, bg); - channelButton->setColour(TextButton::ColourIds::buttonOnColourId, bg); - channelButton->setColour(TextButton::ColourIds::textColourOnId, fg); - channelButton->setColour(TextButton::ColourIds::textColourOffId, fg); - + Colour textColour = channelEnabled ? OPLLookAndFeel::DOS_GREEN : OPLLookAndFeel::DOS_GREEN_DARK; + channelButton->setColour(TextButton::ColourIds::textColourOnId, textColour); + channelButton->setColour(TextButton::ColourIds::textColourOffId, textColour); return; } } @@ -2648,7 +2642,8 @@ BEGIN_JUCER_METADATA virtualName="" explicitFocusOrder="0" pos="40 168 152 24" tooltip="Multiplier applied to base note frequency" textCol="ff007f00" edTextCol="ff000000" edBkgCol="0" labelText="Frequency Multiplier" editableSingleClick="0" editableDoubleClick="0" focusDiscardsChanges="0" - fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/> + fontname="Default font" fontsize="15" kerning="0" bold="0" italic="0" + justification="33"/> + fontname="Default font" fontsize="15" kerning="0" bold="0" italic="0" + justification="36"/> + fontname="Default font" fontsize="15" kerning="0" bold="0" italic="0" + justification="36"/> + fontname="Default font" fontsize="15" kerning="0" bold="0" italic="0" + justification="36"/> + fontname="Default font" fontsize="15" kerning="0" bold="0" italic="0" + justification="36"/>