window-basic-main.hpp 18.6 KB
Newer Older
1
/******************************************************************************
2
    Copyright (C) 2013-2014 by Hugh Bailey <obs.jim@gmail.com>
3 4 5

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
6
    the Free Software Foundation, either version 2 of the License, or
7 8 9 10 11 12 13 14 15 16 17 18 19
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#pragma once

J
jp9000 已提交
20
#include <QBuffer>
J
jp9000 已提交
21
#include <QAction>
C
cg2121 已提交
22
#include <QSystemTrayIcon>
J
jp9000 已提交
23
#include <obs.hpp>
24
#include <vector>
J
jp9000 已提交
25
#include <memory>
26
#include "window-main.hpp"
J
John Bradley 已提交
27
#include "window-basic-interaction.hpp"
28
#include "window-basic-properties.hpp"
J
jp9000 已提交
29
#include "window-basic-transform.hpp"
J
jp9000 已提交
30
#include "window-basic-adv-audio.hpp"
J
jp9000 已提交
31
#include "window-basic-filters.hpp"
J
jp9000 已提交
32

J
jp9000 已提交
33 34
#include <obs-frontend-internal.hpp>

35
#include <util/platform.h>
36
#include <util/threading.h>
37 38
#include <util/util.hpp>

39 40
#include <QPointer>

41
class QMessageBox;
J
jp9000 已提交
42
class QListWidgetItem;
43
class VolControl;
J
jp9000 已提交
44
class QNetworkReply;
J
jp9000 已提交
45
class OBSBasicStats;
J
jp9000 已提交
46

B
BtbN 已提交
47
#include "ui_OBSBasic.h"
J
jp9000 已提交
48

49 50 51 52 53 54
#define DESKTOP_AUDIO_1 Str("DesktopAudioDevice1")
#define DESKTOP_AUDIO_2 Str("DesktopAudioDevice2")
#define AUX_AUDIO_1     Str("AuxAudioDevice1")
#define AUX_AUDIO_2     Str("AuxAudioDevice2")
#define AUX_AUDIO_3     Str("AuxAudioDevice3")

55 56
#define SIMPLE_ENCODER_X264                    "x264"
#define SIMPLE_ENCODER_X264_LOWCPU             "x264_lowcpu"
57
#define SIMPLE_ENCODER_QSV                     "qsv"
J
jp9000 已提交
58
#define SIMPLE_ENCODER_NVENC                   "nvenc"
59
#define SIMPLE_ENCODER_AMD                     "amd"
60

61 62
#define PREVIEW_EDGE_SIZE 10

J
jp9000 已提交
63 64
struct BasicOutputHandler;

P
Palana 已提交
65 66 67 68 69
enum class QtDataRole {
	OBSRef = Qt::UserRole,
	OBSSignals,
};

70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
struct QuickTransition {
	QPushButton *button = nullptr;
	OBSSource source;
	obs_hotkey_id hotkey = 0;
	int duration = 0;
	int id = 0;

	inline QuickTransition() {}
	inline QuickTransition(OBSSource source_, int duration_, int id_)
		: source   (source_),
		  duration (duration_),
		  id       (id_)
	{}
};

85
class OBSBasic : public OBSMainWindow {
J
jp9000 已提交
86 87
	Q_OBJECT

J
jp9000 已提交
88
	friend class OBSBasicPreview;
J
jp9000 已提交
89
	friend class OBSBasicStatusBar;
J
jp9000 已提交
90
	friend class OBSBasicSourceSelect;
91
	friend class OBSBasicSettings;
J
jp9000 已提交
92
	friend struct OBSStudioAPI;
J
jp9000 已提交
93

94 95 96 97 98 99 100
	enum class MoveDir {
		Up,
		Down,
		Left,
		Right
	};

101 102 103 104 105 106 107
	enum DropType {
		DropType_RawText,
		DropType_Text,
		DropType_Image,
		DropType_Media
	};

J
jp9000 已提交
108
private:
J
jp9000 已提交
109 110
	obs_frontend_callbacks *api = nullptr;

111 112
	std::vector<VolControl*> volumes;

P
Palana 已提交
113 114
	std::vector<OBSSignal> signalHandlers;

C
cg2121 已提交
115 116 117
	std::vector<std::string> projectorArray;
	std::vector<int> previewProjectorArray;

118
	bool loaded = false;
J
jp9000 已提交
119
	long disableSaving = 1;
J
jp9000 已提交
120
	bool projectChanged = false;
121
	bool previewEnabled = true;
122

123 124 125 126
	const char *copyString;
	const char *copyFiltersString;
	bool copyVisible = true;

127 128 129
	QPointer<QThread> updateCheckThread;
	QPointer<QThread> logUploadThread;

J
John Bradley 已提交
130
	QPointer<OBSBasicInteraction> interaction;
131
	QPointer<OBSBasicProperties> properties;
J
jp9000 已提交
132
	QPointer<OBSBasicTransform> transformWindow;
J
jp9000 已提交
133
	QPointer<OBSBasicAdvAudio> advAudioWindow;
J
jp9000 已提交
134
	QPointer<OBSBasicFilters> filters;
135

J
jp9000 已提交
136
	QPointer<QTimer>    cpuUsageTimer;
137
	os_cpu_usage_info_t *cpuUsageInfo = nullptr;
138

139
	OBSService service;
J
jp9000 已提交
140
	std::unique_ptr<BasicOutputHandler> outputHandler;
141 142
	bool streamingStopping = false;
	bool recordingStopping = false;
J
jp9000 已提交
143
	bool replayBufferStopping = false;
J
jp9000 已提交
144

145
	gs_vertbuffer_t *box = nullptr;
146 147 148 149
	gs_vertbuffer_t *boxLeft = nullptr;
	gs_vertbuffer_t *boxTop = nullptr;
	gs_vertbuffer_t *boxRight = nullptr;
	gs_vertbuffer_t *boxBottom = nullptr;
150
	gs_vertbuffer_t *circle = nullptr;
J
jp9000 已提交
151

J
jp9000 已提交
152
	bool          sceneChanging = false;
153
	bool          ignoreSelectionUpdate = false;
154

J
jp9000 已提交
155 156 157
	int           previewX = 0,  previewY = 0;
	int           previewCX = 0, previewCY = 0;
	float         previewScale = 0.0f;
J
jp9000 已提交
158

159
	ConfigFile    basicConfig;
160

J
jp9000 已提交
161
	QPointer<QWidget> projectors[10];
C
cg2121 已提交
162
	QList<QPointer<QWidget>> windowProjectors;
J
jp9000 已提交
163

J
jp9000 已提交
164 165
	QPointer<QWidget> stats;

J
jp9000 已提交
166 167
	QPointer<QMenu> startStreamMenu;

J
jp9000 已提交
168 169
	QPointer<QPushButton> replayBufferButton;

170 171 172
	QPointer<QSystemTrayIcon> trayIcon;
	QPointer<QAction>         sysTrayStream;
	QPointer<QAction>         sysTrayRecord;
J
jp9000 已提交
173
	QPointer<QAction>         sysTrayReplayBuffer;
174 175 176
	QPointer<QAction>         showHide;
	QPointer<QAction>         exit;
	QPointer<QMenu>           trayMenu;
C
cg2121 已提交
177

178 179
	void          DrawBackdrop(float cx, float cy);

180 181
	void          SetupEncoders();

182
	void          CreateFirstRunSources();
183
	void          CreateDefaultScene(bool firstStart);
184 185

	void          ClearVolumeControls();
186

J
jp9000 已提交
187 188
	void          UploadLog(const char *file);

189 190 191
	void          Save(const char *file);
	void          Load(const char *file);

P
Palana 已提交
192
	void          InitHotkeys();
193
	void          CreateHotkeys();
J
jp9000 已提交
194
	void          ClearHotkeys();
P
Palana 已提交
195

196 197 198 199 200
	bool          InitService();

	bool          InitBasicConfigDefaults();
	bool          InitBasicConfig();

201 202
	void          InitOBSCallbacks();

J
jp9000 已提交
203 204
	void          InitPrimitives();

205
	OBSSceneItem  GetSceneItem(QListWidgetItem *item);
206 207
	OBSSceneItem  GetCurrentSceneItem();

208
	bool          QueryRemoveSource(obs_source_t *source);
209

J
jp9000 已提交
210
	void          TimedCheckForUpdates();
J
jp9000 已提交
211
	void          CheckForUpdates(bool manualUpdate);
J
jp9000 已提交
212

213 214 215 216 217 218
	void GetFPSCommon(uint32_t &num, uint32_t &den) const;
	void GetFPSInteger(uint32_t &num, uint32_t &den) const;
	void GetFPSFraction(uint32_t &num, uint32_t &den) const;
	void GetFPSNanoseconds(uint32_t &num, uint32_t &den) const;
	void GetConfigFPS(uint32_t &num, uint32_t &den) const;

J
Joseph El-Khouri 已提交
219 220
	void UpdatePreviewScalingMenu();

221
	void UpdateSources(OBSScene scene);
222
	void InsertSceneItem(obs_sceneitem_t *item);
223

J
jp9000 已提交
224 225 226 227
	void LoadSceneListOrder(obs_data_array_t *array);
	obs_data_array_t *SaveSceneListOrder();
	void ChangeSceneIndex(bool relative, int idx, int invalidIdx);

J
jp9000 已提交
228 229 230 231
	void TempFileOutput(const char *path, int vBitrate, int aBitrate);
	void TempStreamOutput(const char *url, const char *key,
			int vBitrate, int aBitrate);

232 233
	void CreateInteractionWindow(obs_source_t *source);
	void CreatePropertiesWindow(obs_source_t *source);
J
jp9000 已提交
234
	void CreateFiltersWindow(obs_source_t *source);
235

236 237 238
	void CloseDialogs();
	void ClearSceneData();

239
	void Nudge(int dist, MoveDir dir);
C
cg2121 已提交
240 241
	void OpenProjector(obs_source_t *source, int monitor, bool window,
			QString title = nullptr);
242

243 244 245 246
	void GetAudioSourceFilters();
	void GetAudioSourceProperties();
	void VolControlContextMenu();

J
jp9000 已提交
247 248 249
	void AddSceneCollection(bool create_new);
	void RefreshSceneCollections();
	void ChangeSceneCollection();
250
	void LogScenes();
J
jp9000 已提交
251

J
jp9000 已提交
252 253 254 255 256 257 258 259
	void LoadProfile();
	void ResetProfileData();
	bool AddProfile(bool create_new, const char *title, const char *text,
			const char *init_text = nullptr);
	void DeleteProfile(const char *profile_name, const char *profile_dir);
	void RefreshProfiles();
	void ChangeProfile();

J
jp9000 已提交
260 261
	void SaveProjectNow();

262 263
	QListWidgetItem *GetTopSelectedSourceItem();

J
jp9000 已提交
264 265
	obs_hotkey_pair_id streamingHotkeys, recordingHotkeys,
	                   replayBufHotkeys;
J
jp9000 已提交
266
	obs_hotkey_id forceStreamingStopHotkey;
267

268 269 270 271
	void InitDefaultTransitions();
	void InitTransition(obs_source_t *transition);
	obs_source_t *FindTransition(const char *name);
	OBSSource GetCurrentTransition();
J
jp9000 已提交
272 273
	obs_data_array_t *SaveTransitions();
	void LoadTransitions(obs_data_array_t *transitions);
274 275 276 277 278 279 280 281 282 283 284

	obs_source_t *fadeTransition;

	void CreateProgramDisplay();
	void CreateProgramOptions();
	void AddQuickTransitionId(int id);
	void AddQuickTransition();
	void AddQuickTransitionHotkey(QuickTransition *qt);
	void RemoveQuickTransitionHotkey(QuickTransition *qt);
	void LoadQuickTransitions(obs_data_array_t *array);
	obs_data_array_t *SaveQuickTransitions();
285
	void ClearQuickTransitionWidgets();
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320
	void RefreshQuickTransitions();
	void CreateDefaultQuickTransitions();

	QuickTransition *GetQuickTransition(int id);
	int GetQuickTransitionIdx(int id);
	QMenu *CreateTransitionMenu(QWidget *parent, QuickTransition *qt);
	void ClearQuickTransitions();
	void QuickTransitionClicked();
	void QuickTransitionChange();
	void QuickTransitionChangeDuration(int value);
	void QuickTransitionRemoveClicked();

	void SetPreviewProgramMode(bool enabled);
	void ResizeProgram(uint32_t cx, uint32_t cy);
	void SetCurrentScene(obs_scene_t *scene, bool force = false);
	static void RenderProgram(void *data, uint32_t cx, uint32_t cy);

	std::vector<QuickTransition> quickTransitions;
	QPointer<QWidget> programOptions;
	QPointer<OBSQTDisplay> program;
	OBSWeakSource lastScene;
	OBSWeakSource swapScene;
	OBSWeakSource programScene;
	bool editPropertiesMode = false;
	bool sceneDuplicationMode = true;
	bool swapScenesMode = true;
	volatile bool previewProgramMode = false;
	obs_hotkey_id togglePreviewProgramHotkey = 0;
	obs_hotkey_id transitionHotkey = 0;
	int quickTransitionIdCounter = 1;

	int   programX = 0,  programY = 0;
	int   programCX = 0, programCY = 0;
	float programScale = 0.0f;

321
	int disableOutputsRef = 0;
322

323 324 325 326 327
	inline bool IsPreviewProgramMode() const
	{
		return os_atomic_load_bool(&previewProgramMode);
	}

328 329 330
	inline void OnActivate();
	inline void OnDeactivate();

331
	void AddDropSource(const char *file, DropType image);
J
jp9000 已提交
332 333 334 335 336
	void dragEnterEvent(QDragEnterEvent *event) override;
	void dragLeaveEvent(QDragLeaveEvent *event) override;
	void dragMoveEvent(QDragMoveEvent *event) override;
	void dropEvent(QDropEvent *event) override;

J
jp9000 已提交
337 338
	void ReplayBufferClicked();

339 340
	bool sysTrayMinimizeToTray();

341 342 343 344 345 346 347 348
	void EnumDialogs();

	QList<QDialog*> visDialogs;
	QList<QDialog*> modalDialogs;
	QList<QMessageBox*> visMsgBoxes;

	QList<QPoint> visDlgPositions;

C
cg2121 已提交
349 350 351 352 353 354 355
	obs_data_array_t *SaveProjectors();
	void LoadSavedProjectors(obs_data_array_t *savedProjectors);

	obs_data_array_t *SavePreviewProjectors();
	void LoadSavedPreviewProjectors(
		obs_data_array_t *savedPreviewProjectors);

356
public slots:
357 358
	void StartStreaming();
	void StopStreaming();
J
jp9000 已提交
359 360 361 362
	void ForceStopStreaming();

	void StreamDelayStarting(int sec);
	void StreamDelayStopping(int sec);
363

364
	void StreamingStart();
365
	void StreamStopping();
366
	void StreamingStop(int errorcode, QString last_error);
367

368 369 370
	void StartRecording();
	void StopRecording();

P
Palana 已提交
371
	void RecordingStart();
372
	void RecordStopping();
373
	void RecordingStop(int code);
374

J
jp9000 已提交
375 376 377 378 379 380 381
	void StartReplayBuffer();
	void StopReplayBuffer();

	void ReplayBufferStart();
	void ReplayBufferStopping();
	void ReplayBufferStop(int code);

J
jp9000 已提交
382
	void SaveProjectDeferred();
J
jp9000 已提交
383 384
	void SaveProject();

385 386 387 388 389
	void SetTransition(OBSSource transition);
	void TransitionToScene(OBSScene scene, bool force = false);
	void TransitionToScene(OBSSource scene, bool force = false);
	void SetCurrentScene(OBSSource scene, bool force = false);

390 391 392 393 394
private slots:
	void AddSceneItem(OBSSceneItem item);
	void RemoveSceneItem(OBSSceneItem item);
	void AddScene(OBSSource source);
	void RemoveScene(OBSSource source);
J
jp9000 已提交
395
	void RenameSources(QString newName, QString prevName);
396

397
	void SelectSceneItem(OBSScene scene, OBSSceneItem item, bool select);
J
jp9000 已提交
398

399 400 401
	void ActivateAudioSource(OBSSource source);
	void DeactivateAudioSource(OBSSource source);

402
	void DuplicateSelectedScene();
403 404
	void RemoveSelectedScene();
	void RemoveSelectedSceneItem();
J
jp9000 已提交
405

406 407
	void ToggleAlwaysOnTop();

408 409
	void ReorderSources(OBSScene scene);

P
Palana 已提交
410 411
	void ProcessHotkey(obs_hotkey_id id, bool pressed);

J
jp9000 已提交
412 413
	void AddTransition();
	void RenameTransition();
414 415 416 417
	void TransitionClicked();
	void TransitionStopped();
	void TriggerQuickTransition(int id);

J
jp9000 已提交
418 419 420
	void SetDeinterlacingMode();
	void SetDeinterlacingOrder();

421 422
	void SetScaleFilter();

C
cg2121 已提交
423 424 425
	void IconActivated(QSystemTrayIcon::ActivationReason reason);
	void SetShowing(bool showing);

426
	void ToggleShowHide();
C
cg2121 已提交
427

428 429 430 431 432 433 434
	void on_actionCopySource_triggered();
	void on_actionPasteRef_triggered();
	void on_actionPasteDup_triggered();

	void on_actionCopyFilters_triggered();
	void on_actionPasteFilters_triggered();

435
private:
436
	/* OBS Callbacks */
