git subrepo clone --branch=sono6good https://github.com/essej/JUCE.git deps/juce

subrepo:
  subdir:   "deps/juce"
  merged:   "b13f9084e"
upstream:
  origin:   "https://github.com/essej/JUCE.git"
  branch:   "sono6good"
  commit:   "b13f9084e"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"
This commit is contained in:
essej
2022-04-18 17:51:22 -04:00
parent 63e175fee6
commit 25bd5d8adb
3210 changed files with 1045392 additions and 0 deletions

View File

@ -0,0 +1,56 @@
#pragma once
%%include_juce%%
//==============================================================================
/*
This component lives inside our window, and this is where you should put all
your controls and content.
*/
class %%content_component_class%% : public juce::AnimatedAppComponent
{
public:
//==============================================================================
%%content_component_class%%()
{
// Make sure you set the size of the component after
// you add any child components.
setSize (800, 600);
setFramesPerSecond (60); // This sets the frequency of the update calls.
}
~%%content_component_class%%() override
{
}
//==============================================================================
void update() override
{
// This function is called at the frequency specified by the setFramesPerSecond() call
// in the constructor. You can use it to update counters, animate values, etc.
}
//==============================================================================
void paint (juce::Graphics& g) override
{
// (Our component is opaque, so we must completely fill the background with a solid colour)
g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId));
// You can add your drawing code here!
}
void resized() override
{
// This is called when the MainContentComponent is resized.
// If you add any child components, this is where you should
// update their positions.
}
private:
//==============================================================================
// Your private member variables go here...
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%content_component_class%%)
};

View File

@ -0,0 +1,37 @@
%%include_corresponding_header%%
//==============================================================================
%%content_component_class%%::%%content_component_class%%()
{
// Make sure you set the size of the component after
// you add any child components.
setSize (800, 600);
setFramesPerSecond (60); // This sets the frequency of the update calls.
}
%%content_component_class%%::~%%content_component_class%%()
{
}
//==============================================================================
void %%content_component_class%%::update()
{
// This function is called at the frequency specified by the setFramesPerSecond() call
// in the constructor. You can use it to update counters, animate values, etc.
}
//==============================================================================
void %%content_component_class%%::paint (juce::Graphics& g)
{
// (Our component is opaque, so we must completely fill the background with a solid colour)
g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId));
// You can add your drawing code here!
}
void %%content_component_class%%::resized()
{
// This is called when the MainContentComponent is resized.
// If you add any child components, this is where you should
// update their positions.
}

View File

@ -0,0 +1,30 @@
#pragma once
%%include_juce%%
//==============================================================================
/*
This component lives inside our window, and this is where you should put all
your controls and content.
*/
class %%content_component_class%% : public juce::AnimatedAppComponent
{
public:
//==============================================================================
%%content_component_class%%();
~%%content_component_class%%() override;
//==============================================================================
void update() override;
//==============================================================================
void paint (juce::Graphics& g) override;
void resized() override;
private:
//==============================================================================
// Your private member variables go here...
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%content_component_class%%)
};

View File

@ -0,0 +1,94 @@
#pragma once
%%include_juce%%
//==============================================================================
/*
This component lives inside our window, and this is where you should put all
your controls and content.
*/
class %%content_component_class%% : public juce::AudioAppComponent
{
public:
//==============================================================================
%%content_component_class%%()
{
// Make sure you set the size of the component after
// you add any child components.
setSize (800, 600);
// Some platforms require permissions to open input channels so request that here
if (juce::RuntimePermissions::isRequired (juce::RuntimePermissions::recordAudio)
&& ! juce::RuntimePermissions::isGranted (juce::RuntimePermissions::recordAudio))
{
juce::RuntimePermissions::request (juce::RuntimePermissions::recordAudio,
[&] (bool granted) { setAudioChannels (granted ? 2 : 0, 2); });
}
else
{
// Specify the number of input and output channels that we want to open
setAudioChannels (2, 2);
}
}
~%%content_component_class%%() override
{
// This shuts down the audio device and clears the audio source.
shutdownAudio();
}
//==============================================================================
void prepareToPlay (int samplesPerBlockExpected, double sampleRate) override
{
// This function will be called when the audio device is started, or when
// its settings (i.e. sample rate, block size, etc) are changed.
// You can use this function to initialise any resources you might need,
// but be careful - it will be called on the audio thread, not the GUI thread.
// For more details, see the help for AudioProcessor::prepareToPlay()
}
void getNextAudioBlock (const juce::AudioSourceChannelInfo& bufferToFill) override
{
// Your audio-processing code goes here!
// For more details, see the help for AudioProcessor::getNextAudioBlock()
// Right now we are not producing any data, in which case we need to clear the buffer
// (to prevent the output of random noise)
bufferToFill.clearActiveBufferRegion();
}
void releaseResources() override
{
// This will be called when the audio device stops, or when it is being
// restarted due to a setting change.
// For more details, see the help for AudioProcessor::releaseResources()
}
//==============================================================================
void paint (juce::Graphics& g) override
{
// (Our component is opaque, so we must completely fill the background with a solid colour)
g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId));
// You can add your drawing code here!
}
void resized() override
{
// This is called when the MainContentComponent is resized.
// If you add any child components, this is where you should
// update their positions.
}
private:
//==============================================================================
// Your private member variables go here...
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%content_component_class%%)
};

