window-basic-main.hpp 22 KB

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