PluginProcessor.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. ==============================================================================
  3. This file contains the basic framework code for a JUCE plugin processor.
  4. ==============================================================================
  5. */
  6. #pragma once
  7. #include <JuceHeader.h>
  8. #include "CMLSReverb.h"
  9. #include "CMLSDelay.h"
  10. #include "CMLSChorus.h"
  11. #include "CMLSProcessorChain.h"
  12. #include "CMLSEqualizer.h"
  13. #include "CMLSDistortion.h"
  14. #include "APVTSListeners.h"
  15. //==============================================================================
  16. /**
  17. */
  18. class CMLSProjectAudioProcessor : public juce::AudioProcessor
  19. {
  20. public:
  21. //==============================================================================
  22. CMLSProjectAudioProcessor();
  23. ~CMLSProjectAudioProcessor() override;
  24. //==============================================================================
  25. void prepareToPlay (double sampleRate, int samplesPerBlock) override;
  26. void releaseResources() override;
  27. #ifndef JucePlugin_PreferredChannelConfigurations
  28. bool isBusesLayoutSupported (const BusesLayout& layouts) const override;
  29. #endif
  30. void processBlock (juce::AudioBuffer<float>&, juce::MidiBuffer&) override;
  31. //==============================================================================
  32. juce::AudioProcessorEditor* createEditor() override;
  33. bool hasEditor() const override;
  34. //==============================================================================
  35. const juce::String getName() const override;
  36. bool acceptsMidi() const override;
  37. bool producesMidi() const override;
  38. bool isMidiEffect() const override;
  39. double getTailLengthSeconds() const override;
  40. //==============================================================================
  41. int getNumPrograms() override;
  42. int getCurrentProgram() override;
  43. void setCurrentProgram (int index) override;
  44. const juce::String getProgramName (int index) override;
  45. void changeProgramName (int index, const juce::String& newName) override;
  46. //==============================================================================
  47. void getStateInformation (juce::MemoryBlock& destData) override;
  48. void setStateInformation (const void* data, int sizeInBytes) override;
  49. // Mute/unmute slot by number
  50. void muteEffectInSlot(int slot);
  51. void unmuteEffectInSlot(int slot);
  52. void swapEffectInSlot(int slot1, int slot2);
  53. // Value Tree State for parameters
  54. juce::AudioProcessorValueTreeState apvts;
  55. juce::AudioProcessorValueTreeState* getApvts();
  56. private:
  57. //==============================================================================
  58. // Effects processing chain
  59. juce::dsp::ProcessorBase* equalizer;
  60. juce::dsp::ProcessorBase* distortion;
  61. juce::dsp::ProcessorBase* chorus;
  62. juce::dsp::ProcessorBase* delay;
  63. juce::dsp::ProcessorBase* reverb;
  64. CMLSProcessorChain processorChain;
  65. APVTSListeners apvtsListeners;
  66. juce::AudioProcessorValueTreeState::ParameterLayout createParameters();
  67. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CMLSProjectAudioProcessor)
  68. };