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.

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