window-basic-main.hpp 21 KB

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