View File

@ -0,0 +1,75 @@
%%include_corresponding_header%%
//==============================================================================
%%content_component_class%%::%%content_component_class%%()
{
// Make sure you set the size of the component after
// you add any child components.
setSize (800, 600);
// Some platforms require permissions to open input channels so request that here
if (juce::RuntimePermissions::isRequired (juce::RuntimePermissions::recordAudio)
&& ! juce::RuntimePermissions::isGranted (juce::RuntimePermissions::recordAudio))
{
juce::RuntimePermissions::request (juce::RuntimePermissions::recordAudio,
[&] (bool granted) { setAudioChannels (granted ? 2 : 0, 2); });
}
else
{
// Specify the number of input and output channels that we want to open
setAudioChannels (2, 2);
}
}
%%content_component_class%%::~%%content_component_class%%()
{
// This shuts down the audio device and clears the audio source.
shutdownAudio();
}
//==============================================================================
void %%content_component_class%%::prepareToPlay (int samplesPerBlockExpected, double sampleRate)
{
// This function will be called when the audio device is started, or when
// its settings (i.e. sample rate, block size, etc) are changed.
// You can use this function to initialise any resources you might need,
// but be careful - it will be called on the audio thread, not the GUI thread.
// For more details, see the help for AudioProcessor::prepareToPlay()
}
void %%content_component_class%%::getNextAudioBlock (const juce::AudioSourceChannelInfo& bufferToFill)
{
// Your audio-processing code goes here!
// For more details, see the help for AudioProcessor::getNextAudioBlock()
// Right now we are not producing any data, in which case we need to clear the buffer
// (to prevent the output of random noise)
bufferToFill.clearActiveBufferRegion();
}
void %%content_component_class%%::releaseResources()
{
// This will be called when the audio device stops, or when it is being
// restarted due to a setting change.
// For more details, see the help for AudioProcessor::releaseResources()
}
//==============================================================================
void %%content_component_class%%::paint (juce::Graphics& g)
{
// (Our component is opaque, so we must completely fill the background with a solid colour)
g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId));
// You can add your drawing code here!
}
void %%content_component_class%%::resized()
{
// This is called when the MainContentComponent is resized.
// If you add any child components, this is where you should
// update their positions.
}

View File

@ -0,0 +1,32 @@
#pragma once
%%include_juce%%
//==============================================================================
/*
This component lives inside our window, and this is where you should put all
your controls and content.
*/
class %%content_component_class%% : public juce::AudioAppComponent
{
public:
//==============================================================================
%%content_component_class%%();
~%%content_component_class%%() override;
//==============================================================================
void prepareToPlay (int samplesPerBlockExpected, double sampleRate) override;
void getNextAudioBlock (const juce::AudioSourceChannelInfo& bufferToFill) override;
void releaseResources() override;
//==============================================================================
void paint (juce::Graphics& g) override;
void resized() override;
private:
//==============================================================================
// Your private member variables go here...
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%content_component_class%%)
};

View File