437
	static void SceneReordered(void *data, calldata_t *params);
438 439
	static void SceneItemAdded(void *data, calldata_t *params);
	static void SceneItemRemoved(void *data, calldata_t *params);
440 441
	static void SceneItemSelected(void *data, calldata_t *params);
	static void SceneItemDeselected(void *data, calldata_t *params);
442
	static void SourceLoaded(void *data, obs_source_t *source);
443 444 445 446
	static void SourceRemoved(void *data, calldata_t *params);
	static void SourceActivated(void *data, calldata_t *params);
	static void SourceDeactivated(void *data, calldata_t *params);
	static void SourceRenamed(void *data, calldata_t *params);
447
	static void RenderMain(void *data, uint32_t cx, uint32_t cy);
448

J
jp9000 已提交
449 450
	void ResizePreview(uint32_t cx, uint32_t cy);

J
jp9000 已提交
451
	void AddSource(const char *id);
452
	QMenu *CreateAddSourcePopupMenu();
J
jp9000 已提交
453
	void AddSourcePopupMenu(const QPoint &pos);
S
Socapex 已提交
454
	void copyActionsDynamicProperties();
455

P
Palana 已提交
456 457
	static void HotkeyTriggered(void *data, obs_hotkey_id id, bool pressed);

458
public:
J
jp9000 已提交
459 460
	OBSScene      GetCurrentScene();

