mirror of
https://github.com/yokemura/Magical8bitPlug2.git
synced 2025-05-24 23:00:21 -04:00
(1)Added MonoComponent file (2)Size Adjustment
This commit is contained in:
parent
2b0da1a0b4
commit
c77f380fda
@ -46,6 +46,10 @@
|
|||||||
file="Source/EnvelopeParamsComponent.cpp"/>
|
file="Source/EnvelopeParamsComponent.cpp"/>
|
||||||
<FILE id="zBFywa" name="EnvelopeParamsComponent.h" compile="0" resource="0"
|
<FILE id="zBFywa" name="EnvelopeParamsComponent.h" compile="0" resource="0"
|
||||||
file="Source/EnvelopeParamsComponent.h"/>
|
file="Source/EnvelopeParamsComponent.h"/>
|
||||||
|
<FILE id="SHaDYI" name="MonophonicComponent.cpp" compile="1" resource="0"
|
||||||
|
file="Source/MonophonicComponent.cpp"/>
|
||||||
|
<FILE id="cyIRRW" name="MonophonicComponent.h" compile="0" resource="0"
|
||||||
|
file="Source/MonophonicComponent.h"/>
|
||||||
<FILE id="RF89Wr" name="NoiseParamsComponent.cpp" compile="1" resource="0"
|
<FILE id="RF89Wr" name="NoiseParamsComponent.cpp" compile="1" resource="0"
|
||||||
file="Source/NoiseParamsComponent.cpp"/>
|
file="Source/NoiseParamsComponent.cpp"/>
|
||||||
<FILE id="jPVIvX" name="NoiseParamsComponent.h" compile="0" resource="0"
|
<FILE id="jPVIvX" name="NoiseParamsComponent.h" compile="0" resource="0"
|
||||||
|
@ -163,8 +163,9 @@ void BasicParamsComponent::buttonClicked (juce::Button* buttonThatWasClicked)
|
|||||||
|
|
||||||
if (buttonThatWasClicked == monoButton.get())
|
if (buttonThatWasClicked == monoButton.get())
|
||||||
{
|
{
|
||||||
polyNumberInput.get()->setValue(1);
|
|
||||||
//[UserButtonCode_monoButton] -- add your button handler code here..
|
//[UserButtonCode_monoButton] -- add your button handler code here..
|
||||||
|
polyNumberInput.get()->setValue(1);
|
||||||
|
return;
|
||||||
//[/UserButtonCode_monoButton]
|
//[/UserButtonCode_monoButton]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,8 +197,7 @@ void BasicParamsComponent::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
|
|||||||
BEGIN_JUCER_METADATA
|
BEGIN_JUCER_METADATA
|
||||||
|
|
||||||
<JUCER_COMPONENT documentType="Component" className="BasicParamsComponent" componentName=""
|
<JUCER_COMPONENT documentType="Component" className="BasicParamsComponent" componentName=""
|
||||||
parentClasses="public Component, public ComboBox::Listener, public Button::Listener"
|
parentClasses="public Component, public ComboBox::Listener" constructorParams="Magical8bitPlug2AudioProcessor& p, Magical8bitPlug2AudioProcessorEditor& e"
|
||||||
constructorParams="Magical8bitPlug2AudioProcessor& p, Magical8bitPlug2AudioProcessorEditor& e"
|
|
||||||
variableInitialisers="processor(p),editor(e)" snapPixels="8"
|
variableInitialisers="processor(p),editor(e)" snapPixels="8"
|
||||||
snapActive="1" snapShown="1" overlayOpacity="0.330" fixedSize="1"
|
snapActive="1" snapShown="1" overlayOpacity="0.330" fixedSize="1"
|
||||||
initialWidth="700" initialHeight="64">
|
initialWidth="700" initialHeight="64">
|
||||||
|
107
Source/MonophonicComponent.cpp
Normal file
107
Source/MonophonicComponent.cpp
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
/*
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
This is an automatically generated GUI class created by the Projucer!
|
||||||
|
|
||||||
|
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 Projucer version: 6.0.8
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
The Projucer is part of the JUCE library.
|
||||||
|
Copyright (c) 2020 - Raw Material Software Limited.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
//[Headers] You can add your own extra header files here...
|
||||||
|
//[/Headers]
|
||||||
|
|
||||||
|
#include "MonophonicComponent.h"
|
||||||
|
|
||||||
|
|
||||||
|
//[MiscUserDefs] You can add your own user definitions and misc code here...
|
||||||
|
//[/MiscUserDefs]
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
MonophonicComponent::MonophonicComponent ()
|
||||||
|
{
|
||||||
|
//[Constructor_pre] You can add your own custom stuff here..
|
||||||
|
//[/Constructor_pre]
|
||||||
|
|
||||||
|
|
||||||
|
//[UserPreSize]
|
||||||
|
//[/UserPreSize]
|
||||||
|
|
||||||
|
setSize (640, 400);
|
||||||
|
|
||||||
|
|
||||||
|
//[Constructor] You can add your own custom stuff here..
|
||||||
|
//[/Constructor]
|
||||||
|
}
|
||||||
|
|
||||||
|
MonophonicComponent::~MonophonicComponent()
|
||||||
|
{
|
||||||
|
//[Destructor_pre]. You can add your own custom destruction code here..
|
||||||
|
//[/Destructor_pre]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//[Destructor]. You can add your own custom destruction code here..
|
||||||
|
//[/Destructor]
|
||||||
|
}
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
void MonophonicComponent::paint (juce::Graphics& g)
|
||||||
|
{
|
||||||
|
//[UserPrePaint] Add your own custom painting code here..
|
||||||
|
//[/UserPrePaint]
|
||||||
|
|
||||||
|
g.fillAll (juce::Colour (0xff323e44));
|
||||||
|
|
||||||
|
//[UserPaint] Add your own custom painting code here..
|
||||||
|
//[/UserPaint]
|
||||||
|
}
|
||||||
|
|
||||||
|
void MonophonicComponent::resized()
|
||||||
|
{
|
||||||
|
//[UserPreResize] Add your own custom resize code here..
|
||||||
|
//[/UserPreResize]
|
||||||
|
|
||||||
|
//[UserResized] Add your own custom resize handling here..
|
||||||
|
//[/UserResized]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
|
||||||
|
//[/MiscUserCode]
|
||||||
|
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
#if 0
|
||||||
|
/* -- Projucer information section --
|
||||||
|
|
||||||
|
This is where the Projucer stores the metadata that describe this GUI layout, so
|
||||||
|
make changes in here at your peril!
|
||||||
|
|
||||||
|
BEGIN_JUCER_METADATA
|
||||||
|
|
||||||
|
<JUCER_COMPONENT documentType="Component" className="MonophonicComponent" componentName=""
|
||||||
|
parentClasses="public juce::Component" constructorParams="" variableInitialisers=""
|
||||||
|
snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330"
|
||||||
|
fixedSize="0" initialWidth="640" initialHeight="400">
|
||||||
|
<BACKGROUND backgroundColour="ff323e44"/>
|
||||||
|
</JUCER_COMPONENT>
|
||||||
|
|
||||||
|
END_JUCER_METADATA
|
||||||
|
*/
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
//[EndFile] You can add extra defines here...
|
||||||
|
//[/EndFile]
|
||||||
|
|
65
Source/MonophonicComponent.h
Normal file
65
Source/MonophonicComponent.h
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
This is an automatically generated GUI class created by the Projucer!
|
||||||
|
|
||||||
|
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 Projucer version: 6.0.8
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
The Projucer is part of the JUCE library.
|
||||||
|
Copyright (c) 2020 - Raw Material Software Limited.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
//[Headers] -- You can add your own extra header files here --
|
||||||
|
#include <JuceHeader.h>
|
||||||
|
//[/Headers]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
/**
|
||||||
|
//[Comments]
|
||||||
|
An auto-generated component, created by the Projucer.
|
||||||
|
|
||||||
|
Describe your class and how it works here!
|
||||||
|
//[/Comments]
|
||||||
|
*/
|
||||||
|
class MonophonicComponent : public juce::Component
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//==============================================================================
|
||||||
|
MonophonicComponent ();
|
||||||
|
~MonophonicComponent() override;
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
//[UserMethods] -- You can add your own custom methods in this section.
|
||||||
|
//[/UserMethods]
|
||||||
|
|
||||||
|
void paint (juce::Graphics& g) override;
|
||||||
|
void resized() override;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
//[UserVariables] -- You can add your own custom variables in this section.
|
||||||
|
//[/UserVariables]
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MonophonicComponent)
|
||||||
|
};
|
||||||
|
|
||||||
|
//[EndFile] You can add extra defines here...
|
||||||
|
//[/EndFile]
|
||||||
|
|
@ -169,8 +169,7 @@ struct
|
|||||||
}
|
}
|
||||||
if (isMono)
|
if (isMono)
|
||||||
{
|
{
|
||||||
retHeight += sectionSeparatorHeight
|
retHeight += monoCompoHeight;
|
||||||
+ monoCompoHeight;
|
|
||||||
}
|
}
|
||||||
return retHeight;
|
return retHeight;
|
||||||
}
|
}
|
||||||
@ -206,26 +205,36 @@ void Magical8bitPlug2AudioProcessorEditor::resized()
|
|||||||
int w = sizes.halfComponentWidth;
|
int w = sizes.halfComponentWidth;
|
||||||
basicCompo->setBounds (x, y, sizes.fullComponentWidth, sizes.basCompoHeight);
|
basicCompo->setBounds (x, y, sizes.fullComponentWidth, sizes.basCompoHeight);
|
||||||
|
|
||||||
|
y += sizes.basCompoHeight + sizes.sectionSeparatorHeight;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Monophonic
|
||||||
|
//
|
||||||
|
if (processor.settingRefs.isMonophonic()) {
|
||||||
|
y += sizes.monoCompoHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
int y1 = y;
|
||||||
|
int y2 = y;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Main part - Left
|
// Main part - Left
|
||||||
//
|
//
|
||||||
y = sizes.topMargin + sizes.basCompoHeight + sizes.sectionSeparatorHeight;
|
|
||||||
|
|
||||||
pulCompo->setBounds (x, y, w, sizes.toneSpecificControlHeight);
|
pulCompo->setBounds (x, y1, w, sizes.toneSpecificControlHeight);
|
||||||
noiCompo->setBounds (x, y, w, sizes.toneSpecificControlHeight);
|
noiCompo->setBounds (x, y1, w, sizes.toneSpecificControlHeight);
|
||||||
y += sizes.toneSpecificControlHeight;
|
y1 += sizes.toneSpecificControlHeight;
|
||||||
|
|
||||||
envCompo->setBounds (x, y, w, sizes.envCompoHeight);
|
envCompo->setBounds (x, y1, w, sizes.envCompoHeight);
|
||||||
y += sizes.envCompoHeight;
|
y1 += sizes.envCompoHeight;
|
||||||
|
|
||||||
bendCompo->setBounds (x, y, w, sizes.bendCompoHeight);
|
bendCompo->setBounds (x, y1, w, sizes.bendCompoHeight);
|
||||||
y += sizes.bendCompoHeight;
|
y1 += sizes.bendCompoHeight;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Main part - Right
|
// Main part - Right
|
||||||
//
|
//
|
||||||
x = sizes.leftMargin + sizes.halfComponentWidth + sizes.verticalSeparatorWidth;
|
x = sizes.leftMargin + sizes.halfComponentWidth + sizes.verticalSeparatorWidth;
|
||||||
int y2 = sizes.topMargin + sizes.basCompoHeight + sizes.sectionSeparatorHeight;
|
|
||||||
|
|
||||||
sweepCompo->setBounds (x, y2, w, sizes.sweepCompoHeight);
|
sweepCompo->setBounds (x, y2, w, sizes.sweepCompoHeight);
|
||||||
y2 += sizes.sweepCompoHeight;
|
y2 += sizes.sweepCompoHeight;
|
||||||
@ -237,7 +246,7 @@ void Magical8bitPlug2AudioProcessorEditor::resized()
|
|||||||
// Advanced part
|
// Advanced part
|
||||||
//
|
//
|
||||||
x = sizes.leftMargin;
|
x = sizes.leftMargin;
|
||||||
int y3 = y > y2 ? y : y2;
|
int y3 = y1 > y2 ? y1 : y2;
|
||||||
y3 += sizes.sectionSeparatorHeight;
|
y3 += sizes.sectionSeparatorHeight;
|
||||||
advCompo->setBounds (x, y3, sizes.fullComponentWidth, sizes.advCompoHeight);
|
advCompo->setBounds (x, y3, sizes.fullComponentWidth, sizes.advCompoHeight);
|
||||||
|
|
||||||
@ -276,8 +285,7 @@ void Magical8bitPlug2AudioProcessorEditor::resizeWholePanel()
|
|||||||
if (!isComponentsReady) {
|
if (!isComponentsReady) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bool isMono = (int)(*processor.settingRefs.maxPoly) == 1;
|
setSize (sizes.totalWidth, sizes.totalHeight (processor.settingRefs.isAdvancedPanelOpen(), processor.settingRefs.isMonophonic()));
|
||||||
setSize (sizes.totalWidth, sizes.totalHeight (processor.settingRefs.isAdvancedPanelOpen(), isMono));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Magical8bitPlug2AudioProcessorEditor::parameterValueChanged (int parameterIndex, float newValue)
|
void Magical8bitPlug2AudioProcessorEditor::parameterValueChanged (int parameterIndex, float newValue)
|
||||||
|
@ -139,6 +139,7 @@ struct SettingRefs
|
|||||||
// accessors
|
// accessors
|
||||||
//
|
//
|
||||||
int oscillatorType() { return (int) (*osc); }
|
int oscillatorType() { return (int) (*osc); }
|
||||||
|
bool isMonophonic() { return (int)(*maxPoly) == 1; }
|
||||||
bool isAdvancedPanelOpen() { return *isAdvancedPanelOpen_raw > 0.5; }
|
bool isAdvancedPanelOpen() { return *isAdvancedPanelOpen_raw > 0.5; }
|
||||||
ColorSchemeType colorSchemeType() { return (ColorSchemeType) ((int) (*colorScheme)); }
|
ColorSchemeType colorSchemeType() { return (ColorSchemeType) ((int) (*colorScheme)); }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user