@ -0,0 +1,39 @@
/*
==============================================================================
This file contains the basic framework code for a JUCE plugin editor.
==============================================================================
*/
%%editor_cpp_headers%%
//==============================================================================
%%editor_class_name%%::%%editor_class_name%% (%%filter_class_name%%& p)
: AudioProcessorEditor (&p), audioProcessor (p)
{
// Make sure that before the constructor has finished, you've set the
// editor's size to whatever you need it to be.
setSize (400, 300);
}
%%editor_class_name%%::~%%editor_class_name%%()
{
}
//==============================================================================
void %%editor_class_name%%::paint (juce::Graphics& g)
{
// (Our component is opaque, so we must completely fill the background with a solid colour)
g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId));
g.setColour (juce::Colours::white);
g.setFont (15.0f);
g.drawFittedText ("Hello World!", getLocalBounds(), juce::Justification::centred, 1);
}
void %%editor_class_name%%::resized()
{
// This is generally where you'll want to lay out the positions of any
// subcomponents in your editor..
}

View File

@ -0,0 +1,32 @@
/*
==============================================================================
This file contains the basic framework code for a JUCE plugin editor.
==============================================================================
*/
#pragma once
%%editor_headers%%
//==============================================================================
/**
*/
class %%editor_class_name%% : public juce::AudioProcessorEditor
{
public:
%%editor_class_name%% (%%filter_class_name%%&);
~%%editor_class_name%%() override;
//==============================================================================
void paint (juce::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.
%%filter_class_name%%& audioProcessor;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%editor_class_name%%)
};

View File

@ -0,0 +1,190 @@
/*
==============================================================================
This file contains the basic framework code for a JUCE plugin processor.
==============================================================================
*/
%%filter_headers%%
//==============================================================================
%%filter_class_name%%::%%filter_class_name%%()
#ifndef JucePlugin_PreferredChannelConfigurations
: AudioProcessor (BusesProperties()
#if ! JucePlugin_IsMidiEffect
#if ! JucePlugin_IsSynth
.withInput ("Input", juce::AudioChannelSet::stereo(), true)
#endif
.withOutput ("Output", juce::AudioChannelSet::stereo(), true)
#endif
)
#endif
{
}
%%filter_class_name%%::~%%filter_class_name%%()
{
}
//==============================================================================
const juce::String %%filter_class_name%%::getName() const
{
return JucePlugin_Name;
}
bool %%filter_class_name%%::acceptsMidi() const
{
#if JucePlugin_WantsMidiInput
return true;
#else
return false;
#endif
}
bool %%filter_class_name%%::producesMidi() const
{
#if JucePlugin_ProducesMidiOutput
return true;
#else
return false;
#endif
}
bool %%filter_class_name%%::isMidiEffect() const
{
#if JucePlugin_IsMidiEffect
return true;
#else
return false;
#endif
}
double %%filter_class_name%%::getTailLengthSeconds() const
{
return 0.0;
}
int %%filter_class_name%%::getNumPrograms()
{
return 1; // NB: some hosts don't cope very well if you tell them there are 0 programs,
// so this should be at least 1, even if you're not really implementing programs.
}
int %%filter_class_name%%::getCurrentProgram()
{
return 0;
}
void %%filter_class_name%%::setCurrentProgram (int index)
{
}
const juce::String %%filter_class_name%%::getProgramName (int index)
{
return {};
}
void %%filter_class_name%%::changeProgramName (int index, const juce::String& newName)
{
}
//==============================================================================
void %%filter_class_name%%::prepareToPlay (double sampleRate, int samplesPerBlock)
{
// Use this method as the place to do any pre-playback
// initialisation that you need..
}
void %%filter_class_name%%::releaseResources()
{
// When playback stops, you can use this as an opportunity to free up any
// spare memory, etc.
}
#ifndef JucePlugin_PreferredChannelConfigurations
bool %%filter_class_name%%::isBusesLayoutSupported (const BusesLayout& layouts) const
{
#if JucePlugin_IsMidiEffect
juce::ignoreUnused (layouts);
return true;
#else
// This is the place where you check if the layout is supported.
// In this template code we only support mono or stereo.
// Some plugin hosts, such as certain GarageBand versions, will only
// load plugins that support stereo bus layouts.
if (layouts.getMainOutputChannelSet() != juce::AudioChannelSet::mono()
&& layouts.getMainOutputChannelSet() != juce::AudioChannelSet::stereo())
return false;
// This checks if the input layout matches the output layout
#if ! JucePlugin_IsSynth
if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet())
return false;
#endif
return true;
#endif
}
#endif
void %%filter_class_name%%::processBlock (juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midiMessages)
{
juce::ScopedNoDenormals noDenormals;
auto totalNumInputChannels = getTotalNumInputChannels();
auto totalNumOutputChannels = getTotalNumOutputChannels();
// In case we have more outputs than inputs, this code clears any output
// channels that didn't contain input data, (because these aren't
// guaranteed to be empty - they may contain garbage).
// This is here to avoid people getting screaming feedback
// when they first compile a plugin, but obviously you don't need to keep
// this code if your algorithm always overwrites all the output channels.
for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
buffer.clear (i, 0, buffer.getNumSamples());
// This is the place where you'd normally do the guts of your plugin's
// audio processing...
// Make sure to reset the state if your inner loop is processing
// the samples and the outer loop is handling the channels.
// Alternatively, you can process the samples with the channels
// interleaved by keeping the same state.
for (int channel = 0; channel < totalNumInputChannels; ++channel)
{
auto* channelData = buffer.getWritePointer (channel);
// ..do something to the data...
}
}
//==============================================================================
bool %%filter_class_name%%::hasEditor() const
{
return true; // (change this to false if you choose to not supply an editor)
}
juce::AudioProcessorEditor* %%filter_class_name%%::createEditor()
{
return new %%editor_class_name%% (*this);
}
//==============================================================================
void %%filter_class_name%%::getStateInformation (juce::MemoryBlock& destData)
{
// You should use this method to store your parameters in the memory block.
// You could do that either as raw data, or use the XML or ValueTree classes
// as intermediaries to make it easy to save and load complex data.
}
void %%filter_class_name%%::setStateInformation (const void* data, int sizeInBytes)
{
// You should use this method to restore your parameters from this memory block,
// whose contents will have been created by the getStateInformation() call.
}
//==============================================================================
// This creates new instances of the plugin..
juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter()
{
return new %%filter_class_name%%();
}