C
cg2121 已提交
461 462
	void SysTrayNotify(const QString &text, QSystemTrayIcon::MessageIcon n);

463 464 465 466 467 468
	inline OBSSource GetCurrentSceneSource()
	{
		OBSScene curScene = GetCurrentScene();
		return OBSSource(obs_scene_get_source(curScene));
	}

469 470
	obs_service_t *GetService();
	void          SetService(obs_service_t *service);
471

472 473
	bool StreamingActive() const;
	bool Active() const;
474

475
	int  ResetVideo();
476
	bool ResetAudio();
J
jp9000 已提交
477 478

	void ResetOutputs();
J
jp9000 已提交
479

480
	void ResetAudioDevice(const char *sourceId, const char *deviceId,
481
			const char *deviceDesc, int channel);
J
jp9000 已提交
482

483 484 485
	void NewProject();
	void LoadProject();

J
jp9000 已提交
486 487 488 489 490 491 492 493
	inline void GetDisplayRect(int &x, int &y, int &cx, int &cy)
	{
		x  = previewX;
		y  = previewY;
		cx = previewCX;
		cy = previewCY;
	}

494 495 496 497 498
	inline double GetCPUUsage() const
	{
		return os_cpu_usage_info_query(cpuUsageInfo);
	}

499 500 501
	void SaveService();
	bool LoadService();

