window-basic-settings.hpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /******************************************************************************
  2. Copyright (C) 2013 by Hugh Bailey <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #pragma once
  15. #include <util/util.hpp>
  16. #include <QDialog>
  17. #include <memory>
  18. class OBSBasic;
  19. class QAbstractButton;
  20. #include "ui_OBSBasicSettings.h"
  21. class OBSBasicSettings : public QDialog {
  22. Q_OBJECT
  23. private:
  24. OBSBasic *main;
  25. std::unique_ptr<Ui::OBSBasicSettings> ui;
  26. ConfigFile localeIni;
  27. bool generalChanged;
  28. bool outputsChanged;
  29. bool audioChanged;
  30. bool videoChanged;
  31. int pageIndex;
  32. bool loading;
  33. inline bool Changed() const
  34. {
  35. return generalChanged || outputsChanged || audioChanged ||
  36. videoChanged;
  37. }
  38. inline void ClearChanged()
  39. {
  40. generalChanged = false;
  41. outputsChanged = false;
  42. audioChanged = false;
  43. videoChanged = false;
  44. }
  45. bool QueryChanges();
  46. void LoadGeneralSettings();
  47. //void LoadOutputSettings();
  48. void LoadAudioSettings();
  49. void LoadVideoSettings();
  50. void LoadSettings(bool changedOnly);
  51. /* general */
  52. void LoadLanguageList();
  53. /* audio */
  54. void LoadAudioDevices();
  55. /* video */
  56. void LoadRendererList();
  57. void ResetDownscales(uint32_t cx, uint32_t cy);
  58. void LoadResolutionLists();
  59. void LoadFPSData();
  60. void SaveGeneralSettings();
  61. //void SaveOutputSettings();
  62. void SaveAudioSettings();
  63. void SaveVideoSettings();
  64. void SaveSettings();
  65. private slots:
  66. void on_listWidget_itemSelectionChanged();
  67. void on_buttonBox_clicked(QAbstractButton *button);
  68. void on_language_currentIndexChanged(int index);
  69. void on_sampleRate_currentIndexChanged(int index);
  70. void on_channelSetup_currentIndexChanged(int index);
  71. void on_audioBufferingTime_valueChanged(int index);
  72. void on_renderer_currentIndexChanged(int index);
  73. void on_fpsType_currentIndexChanged(int index);
  74. void on_baseResolution_editTextChanged(const QString &text);
  75. void on_outputResolution_editTextChanged(const QString &text);
  76. void on_fpsCommon_currentIndexChanged(int index);
  77. void on_fpsInteger_valueChanged(int value);
  78. void on_fpsNumerator_valueChanged(int value);
  79. void on_fpsDenominator_valueChanged(int value);
  80. protected:
  81. virtual void closeEvent(QCloseEvent *event);
  82. public:
  83. OBSBasicSettings(QWidget *parent);
  84. };