View File

@ -0,0 +1,59 @@
/*
==============================================================================
This file contains the basic framework code for a JUCE plugin processor.
==============================================================================
*/
#pragma once
%%app_headers%%
//==============================================================================
/**
*/
class %%filter_class_name%% : public juce::AudioProcessor
{
public:
//==============================================================================
%%filter_class_name%%();
~%%filter_class_name%%() override;
//==============================================================================
void prepareToPlay (double sampleRate, int samplesPerBlock) override;
void releaseResources() override;
#ifndef JucePlugin_PreferredChannelConfigurations
bool isBusesLayoutSupported (const BusesLayout& layouts) const override;
#endif
void processBlock (juce::AudioBuffer<float>&, juce::MidiBuffer&) override;
//==============================================================================
juce::AudioProcessorEditor* createEditor() override;
bool hasEditor() const override;
//==============================================================================
const juce::String getName() const override;
bool acceptsMidi() const override;
bool producesMidi() const override;
bool isMidiEffect() const override;
double getTailLengthSeconds() const override;
//==============================================================================
int getNumPrograms() override;
int getCurrentProgram() override;
void setCurrentProgram (int index) override;
const juce::String getProgramName (int index) override;
void changeProgramName (int index, const juce::String& newName) override;
//==============================================================================
void getStateInformation (juce::MemoryBlock& destData) override;
void setStateInformation (const void* data, int sizeInBytes) override;
private:
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%filter_class_name%%)
};

View File

@ -0,0 +1,74 @@
/*
==============================================================================
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: %%version%%
------------------------------------------------------------------------------
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_files_cpp%%
//[MiscUserDefs] You can add your own user definitions and misc code here...
//[/MiscUserDefs]
//==============================================================================
%%class_name%%::%%class_name%% (%%constructor_params%%)
%%initialisers%%{
//[Constructor_pre] You can add your own custom stuff here..
//[/Constructor_pre]
%%constructor%%
//[Constructor] You can add your own custom stuff here..
//[/Constructor]
}
%%class_name%%::~%%class_name%%()
{
//[Destructor_pre]. You can add your own custom destruction code here..
//[/Destructor_pre]
%%destructor%%
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}
//==============================================================================
%%method_definitions%%
//[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
%%metadata%%
END_JUCER_METADATA
*/
#endif
%%static_member_definitions%%
//[EndFile] You can add extra defines here...
//[/EndFile]

View File

