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