502 503
	inline void EnableOutputs(bool enable)
	{
504 505 506 507 508 509
		if (enable) {
			if (--disableOutputsRef < 0)
				disableOutputsRef = 0;
		} else {
			disableOutputsRef++;
		}
510 511
	}

512 513
	void ReorderSceneItem(obs_sceneitem_t *item, size_t idx);

J
jp9000 已提交
514
	QMenu *AddDeinterlacingMenu(obs_source_t *source);
515
	QMenu *AddScaleFilteringMenu(obs_sceneitem_t *item);
J
jp9000 已提交
516 517
	void CreateSourcePopupMenu(QListWidgetItem *item, bool preview);

518
	void UpdateTitleBar();
519
	void UpdateSceneSelection(OBSSource source);
520

C
cg2121 已提交
521 522 523
	void SystemTrayInit();
	void SystemTray(bool firstStarted);

C
cg2121 已提交
524 525 526
	void OpenSavedProjectors();
	void RemoveSavedProjectors(int monitor);

527
protected:
528 529
	virtual void closeEvent(QCloseEvent *event) override;
	virtual void changeEvent(QEvent *event) override;
J
jp9000 已提交
530 531

private slots:
532
	void on_actionShow_Recordings_triggered();
P
Palana 已提交
533
	void on_actionRemux_triggered();