@ -0,0 +1,61 @@
/*
==============================================================================
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: %%version%%
------------------------------------------------------------------------------
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_juce%%
//[/Headers]
%%include_files_h%%
//==============================================================================
/**
//[Comments]
An auto-generated component, created by the Projucer.
Describe your class and how it works here!
//[/Comments]
*/
%%class_declaration%%
{
public:
//==============================================================================
%%class_name%% (%%constructor_params%%);
~%%class_name%%() override;
//==============================================================================
//[UserMethods] -- You can add your own custom methods in this section.
//[/UserMethods]
%%public_member_declarations%%
private:
//[UserVariables] -- You can add your own custom variables in this section.
//[/UserVariables]
//==============================================================================
%%private_member_declarations%%
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%class_name%%)
};
//[EndFile] You can add extra defines here...
//[/EndFile]

View File

@ -0,0 +1,48 @@
#pragma once
%%include_juce%%
//==============================================================================
/*
This component lives inside our window, and this is where you should put all
your controls and content.
*/
class %%content_component_class%% : public juce::Component
{
public:
//==============================================================================
%%content_component_class%%()
{
setSize (600, 400);
}
~%%content_component_class%%() override
{
}
//==============================================================================
void paint (juce::Graphics& g) override
{
// (Our component is opaque, so we must completely fill the background with a solid colour)
g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId));
g.setFont (juce::Font (16.0f));
g.setColour (juce::Colours::white);
g.drawText ("Hello World!", getLocalBounds(), juce::Justification::centred, true);
}
void resized() override
{
// This is called when the %%content_component_class%% is resized.
// If you add any child components, this is where you should
// update their positions.
}
private:
//==============================================================================
// Your private member variables go here...
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%content_component_class%%)
};

View File

@ -0,0 +1,29 @@
%%include_corresponding_header%%
//==============================================================================
%%content_component_class%%::%%content_component_class%%()
{
setSize (600, 400);
}
%%content_component_class%%::~%%content_component_class%%()
{
}
//==============================================================================
void %%content_component_class%%::paint (juce::Graphics& g)
{
// (Our component is opaque, so we must completely fill the background with a solid colour)
g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId));
g.setFont (juce::Font (16.0f));
g.setColour (juce::Colours::white);
g.drawText ("Hello World!", getLocalBounds(), juce::Justification::centred, true);
}
void %%content_component_class%%::resized()
{
// This is called when the %%content_component_class%% is resized.
// If you add any child components, this is where you should
// update their positions.
}

View File

@ -0,0 +1,27 @@
#pragma once
%%include_juce%%
//==============================================================================
/*
This component lives inside our window, and this is where you should put all
your controls and content.
*/
class %%content_component_class%% : public juce::Component
{
public:
//==============================================================================
%%content_component_class%%();
~%%content_component_class%%() override;
//==============================================================================
void paint (juce::Graphics&) override;
void resized() override;
private:
//==============================================================================
// Your private member variables go here...
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%content_component_class%%)
};

View File

@ -0,0 +1,40 @@
//==============================================================================
class %%component_class%% : public juce::Component
{
public:
%%component_class%%()
{
// In your constructor, you should add any child components, and
// initialise any special settings that your component needs.
}
~%%component_class%%() override
{
}
void paint (juce::Graphics& g) override
{
// You should replace everything in this method with your own drawing code..
g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId)); // clear the background
g.setColour (juce::Colours::grey);
g.drawRect (getLocalBounds(), 1); // draw an outline around the component
g.setColour (juce::Colours::white);
g.setFont (14.0f);
g.drawText ("%%component_class%%", getLocalBounds(),
juce::Justification::centred, true); // draw some placeholder text
}
void resized() override
{
// This method is where you should set the bounds of any child
// components that your component contains..
}
private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%component_class%%)
};

View File

@ -0,0 +1,19 @@
/*
==============================================================================
This file contains the basic startup code for a JUCE application.
==============================================================================
*/
%%app_headers%%
//==============================================================================
int main (int argc, char* argv[])
{
// ..your code goes here!
return 0;
}

View File

