From 637e49fc531d40528fc893dc54ed264570d0c323 Mon Sep 17 00:00:00 2001 From: jefrus Date: Thu, 12 Feb 2015 22:13:54 -0500 Subject: [PATCH 1/8] Added Xcode exporter. Its only set to build for VSTi on Mac (32 or 64-bit work) at the moment as a tweak the AU build. Missing functions and types found on Windows are now supplemented with replacements. Other typedefs depending on compiler implementation were replaced with more predictable ones --- JuceOPLVSTi.jucer | 246 ++++++++++++++++++++++---------------- Source/DROMultiplexer.cpp | 16 ++- Source/PluginProcessor.h | 2 +- Source/config.h | 48 +++++--- Source/hiopl.h | 184 ++++++++++++++-------------- Source/itoa.h | 50 ++++++++ Source/windows.h | 85 +++++++++++++ Source/zdopl.cpp | 10 +- 8 files changed, 422 insertions(+), 219 deletions(-) create mode 100644 Source/itoa.h create mode 100644 Source/windows.h diff --git a/JuceOPLVSTi.jucer b/JuceOPLVSTi.jucer index 942e45b..56c8035 100644 --- a/JuceOPLVSTi.jucer +++ b/JuceOPLVSTi.jucer @@ -1,105 +1,141 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/DROMultiplexer.cpp b/Source/DROMultiplexer.cpp index 8292c83..bbd5623 100644 --- a/Source/DROMultiplexer.cpp +++ b/Source/DROMultiplexer.cpp @@ -1,7 +1,17 @@ #include "DROMultiplexer.h" - #include "JuceHeader.h" -#include + +/// Jeff-Russ added guard against windows.h include if not windows: +#ifdef _WIN32 // covers both 32 and 64-bit + #include +#else + #include "windows.h" +#endif + +/// Jeff-Russ added to replace mising itoa for xcode: +#if __APPLE__ + #include "itoa.h" +#endif // Used by the first recording instance to claim master status DROMultiplexer* DROMultiplexer::master = NULL; @@ -186,7 +196,7 @@ void DROMultiplexer::TwoOpMelodicNoteOn(Hiopl* opl, int inCh) { char addr[16]; int outCh = _FindFreeChannel(opl, inCh); _DebugOut(" <- "); - _DebugOut(itoa((int)opl, addr, 16)); +/// _DebugOut(itoa((int)opl, addr, 16)); _DebugOut(" "); for (int i = 0; i < MELODIC_CHANNELS; i++) { Hiopl* tmpOpl = channels[i].opl; diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 879ce59..8b0566a 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -45,7 +45,7 @@ public: //============================================================================== const String getName() const; - static const int JuceOplvstiAudioProcessor::MAX_INSTRUMENT_FILE_SIZE_BYTES = 1024; + static const int MAX_INSTRUMENT_FILE_SIZE_BYTES = 1024; int getNumParameters(); diff --git a/Source/config.h b/Source/config.h index 5519f70..ff6fc51 100644 --- a/Source/config.h +++ b/Source/config.h @@ -63,20 +63,36 @@ #pragma warning(disable : 4996) #endif -#ifndef WIN32 -typedef long long __int64; +/// Jeff-Russ modified to be uniform across C++ implementations: +// The internal types: +#include +typedef unsigned char BYTE; +typedef int64_t __int64; +typedef double Real64; +typedef unsigned char Bit8u; +typedef signed char Bit8s; +typedef uint16_t Bit16u; +typedef int16_t Bit16s; +typedef uint32_t Bit32u; +typedef int32_t Bit32s; +typedef int64_t Bit64u; +typedef uint64_t Bit64s; +typedef Bit32u Bitu; +typedef Bit32s Bits; + + +/// Jeff-Russ PUT PLATFORM SPECIFIC STUFF HERE: +#ifdef _WIN32 // covers both 32 and 64-bit + #define INLINE __forceinline +#elif __APPLE__ + #include "TargetConditionals.h" + #define INLINE inline /// apple has no forceinline +#elif __linux + #define INLINE inline +#elif __unix + #define INLINE inline +#elif __posix + #define INLINE inline +#else + #error Unsupported Operating System #endif - -typedef double Real64; -/* The internal types */ -typedef unsigned char Bit8u; -typedef signed char Bit8s; -typedef unsigned short Bit16u; -typedef signed short Bit16s; -typedef unsigned long Bit32u; -typedef signed long Bit32s; -typedef unsigned __int64 Bit64u; -typedef signed __int64 Bit64s; -typedef unsigned int Bitu; -typedef signed int Bits; - diff --git a/Source/hiopl.h b/Source/hiopl.h index e2a9d4e..f762ca3 100644 --- a/Source/hiopl.h +++ b/Source/hiopl.h @@ -1,92 +1,92 @@ -#pragma once -#include - -#include "adlib.h" -#include "dbopl.h" -#include "zdopl.h" - -enum Waveform -{ - SIN = 0, HALF_SIN = 1, ABS_SIN = 2, QUART_SIN = 3 -}; - -enum FreqMultiple -{ - xHALF=0, x1=1, x2=2, x3=3, x4=4, x5=5, x6=6, x7=7, x8=8, x9=9, x10=10, x12=12, x15=15 -}; - -enum Emulator -{ - DOSBOX=0, ZDOOM=1 -}; - -enum Drum -{ - BDRUM=0x10, SNARE=0x8, TOM=0x4, CYMBAL=0x2, HIHAT=0x1 -}; - -class Hiopl { - public: - static const int CHANNELS = 9; - static const int OSCILLATORS = 2; - Hiopl(int buflen, Emulator emulator = ZDOOM); - void SetEmulator(Emulator emulator); - void SetPercussionMode(bool enable); - void HitPercussion(Drum drum); - void ReleasePercussion(); - - void Generate(int length, short* buffer); - void Generate(int length, float* buffer); - void SetSampleRate(int hz); - void EnableWaveformControl(); - void EnableOpl3Mode(); - - void EnableTremolo(int ch, int osc, bool enable); - void EnableVibrato(int ch, int osc, bool enable); - void VibratoDepth(bool high); - void TremoloDepth(bool high); - void EnableSustain(int ch, int osc, bool enable); - void EnableKsr(int ch, int osc, bool enable); - // true = additive; false = frequency modulation - void EnableAdditiveSynthesis(int ch, bool enable); - - void SetWaveform(int ch, int osc, Waveform wave); - void SetAttenuation(int ch, int osc, int level); - void SetKsl(int ch, int osc, int level); - void SetFrequencyMultiple(int ch, int osc, FreqMultiple mult); - void SetEnvelopeAttack(int ch, int osc, int t); - void SetEnvelopeDecay(int ch, int osc, int t); - void SetEnvelopeSustain(int ch, int osc, int level); - void SetEnvelopeRelease(int ch, int osc, int t); - // Get register address offset for operator settings for the specified channel and operator. - int _GetOffset(int ch, int osc); - // Get register address offset for channel-wide register settings for the specified channel. - int _GetOffset(int ch); - - void SetModulatorFeedback(int ch, int level); - void KeyOn(int ch, float frqHz); - void KeyOff(int ch); - // Return false if no note is active on the channel (ie release is complete) - bool IsActive(int ch); - // Return a single character string representing the stage of the envelope for the carrier operator for the channel - const char* GetState(int ch) const; - void SetFrequency(int ch, float frqHz, bool keyOn=false); - void _WriteReg(Bit32u reg, Bit8u value, Bit8u mask=0x0); - void _ClearRegBits(Bit32u reg, Bit8u mask); - // Read the last value written to the specified register address (cached) - Bit8u _ReadReg(Bit32u reg); - - ~Hiopl(); - private: - Emulator emulator; - DBOPL::Handler *adlib; - OPLEmul *zdoom; - Bit8u regCache[256]; - bool _CheckParams(int ch, int osc); - void _milliHertzToFnum(unsigned int milliHertz, unsigned int *fnum, unsigned int *block, unsigned int conversionFactor=49716); - void _ClearRegisters(); - - std::map _op1offset; - std::map _op2offset; - -}; +#pragma once +#include + +#include "adlib.h" +#include "dbopl.h" +#include "zdopl.h" + +enum Waveform +{ + SIN = 0, HALF_SIN = 1, ABS_SIN = 2, QUART_SIN = 3 +}; + +enum FreqMultiple +{ + xHALF=0, x1=1, x2=2, x3=3, x4=4, x5=5, x6=6, x7=7, x8=8, x9=9, x10=10, x12=12, x15=15 +}; + +enum Emulator +{ + DOSBOX=0, ZDOOM=1 +}; + +enum Drum +{ + BDRUM=0x10, SNARE=0x8, TOM=0x4, CYMBAL=0x2, HIHAT=0x1 +}; + +class Hiopl { + public: + static const int CHANNELS = 9; + static const int OSCILLATORS = 2; + Hiopl(int buflen, Emulator emulator = ZDOOM); + void SetEmulator(Emulator emulator); + void SetPercussionMode(bool enable); + void HitPercussion(Drum drum); + void ReleasePercussion(); + + void Generate(int length, short* buffer); + void Generate(int length, float* buffer); + void SetSampleRate(int hz); + void EnableWaveformControl(); + void EnableOpl3Mode(); + + void EnableTremolo(int ch, int osc, bool enable); + void EnableVibrato(int ch, int osc, bool enable); + void VibratoDepth(bool high); + void TremoloDepth(bool high); + void EnableSustain(int ch, int osc, bool enable); + void EnableKsr(int ch, int osc, bool enable); + // true = additive; false = frequency modulation + void EnableAdditiveSynthesis(int ch, bool enable); + + void SetWaveform(int ch, int osc, Waveform wave); + void SetAttenuation(int ch, int osc, int level); + void SetKsl(int ch, int osc, int level); + void SetFrequencyMultiple(int ch, int osc, FreqMultiple mult); + void SetEnvelopeAttack(int ch, int osc, int t); + void SetEnvelopeDecay(int ch, int osc, int t); + void SetEnvelopeSustain(int ch, int osc, int level); + void SetEnvelopeRelease(int ch, int osc, int t); + // Get register address offset for operator settings for the specified channel and operator. + int _GetOffset(int ch, int osc); + // Get register address offset for channel-wide register settings for the specified channel. + int _GetOffset(int ch); + + void SetModulatorFeedback(int ch, int level); + void KeyOn(int ch, float frqHz); + void KeyOff(int ch); + // Return false if no note is active on the channel (ie release is complete) + bool IsActive(int ch); + // Return a single character string representing the stage of the envelope for the carrier operator for the channel + const char* GetState(int ch) const; + void SetFrequency(int ch, float frqHz, bool keyOn=false); + void _WriteReg(Bit32u reg, Bit8u value, Bit8u mask=0x0); + void _ClearRegBits(Bit32u reg, Bit8u mask); + // Read the last value written to the specified register address (cached) + Bit8u _ReadReg(Bit32u reg); + + ~Hiopl(); + private: + Emulator emulator; + DBOPL::Handler *adlib; + OPLEmul *zdoom; + Bit8u regCache[256]; + bool _CheckParams(int ch, int osc); + void _milliHertzToFnum(unsigned int milliHertz, unsigned int *fnum, unsigned int *block, unsigned int conversionFactor=49716); + void _ClearRegisters(); + + std::map _op1offset; + std::map _op2offset; + +}; diff --git a/Source/itoa.h b/Source/itoa.h new file mode 100644 index 0000000..8b5a0c6 --- /dev/null +++ b/Source/itoa.h @@ -0,0 +1,50 @@ + +///============================================================================= +/// itoa.h - A C++ header to implement itoa() +/// Created: 11 Feb 2015 5:08:51pm +/// Author: Jeff-Russ +///============================================================================= +#pragma once + +#include +using namespace std; + +// A utility function to reverse a string: +void reverse(char str[], int length) +{ + int start = 0; + int end = length -1; + while (start < end) + { swap(*(str+start), *(str+end)); + start++; + end--; + } +}; + +char* itoa(int num, char* str, int base) +{ + int i = 0; + bool isNegative = false; + + if (num == 0) // Handle 0 explicitly, otherwise + { str[i++] = '0'; // empty string is printed for 0 + str[i] = '\0'; + return str; + } + // In standard itoa(), negative + if (num < 0 && base == 10) // numbers are handled only with + { isNegative = true; // base 10. Otherwise numbers + num = -num; // are considered unsigned. + } + while (num != 0) + { int rem = num % base; // Process individual digits + str[i++] = (rem > 9)? (rem-10) + 'a' : rem + '0'; + num = num/base; + } + if (isNegative) // If number is negative, append '-' + str[i++] = '-'; + + str[i] = '\0'; // Append string terminator + reverse(str, i); // Reverse the string + return str; +}; diff --git a/Source/windows.h b/Source/windows.h new file mode 100644 index 0000000..2fa0bff --- /dev/null +++ b/Source/windows.h @@ -0,0 +1,85 @@ + +///============================================================================= +/// windows.h - as needed re-definition of windows.h functions for non-win +/// Created: 11 Feb 2015 5:08:51pm +/// Author: Jeff-Russ +///============================================================================= + +#pragma once + +#include + + +// PVOID - A pointer to any type. +// This type is declared in WinNT.h as follows: +typedef void* PVOID; + +// DWORDLONG A 64-bit unsigned integer. +// This type is declared in IntSafe.h as follows: +typedef uint64_t DWORDLONG; + + +#define WINAPI + +// DWORD - A 32-bit unsigned integer. +// This type is declared in IntSafe.h as follows: +typedef uint32_t DWORD; + +// WCHAR - A 16-bit unicode character +// This type is declared in WinNT.h as follows: +typedef int16_t WCHAR; + +// HANDLE - A handle to an object. +// This type is declared in WinDef.h as follows: +typedef PVOID HANDLE; + +DWORD STD_INPUT_HANDLE = -10; +DWORD STD_OUTPUT_HANDLE = -11; +DWORD STD_ERROR_HANDLE = -12; + + +#define MAX_PATH PATH_MAX + +// BYTE - A byte (8-bits) +// This type is declared in WinDef.h as follows: +typedef unsigned char BYTE; + +// WORD - A 16-bit unsigned integer. +// This type is declared in WinDef.h as follows: +typedef uint16_t WORD; + +// BOOL - A boolean variable +// This type is declared in WinDef.h as follows: +typedef BYTE BOOL; + +DWORD GetStdHandle (DWORD handle) { return handle; } + +void WriteConsole(DWORD conout,const char* strPtr, + DWORD count, DWORD* countAdr, int* nul) +{ + std::string msgType = "NOTICE: "; + + if (conout == -10) + msgType = "INPUT: "; + else if (conout == -11) + msgType = "OUTPUT: "; + else if (conout == -12) + msgType = "ERROR: "; + else + msgType = "NOTICE: "; + + std::string message (const char* str, uint32_t count); + + std::cout << std::endl << msgType << message; +} + +void AllocConsole() +{ + std::cout << std::endl << "=== Starting debug console....." << std::endl; +} +void FreeConsole() +{ + std::cout << std::endl << "=== Exited debug console ===" << std::endl; +} + + diff --git a/Source/zdopl.cpp b/Source/zdopl.cpp index fae6b8c..e362768 100644 --- a/Source/zdopl.cpp +++ b/Source/zdopl.cpp @@ -46,9 +46,15 @@ #include #include #include +#include /// Jeff-Russ added to get rand() and RAND_MAX + + +/*typedef unsigned __int8 BYTE;*/ /// Jeff changed to char and put in config.h + +#ifndef M_PI /// Jeff-Russ added condition to silence xcode warning + #define M_PI 3.141592654 +#endif -typedef unsigned __int8 BYTE; -#define M_PI 3.141592654 #include "config.h" #include "zdopl.h" From 2fcf6c639524c9f077591f2ad43842a180fe0f4e Mon Sep 17 00:00:00 2001 From: Jeff-Russ Date: Fri, 13 Feb 2015 13:08:38 -0500 Subject: [PATCH 2/8] No significant changes, just silencing warnings by minor modifications and replacements of deprecated juce methods. --- JuceOPLVSTi.jucer | 68 +- Source/PluginGui.cpp | 4358 ++++++++++++++++++------------------ Source/PluginProcessor.cpp | 3 +- Source/config.h | 34 +- Source/dbopl.cpp | 4 + Source/windows.h | 2 +- 6 files changed, 2251 insertions(+), 2218 deletions(-) diff --git a/JuceOPLVSTi.jucer b/JuceOPLVSTi.jucer index 56c8035..8d4b687 100644 --- a/JuceOPLVSTi.jucer +++ b/JuceOPLVSTi.jucer @@ -17,25 +17,20 @@ - + - - - - + - @@ -46,6 +41,9 @@ + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -121,20 +119,20 @@ isDebug="0" optimisation="2" targetName="JuceOPL" cppLibType="libc++"/> - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/Source/PluginGui.cpp b/Source/PluginGui.cpp index c497921..52158ec 100644 --- a/Source/PluginGui.cpp +++ b/Source/PluginGui.cpp @@ -1,2167 +1,2191 @@ -/* - ============================================================================== - - This is an automatically generated GUI class created by the Introjucer! - - Be careful when adding custom code to these files, as only the code within - the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded - and re-saved. - - Created with Introjucer version: 3.1.0 - - ------------------------------------------------------------------------------ - - The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-13 by Raw Material Software Ltd. - - ============================================================================== -*/ - -//[Headers] You can add your own extra header files here... -//[/Headers] - -#include "PluginGui.h" - - -//[MiscUserDefs] You can add your own user definitions and misc code here... -void PluginGui::updateFromParameters() -{ - emulatorSlider->setValue(processor->getEnumParameter("Emulator"), juce::NotificationType::dontSendNotification); - setRecordButtonState(processor->isThisInstanceRecording()); - - sineImageButton->setToggleState(false, false); - halfsineImageButton->setToggleState(false, false); - abssineImageButton->setToggleState(false, false); - quartersineImageButton->setToggleState(false, false); - alternatingsineImageButton->setToggleState(false, false); - camelsineImageButton->setToggleState(false, false); - squareImageButton->setToggleState(false, false); - logsawImageButton->setToggleState(false, false); - switch(processor->getEnumParameter("Modulator Wave")) { - case 0: sineImageButton->setToggleState(true, false); break; - case 1: halfsineImageButton->setToggleState(true, false); break; - case 2: abssineImageButton->setToggleState(true, false); break; - case 3: quartersineImageButton->setToggleState(true, false); break; - case 4: alternatingsineImageButton->setToggleState(true, false); break; - case 5: camelsineImageButton->setToggleState(true, false); break; - case 6: squareImageButton->setToggleState(true, false); break; - case 7: logsawImageButton->setToggleState(true, false); break; - - } - sineImageButton2->setToggleState(false, false); - halfsineImageButton2->setToggleState(false, false); - abssineImageButton2->setToggleState(false, false); - quartersineImageButton2->setToggleState(false, false); - alternatingsineImageButton2->setToggleState(false, false); - camelsineImageButton2->setToggleState(false, false); - squareImageButton2->setToggleState(false, false); - logsawImageButton2->setToggleState(false, false); - switch(processor->getEnumParameter("Carrier Wave")) { - case 0: sineImageButton2->setToggleState(true, false); break; - case 1: halfsineImageButton2->setToggleState(true, false); break; - case 2: abssineImageButton2->setToggleState(true, false); break; - case 3: quartersineImageButton2->setToggleState(true, false); break; - case 4: alternatingsineImageButton2->setToggleState(true, false); break; - case 5: camelsineImageButton2->setToggleState(true, false); break; - case 6: squareImageButton2->setToggleState(true, false); break; - case 7: logsawImageButton2->setToggleState(true, false); break; - } - - frequencyComboBox->setSelectedItemIndex(processor->getEnumParameter("Modulator Frequency Multiplier"), true); - frequencyComboBox2->setSelectedItemIndex(processor->getEnumParameter("Carrier Frequency Multiplier"), true); - - attenuationSlider->setValue(processor->getEnumParameter("Modulator Attenuation") * -0.75, juce::NotificationType::dontSendNotification); - attenuationSlider2->setValue(processor->getEnumParameter("Carrier Attenuation") * -0.75, juce::NotificationType::dontSendNotification); - - aSlider->setValue(processor->getIntParameter("Modulator Attack"), juce::NotificationType::dontSendNotification); - dSlider->setValue(processor->getIntParameter("Modulator Decay"), juce::NotificationType::dontSendNotification); - sSlider->setValue(processor->getIntParameter("Modulator Sustain Level"), juce::NotificationType::dontSendNotification); - rSlider->setValue(processor->getIntParameter("Modulator Release"), juce::NotificationType::dontSendNotification); - aSlider2->setValue(processor->getIntParameter("Carrier Attack"), juce::NotificationType::dontSendNotification); - dSlider2->setValue(processor->getIntParameter("Carrier Decay"), juce::NotificationType::dontSendNotification); - sSlider2->setValue(processor->getIntParameter("Carrier Sustain Level"), juce::NotificationType::dontSendNotification); - rSlider2->setValue(processor->getIntParameter("Carrier Release"), juce::NotificationType::dontSendNotification); - - keyscaleAttenuationComboBox->setSelectedItemIndex(processor->getEnumParameter("Modulator Keyscale Level"), true); - keyscaleAttenuationComboBox2->setSelectedItemIndex(processor->getEnumParameter("Carrier Keyscale Level"), true); - - - if (processor->getEnumParameter("Modulator Tremolo")) tremoloButton->setToggleState(true, false); - if (processor->getEnumParameter("Modulator Vibrato")) vibratoButton->setToggleState(true, false); - if (processor->getEnumParameter("Modulator Sustain")) sustainButton->setToggleState(true, false); - if (processor->getEnumParameter("Modulator Keyscale Rate")) keyscaleEnvButton->setToggleState(true, false); - - if (processor->getEnumParameter("Carrier Tremolo")) tremoloButton2->setToggleState(true, false); - if (processor->getEnumParameter("Carrier Vibrato")) vibratoButton2->setToggleState(true, false); - if (processor->getEnumParameter("Carrier Sustain")) sustainButton2->setToggleState(true, false); - if (processor->getEnumParameter("Carrier Keyscale Rate")) keyscaleEnvButton2->setToggleState(true, false); - - vibratoSlider->setValue(processor->getEnumParameter("Vibrato Depth") * 7.0 + 7.0, juce::NotificationType::dontSendNotification); - tremoloSlider->setValue(processor->getEnumParameter("Tremolo Depth") * 3.8 + 1.0, juce::NotificationType::dontSendNotification); - feedbackSlider->setValue(processor->getIntParameter("Modulator Feedback"), juce::NotificationType::dontSendNotification); - - velocityComboBox->setSelectedItemIndex(processor->getEnumParameter("Modulator Velocity Sensitivity"), true); - velocityComboBox2->setSelectedItemIndex(processor->getEnumParameter("Carrier Velocity Sensitivity"), true); - - algorithmComboBox->setSelectedItemIndex(processor->getEnumParameter("Algorithm"), true); - - percussionComboBox->setSelectedItemIndex(processor->getEnumParameter("Percussion Mode"), true); - - tooltipWindow.setColour(tooltipWindow.backgroundColourId, Colour(0x0)); - tooltipWindow.setColour(tooltipWindow.textColourId, Colour(COLOUR_MID)); -} - -void PluginGui::setRecordButtonState(bool recording) { - if (recording) { - recordButton->setColour(TextButton::buttonColourId, Colour(COLOUR_RECORDING)); - recordButton->setButtonText("Recording.."); - recordButton->setColour(ToggleButton::textColourId, Colour(COLOUR_RECORDING)); - } else { - recordButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); - recordButton->setButtonText("Record to DRO"); - recordButton->setColour(ToggleButton::textColourId, Colour(COLOUR_MID)); - } -} - -//[/MiscUserDefs] - -//============================================================================== -PluginGui::PluginGui (JuceOplvstiAudioProcessor* ownerFilter) - : AudioProcessorEditor (ownerFilter) -{ - addAndMakeVisible (groupComponent = new GroupComponent ("new group", - TRANS("Modulator"))); - groupComponent->setTextLabelPosition (Justification::centredLeft); - groupComponent->setColour (GroupComponent::outlineColourId, Colour (0xff007f00)); - groupComponent->setColour (GroupComponent::textColourId, Colour (0xff007f00)); - - addAndMakeVisible (frequencyComboBox = new ComboBox ("frequency combo box")); - frequencyComboBox->setEditableText (false); - frequencyComboBox->setJustificationType (Justification::centredLeft); - frequencyComboBox->setTextWhenNothingSelected (String::empty); - frequencyComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); - frequencyComboBox->addListener (this); - - addAndMakeVisible (frequencyLabel = new Label ("frequency label", - TRANS("Frequency"))); - frequencyLabel->setTooltip (TRANS("Multiplier applied to base note frequency")); - frequencyLabel->setFont (Font (15.00f, Font::plain)); - frequencyLabel->setJustificationType (Justification::centredLeft); - frequencyLabel->setEditable (false, false, false); - frequencyLabel->setColour (Label::textColourId, Colour (0xff007f00)); - frequencyLabel->setColour (TextEditor::textColourId, Colours::black); - frequencyLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (aSlider = new Slider ("a slider")); - aSlider->setTooltip (TRANS("Envelope attack rate")); - aSlider->setRange (0, 15, 1); - aSlider->setSliderStyle (Slider::LinearVertical); - aSlider->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); - aSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); - aSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); - aSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); - aSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); - aSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); - aSlider->addListener (this); - - addAndMakeVisible (aLabel = new Label ("a label", - TRANS("A"))); - aLabel->setTooltip (TRANS("Attack rate")); - aLabel->setFont (Font (15.00f, Font::plain)); - aLabel->setJustificationType (Justification::centred); - aLabel->setEditable (false, false, false); - aLabel->setColour (Label::textColourId, Colour (0xff007f00)); - aLabel->setColour (TextEditor::textColourId, Colours::black); - aLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (dSlider = new Slider ("d slider")); - dSlider->setTooltip (TRANS("Envelope decay rate")); - dSlider->setRange (0, 15, 1); - dSlider->setSliderStyle (Slider::LinearVertical); - dSlider->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); - dSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); - dSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); - dSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); - dSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); - dSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); - dSlider->addListener (this); - - addAndMakeVisible (dLabel = new Label ("d label", - TRANS("D"))); - dLabel->setTooltip (TRANS("Decay rate")); - dLabel->setFont (Font (15.00f, Font::plain)); - dLabel->setJustificationType (Justification::centred); - dLabel->setEditable (false, false, false); - dLabel->setColour (Label::textColourId, Colour (0xff007f00)); - dLabel->setColour (TextEditor::textColourId, Colours::black); - dLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (sSlider = new Slider ("s slider")); - sSlider->setTooltip (TRANS("Envelope sustain level")); - sSlider->setRange (0, 15, 1); - sSlider->setSliderStyle (Slider::LinearVertical); - sSlider->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); - sSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); - sSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); - sSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); - sSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); - sSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); - sSlider->addListener (this); - - addAndMakeVisible (dLabel2 = new Label ("d label", - TRANS("S"))); - dLabel2->setTooltip (TRANS("Sustain level")); - dLabel2->setFont (Font (15.00f, Font::plain)); - dLabel2->setJustificationType (Justification::centred); - dLabel2->setEditable (false, false, false); - dLabel2->setColour (Label::textColourId, Colour (0xff007f00)); - dLabel2->setColour (TextEditor::textColourId, Colours::black); - dLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (rSlider = new Slider ("r slider")); - rSlider->setTooltip (TRANS("Envelope release rate")); - rSlider->setRange (0, 15, 1); - rSlider->setSliderStyle (Slider::LinearVertical); - rSlider->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); - rSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); - rSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); - rSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); - rSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); - rSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); - rSlider->addListener (this); - - addAndMakeVisible (rLabel = new Label ("r label", - TRANS("R"))); - rLabel->setTooltip (TRANS("Release rate")); - rLabel->setFont (Font (15.00f, Font::plain)); - rLabel->setJustificationType (Justification::centred); - rLabel->setEditable (false, false, false); - rLabel->setColour (Label::textColourId, Colour (0xff007f00)); - rLabel->setColour (TextEditor::textColourId, Colours::black); - rLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (attenuationSlider = new Slider ("attenuation slider")); - attenuationSlider->setRange (-47.25, 0, 0.75); - attenuationSlider->setSliderStyle (Slider::LinearVertical); - attenuationSlider->setTextBoxStyle (Slider::TextBoxBelow, false, 64, 20); - attenuationSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); - attenuationSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); - attenuationSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); - attenuationSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); - attenuationSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); - attenuationSlider->addListener (this); - - addAndMakeVisible (attenuationLabel = new Label ("attenuation label", - TRANS("Attenuation"))); - attenuationLabel->setTooltip (TRANS("Final output level adjustment")); - attenuationLabel->setFont (Font (15.00f, Font::plain)); - attenuationLabel->setJustificationType (Justification::centred); - attenuationLabel->setEditable (false, false, false); - attenuationLabel->setColour (Label::textColourId, Colour (0xff007f00)); - attenuationLabel->setColour (TextEditor::textColourId, Colours::black); - attenuationLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (dbLabel = new Label ("db label", - TRANS("dB"))); - dbLabel->setFont (Font (15.00f, Font::plain)); - dbLabel->setJustificationType (Justification::centred); - dbLabel->setEditable (false, false, false); - dbLabel->setColour (Label::textColourId, Colour (0xff007f00)); - dbLabel->setColour (Label::outlineColourId, Colour (0x00000000)); - dbLabel->setColour (TextEditor::textColourId, Colours::black); - dbLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (sineImageButton = new ImageButton ("sine image button")); - sineImageButton->setButtonText (TRANS("Sine")); - sineImageButton->setRadioGroupId (1); - sineImageButton->addListener (this); - - sineImageButton->setImages (false, true, true, - ImageCache::getFromMemory (full_sine_png, full_sine_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (halfsineImageButton = new ImageButton ("half sine image button")); - halfsineImageButton->setButtonText (TRANS("Half Sine")); - halfsineImageButton->setRadioGroupId (1); - halfsineImageButton->addListener (this); - - halfsineImageButton->setImages (false, true, true, - ImageCache::getFromMemory (half_sine_png, half_sine_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (abssineImageButton = new ImageButton ("abs sine image button")); - abssineImageButton->setButtonText (TRANS("Abs Sine")); - abssineImageButton->setRadioGroupId (1); - abssineImageButton->addListener (this); - - abssineImageButton->setImages (false, true, true, - ImageCache::getFromMemory (abs_sine_png, abs_sine_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (quartersineImageButton = new ImageButton ("quarter sine image button")); - quartersineImageButton->setButtonText (TRANS("Quarter Sine")); - quartersineImageButton->setRadioGroupId (1); - quartersineImageButton->addListener (this); - - quartersineImageButton->setImages (false, true, true, - ImageCache::getFromMemory (quarter_sine_png, quarter_sine_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (waveLabel = new Label ("wave label", - TRANS("Wave"))); - waveLabel->setFont (Font (15.00f, Font::plain)); - waveLabel->setJustificationType (Justification::centredLeft); - waveLabel->setEditable (false, false, false); - waveLabel->setColour (Label::textColourId, Colour (0xff007f00)); - waveLabel->setColour (TextEditor::textColourId, Colours::black); - waveLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (tremoloButton = new ToggleButton ("tremolo button")); - tremoloButton->setButtonText (TRANS("Tremolo")); - tremoloButton->addListener (this); - tremoloButton->setColour (ToggleButton::textColourId, Colour (0xff007f00)); - - addAndMakeVisible (vibratoButton = new ToggleButton ("vibrato button")); - vibratoButton->setButtonText (TRANS("Vibrato")); - vibratoButton->addListener (this); - vibratoButton->setColour (ToggleButton::textColourId, Colour (0xff007f00)); - - addAndMakeVisible (sustainButton = new ToggleButton ("sustain button")); - sustainButton->setTooltip (TRANS("Enable or disable sustain when note is held")); - sustainButton->setButtonText (TRANS("Sustain")); - sustainButton->addListener (this); - sustainButton->setColour (ToggleButton::textColourId, Colour (0xff007f00)); - - addAndMakeVisible (keyscaleEnvButton = new ToggleButton ("keyscale env button")); - keyscaleEnvButton->setTooltip (TRANS("Speed up envelope rate with note frequency")); - keyscaleEnvButton->setButtonText (TRANS("Keyscale Envelope Rate")); - keyscaleEnvButton->addListener (this); - keyscaleEnvButton->setColour (ToggleButton::textColourId, Colour (0xff007f00)); - - addAndMakeVisible (frequencyLabel2 = new Label ("frequency label", - TRANS("Keyscale Attenuation"))); - frequencyLabel2->setTooltip (TRANS("Attenuate amplitude with note frequency")); - frequencyLabel2->setFont (Font (15.00f, Font::plain)); - frequencyLabel2->setJustificationType (Justification::centred); - frequencyLabel2->setEditable (false, false, false); - frequencyLabel2->setColour (Label::textColourId, Colour (0xff007f00)); - frequencyLabel2->setColour (TextEditor::textColourId, Colours::black); - frequencyLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (dbLabel2 = new Label ("db label", - TRANS("dB/8ve\n"))); - dbLabel2->setFont (Font (15.00f, Font::plain)); - dbLabel2->setJustificationType (Justification::centred); - dbLabel2->setEditable (false, false, false); - dbLabel2->setColour (Label::textColourId, Colour (0xff007f00)); - dbLabel2->setColour (Label::outlineColourId, Colour (0x00000000)); - dbLabel2->setColour (TextEditor::textColourId, Colours::black); - dbLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (groupComponent2 = new GroupComponent ("new group", - TRANS("Carrier"))); - groupComponent2->setTextLabelPosition (Justification::centredLeft); - groupComponent2->setColour (GroupComponent::outlineColourId, Colour (0xff007f00)); - groupComponent2->setColour (GroupComponent::textColourId, Colour (0xff007f00)); - - addAndMakeVisible (frequencyComboBox2 = new ComboBox ("frequency combo box")); - frequencyComboBox2->setEditableText (false); - frequencyComboBox2->setJustificationType (Justification::centredLeft); - frequencyComboBox2->setTextWhenNothingSelected (String::empty); - frequencyComboBox2->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); - frequencyComboBox2->addListener (this); - - addAndMakeVisible (frequencyLabel3 = new Label ("frequency label", - TRANS("Frequency"))); - frequencyLabel3->setTooltip (TRANS("Multiplier applied to base note frequency")); - frequencyLabel3->setFont (Font (15.00f, Font::plain)); - frequencyLabel3->setJustificationType (Justification::centredLeft); - frequencyLabel3->setEditable (false, false, false); - frequencyLabel3->setColour (Label::textColourId, Colour (0xff007f00)); - frequencyLabel3->setColour (TextEditor::textColourId, Colours::black); - frequencyLabel3->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (aSlider2 = new Slider ("a slider")); - aSlider2->setRange (0, 15, 1); - aSlider2->setSliderStyle (Slider::LinearVertical); - aSlider2->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); - aSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); - aSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); - aSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); - aSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); - aSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); - aSlider2->addListener (this); - - addAndMakeVisible (aLabel2 = new Label ("a label", - TRANS("A"))); - aLabel2->setTooltip (TRANS("Attack rate")); - aLabel2->setFont (Font (15.00f, Font::plain)); - aLabel2->setJustificationType (Justification::centred); - aLabel2->setEditable (false, false, false); - aLabel2->setColour (Label::textColourId, Colour (0xff007f00)); - aLabel2->setColour (TextEditor::textColourId, Colours::black); - aLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (dSlider2 = new Slider ("d slider")); - dSlider2->setRange (0, 15, 1); - dSlider2->setSliderStyle (Slider::LinearVertical); - dSlider2->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); - dSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); - dSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); - dSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); - dSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); - dSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); - dSlider2->addListener (this); - - addAndMakeVisible (dLabel3 = new Label ("d label", - TRANS("D"))); - dLabel3->setTooltip (TRANS("Decay rate")); - dLabel3->setFont (Font (15.00f, Font::plain)); - dLabel3->setJustificationType (Justification::centred); - dLabel3->setEditable (false, false, false); - dLabel3->setColour (Label::textColourId, Colour (0xff007f00)); - dLabel3->setColour (TextEditor::textColourId, Colours::black); - dLabel3->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (sSlider2 = new Slider ("s slider")); - sSlider2->setRange (0, 15, 1); - sSlider2->setSliderStyle (Slider::LinearVertical); - sSlider2->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); - sSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); - sSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); - sSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); - sSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); - sSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); - sSlider2->addListener (this); - - addAndMakeVisible (dLabel4 = new Label ("d label", - TRANS("S"))); - dLabel4->setTooltip (TRANS("Sustain level")); - dLabel4->setFont (Font (15.00f, Font::plain)); - dLabel4->setJustificationType (Justification::centred); - dLabel4->setEditable (false, false, false); - dLabel4->setColour (Label::textColourId, Colour (0xff007f00)); - dLabel4->setColour (TextEditor::textColourId, Colours::black); - dLabel4->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (rSlider2 = new Slider ("r slider")); - rSlider2->setRange (0, 15, 1); - rSlider2->setSliderStyle (Slider::LinearVertical); - rSlider2->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); - rSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); - rSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); - rSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); - rSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); - rSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); - rSlider2->addListener (this); - - addAndMakeVisible (rLabel2 = new Label ("r label", - TRANS("R"))); - rLabel2->setTooltip (TRANS("Release rate")); - rLabel2->setFont (Font (15.00f, Font::plain)); - rLabel2->setJustificationType (Justification::centred); - rLabel2->setEditable (false, false, false); - rLabel2->setColour (Label::textColourId, Colour (0xff007f00)); - rLabel2->setColour (TextEditor::textColourId, Colours::black); - rLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (attenuationSlider2 = new Slider ("attenuation slider")); - attenuationSlider2->setRange (-47.25, 0, 0.75); - attenuationSlider2->setSliderStyle (Slider::LinearVertical); - attenuationSlider2->setTextBoxStyle (Slider::TextBoxBelow, false, 64, 20); - attenuationSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); - attenuationSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); - attenuationSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); - attenuationSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); - attenuationSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); - attenuationSlider2->addListener (this); - - addAndMakeVisible (attenuationLabel2 = new Label ("attenuation label", - TRANS("Attenuation"))); - attenuationLabel2->setTooltip (TRANS("Final output level adjustment")); - attenuationLabel2->setFont (Font (15.00f, Font::plain)); - attenuationLabel2->setJustificationType (Justification::centred); - attenuationLabel2->setEditable (false, false, false); - attenuationLabel2->setColour (Label::textColourId, Colour (0xff007f00)); - attenuationLabel2->setColour (TextEditor::textColourId, Colours::black); - attenuationLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (dbLabel3 = new Label ("db label", - TRANS("dB"))); - dbLabel3->setFont (Font (15.00f, Font::plain)); - dbLabel3->setJustificationType (Justification::centred); - dbLabel3->setEditable (false, false, false); - dbLabel3->setColour (Label::textColourId, Colour (0xff007f00)); - dbLabel3->setColour (Label::outlineColourId, Colour (0x00000000)); - dbLabel3->setColour (TextEditor::textColourId, Colours::black); - dbLabel3->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (sineImageButton2 = new ImageButton ("sine image button")); - sineImageButton2->setButtonText (TRANS("Sine")); - sineImageButton2->setRadioGroupId (2); - sineImageButton2->addListener (this); - - sineImageButton2->setImages (false, true, true, - ImageCache::getFromMemory (full_sine_png, full_sine_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (halfsineImageButton2 = new ImageButton ("half sine image button")); - halfsineImageButton2->setButtonText (TRANS("Half Sine")); - halfsineImageButton2->setRadioGroupId (2); - halfsineImageButton2->addListener (this); - - halfsineImageButton2->setImages (false, true, true, - ImageCache::getFromMemory (half_sine_png, half_sine_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (abssineImageButton2 = new ImageButton ("abs sine image button")); - abssineImageButton2->setButtonText (TRANS("Abs Sine")); - abssineImageButton2->setRadioGroupId (2); - abssineImageButton2->addListener (this); - - abssineImageButton2->setImages (false, true, true, - ImageCache::getFromMemory (abs_sine_png, abs_sine_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (quartersineImageButton2 = new ImageButton ("quarter sine image button")); - quartersineImageButton2->setButtonText (TRANS("Quarter Sine")); - quartersineImageButton2->setRadioGroupId (2); - quartersineImageButton2->addListener (this); - - quartersineImageButton2->setImages (false, true, true, - ImageCache::getFromMemory (quarter_sine_png, quarter_sine_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (waveLabel2 = new Label ("wave label", - TRANS("Wave"))); - waveLabel2->setFont (Font (15.00f, Font::plain)); - waveLabel2->setJustificationType (Justification::centredLeft); - waveLabel2->setEditable (false, false, false); - waveLabel2->setColour (Label::textColourId, Colour (0xff007f00)); - waveLabel2->setColour (TextEditor::textColourId, Colours::black); - waveLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (tremoloButton2 = new ToggleButton ("tremolo button")); - tremoloButton2->setButtonText (TRANS("Tremolo")); - tremoloButton2->addListener (this); - tremoloButton2->setColour (ToggleButton::textColourId, Colour (0xff007f00)); - - addAndMakeVisible (vibratoButton2 = new ToggleButton ("vibrato button")); - vibratoButton2->setButtonText (TRANS("Vibrato")); - vibratoButton2->addListener (this); - vibratoButton2->setColour (ToggleButton::textColourId, Colour (0xff007f00)); - - addAndMakeVisible (sustainButton2 = new ToggleButton ("sustain button")); - sustainButton2->setTooltip (TRANS("Enable or disable sustain when note is held")); - sustainButton2->setButtonText (TRANS("Sustain")); - sustainButton2->addListener (this); - sustainButton2->setColour (ToggleButton::textColourId, Colour (0xff007f00)); - - addAndMakeVisible (keyscaleEnvButton2 = new ToggleButton ("keyscale env button")); - keyscaleEnvButton2->setTooltip (TRANS("Speed up envelope rate with note frequency")); - keyscaleEnvButton2->setButtonText (TRANS("Keyscale Envelope Rate")); - keyscaleEnvButton2->addListener (this); - keyscaleEnvButton2->setColour (ToggleButton::textColourId, Colour (0xff007f00)); - - addAndMakeVisible (frequencyLabel4 = new Label ("frequency label", - TRANS("Keyscale Attenuation"))); - frequencyLabel4->setTooltip (TRANS("Attenuate amplitude with note frequency")); - frequencyLabel4->setFont (Font (15.00f, Font::plain)); - frequencyLabel4->setJustificationType (Justification::centred); - frequencyLabel4->setEditable (false, false, false); - frequencyLabel4->setColour (Label::textColourId, Colour (0xff007f00)); - frequencyLabel4->setColour (TextEditor::textColourId, Colours::black); - frequencyLabel4->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (groupComponent3 = new GroupComponent ("new group", - TRANS("Common"))); - groupComponent3->setTextLabelPosition (Justification::centredLeft); - groupComponent3->setColour (GroupComponent::outlineColourId, Colour (0xff007f00)); - groupComponent3->setColour (GroupComponent::textColourId, Colour (0xff007f00)); - - addAndMakeVisible (tremoloSlider = new Slider ("tremolo slider")); - tremoloSlider->setRange (1, 4.8, 3.8); - tremoloSlider->setSliderStyle (Slider::LinearHorizontal); - tremoloSlider->setTextBoxStyle (Slider::TextBoxLeft, false, 44, 20); - tremoloSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); - tremoloSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); - tremoloSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); - tremoloSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); - tremoloSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); - tremoloSlider->addListener (this); - - addAndMakeVisible (frequencyLabel5 = new Label ("frequency label", - TRANS("Tremolo Depth\n"))); - frequencyLabel5->setTooltip (TRANS("OPL global tremolo depth")); - frequencyLabel5->setFont (Font (15.00f, Font::plain)); - frequencyLabel5->setJustificationType (Justification::centredLeft); - frequencyLabel5->setEditable (false, false, false); - frequencyLabel5->setColour (Label::textColourId, Colour (0xff007f00)); - frequencyLabel5->setColour (TextEditor::textColourId, Colours::black); - frequencyLabel5->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (dbLabel5 = new Label ("db label", - TRANS("dB"))); - dbLabel5->setFont (Font (15.00f, Font::plain)); - dbLabel5->setJustificationType (Justification::centredLeft); - dbLabel5->setEditable (false, false, false); - dbLabel5->setColour (Label::textColourId, Colour (0xff007f00)); - dbLabel5->setColour (Label::outlineColourId, Colour (0x00000000)); - dbLabel5->setColour (TextEditor::textColourId, Colours::black); - dbLabel5->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (vibratoSlider = new Slider ("vibrato slider")); - vibratoSlider->setRange (7, 14, 7); - vibratoSlider->setSliderStyle (Slider::LinearHorizontal); - vibratoSlider->setTextBoxStyle (Slider::TextBoxLeft, false, 44, 20); - vibratoSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); - vibratoSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); - vibratoSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); - vibratoSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); - vibratoSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); - vibratoSlider->addListener (this); - - addAndMakeVisible (frequencyLabel6 = new Label ("frequency label", - TRANS("Vibrato Depth"))); - frequencyLabel6->setTooltip (TRANS("OPL global vibrato depth")); - frequencyLabel6->setFont (Font (15.00f, Font::plain)); - frequencyLabel6->setJustificationType (Justification::centredLeft); - frequencyLabel6->setEditable (false, false, false); - frequencyLabel6->setColour (Label::textColourId, Colour (0xff007f00)); - frequencyLabel6->setColour (TextEditor::textColourId, Colours::black); - frequencyLabel6->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - 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->setJustificationType (Justification::centredLeft); - dbLabel6->setEditable (false, false, false); - dbLabel6->setColour (Label::textColourId, Colour (0xff007f00)); - dbLabel6->setColour (Label::outlineColourId, Colour (0x00000000)); - dbLabel6->setColour (TextEditor::textColourId, Colours::black); - dbLabel6->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (feedbackSlider = new Slider ("feedback slider")); - feedbackSlider->setRange (0, 7, 1); - feedbackSlider->setSliderStyle (Slider::LinearHorizontal); - feedbackSlider->setTextBoxStyle (Slider::TextBoxRight, false, 44, 20); - feedbackSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); - feedbackSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); - feedbackSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); - feedbackSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); - feedbackSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); - feedbackSlider->addListener (this); - - 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->setJustificationType (Justification::centredLeft); - frequencyLabel7->setEditable (false, false, false); - frequencyLabel7->setColour (Label::textColourId, Colour (0xff007f00)); - frequencyLabel7->setColour (TextEditor::textColourId, Colours::black); - frequencyLabel7->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (velocityComboBox = new ComboBox ("velocity combo box")); - velocityComboBox->setEditableText (false); - velocityComboBox->setJustificationType (Justification::centredLeft); - velocityComboBox->setTextWhenNothingSelected (String::empty); - velocityComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); - velocityComboBox->addItem (TRANS("Off"), 1); - velocityComboBox->addItem (TRANS("Light"), 2); - velocityComboBox->addItem (TRANS("Heavy"), 3); - velocityComboBox->addListener (this); - - addAndMakeVisible (attenuationLabel3 = new Label ("attenuation label", - TRANS("Velocity"))); - attenuationLabel3->setTooltip (TRANS("Set or disable velocity senstivity")); - attenuationLabel3->setFont (Font (15.00f, Font::plain)); - attenuationLabel3->setJustificationType (Justification::centredLeft); - attenuationLabel3->setEditable (false, false, false); - attenuationLabel3->setColour (Label::textColourId, Colour (0xff007f00)); - attenuationLabel3->setColour (TextEditor::textColourId, Colours::black); - attenuationLabel3->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (velocityComboBox2 = new ComboBox ("velocity combo box")); - velocityComboBox2->setEditableText (false); - velocityComboBox2->setJustificationType (Justification::centredLeft); - velocityComboBox2->setTextWhenNothingSelected (String::empty); - velocityComboBox2->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); - velocityComboBox2->addItem (TRANS("Off"), 1); - velocityComboBox2->addItem (TRANS("Light"), 2); - velocityComboBox2->addItem (TRANS("Heavy"), 3); - velocityComboBox2->addListener (this); - - addAndMakeVisible (attenuationLabel4 = new Label ("attenuation label", - TRANS("Velocity"))); - attenuationLabel4->setTooltip (TRANS("Set or disable velocity senstivity")); - attenuationLabel4->setFont (Font (15.00f, Font::plain)); - attenuationLabel4->setJustificationType (Justification::centredLeft); - attenuationLabel4->setEditable (false, false, false); - attenuationLabel4->setColour (Label::textColourId, Colour (0xff007f00)); - attenuationLabel4->setColour (TextEditor::textColourId, Colours::black); - attenuationLabel4->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (alternatingsineImageButton = new ImageButton ("alternating sine image button")); - alternatingsineImageButton->setButtonText (TRANS("Alternating Sine")); - alternatingsineImageButton->setRadioGroupId (1); - alternatingsineImageButton->addListener (this); - - alternatingsineImageButton->setImages (false, true, true, - ImageCache::getFromMemory (alternating_sine_png, alternating_sine_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (camelsineImageButton = new ImageButton ("camel sine image button")); - camelsineImageButton->setButtonText (TRANS("Camel Sine")); - camelsineImageButton->setRadioGroupId (1); - camelsineImageButton->addListener (this); - - camelsineImageButton->setImages (false, true, true, - ImageCache::getFromMemory (camel_sine_png, camel_sine_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (squareImageButton = new ImageButton ("square image button")); - squareImageButton->setButtonText (TRANS("Square")); - squareImageButton->setRadioGroupId (1); - squareImageButton->addListener (this); - - squareImageButton->setImages (false, true, true, - ImageCache::getFromMemory (square_png, square_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (logsawImageButton = new ImageButton ("logsaw image button")); - logsawImageButton->setButtonText (TRANS("Logarithmic Sawtooth")); - logsawImageButton->setRadioGroupId (1); - logsawImageButton->addListener (this); - - logsawImageButton->setImages (false, true, true, - ImageCache::getFromMemory (logarithmic_saw_png, logarithmic_saw_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (alternatingsineImageButton2 = new ImageButton ("alternating sine image button")); - alternatingsineImageButton2->setButtonText (TRANS("Alternating Sine")); - alternatingsineImageButton2->setRadioGroupId (2); - alternatingsineImageButton2->addListener (this); - - alternatingsineImageButton2->setImages (false, true, true, - ImageCache::getFromMemory (alternating_sine_png, alternating_sine_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (camelsineImageButton2 = new ImageButton ("camel sine image button")); - camelsineImageButton2->setButtonText (TRANS("Camel Sine")); - camelsineImageButton2->setRadioGroupId (2); - camelsineImageButton2->addListener (this); - - camelsineImageButton2->setImages (false, true, true, - ImageCache::getFromMemory (camel_sine_png, camel_sine_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (squareImageButton2 = new ImageButton ("square image button")); - squareImageButton2->setButtonText (TRANS("Square")); - squareImageButton2->setRadioGroupId (2); - squareImageButton2->addListener (this); - - squareImageButton2->setImages (false, true, true, - ImageCache::getFromMemory (square_png, square_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (logsawImageButton2 = new ImageButton ("logsaw image button")); - logsawImageButton2->setButtonText (TRANS("Logarithmic Sawtooth")); - logsawImageButton2->setRadioGroupId (2); - logsawImageButton2->addListener (this); - - logsawImageButton2->setImages (false, true, true, - ImageCache::getFromMemory (logarithmic_saw_png, logarithmic_saw_pngSize), 0.500f, Colour (0x00000000), - Image(), 0.500f, Colour (0x00000000), - Image(), 1.000f, Colour (0x00000000)); - addAndMakeVisible (algorithmComboBox = new ComboBox ("algorithm combo box")); - algorithmComboBox->setEditableText (false); - algorithmComboBox->setJustificationType (Justification::centredLeft); - algorithmComboBox->setTextWhenNothingSelected (String::empty); - algorithmComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); - algorithmComboBox->addItem (TRANS("FM"), 1); - algorithmComboBox->addItem (TRANS("Additive"), 2); - algorithmComboBox->addListener (this); - - addAndMakeVisible (frequencyLabel8 = new Label ("frequency label", - TRANS("Algorithm"))); - frequencyLabel8->setTooltip (TRANS("In additive mode, carrier and modulator output are simply summed rather than modulated")); - frequencyLabel8->setFont (Font (15.00f, Font::plain)); - frequencyLabel8->setJustificationType (Justification::centredLeft); - frequencyLabel8->setEditable (false, false, false); - frequencyLabel8->setColour (Label::textColourId, Colour (0xff007f00)); - frequencyLabel8->setColour (TextEditor::textColourId, Colours::black); - frequencyLabel8->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (dbLabel4 = new Label ("db label", - TRANS("dB/8ve\n"))); - dbLabel4->setFont (Font (15.00f, Font::plain)); - dbLabel4->setJustificationType (Justification::centred); - dbLabel4->setEditable (false, false, false); - dbLabel4->setColour (Label::textColourId, Colour (0xff007f00)); - dbLabel4->setColour (Label::outlineColourId, Colour (0x00000000)); - dbLabel4->setColour (TextEditor::textColourId, Colours::black); - dbLabel4->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (keyscaleAttenuationComboBox2 = new ComboBox ("keyscale combo box")); - keyscaleAttenuationComboBox2->setEditableText (false); - keyscaleAttenuationComboBox2->setJustificationType (Justification::centredLeft); - keyscaleAttenuationComboBox2->setTextWhenNothingSelected (String::empty); - keyscaleAttenuationComboBox2->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); - keyscaleAttenuationComboBox2->addItem (TRANS("-0.0"), 1); - keyscaleAttenuationComboBox2->addItem (TRANS("-3.0"), 2); - keyscaleAttenuationComboBox2->addItem (TRANS("-1.5"), 3); - keyscaleAttenuationComboBox2->addItem (TRANS("-6.0"), 4); - keyscaleAttenuationComboBox2->addListener (this); - - addAndMakeVisible (keyscaleAttenuationComboBox = new ComboBox ("keyscale combo box")); - keyscaleAttenuationComboBox->setEditableText (false); - keyscaleAttenuationComboBox->setJustificationType (Justification::centredLeft); - keyscaleAttenuationComboBox->setTextWhenNothingSelected (String::empty); - keyscaleAttenuationComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); - 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 (groupComponent4 = new GroupComponent ("new group", - TRANS("Channels"))); - groupComponent4->setTextLabelPosition (Justification::centredLeft); - groupComponent4->setColour (GroupComponent::outlineColourId, Colour (0xff007f00)); - groupComponent4->setColour (GroupComponent::textColourId, Colour (0xff007f00)); - - addAndMakeVisible (groupComponent5 = new GroupComponent ("new group", - TRANS("Emulator"))); - groupComponent5->setTextLabelPosition (Justification::centredLeft); - groupComponent5->setColour (GroupComponent::outlineColourId, Colour (0xff007f00)); - groupComponent5->setColour (GroupComponent::textColourId, Colour (0xff007f00)); - - addAndMakeVisible (emulatorSlider = new Slider ("emulator slider")); - emulatorSlider->setRange (0, 1, 1); - emulatorSlider->setSliderStyle (Slider::LinearHorizontal); - emulatorSlider->setTextBoxStyle (Slider::NoTextBox, true, 44, 20); - emulatorSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); - emulatorSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); - emulatorSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); - emulatorSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); - emulatorSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); - emulatorSlider->addListener (this); - - 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->setJustificationType (Justification::centredRight); - emulatorLabel->setEditable (false, false, false); - emulatorLabel->setColour (Label::textColourId, Colour (0xff007f00)); - emulatorLabel->setColour (TextEditor::textColourId, Colours::black); - emulatorLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - 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->setJustificationType (Justification::centredLeft); - emulatorLabel2->setEditable (false, false, false); - emulatorLabel2->setColour (Label::textColourId, Colour (0xff007f00)); - emulatorLabel2->setColour (TextEditor::textColourId, Colours::black); - emulatorLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - addAndMakeVisible (recordButton = new ToggleButton ("record button")); - recordButton->setTooltip (TRANS("Start recording all register writes to a DRO file - an OPL recording file format defined by DOSBox")); - recordButton->setButtonText (TRANS("Record to DRO")); - recordButton->addListener (this); - recordButton->setColour (ToggleButton::textColourId, Colour (0xff007f00)); - - addAndMakeVisible (percussionComboBox = new ComboBox ("percussion combo box")); - percussionComboBox->setEditableText (false); - percussionComboBox->setJustificationType (Justification::centredLeft); - percussionComboBox->setTextWhenNothingSelected (String::empty); - percussionComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); - percussionComboBox->addItem (TRANS("Off"), 1); - percussionComboBox->addItem (TRANS("Bass drum"), 2); - percussionComboBox->addItem (TRANS("Snare"), 3); - percussionComboBox->addItem (TRANS("Tom"), 4); - percussionComboBox->addItem (TRANS("Cymbal"), 5); - percussionComboBox->addItem (TRANS("Hi-hat"), 6); - percussionComboBox->addListener (this); - - addAndMakeVisible (percussionLabel = new Label ("percussion label", - TRANS("Percussion mode"))); - percussionLabel->setTooltip (TRANS("Enable percussion instruments instead of oscillators")); - percussionLabel->setFont (Font (15.00f, Font::plain)); - percussionLabel->setJustificationType (Justification::centredLeft); - percussionLabel->setEditable (false, false, false); - percussionLabel->setColour (Label::textColourId, Colour (0xff007f00)); - percussionLabel->setColour (TextEditor::textColourId, Colours::black); - percussionLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - - - //[UserPreSize] - frequencyComboBox->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); - frequencyComboBox->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); - frequencyComboBox->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); - frequencyComboBox->setColour (ComboBox::buttonColourId, Colours::black); - frequencyComboBox->setColour (ComboBox::backgroundColourId, Colours::black); - - frequencyComboBox->addItem ("x1/2", 16); // can't use 0 :( - frequencyComboBox->addItem ("x1", 1); - frequencyComboBox->addItem ("x2", 2); - frequencyComboBox->addItem ("x3", 3); - frequencyComboBox->addItem ("x4", 4); - frequencyComboBox->addItem ("x5", 5); - frequencyComboBox->addItem ("x6", 6); - frequencyComboBox->addItem ("x7", 7); - frequencyComboBox->addItem ("x8", 8); - frequencyComboBox->addItem ("x9", 9); - frequencyComboBox->addItem ("x10", 10); - frequencyComboBox->addItem ("x12", 12); - frequencyComboBox->addItem ("x15", 15); - - frequencyComboBox2->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); - frequencyComboBox2->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); - frequencyComboBox2->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); - frequencyComboBox2->setColour (ComboBox::buttonColourId, Colours::black); - frequencyComboBox2->setColour (ComboBox::backgroundColourId, Colours::black); - frequencyComboBox2->addItem ("x1/2", 16); // can't use 0 :( - frequencyComboBox2->addItem ("x1", 1); - frequencyComboBox2->addItem ("x2", 2); - frequencyComboBox2->addItem ("x3", 3); - frequencyComboBox2->addItem ("x4", 4); - frequencyComboBox2->addItem ("x5", 5); - frequencyComboBox2->addItem ("x6", 6); - frequencyComboBox2->addItem ("x7", 7); - frequencyComboBox2->addItem ("x8", 8); - frequencyComboBox2->addItem ("x9", 9); - frequencyComboBox2->addItem ("x10", 10); - frequencyComboBox2->addItem ("x12", 12); - frequencyComboBox2->addItem ("x15", 15); - - velocityComboBox->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); - velocityComboBox->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); - velocityComboBox->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); - velocityComboBox->setColour (ComboBox::buttonColourId, Colours::black); - velocityComboBox->setColour (ComboBox::backgroundColourId, Colours::black); - velocityComboBox2->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); - velocityComboBox2->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); - velocityComboBox2->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); - velocityComboBox2->setColour (ComboBox::buttonColourId, Colours::black); - velocityComboBox2->setColour (ComboBox::backgroundColourId, Colours::black); - - algorithmComboBox->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); - algorithmComboBox->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); - algorithmComboBox->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); - algorithmComboBox->setColour (ComboBox::buttonColourId, Colours::black); - algorithmComboBox->setColour (ComboBox::backgroundColourId, Colours::black); - - keyscaleAttenuationComboBox->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); - keyscaleAttenuationComboBox->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); - keyscaleAttenuationComboBox->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); - keyscaleAttenuationComboBox->setColour (ComboBox::buttonColourId, Colours::black); - keyscaleAttenuationComboBox->setColour (ComboBox::backgroundColourId, Colours::black); - keyscaleAttenuationComboBox2->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); - keyscaleAttenuationComboBox2->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); - keyscaleAttenuationComboBox2->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); - keyscaleAttenuationComboBox2->setColour (ComboBox::buttonColourId, Colours::black); - keyscaleAttenuationComboBox2->setColour (ComboBox::backgroundColourId, Colours::black); - - percussionComboBox->setColour(ComboBox::textColourId, Colour(COLOUR_MID)); - percussionComboBox->setColour(ComboBox::outlineColourId, Colour(COLOUR_MID)); - percussionComboBox->setColour(ComboBox::arrowColourId, Colour(COLOUR_MID)); - percussionComboBox->setColour(ComboBox::buttonColourId, Colours::black); - percussionComboBox->setColour(ComboBox::backgroundColourId, Colours::black); - - sineImageButton->setClickingTogglesState(true); - sineImageButton->setRepaintsOnMouseActivity(false); - abssineImageButton->setClickingTogglesState(true); - abssineImageButton->setRepaintsOnMouseActivity(false); - halfsineImageButton->setClickingTogglesState(true); - halfsineImageButton->setRepaintsOnMouseActivity(false); - quartersineImageButton->setClickingTogglesState(true); - quartersineImageButton->setRepaintsOnMouseActivity(false); - alternatingsineImageButton->setClickingTogglesState(true); - alternatingsineImageButton->setRepaintsOnMouseActivity(false); - camelsineImageButton->setClickingTogglesState(true); - camelsineImageButton->setRepaintsOnMouseActivity(false); - squareImageButton->setClickingTogglesState(true); - squareImageButton->setRepaintsOnMouseActivity(false); - logsawImageButton->setClickingTogglesState(true); - logsawImageButton->setRepaintsOnMouseActivity(false); - - sineImageButton2->setClickingTogglesState(true); - sineImageButton2->setRepaintsOnMouseActivity(false); - abssineImageButton2->setClickingTogglesState(true); - abssineImageButton2->setRepaintsOnMouseActivity(false); - halfsineImageButton2->setClickingTogglesState(true); - halfsineImageButton2->setRepaintsOnMouseActivity(false); - quartersineImageButton2->setClickingTogglesState(true); - quartersineImageButton2->setRepaintsOnMouseActivity(false); - alternatingsineImageButton2->setClickingTogglesState(true); - alternatingsineImageButton2->setRepaintsOnMouseActivity(false); - camelsineImageButton2->setClickingTogglesState(true); - camelsineImageButton2->setRepaintsOnMouseActivity(false); - squareImageButton2->setClickingTogglesState(true); - squareImageButton2->setRepaintsOnMouseActivity(false); - logsawImageButton2->setClickingTogglesState(true); - logsawImageButton2->setRepaintsOnMouseActivity(false); - - recordButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); - tremoloButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); - vibratoButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); - keyscaleEnvButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); - sustainButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); - tremoloButton2->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); - vibratoButton2->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); - keyscaleEnvButton2->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); - sustainButton2->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); - - Font fw(Font::getDefaultMonospacedFontName(), 14, Font::bold); - for (unsigned int i = 0; i < channels.size(); ++i) - { - Label *channel = new Label("chan label", TRANS("-")); - channel->setColour(Label::textColourId, Colour(COLOUR_MID)); - channel->setJustificationType(Justification::centred); - addAndMakeVisible(channel); - channels[i] = channel; - } - //[/UserPreSize] - - setSize (860, 550); - - - //[Constructor] You can add your own custom stuff here.. - processor = ownerFilter; - startTimer(1000/30); - //[/Constructor] -} - -PluginGui::~PluginGui() -{ - //[Destructor_pre]. You can add your own custom destruction code here.. - //[/Destructor_pre] - - groupComponent = nullptr; - frequencyComboBox = nullptr; - frequencyLabel = nullptr; - aSlider = nullptr; - aLabel = nullptr; - dSlider = nullptr; - dLabel = nullptr; - sSlider = nullptr; - dLabel2 = nullptr; - rSlider = nullptr; - rLabel = nullptr; - attenuationSlider = nullptr; - attenuationLabel = nullptr; - dbLabel = nullptr; - sineImageButton = nullptr; - halfsineImageButton = nullptr; - abssineImageButton = nullptr; - quartersineImageButton = nullptr; - waveLabel = nullptr; - tremoloButton = nullptr; - vibratoButton = nullptr; - sustainButton = nullptr; - keyscaleEnvButton = nullptr; - frequencyLabel2 = nullptr; - dbLabel2 = nullptr; - groupComponent2 = nullptr; - frequencyComboBox2 = nullptr; - frequencyLabel3 = nullptr; - aSlider2 = nullptr; - aLabel2 = nullptr; - dSlider2 = nullptr; - dLabel3 = nullptr; - sSlider2 = nullptr; - dLabel4 = nullptr; - rSlider2 = nullptr; - rLabel2 = nullptr; - attenuationSlider2 = nullptr; - attenuationLabel2 = nullptr; - dbLabel3 = nullptr; - sineImageButton2 = nullptr; - halfsineImageButton2 = nullptr; - abssineImageButton2 = nullptr; - quartersineImageButton2 = nullptr; - waveLabel2 = nullptr; - tremoloButton2 = nullptr; - vibratoButton2 = nullptr; - sustainButton2 = nullptr; - keyscaleEnvButton2 = nullptr; - frequencyLabel4 = nullptr; - groupComponent3 = nullptr; - tremoloSlider = nullptr; - frequencyLabel5 = nullptr; - dbLabel5 = nullptr; - vibratoSlider = nullptr; - frequencyLabel6 = nullptr; - dbLabel6 = nullptr; - feedbackSlider = nullptr; - frequencyLabel7 = nullptr; - velocityComboBox = nullptr; - attenuationLabel3 = nullptr; - velocityComboBox2 = nullptr; - attenuationLabel4 = nullptr; - alternatingsineImageButton = nullptr; - camelsineImageButton = nullptr; - squareImageButton = nullptr; - logsawImageButton = nullptr; - alternatingsineImageButton2 = nullptr; - camelsineImageButton2 = nullptr; - squareImageButton2 = nullptr; - logsawImageButton2 = nullptr; - algorithmComboBox = nullptr; - frequencyLabel8 = nullptr; - dbLabel4 = nullptr; - keyscaleAttenuationComboBox2 = nullptr; - keyscaleAttenuationComboBox = nullptr; - groupComponent4 = nullptr; - groupComponent5 = nullptr; - emulatorSlider = nullptr; - emulatorLabel = nullptr; - emulatorLabel2 = nullptr; - recordButton = nullptr; - percussionComboBox = nullptr; - percussionLabel = nullptr; - - - //[Destructor]. You can add your own custom destruction code here.. - //[/Destructor] -} - -//============================================================================== -void PluginGui::paint (Graphics& g) -{ - //[UserPrePaint] Add your own custom painting code here.. - //[/UserPrePaint] - - g.fillAll (Colours::black); - - //[UserPaint] Add your own custom painting code here.. - //[/UserPaint] -} - -void PluginGui::resized() -{ - //[UserPreResize] Add your own custom resize code here.. - //[/UserPreResize] - - groupComponent->setBounds (16, 80, 408, 344); - frequencyComboBox->setBounds (128, 152, 72, 24); - frequencyLabel->setBounds (32, 152, 80, 24); - aSlider->setBounds (40, 280, 48, 72); - aLabel->setBounds (40, 352, 48, 24); - dSlider->setBounds (104, 280, 48, 72); - dLabel->setBounds (104, 352, 48, 24); - sSlider->setBounds (168, 280, 48, 72); - dLabel2->setBounds (168, 352, 48, 24); - rSlider->setBounds (232, 280, 48, 72); - rLabel->setBounds (232, 352, 48, 24); - attenuationSlider->setBounds (312, 280, 72, 96); - attenuationLabel->setBounds (312, 384, 96, 24); - dbLabel->setBounds (376, 352, 40, 24); - sineImageButton->setBounds (88, 112, 34, 30); - halfsineImageButton->setBounds (128, 112, 34, 30); - abssineImageButton->setBounds (168, 112, 34, 30); - quartersineImageButton->setBounds (208, 112, 34, 30); - waveLabel->setBounds (32, 112, 48, 24); - tremoloButton->setBounds (144, 192, 96, 24); - vibratoButton->setBounds (40, 192, 96, 24); - sustainButton->setBounds (40, 384, 96, 24); - keyscaleEnvButton->setBounds (128, 384, 184, 24); - frequencyLabel2->setBounds (248, 184, 152, 24); - dbLabel2->setBounds (336, 156, 72, 16); - groupComponent2->setBounds (440, 80, 408, 344); - frequencyComboBox2->setBounds (552, 152, 72, 24); - frequencyLabel3->setBounds (456, 152, 80, 24); - aSlider2->setBounds (464, 280, 48, 72); - aLabel2->setBounds (464, 352, 48, 24); - dSlider2->setBounds (528, 280, 48, 72); - dLabel3->setBounds (528, 352, 48, 24); - sSlider2->setBounds (592, 280, 48, 72); - dLabel4->setBounds (592, 352, 48, 24); - rSlider2->setBounds (656, 280, 48, 72); - rLabel2->setBounds (656, 352, 48, 24); - attenuationSlider2->setBounds (736, 280, 72, 96); - attenuationLabel2->setBounds (736, 384, 96, 24); - dbLabel3->setBounds (800, 352, 40, 24); - sineImageButton2->setBounds (512, 112, 34, 30); - halfsineImageButton2->setBounds (552, 112, 34, 30); - abssineImageButton2->setBounds (592, 112, 34, 30); - quartersineImageButton2->setBounds (632, 112, 34, 30); - waveLabel2->setBounds (456, 112, 48, 24); - tremoloButton2->setBounds (576, 192, 96, 24); - vibratoButton2->setBounds (464, 192, 96, 24); - sustainButton2->setBounds (464, 384, 96, 24); - keyscaleEnvButton2->setBounds (552, 384, 184, 24); - frequencyLabel4->setBounds (672, 184, 152, 24); - groupComponent3->setBounds (16, 432, 832, 96); - tremoloSlider->setBounds (632, 456, 112, 24); - frequencyLabel5->setBounds (472, 456, 152, 24); - dbLabel5->setBounds (752, 448, 40, 40); - vibratoSlider->setBounds (632, 488, 112, 24); - frequencyLabel6->setBounds (472, 488, 152, 24); - dbLabel6->setBounds (752, 480, 47, 40); - feedbackSlider->setBounds (112, 232, 136, 24); - frequencyLabel7->setBounds (32, 232, 80, 24); - velocityComboBox->setBounds (336, 232, 72, 24); - attenuationLabel3->setBounds (272, 232, 64, 24); - velocityComboBox2->setBounds (760, 232, 72, 24); - attenuationLabel4->setBounds (696, 232, 64, 24); - alternatingsineImageButton->setBounds (288, 112, 34, 30); - camelsineImageButton->setBounds (248, 112, 34, 30); - squareImageButton->setBounds (328, 112, 34, 30); - logsawImageButton->setBounds (368, 112, 34, 30); - alternatingsineImageButton2->setBounds (714, 113, 34, 30); - camelsineImageButton2->setBounds (674, 113, 34, 30); - squareImageButton2->setBounds (754, 113, 34, 30); - logsawImageButton2->setBounds (794, 113, 34, 30); - algorithmComboBox->setBounds (552, 232, 112, 24); - frequencyLabel8->setBounds (456, 232, 80, 24); - dbLabel4->setBounds (760, 156, 72, 16); - keyscaleAttenuationComboBox2->setBounds (688, 152, 72, 24); - keyscaleAttenuationComboBox->setBounds (264, 152, 72, 24); - groupComponent4->setBounds (440, 8, 408, 64); - groupComponent5->setBounds (16, 8, 408, 64); - emulatorSlider->setBounds (200, 32, 40, 24); - emulatorLabel->setBounds (112, 32, 72, 24); - emulatorLabel2->setBounds (248, 32, 72, 24); - recordButton->setBounds (40, 456, 128, 24); - percussionComboBox->setBounds (256, 488, 112, 24); - percussionLabel->setBounds (40, 488, 163, 24); - //[UserResized] Add your own custom resize handling here.. - for (unsigned int i = 0; i < channels.size(); ++i) - channels[i]->setBounds(456+44*i+4, 36, 20, 20); - //[/UserResized] -} - -void PluginGui::comboBoxChanged (ComboBox* comboBoxThatHasChanged) -{ - //[UsercomboBoxChanged_Pre] - - //[/UsercomboBoxChanged_Pre] - - if (comboBoxThatHasChanged == frequencyComboBox) - { - //[UserComboBoxCode_frequencyComboBox] -- add your combo box handling code here.. - int id = comboBoxThatHasChanged->getSelectedId(); - if (id > 15) id = 0; - processor->setEnumParameter("Modulator Frequency Multiplier", id); - //[/UserComboBoxCode_frequencyComboBox] - } - else if (comboBoxThatHasChanged == frequencyComboBox2) - { - //[UserComboBoxCode_frequencyComboBox2] -- add your combo box handling code here.. - int id = comboBoxThatHasChanged->getSelectedId(); - if (id > 15) id = 0; - processor->setEnumParameter("Carrier Frequency Multiplier", id); - //[/UserComboBoxCode_frequencyComboBox2] - } - else if (comboBoxThatHasChanged == velocityComboBox) - { - //[UserComboBoxCode_velocityComboBox] -- add your combo box handling code here.. - int id = comboBoxThatHasChanged->getSelectedId() - 1; - processor->setEnumParameter("Modulator Velocity Sensitivity", id); - //[/UserComboBoxCode_velocityComboBox] - } - else if (comboBoxThatHasChanged == velocityComboBox2) - { - //[UserComboBoxCode_velocityComboBox2] -- add your combo box handling code here.. - int id = comboBoxThatHasChanged->getSelectedId() - 1; - processor->setEnumParameter("Carrier Velocity Sensitivity", id); - //[/UserComboBoxCode_velocityComboBox2] - } - else if (comboBoxThatHasChanged == algorithmComboBox) - { - //[UserComboBoxCode_algorithmComboBox] -- add your combo box handling code here.. - int id = comboBoxThatHasChanged->getSelectedId() - 1; - processor->setEnumParameter("Algorithm", id); - //[/UserComboBoxCode_algorithmComboBox] - } - else if (comboBoxThatHasChanged == keyscaleAttenuationComboBox2) - { - //[UserComboBoxCode_keyscaleAttenuationComboBox2] -- add your combo box handling code here.. - int id = comboBoxThatHasChanged->getSelectedId() - 1; - processor->setEnumParameter("Carrier Keyscale Level", id); - //[/UserComboBoxCode_keyscaleAttenuationComboBox2] - } - else if (comboBoxThatHasChanged == keyscaleAttenuationComboBox) - { - //[UserComboBoxCode_keyscaleAttenuationComboBox] -- add your combo box handling code here.. - int id = comboBoxThatHasChanged->getSelectedId() - 1; - processor->setEnumParameter("Modulator Keyscale Level", id); - //[/UserComboBoxCode_keyscaleAttenuationComboBox] - } - else if (comboBoxThatHasChanged == percussionComboBox) - { - //[UserComboBoxCode_percussionComboBox] -- add your combo box handling code here.. - int id = comboBoxThatHasChanged->getSelectedId() - 1; - processor->setEnumParameter("Percussion Mode", id); - //[/UserComboBoxCode_percussionComboBox] - } - - //[UsercomboBoxChanged_Post] - //[/UsercomboBoxChanged_Post] -} - -void PluginGui::sliderValueChanged (Slider* sliderThatWasMoved) -{ - //[UsersliderValueChanged_Pre] - //[/UsersliderValueChanged_Pre] - - if (sliderThatWasMoved == aSlider) - { - //[UserSliderCode_aSlider] -- add your slider handling code here.. - processor->setIntParameter("Modulator Attack", (int)sliderThatWasMoved->getValue()); - //[/UserSliderCode_aSlider] - } - else if (sliderThatWasMoved == dSlider) - { - //[UserSliderCode_dSlider] -- add your slider handling code here.. - processor->setIntParameter("Modulator Decay", (int)sliderThatWasMoved->getValue()); - //[/UserSliderCode_dSlider] - } - else if (sliderThatWasMoved == sSlider) - { - //[UserSliderCode_sSlider] -- add your slider handling code here.. - processor->setIntParameter("Modulator Sustain Level", (int)sliderThatWasMoved->getValue()); - //[/UserSliderCode_sSlider] - } - else if (sliderThatWasMoved == rSlider) - { - //[UserSliderCode_rSlider] -- add your slider handling code here.. - processor->setIntParameter("Modulator Release", (int)sliderThatWasMoved->getValue()); - //[/UserSliderCode_rSlider] - } - else if (sliderThatWasMoved == attenuationSlider) - { - //[UserSliderCode_attenuationSlider] -- add your slider handling code here.. - processor->setEnumParameter("Modulator Attenuation", -(int)(sliderThatWasMoved->getValue()/0.75)); - //[/UserSliderCode_attenuationSlider] - } - else if (sliderThatWasMoved == aSlider2) - { - //[UserSliderCode_aSlider2] -- add your slider handling code here.. - processor->setIntParameter("Carrier Attack", (int)sliderThatWasMoved->getValue()); - //[/UserSliderCode_aSlider2] - } - else if (sliderThatWasMoved == dSlider2) - { - //[UserSliderCode_dSlider2] -- add your slider handling code here.. - processor->setIntParameter("Carrier Decay", (int)sliderThatWasMoved->getValue()); - //[/UserSliderCode_dSlider2] - } - else if (sliderThatWasMoved == sSlider2) - { - //[UserSliderCode_sSlider2] -- add your slider handling code here.. - processor->setIntParameter("Carrier Sustain Level", (int)sliderThatWasMoved->getValue()); - //[/UserSliderCode_sSlider2] - } - else if (sliderThatWasMoved == rSlider2) - { - //[UserSliderCode_rSlider2] -- add your slider handling code here.. - processor->setIntParameter("Carrier Release", (int)sliderThatWasMoved->getValue()); - //[/UserSliderCode_rSlider2] - } - else if (sliderThatWasMoved == attenuationSlider2) - { - //[UserSliderCode_attenuationSlider2] -- add your slider handling code here.. - processor->setEnumParameter("Carrier Attenuation", -(int)(sliderThatWasMoved->getValue()/0.75)); - //[/UserSliderCode_attenuationSlider2] - } - else if (sliderThatWasMoved == tremoloSlider) - { - //[UserSliderCode_tremoloSlider] -- add your slider handling code here.. - processor->setEnumParameter("Tremolo Depth", sliderThatWasMoved->getValue() < 2.0 ? 0 : 1); - //[/UserSliderCode_tremoloSlider] - } - else if (sliderThatWasMoved == vibratoSlider) - { - //[UserSliderCode_vibratoSlider] -- add your slider handling code here.. - processor->setEnumParameter("Vibrato Depth", sliderThatWasMoved->getValue() < 8.0 ? 0 : 1); - //[/UserSliderCode_vibratoSlider] - } - else if (sliderThatWasMoved == feedbackSlider) - { - //[UserSliderCode_feedbackSlider] -- add your slider handling code here.. - processor->setIntParameter("Modulator Feedback", (int)sliderThatWasMoved->getValue()); - //[/UserSliderCode_feedbackSlider] - } - else if (sliderThatWasMoved == emulatorSlider) - { - //[UserSliderCode_emulatorSlider] -- add your slider handling code here.. - processor->setEnumParameter("Emulator", sliderThatWasMoved->getValue() < 0.5 ? 0 : 1); - //[/UserSliderCode_emulatorSlider] - } - - //[UsersliderValueChanged_Post] - //[/UsersliderValueChanged_Post] -} - -void PluginGui::buttonClicked (Button* buttonThatWasClicked) -{ - //[UserbuttonClicked_Pre] - //[/UserbuttonClicked_Pre] - - if (buttonThatWasClicked == sineImageButton) - { - //[UserButtonCode_sineImageButton] -- add your button handler code here.. - processor->setEnumParameter("Modulator Wave", 0); - //[/UserButtonCode_sineImageButton] - } - else if (buttonThatWasClicked == halfsineImageButton) - { - //[UserButtonCode_halfsineImageButton] -- add your button handler code here.. - processor->setEnumParameter("Modulator Wave", 1); - //[/UserButtonCode_halfsineImageButton] - } - else if (buttonThatWasClicked == abssineImageButton) - { - //[UserButtonCode_abssineImageButton] -- add your button handler code here.. - processor->setEnumParameter("Modulator Wave", 2); - //[/UserButtonCode_abssineImageButton] - } - else if (buttonThatWasClicked == quartersineImageButton) - { - //[UserButtonCode_quartersineImageButton] -- add your button handler code here.. - processor->setEnumParameter("Modulator Wave", 3); - //[/UserButtonCode_quartersineImageButton] - } - else if (buttonThatWasClicked == tremoloButton) - { - //[UserButtonCode_tremoloButton] -- add your button handler code here.. - processor->setEnumParameter("Modulator Tremolo", buttonThatWasClicked->getToggleState() ? 1 : 0); - //[/UserButtonCode_tremoloButton] - } - else if (buttonThatWasClicked == vibratoButton) - { - //[UserButtonCode_vibratoButton] -- add your button handler code here.. - processor->setEnumParameter("Modulator Vibrato", buttonThatWasClicked->getToggleState() ? 1 : 0); - //[/UserButtonCode_vibratoButton] - } - else if (buttonThatWasClicked == sustainButton) - { - //[UserButtonCode_sustainButton] -- add your button handler code here.. - processor->setEnumParameter("Modulator Sustain", buttonThatWasClicked->getToggleState() ? 1 : 0); - //[/UserButtonCode_sustainButton] - } - else if (buttonThatWasClicked == keyscaleEnvButton) - { - //[UserButtonCode_keyscaleEnvButton] -- add your button handler code here.. - processor->setEnumParameter("Modulator Keyscale Rate", buttonThatWasClicked->getToggleState() ? 1 : 0); - //[/UserButtonCode_keyscaleEnvButton] - } - else if (buttonThatWasClicked == sineImageButton2) - { - //[UserButtonCode_sineImageButton2] -- add your button handler code here.. - processor->setEnumParameter("Carrier Wave", 0); - //[/UserButtonCode_sineImageButton2] - } - else if (buttonThatWasClicked == halfsineImageButton2) - { - //[UserButtonCode_halfsineImageButton2] -- add your button handler code here.. - processor->setEnumParameter("Carrier Wave", 1); - //[/UserButtonCode_halfsineImageButton2] - } - else if (buttonThatWasClicked == abssineImageButton2) - { - //[UserButtonCode_abssineImageButton2] -- add your button handler code here.. - processor->setEnumParameter("Carrier Wave", 2); - //[/UserButtonCode_abssineImageButton2] - } - else if (buttonThatWasClicked == quartersineImageButton2) - { - //[UserButtonCode_quartersineImageButton2] -- add your button handler code here.. - processor->setEnumParameter("Carrier Wave", 3); - //[/UserButtonCode_quartersineImageButton2] - } - else if (buttonThatWasClicked == tremoloButton2) - { - //[UserButtonCode_tremoloButton2] -- add your button handler code here.. - processor->setEnumParameter("Carrier Tremolo", buttonThatWasClicked->getToggleState() ? 1 : 0); - //[/UserButtonCode_tremoloButton2] - } - else if (buttonThatWasClicked == vibratoButton2) - { - //[UserButtonCode_vibratoButton2] -- add your button handler code here.. - processor->setEnumParameter("Carrier Vibrato", buttonThatWasClicked->getToggleState() ? 1 : 0); - //[/UserButtonCode_vibratoButton2] - } - else if (buttonThatWasClicked == sustainButton2) - { - //[UserButtonCode_sustainButton2] -- add your button handler code here.. - processor->setEnumParameter("Carrier Sustain", buttonThatWasClicked->getToggleState() ? 1 : 0); - //[/UserButtonCode_sustainButton2] - } - else if (buttonThatWasClicked == keyscaleEnvButton2) - { - //[UserButtonCode_keyscaleEnvButton2] -- add your button handler code here.. - processor->setEnumParameter("Carrier Keyscale Rate", buttonThatWasClicked->getToggleState() ? 1 : 0); - //[/UserButtonCode_keyscaleEnvButton2] - } - else if (buttonThatWasClicked == alternatingsineImageButton) - { - //[UserButtonCode_alternatingsineImageButton] -- add your button handler code here.. - processor->setEnumParameter("Modulator Wave", 4); - //[/UserButtonCode_alternatingsineImageButton] - } - else if (buttonThatWasClicked == camelsineImageButton) - { - //[UserButtonCode_camelsineImageButton] -- add your button handler code here.. - processor->setEnumParameter("Modulator Wave", 5); - //[/UserButtonCode_camelsineImageButton] - } - else if (buttonThatWasClicked == squareImageButton) - { - //[UserButtonCode_squareImageButton] -- add your button handler code here.. - processor->setEnumParameter("Modulator Wave", 6); - //[/UserButtonCode_squareImageButton] - } - else if (buttonThatWasClicked == logsawImageButton) - { - //[UserButtonCode_logsawImageButton] -- add your button handler code here.. - processor->setEnumParameter("Modulator Wave", 7); - //[/UserButtonCode_logsawImageButton] - } - else if (buttonThatWasClicked == alternatingsineImageButton2) - { - //[UserButtonCode_alternatingsineImageButton2] -- add your button handler code here.. - processor->setEnumParameter("Carrier Wave", 4); - //[/UserButtonCode_alternatingsineImageButton2] - } - else if (buttonThatWasClicked == camelsineImageButton2) - { - //[UserButtonCode_camelsineImageButton2] -- add your button handler code here.. - processor->setEnumParameter("Carrier Wave", 5); - //[/UserButtonCode_camelsineImageButton2] - } - else if (buttonThatWasClicked == squareImageButton2) - { - //[UserButtonCode_squareImageButton2] -- add your button handler code here.. - processor->setEnumParameter("Carrier Wave", 6); - //[/UserButtonCode_squareImageButton2] - } - else if (buttonThatWasClicked == logsawImageButton2) - { - //[UserButtonCode_logsawImageButton2] -- add your button handler code here.. - processor->setEnumParameter("Carrier Wave", 7); - //[/UserButtonCode_logsawImageButton2] - } - else if (buttonThatWasClicked == recordButton) - { - //[UserButtonCode_recordButton] -- add your button handler code here.. - recordButton->setToggleState(false, false); - if (!processor->isAnyInstanceRecording()) { - WildcardFileFilter wildcardFilter ("*.dro", String::empty, "DRO files"); - FileBrowserComponent browser (FileBrowserComponent::saveMode, - File::nonexistent, - &wildcardFilter, - nullptr); - FileChooserDialogBox dialogBox ("Record to", - "Specify DRO output file", - browser, - true, - Colours::darkgreen); - if (dialogBox.show()) - { - File selectedFile = browser.getSelectedFile(0); - processor->startRecording(&selectedFile); - setRecordButtonState(true); - } - } else { - setRecordButtonState(false); - processor->stopRecording(); - } - //[/UserButtonCode_recordButton] - } - - //[UserbuttonClicked_Post] - //[/UserbuttonClicked_Post] -} - - - -//[MiscUserCode] You can add your own definitions of your custom methods or any other code here... - //============================================================================== - // These methods implement the FileDragAndDropTarget interface, and allow our component - // to accept drag-and-drop of files.. - - bool PluginGui::isInterestedInFileDrag (const StringArray& files) - { - return 1 == files.size() && ( - files[0].toLowerCase().endsWith(".sbi") - || files[0].toLowerCase().endsWith(".sb2") - || files[0].toLowerCase().endsWith(".sb0") - ); - } - - void PluginGui::fileDragEnter (const StringArray& files, int x, int y) - { - } - - void PluginGui::fileDragMove (const StringArray& files, int x, int y) - { - } - - void PluginGui::fileDragExit (const StringArray& files) - { - } - - void PluginGui::filesDropped (const StringArray& files, int x, int y) - { - if (isInterestedInFileDrag(files)) { - processor->loadInstrumentFromFile(files[0]); - } - } - - void PluginGui::timerCallback() - { - for (int i = 0; i < Hiopl::CHANNELS; ++i) { - channels[i]->setText(processor->getChannelEnvelopeStage(i + 1), NotificationType::dontSendNotification); - } - //channels[i]->setState(processor->isChannelActive(i+1) ? Button::buttonDown : Button::buttonNormal); - } -//[/MiscUserCode] - - -//============================================================================== -#if 0 -/* -- Introjucer information section -- - - This is where the Introjucer stores the metadata that describe this GUI layout, so - make changes in here at your peril! - -BEGIN_JUCER_METADATA - - - - - - - -END_JUCER_METADATA -*/ -#endif - -//============================================================================== -// Binary resources - be careful not to edit any of these sections! - -// JUCER_RESOURCE: full_sine_png, 203, "../img/full_sine.png" -static const unsigned char resource_PluginGui_full_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,146,73,68,65,84,88,133,237,151,81,14,64, -48,16,68,183,226,94,110,225,18,110,230,146,252,116,35,153,166,97,219,21,131,125,63,66,144,241,76,75,147,136,108,66,192,240,116,0,101,60,61,99,133,253,249,158,32,47,48,162,38,208,64,237,120,39,52,70,146, -224,168,185,250,196,206,102,104,140,68,16,228,232,72,235,59,119,234,10,141,145,8,130,148,51,235,212,120,39,235,117,75,222,230,110,209,24,41,103,86,43,78,163,141,198,72,4,65,250,59,162,116,126,181,105, -140,68,16,196,175,35,74,227,191,238,135,141,40,198,245,208,15,140,24,161,49,178,3,63,99,23,114,126,178,233,88,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; - -const char* PluginGui::full_sine_png = (const char*) resource_PluginGui_full_sine_png; -const int PluginGui::full_sine_pngSize = 203; - -// JUCER_RESOURCE: half_sine_png, 179, "../img/half_sine.png" -static const unsigned char resource_PluginGui_half_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,122,73,68,65,84,88,133,237,148,65,10,128, -32,20,5,191,209,189,186,69,135,236,22,157,172,22,33,193,72,20,102,248,130,55,155,40,50,198,73,77,17,177,133,0,67,111,129,204,120,251,198,130,251,249,27,145,31,20,201,37,88,224,234,249,75,100,138,164,224, -174,121,58,227,198,101,100,138,88,132,156,107,164,246,159,55,90,43,50,69,44,66,202,147,117,170,252,82,237,184,245,184,200,20,41,79,214,78,200,20,177,8,177,8,177,8,177,8,177,8,177,8,217,1,254,115,12,122, -78,109,41,249,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; - -const char* PluginGui::half_sine_png = (const char*) resource_PluginGui_half_sine_png; -const int PluginGui::half_sine_pngSize = 179; - -// JUCER_RESOURCE: abs_sine_png, 181, "../img/abs_sine.png" -static const unsigned char resource_PluginGui_abs_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,124,73,68,65,84,88,133,237,148,81,10,128, -32,16,5,215,232,94,221,162,67,118,201,250,81,130,17,209,182,192,13,222,252,21,62,153,125,150,201,204,78,11,192,50,91,160,176,118,87,28,120,222,7,119,126,152,251,65,35,101,34,78,210,122,255,50,23,166,145, -100,252,107,122,19,183,214,121,115,153,48,141,72,132,220,223,200,232,25,147,143,114,97,26,145,8,169,111,214,205,185,147,55,151,9,211,72,125,179,78,34,76,35,18,33,18,33,18,33,18,33,18,33,18,33,23,197,62, -17,185,230,123,254,103,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; - -const char* PluginGui::abs_sine_png = (const char*) resource_PluginGui_abs_sine_png; -const int PluginGui::abs_sine_pngSize = 181; - -// JUCER_RESOURCE: quarter_sine_png, 181, "../img/quarter_sine.png" -static const unsigned char resource_PluginGui_quarter_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,124,73,68,65,84,88,133,237,150,81,10, -128,32,16,68,215,232,94,221,162,67,118,139,78,150,31,41,209,196,162,174,31,205,199,60,8,177,28,120,77,33,38,51,187,140,128,229,111,129,74,91,228,40,215,40,131,57,154,70,86,247,73,164,133,137,28,113,35, -245,141,118,152,183,136,230,10,52,141,72,4,121,254,17,252,198,189,68,115,0,77,35,18,65,190,251,200,230,172,244,238,207,230,206,123,160,105,36,153,206,35,111,36,130,72,4,145,8,34,17,68,34,136,68,144,12, -123,138,13,78,65,207,81,74,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; - -const char* PluginGui::quarter_sine_png = (const char*) resource_PluginGui_quarter_sine_png; -const int PluginGui::quarter_sine_pngSize = 181; - -// JUCER_RESOURCE: camel_sine_png, 174, "../img/camel_sine.png" -static const unsigned char resource_PluginGui_camel_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,117,73,68,65,84,88,133,237,148,209,9,192, -32,12,68,99,233,94,221,162,67,118,139,78,86,63,218,80,56,41,129,40,245,62,238,129,136,6,225,229,132,20,51,187,140,128,101,182,128,243,45,114,60,43,91,31,38,242,51,107,115,227,93,238,201,115,18,154,68, -36,130,20,243,57,18,253,117,111,61,128,38,17,137,32,18,65,218,201,186,5,47,122,235,200,121,111,52,137,188,115,100,50,52,137,72,4,145,8,34,17,68,34,136,68,16,137,32,21,146,46,14,97,109,79,27,36,0,0,0,0, -73,69,78,68,174,66,96,130,0,0}; - -const char* PluginGui::camel_sine_png = (const char*) resource_PluginGui_camel_sine_png; -const int PluginGui::camel_sine_pngSize = 174; - -// JUCER_RESOURCE: alternating_sine_png, 197, "../img/alternating_sine.png" -static const unsigned char resource_PluginGui_alternating_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,140,73,68,65,84,88,133,99,100,96, -96,248,207,48,8,0,211,64,59,0,6,112,59,100,21,20,15,184,67,232,12,88,48,68,96,161,16,134,131,79,35,48,104,66,100,212,33,232,128,145,1,86,142,16,74,11,52,78,43,131,38,68,70,29,130,14,70,29,130,14,48,75, -86,123,2,58,112,201,103,67,233,169,36,186,224,32,132,26,52,33,130,40,71,8,1,26,151,51,131,38,68,70,29,130,14,70,29,130,14,136,207,53,48,64,163,22,220,160,9,145,81,135,160,3,210,211,8,12,80,185,197,54, -12,66,132,202,96,208,132,8,0,67,200,18,200,95,246,147,104,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; - -const char* PluginGui::alternating_sine_png = (const char*) resource_PluginGui_alternating_sine_png; -const int PluginGui::alternating_sine_pngSize = 197; - -// JUCER_RESOURCE: square_png, 179, "../img/square.png" -static const unsigned char resource_PluginGui_square_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,122,73,68,65,84,88,133,237,150,177,17,128,48, -12,3,29,142,189,216,130,37,216,44,75,66,99,83,40,85,34,238,80,161,111,146,198,190,143,10,59,45,34,238,16,96,251,91,160,216,223,91,39,59,157,92,185,96,34,197,236,203,216,36,19,153,68,44,130,88,4,177,8, -98,17,100,156,172,199,98,167,217,186,43,207,156,228,50,137,180,96,255,35,181,107,86,119,148,90,34,22,65,44,130,88,4,177,8,50,238,154,85,200,223,188,76,34,252,174,249,8,153,68,30,246,154,9,40,60,195,35, -102,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; - -const char* PluginGui::square_png = (const char*) resource_PluginGui_square_png; -const int PluginGui::square_pngSize = 179; - -// JUCER_RESOURCE: logarithmic_saw_png, 206, "../img/logarithmic_saw.png" -static const unsigned char resource_PluginGui_logarithmic_saw_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,149,73,68,65,84,88,133,237,150,81, -10,128,32,16,68,215,232,94,221,194,75,116,158,46,225,37,235,103,37,24,19,139,218,118,64,31,136,172,32,12,15,87,13,34,178,11,1,147,119,128,204,25,36,233,112,15,226,204,8,130,148,65,156,206,10,177,17,39, -104,130,204,197,74,212,57,65,109,12,177,145,12,154,193,245,143,33,54,178,64,189,65,125,247,142,193,125,200,170,179,26,166,49,18,196,234,63,210,58,91,208,149,52,70,234,93,243,150,134,1,164,3,35,72,237, -94,82,104,140,140,32,200,255,65,162,92,118,78,199,70,42,208,4,177,123,107,30,66,99,228,0,184,114,16,107,149,79,109,141,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; - -const char* PluginGui::logarithmic_saw_png = (const char*) resource_PluginGui_logarithmic_saw_png; -const int PluginGui::logarithmic_saw_pngSize = 206; - -// JUCER_RESOURCE: channeloff_png, 414, "../img/channeloff.png" -static const unsigned char resource_PluginGui_channeloff_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255,97,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187,127, -0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,222,8,25,20,6,56,156,246,144,159,0,0,0,29,105,84,88,116,67,111,109,109,101,110,116,0,0,0,0,0,67,114,101,97,116,101,100,32, -119,105,116,104,32,71,73,77,80,100,46,101,7,0,0,1,2,73,68,65,84,56,203,165,211,61,78,66,65,20,5,224,143,193,82,119,224,62,104,40,166,196,194,202,10,66,65,137,149,75,120,121,193,21,216,104,108,164,32,178, -128,183,1,94,66,67,66,172,172,140,27,176,178,192,202,70,139,55,26,2,138,2,39,153,102,230,220,159,185,231,220,154,85,100,14,113,138,46,154,233,118,138,17,10,185,183,101,122,88,9,110,99,129,11,20,104,164, -83,164,187,69,226,252,128,204,64,230,67,166,239,55,100,250,137,51,176,86,185,122,104,249,11,153,86,226,182,161,150,254,188,192,185,220,141,255,160,234,242,26,71,117,209,25,142,229,27,90,95,69,105,46,58, -193,107,72,211,30,218,30,67,116,67,146,106,178,67,130,9,154,193,158,8,201,36,113,135,216,136,105,72,14,235,237,144,160,135,81,248,118,92,182,133,10,21,183,129,162,174,244,46,122,194,157,104,166,244,252, -167,145,24,163,35,247,80,79,186,62,138,14,112,43,122,81,154,111,168,60,198,165,220,85,229,196,245,101,186,199,44,233,60,89,26,88,47,181,221,145,27,127,133,212,246,93,231,79,44,229,73,181,37,137,229,213, -0,0,0,0,73,69,78,68,174,66,96,130,0,0}; - -const char* PluginGui::channeloff_png = (const char*) resource_PluginGui_channeloff_png; -const int PluginGui::channeloff_pngSize = 414; - -// JUCER_RESOURCE: channelon_png, 326, "../img/channelon.png" -static const unsigned char resource_PluginGui_channelon_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255,97,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187,127, -0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,222,8,25,20,6,39,17,254,157,106,0,0,0,29,105,84,88,116,67,111,109,109,101,110,116,0,0,0,0,0,67,114,101,97,116,101,100,32, -119,105,116,104,32,71,73,77,80,100,46,101,7,0,0,0,170,73,68,65,84,56,203,173,147,177,13,194,48,16,69,159,143,148,176,81,20,101,129,84,84,68,217,5,89,176,0,204,16,193,0,30,0,69,202,8,169,88,131,12,64,145, -139,176,82,64,116,230,117,182,252,206,242,249,159,99,201,145,45,80,1,13,144,235,110,15,180,64,192,51,198,199,221,66,62,0,55,190,83,227,185,207,139,77,36,159,128,11,191,217,83,146,209,241,248,20,152,110, -94,35,207,20,148,60,233,24,156,190,249,133,141,157,104,195,172,84,162,221,182,210,72,244,85,22,114,33,17,209,144,88,233,69,19,102,165,21,32,36,20,8,162,217,174,13,114,141,103,156,146,216,49,80,146,1,197, -74,249,140,231,250,151,97,114,169,227,252,6,230,208,38,246,228,75,209,233,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; - -const char* PluginGui::channelon_png = (const char*) resource_PluginGui_channelon_png; -const int PluginGui::channelon_pngSize = 326; - - -//[EndFile] You can add extra defines here... -//[/EndFile] +/* + ============================================================================== + + This is an automatically generated GUI class created by the Introjucer! + + Be careful when adding custom code to these files, as only the code within + the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded + and re-saved. + + Created with Introjucer version: 3.1.0 + + ------------------------------------------------------------------------------ + + The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-13 by Raw Material Software Ltd. + + ============================================================================== +*/ + +//[Headers] You can add your own extra header files here... +//[/Headers] + +#include "PluginGui.h" + + +//[MiscUserDefs] You can add your own user definitions and misc code here... +void PluginGui::updateFromParameters() +{ + emulatorSlider->setValue(processor->getEnumParameter("Emulator"), juce::NotificationType::dontSendNotification); + setRecordButtonState(processor->isThisInstanceRecording()); + +/// setToggleState(bool, bool) is deprecated. +/// Jeff-Russ replaced the second arg of "false" with dontSendNotification: + + sineImageButton->setToggleState(false, dontSendNotification); + halfsineImageButton->setToggleState(false, dontSendNotification); + abssineImageButton->setToggleState(false, dontSendNotification); + quartersineImageButton->setToggleState(false, dontSendNotification); + alternatingsineImageButton->setToggleState(false, dontSendNotification); + camelsineImageButton->setToggleState(false, dontSendNotification); + squareImageButton->setToggleState(false, dontSendNotification); + logsawImageButton->setToggleState(false, dontSendNotification); + switch(processor->getEnumParameter("Modulator Wave")) { + case 0: sineImageButton->setToggleState(true, dontSendNotification); break; + case 1: halfsineImageButton->setToggleState(true, dontSendNotification); break; + case 2: abssineImageButton->setToggleState(true, dontSendNotification); break; + case 3: quartersineImageButton->setToggleState(true, dontSendNotification); break; + case 4: alternatingsineImageButton->setToggleState(true, dontSendNotification); break; + case 5: camelsineImageButton->setToggleState(true, dontSendNotification); break; + case 6: squareImageButton->setToggleState(true, dontSendNotification); break; + case 7: logsawImageButton->setToggleState(true, dontSendNotification); break; + + } + sineImageButton2->setToggleState(false, dontSendNotification); + halfsineImageButton2->setToggleState(false, dontSendNotification); + abssineImageButton2->setToggleState(false, dontSendNotification); + quartersineImageButton2->setToggleState(false, dontSendNotification); + alternatingsineImageButton2->setToggleState(false, dontSendNotification); + camelsineImageButton2->setToggleState(false, dontSendNotification); + squareImageButton2->setToggleState(false, dontSendNotification); + logsawImageButton2->setToggleState(false, dontSendNotification); + switch(processor->getEnumParameter("Carrier Wave")) { + case 0: sineImageButton2->setToggleState(true, dontSendNotification); break; + case 1: halfsineImageButton2->setToggleState(true, dontSendNotification); break; + case 2: abssineImageButton2->setToggleState(true, dontSendNotification); break; + case 3: quartersineImageButton2->setToggleState(true, dontSendNotification); break; + case 4: alternatingsineImageButton2->setToggleState(true, dontSendNotification); break; + case 5: camelsineImageButton2->setToggleState(true, dontSendNotification); break; + case 6: squareImageButton2->setToggleState(true, dontSendNotification); break; + case 7: logsawImageButton2->setToggleState(true, dontSendNotification); break; + } + +/// setSelectedItemIndex(bool, bool) is deprecated. +/// Jeff-Russ replaced the second arg of "true" with "sendNotificationAsync": + + frequencyComboBox->setSelectedItemIndex ( + processor->getEnumParameter("Modulator Frequency Multiplier"), + sendNotificationAsync); + frequencyComboBox2->setSelectedItemIndex ( + processor->getEnumParameter("Carrier Frequency Multiplier"), + sendNotificationAsync); + + attenuationSlider->setValue(processor->getEnumParameter("Modulator Attenuation") * -0.75, juce::NotificationType::dontSendNotification); + attenuationSlider2->setValue(processor->getEnumParameter("Carrier Attenuation") * -0.75, juce::NotificationType::dontSendNotification); + + aSlider->setValue(processor->getIntParameter("Modulator Attack"), juce::NotificationType::dontSendNotification); + dSlider->setValue(processor->getIntParameter("Modulator Decay"), juce::NotificationType::dontSendNotification); + sSlider->setValue(processor->getIntParameter("Modulator Sustain Level"), juce::NotificationType::dontSendNotification); + rSlider->setValue(processor->getIntParameter("Modulator Release"), juce::NotificationType::dontSendNotification); + aSlider2->setValue(processor->getIntParameter("Carrier Attack"), juce::NotificationType::dontSendNotification); + dSlider2->setValue(processor->getIntParameter("Carrier Decay"), juce::NotificationType::dontSendNotification); + sSlider2->setValue(processor->getIntParameter("Carrier Sustain Level"), juce::NotificationType::dontSendNotification); + rSlider2->setValue(processor->getIntParameter("Carrier Release"), juce::NotificationType::dontSendNotification); + +/// Jeff-Russ replaced the second arg of "true" with "sendNotificationAsync": + + keyscaleAttenuationComboBox->setSelectedItemIndex ( + processor->getEnumParameter("Modulator Keyscale Level"), + sendNotificationAsync); + keyscaleAttenuationComboBox2->setSelectedItemIndex ( + processor->getEnumParameter("Carrier Keyscale Level"), + sendNotificationAsync); + + + if (processor->getEnumParameter("Modulator Tremolo")) tremoloButton->setToggleState(true, dontSendNotification); + if (processor->getEnumParameter("Modulator Vibrato")) vibratoButton->setToggleState(true, dontSendNotification); + if (processor->getEnumParameter("Modulator Sustain")) sustainButton->setToggleState(true, dontSendNotification); + if (processor->getEnumParameter("Modulator Keyscale Rate")) keyscaleEnvButton->setToggleState(true, dontSendNotification); + + if (processor->getEnumParameter("Carrier Tremolo")) tremoloButton2->setToggleState(true, dontSendNotification); + if (processor->getEnumParameter("Carrier Vibrato")) vibratoButton2->setToggleState(true, dontSendNotification); + if (processor->getEnumParameter("Carrier Sustain")) sustainButton2->setToggleState(true, dontSendNotification); + if (processor->getEnumParameter("Carrier Keyscale Rate")) keyscaleEnvButton2->setToggleState(true, dontSendNotification); + + vibratoSlider->setValue(processor->getEnumParameter("Vibrato Depth") * 7.0 + 7.0, juce::NotificationType::dontSendNotification); + tremoloSlider->setValue(processor->getEnumParameter("Tremolo Depth") * 3.8 + 1.0, juce::NotificationType::dontSendNotification); + feedbackSlider->setValue(processor->getIntParameter("Modulator Feedback"), juce::NotificationType::dontSendNotification); + +/// Jeff-Russ replaced the second arg of "true" with "sendNotificationAsync": + + velocityComboBox->setSelectedItemIndex ( + processor->getEnumParameter("Modulator Velocity Sensitivity"), + sendNotificationAsync); + velocityComboBox2->setSelectedItemIndex ( + processor->getEnumParameter("Carrier Velocity Sensitivity"), + sendNotificationAsync); + algorithmComboBox->setSelectedItemIndex ( + processor->getEnumParameter("Algorithm"), + sendNotificationAsync); + percussionComboBox->setSelectedItemIndex ( + processor->getEnumParameter("Percussion Mode"), + sendNotificationAsync); + + tooltipWindow.setColour(tooltipWindow.backgroundColourId, Colour(0x0)); + tooltipWindow.setColour(tooltipWindow.textColourId, Colour(COLOUR_MID)); +} + +void PluginGui::setRecordButtonState(bool recording) { + if (recording) { + recordButton->setColour(TextButton::buttonColourId, Colour(COLOUR_RECORDING)); + recordButton->setButtonText("Recording.."); + recordButton->setColour(ToggleButton::textColourId, Colour(COLOUR_RECORDING)); + } else { + recordButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + recordButton->setButtonText("Record to DRO"); + recordButton->setColour(ToggleButton::textColourId, Colour(COLOUR_MID)); + } +} + +//[/MiscUserDefs] + +//============================================================================== +PluginGui::PluginGui (JuceOplvstiAudioProcessor* ownerFilter) + : AudioProcessorEditor (ownerFilter) +{ + addAndMakeVisible (groupComponent = new GroupComponent ("new group", + TRANS("Modulator"))); + groupComponent->setTextLabelPosition (Justification::centredLeft); + groupComponent->setColour (GroupComponent::outlineColourId, Colour (0xff007f00)); + groupComponent->setColour (GroupComponent::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (frequencyComboBox = new ComboBox ("frequency combo box")); + frequencyComboBox->setEditableText (false); + frequencyComboBox->setJustificationType (Justification::centredLeft); + frequencyComboBox->setTextWhenNothingSelected (String::empty); + frequencyComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); + frequencyComboBox->addListener (this); + + addAndMakeVisible (frequencyLabel = new Label ("frequency label", + TRANS("Frequency"))); + frequencyLabel->setTooltip (TRANS("Multiplier applied to base note frequency")); + frequencyLabel->setFont (Font (15.00f, Font::plain)); + frequencyLabel->setJustificationType (Justification::centredLeft); + frequencyLabel->setEditable (false, false, false); + frequencyLabel->setColour (Label::textColourId, Colour (0xff007f00)); + frequencyLabel->setColour (TextEditor::textColourId, Colours::black); + frequencyLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (aSlider = new Slider ("a slider")); + aSlider->setTooltip (TRANS("Envelope attack rate")); + aSlider->setRange (0, 15, 1); + aSlider->setSliderStyle (Slider::LinearVertical); + aSlider->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + aSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); + aSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); + aSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + aSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); + aSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + aSlider->addListener (this); + + addAndMakeVisible (aLabel = new Label ("a label", + TRANS("A"))); + aLabel->setTooltip (TRANS("Attack rate")); + aLabel->setFont (Font (15.00f, Font::plain)); + aLabel->setJustificationType (Justification::centred); + aLabel->setEditable (false, false, false); + aLabel->setColour (Label::textColourId, Colour (0xff007f00)); + aLabel->setColour (TextEditor::textColourId, Colours::black); + aLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (dSlider = new Slider ("d slider")); + dSlider->setTooltip (TRANS("Envelope decay rate")); + dSlider->setRange (0, 15, 1); + dSlider->setSliderStyle (Slider::LinearVertical); + dSlider->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + dSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); + dSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); + dSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + dSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); + dSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + dSlider->addListener (this); + + addAndMakeVisible (dLabel = new Label ("d label", + TRANS("D"))); + dLabel->setTooltip (TRANS("Decay rate")); + dLabel->setFont (Font (15.00f, Font::plain)); + dLabel->setJustificationType (Justification::centred); + dLabel->setEditable (false, false, false); + dLabel->setColour (Label::textColourId, Colour (0xff007f00)); + dLabel->setColour (TextEditor::textColourId, Colours::black); + dLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (sSlider = new Slider ("s slider")); + sSlider->setTooltip (TRANS("Envelope sustain level")); + sSlider->setRange (0, 15, 1); + sSlider->setSliderStyle (Slider::LinearVertical); + sSlider->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + sSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); + sSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); + sSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + sSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); + sSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + sSlider->addListener (this); + + addAndMakeVisible (dLabel2 = new Label ("d label", + TRANS("S"))); + dLabel2->setTooltip (TRANS("Sustain level")); + dLabel2->setFont (Font (15.00f, Font::plain)); + dLabel2->setJustificationType (Justification::centred); + dLabel2->setEditable (false, false, false); + dLabel2->setColour (Label::textColourId, Colour (0xff007f00)); + dLabel2->setColour (TextEditor::textColourId, Colours::black); + dLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (rSlider = new Slider ("r slider")); + rSlider->setTooltip (TRANS("Envelope release rate")); + rSlider->setRange (0, 15, 1); + rSlider->setSliderStyle (Slider::LinearVertical); + rSlider->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + rSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); + rSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); + rSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + rSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); + rSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + rSlider->addListener (this); + + addAndMakeVisible (rLabel = new Label ("r label", + TRANS("R"))); + rLabel->setTooltip (TRANS("Release rate")); + rLabel->setFont (Font (15.00f, Font::plain)); + rLabel->setJustificationType (Justification::centred); + rLabel->setEditable (false, false, false); + rLabel->setColour (Label::textColourId, Colour (0xff007f00)); + rLabel->setColour (TextEditor::textColourId, Colours::black); + rLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (attenuationSlider = new Slider ("attenuation slider")); + attenuationSlider->setRange (-47.25, 0, 0.75); + attenuationSlider->setSliderStyle (Slider::LinearVertical); + attenuationSlider->setTextBoxStyle (Slider::TextBoxBelow, false, 64, 20); + attenuationSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); + attenuationSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); + attenuationSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + attenuationSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); + attenuationSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + attenuationSlider->addListener (this); + + addAndMakeVisible (attenuationLabel = new Label ("attenuation label", + TRANS("Attenuation"))); + attenuationLabel->setTooltip (TRANS("Final output level adjustment")); + attenuationLabel->setFont (Font (15.00f, Font::plain)); + attenuationLabel->setJustificationType (Justification::centred); + attenuationLabel->setEditable (false, false, false); + attenuationLabel->setColour (Label::textColourId, Colour (0xff007f00)); + attenuationLabel->setColour (TextEditor::textColourId, Colours::black); + attenuationLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (dbLabel = new Label ("db label", + TRANS("dB"))); + dbLabel->setFont (Font (15.00f, Font::plain)); + dbLabel->setJustificationType (Justification::centred); + dbLabel->setEditable (false, false, false); + dbLabel->setColour (Label::textColourId, Colour (0xff007f00)); + dbLabel->setColour (Label::outlineColourId, Colour (0x00000000)); + dbLabel->setColour (TextEditor::textColourId, Colours::black); + dbLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (sineImageButton = new ImageButton ("sine image button")); + sineImageButton->setButtonText (TRANS("Sine")); + sineImageButton->setRadioGroupId (1); + sineImageButton->addListener (this); + + sineImageButton->setImages (false, true, true, + ImageCache::getFromMemory (full_sine_png, full_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (halfsineImageButton = new ImageButton ("half sine image button")); + halfsineImageButton->setButtonText (TRANS("Half Sine")); + halfsineImageButton->setRadioGroupId (1); + halfsineImageButton->addListener (this); + + halfsineImageButton->setImages (false, true, true, + ImageCache::getFromMemory (half_sine_png, half_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (abssineImageButton = new ImageButton ("abs sine image button")); + abssineImageButton->setButtonText (TRANS("Abs Sine")); + abssineImageButton->setRadioGroupId (1); + abssineImageButton->addListener (this); + + abssineImageButton->setImages (false, true, true, + ImageCache::getFromMemory (abs_sine_png, abs_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (quartersineImageButton = new ImageButton ("quarter sine image button")); + quartersineImageButton->setButtonText (TRANS("Quarter Sine")); + quartersineImageButton->setRadioGroupId (1); + quartersineImageButton->addListener (this); + + quartersineImageButton->setImages (false, true, true, + ImageCache::getFromMemory (quarter_sine_png, quarter_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (waveLabel = new Label ("wave label", + TRANS("Wave"))); + waveLabel->setFont (Font (15.00f, Font::plain)); + waveLabel->setJustificationType (Justification::centredLeft); + waveLabel->setEditable (false, false, false); + waveLabel->setColour (Label::textColourId, Colour (0xff007f00)); + waveLabel->setColour (TextEditor::textColourId, Colours::black); + waveLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (tremoloButton = new ToggleButton ("tremolo button")); + tremoloButton->setButtonText (TRANS("Tremolo")); + tremoloButton->addListener (this); + tremoloButton->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (vibratoButton = new ToggleButton ("vibrato button")); + vibratoButton->setButtonText (TRANS("Vibrato")); + vibratoButton->addListener (this); + vibratoButton->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (sustainButton = new ToggleButton ("sustain button")); + sustainButton->setTooltip (TRANS("Enable or disable sustain when note is held")); + sustainButton->setButtonText (TRANS("Sustain")); + sustainButton->addListener (this); + sustainButton->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (keyscaleEnvButton = new ToggleButton ("keyscale env button")); + keyscaleEnvButton->setTooltip (TRANS("Speed up envelope rate with note frequency")); + keyscaleEnvButton->setButtonText (TRANS("Keyscale Envelope Rate")); + keyscaleEnvButton->addListener (this); + keyscaleEnvButton->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (frequencyLabel2 = new Label ("frequency label", + TRANS("Keyscale Attenuation"))); + frequencyLabel2->setTooltip (TRANS("Attenuate amplitude with note frequency")); + frequencyLabel2->setFont (Font (15.00f, Font::plain)); + frequencyLabel2->setJustificationType (Justification::centred); + frequencyLabel2->setEditable (false, false, false); + frequencyLabel2->setColour (Label::textColourId, Colour (0xff007f00)); + frequencyLabel2->setColour (TextEditor::textColourId, Colours::black); + frequencyLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (dbLabel2 = new Label ("db label", + TRANS("dB/8ve\n"))); + dbLabel2->setFont (Font (15.00f, Font::plain)); + dbLabel2->setJustificationType (Justification::centred); + dbLabel2->setEditable (false, false, false); + dbLabel2->setColour (Label::textColourId, Colour (0xff007f00)); + dbLabel2->setColour (Label::outlineColourId, Colour (0x00000000)); + dbLabel2->setColour (TextEditor::textColourId, Colours::black); + dbLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (groupComponent2 = new GroupComponent ("new group", + TRANS("Carrier"))); + groupComponent2->setTextLabelPosition (Justification::centredLeft); + groupComponent2->setColour (GroupComponent::outlineColourId, Colour (0xff007f00)); + groupComponent2->setColour (GroupComponent::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (frequencyComboBox2 = new ComboBox ("frequency combo box")); + frequencyComboBox2->setEditableText (false); + frequencyComboBox2->setJustificationType (Justification::centredLeft); + frequencyComboBox2->setTextWhenNothingSelected (String::empty); + frequencyComboBox2->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); + frequencyComboBox2->addListener (this); + + addAndMakeVisible (frequencyLabel3 = new Label ("frequency label", + TRANS("Frequency"))); + frequencyLabel3->setTooltip (TRANS("Multiplier applied to base note frequency")); + frequencyLabel3->setFont (Font (15.00f, Font::plain)); + frequencyLabel3->setJustificationType (Justification::centredLeft); + frequencyLabel3->setEditable (false, false, false); + frequencyLabel3->setColour (Label::textColourId, Colour (0xff007f00)); + frequencyLabel3->setColour (TextEditor::textColourId, Colours::black); + frequencyLabel3->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (aSlider2 = new Slider ("a slider")); + aSlider2->setRange (0, 15, 1); + aSlider2->setSliderStyle (Slider::LinearVertical); + aSlider2->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + aSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); + aSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); + aSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + aSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); + aSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + aSlider2->addListener (this); + + addAndMakeVisible (aLabel2 = new Label ("a label", + TRANS("A"))); + aLabel2->setTooltip (TRANS("Attack rate")); + aLabel2->setFont (Font (15.00f, Font::plain)); + aLabel2->setJustificationType (Justification::centred); + aLabel2->setEditable (false, false, false); + aLabel2->setColour (Label::textColourId, Colour (0xff007f00)); + aLabel2->setColour (TextEditor::textColourId, Colours::black); + aLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (dSlider2 = new Slider ("d slider")); + dSlider2->setRange (0, 15, 1); + dSlider2->setSliderStyle (Slider::LinearVertical); + dSlider2->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + dSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); + dSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); + dSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + dSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); + dSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + dSlider2->addListener (this); + + addAndMakeVisible (dLabel3 = new Label ("d label", + TRANS("D"))); + dLabel3->setTooltip (TRANS("Decay rate")); + dLabel3->setFont (Font (15.00f, Font::plain)); + dLabel3->setJustificationType (Justification::centred); + dLabel3->setEditable (false, false, false); + dLabel3->setColour (Label::textColourId, Colour (0xff007f00)); + dLabel3->setColour (TextEditor::textColourId, Colours::black); + dLabel3->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (sSlider2 = new Slider ("s slider")); + sSlider2->setRange (0, 15, 1); + sSlider2->setSliderStyle (Slider::LinearVertical); + sSlider2->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + sSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); + sSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); + sSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + sSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); + sSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + sSlider2->addListener (this); + + addAndMakeVisible (dLabel4 = new Label ("d label", + TRANS("S"))); + dLabel4->setTooltip (TRANS("Sustain level")); + dLabel4->setFont (Font (15.00f, Font::plain)); + dLabel4->setJustificationType (Justification::centred); + dLabel4->setEditable (false, false, false); + dLabel4->setColour (Label::textColourId, Colour (0xff007f00)); + dLabel4->setColour (TextEditor::textColourId, Colours::black); + dLabel4->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (rSlider2 = new Slider ("r slider")); + rSlider2->setRange (0, 15, 1); + rSlider2->setSliderStyle (Slider::LinearVertical); + rSlider2->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + rSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); + rSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); + rSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + rSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); + rSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + rSlider2->addListener (this); + + addAndMakeVisible (rLabel2 = new Label ("r label", + TRANS("R"))); + rLabel2->setTooltip (TRANS("Release rate")); + rLabel2->setFont (Font (15.00f, Font::plain)); + rLabel2->setJustificationType (Justification::centred); + rLabel2->setEditable (false, false, false); + rLabel2->setColour (Label::textColourId, Colour (0xff007f00)); + rLabel2->setColour (TextEditor::textColourId, Colours::black); + rLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (attenuationSlider2 = new Slider ("attenuation slider")); + attenuationSlider2->setRange (-47.25, 0, 0.75); + attenuationSlider2->setSliderStyle (Slider::LinearVertical); + attenuationSlider2->setTextBoxStyle (Slider::TextBoxBelow, false, 64, 20); + attenuationSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); + attenuationSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); + attenuationSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + attenuationSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); + attenuationSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + attenuationSlider2->addListener (this); + + addAndMakeVisible (attenuationLabel2 = new Label ("attenuation label", + TRANS("Attenuation"))); + attenuationLabel2->setTooltip (TRANS("Final output level adjustment")); + attenuationLabel2->setFont (Font (15.00f, Font::plain)); + attenuationLabel2->setJustificationType (Justification::centred); + attenuationLabel2->setEditable (false, false, false); + attenuationLabel2->setColour (Label::textColourId, Colour (0xff007f00)); + attenuationLabel2->setColour (TextEditor::textColourId, Colours::black); + attenuationLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (dbLabel3 = new Label ("db label", + TRANS("dB"))); + dbLabel3->setFont (Font (15.00f, Font::plain)); + dbLabel3->setJustificationType (Justification::centred); + dbLabel3->setEditable (false, false, false); + dbLabel3->setColour (Label::textColourId, Colour (0xff007f00)); + dbLabel3->setColour (Label::outlineColourId, Colour (0x00000000)); + dbLabel3->setColour (TextEditor::textColourId, Colours::black); + dbLabel3->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (sineImageButton2 = new ImageButton ("sine image button")); + sineImageButton2->setButtonText (TRANS("Sine")); + sineImageButton2->setRadioGroupId (2); + sineImageButton2->addListener (this); + + sineImageButton2->setImages (false, true, true, + ImageCache::getFromMemory (full_sine_png, full_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (halfsineImageButton2 = new ImageButton ("half sine image button")); + halfsineImageButton2->setButtonText (TRANS("Half Sine")); + halfsineImageButton2->setRadioGroupId (2); + halfsineImageButton2->addListener (this); + + halfsineImageButton2->setImages (false, true, true, + ImageCache::getFromMemory (half_sine_png, half_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (abssineImageButton2 = new ImageButton ("abs sine image button")); + abssineImageButton2->setButtonText (TRANS("Abs Sine")); + abssineImageButton2->setRadioGroupId (2); + abssineImageButton2->addListener (this); + + abssineImageButton2->setImages (false, true, true, + ImageCache::getFromMemory (abs_sine_png, abs_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (quartersineImageButton2 = new ImageButton ("quarter sine image button")); + quartersineImageButton2->setButtonText (TRANS("Quarter Sine")); + quartersineImageButton2->setRadioGroupId (2); + quartersineImageButton2->addListener (this); + + quartersineImageButton2->setImages (false, true, true, + ImageCache::getFromMemory (quarter_sine_png, quarter_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (waveLabel2 = new Label ("wave label", + TRANS("Wave"))); + waveLabel2->setFont (Font (15.00f, Font::plain)); + waveLabel2->setJustificationType (Justification::centredLeft); + waveLabel2->setEditable (false, false, false); + waveLabel2->setColour (Label::textColourId, Colour (0xff007f00)); + waveLabel2->setColour (TextEditor::textColourId, Colours::black); + waveLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (tremoloButton2 = new ToggleButton ("tremolo button")); + tremoloButton2->setButtonText (TRANS("Tremolo")); + tremoloButton2->addListener (this); + tremoloButton2->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (vibratoButton2 = new ToggleButton ("vibrato button")); + vibratoButton2->setButtonText (TRANS("Vibrato")); + vibratoButton2->addListener (this); + vibratoButton2->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (sustainButton2 = new ToggleButton ("sustain button")); + sustainButton2->setTooltip (TRANS("Enable or disable sustain when note is held")); + sustainButton2->setButtonText (TRANS("Sustain")); + sustainButton2->addListener (this); + sustainButton2->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (keyscaleEnvButton2 = new ToggleButton ("keyscale env button")); + keyscaleEnvButton2->setTooltip (TRANS("Speed up envelope rate with note frequency")); + keyscaleEnvButton2->setButtonText (TRANS("Keyscale Envelope Rate")); + keyscaleEnvButton2->addListener (this); + keyscaleEnvButton2->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (frequencyLabel4 = new Label ("frequency label", + TRANS("Keyscale Attenuation"))); + frequencyLabel4->setTooltip (TRANS("Attenuate amplitude with note frequency")); + frequencyLabel4->setFont (Font (15.00f, Font::plain)); + frequencyLabel4->setJustificationType (Justification::centred); + frequencyLabel4->setEditable (false, false, false); + frequencyLabel4->setColour (Label::textColourId, Colour (0xff007f00)); + frequencyLabel4->setColour (TextEditor::textColourId, Colours::black); + frequencyLabel4->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (groupComponent3 = new GroupComponent ("new group", + TRANS("Common"))); + groupComponent3->setTextLabelPosition (Justification::centredLeft); + groupComponent3->setColour (GroupComponent::outlineColourId, Colour (0xff007f00)); + groupComponent3->setColour (GroupComponent::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (tremoloSlider = new Slider ("tremolo slider")); + tremoloSlider->setRange (1, 4.8, 3.8); + tremoloSlider->setSliderStyle (Slider::LinearHorizontal); + tremoloSlider->setTextBoxStyle (Slider::TextBoxLeft, false, 44, 20); + tremoloSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); + tremoloSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); + tremoloSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + tremoloSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); + tremoloSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + tremoloSlider->addListener (this); + + addAndMakeVisible (frequencyLabel5 = new Label ("frequency label", + TRANS("Tremolo Depth\n"))); + frequencyLabel5->setTooltip (TRANS("OPL global tremolo depth")); + frequencyLabel5->setFont (Font (15.00f, Font::plain)); + frequencyLabel5->setJustificationType (Justification::centredLeft); + frequencyLabel5->setEditable (false, false, false); + frequencyLabel5->setColour (Label::textColourId, Colour (0xff007f00)); + frequencyLabel5->setColour (TextEditor::textColourId, Colours::black); + frequencyLabel5->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (dbLabel5 = new Label ("db label", + TRANS("dB"))); + dbLabel5->setFont (Font (15.00f, Font::plain)); + dbLabel5->setJustificationType (Justification::centredLeft); + dbLabel5->setEditable (false, false, false); + dbLabel5->setColour (Label::textColourId, Colour (0xff007f00)); + dbLabel5->setColour (Label::outlineColourId, Colour (0x00000000)); + dbLabel5->setColour (TextEditor::textColourId, Colours::black); + dbLabel5->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (vibratoSlider = new Slider ("vibrato slider")); + vibratoSlider->setRange (7, 14, 7); + vibratoSlider->setSliderStyle (Slider::LinearHorizontal); + vibratoSlider->setTextBoxStyle (Slider::TextBoxLeft, false, 44, 20); + vibratoSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); + vibratoSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); + vibratoSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + vibratoSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); + vibratoSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + vibratoSlider->addListener (this); + + addAndMakeVisible (frequencyLabel6 = new Label ("frequency label", + TRANS("Vibrato Depth"))); + frequencyLabel6->setTooltip (TRANS("OPL global vibrato depth")); + frequencyLabel6->setFont (Font (15.00f, Font::plain)); + frequencyLabel6->setJustificationType (Justification::centredLeft); + frequencyLabel6->setEditable (false, false, false); + frequencyLabel6->setColour (Label::textColourId, Colour (0xff007f00)); + frequencyLabel6->setColour (TextEditor::textColourId, Colours::black); + frequencyLabel6->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + 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->setJustificationType (Justification::centredLeft); + dbLabel6->setEditable (false, false, false); + dbLabel6->setColour (Label::textColourId, Colour (0xff007f00)); + dbLabel6->setColour (Label::outlineColourId, Colour (0x00000000)); + dbLabel6->setColour (TextEditor::textColourId, Colours::black); + dbLabel6->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (feedbackSlider = new Slider ("feedback slider")); + feedbackSlider->setRange (0, 7, 1); + feedbackSlider->setSliderStyle (Slider::LinearHorizontal); + feedbackSlider->setTextBoxStyle (Slider::TextBoxRight, false, 44, 20); + feedbackSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); + feedbackSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); + feedbackSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + feedbackSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); + feedbackSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + feedbackSlider->addListener (this); + + 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->setJustificationType (Justification::centredLeft); + frequencyLabel7->setEditable (false, false, false); + frequencyLabel7->setColour (Label::textColourId, Colour (0xff007f00)); + frequencyLabel7->setColour (TextEditor::textColourId, Colours::black); + frequencyLabel7->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (velocityComboBox = new ComboBox ("velocity combo box")); + velocityComboBox->setEditableText (false); + velocityComboBox->setJustificationType (Justification::centredLeft); + velocityComboBox->setTextWhenNothingSelected (String::empty); + velocityComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); + velocityComboBox->addItem (TRANS("Off"), 1); + velocityComboBox->addItem (TRANS("Light"), 2); + velocityComboBox->addItem (TRANS("Heavy"), 3); + velocityComboBox->addListener (this); + + addAndMakeVisible (attenuationLabel3 = new Label ("attenuation label", + TRANS("Velocity"))); + attenuationLabel3->setTooltip (TRANS("Set or disable velocity senstivity")); + attenuationLabel3->setFont (Font (15.00f, Font::plain)); + attenuationLabel3->setJustificationType (Justification::centredLeft); + attenuationLabel3->setEditable (false, false, false); + attenuationLabel3->setColour (Label::textColourId, Colour (0xff007f00)); + attenuationLabel3->setColour (TextEditor::textColourId, Colours::black); + attenuationLabel3->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (velocityComboBox2 = new ComboBox ("velocity combo box")); + velocityComboBox2->setEditableText (false); + velocityComboBox2->setJustificationType (Justification::centredLeft); + velocityComboBox2->setTextWhenNothingSelected (String::empty); + velocityComboBox2->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); + velocityComboBox2->addItem (TRANS("Off"), 1); + velocityComboBox2->addItem (TRANS("Light"), 2); + velocityComboBox2->addItem (TRANS("Heavy"), 3); + velocityComboBox2->addListener (this); + + addAndMakeVisible (attenuationLabel4 = new Label ("attenuation label", + TRANS("Velocity"))); + attenuationLabel4->setTooltip (TRANS("Set or disable velocity senstivity")); + attenuationLabel4->setFont (Font (15.00f, Font::plain)); + attenuationLabel4->setJustificationType (Justification::centredLeft); + attenuationLabel4->setEditable (false, false, false); + attenuationLabel4->setColour (Label::textColourId, Colour (0xff007f00)); + attenuationLabel4->setColour (TextEditor::textColourId, Colours::black); + attenuationLabel4->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (alternatingsineImageButton = new ImageButton ("alternating sine image button")); + alternatingsineImageButton->setButtonText (TRANS("Alternating Sine")); + alternatingsineImageButton->setRadioGroupId (1); + alternatingsineImageButton->addListener (this); + + alternatingsineImageButton->setImages (false, true, true, + ImageCache::getFromMemory (alternating_sine_png, alternating_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (camelsineImageButton = new ImageButton ("camel sine image button")); + camelsineImageButton->setButtonText (TRANS("Camel Sine")); + camelsineImageButton->setRadioGroupId (1); + camelsineImageButton->addListener (this); + + camelsineImageButton->setImages (false, true, true, + ImageCache::getFromMemory (camel_sine_png, camel_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (squareImageButton = new ImageButton ("square image button")); + squareImageButton->setButtonText (TRANS("Square")); + squareImageButton->setRadioGroupId (1); + squareImageButton->addListener (this); + + squareImageButton->setImages (false, true, true, + ImageCache::getFromMemory (square_png, square_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (logsawImageButton = new ImageButton ("logsaw image button")); + logsawImageButton->setButtonText (TRANS("Logarithmic Sawtooth")); + logsawImageButton->setRadioGroupId (1); + logsawImageButton->addListener (this); + + logsawImageButton->setImages (false, true, true, + ImageCache::getFromMemory (logarithmic_saw_png, logarithmic_saw_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (alternatingsineImageButton2 = new ImageButton ("alternating sine image button")); + alternatingsineImageButton2->setButtonText (TRANS("Alternating Sine")); + alternatingsineImageButton2->setRadioGroupId (2); + alternatingsineImageButton2->addListener (this); + + alternatingsineImageButton2->setImages (false, true, true, + ImageCache::getFromMemory (alternating_sine_png, alternating_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (camelsineImageButton2 = new ImageButton ("camel sine image button")); + camelsineImageButton2->setButtonText (TRANS("Camel Sine")); + camelsineImageButton2->setRadioGroupId (2); + camelsineImageButton2->addListener (this); + + camelsineImageButton2->setImages (false, true, true, + ImageCache::getFromMemory (camel_sine_png, camel_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (squareImageButton2 = new ImageButton ("square image button")); + squareImageButton2->setButtonText (TRANS("Square")); + squareImageButton2->setRadioGroupId (2); + squareImageButton2->addListener (this); + + squareImageButton2->setImages (false, true, true, + ImageCache::getFromMemory (square_png, square_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (logsawImageButton2 = new ImageButton ("logsaw image button")); + logsawImageButton2->setButtonText (TRANS("Logarithmic Sawtooth")); + logsawImageButton2->setRadioGroupId (2); + logsawImageButton2->addListener (this); + + logsawImageButton2->setImages (false, true, true, + ImageCache::getFromMemory (logarithmic_saw_png, logarithmic_saw_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (algorithmComboBox = new ComboBox ("algorithm combo box")); + algorithmComboBox->setEditableText (false); + algorithmComboBox->setJustificationType (Justification::centredLeft); + algorithmComboBox->setTextWhenNothingSelected (String::empty); + algorithmComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); + algorithmComboBox->addItem (TRANS("FM"), 1); + algorithmComboBox->addItem (TRANS("Additive"), 2); + algorithmComboBox->addListener (this); + + addAndMakeVisible (frequencyLabel8 = new Label ("frequency label", + TRANS("Algorithm"))); + frequencyLabel8->setTooltip (TRANS("In additive mode, carrier and modulator output are simply summed rather than modulated")); + frequencyLabel8->setFont (Font (15.00f, Font::plain)); + frequencyLabel8->setJustificationType (Justification::centredLeft); + frequencyLabel8->setEditable (false, false, false); + frequencyLabel8->setColour (Label::textColourId, Colour (0xff007f00)); + frequencyLabel8->setColour (TextEditor::textColourId, Colours::black); + frequencyLabel8->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (dbLabel4 = new Label ("db label", + TRANS("dB/8ve\n"))); + dbLabel4->setFont (Font (15.00f, Font::plain)); + dbLabel4->setJustificationType (Justification::centred); + dbLabel4->setEditable (false, false, false); + dbLabel4->setColour (Label::textColourId, Colour (0xff007f00)); + dbLabel4->setColour (Label::outlineColourId, Colour (0x00000000)); + dbLabel4->setColour (TextEditor::textColourId, Colours::black); + dbLabel4->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (keyscaleAttenuationComboBox2 = new ComboBox ("keyscale combo box")); + keyscaleAttenuationComboBox2->setEditableText (false); + keyscaleAttenuationComboBox2->setJustificationType (Justification::centredLeft); + keyscaleAttenuationComboBox2->setTextWhenNothingSelected (String::empty); + keyscaleAttenuationComboBox2->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); + keyscaleAttenuationComboBox2->addItem (TRANS("-0.0"), 1); + keyscaleAttenuationComboBox2->addItem (TRANS("-3.0"), 2); + keyscaleAttenuationComboBox2->addItem (TRANS("-1.5"), 3); + keyscaleAttenuationComboBox2->addItem (TRANS("-6.0"), 4); + keyscaleAttenuationComboBox2->addListener (this); + + addAndMakeVisible (keyscaleAttenuationComboBox = new ComboBox ("keyscale combo box")); + keyscaleAttenuationComboBox->setEditableText (false); + keyscaleAttenuationComboBox->setJustificationType (Justification::centredLeft); + keyscaleAttenuationComboBox->setTextWhenNothingSelected (String::empty); + keyscaleAttenuationComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); + 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 (groupComponent4 = new GroupComponent ("new group", + TRANS("Channels"))); + groupComponent4->setTextLabelPosition (Justification::centredLeft); + groupComponent4->setColour (GroupComponent::outlineColourId, Colour (0xff007f00)); + groupComponent4->setColour (GroupComponent::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (groupComponent5 = new GroupComponent ("new group", + TRANS("Emulator"))); + groupComponent5->setTextLabelPosition (Justification::centredLeft); + groupComponent5->setColour (GroupComponent::outlineColourId, Colour (0xff007f00)); + groupComponent5->setColour (GroupComponent::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (emulatorSlider = new Slider ("emulator slider")); + emulatorSlider->setRange (0, 1, 1); + emulatorSlider->setSliderStyle (Slider::LinearHorizontal); + emulatorSlider->setTextBoxStyle (Slider::NoTextBox, true, 44, 20); + emulatorSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); + emulatorSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); + emulatorSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + emulatorSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); + emulatorSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + emulatorSlider->addListener (this); + + 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->setJustificationType (Justification::centredRight); + emulatorLabel->setEditable (false, false, false); + emulatorLabel->setColour (Label::textColourId, Colour (0xff007f00)); + emulatorLabel->setColour (TextEditor::textColourId, Colours::black); + emulatorLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + 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->setJustificationType (Justification::centredLeft); + emulatorLabel2->setEditable (false, false, false); + emulatorLabel2->setColour (Label::textColourId, Colour (0xff007f00)); + emulatorLabel2->setColour (TextEditor::textColourId, Colours::black); + emulatorLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (recordButton = new ToggleButton ("record button")); + recordButton->setTooltip (TRANS("Start recording all register writes to a DRO file - an OPL recording file format defined by DOSBox")); + recordButton->setButtonText (TRANS("Record to DRO")); + recordButton->addListener (this); + recordButton->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (percussionComboBox = new ComboBox ("percussion combo box")); + percussionComboBox->setEditableText (false); + percussionComboBox->setJustificationType (Justification::centredLeft); + percussionComboBox->setTextWhenNothingSelected (String::empty); + percussionComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); + percussionComboBox->addItem (TRANS("Off"), 1); + percussionComboBox->addItem (TRANS("Bass drum"), 2); + percussionComboBox->addItem (TRANS("Snare"), 3); + percussionComboBox->addItem (TRANS("Tom"), 4); + percussionComboBox->addItem (TRANS("Cymbal"), 5); + percussionComboBox->addItem (TRANS("Hi-hat"), 6); + percussionComboBox->addListener (this); + + addAndMakeVisible (percussionLabel = new Label ("percussion label", + TRANS("Percussion mode"))); + percussionLabel->setTooltip (TRANS("Enable percussion instruments instead of oscillators")); + percussionLabel->setFont (Font (15.00f, Font::plain)); + percussionLabel->setJustificationType (Justification::centredLeft); + percussionLabel->setEditable (false, false, false); + percussionLabel->setColour (Label::textColourId, Colour (0xff007f00)); + percussionLabel->setColour (TextEditor::textColourId, Colours::black); + percussionLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + + //[UserPreSize] + frequencyComboBox->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); + frequencyComboBox->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); + frequencyComboBox->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); + frequencyComboBox->setColour (ComboBox::buttonColourId, Colours::black); + frequencyComboBox->setColour (ComboBox::backgroundColourId, Colours::black); + + frequencyComboBox->addItem ("x1/2", 16); // can't use 0 :( + frequencyComboBox->addItem ("x1", 1); + frequencyComboBox->addItem ("x2", 2); + frequencyComboBox->addItem ("x3", 3); + frequencyComboBox->addItem ("x4", 4); + frequencyComboBox->addItem ("x5", 5); + frequencyComboBox->addItem ("x6", 6); + frequencyComboBox->addItem ("x7", 7); + frequencyComboBox->addItem ("x8", 8); + frequencyComboBox->addItem ("x9", 9); + frequencyComboBox->addItem ("x10", 10); + frequencyComboBox->addItem ("x12", 12); + frequencyComboBox->addItem ("x15", 15); + + frequencyComboBox2->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); + frequencyComboBox2->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); + frequencyComboBox2->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); + frequencyComboBox2->setColour (ComboBox::buttonColourId, Colours::black); + frequencyComboBox2->setColour (ComboBox::backgroundColourId, Colours::black); + frequencyComboBox2->addItem ("x1/2", 16); // can't use 0 :( + frequencyComboBox2->addItem ("x1", 1); + frequencyComboBox2->addItem ("x2", 2); + frequencyComboBox2->addItem ("x3", 3); + frequencyComboBox2->addItem ("x4", 4); + frequencyComboBox2->addItem ("x5", 5); + frequencyComboBox2->addItem ("x6", 6); + frequencyComboBox2->addItem ("x7", 7); + frequencyComboBox2->addItem ("x8", 8); + frequencyComboBox2->addItem ("x9", 9); + frequencyComboBox2->addItem ("x10", 10); + frequencyComboBox2->addItem ("x12", 12); + frequencyComboBox2->addItem ("x15", 15); + + velocityComboBox->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); + velocityComboBox->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); + velocityComboBox->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); + velocityComboBox->setColour (ComboBox::buttonColourId, Colours::black); + velocityComboBox->setColour (ComboBox::backgroundColourId, Colours::black); + velocityComboBox2->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); + velocityComboBox2->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); + velocityComboBox2->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); + velocityComboBox2->setColour (ComboBox::buttonColourId, Colours::black); + velocityComboBox2->setColour (ComboBox::backgroundColourId, Colours::black); + + algorithmComboBox->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); + algorithmComboBox->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); + algorithmComboBox->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); + algorithmComboBox->setColour (ComboBox::buttonColourId, Colours::black); + algorithmComboBox->setColour (ComboBox::backgroundColourId, Colours::black); + + keyscaleAttenuationComboBox->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); + keyscaleAttenuationComboBox->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); + keyscaleAttenuationComboBox->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); + keyscaleAttenuationComboBox->setColour (ComboBox::buttonColourId, Colours::black); + keyscaleAttenuationComboBox->setColour (ComboBox::backgroundColourId, Colours::black); + keyscaleAttenuationComboBox2->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); + keyscaleAttenuationComboBox2->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); + keyscaleAttenuationComboBox2->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); + keyscaleAttenuationComboBox2->setColour (ComboBox::buttonColourId, Colours::black); + keyscaleAttenuationComboBox2->setColour (ComboBox::backgroundColourId, Colours::black); + + percussionComboBox->setColour(ComboBox::textColourId, Colour(COLOUR_MID)); + percussionComboBox->setColour(ComboBox::outlineColourId, Colour(COLOUR_MID)); + percussionComboBox->setColour(ComboBox::arrowColourId, Colour(COLOUR_MID)); + percussionComboBox->setColour(ComboBox::buttonColourId, Colours::black); + percussionComboBox->setColour(ComboBox::backgroundColourId, Colours::black); + + sineImageButton->setClickingTogglesState(true); + sineImageButton->setRepaintsOnMouseActivity(false); + abssineImageButton->setClickingTogglesState(true); + abssineImageButton->setRepaintsOnMouseActivity(false); + halfsineImageButton->setClickingTogglesState(true); + halfsineImageButton->setRepaintsOnMouseActivity(false); + quartersineImageButton->setClickingTogglesState(true); + quartersineImageButton->setRepaintsOnMouseActivity(false); + alternatingsineImageButton->setClickingTogglesState(true); + alternatingsineImageButton->setRepaintsOnMouseActivity(false); + camelsineImageButton->setClickingTogglesState(true); + camelsineImageButton->setRepaintsOnMouseActivity(false); + squareImageButton->setClickingTogglesState(true); + squareImageButton->setRepaintsOnMouseActivity(false); + logsawImageButton->setClickingTogglesState(true); + logsawImageButton->setRepaintsOnMouseActivity(false); + + sineImageButton2->setClickingTogglesState(true); + sineImageButton2->setRepaintsOnMouseActivity(false); + abssineImageButton2->setClickingTogglesState(true); + abssineImageButton2->setRepaintsOnMouseActivity(false); + halfsineImageButton2->setClickingTogglesState(true); + halfsineImageButton2->setRepaintsOnMouseActivity(false); + quartersineImageButton2->setClickingTogglesState(true); + quartersineImageButton2->setRepaintsOnMouseActivity(false); + alternatingsineImageButton2->setClickingTogglesState(true); + alternatingsineImageButton2->setRepaintsOnMouseActivity(false); + camelsineImageButton2->setClickingTogglesState(true); + camelsineImageButton2->setRepaintsOnMouseActivity(false); + squareImageButton2->setClickingTogglesState(true); + squareImageButton2->setRepaintsOnMouseActivity(false); + logsawImageButton2->setClickingTogglesState(true); + logsawImageButton2->setRepaintsOnMouseActivity(false); + + recordButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + tremoloButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + vibratoButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + keyscaleEnvButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + sustainButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + tremoloButton2->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + vibratoButton2->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + keyscaleEnvButton2->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + sustainButton2->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + + Font fw(Font::getDefaultMonospacedFontName(), 14, Font::bold); + for (unsigned int i = 0; i < channels.size(); ++i) + { + Label *channel = new Label("chan label", TRANS("-")); + channel->setColour(Label::textColourId, Colour(COLOUR_MID)); + channel->setJustificationType(Justification::centred); + addAndMakeVisible(channel); + channels[i] = channel; + } + //[/UserPreSize] + + setSize (860, 550); + + + //[Constructor] You can add your own custom stuff here.. + processor = ownerFilter; + startTimer(1000/30); + //[/Constructor] +} + +PluginGui::~PluginGui() +{ + //[Destructor_pre]. You can add your own custom destruction code here.. + //[/Destructor_pre] + + groupComponent = nullptr; + frequencyComboBox = nullptr; + frequencyLabel = nullptr; + aSlider = nullptr; + aLabel = nullptr; + dSlider = nullptr; + dLabel = nullptr; + sSlider = nullptr; + dLabel2 = nullptr; + rSlider = nullptr; + rLabel = nullptr; + attenuationSlider = nullptr; + attenuationLabel = nullptr; + dbLabel = nullptr; + sineImageButton = nullptr; + halfsineImageButton = nullptr; + abssineImageButton = nullptr; + quartersineImageButton = nullptr; + waveLabel = nullptr; + tremoloButton = nullptr; + vibratoButton = nullptr; + sustainButton = nullptr; + keyscaleEnvButton = nullptr; + frequencyLabel2 = nullptr; + dbLabel2 = nullptr; + groupComponent2 = nullptr; + frequencyComboBox2 = nullptr; + frequencyLabel3 = nullptr; + aSlider2 = nullptr; + aLabel2 = nullptr; + dSlider2 = nullptr; + dLabel3 = nullptr; + sSlider2 = nullptr; + dLabel4 = nullptr; + rSlider2 = nullptr; + rLabel2 = nullptr; + attenuationSlider2 = nullptr; + attenuationLabel2 = nullptr; + dbLabel3 = nullptr; + sineImageButton2 = nullptr; + halfsineImageButton2 = nullptr; + abssineImageButton2 = nullptr; + quartersineImageButton2 = nullptr; + waveLabel2 = nullptr; + tremoloButton2 = nullptr; + vibratoButton2 = nullptr; + sustainButton2 = nullptr; + keyscaleEnvButton2 = nullptr; + frequencyLabel4 = nullptr; + groupComponent3 = nullptr; + tremoloSlider = nullptr; + frequencyLabel5 = nullptr; + dbLabel5 = nullptr; + vibratoSlider = nullptr; + frequencyLabel6 = nullptr; + dbLabel6 = nullptr; + feedbackSlider = nullptr; + frequencyLabel7 = nullptr; + velocityComboBox = nullptr; + attenuationLabel3 = nullptr; + velocityComboBox2 = nullptr; + attenuationLabel4 = nullptr; + alternatingsineImageButton = nullptr; + camelsineImageButton = nullptr; + squareImageButton = nullptr; + logsawImageButton = nullptr; + alternatingsineImageButton2 = nullptr; + camelsineImageButton2 = nullptr; + squareImageButton2 = nullptr; + logsawImageButton2 = nullptr; + algorithmComboBox = nullptr; + frequencyLabel8 = nullptr; + dbLabel4 = nullptr; + keyscaleAttenuationComboBox2 = nullptr; + keyscaleAttenuationComboBox = nullptr; + groupComponent4 = nullptr; + groupComponent5 = nullptr; + emulatorSlider = nullptr; + emulatorLabel = nullptr; + emulatorLabel2 = nullptr; + recordButton = nullptr; + percussionComboBox = nullptr; + percussionLabel = nullptr; + + + //[Destructor]. You can add your own custom destruction code here.. + //[/Destructor] +} + +//============================================================================== +void PluginGui::paint (Graphics& g) +{ + //[UserPrePaint] Add your own custom painting code here.. + //[/UserPrePaint] + + g.fillAll (Colours::black); + + //[UserPaint] Add your own custom painting code here.. + //[/UserPaint] +} + +void PluginGui::resized() +{ + //[UserPreResize] Add your own custom resize code here.. + //[/UserPreResize] + + groupComponent->setBounds (16, 80, 408, 344); + frequencyComboBox->setBounds (128, 152, 72, 24); + frequencyLabel->setBounds (32, 152, 80, 24); + aSlider->setBounds (40, 280, 48, 72); + aLabel->setBounds (40, 352, 48, 24); + dSlider->setBounds (104, 280, 48, 72); + dLabel->setBounds (104, 352, 48, 24); + sSlider->setBounds (168, 280, 48, 72); + dLabel2->setBounds (168, 352, 48, 24); + rSlider->setBounds (232, 280, 48, 72); + rLabel->setBounds (232, 352, 48, 24); + attenuationSlider->setBounds (312, 280, 72, 96); + attenuationLabel->setBounds (312, 384, 96, 24); + dbLabel->setBounds (376, 352, 40, 24); + sineImageButton->setBounds (88, 112, 34, 30); + halfsineImageButton->setBounds (128, 112, 34, 30); + abssineImageButton->setBounds (168, 112, 34, 30); + quartersineImageButton->setBounds (208, 112, 34, 30); + waveLabel->setBounds (32, 112, 48, 24); + tremoloButton->setBounds (144, 192, 96, 24); + vibratoButton->setBounds (40, 192, 96, 24); + sustainButton->setBounds (40, 384, 96, 24); + keyscaleEnvButton->setBounds (128, 384, 184, 24); + frequencyLabel2->setBounds (248, 184, 152, 24); + dbLabel2->setBounds (336, 156, 72, 16); + groupComponent2->setBounds (440, 80, 408, 344); + frequencyComboBox2->setBounds (552, 152, 72, 24); + frequencyLabel3->setBounds (456, 152, 80, 24); + aSlider2->setBounds (464, 280, 48, 72); + aLabel2->setBounds (464, 352, 48, 24); + dSlider2->setBounds (528, 280, 48, 72); + dLabel3->setBounds (528, 352, 48, 24); + sSlider2->setBounds (592, 280, 48, 72); + dLabel4->setBounds (592, 352, 48, 24); + rSlider2->setBounds (656, 280, 48, 72); + rLabel2->setBounds (656, 352, 48, 24); + attenuationSlider2->setBounds (736, 280, 72, 96); + attenuationLabel2->setBounds (736, 384, 96, 24); + dbLabel3->setBounds (800, 352, 40, 24); + sineImageButton2->setBounds (512, 112, 34, 30); + halfsineImageButton2->setBounds (552, 112, 34, 30); + abssineImageButton2->setBounds (592, 112, 34, 30); + quartersineImageButton2->setBounds (632, 112, 34, 30); + waveLabel2->setBounds (456, 112, 48, 24); + tremoloButton2->setBounds (576, 192, 96, 24); + vibratoButton2->setBounds (464, 192, 96, 24); + sustainButton2->setBounds (464, 384, 96, 24); + keyscaleEnvButton2->setBounds (552, 384, 184, 24); + frequencyLabel4->setBounds (672, 184, 152, 24); + groupComponent3->setBounds (16, 432, 832, 96); + tremoloSlider->setBounds (632, 456, 112, 24); + frequencyLabel5->setBounds (472, 456, 152, 24); + dbLabel5->setBounds (752, 448, 40, 40); + vibratoSlider->setBounds (632, 488, 112, 24); + frequencyLabel6->setBounds (472, 488, 152, 24); + dbLabel6->setBounds (752, 480, 47, 40); + feedbackSlider->setBounds (112, 232, 136, 24); + frequencyLabel7->setBounds (32, 232, 80, 24); + velocityComboBox->setBounds (336, 232, 72, 24); + attenuationLabel3->setBounds (272, 232, 64, 24); + velocityComboBox2->setBounds (760, 232, 72, 24); + attenuationLabel4->setBounds (696, 232, 64, 24); + alternatingsineImageButton->setBounds (288, 112, 34, 30); + camelsineImageButton->setBounds (248, 112, 34, 30); + squareImageButton->setBounds (328, 112, 34, 30); + logsawImageButton->setBounds (368, 112, 34, 30); + alternatingsineImageButton2->setBounds (714, 113, 34, 30); + camelsineImageButton2->setBounds (674, 113, 34, 30); + squareImageButton2->setBounds (754, 113, 34, 30); + logsawImageButton2->setBounds (794, 113, 34, 30); + algorithmComboBox->setBounds (552, 232, 112, 24); + frequencyLabel8->setBounds (456, 232, 80, 24); + dbLabel4->setBounds (760, 156, 72, 16); + keyscaleAttenuationComboBox2->setBounds (688, 152, 72, 24); + keyscaleAttenuationComboBox->setBounds (264, 152, 72, 24); + groupComponent4->setBounds (440, 8, 408, 64); + groupComponent5->setBounds (16, 8, 408, 64); + emulatorSlider->setBounds (200, 32, 40, 24); + emulatorLabel->setBounds (112, 32, 72, 24); + emulatorLabel2->setBounds (248, 32, 72, 24); + recordButton->setBounds (40, 456, 128, 24); + percussionComboBox->setBounds (256, 488, 112, 24); + percussionLabel->setBounds (40, 488, 163, 24); + //[UserResized] Add your own custom resize handling here.. + for (unsigned int i = 0; i < channels.size(); ++i) + channels[i]->setBounds(456+44*i+4, 36, 20, 20); + //[/UserResized] +} + +void PluginGui::comboBoxChanged (ComboBox* comboBoxThatHasChanged) +{ + //[UsercomboBoxChanged_Pre] + + //[/UsercomboBoxChanged_Pre] + + if (comboBoxThatHasChanged == frequencyComboBox) + { + //[UserComboBoxCode_frequencyComboBox] -- add your combo box handling code here.. + int id = comboBoxThatHasChanged->getSelectedId(); + if (id > 15) id = 0; + processor->setEnumParameter("Modulator Frequency Multiplier", id); + //[/UserComboBoxCode_frequencyComboBox] + } + else if (comboBoxThatHasChanged == frequencyComboBox2) + { + //[UserComboBoxCode_frequencyComboBox2] -- add your combo box handling code here.. + int id = comboBoxThatHasChanged->getSelectedId(); + if (id > 15) id = 0; + processor->setEnumParameter("Carrier Frequency Multiplier", id); + //[/UserComboBoxCode_frequencyComboBox2] + } + else if (comboBoxThatHasChanged == velocityComboBox) + { + //[UserComboBoxCode_velocityComboBox] -- add your combo box handling code here.. + int id = comboBoxThatHasChanged->getSelectedId() - 1; + processor->setEnumParameter("Modulator Velocity Sensitivity", id); + //[/UserComboBoxCode_velocityComboBox] + } + else if (comboBoxThatHasChanged == velocityComboBox2) + { + //[UserComboBoxCode_velocityComboBox2] -- add your combo box handling code here.. + int id = comboBoxThatHasChanged->getSelectedId() - 1; + processor->setEnumParameter("Carrier Velocity Sensitivity", id); + //[/UserComboBoxCode_velocityComboBox2] + } + else if (comboBoxThatHasChanged == algorithmComboBox) + { + //[UserComboBoxCode_algorithmComboBox] -- add your combo box handling code here.. + int id = comboBoxThatHasChanged->getSelectedId() - 1; + processor->setEnumParameter("Algorithm", id); + //[/UserComboBoxCode_algorithmComboBox] + } + else if (comboBoxThatHasChanged == keyscaleAttenuationComboBox2) + { + //[UserComboBoxCode_keyscaleAttenuationComboBox2] -- add your combo box handling code here.. + int id = comboBoxThatHasChanged->getSelectedId() - 1; + processor->setEnumParameter("Carrier Keyscale Level", id); + //[/UserComboBoxCode_keyscaleAttenuationComboBox2] + } + else if (comboBoxThatHasChanged == keyscaleAttenuationComboBox) + { + //[UserComboBoxCode_keyscaleAttenuationComboBox] -- add your combo box handling code here.. + int id = comboBoxThatHasChanged->getSelectedId() - 1; + processor->setEnumParameter("Modulator Keyscale Level", id); + //[/UserComboBoxCode_keyscaleAttenuationComboBox] + } + else if (comboBoxThatHasChanged == percussionComboBox) + { + //[UserComboBoxCode_percussionComboBox] -- add your combo box handling code here.. + int id = comboBoxThatHasChanged->getSelectedId() - 1; + processor->setEnumParameter("Percussion Mode", id); + //[/UserComboBoxCode_percussionComboBox] + } + + //[UsercomboBoxChanged_Post] + //[/UsercomboBoxChanged_Post] +} + +void PluginGui::sliderValueChanged (Slider* sliderThatWasMoved) +{ + //[UsersliderValueChanged_Pre] + //[/UsersliderValueChanged_Pre] + + if (sliderThatWasMoved == aSlider) + { + //[UserSliderCode_aSlider] -- add your slider handling code here.. + processor->setIntParameter("Modulator Attack", (int)sliderThatWasMoved->getValue()); + //[/UserSliderCode_aSlider] + } + else if (sliderThatWasMoved == dSlider) + { + //[UserSliderCode_dSlider] -- add your slider handling code here.. + processor->setIntParameter("Modulator Decay", (int)sliderThatWasMoved->getValue()); + //[/UserSliderCode_dSlider] + } + else if (sliderThatWasMoved == sSlider) + { + //[UserSliderCode_sSlider] -- add your slider handling code here.. + processor->setIntParameter("Modulator Sustain Level", (int)sliderThatWasMoved->getValue()); + //[/UserSliderCode_sSlider] + } + else if (sliderThatWasMoved == rSlider) + { + //[UserSliderCode_rSlider] -- add your slider handling code here.. + processor->setIntParameter("Modulator Release", (int)sliderThatWasMoved->getValue()); + //[/UserSliderCode_rSlider] + } + else if (sliderThatWasMoved == attenuationSlider) + { + //[UserSliderCode_attenuationSlider] -- add your slider handling code here.. + processor->setEnumParameter("Modulator Attenuation", -(int)(sliderThatWasMoved->getValue()/0.75)); + //[/UserSliderCode_attenuationSlider] + } + else if (sliderThatWasMoved == aSlider2) + { + //[UserSliderCode_aSlider2] -- add your slider handling code here.. + processor->setIntParameter("Carrier Attack", (int)sliderThatWasMoved->getValue()); + //[/UserSliderCode_aSlider2] + } + else if (sliderThatWasMoved == dSlider2) + { + //[UserSliderCode_dSlider2] -- add your slider handling code here.. + processor->setIntParameter("Carrier Decay", (int)sliderThatWasMoved->getValue()); + //[/UserSliderCode_dSlider2] + } + else if (sliderThatWasMoved == sSlider2) + { + //[UserSliderCode_sSlider2] -- add your slider handling code here.. + processor->setIntParameter("Carrier Sustain Level", (int)sliderThatWasMoved->getValue()); + //[/UserSliderCode_sSlider2] + } + else if (sliderThatWasMoved == rSlider2) + { + //[UserSliderCode_rSlider2] -- add your slider handling code here.. + processor->setIntParameter("Carrier Release", (int)sliderThatWasMoved->getValue()); + //[/UserSliderCode_rSlider2] + } + else if (sliderThatWasMoved == attenuationSlider2) + { + //[UserSliderCode_attenuationSlider2] -- add your slider handling code here.. + processor->setEnumParameter("Carrier Attenuation", -(int)(sliderThatWasMoved->getValue()/0.75)); + //[/UserSliderCode_attenuationSlider2] + } + else if (sliderThatWasMoved == tremoloSlider) + { + //[UserSliderCode_tremoloSlider] -- add your slider handling code here.. + processor->setEnumParameter("Tremolo Depth", sliderThatWasMoved->getValue() < 2.0 ? 0 : 1); + //[/UserSliderCode_tremoloSlider] + } + else if (sliderThatWasMoved == vibratoSlider) + { + //[UserSliderCode_vibratoSlider] -- add your slider handling code here.. + processor->setEnumParameter("Vibrato Depth", sliderThatWasMoved->getValue() < 8.0 ? 0 : 1); + //[/UserSliderCode_vibratoSlider] + } + else if (sliderThatWasMoved == feedbackSlider) + { + //[UserSliderCode_feedbackSlider] -- add your slider handling code here.. + processor->setIntParameter("Modulator Feedback", (int)sliderThatWasMoved->getValue()); + //[/UserSliderCode_feedbackSlider] + } + else if (sliderThatWasMoved == emulatorSlider) + { + //[UserSliderCode_emulatorSlider] -- add your slider handling code here.. + processor->setEnumParameter("Emulator", sliderThatWasMoved->getValue() < 0.5 ? 0 : 1); + //[/UserSliderCode_emulatorSlider] + } + + //[UsersliderValueChanged_Post] + //[/UsersliderValueChanged_Post] +} + +void PluginGui::buttonClicked (Button* buttonThatWasClicked) +{ + //[UserbuttonClicked_Pre] + //[/UserbuttonClicked_Pre] + + if (buttonThatWasClicked == sineImageButton) + { + //[UserButtonCode_sineImageButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Wave", 0); + //[/UserButtonCode_sineImageButton] + } + else if (buttonThatWasClicked == halfsineImageButton) + { + //[UserButtonCode_halfsineImageButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Wave", 1); + //[/UserButtonCode_halfsineImageButton] + } + else if (buttonThatWasClicked == abssineImageButton) + { + //[UserButtonCode_abssineImageButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Wave", 2); + //[/UserButtonCode_abssineImageButton] + } + else if (buttonThatWasClicked == quartersineImageButton) + { + //[UserButtonCode_quartersineImageButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Wave", 3); + //[/UserButtonCode_quartersineImageButton] + } + else if (buttonThatWasClicked == tremoloButton) + { + //[UserButtonCode_tremoloButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Tremolo", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_tremoloButton] + } + else if (buttonThatWasClicked == vibratoButton) + { + //[UserButtonCode_vibratoButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Vibrato", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_vibratoButton] + } + else if (buttonThatWasClicked == sustainButton) + { + //[UserButtonCode_sustainButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Sustain", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_sustainButton] + } + else if (buttonThatWasClicked == keyscaleEnvButton) + { + //[UserButtonCode_keyscaleEnvButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Keyscale Rate", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_keyscaleEnvButton] + } + else if (buttonThatWasClicked == sineImageButton2) + { + //[UserButtonCode_sineImageButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Wave", 0); + //[/UserButtonCode_sineImageButton2] + } + else if (buttonThatWasClicked == halfsineImageButton2) + { + //[UserButtonCode_halfsineImageButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Wave", 1); + //[/UserButtonCode_halfsineImageButton2] + } + else if (buttonThatWasClicked == abssineImageButton2) + { + //[UserButtonCode_abssineImageButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Wave", 2); + //[/UserButtonCode_abssineImageButton2] + } + else if (buttonThatWasClicked == quartersineImageButton2) + { + //[UserButtonCode_quartersineImageButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Wave", 3); + //[/UserButtonCode_quartersineImageButton2] + } + else if (buttonThatWasClicked == tremoloButton2) + { + //[UserButtonCode_tremoloButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Tremolo", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_tremoloButton2] + } + else if (buttonThatWasClicked == vibratoButton2) + { + //[UserButtonCode_vibratoButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Vibrato", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_vibratoButton2] + } + else if (buttonThatWasClicked == sustainButton2) + { + //[UserButtonCode_sustainButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Sustain", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_sustainButton2] + } + else if (buttonThatWasClicked == keyscaleEnvButton2) + { + //[UserButtonCode_keyscaleEnvButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Keyscale Rate", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_keyscaleEnvButton2] + } + else if (buttonThatWasClicked == alternatingsineImageButton) + { + //[UserButtonCode_alternatingsineImageButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Wave", 4); + //[/UserButtonCode_alternatingsineImageButton] + } + else if (buttonThatWasClicked == camelsineImageButton) + { + //[UserButtonCode_camelsineImageButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Wave", 5); + //[/UserButtonCode_camelsineImageButton] + } + else if (buttonThatWasClicked == squareImageButton) + { + //[UserButtonCode_squareImageButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Wave", 6); + //[/UserButtonCode_squareImageButton] + } + else if (buttonThatWasClicked == logsawImageButton) + { + //[UserButtonCode_logsawImageButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Wave", 7); + //[/UserButtonCode_logsawImageButton] + } + else if (buttonThatWasClicked == alternatingsineImageButton2) + { + //[UserButtonCode_alternatingsineImageButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Wave", 4); + //[/UserButtonCode_alternatingsineImageButton2] + } + else if (buttonThatWasClicked == camelsineImageButton2) + { + //[UserButtonCode_camelsineImageButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Wave", 5); + //[/UserButtonCode_camelsineImageButton2] + } + else if (buttonThatWasClicked == squareImageButton2) + { + //[UserButtonCode_squareImageButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Wave", 6); + //[/UserButtonCode_squareImageButton2] + } + else if (buttonThatWasClicked == logsawImageButton2) + { + //[UserButtonCode_logsawImageButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Wave", 7); + //[/UserButtonCode_logsawImageButton2] + } + else if (buttonThatWasClicked == recordButton) + { + //[UserButtonCode_recordButton] -- add your button handler code here.. + recordButton->setToggleState(false, dontSendNotification); + if (!processor->isAnyInstanceRecording()) { + WildcardFileFilter wildcardFilter ("*.dro", String::empty, "DRO files"); + FileBrowserComponent browser (FileBrowserComponent::saveMode, + File::nonexistent, + &wildcardFilter, + nullptr); + FileChooserDialogBox dialogBox ("Record to", + "Specify DRO output file", + browser, + true, + Colours::darkgreen); + if (dialogBox.show()) + { + File selectedFile = browser.getSelectedFile(0); + processor->startRecording(&selectedFile); + setRecordButtonState(true); + } + } else { + setRecordButtonState(false); + processor->stopRecording(); + } + //[/UserButtonCode_recordButton] + } + + //[UserbuttonClicked_Post] + //[/UserbuttonClicked_Post] +} + + + +//[MiscUserCode] You can add your own definitions of your custom methods or any other code here... + //============================================================================== + // These methods implement the FileDragAndDropTarget interface, and allow our component + // to accept drag-and-drop of files.. + + bool PluginGui::isInterestedInFileDrag (const StringArray& files) + { + return 1 == files.size() && ( + files[0].toLowerCase().endsWith(".sbi") + || files[0].toLowerCase().endsWith(".sb2") + || files[0].toLowerCase().endsWith(".sb0") + ); + } + + void PluginGui::fileDragEnter (const StringArray& files, int x, int y) + { + } + + void PluginGui::fileDragMove (const StringArray& files, int x, int y) + { + } + + void PluginGui::fileDragExit (const StringArray& files) + { + } + + void PluginGui::filesDropped (const StringArray& files, int x, int y) + { + if (isInterestedInFileDrag(files)) { + processor->loadInstrumentFromFile(files[0]); + } + } + + void PluginGui::timerCallback() + { + for (int i = 0; i < Hiopl::CHANNELS; ++i) { + channels[i]->setText(processor->getChannelEnvelopeStage(i + 1), NotificationType::dontSendNotification); + } + //channels[i]->setState(processor->isChannelActive(i+1) ? Button::buttonDown : Button::buttonNormal); + } +//[/MiscUserCode] + + +//============================================================================== +#if 0 +/* -- Introjucer information section -- + + This is where the Introjucer stores the metadata that describe this GUI layout, so + make changes in here at your peril! + +BEGIN_JUCER_METADATA + + + + + + + +END_JUCER_METADATA +*/ +#endif + +//============================================================================== +// Binary resources - be careful not to edit any of these sections! + +// JUCER_RESOURCE: full_sine_png, 203, "../img/full_sine.png" +static const unsigned char resource_PluginGui_full_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,146,73,68,65,84,88,133,237,151,81,14,64, +48,16,68,183,226,94,110,225,18,110,230,146,252,116,35,153,166,97,219,21,131,125,63,66,144,241,76,75,147,136,108,66,192,240,116,0,101,60,61,99,133,253,249,158,32,47,48,162,38,208,64,237,120,39,52,70,146, +224,168,185,250,196,206,102,104,140,68,16,228,232,72,235,59,119,234,10,141,145,8,130,148,51,235,212,120,39,235,117,75,222,230,110,209,24,41,103,86,43,78,163,141,198,72,4,65,250,59,162,116,126,181,105, +140,68,16,196,175,35,74,227,191,238,135,141,40,198,245,208,15,140,24,161,49,178,3,63,99,23,114,126,178,233,88,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* PluginGui::full_sine_png = (const char*) resource_PluginGui_full_sine_png; +const int PluginGui::full_sine_pngSize = 203; + +// JUCER_RESOURCE: half_sine_png, 179, "../img/half_sine.png" +static const unsigned char resource_PluginGui_half_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,122,73,68,65,84,88,133,237,148,65,10,128, +32,20,5,191,209,189,186,69,135,236,22,157,172,22,33,193,72,20,102,248,130,55,155,40,50,198,73,77,17,177,133,0,67,111,129,204,120,251,198,130,251,249,27,145,31,20,201,37,88,224,234,249,75,100,138,164,224, +174,121,58,227,198,101,100,138,88,132,156,107,164,246,159,55,90,43,50,69,44,66,202,147,117,170,252,82,237,184,245,184,200,20,41,79,214,78,200,20,177,8,177,8,177,8,177,8,177,8,177,8,217,1,254,115,12,122, +78,109,41,249,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* PluginGui::half_sine_png = (const char*) resource_PluginGui_half_sine_png; +const int PluginGui::half_sine_pngSize = 179; + +// JUCER_RESOURCE: abs_sine_png, 181, "../img/abs_sine.png" +static const unsigned char resource_PluginGui_abs_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,124,73,68,65,84,88,133,237,148,81,10,128, +32,16,5,215,232,94,221,162,67,118,201,250,81,130,17,209,182,192,13,222,252,21,62,153,125,150,201,204,78,11,192,50,91,160,176,118,87,28,120,222,7,119,126,152,251,65,35,101,34,78,210,122,255,50,23,166,145, +100,252,107,122,19,183,214,121,115,153,48,141,72,132,220,223,200,232,25,147,143,114,97,26,145,8,169,111,214,205,185,147,55,151,9,211,72,125,179,78,34,76,35,18,33,18,33,18,33,18,33,18,33,18,33,23,197,62, +17,185,230,123,254,103,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* PluginGui::abs_sine_png = (const char*) resource_PluginGui_abs_sine_png; +const int PluginGui::abs_sine_pngSize = 181; + +// JUCER_RESOURCE: quarter_sine_png, 181, "../img/quarter_sine.png" +static const unsigned char resource_PluginGui_quarter_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,124,73,68,65,84,88,133,237,150,81,10, +128,32,16,68,215,232,94,221,162,67,118,139,78,150,31,41,209,196,162,174,31,205,199,60,8,177,28,120,77,33,38,51,187,140,128,229,111,129,74,91,228,40,215,40,131,57,154,70,86,247,73,164,133,137,28,113,35, +245,141,118,152,183,136,230,10,52,141,72,4,121,254,17,252,198,189,68,115,0,77,35,18,65,190,251,200,230,172,244,238,207,230,206,123,160,105,36,153,206,35,111,36,130,72,4,145,8,34,17,68,34,136,68,144,12, +123,138,13,78,65,207,81,74,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* PluginGui::quarter_sine_png = (const char*) resource_PluginGui_quarter_sine_png; +const int PluginGui::quarter_sine_pngSize = 181; + +// JUCER_RESOURCE: camel_sine_png, 174, "../img/camel_sine.png" +static const unsigned char resource_PluginGui_camel_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,117,73,68,65,84,88,133,237,148,209,9,192, +32,12,68,99,233,94,221,162,67,118,139,78,86,63,218,80,56,41,129,40,245,62,238,129,136,6,225,229,132,20,51,187,140,128,101,182,128,243,45,114,60,43,91,31,38,242,51,107,115,227,93,238,201,115,18,154,68, +36,130,20,243,57,18,253,117,111,61,128,38,17,137,32,18,65,218,201,186,5,47,122,235,200,121,111,52,137,188,115,100,50,52,137,72,4,145,8,34,17,68,34,136,68,16,137,32,21,146,46,14,97,109,79,27,36,0,0,0,0, +73,69,78,68,174,66,96,130,0,0}; + +const char* PluginGui::camel_sine_png = (const char*) resource_PluginGui_camel_sine_png; +const int PluginGui::camel_sine_pngSize = 174; + +// JUCER_RESOURCE: alternating_sine_png, 197, "../img/alternating_sine.png" +static const unsigned char resource_PluginGui_alternating_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,140,73,68,65,84,88,133,99,100,96, +96,248,207,48,8,0,211,64,59,0,6,112,59,100,21,20,15,184,67,232,12,88,48,68,96,161,16,134,131,79,35,48,104,66,100,212,33,232,128,145,1,86,142,16,74,11,52,78,43,131,38,68,70,29,130,14,70,29,130,14,48,75, +86,123,2,58,112,201,103,67,233,169,36,186,224,32,132,26,52,33,130,40,71,8,1,26,151,51,131,38,68,70,29,130,14,70,29,130,14,136,207,53,48,64,163,22,220,160,9,145,81,135,160,3,210,211,8,12,80,185,197,54, +12,66,132,202,96,208,132,8,0,67,200,18,200,95,246,147,104,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* PluginGui::alternating_sine_png = (const char*) resource_PluginGui_alternating_sine_png; +const int PluginGui::alternating_sine_pngSize = 197; + +// JUCER_RESOURCE: square_png, 179, "../img/square.png" +static const unsigned char resource_PluginGui_square_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,122,73,68,65,84,88,133,237,150,177,17,128,48, +12,3,29,142,189,216,130,37,216,44,75,66,99,83,40,85,34,238,80,161,111,146,198,190,143,10,59,45,34,238,16,96,251,91,160,216,223,91,39,59,157,92,185,96,34,197,236,203,216,36,19,153,68,44,130,88,4,177,8, +98,17,100,156,172,199,98,167,217,186,43,207,156,228,50,137,180,96,255,35,181,107,86,119,148,90,34,22,65,44,130,88,4,177,8,50,238,154,85,200,223,188,76,34,252,174,249,8,153,68,30,246,154,9,40,60,195,35, +102,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* PluginGui::square_png = (const char*) resource_PluginGui_square_png; +const int PluginGui::square_pngSize = 179; + +// JUCER_RESOURCE: logarithmic_saw_png, 206, "../img/logarithmic_saw.png" +static const unsigned char resource_PluginGui_logarithmic_saw_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,34,0,0,0,30,8,6,0,0,0,73,255,204,20,0,0,0,149,73,68,65,84,88,133,237,150,81, +10,128,32,16,68,215,232,94,221,194,75,116,158,46,225,37,235,103,37,24,19,139,218,118,64,31,136,172,32,12,15,87,13,34,178,11,1,147,119,128,204,25,36,233,112,15,226,204,8,130,148,65,156,206,10,177,17,39, +104,130,204,197,74,212,57,65,109,12,177,145,12,154,193,245,143,33,54,178,64,189,65,125,247,142,193,125,200,170,179,26,166,49,18,196,234,63,210,58,91,208,149,52,70,234,93,243,150,134,1,164,3,35,72,237, +94,82,104,140,140,32,200,255,65,162,92,118,78,199,70,42,208,4,177,123,107,30,66,99,228,0,184,114,16,107,149,79,109,141,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* PluginGui::logarithmic_saw_png = (const char*) resource_PluginGui_logarithmic_saw_png; +const int PluginGui::logarithmic_saw_pngSize = 206; + +// JUCER_RESOURCE: channeloff_png, 414, "../img/channeloff.png" +static const unsigned char resource_PluginGui_channeloff_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255,97,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187,127, +0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,222,8,25,20,6,56,156,246,144,159,0,0,0,29,105,84,88,116,67,111,109,109,101,110,116,0,0,0,0,0,67,114,101,97,116,101,100,32, +119,105,116,104,32,71,73,77,80,100,46,101,7,0,0,1,2,73,68,65,84,56,203,165,211,61,78,66,65,20,5,224,143,193,82,119,224,62,104,40,166,196,194,202,10,66,65,137,149,75,120,121,193,21,216,104,108,164,32,178, +128,183,1,94,66,67,66,172,172,140,27,176,178,192,202,70,139,55,26,2,138,2,39,153,102,230,220,159,185,231,220,154,85,100,14,113,138,46,154,233,118,138,17,10,185,183,101,122,88,9,110,99,129,11,20,104,164, +83,164,187,69,226,252,128,204,64,230,67,166,239,55,100,250,137,51,176,86,185,122,104,249,11,153,86,226,182,161,150,254,188,192,185,220,141,255,160,234,242,26,71,117,209,25,142,229,27,90,95,69,105,46,58, +193,107,72,211,30,218,30,67,116,67,146,106,178,67,130,9,154,193,158,8,201,36,113,135,216,136,105,72,14,235,237,144,160,135,81,248,118,92,182,133,10,21,183,129,162,174,244,46,122,194,157,104,166,244,252, +167,145,24,163,35,247,80,79,186,62,138,14,112,43,122,81,154,111,168,60,198,165,220,85,229,196,245,101,186,199,44,233,60,89,26,88,47,181,221,145,27,127,133,212,246,93,231,79,44,229,73,181,37,137,229,213, +0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* PluginGui::channeloff_png = (const char*) resource_PluginGui_channeloff_png; +const int PluginGui::channeloff_pngSize = 414; + +// JUCER_RESOURCE: channelon_png, 326, "../img/channelon.png" +static const unsigned char resource_PluginGui_channelon_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255,97,0,0,0,6,98,75,71,68,0,0,0,0,0,0,249,67,187,127, +0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,222,8,25,20,6,39,17,254,157,106,0,0,0,29,105,84,88,116,67,111,109,109,101,110,116,0,0,0,0,0,67,114,101,97,116,101,100,32, +119,105,116,104,32,71,73,77,80,100,46,101,7,0,0,0,170,73,68,65,84,56,203,173,147,177,13,194,48,16,69,159,143,148,176,81,20,101,129,84,84,68,217,5,89,176,0,204,16,193,0,30,0,69,202,8,169,88,131,12,64,145, +139,176,82,64,116,230,117,182,252,206,242,249,159,99,201,145,45,80,1,13,144,235,110,15,180,64,192,51,198,199,221,66,62,0,55,190,83,227,185,207,139,77,36,159,128,11,191,217,83,146,209,241,248,20,152,110, +94,35,207,20,148,60,233,24,156,190,249,133,141,157,104,195,172,84,162,221,182,210,72,244,85,22,114,33,17,209,144,88,233,69,19,102,165,21,32,36,20,8,162,217,174,13,114,141,103,156,146,216,49,80,146,1,197, +74,249,140,231,250,151,97,114,169,227,252,6,230,208,38,246,228,75,209,233,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* PluginGui::channelon_png = (const char*) resource_PluginGui_channelon_png; +const int PluginGui::channelon_pngSize = 326; + + +//[EndFile] You can add extra defines here... +//[/EndFile] diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index d44de01..cb1df98 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -820,7 +820,8 @@ void JuceOplvstiAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuf applyPitchBend(); } } - Opl->Generate(buffer.getNumSamples(), buffer.getSampleData(0)); +/// Jeff-Russ: getSampleData(int) is deprecated. use getWritePointer(int) + Opl->Generate(buffer.getNumSamples(), buffer.getWritePointer(0)); } //============================================================================== diff --git a/Source/config.h b/Source/config.h index ff6fc51..24b2801 100644 --- a/Source/config.h +++ b/Source/config.h @@ -75,24 +75,30 @@ typedef uint16_t Bit16u; typedef int16_t Bit16s; typedef uint32_t Bit32u; typedef int32_t Bit32s; -typedef int64_t Bit64u; -typedef uint64_t Bit64s; +typedef uint64_t Bit64u; +typedef int64_t Bit64s; typedef Bit32u Bitu; typedef Bit32s Bits; /// Jeff-Russ PUT PLATFORM SPECIFIC STUFF HERE: +#ifndef _WIN32 /// __forceinline likely not needed + #define __forceinline inline /// outside of windows. +#endif + #ifdef _WIN32 // covers both 32 and 64-bit #define INLINE __forceinline -#elif __APPLE__ - #include "TargetConditionals.h" - #define INLINE inline /// apple has no forceinline -#elif __linux - #define INLINE inline -#elif __unix - #define INLINE inline -#elif __posix - #define INLINE inline -#else - #error Unsupported Operating System -#endif +#endif + +//#elif __APPLE__ +// #include "TargetConditionals.h" +// #define INLINE inline /// apple has no forceinline +//#elif __linux +// #define INLINE inline +//#elif __unix +// #define INLINE inline +//#elif __posix +// #define INLINE inline +//#else +// #error Unsupported Operating System +//#endif diff --git a/Source/dbopl.cpp b/Source/dbopl.cpp index a35e054..2ac86c6 100644 --- a/Source/dbopl.cpp +++ b/Source/dbopl.cpp @@ -889,6 +889,8 @@ Channel* Channel::BlockTemplate( Chip* chip, Bit32u samples, Bit32s* output ) { return (this + 2); } break; + default: /// Jeff-Russ added to silence warning + break; } //Init the operators with the the current vibrato and tremolo values Op( 0 )->Prepare( chip ); @@ -954,6 +956,8 @@ Channel* Channel::BlockTemplate( Chip* chip, Bit32u samples, Bit32s* output ) { output[ i * 2 + 0 ] += sample & maskLeft; output[ i * 2 + 1 ] += sample & maskRight; break; + default: /// Jeff-Russ added to silence warning + break; } } switch( mode ) { diff --git a/Source/windows.h b/Source/windows.h index 2fa0bff..5e32977 100644 --- a/Source/windows.h +++ b/Source/windows.h @@ -31,7 +31,7 @@ typedef int16_t WCHAR; // HANDLE - A handle to an object. // This type is declared in WinDef.h as follows: -typedef PVOID HANDLE; +typedef /*PVOID*/ DWORD HANDLE; DWORD STD_INPUT_HANDLE = -10; DWORD STD_OUTPUT_HANDLE = -11; From 41493c657e329314d5ad6805de17c5c63eec6547 Mon Sep 17 00:00:00 2001 From: Jeffrey Russ Date: Sun, 22 Feb 2015 12:07:35 -0500 Subject: [PATCH 3/8] Create README.txt --- _RELEASES/README.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 _RELEASES/README.txt diff --git a/_RELEASES/README.txt b/_RELEASES/README.txt new file mode 100644 index 0000000..421376d --- /dev/null +++ b/_RELEASES/README.txt @@ -0,0 +1 @@ +dummy From ec8f2fdebfd13cf1a2638ad8074928b25ec4ffdd Mon Sep 17 00:00:00 2001 From: Jeff-Russ Date: Sun, 22 Feb 2015 12:26:42 -0500 Subject: [PATCH 4/8] name change name change --- JuceOPLVSTi.jucer => JuceOPL.jucer | 68 +++++++++++++++--------------- 1 file changed, 33 insertions(+), 35 deletions(-) rename JuceOPLVSTi.jucer => JuceOPL.jucer (81%) diff --git a/JuceOPLVSTi.jucer b/JuceOPL.jucer similarity index 81% rename from JuceOPLVSTi.jucer rename to JuceOPL.jucer index 8d4b687..59d59b6 100644 --- a/JuceOPLVSTi.jucer +++ b/JuceOPL.jucer @@ -1,18 +1,16 @@ - @@ -95,44 +93,44 @@ winArchitecture="32-bit" isDebug="0" optimisation="3" targetName="JuceOPLVSTi"/> - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + From e39174f77ae3c610f16cc3a561dd9e4f45ac95aa Mon Sep 17 00:00:00 2001 From: Jeffrey Russ Date: Sun, 22 Feb 2015 13:21:06 -0500 Subject: [PATCH 5/8] Delete README.txt --- _RELEASES/README.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 _RELEASES/README.txt diff --git a/_RELEASES/README.txt b/_RELEASES/README.txt deleted file mode 100644 index 421376d..0000000 --- a/_RELEASES/README.txt +++ /dev/null @@ -1 +0,0 @@ -dummy From 49a6f847ee06078fb9d6734d8e5b89b97d50ca75 Mon Sep 17 00:00:00 2001 From: Jeff-Russ Date: Sun, 22 Feb 2015 20:08:45 -0500 Subject: [PATCH 6/8] Started over with an empty Introjucer template and it finally built the AU!! --- JuceOPL.jucer | 137 --------------- Source/PluginGui.cpp | 12 +- Source/PluginGui.h | 386 +++++++++++++++++++++---------------------- _RELEASES/README.txt | 1 - 4 files changed, 199 insertions(+), 337 deletions(-) delete mode 100644 JuceOPL.jucer delete mode 100644 _RELEASES/README.txt diff --git a/JuceOPL.jucer b/JuceOPL.jucer deleted file mode 100644 index 59d59b6..0000000 --- a/JuceOPL.jucer +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Source/PluginGui.cpp b/Source/PluginGui.cpp index 52158ec..3fa1370 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 Introjucer version: 3.1.0 + Created with Introjucer version: 3.1.1 ------------------------------------------------------------------------------ @@ -28,10 +28,10 @@ void PluginGui::updateFromParameters() { emulatorSlider->setValue(processor->getEnumParameter("Emulator"), juce::NotificationType::dontSendNotification); setRecordButtonState(processor->isThisInstanceRecording()); - + /// setToggleState(bool, bool) is deprecated. /// Jeff-Russ replaced the second arg of "false" with dontSendNotification: - + sineImageButton->setToggleState(false, dontSendNotification); halfsineImageButton->setToggleState(false, dontSendNotification); abssineImageButton->setToggleState(false, dontSendNotification); @@ -69,10 +69,10 @@ void PluginGui::updateFromParameters() case 6: squareImageButton2->setToggleState(true, dontSendNotification); break; case 7: logsawImageButton2->setToggleState(true, dontSendNotification); break; } - + /// setSelectedItemIndex(bool, bool) is deprecated. /// Jeff-Russ replaced the second arg of "true" with "sendNotificationAsync": - + frequencyComboBox->setSelectedItemIndex ( processor->getEnumParameter("Modulator Frequency Multiplier"), sendNotificationAsync); @@ -91,7 +91,7 @@ void PluginGui::updateFromParameters() dSlider2->setValue(processor->getIntParameter("Carrier Decay"), juce::NotificationType::dontSendNotification); sSlider2->setValue(processor->getIntParameter("Carrier Sustain Level"), juce::NotificationType::dontSendNotification); rSlider2->setValue(processor->getIntParameter("Carrier Release"), juce::NotificationType::dontSendNotification); - + /// Jeff-Russ replaced the second arg of "true" with "sendNotificationAsync": keyscaleAttenuationComboBox->setSelectedItemIndex ( diff --git a/Source/PluginGui.h b/Source/PluginGui.h index 8d19093..2dee55a 100644 --- a/Source/PluginGui.h +++ b/Source/PluginGui.h @@ -1,193 +1,193 @@ -/* - ============================================================================== - - This is an automatically generated GUI class created by the Introjucer! - - Be careful when adding custom code to these files, as only the code within - the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded - and re-saved. - - Created with Introjucer version: 3.1.0 - - ------------------------------------------------------------------------------ - - The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-13 by Raw Material Software Ltd. - - ============================================================================== -*/ - -#ifndef __JUCE_HEADER_450C07F5C14097B8__ -#define __JUCE_HEADER_450C07F5C14097B8__ - -//[Headers] -- You can add your own extra header files here -- -#include -#include "JuceHeader.h" -#include "PluginProcessor.h" -//[/Headers] - - - -//============================================================================== -/** - //[Comments] - This is a GUI for the OPL2 VST plugin, created in Juce. - //[/Comments] -*/ -class PluginGui : public AudioProcessorEditor, - public FileDragAndDropTarget, - public DragAndDropContainer, - public Timer, - public ComboBoxListener, - public SliderListener, - public ButtonListener -{ -public: - //============================================================================== - PluginGui (JuceOplvstiAudioProcessor* ownerFilter); - ~PluginGui(); - - //============================================================================== - //[UserMethods] -- You can add your own custom methods in this section. - void updateFromParameters(); - bool isInterestedInFileDrag (const StringArray& files); - void fileDragEnter (const StringArray& files, int x, int y); - void fileDragMove (const StringArray& files, int x, int y); - void fileDragExit (const StringArray& files); - void filesDropped (const StringArray& files, int x, int y); - void timerCallback(); - void setRecordButtonState(bool recording); - //[/UserMethods] - - void paint (Graphics& g); - void resized(); - void comboBoxChanged (ComboBox* comboBoxThatHasChanged); - void sliderValueChanged (Slider* sliderThatWasMoved); - void buttonClicked (Button* buttonThatWasClicked); - - // Binary resources: - static const char* full_sine_png; - static const int full_sine_pngSize; - static const char* half_sine_png; - static const int half_sine_pngSize; - static const char* abs_sine_png; - static const int abs_sine_pngSize; - static const char* quarter_sine_png; - static const int quarter_sine_pngSize; - static const char* camel_sine_png; - static const int camel_sine_pngSize; - static const char* alternating_sine_png; - static const int alternating_sine_pngSize; - static const char* square_png; - static const int square_pngSize; - static const char* logarithmic_saw_png; - static const int logarithmic_saw_pngSize; - static const char* channeloff_png; - static const int channeloff_pngSize; - static const char* channelon_png; - static const int channelon_pngSize; - - -private: - //[UserVariables] -- You can add your own custom variables in this section. - static const uint32 COLOUR_MID = 0xff007f00; - static const uint32 COLOUR_RECORDING = 0xffff0000; - JuceOplvstiAudioProcessor* processor; - std::array, Hiopl::CHANNELS> channels; - TooltipWindow tooltipWindow; - //[/UserVariables] - - //============================================================================== - ScopedPointer groupComponent; - ScopedPointer frequencyComboBox; - ScopedPointer