PluginProcessor.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. //==============================================================================
  15. /**
  16. */
  17. class CMLSProjectAudioProcessor : public juce::AudioProcessor
  18. {
  19. public:
  20. //==============================================================================
  21. CMLSProjectAudioProcessor();
  22. ~CMLSProjectAudioProcessor() override;
  23. //==============================================================================
  24. void prepareToPlay (double sampleRate, int samplesPerBlock) override;
  25. void releaseResources() override;
  26. #ifndef JucePlugin_PreferredChannelConfigurations
  27. bool isBusesLayoutSupported (const BusesLayout& layouts) const override;
  28. #endif
  29. void processBlock (juce::AudioBuffer<float>&, juce::MidiBuffer&) override;
  30. //==============================================================================
  31. juce::AudioProcessorEditor* createEditor() override;
  32. bool hasEditor() const override;
  33. //==============================================================================
  34. const juce::String getName() const override;
  35. bool acceptsMidi() const override;
  36. bool producesMidi() const override;
  37. bool isMidiEffect() const override;
  38. double getTailLengthSeconds() const override;
  39. //==============================================================================
  40. int getNumPrograms() override;
  41. int getCurrentProgram() override;
  42. void setCurrentProgram (int index) override;
  43. const juce::String getProgramName (int index) override;
  44. void changeProgramName (int index, const juce::String& newName) override;
  45. //==============================================================================
  46. void getStateInformation (juce::MemoryBlock& destData) override;
  47. void setStateInformation (const void* data, int sizeInBytes) override;
  48. // Mute/unmute slot by number
  49. void muteEffectInSlot(int slot);
  50. void unmuteEffectInSlot(int slot);
  51. void swapEffectInSlot(int slot1, int slot2);
  52. // Parameter controls
  53. void setEqLowGain(float value);
  54. void setEqHighGain(float value);
  55. void setDistortionDrive(float value);
  56. void setDistortionMix(float value);
  57. void setChorusDryWet(float value);
  58. void setChorusAmount(float value);
  59. void setReverbDryWet(float value);
  60. void setReverbRoomSize(float value);
  61. void setDelayDryWet(float value);
  62. void setDelayAmount(float value);
  63. private:
  64. //==============================================================================
  65. // OSC message receiver
  66. juce::OSCReceiver oscReceiver;
  67. // Buffer for the incoming audio from the generators
  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. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CMLSProjectAudioProcessor)
  76. };