MainContent.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*\
  2. |*| Copyright 2015-2016 bill-auger <https://github.com/bill-auger/av-caster/issues>
  3. |*|
  4. |*| This file is part of the AvCaster program.
  5. |*|
  6. |*| AvCaster is free software: you can redistribute it and/or modify
  7. |*| it under the terms of the GNU General Public License version 3
  8. |*| as published by the Free Software Foundation.
  9. |*|
  10. |*| AvCaster is distributed in the hope that it will be useful,
  11. |*| but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. |*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. |*| GNU General Public License for more details.
  14. |*|
  15. |*| You should have received a copy of the GNU General Public License
  16. |*| along with AvCaster. If not, see <http://www.gnu.org/licenses/>.
  17. \*/
  18. #ifndef _MAINCONTENT_H_
  19. #define _MAINCONTENT_H_
  20. //[Headers] -- You can add your own extra header files here --
  21. #include "Background.h"
  22. #include "Chat.h"
  23. #include "Config.h"
  24. #include "Controls.h"
  25. #include "Preview.h"
  26. #include "Presets.h"
  27. #include "Statusbar.h"
  28. //[/Headers]
  29. //==============================================================================
  30. /**
  31. //[Comments]
  32. MainContent is the main GUI container class for the AvCaster application.
  33. //[/Comments]
  34. */
  35. class MainContent : public Component
  36. {
  37. public:
  38. //==============================================================================
  39. MainContent ();
  40. ~MainContent();
  41. //==============================================================================
  42. //[UserMethods] -- You can add your own custom methods in this section.
  43. friend class AvCaster ;
  44. void configureButton (Button* a_button , Button::Listener* a_button_listener) ;
  45. void configureSlider (Slider* a_slider , Slider::Listener* a_slider_listener ,
  46. double min_val , double max_val ,
  47. double step ) ;
  48. void configureTextEditor(TextEditor* a_text_editor , TextEditor::Listener* a_text_listener ,
  49. int max_n_chars , const String allowed_chars ) ;
  50. void configureCombobox (ComboBox* a_combobox ,
  51. ComboBox::Listener* a_combobox_listener = nullptr) ;
  52. void loadPresetsCombo (ComboBox* a_combobox) ;
  53. Colour btnTickColor (bool is_active) ;
  54. Colour btnTextColor (bool is_active) ;
  55. private:
  56. void initialize (ValueTree config_store , ValueTree network_store ,
  57. ValueTree chatters_store , NamedValueSet& disabled_features) ;
  58. void warning (String message_text) ;
  59. void error (String message_text) ;
  60. Rectangle<int> getPreviewBounds() ;
  61. //[/UserMethods]
  62. void paint (Graphics& g);
  63. void resized();
  64. private:
  65. //[UserVariables] -- You can add your own custom variables in this section.
  66. DocumentWindow* mainWindow ;
  67. #ifdef TRAY_ICON
  68. ScopedPointer<SystemTrayIconComponent> trayIcon ;
  69. #endif // TRAY_ICON
  70. //[/UserVariables]
  71. //==============================================================================
  72. ScopedPointer<Background> background;
  73. ScopedPointer<Controls> controls;
  74. ScopedPointer<Chat> chat;
  75. ScopedPointer<Preview> preview;
  76. ScopedPointer<Presets> presets;
  77. ScopedPointer<Config> config;
  78. ScopedPointer<Statusbar> statusbar;
  79. //==============================================================================
  80. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainContent)
  81. };
  82. //[EndFile] You can add extra defines here...
  83. #ifdef TRAY_ICON
  84. /**
  85. AvCasterTrayIconComponent is the system tray GUI for the AvCaster application.
  86. It is just what it says on the tin.
  87. */
  88. class AvCasterTrayIconComponent : public SystemTrayIconComponent
  89. {
  90. public:
  91. AvCasterTrayIconComponent(ResizableWindow* main_window) : mainWindow(main_window) {}
  92. void mouseDown(const MouseEvent& mouse_event) ;
  93. private:
  94. ResizableWindow* mainWindow ;
  95. } ;
  96. #endif // TRAY_ICON
  97. //[/EndFile]
  98. #endif // _MAINCONTENT_H_