window-basic-main.hpp 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248
  1. /******************************************************************************
  2. Copyright (C) 2023 by Lain Bailey <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #pragma once
  15. #include <QBuffer>
  16. #include <QAction>
  17. #include <QThread>
  18. #include <QWidgetAction>
  19. #include <QSystemTrayIcon>
  20. #include <QStyledItemDelegate>
  21. #include <obs.hpp>
  22. #include <vector>
  23. #include <memory>
  24. #include "window-main.hpp"
  25. #include "window-basic-interaction.hpp"
  26. #include "window-basic-vcam.hpp"
  27. #include "window-basic-properties.hpp"
  28. #include "window-basic-transform.hpp"
  29. #include "window-basic-adv-audio.hpp"
  30. #include "window-basic-filters.hpp"
  31. #include "window-missing-files.hpp"
  32. #include "window-projector.hpp"
  33. #include "window-basic-about.hpp"
  34. #include "auth-base.hpp"
  35. #include "log-viewer.hpp"
  36. #include "undo-stack-obs.hpp"
  37. #include <obs-frontend-internal.hpp>
  38. #include <util/platform.h>
  39. #include <util/threading.h>
  40. #include <util/util.hpp>
  41. #include <QPointer>
  42. class QMessageBox;
  43. class QListWidgetItem;
  44. class VolControl;
  45. class OBSBasicStats;
  46. class OBSBasicVCamConfig;
  47. #include "ui_OBSBasic.h"
  48. #include "ui_ColorSelect.h"
  49. #define DESKTOP_AUDIO_1 Str("DesktopAudioDevice1")
  50. #define DESKTOP_AUDIO_2 Str("DesktopAudioDevice2")
  51. #define AUX_AUDIO_1 Str("AuxAudioDevice1")
  52. #define AUX_AUDIO_2 Str("AuxAudioDevice2")
  53. #define AUX_AUDIO_3 Str("AuxAudioDevice3")
  54. #define AUX_AUDIO_4 Str("AuxAudioDevice4")
  55. #define SIMPLE_ENCODER_X264 "x264"
  56. #define SIMPLE_ENCODER_X264_LOWCPU "x264_lowcpu"
  57. #define SIMPLE_ENCODER_QSV "qsv"
  58. #define SIMPLE_ENCODER_QSV_AV1 "qsv_av1"
  59. #define SIMPLE_ENCODER_NVENC "nvenc"
  60. #define SIMPLE_ENCODER_NVENC_AV1 "nvenc_av1"
  61. #define SIMPLE_ENCODER_NVENC_HEVC "nvenc_hevc"
  62. #define SIMPLE_ENCODER_AMD "amd"
  63. #define SIMPLE_ENCODER_AMD_HEVC "amd_hevc"
  64. #define SIMPLE_ENCODER_AMD_AV1 "amd_av1"
  65. #define SIMPLE_ENCODER_APPLE_H264 "apple_h264"
  66. #define SIMPLE_ENCODER_APPLE_HEVC "apple_hevc"
  67. #define PREVIEW_EDGE_SIZE 10
  68. struct BasicOutputHandler;
  69. enum class QtDataRole {
  70. OBSRef = Qt::UserRole,
  71. OBSSignals,
  72. };
  73. struct SavedProjectorInfo {
  74. ProjectorType type;
  75. int monitor;
  76. std::string geometry;
  77. std::string name;
  78. bool alwaysOnTop;
  79. bool alwaysOnTopOverridden;
  80. };
  81. struct SourceCopyInfo {
  82. OBSWeakSource weak_source;
  83. bool visible;
  84. obs_sceneitem_crop crop;
  85. obs_transform_info transform;
  86. obs_blending_method blend_method;
  87. obs_blending_type blend_mode;
  88. };
  89. struct QuickTransition {
  90. QPushButton *button = nullptr;
  91. OBSSource source;
  92. obs_hotkey_id hotkey = OBS_INVALID_HOTKEY_ID;
  93. int duration = 0;
  94. int id = 0;
  95. bool fadeToBlack = false;
  96. inline QuickTransition() {}
  97. inline QuickTransition(OBSSource source_, int duration_, int id_,
  98. bool fadeToBlack_ = false)
  99. : source(source_),
  100. duration(duration_),
  101. id(id_),
  102. fadeToBlack(fadeToBlack_),
  103. renamedSignal(std::make_shared<OBSSignal>(
  104. obs_source_get_signal_handler(source), "rename",
  105. SourceRenamed, this))
  106. {
  107. }
  108. private:
  109. static void SourceRenamed(void *param, calldata_t *data);
  110. std::shared_ptr<OBSSignal> renamedSignal;
  111. };
  112. class ColorSelect : public QWidget {
  113. public:
  114. explicit ColorSelect(QWidget *parent = 0);
  115. private:
  116. std::unique_ptr<Ui::ColorSelect> ui;
  117. };
  118. class OBSBasic : public OBSMainWindow {
  119. Q_OBJECT
  120. Q_PROPERTY(QIcon imageIcon READ GetImageIcon WRITE SetImageIcon
  121. DESIGNABLE true)
  122. Q_PROPERTY(QIcon colorIcon READ GetColorIcon WRITE SetColorIcon
  123. DESIGNABLE true)
  124. Q_PROPERTY(QIcon slideshowIcon READ GetSlideshowIcon WRITE
  125. SetSlideshowIcon DESIGNABLE true)
  126. Q_PROPERTY(QIcon audioInputIcon READ GetAudioInputIcon WRITE
  127. SetAudioInputIcon DESIGNABLE true)
  128. Q_PROPERTY(QIcon audioOutputIcon READ GetAudioOutputIcon WRITE
  129. SetAudioOutputIcon DESIGNABLE true)
  130. Q_PROPERTY(QIcon desktopCapIcon READ GetDesktopCapIcon WRITE
  131. SetDesktopCapIcon DESIGNABLE true)
  132. Q_PROPERTY(QIcon windowCapIcon READ GetWindowCapIcon WRITE
  133. SetWindowCapIcon DESIGNABLE true)
  134. Q_PROPERTY(QIcon gameCapIcon READ GetGameCapIcon WRITE SetGameCapIcon
  135. DESIGNABLE true)
  136. Q_PROPERTY(QIcon cameraIcon READ GetCameraIcon WRITE SetCameraIcon
  137. DESIGNABLE true)
  138. Q_PROPERTY(QIcon textIcon READ GetTextIcon WRITE SetTextIcon
  139. DESIGNABLE true)
  140. Q_PROPERTY(QIcon mediaIcon READ GetMediaIcon WRITE SetMediaIcon
  141. DESIGNABLE true)
  142. Q_PROPERTY(QIcon browserIcon READ GetBrowserIcon WRITE SetBrowserIcon
  143. DESIGNABLE true)
  144. Q_PROPERTY(QIcon groupIcon READ GetGroupIcon WRITE SetGroupIcon
  145. DESIGNABLE true)
  146. Q_PROPERTY(QIcon sceneIcon READ GetSceneIcon WRITE SetSceneIcon
  147. DESIGNABLE true)
  148. Q_PROPERTY(QIcon defaultIcon READ GetDefaultIcon WRITE SetDefaultIcon
  149. DESIGNABLE true)
  150. Q_PROPERTY(QIcon audioProcessOutputIcon READ GetAudioProcessOutputIcon
  151. WRITE SetAudioProcessOutputIcon DESIGNABLE true)
  152. friend class OBSAbout;
  153. friend class OBSBasicPreview;
  154. friend class OBSBasicStatusBar;
  155. friend class OBSBasicSourceSelect;
  156. friend class OBSBasicTransform;
  157. friend class OBSBasicSettings;
  158. friend class Auth;
  159. friend class AutoConfig;
  160. friend class AutoConfigStreamPage;
  161. friend class RecordButton;
  162. friend class ControlsSplitButton;
  163. friend class ExtraBrowsersModel;
  164. friend class ExtraBrowsersDelegate;
  165. friend class DeviceCaptureToolbar;
  166. friend class DeviceToolbarPropertiesThread;
  167. friend class OBSBasicSourceSelect;
  168. friend class OBSYoutubeActions;
  169. friend class OBSPermissions;
  170. friend struct BasicOutputHandler;
  171. friend struct OBSStudioAPI;
  172. friend class ScreenshotObj;
  173. enum class MoveDir { Up, Down, Left, Right };
  174. enum DropType {
  175. DropType_RawText,
  176. DropType_Text,
  177. DropType_Image,
  178. DropType_Media,
  179. DropType_Html,
  180. DropType_Url,
  181. };
  182. enum ContextBarSize {
  183. ContextBarSize_Minimized,
  184. ContextBarSize_Reduced,
  185. ContextBarSize_Normal
  186. };
  187. enum class CenterType {
  188. Scene,
  189. Vertical,
  190. Horizontal,
  191. };
  192. private:
  193. obs_frontend_callbacks *api = nullptr;
  194. std::shared_ptr<Auth> auth;
  195. std::vector<VolControl *> volumes;
  196. std::vector<OBSSignal> signalHandlers;
  197. QList<QPointer<QDockWidget>> oldExtraDocks;
  198. bool loaded = false;
  199. long disableSaving = 1;
  200. bool projectChanged = false;
  201. bool previewEnabled = true;
  202. ContextBarSize contextBarSize = ContextBarSize_Normal;
  203. std::deque<SourceCopyInfo> clipboard;
  204. OBSWeakSourceAutoRelease copyFiltersSource;
  205. bool copyVisible = true;
  206. obs_transform_info copiedTransformInfo;
  207. obs_sceneitem_crop copiedCropInfo;
  208. bool hasCopiedTransform = false;
  209. OBSWeakSourceAutoRelease copySourceTransition;
  210. bool closing = false;
  211. bool clearingFailed = false;
  212. QScopedPointer<QThread> devicePropertiesThread;
  213. QScopedPointer<QThread> whatsNewInitThread;
  214. QScopedPointer<QThread> updateCheckThread;
  215. QScopedPointer<QThread> introCheckThread;
  216. QScopedPointer<QThread> logUploadThread;
  217. QPointer<OBSBasicInteraction> interaction;
  218. QPointer<OBSBasicProperties> properties;
  219. QPointer<OBSBasicTransform> transformWindow;
  220. QPointer<OBSBasicAdvAudio> advAudioWindow;
  221. QPointer<OBSBasicFilters> filters;
  222. QPointer<QDockWidget> statsDock;
  223. QPointer<OBSAbout> about;
  224. QPointer<OBSMissingFiles> missDialog;
  225. QPointer<OBSLogViewer> logView;
  226. QPointer<QTimer> cpuUsageTimer;
  227. QPointer<QTimer> diskFullTimer;
  228. QPointer<QTimer> nudge_timer;
  229. bool recent_nudge = false;
  230. os_cpu_usage_info_t *cpuUsageInfo = nullptr;
  231. OBSService service;
  232. std::unique_ptr<BasicOutputHandler> outputHandler;
  233. bool streamingStopping = false;
  234. bool recordingStopping = false;
  235. bool replayBufferStopping = false;
  236. gs_vertbuffer_t *box = nullptr;
  237. gs_vertbuffer_t *boxLeft = nullptr;
  238. gs_vertbuffer_t *boxTop = nullptr;
  239. gs_vertbuffer_t *boxRight = nullptr;
  240. gs_vertbuffer_t *boxBottom = nullptr;
  241. gs_vertbuffer_t *circle = nullptr;
  242. gs_vertbuffer_t *actionSafeMargin = nullptr;
  243. gs_vertbuffer_t *graphicsSafeMargin = nullptr;
  244. gs_vertbuffer_t *fourByThreeSafeMargin = nullptr;
  245. gs_vertbuffer_t *leftLine = nullptr;
  246. gs_vertbuffer_t *topLine = nullptr;
  247. gs_vertbuffer_t *rightLine = nullptr;
  248. int previewX = 0, previewY = 0;
  249. int previewCX = 0, previewCY = 0;
  250. float previewScale = 0.0f;
  251. ConfigFile basicConfig;
  252. std::vector<SavedProjectorInfo *> savedProjectorsArray;
  253. std::vector<OBSProjector *> projectors;
  254. QPointer<QWidget> stats;
  255. QPointer<QWidget> remux;
  256. QPointer<QWidget> extraBrowsers;
  257. QPointer<QWidget> importer;
  258. QPointer<QMenu> startStreamMenu;
  259. QPointer<QPushButton> transitionButton;
  260. QPointer<ControlsSplitButton> replayBufferButton;
  261. QScopedPointer<QPushButton> pause;
  262. QPointer<ControlsSplitButton> vcamButton;
  263. bool vcamEnabled = false;
  264. VCamConfig vcamConfig;
  265. QScopedPointer<QSystemTrayIcon> trayIcon;
  266. QPointer<QAction> sysTrayStream;
  267. QPointer<QAction> sysTrayRecord;
  268. QPointer<QAction> sysTrayReplayBuffer;
  269. QPointer<QAction> sysTrayVirtualCam;
  270. QPointer<QAction> showHide;
  271. QPointer<QAction> exit;
  272. QPointer<QMenu> trayMenu;
  273. QPointer<QMenu> previewProjector;
  274. QPointer<QMenu> studioProgramProjector;
  275. QPointer<QMenu> previewProjectorSource;
  276. QPointer<QMenu> previewProjectorMain;
  277. QPointer<QMenu> sceneProjectorMenu;
  278. QPointer<QMenu> sourceProjector;
  279. QPointer<QMenu> scaleFilteringMenu;
  280. QPointer<QMenu> blendingMethodMenu;
  281. QPointer<QMenu> blendingModeMenu;
  282. QPointer<QMenu> colorMenu;
  283. QPointer<QWidgetAction> colorWidgetAction;
  284. QPointer<ColorSelect> colorSelect;
  285. QPointer<QMenu> deinterlaceMenu;
  286. QPointer<QMenu> perSceneTransitionMenu;
  287. QPointer<QObject> shortcutFilter;
  288. QPointer<QAction> renameScene;
  289. QPointer<QAction> renameSource;
  290. QPointer<QWidget> programWidget;
  291. QPointer<QVBoxLayout> programLayout;
  292. QPointer<QLabel> programLabel;
  293. QScopedPointer<QThread> patronJsonThread;
  294. std::string patronJson;
  295. std::atomic<obs_scene_t *> currentScene = nullptr;
  296. void UpdateMultiviewProjectorMenu();
  297. void DrawBackdrop(float cx, float cy);
  298. void SetupEncoders();
  299. void CreateFirstRunSources();
  300. void CreateDefaultScene(bool firstStart);
  301. void UpdateVolumeControlsDecayRate();
  302. void UpdateVolumeControlsPeakMeterType();
  303. void ClearVolumeControls();
  304. void UploadLog(const char *subdir, const char *file, const bool crash);
  305. void Save(const char *file);
  306. void LoadData(obs_data_t *data, const char *file);
  307. void Load(const char *file);
  308. void InitHotkeys();
  309. void CreateHotkeys();
  310. void ClearHotkeys();
  311. bool InitService();
  312. bool InitBasicConfigDefaults();
  313. void InitBasicConfigDefaults2();
  314. bool InitBasicConfig();
  315. void InitOBSCallbacks();
  316. void InitPrimitives();
  317. void OnFirstLoad();
  318. OBSSceneItem GetSceneItem(QListWidgetItem *item);
  319. OBSSceneItem GetCurrentSceneItem();
  320. bool QueryRemoveSource(obs_source_t *source);
  321. void TimedCheckForUpdates();
  322. void CheckForUpdates(bool manualUpdate);
  323. void GetFPSCommon(uint32_t &num, uint32_t &den) const;
  324. void GetFPSInteger(uint32_t &num, uint32_t &den) const;
  325. void GetFPSFraction(uint32_t &num, uint32_t &den) const;
  326. void GetFPSNanoseconds(uint32_t &num, uint32_t &den) const;
  327. void GetConfigFPS(uint32_t &num, uint32_t &den) const;
  328. void UpdatePreviewScalingMenu();
  329. void LoadSceneListOrder(obs_data_array_t *array);
  330. obs_data_array_t *SaveSceneListOrder();
  331. void ChangeSceneIndex(bool relative, int idx, int invalidIdx);
  332. void TempFileOutput(const char *path, int vBitrate, int aBitrate);
  333. void TempStreamOutput(const char *url, const char *key, int vBitrate,
  334. int aBitrate);
  335. void CloseDialogs();
  336. void ClearSceneData();
  337. void ClearProjectors();
  338. void Nudge(int dist, MoveDir dir);
  339. OBSProjector *OpenProjector(obs_source_t *source, int monitor,
  340. ProjectorType type);
  341. void GetAudioSourceFilters();
  342. void GetAudioSourceProperties();
  343. void VolControlContextMenu();
  344. void ToggleVolControlLayout();
  345. void ToggleMixerLayout(bool vertical);
  346. void RefreshSceneCollections();
  347. void ChangeSceneCollection();
  348. void LogScenes();
  349. void ResetProfileData();
  350. bool AddProfile(bool create_new, const char *title, const char *text,
  351. const char *init_text = nullptr, bool rename = false);
  352. bool CreateProfile(const std::string &newName, bool create_new,
  353. bool showWizardChecked, bool rename = false);
  354. void DeleteProfile(const char *profile_name, const char *profile_dir);
  355. void RefreshProfiles();
  356. void ChangeProfile();
  357. void CheckForSimpleModeX264Fallback();
  358. void SaveProjectNow();
  359. int GetTopSelectedSourceItem();
  360. QModelIndexList GetAllSelectedSourceItems();
  361. obs_hotkey_pair_id streamingHotkeys, recordingHotkeys, pauseHotkeys,
  362. replayBufHotkeys, vcamHotkeys, togglePreviewHotkeys,
  363. contextBarHotkeys;
  364. obs_hotkey_id forceStreamingStopHotkey, splitFileHotkey;
  365. void InitDefaultTransitions();
  366. void InitTransition(obs_source_t *transition);
  367. obs_source_t *FindTransition(const char *name);
  368. OBSSource GetCurrentTransition();
  369. obs_data_array_t *SaveTransitions();
  370. void LoadTransitions(obs_data_array_t *transitions,
  371. obs_load_source_cb cb, void *private_data);
  372. obs_source_t *fadeTransition;
  373. obs_source_t *cutTransition;
  374. void CreateProgramDisplay();
  375. void CreateProgramOptions();
  376. void AddQuickTransitionId(int id);
  377. void AddQuickTransition();
  378. void AddQuickTransitionHotkey(QuickTransition *qt);
  379. void RemoveQuickTransitionHotkey(QuickTransition *qt);
  380. void LoadQuickTransitions(obs_data_array_t *array);
  381. obs_data_array_t *SaveQuickTransitions();
  382. void ClearQuickTransitionWidgets();
  383. void RefreshQuickTransitions();
  384. void DisableQuickTransitionWidgets();
  385. void EnableTransitionWidgets(bool enable);
  386. void CreateDefaultQuickTransitions();
  387. void PasteShowHideTransition(obs_sceneitem_t *item, bool show,
  388. obs_source_t *tr);
  389. QMenu *CreatePerSceneTransitionMenu();
  390. QMenu *CreateVisibilityTransitionMenu(bool visible);
  391. QuickTransition *GetQuickTransition(int id);
  392. int GetQuickTransitionIdx(int id);
  393. QMenu *CreateTransitionMenu(QWidget *parent, QuickTransition *qt);
  394. void ClearQuickTransitions();
  395. void QuickTransitionClicked();
  396. void QuickTransitionChange();
  397. void QuickTransitionChangeDuration(int value);
  398. void QuickTransitionRemoveClicked();
  399. void SetPreviewProgramMode(bool enabled);
  400. void ResizeProgram(uint32_t cx, uint32_t cy);
  401. void SetCurrentScene(obs_scene_t *scene, bool force = false);
  402. static void RenderProgram(void *data, uint32_t cx, uint32_t cy);
  403. std::vector<QuickTransition> quickTransitions;
  404. QPointer<QWidget> programOptions;
  405. QPointer<OBSQTDisplay> program;
  406. OBSWeakSource lastScene;
  407. OBSWeakSource swapScene;
  408. OBSWeakSource programScene;
  409. OBSWeakSource lastProgramScene;
  410. bool editPropertiesMode = false;
  411. bool sceneDuplicationMode = true;
  412. bool swapScenesMode = true;
  413. volatile bool previewProgramMode = false;
  414. obs_hotkey_id togglePreviewProgramHotkey = 0;
  415. obs_hotkey_id transitionHotkey = 0;
  416. obs_hotkey_id statsHotkey = 0;
  417. obs_hotkey_id screenshotHotkey = 0;
  418. obs_hotkey_id sourceScreenshotHotkey = 0;
  419. int quickTransitionIdCounter = 1;
  420. bool overridingTransition = false;
  421. int programX = 0, programY = 0;
  422. int programCX = 0, programCY = 0;
  423. float programScale = 0.0f;
  424. int disableOutputsRef = 0;
  425. inline void OnActivate(bool force = false);
  426. inline void OnDeactivate();
  427. void AddDropSource(const char *file, DropType image);
  428. void AddDropURL(const char *url, QString &name, obs_data_t *settings,
  429. const obs_video_info &ovi);
  430. void ConfirmDropUrl(const QString &url);
  431. void dragEnterEvent(QDragEnterEvent *event) override;
  432. void dragLeaveEvent(QDragLeaveEvent *event) override;
  433. void dragMoveEvent(QDragMoveEvent *event) override;
  434. void dropEvent(QDropEvent *event) override;
  435. void ReplayBufferClicked();
  436. bool sysTrayMinimizeToTray();
  437. void EnumDialogs();
  438. QList<QDialog *> visDialogs;
  439. QList<QDialog *> modalDialogs;
  440. QList<QMessageBox *> visMsgBoxes;
  441. QList<QPoint> visDlgPositions;
  442. QByteArray startingDockLayout;
  443. obs_data_array_t *SaveProjectors();
  444. void LoadSavedProjectors(obs_data_array_t *savedProjectors);
  445. void MacBranchesFetched(const QString &branch, bool manualUpdate);
  446. void ReceivedIntroJson(const QString &text);
  447. void ShowWhatsNew(const QString &url);
  448. void UpdatePreviewProgramIndicators();
  449. QStringList extraDockNames;
  450. QList<QSharedPointer<QDockWidget>> extraDocks;
  451. #ifdef BROWSER_AVAILABLE
  452. QPointer<QAction> extraBrowserMenuDocksSeparator;
  453. QList<QSharedPointer<QDockWidget>> extraBrowserDocks;
  454. QStringList extraBrowserDockTargets;
  455. void ClearExtraBrowserDocks();
  456. void LoadExtraBrowserDocks();
  457. void SaveExtraBrowserDocks();
  458. void ManageExtraBrowserDocks();
  459. void AddExtraBrowserDock(const QString &title, const QString &url,
  460. const QString &uuid, bool firstCreate);
  461. #endif
  462. QIcon imageIcon;
  463. QIcon colorIcon;
  464. QIcon slideshowIcon;
  465. QIcon audioInputIcon;
  466. QIcon audioOutputIcon;
  467. QIcon desktopCapIcon;
  468. QIcon windowCapIcon;
  469. QIcon gameCapIcon;
  470. QIcon cameraIcon;
  471. QIcon textIcon;
  472. QIcon mediaIcon;
  473. QIcon browserIcon;
  474. QIcon groupIcon;
  475. QIcon sceneIcon;
  476. QIcon defaultIcon;
  477. QIcon audioProcessOutputIcon;
  478. QIcon GetImageIcon() const;
  479. QIcon GetColorIcon() const;
  480. QIcon GetSlideshowIcon() const;
  481. QIcon GetAudioInputIcon() const;
  482. QIcon GetAudioOutputIcon() const;
  483. QIcon GetDesktopCapIcon() const;
  484. QIcon GetWindowCapIcon() const;
  485. QIcon GetGameCapIcon() const;
  486. QIcon GetCameraIcon() const;
  487. QIcon GetTextIcon() const;
  488. QIcon GetMediaIcon() const;
  489. QIcon GetBrowserIcon() const;
  490. QIcon GetDefaultIcon() const;
  491. QIcon GetAudioProcessOutputIcon() const;
  492. QSlider *tBar;
  493. bool tBarActive = false;
  494. OBSSource GetOverrideTransition(OBSSource source);
  495. int GetOverrideTransitionDuration(OBSSource source);
  496. void UpdateProjectorHideCursor();
  497. void UpdateProjectorAlwaysOnTop(bool top);
  498. void ResetProjectors();
  499. QPointer<QObject> screenshotData;
  500. void MoveSceneItem(enum obs_order_movement movement,
  501. const QString &action_name);
  502. bool autoStartBroadcast = true;
  503. bool autoStopBroadcast = true;
  504. bool broadcastActive = false;
  505. bool broadcastReady = false;
  506. QPointer<QThread> youtubeStreamCheckThread;
  507. #if YOUTUBE_ENABLED
  508. void YoutubeStreamCheck(const std::string &key);
  509. void ShowYouTubeAutoStartWarning();
  510. void YouTubeActionDialogOk(const QString &id, const QString &key,
  511. bool autostart, bool autostop,
  512. bool start_now);
  513. #endif
  514. void BroadcastButtonClicked();
  515. void SetBroadcastFlowEnabled(bool enabled);
  516. void UpdatePreviewSafeAreas();
  517. bool drawSafeAreas = false;
  518. void CenterSelectedSceneItems(const CenterType &centerType);
  519. void ShowMissingFilesDialog(obs_missing_files_t *files);
  520. QColor selectionColor;
  521. QColor cropColor;
  522. QColor hoverColor;
  523. QColor GetCropColor() const;
  524. QColor GetHoverColor() const;
  525. void UpdatePreviewSpacingHelpers();
  526. bool drawSpacingHelpers = true;
  527. float GetDevicePixelRatio();
  528. void SourceToolBarActionsSetEnabled();
  529. std::string lastScreenshot;
  530. std::string lastReplay;
  531. void UpdatePreviewOverflowSettings();
  532. bool restartingVCam = false;
  533. public slots:
  534. void DeferSaveBegin();
  535. void DeferSaveEnd();
  536. void DisplayStreamStartError();
  537. void SetupBroadcast();
  538. void StartStreaming();
  539. void StopStreaming();
  540. void ForceStopStreaming();
  541. void StreamDelayStarting(int sec);
  542. void StreamDelayStopping(int sec);
  543. void StreamingStart();
  544. void StreamStopping();
  545. void StreamingStop(int errorcode, QString last_error);
  546. void StartRecording();
  547. void StopRecording();
  548. void RecordingStart();
  549. void RecordStopping();
  550. void RecordingStop(int code, QString last_error);
  551. void RecordingFileChanged(QString lastRecordingPath);
  552. void ShowReplayBufferPauseWarning();
  553. void StartReplayBuffer();
  554. void StopReplayBuffer();
  555. void ReplayBufferStart();
  556. void ReplayBufferSave();
  557. void ReplayBufferSaved();
  558. void ReplayBufferStopping();
  559. void ReplayBufferStop(int code);
  560. void StartVirtualCam();
  561. void StopVirtualCam();
  562. void OnVirtualCamStart();
  563. void OnVirtualCamStop(int code);
  564. void SaveProjectDeferred();
  565. void SaveProject();
  566. void SetTransition(OBSSource transition);
  567. void OverrideTransition(OBSSource transition);
  568. void TransitionToScene(OBSScene scene, bool force = false);
  569. void TransitionToScene(OBSSource scene, bool force = false,
  570. bool quickTransition = false,
  571. int quickDuration = 0, bool black = false,
  572. bool manual = false);
  573. void SetCurrentScene(OBSSource scene, bool force = false);
  574. bool AddSceneCollection(bool create_new,
  575. const QString &name = QString());
  576. bool NewProfile(const QString &name);
  577. bool DuplicateProfile(const QString &name);
  578. void DeleteProfile(const QString &profileName);
  579. void UpdatePatronJson(const QString &text, const QString &error);
  580. void ShowContextBar();
  581. void HideContextBar();
  582. void PauseRecording();
  583. void UnpauseRecording();
  584. private slots:
  585. void on_actionMainUndo_triggered();
  586. void on_actionMainRedo_triggered();
  587. void AddSceneItem(OBSSceneItem item);
  588. void AddScene(OBSSource source);
  589. void RemoveScene(OBSSource source);
  590. void RenameSources(OBSSource source, QString newName, QString prevName);
  591. void ActivateAudioSource(OBSSource source);
  592. void DeactivateAudioSource(OBSSource source);
  593. void DuplicateSelectedScene();
  594. void RemoveSelectedScene();
  595. void ToggleAlwaysOnTop();
  596. void ReorderSources(OBSScene scene);
  597. void RefreshSources(OBSScene scene);
  598. void ProcessHotkey(obs_hotkey_id id, bool pressed);
  599. void AddTransition();
  600. void RenameTransition();
  601. void TransitionClicked();
  602. void TransitionStopped();
  603. void TransitionFullyStopped();
  604. void TriggerQuickTransition(int id);
  605. void SetDeinterlacingMode();
  606. void SetDeinterlacingOrder();
  607. void SetScaleFilter();
  608. void SetBlendingMethod();
  609. void SetBlendingMode();
  610. void IconActivated(QSystemTrayIcon::ActivationReason reason);
  611. void SetShowing(bool showing);
  612. void ToggleShowHide();
  613. void HideAudioControl();
  614. void UnhideAllAudioControls();
  615. void ToggleHideMixer();
  616. void MixerRenameSource();
  617. void on_vMixerScrollArea_customContextMenuRequested();
  618. void on_hMixerScrollArea_customContextMenuRequested();
  619. void on_actionCopySource_triggered();
  620. void on_actionPasteRef_triggered();
  621. void on_actionPasteDup_triggered();
  622. void on_actionCopyFilters_triggered();
  623. void on_actionPasteFilters_triggered();
  624. void ColorChange();
  625. SourceTreeItem *GetItemWidgetFromSceneItem(obs_sceneitem_t *sceneItem);
  626. void on_actionShowAbout_triggered();
  627. void AudioMixerCopyFilters();
  628. void AudioMixerPasteFilters();
  629. void EnablePreview();
  630. void DisablePreview();
  631. void SceneCopyFilters();
  632. void ScenePasteFilters();
  633. void CheckDiskSpaceRemaining();
  634. void OpenSavedProjector(SavedProjectorInfo *info);
  635. void ScenesReordered();
  636. void ResetStatsHotkey();
  637. void SetImageIcon(const QIcon &icon);
  638. void SetColorIcon(const QIcon &icon);
  639. void SetSlideshowIcon(const QIcon &icon);
  640. void SetAudioInputIcon(const QIcon &icon);
  641. void SetAudioOutputIcon(const QIcon &icon);
  642. void SetDesktopCapIcon(const QIcon &icon);
  643. void SetWindowCapIcon(const QIcon &icon);
  644. void SetGameCapIcon(const QIcon &icon);
  645. void SetCameraIcon(const QIcon &icon);
  646. void SetTextIcon(const QIcon &icon);
  647. void SetMediaIcon(const QIcon &icon);
  648. void SetBrowserIcon(const QIcon &icon);
  649. void SetGroupIcon(const QIcon &icon);
  650. void SetSceneIcon(const QIcon &icon);
  651. void SetDefaultIcon(const QIcon &icon);
  652. void SetAudioProcessOutputIcon(const QIcon &icon);
  653. void TBarChanged(int value);
  654. void TBarReleased();
  655. void LockVolumeControl(bool lock);
  656. void ResetProxyStyleSliders();
  657. void UpdateVirtualCamConfig(const VCamConfig &config);
  658. void RestartVirtualCam(const VCamConfig &config);
  659. void RestartingVirtualCam();
  660. private:
  661. /* OBS Callbacks */
  662. static void SceneReordered(void *data, calldata_t *params);
  663. static void SceneRefreshed(void *data, calldata_t *params);
  664. static void SceneItemAdded(void *data, calldata_t *params);
  665. static void SourceCreated(void *data, calldata_t *params);
  666. static void SourceRemoved(void *data, calldata_t *params);
  667. static void SourceActivated(void *data, calldata_t *params);
  668. static void SourceDeactivated(void *data, calldata_t *params);
  669. static void SourceAudioActivated(void *data, calldata_t *params);
  670. static void SourceAudioDeactivated(void *data, calldata_t *params);
  671. static void SourceRenamed(void *data, calldata_t *params);
  672. static void RenderMain(void *data, uint32_t cx, uint32_t cy);
  673. void ResizePreview(uint32_t cx, uint32_t cy);
  674. void AddSource(const char *id);
  675. QMenu *CreateAddSourcePopupMenu();
  676. void AddSourcePopupMenu(const QPoint &pos);
  677. void copyActionsDynamicProperties();
  678. static void HotkeyTriggered(void *data, obs_hotkey_id id, bool pressed);
  679. void AutoRemux(QString input, bool no_show = false);
  680. void UpdatePause(bool activate = true);
  681. void UpdateReplayBuffer(bool activate = true);
  682. bool OutputPathValid();
  683. void OutputPathInvalidMessage();
  684. bool LowDiskSpace();
  685. void DiskSpaceMessage();
  686. OBSSource prevFTBSource = nullptr;
  687. float dpi = 1.0;
  688. public:
  689. OBSSource GetProgramSource();
  690. OBSScene GetCurrentScene();
  691. void SysTrayNotify(const QString &text, QSystemTrayIcon::MessageIcon n);
  692. inline OBSSource GetCurrentSceneSource()
  693. {
  694. OBSScene curScene = GetCurrentScene();
  695. return OBSSource(obs_scene_get_source(curScene));
  696. }
  697. obs_service_t *GetService();
  698. void SetService(obs_service_t *service);
  699. int GetTransitionDuration();
  700. int GetTbarPosition();
  701. inline bool IsPreviewProgramMode() const
  702. {
  703. return os_atomic_load_bool(&previewProgramMode);
  704. }
  705. inline bool VCamEnabled() const { return vcamEnabled; }
  706. bool Active() const;
  707. void ResetUI();
  708. int ResetVideo();
  709. bool ResetAudio();
  710. void AddVCamButton();
  711. void ResetOutputs();
  712. void RefreshVolumeColors();
  713. void ResetAudioDevice(const char *sourceId, const char *deviceId,
  714. const char *deviceDesc, int channel);
  715. void NewProject();
  716. void LoadProject();
  717. inline void GetDisplayRect(int &x, int &y, int &cx, int &cy)
  718. {
  719. x = previewX;
  720. y = previewY;
  721. cx = previewCX;
  722. cy = previewCY;
  723. }
  724. inline bool SavingDisabled() const { return disableSaving; }
  725. inline double GetCPUUsage() const
  726. {
  727. return os_cpu_usage_info_query(cpuUsageInfo);
  728. }
  729. void SaveService();
  730. bool LoadService();
  731. inline Auth *GetAuth() { return auth.get(); }
  732. inline void EnableOutputs(bool enable)
  733. {
  734. if (enable) {
  735. if (--disableOutputsRef < 0)
  736. disableOutputsRef = 0;
  737. } else {
  738. disableOutputsRef++;
  739. }
  740. }
  741. QMenu *AddDeinterlacingMenu(QMenu *menu, obs_source_t *source);
  742. QMenu *AddScaleFilteringMenu(QMenu *menu, obs_sceneitem_t *item);
  743. QMenu *AddBlendingMethodMenu(QMenu *menu, obs_sceneitem_t *item);
  744. QMenu *AddBlendingModeMenu(QMenu *menu, obs_sceneitem_t *item);
  745. QMenu *AddBackgroundColorMenu(QMenu *menu, QWidgetAction *widgetAction,
  746. ColorSelect *select,
  747. obs_sceneitem_t *item);
  748. void CreateSourcePopupMenu(int idx, bool preview);
  749. void UpdateTitleBar();
  750. void SystemTrayInit();
  751. void SystemTray(bool firstStarted);
  752. void OpenSavedProjectors();
  753. void CreateInteractionWindow(obs_source_t *source);
  754. void CreatePropertiesWindow(obs_source_t *source);
  755. void CreateFiltersWindow(obs_source_t *source);
  756. void CreateEditTransformWindow(obs_sceneitem_t *item);
  757. QAction *AddDockWidget(QDockWidget *dock);
  758. void AddDockWidget(QDockWidget *dock, Qt::DockWidgetArea area,
  759. bool extraBrowser = false);
  760. void RemoveDockWidget(const QString &name);
  761. static OBSBasic *Get();
  762. const char *GetCurrentOutputPath();
  763. void DeleteProjector(OBSProjector *projector);
  764. void AddProjectorMenuMonitors(QMenu *parent, QObject *target,
  765. const char *slot);
  766. QIcon GetSourceIcon(const char *id) const;
  767. QIcon GetGroupIcon() const;
  768. QIcon GetSceneIcon() const;
  769. OBSWeakSource copyFilter;
  770. void ShowStatusBarMessage(const QString &message);
  771. static OBSData
  772. BackupScene(obs_scene_t *scene,
  773. std::vector<obs_source_t *> *sources = nullptr);
  774. void CreateSceneUndoRedoAction(const QString &action_name,
  775. OBSData undo_data, OBSData redo_data);
  776. static inline OBSData
  777. BackupScene(obs_source_t *scene_source,
  778. std::vector<obs_source_t *> *sources = nullptr)
  779. {
  780. obs_scene_t *scene = obs_scene_from_source(scene_source);
  781. return BackupScene(scene, sources);
  782. }
  783. void CreateFilterPasteUndoRedoAction(const QString &text,
  784. obs_source_t *source,
  785. obs_data_array_t *undo_array,
  786. obs_data_array_t *redo_array);
  787. void UpdateEditMenu();
  788. void SetDisplayAffinity(QWindow *window);
  789. QColor GetSelectionColor() const;
  790. protected:
  791. virtual void closeEvent(QCloseEvent *event) override;
  792. #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
  793. virtual bool nativeEvent(const QByteArray &eventType, void *message,
  794. qintptr *result) override;
  795. #else
  796. virtual bool nativeEvent(const QByteArray &eventType, void *message,
  797. long *result) override;
  798. #endif
  799. virtual void changeEvent(QEvent *event) override;
  800. private slots:
  801. void on_actionFullscreenInterface_triggered();
  802. void on_actionShow_Recordings_triggered();
  803. void on_actionRemux_triggered();
  804. void on_action_Settings_triggered();
  805. void on_actionShowMacPermissions_triggered();
  806. void on_actionShowMissingFiles_triggered();
  807. void on_actionAdvAudioProperties_triggered();
  808. void on_actionMixerToolbarAdvAudio_triggered();
  809. void on_actionMixerToolbarMenu_triggered();
  810. void on_actionShowLogs_triggered();
  811. void on_actionUploadCurrentLog_triggered();
  812. void on_actionUploadLastLog_triggered();
  813. void on_actionViewCurrentLog_triggered();
  814. void on_actionCheckForUpdates_triggered();
  815. void on_actionRepair_triggered();
  816. void on_actionShowWhatsNew_triggered();
  817. void on_actionShowCrashLogs_triggered();
  818. void on_actionUploadLastCrashLog_triggered();
  819. void on_actionEditTransform_triggered();
  820. void on_actionCopyTransform_triggered();
  821. void on_actionPasteTransform_triggered();
  822. void on_actionRotate90CW_triggered();
  823. void on_actionRotate90CCW_triggered();
  824. void on_actionRotate180_triggered();
  825. void on_actionFlipHorizontal_triggered();
  826. void on_actionFlipVertical_triggered();
  827. void on_actionFitToScreen_triggered();
  828. void on_actionStretchToScreen_triggered();
  829. void on_actionCenterToScreen_triggered();
  830. void on_actionVerticalCenter_triggered();
  831. void on_actionHorizontalCenter_triggered();
  832. void on_actionSceneFilters_triggered();
  833. void on_OBSBasic_customContextMenuRequested(const QPoint &pos);
  834. void on_scenes_currentItemChanged(QListWidgetItem *current,
  835. QListWidgetItem *prev);
  836. void on_scenes_customContextMenuRequested(const QPoint &pos);
  837. void GridActionClicked();
  838. void on_actionSceneListMode_triggered();
  839. void on_actionSceneGridMode_triggered();
  840. void on_actionAddScene_triggered();
  841. void on_actionRemoveScene_triggered();
  842. void on_actionSceneUp_triggered();
  843. void on_actionSceneDown_triggered();
  844. void on_sources_customContextMenuRequested(const QPoint &pos);
  845. void on_scenes_itemDoubleClicked(QListWidgetItem *item);
  846. void on_actionAddSource_triggered();
  847. void on_actionRemoveSource_triggered();
  848. void on_actionInteract_triggered();
  849. void on_actionSourceProperties_triggered();
  850. void on_actionSourceUp_triggered();
  851. void on_actionSourceDown_triggered();
  852. void on_actionMoveUp_triggered();
  853. void on_actionMoveDown_triggered();
  854. void on_actionMoveToTop_triggered();
  855. void on_actionMoveToBottom_triggered();
  856. void on_actionLockPreview_triggered();
  857. void on_scalingMenu_aboutToShow();
  858. void on_actionScaleWindow_triggered();
  859. void on_actionScaleCanvas_triggered();
  860. void on_actionScaleOutput_triggered();
  861. void on_streamButton_clicked();
  862. void on_recordButton_clicked();
  863. void VCamButtonClicked();
  864. void VCamConfigButtonClicked();
  865. void on_settingsButton_clicked();
  866. void Screenshot(OBSSource source_ = nullptr);
  867. void ScreenshotSelectedSource();
  868. void ScreenshotProgram();
  869. void ScreenshotScene();
  870. void on_actionHelpPortal_triggered();
  871. void on_actionWebsite_triggered();
  872. void on_actionDiscord_triggered();
  873. void on_preview_customContextMenuRequested();
  874. void ProgramViewContextMenuRequested();
  875. void on_previewDisabledWidget_customContextMenuRequested();
  876. void on_actionNewSceneCollection_triggered();
  877. void on_actionDupSceneCollection_triggered();
  878. void on_actionRenameSceneCollection_triggered();
  879. void on_actionRemoveSceneCollection_triggered();
  880. void on_actionImportSceneCollection_triggered();
  881. void on_actionExportSceneCollection_triggered();
  882. void on_actionNewProfile_triggered();
  883. void on_actionDupProfile_triggered();
  884. void on_actionRenameProfile_triggered();
  885. void on_actionRemoveProfile_triggered(bool skipConfirmation = false);
  886. void on_actionImportProfile_triggered();
  887. void on_actionExportProfile_triggered();
  888. void on_actionShowSettingsFolder_triggered();
  889. void on_actionShowProfileFolder_triggered();
  890. void on_actionAlwaysOnTop_triggered();
  891. void on_toggleListboxToolbars_toggled(bool visible);
  892. void on_toggleContextBar_toggled(bool visible);
  893. void on_toggleStatusBar_toggled(bool visible);
  894. void on_toggleSourceIcons_toggled(bool visible);
  895. void on_transitions_currentIndexChanged(int index);
  896. void on_transitionAdd_clicked();
  897. void on_transitionRemove_clicked();
  898. void on_transitionProps_clicked();
  899. void on_transitionDuration_valueChanged();
  900. void ShowTransitionProperties();
  901. void HideTransitionProperties();
  902. void on_modeSwitch_clicked();
  903. // Source Context Buttons
  904. void on_sourcePropertiesButton_clicked();
  905. void on_sourceFiltersButton_clicked();
  906. void on_sourceInteractButton_clicked();
  907. void on_autoConfigure_triggered();
  908. void on_stats_triggered();
  909. void on_resetUI_triggered();
  910. void on_resetDocks_triggered(bool force = false);
  911. void on_lockDocks_toggled(bool lock);
  912. void on_multiviewProjectorWindowed_triggered();
  913. void PauseToggled();
  914. void logUploadFinished(const QString &text, const QString &error);
  915. void crashUploadFinished(const QString &text, const QString &error);
  916. void openLogDialog(const QString &text, const bool crash);
  917. void updateCheckFinished();
  918. void AddSourceFromAction();
  919. void MoveSceneToTop();
  920. void MoveSceneToBottom();
  921. void EditSceneName();
  922. void EditSceneItemName();
  923. void SceneNameEdited(QWidget *editor);
  924. void OpenSceneFilters();
  925. void OpenFilters(OBSSource source = nullptr);
  926. void OpenProperties(OBSSource source = nullptr);
  927. void OpenInteraction(OBSSource source = nullptr);
  928. void OpenEditTransform(OBSSceneItem item = nullptr);
  929. void EnablePreviewDisplay(bool enable);
  930. void TogglePreview();
  931. void OpenStudioProgramProjector();
  932. void OpenPreviewProjector();
  933. void OpenSourceProjector();
  934. void OpenMultiviewProjector();
  935. void OpenSceneProjector();
  936. void OpenStudioProgramWindow();
  937. void OpenPreviewWindow();
  938. void OpenSourceWindow();
  939. void OpenSceneWindow();
  940. void StackedMixerAreaContextMenuRequested();
  941. void ResizeOutputSizeOfSource();
  942. public slots:
  943. void on_actionResetTransform_triggered();
  944. bool StreamingActive();
  945. bool RecordingActive();
  946. bool ReplayBufferActive();
  947. bool VirtualCamActive();
  948. void ClearContextBar();
  949. void UpdateContextBar(bool force = false);
  950. void UpdateContextBarDeferred(bool force = false);
  951. void UpdateContextBarVisibility();
  952. private:
  953. std::unique_ptr<Ui::OBSBasic> ui;
  954. public:
  955. /* `undo_s` needs to be declared after `ui` to prevent an uninitialized
  956. * warning for `ui` while initializing `undo_s`. */
  957. undo_stack undo_s;
  958. explicit OBSBasic(QWidget *parent = 0);
  959. virtual ~OBSBasic();
  960. virtual void OBSInit() override;
  961. virtual config_t *Config() const override;
  962. virtual int GetProfilePath(char *path, size_t size,
  963. const char *file) const override;
  964. static void InitBrowserPanelSafeBlock();
  965. };
  966. class SceneRenameDelegate : public QStyledItemDelegate {
  967. Q_OBJECT
  968. public:
  969. SceneRenameDelegate(QObject *parent);
  970. virtual void setEditorData(QWidget *editor,
  971. const QModelIndex &index) const override;
  972. protected:
  973. virtual bool eventFilter(QObject *editor, QEvent *event) override;
  974. };