OBSBasicProperties.hpp 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /******************************************************************************
  2. Copyright (C) 2023 by Lain 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 "ui_OBSBasicProperties.h"
  16. #include <QDialog>
  17. class OBSBasic;
  18. class OBSPropertiesView;
  19. class OBSBasicProperties : public QDialog {
  20. Q_OBJECT
  21. private:
  22. OBSBasic *main;
  23. std::unique_ptr<Ui::OBSBasicProperties> ui;
  24. bool acceptClicked;
  25. OBSSource source;
  26. OBSSignal removedSignal;
  27. OBSSignal renamedSignal;
  28. OBSSignal updatePropertiesSignal;
  29. OBSData oldSettings;
  30. OBSPropertiesView *view;
  31. QDialogButtonBox *buttonBox;
  32. QSplitter *windowSplitter;
  33. OBSSourceAutoRelease sourceA;
  34. OBSSourceAutoRelease sourceB;
  35. OBSSourceAutoRelease sourceClone;
  36. bool direction = true;
  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. static void DrawTransitionPreview(void *data, uint32_t cx, uint32_t cy);
  42. void UpdateCallback(void *obj, obs_data_t *settings);
  43. bool ConfirmQuit();
  44. int CheckSettings();
  45. void Cleanup();
  46. private slots:
  47. void on_buttonBox_clicked(QAbstractButton *button);
  48. void AddPreviewButton();
  49. public:
  50. OBSBasicProperties(QWidget *parent, OBSSource source_);
  51. ~OBSBasicProperties();
  52. void Init();
  53. protected:
  54. virtual void closeEvent(QCloseEvent *event) override;
  55. virtual bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override;
  56. virtual void reject() override;
  57. };