@ -0,0 +1,51 @@
/*
==============================================================================
This file contains the basic startup code for a JUCE application.
==============================================================================
*/
%%app_headers%%
//==============================================================================
class %%app_class_name%% : public juce::JUCEApplication
{
public:
//==============================================================================
%%app_class_name%%() {}
const juce::String getApplicationName() override { return ProjectInfo::projectName; }
const juce::String getApplicationVersion() override { return ProjectInfo::versionString; }
bool moreThanOneInstanceAllowed() override { return true; }
//==============================================================================
void initialise (const juce::String& commandLine) override
{
// Add your application's initialisation code here..
}
void shutdown() override
{
// Add your application's shutdown code here..
}
//==============================================================================
void systemRequestedQuit() override
{
// This is called when the app is being asked to quit: you can ignore this
// request and let the app carry on running, or call quit() to allow the app to close.
quit();
}
void anotherInstanceStarted (const juce::String& commandLine) override
{
// When another instance of the app is launched while this one is running,
// this method is invoked, and the commandLine parameter tells you what
// the other instance's command-line arguments were.
}
};
//==============================================================================
// This macro generates the main() routine that launches the app.
START_JUCE_APPLICATION (%%app_class_name%%)

View File

@ -0,0 +1,104 @@
/*
==============================================================================
This file contains the basic startup code for a JUCE application.
==============================================================================
*/
%%app_headers%%
//==============================================================================
class %%app_class_name%% : public juce::JUCEApplication
{
public:
//==============================================================================
%%app_class_name%%() {}
const juce::String getApplicationName() override { return ProjectInfo::projectName; }
const juce::String getApplicationVersion() override { return ProjectInfo::versionString; }
bool moreThanOneInstanceAllowed() override { return true; }
//==============================================================================
void initialise (const juce::String& commandLine) override
{
// This method is where you should put your application's initialisation code..
mainWindow.reset (new MainWindow (getApplicationName()));
}
void shutdown() override
{
// Add your application's shutdown code here..
mainWindow = nullptr; // (deletes our window)
}
//==============================================================================
void systemRequestedQuit() override
{
// This is called when the app is being asked to quit: you can ignore this
// request and let the app carry on running, or call quit() to allow the app to close.
quit();
}
void anotherInstanceStarted (const juce::String& commandLine) override
{
// When another instance of the app is launched while this one is running,
// this method is invoked, and the commandLine parameter tells you what
// the other instance's command-line arguments were.
}
//==============================================================================
/*
This class implements the desktop window that contains an instance of
our %%content_component_class%% class.
*/
class MainWindow : public juce::DocumentWindow
{
public:
MainWindow (juce::String name)
: DocumentWindow (name,
juce::Desktop::getInstance().getDefaultLookAndFeel()
.findColour (juce::ResizableWindow::backgroundColourId),
DocumentWindow::allButtons)
{
setUsingNativeTitleBar (true);
setContentOwned (new %%content_component_class%%(), true);
#if JUCE_IOS || JUCE_ANDROID
setFullScreen (true);
#else
setResizable (true, true);
centreWithSize (getWidth(), getHeight());
#endif
setVisible (true);
}
void closeButtonPressed() override
{
// This is called when the user tries to close this window. Here, we'll just
// ask the app to quit when this happens, but you can change this to do
// whatever you need.
JUCEApplication::getInstance()->systemRequestedQuit();
}
/* Note: Be careful if you override any DocumentWindow methods - the base
class uses a lot of them, so by overriding you might break its functionality.
It's best to do all your work in your content component instead, but if
you really have to override any DocumentWindow methods, make sure your
subclass also calls the superclass's method.
*/
private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow)
};
private:
std::unique_ptr<MainWindow> mainWindow;
};
//==============================================================================
// This macro generates the main() routine that launches the app.
START_JUCE_APPLICATION (%%app_class_name%%)

View File

@ -0,0 +1,51 @@
/*
==============================================================================
%%filename%%
Created: %%date%%
Author: %%author%%
==============================================================================
*/
%%include_juce%%
%%include_corresponding_header%%
//==============================================================================
%%component_class%%::%%component_class%%()
{
// In your constructor, you should add any child components, and
// initialise any special settings that your component needs.
}
%%component_class%%::~%%component_class%%()
{
}
void %%component_class%%::paint (juce::Graphics& g)
{
/* This demo code just fills the component's background and
draws some placeholder text to get you started.
You should replace everything in this method with your own
drawing code..
*/
g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId)); // clear the background
g.setColour (juce::Colours::grey);
g.drawRect (getLocalBounds(), 1); // draw an outline around the component
g.setColour (juce::Colours::white);
g.setFont (14.0f);
g.drawText ("%%component_class%%", getLocalBounds(),
juce::Justification::centred, true); // draw some placeholder text
}
void %%component_class%%::resized()
{
// This method is where you should set the bounds of any child
// components that your component contains..
}

