1
0

window-basic-properties.hpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. OBSSource sourceA;
  38. OBSSource sourceB;
  39. OBSSource sourceClone;
  40. bool direction = true;
  41. static void SourceRemoved(void *data, calldata_t *params);
  42. static void SourceRenamed(void *data, calldata_t *params);
  43. static void UpdateProperties(void *data, calldata_t *params);
  44. static void DrawPreview(void *data, uint32_t cx, uint32_t cy);
  45. static void DrawTransitionPreview(void *data, uint32_t cx, uint32_t cy);
  46. void UpdateCallback(void *obj, obs_data_t *settings);
  47. bool ConfirmQuit();
  48. int CheckSettings();
  49. void Cleanup();
  50. private slots:
  51. void on_buttonBox_clicked(QAbstractButton *button);
  52. void AddPreviewButton();
  53. public:
  54. OBSBasicProperties(QWidget *parent, OBSSource source_);
  55. ~OBSBasicProperties();
  56. void Init();
  57. protected:
  58. virtual void closeEvent(QCloseEvent *event) override;
  59. virtual void reject() override;
  60. };