window-basic-main.hpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  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> transitionButton;
  150. QPointer<QPushButton> replayBufferButton;
  151. QScopedPointer<QSystemTrayIcon> trayIcon;
  152. QPointer<QAction> sysTrayStream;
  153. QPointer<QAction> sysTrayRecord;
  154. QPointer<QAction> sysTrayReplayBuffer;
  155. QPointer<QAction> showHide;
  156. QPointer<QAction> exit;
  157. QPointer<QMenu> trayMenu;
  158. QPointer<QMenu> previewProjector;
  159. QPointer<QMenu> studioProgramProjector;
  160. QPointer<QMenu> multiviewProjectorMenu;
  161. void UpdateMultiviewProjectorMenu();
  162. void DrawBackdrop(float cx, float cy);
  163. void SetupEncoders();
  164. void CreateFirstRunSources();
  165. void CreateDefaultScene(bool firstStart);
  166. void UpdateVolumeControlsDecayRate();
  167. void UpdateVolumeControlsPeakMeterType();
  168. void ClearVolumeControls();
  169. void UploadLog(const char *subdir, const char *file);
  170. void Save(const char *file);
  171. void Load(const char *file);
  172. void InitHotkeys();
  173. void CreateHotkeys();
  174. void ClearHotkeys();
  175. bool InitService();
  176. bool InitBasicConfigDefaults();
  177. bool InitBasicConfig();
  178. void InitOBSCallbacks();
  179. void InitPrimitives();
  180. void OnFirstLoad();
  181. OBSSceneItem GetSceneItem(QListWidgetItem *item);
  182. OBSSceneItem GetCurrentSceneItem();
  183. bool QueryRemoveSource(obs_source_t *source);
  184. void TimedCheckForUpdates();
  185. void CheckForUpdates(bool manualUpdate);
  186. void GetFPSCommon(uint32_t &num, uint32_t &den) const;
  187. void GetFPSInteger(uint32_t &num, uint32_t &den) const;
  188. void GetFPSFraction(uint32_t &num, uint32_t &den) const;
  189. void GetFPSNanoseconds(uint32_t &num, uint32_t &den) const;
  190. void GetConfigFPS(uint32_t &num, uint32_t &den) const;
  191. void UpdatePreviewScalingMenu();
  192. void LoadSceneListOrder(obs_data_array_t *array);
  193. obs_data_array_t *SaveSceneListOrder();
  194. void ChangeSceneIndex(bool relative, int idx, int invalidIdx);
  195. void TempFileOutput(const char *path, int vBitrate, int aBitrate);
  196. void TempStreamOutput(const char *url, const char *key,
  197. int vBitrate, int aBitrate);
  198. void CloseDialogs();
  199. void ClearSceneData();
  200. void Nudge(int dist, MoveDir dir);
  201. OBSProjector *OpenProjector(obs_source_t *source, int monitor,
  202. QString title, ProjectorType type);
  203. void GetAudioSourceFilters();
  204. void GetAudioSourceProperties();
  205. void VolControlContextMenu();
  206. void ToggleVolControlLayout();
  207. void ToggleMixerLayout(bool vertical);
  208. void RefreshSceneCollections();
  209. void ChangeSceneCollection();
  210. void LogScenes();
  211. void LoadProfile();
  212. void ResetProfileData();
  213. bool AddProfile(bool create_new, const char *title, const char *text,
  214. const char *init_text = nullptr);
  215. void DeleteProfile(const char *profile_name, const char *profile_dir);
  216. void RefreshProfiles();
  217. void ChangeProfile();
  218. void CheckForSimpleModeX264Fallback();
  219. void SaveProjectNow();
  220. int GetTopSelectedSourceItem();
  221. obs_hotkey_pair_id streamingHotkeys, recordingHotkeys,
  222. replayBufHotkeys;
  223. obs_hotkey_id forceStreamingStopHotkey;
  224. void InitDefaultTransitions();
  225. void InitTransition(obs_source_t *transition);
  226. obs_source_t *FindTransition(const char *name);
  227. OBSSource GetCurrentTransition();
  228. obs_data_array_t *SaveTransitions();
  229. void LoadTransitions(obs_data_array_t *transitions);
  230. obs_source_t *fadeTransition;
  231. void CreateProgramDisplay();
  232. void CreateProgramOptions();
  233. void AddQuickTransitionId(int id);
  234. void AddQuickTransition();
  235. void AddQuickTransitionHotkey(QuickTransition *qt);
  236. void RemoveQuickTransitionHotkey(QuickTransition *qt);
  237. void LoadQuickTransitions(obs_data_array_t *array);
  238. obs_data_array_t *SaveQuickTransitions();
  239. void ClearQuickTransitionWidgets();
  240. void RefreshQuickTransitions();
  241. void DisableQuickTransitionWidgets();
  242. void EnableQuickTransitionWidgets();
  243. void CreateDefaultQuickTransitions();
  244. QMenu *CreatePerSceneTransitionMenu();
  245. QuickTransition *GetQuickTransition(int id);
  246. int GetQuickTransitionIdx(int id);
  247. QMenu *CreateTransitionMenu(QWidget *parent, QuickTransition *qt);
  248. void ClearQuickTransitions();
  249. void QuickTransitionClicked();
  250. void QuickTransitionChange();
  251. void QuickTransitionChangeDuration(int value);
  252. void QuickTransitionRemoveClicked();
  253. void SetPreviewProgramMode(bool enabled);
  254. void ResizeProgram(uint32_t cx, uint32_t cy);
  255. void SetCurrentScene(obs_scene_t *scene, bool force = false,
  256. bool direct = false);
  257. static void RenderProgram(void *data, uint32_t cx, uint32_t cy);
  258. std::vector<QuickTransition> quickTransitions;
  259. QPointer<QWidget> programOptions;
  260. QPointer<OBSQTDisplay> program;
  261. OBSWeakSource lastScene;
  262. OBSWeakSource swapScene;
  263. OBSWeakSource programScene;
  264. bool editPropertiesMode = false;
  265. bool sceneDuplicationMode = true;
  266. bool swapScenesMode = true;
  267. volatile bool previewProgramMode = false;
  268. obs_hotkey_id togglePreviewProgramHotkey = 0;
  269. obs_hotkey_id transitionHotkey = 0;
  270. int quickTransitionIdCounter = 1;
  271. bool overridingTransition = false;
  272. int programX = 0, programY = 0;
  273. int programCX = 0, programCY = 0;
  274. float programScale = 0.0f;
  275. int disableOutputsRef = 0;
  276. inline void OnActivate();
  277. inline void OnDeactivate();
  278. void AddDropSource(const char *file, DropType image);
  279. void dragEnterEvent(QDragEnterEvent *event) override;
  280. void dragLeaveEvent(QDragLeaveEvent *event) override;
  281. void dragMoveEvent(QDragMoveEvent *event) override;
  282. void dropEvent(QDropEvent *event) override;
  283. void ReplayBufferClicked();
  284. bool sysTrayMinimizeToTray();
  285. void EnumDialogs();
  286. QList<QDialog*> visDialogs;
  287. QList<QDialog*> modalDialogs;
  288. QList<QMessageBox*> visMsgBoxes;
  289. QList<QPoint> visDlgPositions;
  290. QByteArray startingDockLayout;
  291. obs_data_array_t *SaveProjectors();
  292. void LoadSavedProjectors(obs_data_array_t *savedProjectors);
  293. void ReceivedIntroJson(const QString &text);
  294. bool NoSourcesConfirmation();
  295. public slots:
  296. void DeferSaveBegin();
  297. void DeferSaveEnd();
  298. void StartStreaming();
  299. void StopStreaming();
  300. void ForceStopStreaming();
  301. void StreamDelayStarting(int sec);
  302. void StreamDelayStopping(int sec);
  303. void StreamingStart();
  304. void StreamStopping();
  305. void StreamingStop(int errorcode, QString last_error);
  306. void StartRecording();
  307. void StopRecording();
  308. void RecordingStart();
  309. void RecordStopping();
  310. void RecordingStop(int code);
  311. void StartReplayBuffer();
  312. void StopReplayBuffer();
  313. void ReplayBufferStart();
  314. void ReplayBufferSave();
  315. void ReplayBufferStopping();
  316. void ReplayBufferStop(int code);
  317. void SaveProjectDeferred();
  318. void SaveProject();
  319. void SetTransition(OBSSource transition);
  320. void TransitionToScene(OBSScene scene, bool force = false,
  321. bool direct = false);
  322. void TransitionToScene(OBSSource scene, bool force = false,
  323. bool direct = false, bool quickTransition = false);
  324. void SetCurrentScene(OBSSource scene, bool force = false,
  325. bool direct = false);
  326. bool AddSceneCollection(
  327. bool create_new,
  328. const QString &name = QString());
  329. private slots:
  330. void AddSceneItem(OBSSceneItem item);
  331. void AddScene(OBSSource source);
  332. void RemoveScene(OBSSource source);
  333. void RenameSources(OBSSource source, QString newName, QString prevName);
  334. void SelectSceneItem(OBSScene scene, OBSSceneItem item, bool select);
  335. void ActivateAudioSource(OBSSource source);
  336. void DeactivateAudioSource(OBSSource source);
  337. void DuplicateSelectedScene();
  338. void RemoveSelectedScene();
  339. void RemoveSelectedSceneItem();
  340. void ToggleAlwaysOnTop();
  341. void ReorderSources(OBSScene scene);
  342. void ProcessHotkey(obs_hotkey_id id, bool pressed);
  343. void AddTransition();
  344. void RenameTransition();
  345. void TransitionClicked();
  346. void TransitionStopped();
  347. void TransitionFullyStopped();
  348. void TriggerQuickTransition(int id);
  349. void SetDeinterlacingMode();
  350. void SetDeinterlacingOrder();
  351. void SetScaleFilter();
  352. void IconActivated(QSystemTrayIcon::ActivationReason reason);
  353. void SetShowing(bool showing);
  354. void ToggleShowHide();
  355. void HideAudioControl();
  356. void UnhideAllAudioControls();
  357. void ToggleHideMixer();
  358. void MixerRenameSource();
  359. void on_vMixerScrollArea_customContextMenuRequested();
  360. void on_hMixerScrollArea_customContextMenuRequested();
  361. void on_actionCopySource_triggered();
  362. void on_actionPasteRef_triggered();
  363. void on_actionPasteDup_triggered();
  364. void on_actionCopyFilters_triggered();
  365. void on_actionPasteFilters_triggered();
  366. void ColorChange();
  367. SourceTreeItem *GetItemWidgetFromSceneItem(obs_sceneitem_t *sceneItem);
  368. void on_actionShowAbout_triggered();
  369. private:
  370. /* OBS Callbacks */
  371. static void SceneReordered(void *data, calldata_t *params);
  372. static void SceneItemAdded(void *data, calldata_t *params);
  373. static void SceneItemSelected(void *data, calldata_t *params);
  374. static void SceneItemDeselected(void *data, calldata_t *params);
  375. static void SourceCreated(void *data, calldata_t *params);
  376. static void SourceRemoved(void *data, calldata_t *params);
  377. static void SourceActivated(void *data, calldata_t *params);
  378. static void SourceDeactivated(void *data, calldata_t *params);
  379. static void SourceRenamed(void *data, calldata_t *params);
  380. static void RenderMain(void *data, uint32_t cx, uint32_t cy);
  381. void ResizePreview(uint32_t cx, uint32_t cy);
  382. void AddSource(const char *id);
  383. QMenu *CreateAddSourcePopupMenu();
  384. void AddSourcePopupMenu(const QPoint &pos);
  385. void copyActionsDynamicProperties();
  386. static void HotkeyTriggered(void *data, obs_hotkey_id id, bool pressed);
  387. void AutoRemux();
  388. public:
  389. OBSSource GetProgramSource();
  390. OBSScene GetCurrentScene();
  391. void SysTrayNotify(const QString &text, QSystemTrayIcon::MessageIcon n);
  392. inline OBSSource GetCurrentSceneSource()
  393. {
  394. OBSScene curScene = GetCurrentScene();
  395. return OBSSource(obs_scene_get_source(curScene));
  396. }
  397. obs_service_t *GetService();
  398. void SetService(obs_service_t *service);
  399. inline bool IsPreviewProgramMode() const
  400. {
  401. return os_atomic_load_bool(&previewProgramMode);
  402. }
  403. bool StreamingActive() const;
  404. bool Active() const;
  405. void ResetUI();
  406. int ResetVideo();
  407. bool ResetAudio();
  408. void ResetOutputs();
  409. void ResetAudioDevice(const char *sourceId, const char *deviceId,
  410. const char *deviceDesc, int channel);
  411. void NewProject();
  412. void LoadProject();
  413. inline void GetDisplayRect(int &x, int &y, int &cx, int &cy)
  414. {
  415. x = previewX;
  416. y = previewY;
  417. cx = previewCX;
  418. cy = previewCY;
  419. }
  420. inline bool SavingDisabled() const
  421. {
  422. return disableSaving;
  423. }
  424. inline double GetCPUUsage() const
  425. {
  426. return os_cpu_usage_info_query(cpuUsageInfo);
  427. }
  428. void SaveService();
  429. bool LoadService();
  430. inline void EnableOutputs(bool enable)
  431. {
  432. if (enable) {
  433. if (--disableOutputsRef < 0)
  434. disableOutputsRef = 0;
  435. } else {
  436. disableOutputsRef++;
  437. }
  438. }
  439. QMenu *AddDeinterlacingMenu(obs_source_t *source);
  440. QMenu *AddScaleFilteringMenu(obs_sceneitem_t *item);
  441. QMenu *AddBackgroundColorMenu(obs_sceneitem_t *item);
  442. void CreateSourcePopupMenu(int idx, bool preview);
  443. void UpdateTitleBar();
  444. void UpdateSceneSelection(OBSSource source);
  445. void SystemTrayInit();
  446. void SystemTray(bool firstStarted);
  447. void OpenSavedProjectors();
  448. void CreateInteractionWindow(obs_source_t *source);
  449. void CreatePropertiesWindow(obs_source_t *source);
  450. void CreateFiltersWindow(obs_source_t *source);
  451. protected:
  452. virtual void closeEvent(QCloseEvent *event) override;
  453. virtual void changeEvent(QEvent *event) override;
  454. private slots:
  455. void on_actionFullscreenInterface_triggered();
  456. void on_actionShow_Recordings_triggered();
  457. void on_actionRemux_triggered();
  458. void on_action_Settings_triggered();
  459. void on_actionAdvAudioProperties_triggered();
  460. void on_advAudioProps_clicked();
  461. void on_advAudioProps_destroyed();
  462. void on_actionShowLogs_triggered();
  463. void on_actionUploadCurrentLog_triggered();
  464. void on_actionUploadLastLog_triggered();
  465. void on_actionViewCurrentLog_triggered();
  466. void on_actionCheckForUpdates_triggered();
  467. void on_actionShowCrashLogs_triggered();
  468. void on_actionUploadLastCrashLog_triggered();
  469. void on_actionEditTransform_triggered();
  470. void on_actionCopyTransform_triggered();
  471. void on_actionPasteTransform_triggered();
  472. void on_actionRotate90CW_triggered();
  473. void on_actionRotate90CCW_triggered();
  474. void on_actionRotate180_triggered();
  475. void on_actionFlipHorizontal_triggered();
  476. void on_actionFlipVertical_triggered();
  477. void on_actionFitToScreen_triggered();
  478. void on_actionStretchToScreen_triggered();
  479. void on_actionCenterToScreen_triggered();
  480. void on_scenes_currentItemChanged(QListWidgetItem *current,
  481. QListWidgetItem *prev);
  482. void on_scenes_customContextMenuRequested(const QPoint &pos);
  483. void on_actionAddScene_triggered();
  484. void on_actionRemoveScene_triggered();
  485. void on_actionSceneUp_triggered();
  486. void on_actionSceneDown_triggered();
  487. void on_sources_customContextMenuRequested(const QPoint &pos);
  488. void on_scenes_itemDoubleClicked(QListWidgetItem *item);
  489. void on_actionAddSource_triggered();
  490. void on_actionRemoveSource_triggered();
  491. void on_actionInteract_triggered();
  492. void on_actionSourceProperties_triggered();
  493. void on_actionSourceUp_triggered();
  494. void on_actionSourceDown_triggered();
  495. void on_actionMoveUp_triggered();
  496. void on_actionMoveDown_triggered();
  497. void on_actionMoveToTop_triggered();
  498. void on_actionMoveToBottom_triggered();
  499. void on_actionLockPreview_triggered();
  500. void on_scalingMenu_aboutToShow();
  501. void on_actionScaleWindow_triggered();
  502. void on_actionScaleCanvas_triggered();
  503. void on_actionScaleOutput_triggered();
  504. void on_streamButton_clicked();
  505. void on_recordButton_clicked();
  506. void on_settingsButton_clicked();
  507. void on_actionHelpPortal_triggered();
  508. void on_actionWebsite_triggered();
  509. void on_actionDiscord_triggered();
  510. void on_preview_customContextMenuRequested(const QPoint &pos);
  511. void on_program_customContextMenuRequested(const QPoint &pos);
  512. void on_previewDisabledLabel_customContextMenuRequested(
  513. const QPoint &pos);
  514. void on_actionNewSceneCollection_triggered();
  515. void on_actionDupSceneCollection_triggered();
  516. void on_actionRenameSceneCollection_triggered();
  517. void on_actionRemoveSceneCollection_triggered();
  518. void on_actionImportSceneCollection_triggered();
  519. void on_actionExportSceneCollection_triggered();
  520. void on_actionNewProfile_triggered();
  521. void on_actionDupProfile_triggered();
  522. void on_actionRenameProfile_triggered();
  523. void on_actionRemoveProfile_triggered();
  524. void on_actionImportProfile_triggered();
  525. void on_actionExportProfile_triggered();
  526. void on_actionShowSettingsFolder_triggered();
  527. void on_actionShowProfileFolder_triggered();
  528. void on_actionAlwaysOnTop_triggered();
  529. void on_toggleListboxToolbars_toggled(bool visible);
  530. void on_toggleStatusBar_toggled(bool visible);
  531. void on_transitions_currentIndexChanged(int index);
  532. void on_transitionAdd_clicked();
  533. void on_transitionRemove_clicked();
  534. void on_transitionProps_clicked();
  535. void on_modeSwitch_clicked();
  536. void on_autoConfigure_triggered();
  537. void on_stats_triggered();
  538. void on_resetUI_triggered();
  539. void on_lockUI_toggled(bool lock);
  540. void logUploadFinished(const QString &text, const QString &error);
  541. void updateCheckFinished();
  542. void AddSourceFromAction();
  543. void MoveSceneToTop();
  544. void MoveSceneToBottom();
  545. void EditSceneName();
  546. void EditSceneItemName();
  547. void SceneNameEdited(QWidget *editor,
  548. QAbstractItemDelegate::EndEditHint endHint);
  549. void OpenSceneFilters();
  550. void OpenFilters();
  551. void EnablePreviewDisplay(bool enable);
  552. void TogglePreview();
  553. void NudgeUp();
  554. void NudgeDown();
  555. void NudgeLeft();
  556. void NudgeRight();
  557. void OpenStudioProgramProjector();
  558. void OpenPreviewProjector();
  559. void OpenSourceProjector();
  560. void OpenMultiviewProjector();
  561. void OpenSceneProjector();
  562. void OpenStudioProgramWindow();
  563. void OpenPreviewWindow();
  564. void OpenSourceWindow();
  565. void OpenMultiviewWindow();
  566. void OpenSceneWindow();
  567. void DeferredLoad(const QString &file, int requeueCount);
  568. void StackedMixerAreaContextMenuRequested();
  569. void ResizeOutputSizeOfSource();
  570. public slots:
  571. void on_actionResetTransform_triggered();
  572. public:
  573. explicit OBSBasic(QWidget *parent = 0);
  574. virtual ~OBSBasic();
  575. virtual void OBSInit() override;
  576. virtual config_t *Config() const override;
  577. virtual int GetProfilePath(char *path, size_t size, const char *file)
  578. const override;
  579. private:
  580. std::unique_ptr<Ui::OBSBasic> ui;
  581. };
  582. class ColorSelect : public QWidget {
  583. public:
  584. explicit ColorSelect(QWidget *parent = 0);
  585. private:
  586. std::unique_ptr<Ui::ColorSelect> ui;
  587. };