P
Palana 已提交
534
	void on_action_Settings_triggered();
J
jp9000 已提交
535
	void on_actionAdvAudioProperties_triggered();
536
	void on_advAudioProps_clicked();
537
	void on_advAudioProps_destroyed();
P
Palana 已提交
538
	void on_actionShowLogs_triggered();
J
jp9000 已提交
539 540
	void on_actionUploadCurrentLog_triggered();
	void on_actionUploadLastLog_triggered();
541
	void on_actionViewCurrentLog_triggered();
J
jp9000 已提交
542
	void on_actionCheckForUpdates_triggered();
J
jp9000 已提交
543 544

	void on_actionEditTransform_triggered();
545 546
	void on_actionCopyTransform_triggered();
	void on_actionPasteTransform_triggered();
J
jp9000 已提交
547 548 549 550 551 552 553 554 555
	void on_actionRotate90CW_triggered();
	void on_actionRotate90CCW_triggered();
	void on_actionRotate180_triggered();
	void on_actionFlipHorizontal_triggered();
	void on_actionFlipVertical_triggered();
	void on_actionFitToScreen_triggered();
	void on_actionStretchToScreen_triggered();
	void on_actionCenterToScreen_triggered();

556 557
	void on_scenes_currentItemChanged(QListWidgetItem *current,
			QListWidgetItem *prev);
