Skip to content

Commit

Permalink
Merged in f/elk_juce_plugin_only_for_review (pull request #3)
Browse files Browse the repository at this point in the history
JUCE example plugin only for review - JUCE project files are all omitted.

Approved-by: Gustav Andersson <[email protected]>
Approved-by: Ruben Svensson <[email protected]>
Approved-by: Stefano Zambon <[email protected]>
  • Loading branch information
IliasBergstrom committed Dec 3, 2019
2 parents bb98dd1 + 0fa0abe commit 8898318
Show file tree
Hide file tree
Showing 12 changed files with 2,424 additions and 0 deletions.
71 changes: 71 additions & 0 deletions elk_juce_example/Source/ElkLogo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/* (Auto-generated binary data file). */

#include "ElkLogo.h"

static const unsigned char temp1[] = {60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49,46,48,34,32,101,110,99,111,100,105,110,103,61,34,85,84,70,45,56,34,63,62,10,60,
115,118,103,32,100,97,116,97,45,110,97,109,101,61,34,76,97,103,101,114,32,49,34,32,118,105,101,119,66,111,120,61,34,48,32,48,32,52,55,53,
46,52,53,32,51,57,51,46,52,53,34,32,120,109,108,110,115,61,34,104,116,116,112,58,47,47,119,119,119,46,119,51,46,111,114,103,47,50,48,48,
48,47,115,118,103,34,62,10,60,100,101,102,115,62,10,60,115,116,121,108,101,62,46,99,108,115,45,49,123,102,105,108,108,58,110,111,110,101,59,125,
46,99,108,115,45,50,123,102,105,108,108,58,35,51,100,101,97,56,54,59,125,46,99,108,115,45,51,123,102,105,108,108,58,117,114,108,40,35,97,41,
59,125,60,47,115,116,121,108,101,62,10,60,112,97,116,116,101,114,110,32,105,100,61,34,97,34,32,119,105,100,116,104,61,34,50,48,48,34,32,104,
101,105,103,104,116,61,34,50,48,48,34,32,100,97,116,97,45,110,97,109,101,61,34,76,111,103,111,34,32,112,97,116,116,101,114,110,85,110,105,116,
115,61,34,117,115,101,114,83,112,97,99,101,79,110,85,115,101,34,32,118,105,101,119,66,111,120,61,34,48,32,48,32,50,48,48,32,50,48,48,34,
62,10,60,114,101,99,116,32,99,108,97,115,115,61,34,99,108,115,45,49,34,32,119,105,100,116,104,61,34,50,48,48,34,32,104,101,105,103,104,116,
61,34,50,48,48,34,47,62,10,60,114,101,99,116,32,99,108,97,115,115,61,34,99,108,115,45,50,34,32,119,105,100,116,104,61,34,50,48,48,34,
32,104,101,105,103,104,116,61,34,50,48,48,34,47,62,10,60,47,112,97,116,116,101,114,110,62,10,60,47,100,101,102,115,62,10,60,116,105,116,108,
101,62,69,108,107,95,97,117,100,105,111,95,108,111,103,111,60,47,116,105,116,108,101,62,10,60,112,97,116,104,32,99,108,97,115,115,61,34,99,108,
115,45,51,34,32,116,114,97,110,115,102,111,114,109,61,34,116,114,97,110,115,108,97,116,101,40,45,49,55,53,46,56,50,32,45,49,49,56,46,52,
51,41,34,32,100,61,34,77,52,51,56,46,50,56,44,49,49,56,46,52,51,72,51,56,49,86,51,57,51,46,51,55,104,53,55,46,50,54,86,49,
49,56,46,52,51,90,34,47,62,10,60,112,97,116,104,32,99,108,97,115,115,61,34,99,108,115,45,51,34,32,116,114,97,110,115,102,111,114,109,61,
34,116,114,97,110,115,108,97,116,101,40,45,49,55,53,46,56,50,32,45,49,49,56,46,52,51,41,34,32,100,61,34,109,52,53,53,46,49,55,32,
51,57,51,46,51,55,104,53,55,46,50,54,118,45,54,53,46,53,49,108,49,53,46,52,54,45,49,55,46,53,57,32,53,54,46,51,49,32,56,51,
46,49,104,54,55,46,48,55,108,45,56,48,46,53,50,45,49,49,54,46,57,51,32,55,54,46,54,49,45,56,57,46,50,56,104,45,54,53,46,55,
50,108,45,54,54,46,49,51,32,55,56,46,50,55,104,45,51,46,48,57,118,45,49,52,55,104,45,53,55,46,50,53,118,50,55,52,46,57,52,122,
34,47,62,10,60,112,97,116,104,32,99,108,97,115,115,61,34,99,108,115,45,51,34,32,116,114,97,110,115,102,111,114,109,61,34,116,114,97,110,115,
108,97,116,101,40,45,49,55,53,46,56,50,32,45,49,49,56,46,52,51,41,34,32,100,61,34,77,49,55,56,46,54,52,44,51,57,51,46,51,55,
104,49,56,54,86,51,52,49,72,50,51,54,46,56,51,86,51,49,54,46,49,57,104,45,53,56,46,50,118,55,55,46,49,57,90,109,53,56,46,50,
45,49,48,57,46,49,55,118,50,51,46,49,54,104,45,53,56,46,50,86,50,48,49,46,53,49,104,53,56,46,50,118,50,53,46,57,53,72,51,54,
52,46,54,53,118,53,54,46,55,53,72,50,51,54,46,56,51,90,109,48,45,57,49,46,53,50,86,49,55,48,46,55,54,72,51,54,52,46,54,53,
86,49,49,56,46,52,51,104,45,49,56,54,118,55,52,46,50,54,104,53,56,46,50,90,34,47,62,10,60,112,97,116,104,32,99,108,97,115,115,61,
34,99,108,115,45,51,34,32,116,114,97,110,115,102,111,114,109,61,34,116,114,97,110,115,108,97,116,101,40,45,49,55,53,46,56,50,32,45,49,49,
56,46,52,51,41,34,32,100,61,34,109,49,57,52,46,50,52,32,53,49,48,46,54,57,32,54,45,49,56,46,53,52,104,50,57,46,51,52,108,54,
32,49,56,46,53,52,104,49,56,46,52,50,108,45,50,56,45,56,49,46,51,104,45,50,50,46,49,50,108,45,50,56,46,48,55,32,56,49,46,51,
104,49,56,46,52,50,122,109,49,48,46,52,45,51,50,32,49,48,45,51,48,46,55,55,104,48,46,54,52,108,49,48,32,51,48,46,55,55,104,45,
50,48,46,54,52,122,109,57,51,46,53,51,32,54,99,48,32,56,46,49,56,45,53,46,53,54,32,49,50,46,52,55,45,49,49,46,54,51,32,49,
50,46,52,55,45,54,46,51,57,32,48,45,49,48,46,53,50,45,52,46,52,57,45,49,48,46,53,54,45,49,49,46,54,55,118,45,51,53,46,55,
56,104,45,49,54,46,57,50,118,51,56,46,56,51,99,48,32,49,52,46,50,53,32,56,46,51,56,32,50,50,46,57,53,32,50,48,46,54,52,32,
50,50,46,57,53,32,57,46,49,55,32,48,32,49,53,46,55,54,45,52,46,55,50,32,49,56,46,53,45,49,49,46,56,55,104,48,46,54,51,118,
49,49,46,48,56,104,49,54,46,50,52,118,45,54,49,104,45,49,54,46,57,49,118,51,53,122,109,52,56,46,52,52,32,50,55,99,57,46,56,53,
32,48,32,49,53,45,53,46,54,56,32,49,55,46,51,49,45,49,48,46,55,54,104,48,46,55,49,118,57,46,55,55,104,49,54,46,54,55,118,45,
56,49,46,51,104,45,49,54,46,56,56,118,51,48,46,54,104,45,48,46,53,50,99,45,50,46,50,54,45,53,45,55,46,49,53,45,49,49,45,49,
55,46,51,53,45,49,49,45,49,51,46,51,56,32,48,45,50,52,46,54,57,32,49,48,46,52,45,50,52,46,54,57,32,51,49,46,51,54,32,48,
46,48,49,32,50,48,46,51,50,32,49,48,46,56,52,32,51,49,46,51,50,32,50,52,46,55,52,32,51,49,46,51,50,122,109,53,46,51,57,45,
49,51,46,52,55,99,45,56,46,51,32,48,45,49,50,46,56,50,45,55,46,51,56,45,49,50,46,56,50,45,49,56,115,52,46,52,53,45,49,55,
46,56,50,32,49,50,46,56,50,45,49,55,46,56,50,99,56,46,50,50,32,48,32,49,50,46,56,50,32,54,46,57,53,32,49,50,46,56,50,32,
49,55,46,56,50,115,45,52,46,55,50,32,49,56,45,49,50,46,56,50,32,49,56,122,109,51,56,46,55,55,32,49,50,46,52,55,104,49,54,46,
57,49,118,45,54,49,104,45,49,54,46,57,53,118,54,49,122,109,56,46,53,45,54,56,46,56,52,99,53,32,48,32,57,46,49,55,45,51,46,56,
53,32,57,46,49,55,45,56,46,53,56,115,45,52,46,49,51,45,56,46,53,51,45,57,46,49,55,45,56,46,53,51,45,57,46,49,51,32,51,46,
56,53,45,57,46,49,51,32,56,46,53,51,32,52,46,48,56,32,56,46,53,56,32,57,46,48,57,32,56,46,53,56,122,109,52,53,32,55,48,99,
49,56,46,53,32,48,32,51,48,45,49,50,46,54,54,32,51,48,45,51,49,46,52,52,115,45,49,49,46,53,49,45,51,49,46,53,50,45,51,48,
45,51,49,46,53,50,45,51,48,32,49,50,46,54,50,45,51,48,32,51,49,46,53,50,32,49,49,46,53,32,51,49,46,52,55,32,51,48,32,51,
49,46,52,55,122,109,48,46,48,56,45,49,51,46,49,99,45,56,46,53,52,32,48,45,49,50,46,57,45,55,46,56,50,45,49,50,46,57,45,49,
56,46,52,54,115,52,46,51,55,45,49,56,46,53,32,49,50,46,57,45,49,56,46,53,99,56,46,51,56,32,48,32,49,50,46,55,52,32,55,46,
56,54,32,49,50,46,55,52,32,49,56,46,53,115,45,52,46,51,55,32,49,56,46,52,57,45,49,50,46,55,52,32,49,56,46,52,57,122,109,49,
51,50,46,56,57,45,50,56,46,55,53,99,48,45,50,54,46,54,45,49,54,46,53,50,45,52,49,46,55,54,45,51,56,46,48,55,45,52,49,46,
55,54,115,45,51,56,46,48,55,32,49,53,46,50,45,51,56,46,48,55,32,52,49,46,55,54,32,49,54,46,52,32,52,49,46,55,54,32,51,56,
46,48,55,32,52,49,46,55,54,32,51,56,46,48,55,45,49,53,46,49,51,32,51,56,46,48,55,45,52,49,46,55,54,122,109,45,49,55,46,52,
51,32,48,99,48,32,49,55,46,50,51,45,56,46,49,56,32,50,54,46,53,54,45,50,48,46,54,52,32,50,54,46,53,54,115,45,50,48,46,54,
52,45,57,46,51,51,45,50,48,46,54,52,45,50,54,46,53,54,32,56,46,49,52,45,50,54,46,53,54,32,50,48,46,54,52,45,50,54,46,53,
54,32,50,48,46,54,52,32,57,46,51,54,32,50,48,46,54,52,32,50,54,46,53,54,122,109,54,57,46,56,45,49,55,46,50,55,104,49,54,46,
52,56,99,45,48,46,50,52,45,49,52,46,52,57,45,49,50,46,49,53,45,50,52,46,52,57,45,51,48,46,50,53,45,50,52,46,52,57,45,49,
55,46,56,50,32,48,45,51,48,46,56,57,32,57,46,56,53,45,51,48,46,56,49,32,50,52,46,54,49,32,48,32,49,50,32,56,46,52,50,32,
49,56,46,56,54,32,50,50,46,49,53,32,50,50,46,49,53,108,56,46,56,53,32,50,46,50,50,99,56,46,56,53,32,50,46,49,52,32,49,51,
46,55,56,32,52,46,54,56,32,49,51,46,56,50,32,49,48,46,49,54,32,48,32,54,45,53,46,54,56,32,49,48,45,49,52,46,52,49,32,49,
48,45,56,46,57,51,32,48,45,49,53,46,51,54,45,52,46,49,51,45,49,53,46,57,50,45,49,50,46,50,55,104,45,49,54,46,54,52,99,48,
46,52,52,32,49,55,46,53,57,32,49,51,32,50,54,46,54,56,32,51,50,46,55,53,32,50,54,46,54,56,115,51,49,46,53,50,45,57,46,52,
57,32,51,49,46,53,54,45,50,52,46,51,56,99,48,45,49,51,46,53,52,45,49,48,46,50,52,45,50,48,46,55,50,45,50,52,46,51,56,45,
50,51,46,57,108,45,55,46,51,45,49,46,55,53,99,45,55,46,48,55,45,49,46,54,51,45,49,51,45,52,46,50,53,45,49,50,46,56,54,45,
49,48,46,48,56,32,48,45,53,46,50,52,32,52,46,54,53,45,57,46,48,57,32,49,51,46,48,54,45,57,46,48,57,32,56,46,50,50,32,48,
46,48,53,32,49,51,46,50,57,32,51,46,55,56,32,49,51,46,57,32,49,48,46,49,56,122,34,47,62,10,60,47,115,118,103,62,10,0,0};
const char* ElkLogo::Elk_audio_logo_svg = (const char*) temp1;

10 changes: 10 additions & 0 deletions elk_juce_example/Source/ElkLogo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* (Auto-generated binary data file). */

#pragma once

namespace ElkLogo
{
extern const char* Elk_audio_logo_svg;
const int Elk_audio_logo_svgSize = 2597;

}
8 changes: 8 additions & 0 deletions elk_juce_example/Source/Main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "../JuceLibraryCode/JuceHeader.h"
#include "SynthProcessor.h"

//==============================================================================
AudioProcessor* JUCE_CALLTYPE createPluginFilter()
{
return new SynthProcessor();
}
127 changes: 127 additions & 0 deletions elk_juce_example/Source/MaterialLookAndFeel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#pragma once

#include "../JuceLibraryCode/JuceHeader.h"

//==============================================================================
class MaterialLookAndFeel : public LookAndFeel_V4
{
public:
//==============================================================================
MaterialLookAndFeel()
{
setColour (ResizableWindow::backgroundColourId, windowBackgroundColour);
setColour (TextButton::buttonOnColourId, brightButtonColour);
setColour (TextButton::buttonColourId, disabledButtonColour);
}

//==============================================================================
void drawButtonBackground (Graphics& g,
Button& button,
const Colour& /*backgroundColour*/,
bool /*isMouseOverButton*/,
bool isButtonDown) override
{
auto buttonRect = button.getLocalBounds().toFloat();

if (isButtonDown)
g.setColour (brightButtonColour.withAlpha (0.7f));
else if (! button.isEnabled())
g.setColour (disabledButtonColour);
else
g.setColour (brightButtonColour);

g.fillRoundedRectangle (buttonRect, 5.0f);
}

//==============================================================================
void drawButtonText (Graphics& g, TextButton& button, bool isMouseOverButton, bool isButtonDown) override
{
ignoreUnused (isMouseOverButton, isButtonDown);

Font font (getTextButtonFont (button, button.getHeight()));
g.setFont (font);

if (button.isEnabled())
g.setColour (Colours::white);
else
g.setColour (backgroundColour);

g.drawFittedText (button.getButtonText(), 0, 0,
button.getWidth(),
button.getHeight(),
Justification::centred, 2);
}

//==============================================================================
void drawLinearSlider (Graphics& g, int x, int y, int width, int height,
float sliderPos, float minSliderPos, float maxSliderPos,
const Slider::SliderStyle style, Slider& slider) override
{
ignoreUnused (style, minSliderPos, maxSliderPos);

auto r = Rectangle<int> (x + haloRadius, y, width - (haloRadius * 2), height);
auto backgroundBar = r.withSizeKeepingCentre(r.getWidth(), 2);

sliderPos = (sliderPos - minSliderPos) / static_cast<float> (width);

auto knobPos = static_cast<int> (sliderPos * r.getWidth());

g.setColour (slider.findColour (Slider::trackColourId));
g.fillRect (backgroundBar.removeFromLeft (knobPos));

g.setColour (sliderInactivePart);
g.fillRect (backgroundBar);

if (slider.isMouseOverOrDragging())
{
auto haloBounds = r.withTrimmedLeft (knobPos - haloRadius)
.withWidth (haloRadius * 2)
.withSizeKeepingCentre (haloRadius * 2, haloRadius * 2);

g.setColour (sliderActivePart.withAlpha (0.5f));
g.fillEllipse (haloBounds.toFloat());
}

auto knobRadius = slider.isMouseOverOrDragging() ? knobActiveRadius : knobInActiveRadius;
auto knobBounds = r.withTrimmedLeft (knobPos - knobRadius)
.withWidth (knobRadius * 2)
.withSizeKeepingCentre (knobRadius * 2, knobRadius * 2);

g.setColour (slider.findColour (Slider::thumbColourId));
g.fillEllipse (knobBounds.toFloat());
}

//==============================================================================
Font getTextButtonFont (TextButton& button, int buttonHeight) override
{
return LookAndFeel_V3::getTextButtonFont (button, buttonHeight).withHeight (buttonFontSize);
}

Font getLabelFont (Label& label) override
{
return LookAndFeel_V3::getLabelFont (label).withHeight (labelFontSize);
}

//==============================================================================
enum
{
labelFontSize = 15,
buttonFontSize = 15
};

//==============================================================================
enum
{
knobActiveRadius = 12,
knobInActiveRadius = 8,
haloRadius = 18
};

//==============================================================================
const Colour windowBackgroundColour = Colour (0xff262328);
const Colour backgroundColour = Colour (0xff4d4d4d);
const Colour brightButtonColour = Colour (0xff80cbc4);
const Colour disabledButtonColour = Colour (0xffe4e4e4);
const Colour sliderInactivePart = Colour (0xff545d62);
const Colour sliderActivePart = Colour (0xff80cbc4);
};
Loading

0 comments on commit 8898318

Please sign in to comment.