View File

@ -0,0 +1,29 @@
/*
==============================================================================
%%filename%%
Created: %%date%%
Author: %%author%%
==============================================================================
*/
#pragma once
%%include_juce%%
//==============================================================================
/*
*/
class %%component_class%% : public juce::Component
{
public:
%%component_class%%();
~%%component_class%%() override;
void paint (juce::Graphics&) override;
void resized() override;
private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%component_class%%)
};

View File

@ -0,0 +1,11 @@
/*
==============================================================================
%%filename%%
Created: %%date%%
Author: %%author%%
==============================================================================
*/
%%include_corresponding_header%%

View File

@ -0,0 +1,11 @@
/*
==============================================================================
%%filename%%
Created: %%date%%
Author: %%author%%
==============================================================================
*/
#pragma once

View File

@ -0,0 +1,61 @@
/*
==============================================================================
%%filename%%
Created: %%date%%
Author: %%author%%
==============================================================================
*/
#pragma once
%%include_juce%%
//==============================================================================
/*
*/
class %%component_class%% : public juce::Component
{
public:
%%component_class%%()
{
// In your constructor, you should add any child components, and
// initialise any special settings that your component needs.
}
~%%component_class%%() override
{
}
void paint (juce::Graphics& g) override
{
/* This demo code just fills the component's background and
draws some placeholder text to get you started.
You should replace everything in this method with your own
drawing code..
*/
g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId)); // clear the background
g.setColour (juce::Colours::grey);
g.drawRect (getLocalBounds(), 1); // draw an outline around the component
g.setColour (juce::Colours::white);
g.setFont (14.0f);
g.drawText ("%%component_class%%", getLocalBounds(),
juce::Justification::centred, true); // draw some placeholder text
}
void resized() override
{
// This method is where you should set the bounds of any child
// components that your component contains..
}
private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%component_class%%)
};

View File

@ -0,0 +1,67 @@
#pragma once
%%include_juce%%
//==============================================================================
/*
This component lives inside our window, and this is where you should put all
your controls and content.
*/
class %%content_component_class%% : public juce::OpenGLAppComponent
{
public:
//==============================================================================
%%content_component_class%%()
{
// Make sure you set the size of the component after
// you add any child components.
setSize (800, 600);
}
~%%content_component_class%%() override
{
// This shuts down the GL system and stops the rendering calls.
shutdownOpenGL();
}
//==============================================================================
void initialise() override
{
// Initialise GL objects for rendering here.
}
void shutdown() override
{
// Free any GL objects created for rendering here.
}
void render() override
{
// This clears the context with a black background.
juce::OpenGLHelpers::clear (Colours::black);
// Add your rendering code here...
}
//==============================================================================
void paint (juce::Graphics& g) override
{
// You can add your component specific drawing code here!
// This will draw over the top of the openGL background.
}
void resized() override
{
// This is called when the MainContentComponent is resized.
// If you add any child components, this is where you should
// update their positions.
}
private:
//==============================================================================
// Your private member variables go here...
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%content_component_class%%)
};

View File

@ -0,0 +1,48 @@
%%include_corresponding_header%%
//==============================================================================
%%content_component_class%%::%%content_component_class%%()
{
// Make sure you set the size of the component after
// you add any child components.
setSize (800, 600);
}
%%content_component_class%%::~%%content_component_class%%()
{
// This shuts down the GL system and stops the rendering calls.
shutdownOpenGL();
}
//==============================================================================
void %%content_component_class%%::initialise()
{
// Initialise GL objects for rendering here.
}
void %%content_component_class%%::shutdown()
{
// Free any GL objects created for rendering here.
}
void %%content_component_class%%::render()
{
// This clears the context with a black background.
juce::OpenGLHelpers::clear (juce::Colours::black);
// Add your rendering code here...
}
//==============================================================================
void %%content_component_class%%::paint (juce::Graphics& g)
{
// You can add your component specific drawing code here!
// This will draw over the top of the openGL background.
}
void %%content_component_class%%::resized()
{
// This is called when the %%content_component_class%% is resized.
// If you add any child components, this is where you should
// update their positions.
}

