window-basic-main.hpp 18.7 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
	bool fullscreenInterface = false;
123

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

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

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

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

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

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

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

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

160
	ConfigFile    basicConfig;
161

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

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

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

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

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

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

181 182
	void          SetupEncoders();

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

	void          ClearVolumeControls();
187

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

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

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

197 198 199 200 201
	bool          InitService();

	bool          InitBasicConfigDefaults();
	bool          InitBasicConfig();

202 203
	void          InitOBSCallbacks();

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

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

209
	bool          QueryRemoveSource(obs_source_t *source);
210

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

214 215 216 217 218 219
	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 已提交
220 221
	void UpdatePreviewScalingMenu();

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

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

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

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

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

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

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

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

J
jp9000 已提交
253 254 255 256 257 258 259 260
	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 已提交
261 262
	void SaveProjectNow();

263 264
	QListWidgetItem *GetTopSelectedSourceItem();

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

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

	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();
286
	void ClearQuickTransitionWidgets();
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 321
	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;

322
	int disableOutputsRef = 0;
323

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

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

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

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

340 341
	bool sysTrayMinimizeToTray();

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

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

	QList<QPoint> visDlgPositions;

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

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

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

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

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

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

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

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

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

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

386 387 388 389 390
	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);

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

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

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

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

407 408
	void ToggleAlwaysOnTop();

409 410
	void ReorderSources(OBSScene scene);

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

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

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

422 423
	void SetScaleFilter();

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

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

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

	void on_actionCopyFilters_triggered();
	void on_actionPasteFilters_triggered();

436
private:
437
	/* OBS Callbacks */
438
	static void SceneReordered(void *data, calldata_t *params);
439 440
	static void SceneItemAdded(void *data, calldata_t *params);
	static void SceneItemRemoved(void *data, calldata_t *params);
441 442
	static void SceneItemSelected(void *data, calldata_t *params);
	static void SceneItemDeselected(void *data, calldata_t *params);
443
	static void SourceLoaded(void *data, obs_source_t *source);
444 445 446 447
	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);
448
	static void RenderMain(void *data, uint32_t cx, uint32_t cy);
449

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

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

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

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

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

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

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

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

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

	void ResetOutputs();
J
jp9000 已提交
480

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

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

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

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

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

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

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

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

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

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

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

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

private slots:
533 534
	void on_actionFullscreenInterface_triggered();

535
	void on_actionShow_Recordings_triggered();
P
Palana 已提交
536
	void on_actionRemux_triggered();
P
Palana 已提交
537
	void on_action_Settings_triggered();
J
jp9000 已提交
538
	void on_actionAdvAudioProperties_triggered();
539
	void on_advAudioProps_clicked();
540
	void on_advAudioProps_destroyed();
P
Palana 已提交
541
	void on_actionShowLogs_triggered();
J
jp9000 已提交
542 543
	void on_actionUploadCurrentLog_triggered();
	void on_actionUploadLastLog_triggered();
544
	void on_actionViewCurrentLog_triggered();
J
jp9000 已提交
545
	void on_actionCheckForUpdates_triggered();
J
jp9000 已提交
546 547

	void on_actionEditTransform_triggered();
548 549
	void on_actionCopyTransform_triggered();
	void on_actionPasteTransform_triggered();
J
jp9000 已提交
550 551 552 553 554 555 556 557 558
	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();

559 560
	void on_scenes_currentItemChanged(QListWidgetItem *current,
			QListWidgetItem *prev);
J
jp9000 已提交
561 562 563 564 565
	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 已提交
566
	void on_sources_itemSelectionChanged();
J
jp9000 已提交
567
	void on_sources_customContextMenuRequested(const QPoint &pos);
P
Palana 已提交
568
	void on_sources_itemDoubleClicked(QListWidgetItem *item);
J
jp9000 已提交
569 570
	void on_actionAddSource_triggered();
	void on_actionRemoveSource_triggered();
J
John Bradley 已提交
571
	void on_actionInteract_triggered();
J
jp9000 已提交
572 573 574
	void on_actionSourceProperties_triggered();
	void on_actionSourceUp_triggered();
	void on_actionSourceDown_triggered();
J
jp9000 已提交
575

J
jp9000 已提交
576 577 578 579 580
	void on_actionMoveUp_triggered();
	void on_actionMoveDown_triggered();
	void on_actionMoveToTop_triggered();
	void on_actionMoveToBottom_triggered();

