window-basic-properties.hpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /******************************************************************************
  2. Copyright (C) 2014 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 <QDialog>
  16. #include <QDialogButtonBox>
  17. #include <QPointer>
  18. #include <QSplitter>
  19. #include "qt-display.hpp"
  20. #include <obs.hpp>
  21. class OBSPropertiesView;
  22. class OBSBasic;
  23. class OBSBasicProperties : public QDialog {
  24. Q_OBJECT
  25. private:
  26. QPointer<OBSQTDisplay> preview;
  27. OBSBasic *main;
  28. bool acceptClicked;
  29. OBSSource source;
  30. OBSSignal removedSignal;
  31. OBSSignal renamedSignal;
  32. OBSSignal updatePropertiesSignal;
  33. OBSData oldSettings;
  34. OBSPropertiesView *view;
  35. QDialogButtonBox *buttonBox;
  36. QSplitter *windowSplitter;
  37. static void SourceRemoved(void *data, calldata_t *params);
  38. static void SourceRenamed(void *data, calldata_t *params);
  39. static void UpdateProperties(void *data, calldata_t *params);
  40. static void DrawPreview(void *data, uint32_t cx, uint32_t cy);
  41. bool ConfirmQuit();
  42. int CheckSettings();
  43. void Cleanup();
  44. private slots:
  45. void on_buttonBox_clicked(QAbstractButton *button);
  46. public:
  47. OBSBasicProperties(QWidget *parent, OBSSource source_);
  48. ~OBSBasicProperties();
  49. void Init();
  50. protected:
  51. virtual void closeEvent(QCloseEvent *event) override;
  52. virtual void reject() override;
  53. };