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. //==============================================================================
  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. //==============================================================================
  41. int getNumPrograms() { return 0; }
  42. int getCurrentProgram() { return 0; }
  43. void setCurrentProgram (int /*index*/) { }
  44. const String getProgramName (int /*index*/) { return String::empty; }
  45. void changeProgramName (int /*index*/, const String& /*newName*/) { }
  46. //==============================================================================
  47. void getStateInformation (MemoryBlock& destData);
  48. void setStateInformation (const void* data, int sizeInBytes);
  49. //==============================================================================
  50. // These properties are public so that our editor component can access them
  51. // A bit of a hacky way to do it, but it's only a demo! Obviously in your own
  52. // code you'll do this much more neatly..
  53. // this is kept up to date with the midi messages that arrive, and the UI component
  54. // registers with it so it can represent the incoming messages
  55. MidiKeyboardState keyboardState;
  56. // this keeps a copy of the last set of time info that was acquired during an audio
  57. // callback - the UI component will read this and display it.
  58. AudioPlayHead::CurrentPositionInfo lastPosInfo;
  59. // these are used to persist the UI's size - the values are stored along with the
  60. // filter's other parameters, and the UI component will update them when it gets
  61. // resized.
  62. int lastUIWidth, lastUIHeight;
  63. //==============================================================================
  64. enum Parameters
  65. {
  66. gainParam = 0,
  67. delayParam,
  68. totalNumParams
  69. };
  70. float gain, delay;
  71. private:
  72. //==============================================================================
  73. AudioSampleBuffer delayBuffer;
  74. int delayPosition;
  75. // the synth!
  76. Synthesiser synth;
  77. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JuceDemoPluginAudioProcessor);
  78. };
  79. #endif // __PLUGINPROCESSOR_H_526ED7A9__