PluginProcessor.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #pragma once
  2. #include <JuceHeader.h>
  3. #include "CMLSEqualizer.h"
  4. #include "CMLSDistortion.h"
  5. //==============================================================================
  6. class CMLSProjectAudioProcessor : public juce::AudioProcessor
  7. {
  8. public:
  9. //==============================================================================
  10. CMLSProjectAudioProcessor();
  11. ~CMLSProjectAudioProcessor() override;
  12. //==============================================================================
  13. void prepareToPlay(double sampleRate, int samplesPerBlock) override;
  14. void releaseResources() override;
  15. #ifndef JucePlugin_PreferredChannelConfigurations
  16. bool isBusesLayoutSupported(const BusesLayout& layouts) const override;
  17. #endif
  18. void processBlock(juce::AudioBuffer<float>&, juce::MidiBuffer&) override;
  19. //==============================================================================
  20. juce::AudioProcessorEditor* createEditor() override;
  21. bool hasEditor() const override;
  22. //==============================================================================
  23. const juce::String getName() const override;
  24. bool acceptsMidi() const override;
  25. bool producesMidi() const override;
  26. bool isMidiEffect() const override;
  27. double getTailLengthSeconds() const override;
  28. //==============================================================================
  29. int getNumPrograms() override;
  30. int getCurrentProgram() override;
  31. void setCurrentProgram(int index) override;
  32. const juce::String getProgramName(int index) override;
  33. void changeProgramName(int index, const juce::String& newName) override;
  34. //==============================================================================
  35. void getStateInformation(juce::MemoryBlock& destData) override;
  36. void setStateInformation(const void* data, int sizeInBytes) override;
  37. //==============================================================================
  38. // parameter control functions
  39. void setEqLowGain(float value);
  40. void setEqHighGain(float value);
  41. void setDistortionDrive(float value);
  42. void setDistortionMix(float value);
  43. private:
  44. //==============================================================================
  45. juce::OSCReceiver oscReceiver; // OSC message receiver
  46. juce::dsp::ProcessorChain<CMLSEqualizer, CMLSDistortion> processorChain;
  47. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CMLSProjectAudioProcessor)
  48. };