Skip to content

Commit

Permalink
Convert tabs to spaces in all code files
Browse files Browse the repository at this point in the history
  • Loading branch information
getdunne committed Aug 30, 2017
1 parent fc4aa19 commit f43bea9
Show file tree
Hide file tree
Showing 24 changed files with 668 additions and 668 deletions.
86 changes: 43 additions & 43 deletions Source/GuiEgTab.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "GuiEgTab.h"

GuiEgTab::GuiEgTab (SynthSound* pSynthSound)
: pSound(pSynthSound)
: pSound(pSynthSound)
{
addAndMakeVisible (attackLabel = new Label ("attack label",
TRANS("Attack Time (sec)")));
Expand Down Expand Up @@ -33,11 +33,11 @@ GuiEgTab::GuiEgTab (SynthSound* pSynthSound)

addAndMakeVisible (sustainLabel = new Label ("sustain level label",
TRANS("Sustain Level (%)")));
sustainLabel->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
sustainLabel->setJustificationType (Justification::centredRight);
sustainLabel->setEditable (false, false, false);
sustainLabel->setColour (TextEditor::textColourId, Colours::black);
sustainLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
sustainLabel->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
sustainLabel->setJustificationType (Justification::centredRight);
sustainLabel->setEditable (false, false, false);
sustainLabel->setColour (TextEditor::textColourId, Colours::black);
sustainLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

addAndMakeVisible (sustainSlider = new Slider ("sustain level slider"));
sustainSlider->setRange (0, 100, 1);
Expand All @@ -47,19 +47,19 @@ GuiEgTab::GuiEgTab (SynthSound* pSynthSound)

addAndMakeVisible (releaseLabel = new Label ("release time label",
TRANS("Release Time (sec)")));
releaseLabel->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
releaseLabel->setJustificationType (Justification::centredRight);
releaseLabel->setEditable (false, false, false);
releaseLabel->setColour (TextEditor::textColourId, Colours::black);
releaseLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
releaseLabel->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
releaseLabel->setJustificationType (Justification::centredRight);
releaseLabel->setEditable (false, false, false);
releaseLabel->setColour (TextEditor::textColourId, Colours::black);
releaseLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

addAndMakeVisible (releaseSlider = new Slider ("release time slider"));
releaseSlider->setRange (0, 10, 0);
releaseSlider->setSliderStyle (Slider::LinearHorizontal);
releaseSlider->setTextBoxStyle (Slider::TextBoxRight, false, 80, 20);
releaseSlider->addListener (this);
releaseSlider->setRange (0, 10, 0);
releaseSlider->setSliderStyle (Slider::LinearHorizontal);
releaseSlider->setTextBoxStyle (Slider::TextBoxRight, false, 80, 20);
releaseSlider->addListener (this);

notify();
notify();

setSize (600, 400);
}
Expand All @@ -84,55 +84,55 @@ void GuiEgTab::paint (Graphics& g)

void GuiEgTab::resized()
{
const int labelLeft = 16;
const int controlLeft = 144;
const int labelWidth = 120;
const int sliderWidth = 420;
const int controlHeight = 24;
const int gapHeight = 8;

int top = 20;
attackLabel->setBounds (labelLeft, top, labelWidth, controlHeight);
const int labelLeft = 16;
const int controlLeft = 144;
const int labelWidth = 120;
const int sliderWidth = 420;
const int controlHeight = 24;
const int gapHeight = 8;

int top = 20;
attackLabel->setBounds (labelLeft, top, labelWidth, controlHeight);
attackSlider->setBounds (controlLeft, top, sliderWidth, controlHeight);
top += controlHeight + gapHeight;
top += controlHeight + gapHeight;
decayLabel->setBounds (labelLeft, top, labelWidth, controlHeight);
decaySlider->setBounds (controlLeft, top, sliderWidth, controlHeight);
top += controlHeight + gapHeight;
sustainLabel->setBounds (labelLeft, top, labelWidth, controlHeight);
top += controlHeight + gapHeight;
sustainLabel->setBounds (labelLeft, top, labelWidth, controlHeight);
sustainSlider->setBounds (controlLeft, top, sliderWidth, controlHeight);
top += controlHeight + gapHeight;
releaseLabel->setBounds (labelLeft, top, labelWidth, controlHeight);
top += controlHeight + gapHeight;
releaseLabel->setBounds (labelLeft, top, labelWidth, controlHeight);
releaseSlider->setBounds (controlLeft, top, sliderWidth, controlHeight);
}

