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.

108 lines
4.1KB

  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. */
  13. class JuceDemoPluginAudioProcessor : public AudioProcessor
  14. {
  15. public:
  16. //==============================================================================
  17. JuceDemoPluginAudioProcessor();
  18. ~JuceDemoPluginAudioProcessor();
  19. //==============================================================================
  20. void prepareToPlay (double sampleRate, int samplesPerBlock);
  21. void releaseResources();
  22. void processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages);
  23. void reset();
  24. //==============================================================================
  25. bool hasEditor() const { return true; }
  26. AudioProcessorEditor* createEditor();
  27. //==============================================================================
  28. const String getName() const { return JucePlugin_Name; }
  29. int getNumParameters();
  30. float getParameter (int index);
  31. void setParameter (int index, float newValue);
  32. const String getParameterName (int index);
  33. const String getParameterText (int index);
  34. const String getInputChannelName (int channelIndex) const;
  35. const String getOutputChannelName (int channelIndex) const;
  36. bool isInputChannelStereoPair (int index) const;
  37. bool isOutputChannelStereoPair (int index) const;
  38. bool acceptsMidi() const;
  39. bool producesMidi() const;
  40. bool silenceInProducesSilenceOut() const;
  41. double getTailLengthSeconds() const;
  42. //==============================================================================
  43. int getNumPrograms() { return 0; }
  44. int getCurrentProgram() { return 0; }
  45. void setCurrentProgram (int /*index*/) { }
  46. const String getProgramName (int /*index*/) { return String::empty; }
  47. void changeProgramName (int /*index*/, const String& /*newName*/) { }
  48. //==============================================================================
  49. void getStateInformation (MemoryBlock& destData);
  50. void setStateInformation (const void* data, int sizeInBytes);
  51. //==============================================================================
  52. // These properties are public so that our editor component can access them
  53. // A bit of a hacky way to do it, but it's only a demo! Obviously in your own
  54. // code you'll do this much more neatly..
  55. // this is kept up to date with the midi messages that arrive, and the UI component
  56. // registers with it so it can represent the incoming messages
  57. MidiKeyboardState keyboardState;
  58. // this keeps a copy of the last set of time info that was acquired during an audio
  59. // callback - the UI component will read this and display it.
  60. AudioPlayHead::CurrentPositionInfo lastPosInfo;
  61. // these are used to persist the UI's size - the values are stored along with the
  62. // filter's other parameters, and the UI component will update them when it gets
  63. // resized.
  64. int lastUIWidth, lastUIHeight;
  65. //==============================================================================
  66. enum Parameters
  67. {
  68. gainParam = 0,
  69. delayParam,
  70. totalNumParams
  71. };
  72. float gain, delay;
  73. private:
  74. //==============================================================================
  75. AudioSampleBuffer delayBuffer;
  76. int delayPosition;
  77. // the synth!
  78. Synthesiser synth;
  79. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JuceDemoPluginAudioProcessor)
  80. };
  81. #endif // __PLUGINPROCESSOR_H_526ED7A9__