PluginProcessor.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. // Parameter controls
  54. void setEqLowGain(float value);
  55. void setEqHighGain(float value);
  56. void setDistortionDrive(float value);
  57. void setDistortionMix(float value);
  58. void setChorusDryWet(float value);
  59. void setChorusAmount(float value);
  60. void setReverbDryWet(float value);
  61. void setReverbRoomSize(float value);
  62. void setDelayDryWet(float value);
  63. void setDelayAmount(float value);
  64. // Value Tree State for parameters
  65. juce::AudioProcessorValueTreeState apvts;
  66. private:
  67. //==============================================================================
  68. // Effects processing chain
  69. juce::dsp::ProcessorBase* equalizer;
  70. juce::dsp::ProcessorBase* distortion;
  71. juce::dsp::ProcessorBase* chorus;
  72. juce::dsp::ProcessorBase* delay;
  73. juce::dsp::ProcessorBase* reverb;
  74. CMLSProcessorChain processorChain;
  75. APVTSListeners apvtsListeners;
  76. juce::AudioProcessorValueTreeState::ParameterLayout createParameters();
  77. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CMLSProjectAudioProcessor)
  78. };