Skip to content

Commit

Permalink
Fixed Vanilla test
Browse files Browse the repository at this point in the history
  • Loading branch information
ffAudio committed Jul 28, 2023
1 parent 3fa8201 commit 35be647
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 8 deletions.
79 changes: 79 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
BasedOnStyle: WebKit
AccessModifierOffset: '-4'
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: 'true'
AlignConsecutiveAssignments: 'true'
AlignConsecutiveDeclarations: 'true'
AlignEscapedNewlines: Right
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowAllConstructorInitializersOnNextLine: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'true'
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: 'false'
AlwaysBreakTemplateDeclarations: 'Yes'
BinPackArguments: 'true'
BinPackParameters: 'true'
BreakAfterJavaFieldAnnotations: 'false'
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: 'false'
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeComma
BreakStringLiterals: 'true'
ColumnLimit: '160'
CompactNamespaces: 'true'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
ConstructorInitializerIndentWidth: '2'
ContinuationIndentWidth: '2'
Cpp11BracedListStyle: 'false'
DerivePointerAlignment: 'false'
DisableFormat: 'false'
ExperimentalAutoDetectBinPacking: 'false'
FixNamespaceComments: 'true'
IncludeBlocks: Regroup
IndentCaseLabels: 'true'
IndentPPDirectives: BeforeHash
IndentWidth: '4'
IndentWrappedFunctionNames: 'true'
KeepEmptyLinesAtTheStartOfBlocks: 'true'
Language: Cpp
MaxEmptyLinesToKeep: '2'
NamespaceIndentation: None
PenaltyBreakBeforeFirstCallParameter: '100'
PenaltyBreakComment: '100'
PenaltyBreakFirstLessLess: '0'
PenaltyBreakString: '100'
PenaltyExcessCharacter: '1'
PenaltyReturnTypeOnItsOwnLine: '20'
PointerAlignment: Left
ReflowComments: 'false'
SortIncludes: 'true'
SortUsingDeclarations: 'true'
SpaceAfterCStyleCast: 'true'
SpaceAfterLogicalNot: 'false'
SpaceAfterTemplateKeyword: 'false'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeCpp11BracedList: 'true'
SpaceBeforeCtorInitializerColon: 'true'
SpaceBeforeInheritanceColon: 'true'
SpaceBeforeParens: NonEmptyParentheses
SpaceBeforeRangeBasedForLoopColon: 'false'
SpaceInEmptyParentheses: 'false'
SpacesBeforeTrailingComments: '2'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'false'
SpacesInSquareBrackets: 'false'
Standard: Auto
TabWidth: '4'
UseTab: Never

...
18 changes: 15 additions & 3 deletions Examples/Vanilla/Source/PluginProcessor.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@

#include "PluginProcessor.h"

VanillaAudioProcessor::VanillaAudioProcessor()
: foleys::MagicProcessor (
juce::AudioProcessor::BusesProperties().withInput ("Intput", juce::AudioChannelSet::stereo(), true).withOutput ("Output", juce::AudioChannelSet::stereo(), true))
{
}

void VanillaAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, juce::MidiBuffer&)
{
for (int channel = getTotalNumInputChannels(); channel < getTotalNumOutputChannels(); ++channel)
buffer.clear (channel, 0, buffer.getNumChannels());

VanillaAudioProcessor::VanillaAudioProcessor() : foleys::MagicProcessor(juce::AudioProcessor::BusesProperties()
.withOutput ("Output", juce::AudioChannelSet::stereo(), true))
{}
buffer.clear();
}

bool VanillaAudioProcessor::isBusesLayoutSupported (const juce::AudioProcessor::BusesLayout& layout) const
{
return (layout.getMainInputChannelSet() == layout.getMainOutputChannelSet());
}

//==============================================================================
// This creates new instances of the plugin..
Expand Down
10 changes: 5 additions & 5 deletions Examples/Vanilla/Source/PluginProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ class VanillaAudioProcessor : public foleys::MagicProcessor
public:
VanillaAudioProcessor();

void prepareToPlay ([[maybe_unused]]double sampleRate, [[maybe_unused]]int expectedNumSamples) override {}
void processBlock (juce::AudioBuffer<float>&, juce::MidiBuffer&) override {}
void releaseResources() override {}
void prepareToPlay ([[maybe_unused]] double sampleRate, [[maybe_unused]] int expectedNumSamples) override { }
void processBlock (juce::AudioBuffer<float>&, juce::MidiBuffer&) override;
void releaseResources() override { }

double getTailLengthSeconds() const override { return 0.0; }
bool isBusesLayoutSupported (const juce::AudioProcessor::BusesLayout& layout) const override;

private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(VanillaAudioProcessor)
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VanillaAudioProcessor)
};
2 changes: 2 additions & 0 deletions modules/foleys_gui_magic/General/foleys_MagicProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ class MagicProcessor : public juce::AudioProcessor
void getStateInformation (juce::MemoryBlock& destData) override;
void setStateInformation (const void* data, int sizeInBytes) override;

double getTailLengthSeconds() const override { return 0.0; }

//==============================================================================
int getNumPrograms() override { return 1; }
int getCurrentProgram() override { return 0; }
Expand Down

0 comments on commit 35be647

Please sign in to comment.