Config.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*\
  2. |*| Copyright 2015 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 Lesser 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 Lesser General Public License for more details.
  14. |*|
  15. |*| You should have received a copy of the GNU Lesser General Public License
  16. |*| along with AvCaster. If not, see <http://www.gnu.org/licenses/>.
  17. \*/
  18. #ifndef _CONFIG_H_
  19. #define _CONFIG_H_
  20. //[Headers] -- You can add your own extra header files here --
  21. #include "JuceHeader.h"
  22. #include "Constants.h"
  23. //[/Headers]
  24. //==============================================================================
  25. /**
  26. //[Comments]
  27. Config is the presets configuration GUI for the AvCaster application.
  28. It has it controls for setting the stream parameters.
  29. //[/Comments]
  30. */
  31. class Config : public Component,
  32. public TextEditor::Listener,
  33. public SliderListener,
  34. public ComboBoxListener,
  35. public ButtonListener
  36. {
  37. public:
  38. //==============================================================================
  39. Config ();
  40. ~Config();
  41. //==============================================================================
  42. //[UserMethods] -- You can add your own custom methods in this section.
  43. //[/UserMethods]
  44. void paint (Graphics& g);
  45. void resized();
  46. void sliderValueChanged (Slider* sliderThatWasMoved);
  47. void comboBoxChanged (ComboBox* comboBoxThatHasChanged);
  48. void buttonClicked (Button* buttonThatWasClicked);
  49. private:
  50. //[UserVariables] -- You can add your own custom variables in this section.
  51. void broughtToFront() override ;
  52. void textEditorFocusLost(TextEditor& a_text_editor) override ;
  53. void configureSlider (Slider* a_slider) ;
  54. void configureTextEditor(TextEditor* a_text_editor , int max_n_chars ,
  55. const String allowed_chars ) ;
  56. void configureCombobox (ComboBox* a_combobox) ;
  57. void loadConfig () ;
  58. void enableComponents () ;
  59. //[/UserVariables]
  60. //==============================================================================
  61. ScopedPointer<GroupComponent> screenGroup;
  62. ScopedPointer<Label> displayLabel;
  63. ScopedPointer<Slider> displaySlider;
  64. ScopedPointer<Label> screenLabel;
  65. ScopedPointer<Slider> screenSlider;
  66. ScopedPointer<Label> screenWidthLabel;
  67. ScopedPointer<TextEditor> screenWidthText;
  68. ScopedPointer<Label> screenHeightLabel;
  69. ScopedPointer<TextEditor> screenHeightText;
  70. ScopedPointer<Label> xOffsetLabel;
  71. ScopedPointer<TextEditor> xOffsetText;
  72. ScopedPointer<Label> yOffsetLabel;
  73. ScopedPointer<TextEditor> yOffsetText;
  74. ScopedPointer<GroupComponent> cameraGroup;
  75. ScopedPointer<Label> cameraDevLabel;
  76. ScopedPointer<ComboBox> cameraDevCombo;
  77. ScopedPointer<Label> cameraResLabel;
  78. ScopedPointer<ComboBox> cameraResCombo;
  79. ScopedPointer<GroupComponent> audioGroup;
  80. ScopedPointer<Label> audioApiLabel;
  81. ScopedPointer<ComboBox> audioApiCombo;
  82. ScopedPointer<Label> audioDevLabel;
  83. ScopedPointer<ComboBox> audioDevCombo;
  84. ScopedPointer<Label> audioCodecLabel;
  85. ScopedPointer<ComboBox> audioCodecCombo;
  86. ScopedPointer<Label> nChannelsLabel;
  87. ScopedPointer<Slider> nChannelsSlider;
  88. ScopedPointer<Label> samplerateLabel;
  89. ScopedPointer<ComboBox> samplerateCombo;
  90. ScopedPointer<Label> audioBitrateLabel;
  91. ScopedPointer<ComboBox> audioBitrateCombo;
  92. ScopedPointer<GroupComponent> textGroup;
  93. ScopedPointer<Label> motdLabel;
  94. ScopedPointer<TextEditor> motdText;
  95. ScopedPointer<Label> textStyleLabel;
  96. ScopedPointer<ComboBox> textStyleCombo;
  97. ScopedPointer<Label> textPosLabel;
  98. ScopedPointer<ComboBox> textPosCombo;
  99. ScopedPointer<GroupComponent> interstitialGroup;
  100. ScopedPointer<Label> locationLabel;
  101. ScopedPointer<TextEditor> interstitialText;
  102. ScopedPointer<TextButton> browseButton;
  103. ScopedPointer<GroupComponent> outputGroup;
  104. ScopedPointer<Label> outputStreamLabel;
  105. ScopedPointer<ComboBox> outputSinkCombo;
  106. ScopedPointer<Label> outputWidthLabel;
  107. ScopedPointer<TextEditor> outputWidthText;
  108. ScopedPointer<Label> outputHeightLabel;
  109. ScopedPointer<TextEditor> outputHeightText;
  110. ScopedPointer<Label> framerateLabel;
  111. ScopedPointer<ComboBox> framerateCombo;
  112. ScopedPointer<Label> bitrateLabel;
  113. ScopedPointer<ComboBox> videoBitrateCombo;
  114. ScopedPointer<Label> outputDestLabel;
  115. ScopedPointer<TextEditor> outputDestText;
  116. //==============================================================================
  117. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Config)
  118. };
  119. //[EndFile] You can add extra defines here...
  120. //[/EndFile]
  121. #endif // _CONFIG_H_