Browse Source

Remove auto-gain on/off button and parameter

Doesn't work properly, causing very loud sound when clicked
So, remove it, as if it was always on

Also add some small credits in there ;)
tags/2018-04-16
falkTX 8 years ago
parent
commit
c50ccd3d34
7 changed files with 16 additions and 19 deletions
  1. +0
    -6
      ports/klangfalter/source/Parameters.cpp
  2. +0
    -1
      ports/klangfalter/source/Parameters.h
  3. +0
    -3
      ports/klangfalter/source/Persistence.cpp
  4. +1
    -6
      ports/klangfalter/source/Processor.cpp
  5. +2
    -3
      ports/klangfalter/source/UI/KlangFalterEditor.cpp
  6. +12
    -0
      ports/klangfalter/source/UI/SettingsDialogComponent.cpp
  7. +1
    -0
      ports/klangfalter/source/UI/SettingsDialogComponent.h

+ 0
- 6
ports/klangfalter/source/Parameters.cpp View File

@@ -120,12 +120,6 @@ const FloatParameterDescriptor Parameters::StereoWidth(12,
0.0f,
10.0f);
const BoolParameterDescriptor Parameters::AutoGainOn(13,
"Autogain On",
"",
ParameterDescriptor::NotAutomatable,
true);
const FloatParameterDescriptor Parameters::AutoGainDecibels(14,
"Autogain",
"dB",


+ 0
- 1
ports/klangfalter/source/Parameters.h View File

@@ -37,7 +37,6 @@ struct Parameters
static const BoolParameterDescriptor DryOn;
static const FloatParameterDescriptor DryDecibels;
static const BoolParameterDescriptor AutoGainOn;
static const FloatParameterDescriptor AutoGainDecibels;
static const IntParameterDescriptor EqLowType;


+ 0
- 3
ports/klangfalter/source/Persistence.cpp View File

@@ -75,7 +75,6 @@ XmlElement* SaveState(const File& irDirectory, Processor& processor)
convolutionElement->setAttribute("wetDecibels", processor.getParameter(Parameters::WetDecibels));
convolutionElement->setAttribute("dryOn", processor.getParameter(Parameters::DryOn));
convolutionElement->setAttribute("dryDecibels", processor.getParameter(Parameters::DryDecibels));
convolutionElement->setAttribute("autoGainOn", processor.getParameter(Parameters::AutoGainOn));
convolutionElement->setAttribute("eqLowType", internal::EqType2String(Parameters::EqType(processor.getParameter(Parameters::EqLowType))));
convolutionElement->setAttribute("eqLowCutFreq", processor.getParameter(Parameters::EqLowCutFreq));
convolutionElement->setAttribute("eqLowShelfFreq", processor.getParameter(Parameters::EqLowShelfFreq));
@@ -136,7 +135,6 @@ bool LoadState(const File& irDirectory, XmlElement& element, Processor& processo
double wetDecibels = element.getDoubleAttribute("wetDecibels", Parameters::WetDecibels.getDefaultValue());
bool dryOn = element.getBoolAttribute("dryOn", Parameters::DryOn.getDefaultValue());
double dryDecibels = element.getDoubleAttribute("dryDecibels", Parameters::DryDecibels.getDefaultValue());
bool autoGainOn = element.getBoolAttribute("autoGainOn", Parameters::AutoGainOn.getDefaultValue());
double irBegin = element.getDoubleAttribute("irBegin", 0.0);
double irEnd = element.getDoubleAttribute("irEnd", 1.0);
double stretch = element.getDoubleAttribute("stretch", 1.0);
@@ -186,7 +184,6 @@ bool LoadState(const File& irDirectory, XmlElement& element, Processor& processo
processor.setParameterNotifyingHost(Parameters::WetDecibels, static_cast<float>(wetDecibels));
processor.setParameterNotifyingHost(Parameters::DryOn, dryOn);
processor.setParameterNotifyingHost(Parameters::DryDecibels, static_cast<float>(dryDecibels));
processor.setParameterNotifyingHost(Parameters::AutoGainOn, autoGainOn);
processor.setParameterNotifyingHost(Parameters::EqLowType, static_cast<int>(eqLoType));
processor.setParameterNotifyingHost(Parameters::EqLowCutFreq, static_cast<float>(eqLoCutFreq));
processor.setParameterNotifyingHost(Parameters::EqLowShelfFreq, static_cast<float>(eqLoShelfFreq));


+ 1
- 6
ports/klangfalter/source/Processor.cpp View File

@@ -72,7 +72,6 @@ Processor::Processor() :
_parameterSet.registerParameter(Parameters::EqHighShelfFreq);
_parameterSet.registerParameter(Parameters::EqHighShelfDecibels);
_parameterSet.registerParameter(Parameters::StereoWidth);
_parameterSet.registerParameter(Parameters::AutoGainOn);
_parameterSet.registerParameter(Parameters::AutoGainDecibels);
_agents.push_back(new IRAgent(*this, 0, 0));
@@ -280,11 +279,7 @@ void Processor::processBlock(AudioSampleBuffer& buffer, MidiBuffer& /*midiMessag
_wetBuffer.clear();
if (numInputChannels > 0 && numOutputChannels > 0)
{
float autoGain = 1.0f;
if (getParameter(Parameters::AutoGainOn))
{
autoGain = DecibelScaling::Db2Gain(getParameter(Parameters::AutoGainDecibels));
}
float autoGain = DecibelScaling::Db2Gain(getParameter(Parameters::AutoGainDecibels));
// Convolve
IRAgent* irAgent00 = getAgent(0, 0);


+ 2
- 3
ports/klangfalter/source/UI/KlangFalterEditor.cpp View File

@@ -1052,7 +1052,8 @@ void KlangFalterEditor::buttonClicked (Button* buttonThatWasClicked)
else if (buttonThatWasClicked == _autogainButton)
{
//[UserButtonCode__autogainButton] -- add your button handler code here..
_processor.setParameterNotifyingHost(Parameters::AutoGainOn, _autogainButton->getToggleState());
if (_autogainButton->getToggleState())
_autogainButton->setToggleState(false, juce::dontSendNotification);
//[/UserButtonCode__autogainButton]
}
else if (buttonThatWasClicked == _reverseButton)
@@ -1162,10 +1163,8 @@ void KlangFalterEditor::updateUI()
}
{
const float autoGainDecibels = _processor.getParameter(Parameters::AutoGainDecibels);
const bool autoGainOn = _processor.getParameter(Parameters::AutoGainOn);
const juce::String autoGainText = DecibelScaling::DecibelString(autoGainDecibels);
_autogainButton->setButtonText(juce::String("Autogain ") + autoGainText);
_autogainButton->setToggleState(autoGainOn, juce::dontSendNotification);
}
{
Parameters::EqType lowEqType = static_cast<Parameters::EqType>(_processor.getParameter(Parameters::EqLowType));


+ 12
- 0
ports/klangfalter/source/UI/SettingsDialogComponent.cpp View File

@@ -38,6 +38,7 @@ SettingsDialogComponent::SettingsDialogComponent (Processor& processor)
_aboutGroupComponent (0),
_nameVersionLabel (0),
_copyrightLabel (0),
_myLabel (0),
_licenseHyperlink (0),
_infoGroupComponent (0),
_juceVersionPrefixLabel (0),
@@ -81,6 +82,15 @@ SettingsDialogComponent::SettingsDialogComponent (Processor& processor)
_copyrightLabel->setColour (TextEditor::textColourId, Colour (0xff202020));
_copyrightLabel->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (_myLabel = new Label (String::empty,
L"Modified by falkTX"));
_myLabel->setFont (Font (15.0000f, Font::plain));
_myLabel->setJustificationType (Justification::centredLeft);
_myLabel->setEditable (false, false, false);
_myLabel->setColour (Label::textColourId, Colour (0xff202020));
_myLabel->setColour (TextEditor::textColourId, Colour (0xff202020));
_myLabel->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (_licenseHyperlink = new HyperlinkButton (L"Licensed under GPL3",
URL (L"http://www.gnu.org/licenses")));
_licenseHyperlink->setTooltip (L"http://www.gnu.org/licenses");
@@ -239,6 +249,7 @@ SettingsDialogComponent::~SettingsDialogComponent()
deleteAndZero (_aboutGroupComponent);
deleteAndZero (_nameVersionLabel);
deleteAndZero (_copyrightLabel);
deleteAndZero (_myLabel);
deleteAndZero (_licenseHyperlink);
deleteAndZero (_infoGroupComponent);
deleteAndZero (_juceVersionPrefixLabel);
@@ -284,6 +295,7 @@ void SettingsDialogComponent::resized()
_aboutGroupComponent->setBounds (16, 11, 472, 101);
_nameVersionLabel->setBounds (24, 28, 344, 24);
_copyrightLabel->setBounds (24, 52, 344, 24);
_myLabel->setBounds (24, 76, 344, 24);
_licenseHyperlink->setBounds (160, 76, 184, 24);
_infoGroupComponent->setBounds (16, 416, 472, 152);
_juceVersionPrefixLabel->setBounds (24, 436, 140, 24);


+ 1
- 0
ports/klangfalter/source/UI/SettingsDialogComponent.h View File

@@ -73,6 +73,7 @@ private:
GroupComponent* _aboutGroupComponent;
Label* _nameVersionLabel;
Label* _copyrightLabel;
Label* _myLabel;
HyperlinkButton* _licenseHyperlink;
GroupComponent* _infoGroupComponent;
Label* _juceVersionPrefixLabel;


Loading…
Cancel
Save