window-basic-properties.hpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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,
  46. uint32_t cy);
  47. void UpdateCallback(void *obj, obs_data_t *settings);
  48. bool ConfirmQuit();
  49. int CheckSettings();
  50. void Cleanup();
  51. private slots:
  52. void on_buttonBox_clicked(QAbstractButton *button);
  53. void AddPreviewButton();
  54. public:
  55. OBSBasicProperties(QWidget *parent, OBSSource source_);
  56. ~OBSBasicProperties();
  57. void Init();
  58. protected:
  59. virtual void closeEvent(QCloseEvent *event) override;
  60. virtual void reject() override;
  61. };