2020/11/2 제목: 슬라이더 제작 슬라이더에 따라 악기소리, MIDI 소리를 바뀔 수 있는 틀을 만들어 놓았다.
아직도 vsc는 이것들을 모두 에러로 다 판별한다....테스트도 못해보겠다.....
다음은 수정한 PlugInEditor.cpp의 코드이다.
/*
==============================================================================
This file contains the basic framework code for a JUCE plugin editor.
==============================================================================
*/
#include "PluginProcessor.h"
#include "PluginEditor.h"
//==============================================================================
KiRiPlugInAudioProcessorEditor::KiRiPlugInAudioProcessorEditor (KiRiPlugInAudioProcessor& p)
: AudioProcessorEditor (&p), audioProcessor (p)
{
mGainSlider.setSliderStyle (Slider::SliderStyle::LinearVertical);
mGainSlider.setTextBoxStyle(Slider::TextBoxBelow, true, 50, 20);
mGainSlider.setRange(0.0f, 1.0f, 0.01f);
mGainSlider.setValue(0.5f);
addAndMakeVisible(mGainSlider);
setSize (200, 300);
}
KiRiPlugInAudioProcessorEditor::~KiRiPlugInAudioProcessorEditor()
{
}
//==============================================================================
void KiRiPlugInAudioProcessorEditor::paint (juce::Graphics& g)
{
g.fillAll(Colours::black);
}
void KiRiPlugInAudioProcessorEditor::resized()
{
mGainSlider.setBounds(getWidth() / 2 -50 , getHeight() /2 - 75, 100, 150);
}
다음은 수정한 PlugInEditor.h의 코드이다.
/*
==============================================================================
This file contains the basic framework code for a JUCE plugin editor.
==============================================================================
*/
#pragma once
#include <JuceHeader.h>
#include "PluginProcessor.h"
//==============================================================================
/**
*/
class KiRiPlugInAudioProcessorEditor : public juce::AudioProcessorEditor{
public:
KiRiPlugInAudioProcessorEditor (KiRiPlugInAudioProcessor&);
~KiRiPlugInAudioProcessorEditor() override;
//==============================================================================
void paint (Graphics&) override;
void resized() override;
private:
slider mGainSlider;
KiRiPlugInAudioProcessor& audioProcessor;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (KiRiPlugInAudioProcessorEditor)
};