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.

93 lines
3.1KB

  1. /*
  2. ==============================================================================
  3. This file was auto-generated!
  4. ==============================================================================
  5. */
  6. #pragma once
  7. %%include_juce%%
  8. //==============================================================================
  9. /*
  10. This component lives inside our window, and this is where you should put all
  11. your controls and content.
  12. */
  13. class %%content_component_class%% : public AudioAppComponent
  14. {
  15. public:
  16. //==============================================================================
  17. %%content_component_class%%()
  18. {
  19. // Make sure you set the size of the component after
  20. // you add any child components.
  21. setSize (800, 600);
  22. // specify the number of input and output channels that we want to open
  23. setAudioChannels (2, 2);
  24. }
  25. ~%%content_component_class%%()
  26. {
  27. // This shuts down the audio device and clears the audio source.
  28. shutdownAudio();
  29. }
  30. //==============================================================================
  31. void prepareToPlay (int samplesPerBlockExpected, double sampleRate) override
  32. {
  33. // This function will be called when the audio device is started, or when
  34. // its settings (i.e. sample rate, block size, etc) are changed.
  35. // You can use this function to initialise any resources you might need,
  36. // but be careful - it will be called on the audio thread, not the GUI thread.
  37. // For more details, see the help for AudioProcessor::prepareToPlay()
  38. }
  39. void getNextAudioBlock (const AudioSourceChannelInfo& bufferToFill) override
  40. {
  41. // Your audio-processing code goes here!
  42. // For more details, see the help for AudioProcessor::getNextAudioBlock()
  43. // Right now we are not producing any data, in which case we need to clear the buffer
  44. // (to prevent the output of random noise)
  45. bufferToFill.clearActiveBufferRegion();
  46. }
  47. void releaseResources() override
  48. {
  49. // This will be called when the audio device stops, or when it is being
  50. // restarted due to a setting change.
  51. // For more details, see the help for AudioProcessor::releaseResources()
  52. }
  53. //==============================================================================
  54. void paint (Graphics& g) override
  55. {
  56. // (Our component is opaque, so we must completely fill the background with a solid colour)
  57. g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId));
  58. // You can add your drawing code here!
  59. }
  60. void resized() override
  61. {
  62. // This is called when the MainContentComponent is resized.
  63. // If you add any child components, this is where you should
  64. // update their positions.
  65. }
  66. private:
  67. //==============================================================================
  68. // Your private member variables go here...
  69. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%content_component_class%%)
  70. };