void GuiEgTab::sliderValueChanged (Slider* sliderThatWasMoved)
{
double value = sliderThatWasMoved->getValue();
SynthParameters* pParams = pSound->pParams;
if (sliderThatWasMoved == attackSlider)
double value = sliderThatWasMoved->getValue();
SynthParameters* pParams = pSound->pParams;
if (sliderThatWasMoved == attackSlider)
{
pParams->ampEgAttackTimeSeconds = value;
pParams->ampEgAttackTimeSeconds = value;
}
else if (sliderThatWasMoved == decaySlider)
{
pParams->ampEgDecayTimeSeconds = value;
pParams->ampEgDecayTimeSeconds = value;
}
else if (sliderThatWasMoved == sustainSlider)
{
pParams->ampEgSustainLevel = 0.01 * value;
pParams->ampEgSustainLevel = 0.01 * value;
}
else if (sliderThatWasMoved == releaseSlider)
{
pParams->ampEgReleaseTimeSeconds = value;
pParams->ampEgReleaseTimeSeconds = value;
}
pSound->parameterChanged();
pSound->parameterChanged();
}

void GuiEgTab::notify()
{
SynthParameters* pParams = pSound->pParams;
attackSlider->setValue(pParams->ampEgAttackTimeSeconds);
decaySlider->setValue(pParams->ampEgDecayTimeSeconds);
sustainSlider->setValue(100.0 * pParams->ampEgSustainLevel);
releaseSlider->setValue(pParams->ampEgReleaseTimeSeconds);
SynthParameters* pParams = pSound->pParams;
attackSlider->setValue(pParams->ampEgAttackTimeSeconds);
decaySlider->setValue(pParams->ampEgDecayTimeSeconds);
sustainSlider->setValue(100.0 * pParams->ampEgSustainLevel);
releaseSlider->setValue(pParams->ampEgReleaseTimeSeconds);
}
4 changes: 2 additions & 2 deletions Source/GuiEgTab.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ class GuiEgTab : public Component,
void resized() override;
void sliderValueChanged (Slider* sliderThatWasMoved) override;

void notify();
void notify();

private:
SynthSound* pSound;
SynthSound* pSound;

ScopedPointer<Label> attackLabel;
ScopedPointer<Slider> attackSlider;
Expand Down
142 changes: 71 additions & 71 deletions Source/GuiMainTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,60 @@