J
jp9000 已提交
558 559 560 561 562
	void on_scenes_customContextMenuRequested(const QPoint &pos);
	void on_actionAddScene_triggered();
	void on_actionRemoveScene_triggered();
	void on_actionSceneUp_triggered();
	void on_actionSceneDown_triggered();
J
jp9000 已提交
563
	void on_sources_itemSelectionChanged();
J
jp9000 已提交
564
	void on_sources_customContextMenuRequested(const QPoint &pos);
P
Palana 已提交
565
	void on_sources_itemDoubleClicked(QListWidgetItem *item);
J
jp9000 已提交
566 567
	void on_actionAddSource_triggered();
	void on_actionRemoveSource_triggered();
J
John Bradley 已提交
568
	void on_actionInteract_triggered();
J
jp9000 已提交
569 570 571
	void on_actionSourceProperties_triggered();
	void on_actionSourceUp_triggered();
	void on_actionSourceDown_triggered();
J
jp9000 已提交
572

J
jp9000 已提交
573 574 575 576 577
	void on_actionMoveUp_triggered();
	void on_actionMoveDown_triggered();
	void on_actionMoveToTop_triggered();
	void on_actionMoveToBottom_triggered();

J
jp9000 已提交
578 579
	void on_actionLockPreview_triggered();

J
Joseph El-Khouri 已提交
580 581 582 583 584
	void on_scalingMenu_aboutToShow();
	void on_actionScaleWindow_triggered();
	void on_actionScaleCanvas_triggered();
	void on_actionScaleOutput_triggered();

