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.

100 lines
3.1KB

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