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.

84 lines
3.0KB

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