585
	void on_streamButton_clicked();
586
	void on_recordButton_clicked();
J
jp9000 已提交
587
	void on_settingsButton_clicked();
588

589 590
	void on_actionWebsite_triggered();

J
jp9000 已提交
591 592 593 594
	void on_preview_customContextMenuRequested(const QPoint &pos);
	void on_previewDisabledLabel_customContextMenuRequested(
			const QPoint &pos);

J
jp9000 已提交
595 596 597 598
	void on_actionNewSceneCollection_triggered();
	void on_actionDupSceneCollection_triggered();
	void on_actionRenameSceneCollection_triggered();
	void on_actionRemoveSceneCollection_triggered();
599 600
	void on_actionImportSceneCollection_triggered();
	void on_actionExportSceneCollection_triggered();
J
jp9000 已提交
601

J
jp9000 已提交
602 603 604 605
	void on_actionNewProfile_triggered();
	void on_actionDupProfile_triggered();
	void on_actionRenameProfile_triggered();
	void on_actionRemoveProfile_triggered();
606 607
	void on_actionImportProfile_triggered();
	void on_actionExportProfile_triggered();
J
jp9000 已提交
608

609 610 611
	void on_actionShowSettingsFolder_triggered();
	void on_actionShowProfileFolder_triggered();

612 613
	void on_actionAlwaysOnTop_triggered();

614 615 616 617
	void on_toggleSceneTransitions_toggled(bool visible);
	void on_toggleListboxToolbars_toggled(bool visible);
	void on_toggleStatusBar_toggled(bool visible);

618
	void on_transitions_currentIndexChanged(int index);
J
jp9000 已提交
619 620
	void on_transitionAdd_clicked();
	void on_transitionRemove_clicked();
621 622 623 624
	void on_transitionProps_clicked();

	void on_modeSwitch_clicked();

J
jp9000 已提交
625
	void on_autoConfigure_triggered();
J
jp9000 已提交
626
	void on_stats_triggered();
J
jp9000 已提交
627

628
	void logUploadFinished(const QString &text, const QString &error);
J
jp9000 已提交
629

J
jp9000 已提交
630
	void updateCheckFinished();
J
jp9000 已提交
631

J
jp9000 已提交
632 633
	void AddSourceFromAction();

J
jp9000 已提交
634 635 636
	void MoveSceneToTop();
	void MoveSceneToBottom();

J
jp9000 已提交
637 638 639
	void EditSceneName();
	void EditSceneItemName();

J
jp9000 已提交
640 641 642 643 644
	void SceneNameEdited(QWidget *editor,
			QAbstractItemDelegate::EndEditHint endHint);
	void SceneItemNameEdited(QWidget *editor,
			QAbstractItemDelegate::EndEditHint endHint);

J
jp9000 已提交
645
	void OpenSceneFilters();
J
jp9000 已提交
646 647
	void OpenFilters();

648
	void EnablePreviewDisplay(bool enable);
J
jp9000 已提交
649 650
	void TogglePreview();

651 652 653 654 655
	void NudgeUp();
	void NudgeDown();
	void NudgeLeft();
	void NudgeRight();

J
jp9000 已提交
656 657 658 659
	void OpenPreviewProjector();
	void OpenSourceProjector();
	void OpenSceneProjector();

C
cg2121 已提交
660 661 662 663
	void OpenPreviewWindow();
	void OpenSourceWindow();
	void OpenSceneWindow();

664 665 666
public slots:
	void on_actionResetTransform_triggered();

667
public:
J
jp9000 已提交
668
	explicit OBSBasic(QWidget *parent = 0);
J
jp9000 已提交
669
	virtual ~OBSBasic();
J
jp9000 已提交
670

671 672
	virtual void OBSInit() override;

673
	virtual config_t *Config() const override;
674

J
jp9000 已提交
675
	virtual int GetProfilePath(char *path, size_t size, const char *file)
P
Palana 已提交
676
		const override;
J
jp9000 已提交
677

J
jp9000 已提交
678 679
private:
	std::unique_ptr<Ui::OBSBasic> ui;
680
};