//==============================================================================
GuiMainTab::GuiMainTab (SynthSound* pSynthSound)
: pSound(pSynthSound)
: pSound(pSynthSound)
{
addAndMakeVisible (masterLevelLabel = new Label ("master level label", TRANS("Master Volume")));
masterLevelLabel->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
masterLevelLabel->setJustificationType (Justification::centredRight);
masterLevelLabel->setEditable (false, false, false);
masterLevelLabel->setColour (TextEditor::textColourId, Colours::black);
masterLevelLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
masterLevelLabel->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular"));
masterLevelLabel->setJustificationType (Justification::centredRight);
masterLevelLabel->setEditable (false, false, false);
masterLevelLabel->setColour (TextEditor::textColourId, Colours::black);
masterLevelLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

addAndMakeVisible (masterLevelSlider = new Slider ("Master Volume"));
masterLevelSlider->setRange (0, 10, 0);
masterLevelSlider->setSliderStyle (Slider::LinearHorizontal);
masterLevelSlider->setTextBoxStyle (Slider::TextBoxRight, false, 80, 20);
masterLevelSlider->addListener (this);
masterLevelSlider->setRange (0, 10, 0);
masterLevelSlider->setSliderStyle (Slider::LinearHorizontal);
masterLevelSlider->setTextBoxStyle (Slider::TextBoxRight, false, 80, 20);
masterLevelSlider->addListener (this);

addAndMakeVisible(pbUpLabel = new Label("PB up semis", TRANS("P.Bend up (semi)")));
pbUpLabel->setFont(Font(15.00f, Font::plain).withTypefaceStyle("Regular"));
pbUpLabel->setJustificationType(Justification::centredRight);
pbUpLabel->setEditable(false, false, false);
pbUpLabel->setColour(TextEditor::textColourId, Colours::black);
pbUpLabel->setColour(TextEditor::backgroundColourId, Colour(0x00000000));
addAndMakeVisible(pbUpLabel = new Label("PB up semis", TRANS("P.Bend up (semi)")));
pbUpLabel->setFont(Font(15.00f, Font::plain).withTypefaceStyle("Regular"));
pbUpLabel->setJustificationType(Justification::centredRight);
pbUpLabel->setEditable(false, false, false);
pbUpLabel->setColour(TextEditor::textColourId, Colours::black);
pbUpLabel->setColour(TextEditor::backgroundColourId, Colour(0x00000000));

addAndMakeVisible(pbUpSlider = new Slider("PB up semis"));
pbUpSlider->setRange(0, 12, 1);
pbUpSlider->setSliderStyle(Slider::LinearHorizontal);
pbUpSlider->setTextBoxStyle(Slider::TextBoxRight, false, 80, 20);
pbUpSlider->addListener(this);
addAndMakeVisible(pbUpSlider = new Slider("PB up semis"));
pbUpSlider->setRange(0, 12, 1);
pbUpSlider->setSliderStyle(Slider::LinearHorizontal);
pbUpSlider->setTextBoxStyle(Slider::TextBoxRight, false, 80, 20);
pbUpSlider->addListener(this);

addAndMakeVisible(pbDownLabel = new Label("PB down semis", TRANS("P.Bend down (semi)")));
pbDownLabel->setFont(Font(15.00f, Font::plain).withTypefaceStyle("Regular"));
pbDownLabel->setJustificationType(Justification::centredRight);
pbDownLabel->setEditable(false, false, false);
pbDownLabel->setColour(TextEditor::textColourId, Colours::black);
pbDownLabel->setColour(TextEditor::backgroundColourId, Colour(0x00000000));
addAndMakeVisible(pbDownLabel = new Label("PB down semis", TRANS("P.Bend down (semi)")));
pbDownLabel->setFont(Font(15.00f, Font::plain).withTypefaceStyle("Regular"));
pbDownLabel->setJustificationType(Justification::centredRight);
pbDownLabel->setEditable(false, false, false);
pbDownLabel->setColour(TextEditor::textColourId, Colours::black);
pbDownLabel->setColour(TextEditor::backgroundColourId, Colour(0x00000000));

addAndMakeVisible(pbDownSlider = new Slider("PB down semis"));
pbDownSlider->setRange(0, 12, 1);
pbDownSlider->setSliderStyle(Slider::LinearHorizontal);
pbDownSlider->setTextBoxStyle(Slider::TextBoxRight, false, 80, 20);
pbDownSlider->addListener(this);
addAndMakeVisible(pbDownSlider = new Slider("PB down semis"));
pbDownSlider->setRange(0, 12, 1);
pbDownSlider->setSliderStyle(Slider::LinearHorizontal);
pbDownSlider->setTextBoxStyle(Slider::TextBoxRight, false, 80, 20);
pbDownSlider->addListener(this);

notify();
notify();

setSize (600, 400);
}

GuiMainTab::~GuiMainTab()
{
masterLevelLabel = nullptr;
masterLevelSlider = nullptr;
pbUpLabel = nullptr;
pbUpSlider = nullptr;
pbDownLabel = nullptr;
pbDownSlider = nullptr;
masterLevelLabel = nullptr;
masterLevelSlider = nullptr;
pbUpLabel = nullptr;
pbUpSlider = nullptr;
pbDownLabel = nullptr;
pbDownSlider = nullptr;
}

//==============================================================================
Expand All @@ -66,47 +66,47 @@ void GuiMainTab::paint (Graphics& g)

