window-basic-properties.hpp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. OBSSourceAutoRelease sourceA;
  38. OBSSourceAutoRelease sourceB;
  39. OBSSourceAutoRelease 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. #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
  60. virtual bool nativeEvent(const QByteArray &eventType, void *message,
  61. qintptr *result) override;
  62. #else
  63. virtual bool nativeEvent(const QByteArray &eventType, void *message,
  64. long *result) override;
  65. #endif
  66. virtual void reject() override;
  67. };