window-basic-main.hpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742
  1. /******************************************************************************
  2. Copyright (C) 2013-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 <QBuffer>
  16. #include <QAction>
  17. #include <QSystemTrayIcon>
  18. #include <obs.hpp>
  19. #include <vector>
  20. #include <memory>
  21. #include "window-main.hpp"
  22. #include "window-basic-interaction.hpp"
  23. #include "window-basic-properties.hpp"
  24. #include "window-basic-transform.hpp"
  25. #include "window-basic-adv-audio.hpp"
  26. #include "window-basic-filters.hpp"
  27. #include "window-projector.hpp"
  28. #include <obs-frontend-internal.hpp>
  29. #include <util/platform.h>
  30. #include <util/threading.h>
  31. #include <util/util.hpp>
  32. #include <QPointer>
  33. class QMessageBox;
  34. class QListWidgetItem;
  35. class VolControl;
  36. class QNetworkReply;
  37. class OBSBasicStats;
  38. #include "ui_OBSBasic.h"
  39. #define DESKTOP_AUDIO_1 Str("DesktopAudioDevice1")
  40. #define DESKTOP_AUDIO_2 Str("DesktopAudioDevice2")
  41. #define AUX_AUDIO_1 Str("AuxAudioDevice1")
  42. #define AUX_AUDIO_2 Str("AuxAudioDevice2")
  43. #define AUX_AUDIO_3 Str("AuxAudioDevice3")
  44. #define SIMPLE_ENCODER_X264 "x264"
  45. #define SIMPLE_ENCODER_X264_LOWCPU "x264_lowcpu"
  46. #define SIMPLE_ENCODER_QSV "qsv"
  47. #define SIMPLE_ENCODER_NVENC "nvenc"
  48. #define SIMPLE_ENCODER_AMD "amd"
  49. #define PREVIEW_EDGE_SIZE 10
  50. struct BasicOutputHandler;
  51. enum class QtDataRole {
  52. OBSRef = Qt::UserRole,
  53. OBSSignals,
  54. };
  55. struct SavedProjectorInfo {
  56. ProjectorType type;
  57. int monitor;
  58. std::string geometry;
  59. std::string name;
  60. };
  61. struct QuickTransition {
  62. QPushButton *button = nullptr;
  63. OBSSource source;
  64. obs_hotkey_id hotkey = 0;
  65. int duration = 0;
  66. int id = 0;
  67. inline QuickTransition() {}
  68. inline QuickTransition(OBSSource source_, int duration_, int id_)
  69. : source (source_),
  70. duration (duration_),
  71. id (id_),
  72. renamedSignal (std::make_shared<OBSSignal>(
  73. obs_source_get_signal_handler(source),
  74. "rename", SourceRenamed, this))
  75. {}
  76. private:
  77. static void SourceRenamed(void *param, calldata_t *data);
  78. std::shared_ptr<OBSSignal> renamedSignal;
  79. };
  80. class OBSBasic : public OBSMainWindow {
  81. Q_OBJECT
  82. friend class OBSBasicPreview;
  83. friend class OBSBasicStatusBar;
  84. friend class OBSBasicSourceSelect;
  85. friend class OBSBasicSettings;
  86. friend struct OBSStudioAPI;
  87. enum class MoveDir {
  88. Up,
  89. Down,
  90. Left,
  91. Right
  92. };
  93. enum DropType {
  94. DropType_RawText,
  95. DropType_Text,
  96. DropType_Image,
  97. DropType_Media,
  98. DropType_Html
  99. };
  100. private:
  101. obs_frontend_callbacks *api = nullptr;
  102. std::vector<VolControl*> volumes;
  103. std::vector<OBSSignal> signalHandlers;
  104. bool loaded = false;
  105. long disableSaving = 1;
  106. bool projectChanged = false;
  107. bool previewEnabled = true;
  108. bool fullscreenInterface = false;
  109. const char *copyString;
  110. const char *copyFiltersString;
  111. bool copyVisible = true;
  112. QPointer<QThread> updateCheckThread;
  113. QPointer<QThread> logUploadThread;
  114. QPointer<OBSBasicInteraction> interaction;
  115. QPointer<OBSBasicProperties> properties;
  116. QPointer<OBSBasicTransform> transformWindow;
  117. QPointer<OBSBasicAdvAudio> advAudioWindow;
  118. QPointer<OBSBasicFilters> filters;
  119. QPointer<QTimer> cpuUsageTimer;
  120. os_cpu_usage_info_t *cpuUsageInfo = nullptr;
  121. OBSService service;
  122. std::unique_ptr<BasicOutputHandler> outputHandler;
  123. bool streamingStopping = false;
  124. bool recordingStopping = false;
  125. bool replayBufferStopping = false;
  126. gs_vertbuffer_t *box = nullptr;
  127. gs_vertbuffer_t *boxLeft = nullptr;
  128. gs_vertbuffer_t *boxTop = nullptr;
  129. gs_vertbuffer_t *boxRight = nullptr;
  130. gs_vertbuffer_t *boxBottom = nullptr;
  131. gs_vertbuffer_t *circle = nullptr;
  132. bool sceneChanging = false;
  133. bool ignoreSelectionUpdate = false;
  134. int previewX = 0, previewY = 0;
  135. int previewCX = 0, previewCY = 0;
  136. float previewScale = 0.0f;
  137. ConfigFile basicConfig;
  138. std::vector<SavedProjectorInfo*> savedProjectorsArray;
  139. QPointer<QWidget> projectors[10];
  140. QList<QPointer<QWidget>> windowProjectors;
  141. QPointer<QWidget> stats;
  142. QPointer<QWidget> remux;
  143. QPointer<QMenu> startStreamMenu;
  144. QPointer<QPushButton> replayBufferButton;
  145. QPointer<QSystemTrayIcon> trayIcon;
  146. QPointer<QAction> sysTrayStream;
  147. QPointer<QAction> sysTrayRecord;
  148. QPointer<QAction> sysTrayReplayBuffer;
  149. QPointer<QAction> showHide;
  150. QPointer<QAction> exit;
  151. QPointer<QMenu> trayMenu;
  152. QPointer<QMenu> multiviewProjectorMenu;
  153. void UpdateMultiviewProjectorMenu();
  154. void DrawBackdrop(float cx, float cy);
  155. void SetupEncoders();
  156. void CreateFirstRunSources();
  157. void CreateDefaultScene(bool firstStart);
  158. void UpdateVolumeControlsDecayRate();
  159. void UpdateVolumeControlsPeakMeterType();
  160. void ClearVolumeControls();
  161. void UploadLog(const char *subdir, const char *file);
  162. void Save(const char *file);
  163. void Load(const char *file);
  164. void InitHotkeys();
  165. void CreateHotkeys();
  166. void ClearHotkeys();
  167. bool InitService();
  168. bool InitBasicConfigDefaults();
  169. bool InitBasicConfig();
  170. void InitOBSCallbacks();
  171. void InitPrimitives();
  172. void OnFirstLoad();
  173. OBSSceneItem GetSceneItem(QListWidgetItem *item);
  174. OBSSceneItem GetCurrentSceneItem();
  175. bool QueryRemoveSource(obs_source_t *source);
  176. void TimedCheckForUpdates();
  177. void CheckForUpdates(bool manualUpdate);
  178. void GetFPSCommon(uint32_t &num, uint32_t &den) const;
  179. void GetFPSInteger(uint32_t &num, uint32_t &den) const;
  180. void GetFPSFraction(uint32_t &num, uint32_t &den) const;
  181. void GetFPSNanoseconds(uint32_t &num, uint32_t &den) const;
  182. void GetConfigFPS(uint32_t &num, uint32_t &den) const;
  183. void UpdatePreviewScalingMenu();
  184. void LoadSceneListOrder(obs_data_array_t *array);
  185. obs_data_array_t *SaveSceneListOrder();
  186. void ChangeSceneIndex(bool relative, int idx, int invalidIdx);
  187. void TempFileOutput(const char *path, int vBitrate, int aBitrate);
  188. void TempStreamOutput(const char *url, const char *key,
  189. int vBitrate, int aBitrate);
  190. void CloseDialogs();
  191. void ClearSceneData();
  192. void Nudge(int dist, MoveDir dir);
  193. OBSProjector *OpenProjector(obs_source_t *source, int monitor,
  194. QString title, ProjectorType type);
  195. void GetAudioSourceFilters();
  196. void GetAudioSourceProperties();
  197. void VolControlContextMenu();
  198. void ToggleVolControlLayout();
  199. void ToggleMixerLayout(bool vertical);
  200. void RefreshSceneCollections();
  201. void ChangeSceneCollection();
  202. void LogScenes();
  203. void LoadProfile();
  204. void ResetProfileData();
  205. bool AddProfile(bool create_new, const char *title, const char *text,
  206. const char *init_text = nullptr);
  207. void DeleteProfile(const char *profile_name, const char *profile_dir);
  208. void RefreshProfiles();
  209. void ChangeProfile();
  210. void CheckForSimpleModeX264Fallback();
  211. void SaveProjectNow();
  212. int GetTopSelectedSourceItem();
  213. obs_hotkey_pair_id streamingHotkeys, recordingHotkeys,
  214. replayBufHotkeys;
  215. obs_hotkey_id forceStreamingStopHotkey;
  216. void InitDefaultTransitions();
  217. void InitTransition(obs_source_t *transition);
  218. obs_source_t *FindTransition(const char *name);
  219. OBSSource GetCurrentTransition();
  220. obs_data_array_t *SaveTransitions();
  221. void LoadTransitions(obs_data_array_t *transitions);
  222. obs_source_t *fadeTransition;
  223. void CreateProgramDisplay();
  224. void CreateProgramOptions();
  225. void AddQuickTransitionId(int id);
  226. void AddQuickTransition();
  227. void AddQuickTransitionHotkey(QuickTransition *qt);
  228. void RemoveQuickTransitionHotkey(QuickTransition *qt);
  229. void LoadQuickTransitions(obs_data_array_t *array);
  230. obs_data_array_t *SaveQuickTransitions();
  231. void ClearQuickTransitionWidgets();
  232. void RefreshQuickTransitions();
  233. void CreateDefaultQuickTransitions();
  234. QMenu *CreatePerSceneTransitionMenu();
  235. QuickTransition *GetQuickTransition(int id);
  236. int GetQuickTransitionIdx(int id);
  237. QMenu *CreateTransitionMenu(QWidget *parent, QuickTransition *qt);
  238. void ClearQuickTransitions();
  239. void QuickTransitionClicked();
  240. void QuickTransitionChange();
  241. void QuickTransitionChangeDuration(int value);
  242. void QuickTransitionRemoveClicked();
  243. void SetPreviewProgramMode(bool enabled);
  244. void ResizeProgram(uint32_t cx, uint32_t cy);
  245. void SetCurrentScene(obs_scene_t *scene, bool force = false,
  246. bool direct = false);
  247. static void RenderProgram(void *data, uint32_t cx, uint32_t cy);
  248. std::vector<QuickTransition> quickTransitions;
  249. QPointer<QWidget> programOptions;
  250. QPointer<OBSQTDisplay> program;
  251. OBSWeakSource lastScene;
  252. OBSWeakSource swapScene;
  253. OBSWeakSource programScene;
  254. bool editPropertiesMode = false;
  255. bool sceneDuplicationMode = true;
  256. bool swapScenesMode = true;
  257. volatile bool previewProgramMode = false;
  258. obs_hotkey_id togglePreviewProgramHotkey = 0;
  259. obs_hotkey_id transitionHotkey = 0;
  260. int quickTransitionIdCounter = 1;
  261. bool overridingTransition = false;
  262. int programX = 0, programY = 0;
  263. int programCX = 0, programCY = 0;
  264. float programScale = 0.0f;
  265. int disableOutputsRef = 0;
  266. inline void OnActivate();
  267. inline void OnDeactivate();
  268. void AddDropSource(const char *file, DropType image);
  269. void dragEnterEvent(QDragEnterEvent *event) override;
  270. void dragLeaveEvent(QDragLeaveEvent *event) override;
  271. void dragMoveEvent(QDragMoveEvent *event) override;
  272. void dropEvent(QDropEvent *event) override;
  273. void ReplayBufferClicked();
  274. bool sysTrayMinimizeToTray();
  275. void EnumDialogs();
  276. QList<QDialog*> visDialogs;
  277. QList<QDialog*> modalDialogs;
  278. QList<QMessageBox*> visMsgBoxes;
  279. QList<QPoint> visDlgPositions;
  280. QByteArray startingDockLayout;
  281. obs_data_array_t *SaveProjectors();
  282. void LoadSavedProjectors(obs_data_array_t *savedProjectors);
  283. public slots:
  284. void DeferSaveBegin();
  285. void DeferSaveEnd();
  286. void StartStreaming();
  287. void StopStreaming();
  288. void ForceStopStreaming();
  289. void StreamDelayStarting(int sec);
  290. void StreamDelayStopping(int sec);
  291. void StreamingStart();
  292. void StreamStopping();
  293. void StreamingStop(int errorcode, QString last_error);
  294. void StartRecording();
  295. void StopRecording();
  296. void RecordingStart();
  297. void RecordStopping();
  298. void RecordingStop(int code);
  299. void StartReplayBuffer();
  300. void StopReplayBuffer();
  301. void ReplayBufferStart();
  302. void ReplayBufferSave();
  303. void ReplayBufferStopping();
  304. void ReplayBufferStop(int code);
  305. void SaveProjectDeferred();
  306. void SaveProject();
  307. void SetTransition(OBSSource transition);
  308. void TransitionToScene(OBSScene scene, bool force = false,
  309. bool direct = false);
  310. void TransitionToScene(OBSSource scene, bool force = false,
  311. bool direct = false, bool quickTransition = false);
  312. void SetCurrentScene(OBSSource scene, bool force = false,
  313. bool direct = false);
  314. bool AddSceneCollection(
  315. bool create_new,
  316. const QString &name = QString());
  317. private slots:
  318. void AddSceneItem(OBSSceneItem item);
  319. void AddScene(OBSSource source);
  320. void RemoveScene(OBSSource source);
  321. void RenameSources(OBSSource source, QString newName, QString prevName);
  322. void SelectSceneItem(OBSScene scene, OBSSceneItem item, bool select);
  323. void ActivateAudioSource(OBSSource source);
  324. void DeactivateAudioSource(OBSSource source);
  325. void DuplicateSelectedScene();
  326. void RemoveSelectedScene();
  327. void RemoveSelectedSceneItem();
  328. void ToggleAlwaysOnTop();
  329. void ReorderSources(OBSScene scene);
  330. void ProcessHotkey(obs_hotkey_id id, bool pressed);
  331. void AddTransition();
  332. void RenameTransition();
  333. void TransitionClicked();
  334. void TransitionStopped();
  335. void TransitionFullyStopped();
  336. void TriggerQuickTransition(int id);
  337. void SetDeinterlacingMode();
  338. void SetDeinterlacingOrder();
  339. void SetScaleFilter();
  340. void IconActivated(QSystemTrayIcon::ActivationReason reason);
  341. void SetShowing(bool showing);
  342. void ToggleShowHide();
  343. void HideAudioControl();
  344. void UnhideAllAudioControls();
  345. void ToggleHideMixer();
  346. void MixerRenameSource();
  347. void on_vMixerScrollArea_customContextMenuRequested();
  348. void on_hMixerScrollArea_customContextMenuRequested();
  349. void on_actionCopySource_triggered();
  350. void on_actionPasteRef_triggered();
  351. void on_actionPasteDup_triggered();
  352. void on_actionCopyFilters_triggered();
  353. void on_actionPasteFilters_triggered();
  354. private:
  355. /* OBS Callbacks */
  356. static void SceneReordered(void *data, calldata_t *params);
  357. static void SceneItemAdded(void *data, calldata_t *params);
  358. static void SceneItemSelected(void *data, calldata_t *params);
  359. static void SceneItemDeselected(void *data, calldata_t *params);
  360. static void SourceCreated(void *data, calldata_t *params);
  361. static void SourceRemoved(void *data, calldata_t *params);
  362. static void SourceActivated(void *data, calldata_t *params);
  363. static void SourceDeactivated(void *data, calldata_t *params);
  364. static void SourceRenamed(void *data, calldata_t *params);
  365. static void RenderMain(void *data, uint32_t cx, uint32_t cy);
  366. void ResizePreview(uint32_t cx, uint32_t cy);
  367. void AddSource(const char *id);
  368. QMenu *CreateAddSourcePopupMenu();
  369. void AddSourcePopupMenu(const QPoint &pos);
  370. void copyActionsDynamicProperties();
  371. static void HotkeyTriggered(void *data, obs_hotkey_id id, bool pressed);
  372. public:
  373. OBSSource GetProgramSource();
  374. OBSScene GetCurrentScene();
  375. void SysTrayNotify(const QString &text, QSystemTrayIcon::MessageIcon n);
  376. inline OBSSource GetCurrentSceneSource()
  377. {
  378. OBSScene curScene = GetCurrentScene();
  379. return OBSSource(obs_scene_get_source(curScene));
  380. }
  381. obs_service_t *GetService();
  382. void SetService(obs_service_t *service);
  383. inline bool IsPreviewProgramMode() const
  384. {
  385. return os_atomic_load_bool(&previewProgramMode);
  386. }
  387. bool StreamingActive() const;
  388. bool Active() const;
  389. void ResetUI();
  390. int ResetVideo();
  391. bool ResetAudio();
  392. void ResetOutputs();
  393. void ResetAudioDevice(const char *sourceId, const char *deviceId,
  394. const char *deviceDesc, int channel);
  395. void NewProject();
  396. void LoadProject();
  397. inline void GetDisplayRect(int &x, int &y, int &cx, int &cy)
  398. {
  399. x = previewX;
  400. y = previewY;
  401. cx = previewCX;
  402. cy = previewCY;
  403. }
  404. inline bool SavingDisabled() const
  405. {
  406. return disableSaving;
  407. }
  408. inline double GetCPUUsage() const
  409. {
  410. return os_cpu_usage_info_query(cpuUsageInfo);
  411. }
  412. void SaveService();
  413. bool LoadService();
  414. inline void EnableOutputs(bool enable)
  415. {
  416. if (enable) {
  417. if (--disableOutputsRef < 0)
  418. disableOutputsRef = 0;
  419. } else {
  420. disableOutputsRef++;
  421. }
  422. }
  423. QMenu *AddDeinterlacingMenu(obs_source_t *source);
  424. QMenu *AddScaleFilteringMenu(obs_sceneitem_t *item);
  425. void CreateSourcePopupMenu(int idx, bool preview);
  426. void UpdateTitleBar();
  427. void UpdateSceneSelection(OBSSource source);
  428. void SystemTrayInit();
  429. void SystemTray(bool firstStarted);
  430. void OpenSavedProjectors();
  431. void CreateInteractionWindow(obs_source_t *source);
  432. void CreatePropertiesWindow(obs_source_t *source);
  433. void CreateFiltersWindow(obs_source_t *source);
  434. protected:
  435. virtual void closeEvent(QCloseEvent *event) override;
  436. virtual void changeEvent(QEvent *event) override;
  437. private slots:
  438. void on_actionFullscreenInterface_triggered();
  439. void on_actionShow_Recordings_triggered();
  440. void on_actionRemux_triggered();
  441. void on_action_Settings_triggered();
  442. void on_actionAdvAudioProperties_triggered();
  443. void on_advAudioProps_clicked();
  444. void on_advAudioProps_destroyed();
  445. void on_actionShowLogs_triggered();
  446. void on_actionUploadCurrentLog_triggered();
  447. void on_actionUploadLastLog_triggered();
  448. void on_actionViewCurrentLog_triggered();
  449. void on_actionCheckForUpdates_triggered();
  450. void on_actionShowCrashLogs_triggered();
  451. void on_actionUploadLastCrashLog_triggered();
  452. void on_actionEditTransform_triggered();
  453. void on_actionCopyTransform_triggered();
  454. void on_actionPasteTransform_triggered();
  455. void on_actionRotate90CW_triggered();
  456. void on_actionRotate90CCW_triggered();
  457. void on_actionRotate180_triggered();
  458. void on_actionFlipHorizontal_triggered();
  459. void on_actionFlipVertical_triggered();
  460. void on_actionFitToScreen_triggered();
  461. void on_actionStretchToScreen_triggered();
  462. void on_actionCenterToScreen_triggered();
  463. void on_scenes_currentItemChanged(QListWidgetItem *current,
  464. QListWidgetItem *prev);
  465. void on_scenes_customContextMenuRequested(const QPoint &pos);
  466. void on_actionAddScene_triggered();
  467. void on_actionRemoveScene_triggered();
  468. void on_actionSceneUp_triggered();
  469. void on_actionSceneDown_triggered();
  470. void on_sources_customContextMenuRequested(const QPoint &pos);
  471. void on_scenes_itemDoubleClicked(QListWidgetItem *item);
  472. void on_actionAddSource_triggered();
  473. void on_actionRemoveSource_triggered();
  474. void on_actionInteract_triggered();
  475. void on_actionSourceProperties_triggered();
  476. void on_actionSourceUp_triggered();
  477. void on_actionSourceDown_triggered();
  478. void on_actionMoveUp_triggered();
  479. void on_actionMoveDown_triggered();
  480. void on_actionMoveToTop_triggered();
  481. void on_actionMoveToBottom_triggered();
  482. void on_actionLockPreview_triggered();
  483. void on_scalingMenu_aboutToShow();
  484. void on_actionScaleWindow_triggered();
  485. void on_actionScaleCanvas_triggered();
  486. void on_actionScaleOutput_triggered();
  487. void on_streamButton_clicked();
  488. void on_recordButton_clicked();
  489. void on_settingsButton_clicked();
  490. void on_actionHelpPortal_triggered();
  491. void on_actionWebsite_triggered();
  492. void on_preview_customContextMenuRequested(const QPoint &pos);
  493. void on_program_customContextMenuRequested(const QPoint &pos);
  494. void on_previewDisabledLabel_customContextMenuRequested(
  495. const QPoint &pos);
  496. void on_actionNewSceneCollection_triggered();
  497. void on_actionDupSceneCollection_triggered();
  498. void on_actionRenameSceneCollection_triggered();
  499. void on_actionRemoveSceneCollection_triggered();
  500. void on_actionImportSceneCollection_triggered();
  501. void on_actionExportSceneCollection_triggered();
  502. void on_actionNewProfile_triggered();
  503. void on_actionDupProfile_triggered();
  504. void on_actionRenameProfile_triggered();
  505. void on_actionRemoveProfile_triggered();
  506. void on_actionImportProfile_triggered();
  507. void on_actionExportProfile_triggered();
  508. void on_actionShowSettingsFolder_triggered();
  509. void on_actionShowProfileFolder_triggered();
  510. void on_actionAlwaysOnTop_triggered();
  511. void on_toggleListboxToolbars_toggled(bool visible);
  512. void on_toggleStatusBar_toggled(bool visible);
  513. void on_transitions_currentIndexChanged(int index);
  514. void on_transitionAdd_clicked();
  515. void on_transitionRemove_clicked();
  516. void on_transitionProps_clicked();
  517. void on_modeSwitch_clicked();
  518. void on_autoConfigure_triggered();
  519. void on_stats_triggered();
  520. void on_resetUI_triggered();
  521. void on_lockUI_toggled(bool lock);
  522. void logUploadFinished(const QString &text, const QString &error);
  523. void updateCheckFinished();
  524. void AddSourceFromAction();
  525. void MoveSceneToTop();
  526. void MoveSceneToBottom();
  527. void EditSceneName();
  528. void EditSceneItemName();
  529. void SceneNameEdited(QWidget *editor,
  530. QAbstractItemDelegate::EndEditHint endHint);
  531. void OpenSceneFilters();
  532. void OpenFilters();
  533. void EnablePreviewDisplay(bool enable);
  534. void TogglePreview();
  535. void NudgeUp();
  536. void NudgeDown();
  537. void NudgeLeft();
  538. void NudgeRight();
  539. void OpenStudioProgramProjector();
  540. void OpenPreviewProjector();
  541. void OpenSourceProjector();
  542. void OpenMultiviewProjector();
  543. void OpenSceneProjector();
  544. void OpenStudioProgramWindow();
  545. void OpenPreviewWindow();
  546. void OpenSourceWindow();
  547. void OpenMultiviewWindow();
  548. void OpenSceneWindow();
  549. void DeferredLoad(const QString &file, int requeueCount);
  550. void StackedMixerAreaContextMenuRequested();
  551. public slots:
  552. void on_actionResetTransform_triggered();
  553. public:
  554. explicit OBSBasic(QWidget *parent = 0);
  555. virtual ~OBSBasic();
  556. virtual void OBSInit() override;
  557. virtual config_t *Config() const override;
  558. virtual int GetProfilePath(char *path, size_t size, const char *file)
  559. const override;
  560. private:
  561. std::unique_ptr<Ui::OBSBasic> ui;
  562. };