Tutorial “Make your Plugin Part2” problem

Hi there have bee trying to compile the tutorial#2 created plugin but all i see nothing change. any one can tell me where i’m wrong?

/*

================================================================

This file was auto-generated!

It contains the basic framework code for a JUCE plugin editor.

==============================================================================
*/

#include "PluginProcessor.h"
#include "PluginEditor.h"

//==============================================================================

TutorialPluginAudioProcessorEditor::TutorialPluginAudioProcessorEditor (TutorialPluginAudioProcessor& p)
: AudioProcessorEditor (&p), processor (p)
 {
// Make sure that before the constructor has finished, you've set the
// editor's size to whatever you need it to be.

    setSize (200, 200);

 // these define the parameters of our slider object
midiVolume.setSliderStyle (Slider::LinearBarVertical);
midiVolume.setRange(0.0, 127.0, 1.0);
midiVolume.setTextBoxStyle (Slider::NoTextBox, false, 90, 0);
midiVolume.setPopUpDisplay (true.this);
midiVolume.setTextValueSuffix (" Volume");
midiVolume.setValue(1.0);

// this function adds the slider to the editor
addAndMakeVisible (&midiVolume);
}

TutorialPluginAudioProcessorEditor::~TutorialPluginAudioProcessorEditor()
{
}

//==============================================================================

  void TutorialPluginAudioProcessorEditor::paint (Graphics& g)
{
// fill the whole window white
g.fillAll (Colours::blue);

// set the current drawing colour to black
g.setColour (Colours::black);

// set the font size and draw text to the screen
g.setFont (15.0f);

g.drawFittedText ("Midi Volume", 0, 0, getWidth(), 30, Justification::centred, 1);
}

void TutorialPluginAudioProcessorEditor::resized()
{
 // sets the position and size of the slider with arguments (x, y, width, height)
midiVolume.setBounds (40, 30, 20, getHeight() - 60);

}

header File
/*

This file was auto-generated!

It contains the basic framework code for a JUCE plugin editor.

==============================================================================
*/

#pragma once

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

//==============================================================================

/**
*/

class TutorialPluginAudioProcessorEditor  : public AudioProcessorEditor
{
public:
TutorialPluginAudioProcessorEditor (TutorialPluginAudioProcessor&);
~TutorialPluginAudioProcessorEditor();

//==============================================================================
void paint (Graphics&) override;
void resized() override;

private:
// This reference is provided as a quick way for your editor to
// access the processor object that created it.
TutorialPluginAudioProcessor& processor;

Slider midiVolume;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TutorialPluginAudioProcessorEditor)
};

i just copy and paste everything, from “Create a simple GUI control”, but nothing happen and i decide to ask before “Pass control information to the processor class” step

If pasting code you need to indent it by 4 spaces to get the forum to display it correctly.

Is the AudioProcessor class missing an implementation for the createEditor method? Or what do you mean by seeing nothing changed?

or for such a long code, use three single-backquotes ` at the start and another three at the end… saves the four spaces on each line.

I’m not sure what your issue is but I’ve just noticed that the midiVolume.setPopupDisplayEnabled (true, this); line is missing an argument - it should be midiVolume.setPopupDisplayEnabled (true, false, this);

I’ve updated this in the tutorial and it should be public the next time we update the website.

image

i got this when i run that code
i change this color into blue

g.fillAll (Colours::blue);

but nothing happen, the result should like this

image

i change the text but the result nothing

g.drawFittedText ("Midi Volume", 0, 0, getWidth(), 30, Justification::centred, 1);

i am sorry, my bad :frowning:
this my first time to post code, but thankyou

https://forum.juce.com/uploads/short-url/jw7pjm7XPCZ3brh3lNawyMbcuNP.png

this what i get when i run the code, in website the result should like

thank you Daniel, next time i will

No worries, just wanted to save you to type four spaces in 100 rows… :wink:

I assume you have a second copy of the tutorial editor in the project, that is instanciated in the processor’s “createEditor()” function (like @Xenakios suggested).
You could a) post your processor’s createEditor() code and b) as I said check for a second TutorialPluginAudioProcessorEditor class…

finally i found the problem
My IDE does not want to update the changes I am doing in Projucer, so I have to change it manually in my IDE, am I missing something in setting?

Windows and Visual Studio

woohhhoooo :laughing:

finally i found the problem
My IDE does not want to update the changes I am doing in Projucer, so I have to change it manually in my IDE, am I missing something in setting?

Windows and Visual Studio

There are two different save modes. If you are in the editor and click cmd-save, it only saves the file. If you are in a config tab and click cmd-save, it only saves the project files.

I usually use the “save and open in IDE” button to be safe, as I believe it saves both / everything…

If you’re editing code in the Projucer then the IDE won’t pick up the changes until you save the file. You can do this by pressing cmd/ctrl + s or selecting File->Save when the Projucer’s code editor has focus. To avoid confusion, it’s best to edit and run your code in one environment - either the Projucer or your IDE.