J
jp9000 已提交
581 582
	void on_actionLockPreview_triggered();

J
Joseph El-Khouri 已提交
583 584 585 586 587
	void on_scalingMenu_aboutToShow();
	void on_actionScaleWindow_triggered();
	void on_actionScaleCanvas_triggered();
	void on_actionScaleOutput_triggered();

588
	void on_streamButton_clicked();
589
	void on_recordButton_clicked();
J
jp9000 已提交
590
	void on_settingsButton_clicked();
591

592 593
	void on_actionWebsite_triggered();

J
jp9000 已提交
594 595 596 597
	void on_preview_customContextMenuRequested(const QPoint &pos);
	void on_previewDisabledLabel_customContextMenuRequested(
			const QPoint &pos);

J
jp9000 已提交
598 599 600 601
	void on_actionNewSceneCollection_triggered();
	void on_actionDupSceneCollection_triggered();
	void on_actionRenameSceneCollection_triggered();
	void on_actionRemoveSceneCollection_triggered();
602 603
	void on_actionImportSceneCollection_triggered();
	void on_actionExportSceneCollection_triggered();
J
jp9000 已提交
604

J
jp9000 已提交
605 606 607 608
	void on_actionNewProfile_triggered();
	void on_actionDupProfile_triggered();
	void on_actionRenameProfile_triggered();
	void on_actionRemoveProfile_triggered();
609 610
	void on_actionImportProfile_triggered();
	void on_actionExportProfile_triggered();
J
jp9000 已提交
611

612 613 614
	void on_actionShowSettingsFolder_triggered();
	void on_actionShowProfileFolder_triggered();

615 616
	void on_actionAlwaysOnTop_triggered();

617 618 619 620
	void on_toggleSceneTransitions_toggled(bool visible);
	void on_toggleListboxToolbars_toggled(bool visible);
	void on_toggleStatusBar_toggled(bool visible);

621
	void on_transitions_currentIndexChanged(int index);
J
jp9000 已提交
622 623
	void on_transitionAdd_clicked();
	void on_transitionRemove_clicked();
624 625 626 627
	void on_transitionProps_clicked();

	void on_modeSwitch_clicked();

J
jp9000 已提交
628
	void on_autoConfigure_triggered();
J
jp9000 已提交
629
	void on_stats_triggered();
J
jp9000 已提交
630

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

J
jp9000 已提交
633
	void updateCheckFinished();
J
jp9000 已提交
634

J
jp9000 已提交
635 636
	void AddSourceFromAction();

J
jp9000 已提交
637 638 639
	void MoveSceneToTop();
	void MoveSceneToBottom();

J
jp9000 已提交
640 641 642
	void EditSceneName();
	void EditSceneItemName();

J
jp9000 已提交
643 644 645 646 647
	void SceneNameEdited(QWidget *editor,
			QAbstractItemDelegate::EndEditHint endHint);
	void SceneItemNameEdited(QWidget *editor,
			QAbstractItemDelegate::EndEditHint endHint);

J
jp9000 已提交
648
	void OpenSceneFilters();
J
jp9000 已提交
649 650
	void OpenFilters();

651
	void EnablePreviewDisplay(bool enable);
J
jp9000 已提交
652 653
	void TogglePreview();

654 655 656 657 658
	void NudgeUp();
	void NudgeDown();
	void NudgeLeft();
	void NudgeRight();

J
jp9000 已提交
659 660 661 662
	void OpenPreviewProjector();
	void OpenSourceProjector();
	void OpenSceneProjector();

C
cg2121 已提交
663 664 665 666
	void OpenPreviewWindow();
	void OpenSourceWindow();
	void OpenSceneWindow();

667 668 669
public slots:
	void on_actionResetTransform_triggered();

670
public:
J
jp9000 已提交
671
	explicit OBSBasic(QWidget *parent = 0);
J
jp9000 已提交
672
	virtual ~OBSBasic();
J
jp9000 已提交
673

674 675
	virtual void OBSInit() override;

676
	virtual config_t *Config() const override;
677

J
jp9000 已提交
678
	virtual int GetProfilePath(char *path, size_t size, const char *file)
P
Palana 已提交
679
		const override;
J
jp9000 已提交
680

J
jp9000 已提交
681 682
private:
	std::unique_ptr<Ui::OBSBasic> ui;
683
};