The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
4.0KB

  1. /*
  2. ==============================================================================
  3. This file was auto-generated by the Jucer!
  4. It contains the basic startup code for a Juce application.
  5. ==============================================================================
  6. */
  7. #ifndef __PLUGINPROCESSOR_H_526ED7A9__
  8. #define __PLUGINPROCESSOR_H_526ED7A9__
  9. #include "../JuceLibraryCode/JuceHeader.h"
  10. //==============================================================================
  11. /**
  12. As the name suggest, this class does the actual audio processing.
  13. */
  14. class JuceDemoPluginAudioProcessor : public AudioProcessor
  15. {
  16. public:
  17. //==============================================================================
  18. JuceDemoPluginAudioProcessor();
  19. ~JuceDemoPluginAudioProcessor();
  20. //==============================================================================
  21. void prepareToPlay (double sampleRate, int samplesPerBlock) override;
  22. void releaseResources() override;
  23. void processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages) override;
  24. void reset() override;
  25. //==============================================================================
  26. bool hasEditor() const override { return true; }
  27. AudioProcessorEditor* createEditor() override;
  28. //==============================================================================
  29. const String getName() const override { return JucePlugin_Name; }
  30. const String getInputChannelName (int channelIndex) const override;
  31. const String getOutputChannelName (int channelIndex) const override;
  32. bool isInputChannelStereoPair (int index) const override;
  33. bool isOutputChannelStereoPair (int index) const override;
  34. bool acceptsMidi() const override;
  35. bool producesMidi() const override;
  36. bool silenceInProducesSilenceOut() const override;
  37. double getTailLengthSeconds() const override;
  38. //==============================================================================
  39. int getNumPrograms() override { return 1; }
  40. int getCurrentProgram() override { return 0; }
  41. void setCurrentProgram (int /*index*/) override {}
  42. const String getProgramName (int /*index*/) override { return "Default"; }
  43. void changeProgramName (int /*index*/, const String& /*newName*/) override {}
  44. //==============================================================================
  45. void getStateInformation (MemoryBlock& destData) override;
  46. void setStateInformation (const void* data, int sizeInBytes) override;
  47. //==============================================================================
  48. // These properties are public so that our editor component can access them
  49. // A bit of a hacky way to do it, but it's only a demo! Obviously in your own
  50. // code you'll do this much more neatly..
  51. // this is kept up to date with the midi messages that arrive, and the UI component
  52. // registers with it so it can represent the incoming messages
  53. MidiKeyboardState keyboardState;
  54. // this keeps a copy of the last set of time info that was acquired during an audio
  55. // callback - the UI component will read this and display it.
  56. AudioPlayHead::CurrentPositionInfo lastPosInfo;
  57. // these are used to persist the UI's size - the values are stored along with the
  58. // filter's other parameters, and the UI component will update them when it gets
  59. // resized.
  60. int lastUIWidth, lastUIHeight;
  61. // Our parameters
  62. AudioProcessorParameter* gain;
  63. AudioProcessorParameter* delay;
  64. private:
  65. //==============================================================================
  66. AudioSampleBuffer delayBuffer;
  67. int delayPosition;
  68. // the synth!
  69. Synthesiser synth;
  70. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JuceDemoPluginAudioProcessor)
  71. };
  72. #endif // __PLUGINPROCESSOR_H_526ED7A9__