Skip to content

Commit

Permalink
title panel a la empy
Browse files Browse the repository at this point in the history
  • Loading branch information
ArdenButterfield committed Jul 18, 2023
1 parent d4a1e6c commit 43be73a
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ set(SourceFiles
Source/PluginProcessor.h
Source/BladeController.cpp
Source/MP3Controller.h
Source/GUIelements/TitlePanel.h
Source/GUIelements/TitlePanel.cpp
Source/GUIelements/MaimLookAndFeel.h
Source/GUIelements/MaimLookAndFeel.cpp
)
Expand Down
5 changes: 5 additions & 0 deletions Source/GUIelements/MainArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ MainArea::MainArea(juce::AudioProcessorValueTreeState& p) :
quantizeSection(p),
decodeSection(p),
postSection(p),
titlePanel (p),
parameters(p)

{
addAndMakeVisible(psychoacousticSection);
addAndMakeVisible(mdctSection);
addAndMakeVisible(quantizeSection);
addAndMakeVisible(decodeSection);
addAndMakeVisible(postSection);
addAndMakeVisible(titlePanel);
}

MainArea::~MainArea()
Expand Down Expand Up @@ -85,4 +88,6 @@ void MainArea::resized()
quantizeSection.setBounds(quantizeBounds);
decodeSection.setBounds(decodeBounds);
postSection.setBounds(postSectionBounds);

titlePanel.setBounds(0,0,200,100);
}
3 changes: 2 additions & 1 deletion Source/GUIelements/MainArea.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "QuantizeSection.h"
#include "DecodeSection.h"
#include "PostSection.h"

#include "TitlePanel.h"
//==============================================================================
/*
*/
Expand All @@ -38,6 +38,7 @@ class MainArea : public juce::Component
QuantizeSection quantizeSection;
DecodeSection decodeSection;
PostSection postSection;
TitlePanel titlePanel;

juce::AudioProcessorValueTreeState& parameters;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainArea)
Expand Down
1 change: 1 addition & 0 deletions Source/GUIelements/StageWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class StageWindow : public juce::Component
{
public:
StageWindow(juce::AudioProcessorValueTreeState& p) : parameters(p) {}
// virtual ~StageWindow();


const juce::Font main_font = juce::Font(MaimLookAndFeel().main_font);
Expand Down
33 changes: 33 additions & 0 deletions Source/GUIelements/TitlePanel.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// Created by arden on 7/18/23.
//

#include "TitlePanel.h"

TitlePanel::TitlePanel (juce::AudioProcessorValueTreeState& p) : StageWindow(p) {}

TitlePanel::~TitlePanel()
{
}


void TitlePanel::paint (juce::Graphics& g)
{
auto inner_rect = draw_beveled_rectangle(g, getLocalBounds(), true);
auto gradient = juce::ColourGradient::horizontal(juce::Colours::darkblue,
juce::Colours::lightblue,
inner_rect);
g.setGradientFill(gradient);
g.fillRect(inner_rect);


g.setColour (juce::Colours::white);
g.setFont(title_font);
g.drawText ("Maim", inner_rect,
juce::Justification::centredLeft, true);
}

void TitlePanel::resized()
{

}
22 changes: 22 additions & 0 deletions Source/GUIelements/TitlePanel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// Created by arden on 7/18/23.
//

#ifndef MAIM_TITLEPANEL_H
#define MAIM_TITLEPANEL_H

#include "StageWindow.h"

class TitlePanel : public StageWindow
{
public:
TitlePanel (juce::AudioProcessorValueTreeState& p);
~TitlePanel();
void paint (juce::Graphics& g) override;
void resized() override;

private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TitlePanel)
};

#endif //MAIM_TITLEPANEL_H

0 comments on commit 43be73a

Please sign in to comment.