View File

@ -0,0 +1,32 @@
#pragma once
%%include_juce%%
//==============================================================================
/*
This component lives inside our window, and this is where you should put all
your controls and content.
*/
class %%content_component_class%% : public juce::OpenGLAppComponent
{
public:
//==============================================================================
%%content_component_class%%();
~%%content_component_class%%() override;
//==============================================================================
void initialise() override;
void shutdown() override;
void render() override;
//==============================================================================
void paint (juce::Graphics& g) override;
void resized() override;
private:
//==============================================================================
// Your private member variables go here...
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%content_component_class%%)
};

View File

@ -0,0 +1,107 @@
class %%class_name%% : public juce::AudioProcessor
{
public:
//==============================================================================
%%class_name%%()
: AudioProcessor (BusesProperties().withInput ("Input", juce::AudioChannelSet::stereo())
.withOutput ("Output", juce::AudioChannelSet::stereo()))
{
}
~%%class_name%%() override
{
}
//==============================================================================
void prepareToPlay (double, int) override
{
// Use this method as the place to do any pre-playback
// initialisation that you need..
}
void releaseResources() override
{
// When playback stops, you can use this as an opportunity to free up any
// spare memory, etc.
}
void processBlock (juce::AudioBuffer<float>& buffer, juce::MidiBuffer&) override
{
juce::ScopedNoDenormals noDenormals;
auto totalNumInputChannels = getTotalNumInputChannels();
auto totalNumOutputChannels = getTotalNumOutputChannels();
// In case we have more outputs than inputs, this code clears any output
// channels that didn't contain input data, (because these aren't
// guaranteed to be empty - they may contain garbage).
// This is here to avoid people getting screaming feedback
// when they first compile a plugin, but obviously you don't need to keep
// this code if your algorithm always overwrites all the output channels.
for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
buffer.clear (i, 0, buffer.getNumSamples());
// This is the place where you'd normally do the guts of your plugin's
// audio processing...
// Make sure to reset the state if your inner loop is processing
// the samples and the outer loop is handling the channels.
// Alternatively, you can process the samples with the channels
// interleaved by keeping the same state.
for (int channel = 0; channel < totalNumInputChannels; ++channel)
{
auto* channelData = buffer.getWritePointer (channel);
// ..do something to the data...
}
}
//==============================================================================
juce::AudioProcessorEditor* createEditor() override { return nullptr; }
bool hasEditor() const override { return false; }
//==============================================================================
const juce::String getName() const override { return "%%name%%"; }
bool acceptsMidi() const override { return false; }
bool producesMidi() const override { return false; }
double getTailLengthSeconds() const override { return 0; }
//==============================================================================
int getNumPrograms() override { return 1; }
int getCurrentProgram() override { return 0; }
void setCurrentProgram (int) override {}
const juce::String getProgramName (int) override { return {}; }
void changeProgramName (int, const juce::String&) override {}
//==============================================================================
void getStateInformation (juce::MemoryBlock& destData) override
{
// You should use this method to store your parameters in the memory block.
// You could do that either as raw data, or use the XML or ValueTree classes
// as intermediaries to make it easy to save and load complex data.
}
void setStateInformation (const void* data, int sizeInBytes) override
{
// You should use this method to restore your parameters from this memory block,
// whose contents will have been created by the getStateInformation() call.
}
//==============================================================================
bool isBusesLayoutSupported (const BusesLayout& layouts) const override
{
// This is the place where you check if the layout is supported.
// In this template code we only support mono or stereo.
if (layouts.getMainOutputChannelSet() != juce::AudioChannelSet::mono()
&& layouts.getMainOutputChannelSet() != juce::AudioChannelSet::stereo())
return false;
// This checks if the input layout matches the output layout
if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet())
return false;
return true;
}
private:
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%class_name%%)
};

View File

@ -0,0 +1,17 @@
/*******************************************************************************
The block below describes the properties of this PIP. A PIP is a short snippet
of code that can be read by the Projucer and used to generate a JUCE project.
BEGIN_JUCE_PIP_METADATA
%%pip_metadata%%
END_JUCE_PIP_METADATA
*******************************************************************************/
#pragma once
//==============================================================================
%%pip_code%%