window-basic-settings.hpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 QAbstractButton;
  19. #include "ui_OBSBasicSettings.h"
  20. class OBSBasicSettings : public QDialog {
  21. Q_OBJECT
  22. private:
  23. std::unique_ptr<Ui::OBSBasicSettings> ui;
  24. ConfigFile localeIni;
  25. bool generalChanged;
  26. bool outputsChanged;
  27. bool audioChanged;
  28. bool videoChanged;
  29. int pageIndex;
  30. bool loading;
  31. inline bool Changed() const
  32. {
  33. return generalChanged || outputsChanged || audioChanged ||
  34. videoChanged;
  35. }
  36. inline void ClearChanged()
  37. {
  38. generalChanged = false;
  39. outputsChanged = false;
  40. audioChanged = false;
  41. videoChanged = false;
  42. }
  43. bool QueryChanges();
  44. void LoadGeneralSettings();
  45. //void LoadOutputSettings();
  46. void LoadAudioSettings();
  47. void LoadVideoSettings();
  48. void LoadSettings(bool changedOnly);
  49. /* general */
  50. void LoadLanguageList();
  51. /* video */
  52. void LoadRendererList();
  53. void ResetDownscales(uint32_t cx, uint32_t cy);
  54. void LoadResolutionLists();
  55. void LoadFPSData();
  56. void SaveGeneralSettings();
  57. //void SaveOutputSettings();
  58. void SaveAudioSettings();
  59. void SaveVideoSettings();
  60. void SaveSettings();
  61. private slots:
  62. void on_listWidget_itemSelectionChanged();
  63. void on_buttonBox_clicked(QAbstractButton *button);
  64. void on_language_currentIndexChanged(int index);
  65. void on_sampleRate_currentIndexChanged(int index);
  66. void on_channelSetup_currentIndexChanged(int index);
  67. void on_audioBufferingTime_valueChanged(int index);
  68. void on_renderer_currentIndexChanged(int index);
  69. void on_fpsType_currentIndexChanged(int index);
  70. void on_baseResolution_editTextChanged(const QString &text);
  71. void on_outputResolution_editTextChanged(const QString &text);
  72. void on_fpsCommon_currentIndexChanged(int index);
  73. void on_fpsInteger_valueChanged(int value);
  74. void on_fpsNumerator_valueChanged(int value);
  75. void on_fpsDenominator_valueChanged(int value);
  76. protected:
  77. virtual void closeEvent(QCloseEvent *event);
  78. public:
  79. OBSBasicSettings(QWidget *parent);
  80. };