void GuiMainTab::resized()
{
const int labelLeft = 16;
const int controlLeft = 144;
const int labelWidth = 120;
const int sliderWidth = 420;
const int controlHeight = 24;
const int gapHeight = 8;
const int labelLeft = 16;
const int controlLeft = 144;
const int labelWidth = 120;
const int sliderWidth = 420;
const int controlHeight = 24;
const int gapHeight = 8;

int top = 20;
masterLevelLabel->setBounds(labelLeft, top, labelWidth, controlHeight);
masterLevelSlider->setBounds(controlLeft, top, sliderWidth, controlHeight);
top += controlHeight + 5 * gapHeight;
pbUpLabel->setBounds(labelLeft, top, labelWidth, controlHeight);
pbUpSlider->setBounds(controlLeft, top, sliderWidth, controlHeight);
top += controlHeight + gapHeight;
pbDownLabel->setBounds(labelLeft, top, labelWidth, controlHeight);
pbDownSlider->setBounds(controlLeft, top, sliderWidth, controlHeight);
int top = 20;
masterLevelLabel->setBounds(labelLeft, top, labelWidth, controlHeight);
masterLevelSlider->setBounds(controlLeft, top, sliderWidth, controlHeight);
top += controlHeight + 5 * gapHeight;
pbUpLabel->setBounds(labelLeft, top, labelWidth, controlHeight);
pbUpSlider->setBounds(controlLeft, top, sliderWidth, controlHeight);
top += controlHeight + gapHeight;
pbDownLabel->setBounds(labelLeft, top, labelWidth, controlHeight);
pbDownSlider->setBounds(controlLeft, top, sliderWidth, controlHeight);
}

void GuiMainTab::sliderValueChanged (Slider* sliderThatWasMoved)
{
double value = sliderThatWasMoved->getValue();
SynthParameters* pParams = pSound->pParams;
if (sliderThatWasMoved == masterLevelSlider)
double value = sliderThatWasMoved->getValue();
SynthParameters* pParams = pSound->pParams;
if (sliderThatWasMoved == masterLevelSlider)
{
pParams->masterLevel = 0.1 * value;
pParams->masterLevel = 0.1 * value;
}
else if (sliderThatWasMoved == pbUpSlider)
{
pParams->pitchBendUpSemitones = int(value);
}
else if (sliderThatWasMoved == pbDownSlider)
{
pParams->pitchBendDownSemitones = int(value);
}
pSound->parameterChanged();
else if (sliderThatWasMoved == pbUpSlider)
{
pParams->pitchBendUpSemitones = int(value);
}
else if (sliderThatWasMoved == pbDownSlider)
{
pParams->pitchBendDownSemitones = int(value);
}
pSound->parameterChanged();
}

void GuiMainTab::notify()
{
SynthParameters* pParams = pSound->pParams;
masterLevelSlider->setValue(10.0 * pParams->masterLevel);
pbUpSlider->setValue(pParams->pitchBendUpSemitones);
pbDownSlider->setValue(pParams->pitchBendDownSemitones);
SynthParameters* pParams = pSound->pParams;
masterLevelSlider->setValue(10.0 * pParams->masterLevel);
pbUpSlider->setValue(pParams->pitchBendUpSemitones);
pbDownSlider->setValue(pParams->pitchBendDownSemitones);
}
12 changes: 6 additions & 6 deletions Source/GuiMainTab.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ class GuiMainTab : public Component, public SliderListener
void resized() override;
void sliderValueChanged (Slider* sliderThatWasMoved) override;

void notify();
void notify();

private:
SynthSound* pSound;
SynthSound* pSound;

ScopedPointer<Label> masterLevelLabel;
ScopedPointer<Slider> masterLevelSlider;
ScopedPointer<Label> pbUpLabel;
ScopedPointer<Slider> pbUpSlider;
ScopedPointer<Label> pbDownLabel;
ScopedPointer<Slider> pbDownSlider;
ScopedPointer<Label> pbUpLabel;
ScopedPointer<Slider> pbUpSlider;
ScopedPointer<Label> pbDownLabel;
ScopedPointer<Slider> pbDownSlider;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GuiMainTab)
};
Loading

0 comments on commit f43bea9

Please sign in to comment.