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.

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