2016-02-23 23:16:51 +00:00
|
|
|
/******************************************************************************
|
|
|
|
Copyright (C) 2013-2014 by Hugh Bailey <obs.jim@gmail.com>
|
|
|
|
|
|
|
|
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
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(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
|
|
|
|
|
|
|
|
#include <QBuffer>
|
|
|
|
#include <QAction>
|
2016-10-10 19:01:40 +00:00
|
|
|
#include <QSystemTrayIcon>
|
2016-02-23 23:16:51 +00:00
|
|
|
#include <obs.hpp>
|
|
|
|
#include <vector>
|
|
|
|
#include <memory>
|
|
|
|
#include "window-main.hpp"
|
|
|
|
#include "window-basic-interaction.hpp"
|
|
|
|
#include "window-basic-properties.hpp"
|
|
|
|
#include "window-basic-transform.hpp"
|
|
|
|
#include "window-basic-adv-audio.hpp"
|
|
|
|
#include "window-basic-filters.hpp"
|
2018-12-16 16:14:58 +00:00
|
|
|
#include "window-projector.hpp"
|
2016-02-23 23:16:51 +00:00
|
|
|
|
2016-10-10 19:01:40 +00:00
|
|
|
#include <obs-frontend-internal.hpp>
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
#include <util/platform.h>
|
|
|
|
#include <util/threading.h>
|
|
|
|
#include <util/util.hpp>
|
|
|
|
|
|
|
|
#include <QPointer>
|
|
|
|
|
2017-04-19 19:54:15 +00:00
|
|
|
class QMessageBox;
|
2016-02-23 23:16:51 +00:00
|
|
|
class QListWidgetItem;
|
|
|
|
class VolControl;
|
2017-06-29 19:01:10 +00:00
|
|
|
class OBSBasicStats;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
#include "ui_OBSBasic.h"
|
2018-12-16 16:14:58 +00:00
|
|
|
#include "ui_ColorSelect.h"
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
#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")
|
|
|
|
|
|
|
|
#define SIMPLE_ENCODER_X264 "x264"
|
|
|
|
#define SIMPLE_ENCODER_X264_LOWCPU "x264_lowcpu"
|
2016-05-24 19:53:01 +00:00
|
|
|
#define SIMPLE_ENCODER_QSV "qsv"
|
|
|
|
#define SIMPLE_ENCODER_NVENC "nvenc"
|
2016-10-10 19:01:40 +00:00
|
|
|
#define SIMPLE_ENCODER_AMD "amd"
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
#define PREVIEW_EDGE_SIZE 10
|
|
|
|
|
|
|
|
struct BasicOutputHandler;
|
|
|
|
|
|
|
|
enum class QtDataRole {
|
|
|
|
OBSRef = Qt::UserRole,
|
|
|
|
OBSSignals,
|
|
|
|
};
|
|
|
|
|
2018-12-16 16:14:58 +00:00
|
|
|
struct SavedProjectorInfo {
|
|
|
|
ProjectorType type;
|
|
|
|
int monitor;
|
|
|
|
std::string geometry;
|
|
|
|
std::string name;
|
2018-02-19 19:54:37 +00:00
|
|
|
};
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
struct QuickTransition {
|
|
|
|
QPushButton *button = nullptr;
|
|
|
|
OBSSource source;
|
2018-12-16 16:14:58 +00:00
|
|
|
obs_hotkey_id hotkey = OBS_INVALID_HOTKEY_ID;
|
2016-02-23 23:16:51 +00:00
|
|
|
int duration = 0;
|
|
|
|
int id = 0;
|
|
|
|
|
|
|
|
inline QuickTransition() {}
|
|
|
|
inline QuickTransition(OBSSource source_, int duration_, int id_)
|
2018-12-16 16:14:58 +00:00
|
|
|
: source (source_),
|
|
|
|
duration (duration_),
|
|
|
|
id (id_),
|
|
|
|
renamedSignal (std::make_shared<OBSSignal>(
|
|
|
|
obs_source_get_signal_handler(source),
|
|
|
|
"rename", SourceRenamed, this))
|
2016-02-23 23:16:51 +00:00
|
|
|
{}
|
2018-12-16 16:14:58 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
static void SourceRenamed(void *param, calldata_t *data);
|
|
|
|
std::shared_ptr<OBSSignal> renamedSignal;
|
2016-02-23 23:16:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class OBSBasic : public OBSMainWindow {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
friend class OBSBasicPreview;
|
|
|
|
friend class OBSBasicStatusBar;
|
2016-08-28 12:07:43 +00:00
|
|
|
friend class OBSBasicSourceSelect;
|
2017-04-19 19:54:15 +00:00
|
|
|
friend class OBSBasicSettings;
|
2016-10-10 19:01:40 +00:00
|
|
|
friend struct OBSStudioAPI;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
enum class MoveDir {
|
|
|
|
Up,
|
|
|
|
Down,
|
|
|
|
Left,
|
|
|
|
Right
|
|
|
|
};
|
|
|
|
|
2017-04-19 19:54:15 +00:00
|
|
|
enum DropType {
|
|
|
|
DropType_RawText,
|
|
|
|
DropType_Text,
|
|
|
|
DropType_Image,
|
2018-02-19 19:54:37 +00:00
|
|
|
DropType_Media,
|
|
|
|
DropType_Html
|
2017-04-19 19:54:15 +00:00
|
|
|
};
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
private:
|
2016-10-10 19:01:40 +00:00
|
|
|
obs_frontend_callbacks *api = nullptr;
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
std::vector<VolControl*> volumes;
|
|
|
|
|
|
|
|
std::vector<OBSSignal> signalHandlers;
|
|
|
|
|
|
|
|
bool loaded = false;
|
|
|
|
long disableSaving = 1;
|
|
|
|
bool projectChanged = false;
|
|
|
|
bool previewEnabled = true;
|
2018-02-19 19:54:37 +00:00
|
|
|
bool fullscreenInterface = false;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
2017-06-29 19:01:10 +00:00
|
|
|
const char *copyString;
|
|
|
|
const char *copyFiltersString;
|
|
|
|
bool copyVisible = true;
|
|
|
|
|
2018-12-16 16:14:58 +00:00
|
|
|
QScopedPointer<QThread> updateCheckThread;
|
|
|
|
QScopedPointer<QThread> introCheckThread;
|
|
|
|
QScopedPointer<QThread> logUploadThread;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
QPointer<OBSBasicInteraction> interaction;
|
|
|
|
QPointer<OBSBasicProperties> properties;
|
|
|
|
QPointer<OBSBasicTransform> transformWindow;
|
|
|
|
QPointer<OBSBasicAdvAudio> advAudioWindow;
|
|
|
|
QPointer<OBSBasicFilters> filters;
|
|
|
|
|
|
|
|
QPointer<QTimer> cpuUsageTimer;
|
|
|
|
os_cpu_usage_info_t *cpuUsageInfo = nullptr;
|
|
|
|
|
|
|
|
OBSService service;
|
|
|
|
std::unique_ptr<BasicOutputHandler> outputHandler;
|
2016-10-10 19:01:40 +00:00
|
|
|
bool streamingStopping = false;
|
|
|
|
bool recordingStopping = false;
|
2017-04-19 19:54:15 +00:00
|
|
|
bool replayBufferStopping = false;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
gs_vertbuffer_t *box = nullptr;
|
2016-05-24 19:53:01 +00:00
|
|
|
gs_vertbuffer_t *boxLeft = nullptr;
|
|
|
|
gs_vertbuffer_t *boxTop = nullptr;
|
|
|
|
gs_vertbuffer_t *boxRight = nullptr;
|
|
|
|
gs_vertbuffer_t *boxBottom = nullptr;
|
2016-02-23 23:16:51 +00:00
|
|
|
gs_vertbuffer_t *circle = nullptr;
|
|
|
|
|
|
|
|
bool sceneChanging = false;
|
|
|
|
bool ignoreSelectionUpdate = false;
|
|
|
|
|
|
|
|
int previewX = 0, previewY = 0;
|
|
|
|
int previewCX = 0, previewCY = 0;
|
|
|
|
float previewScale = 0.0f;
|
|
|
|
|
|
|
|
ConfigFile basicConfig;
|
|
|
|
|
2018-12-16 16:14:58 +00:00
|
|
|
std::vector<SavedProjectorInfo*> savedProjectorsArray;
|
2016-02-23 23:16:51 +00:00
|
|
|
QPointer<QWidget> projectors[10];
|
2017-06-29 19:01:10 +00:00
|
|
|
QList<QPointer<QWidget>> windowProjectors;
|
|
|
|
|
|
|
|
QPointer<QWidget> stats;
|
2018-12-16 16:14:58 +00:00
|
|
|
QPointer<QWidget> remux;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
QPointer<QMenu> startStreamMenu;
|
|
|
|
|
2017-04-19 19:54:15 +00:00
|
|
|
QPointer<QPushButton> replayBufferButton;
|
|
|
|
|
2018-12-16 16:14:58 +00:00
|
|
|
QScopedPointer<QSystemTrayIcon> trayIcon;
|
2017-04-19 19:54:15 +00:00
|
|
|
QPointer<QAction> sysTrayStream;
|
|
|
|
QPointer<QAction> sysTrayRecord;
|
|
|
|
QPointer<QAction> sysTrayReplayBuffer;
|
|
|
|
QPointer<QAction> showHide;
|
|
|
|
QPointer<QAction> exit;
|
|
|
|
QPointer<QMenu> trayMenu;
|
2016-10-10 19:01:40 +00:00
|
|
|
|
2018-05-29 19:13:02 +00:00
|
|
|
QPointer<QMenu> multiviewProjectorMenu;
|
|
|
|
void UpdateMultiviewProjectorMenu();
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
void DrawBackdrop(float cx, float cy);
|
|
|
|
|
|
|
|
void SetupEncoders();
|
|
|
|
|
|
|
|
void CreateFirstRunSources();
|
|
|
|
void CreateDefaultScene(bool firstStart);
|
|
|
|
|
2018-02-19 19:54:37 +00:00
|
|
|
void UpdateVolumeControlsDecayRate();
|
2018-12-16 16:14:58 +00:00
|
|
|
void UpdateVolumeControlsPeakMeterType();
|
2016-02-23 23:16:51 +00:00
|
|
|
void ClearVolumeControls();
|
|
|
|
|
2018-05-29 19:13:02 +00:00
|
|
|
void UploadLog(const char *subdir, const char *file);
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
void Save(const char *file);
|
|
|
|
void Load(const char *file);
|
|
|
|
|
|
|
|
void InitHotkeys();
|
|
|
|
void CreateHotkeys();
|
|
|
|
void ClearHotkeys();
|
|
|
|
|
|
|
|
bool InitService();
|
|
|
|
|
|
|
|
bool InitBasicConfigDefaults();
|
|
|
|
bool InitBasicConfig();
|
|
|
|
|
|
|
|
void InitOBSCallbacks();
|
|
|
|
|
|
|
|
void InitPrimitives();
|
|
|
|
|
2018-12-16 16:14:58 +00:00
|
|
|
void OnFirstLoad();
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
OBSSceneItem GetSceneItem(QListWidgetItem *item);
|
|
|
|
OBSSceneItem GetCurrentSceneItem();
|
|
|
|
|
|
|
|
bool QueryRemoveSource(obs_source_t *source);
|
|
|
|
|
|
|
|
void TimedCheckForUpdates();
|
2017-04-19 19:54:15 +00:00
|
|
|
void CheckForUpdates(bool manualUpdate);
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2017-04-19 19:54:15 +00:00
|
|
|
void UpdatePreviewScalingMenu();
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
void LoadSceneListOrder(obs_data_array_t *array);
|
|
|
|
obs_data_array_t *SaveSceneListOrder();
|
|
|
|
void ChangeSceneIndex(bool relative, int idx, int invalidIdx);
|
|
|
|
|
|
|
|
void TempFileOutput(const char *path, int vBitrate, int aBitrate);
|
|
|
|
void TempStreamOutput(const char *url, const char *key,
|
|
|
|
int vBitrate, int aBitrate);
|
|
|
|
|
|
|
|
void CloseDialogs();
|
|
|
|
void ClearSceneData();
|
|
|
|
|
|
|
|
void Nudge(int dist, MoveDir dir);
|
2018-12-16 16:14:58 +00:00
|
|
|
|
|
|
|
OBSProjector *OpenProjector(obs_source_t *source, int monitor,
|
|
|
|
QString title, ProjectorType type);
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
void GetAudioSourceFilters();
|
|
|
|
void GetAudioSourceProperties();
|
|
|
|
void VolControlContextMenu();
|
2018-12-16 16:14:58 +00:00
|
|
|
void ToggleVolControlLayout();
|
|
|
|
void ToggleMixerLayout(bool vertical);
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
void RefreshSceneCollections();
|
|
|
|
void ChangeSceneCollection();
|
2016-08-28 12:07:43 +00:00
|
|
|
void LogScenes();
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
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();
|
2018-02-19 19:54:37 +00:00
|
|
|
void CheckForSimpleModeX264Fallback();
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
void SaveProjectNow();
|
|
|
|
|
2018-12-16 16:14:58 +00:00
|
|
|
int GetTopSelectedSourceItem();
|
2016-02-23 23:16:51 +00:00
|
|
|
|
2017-04-19 19:54:15 +00:00
|
|
|
obs_hotkey_pair_id streamingHotkeys, recordingHotkeys,
|
|
|
|
replayBufHotkeys;
|
2016-02-23 23:16:51 +00:00
|
|
|
obs_hotkey_id forceStreamingStopHotkey;
|
|
|
|
|
|
|
|
void InitDefaultTransitions();
|
|
|
|
void InitTransition(obs_source_t *transition);
|
|
|
|
obs_source_t *FindTransition(const char *name);
|
|
|
|
OBSSource GetCurrentTransition();
|
2016-05-24 19:53:01 +00:00
|
|
|
obs_data_array_t *SaveTransitions();
|
|
|
|
void LoadTransitions(obs_data_array_t *transitions);
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
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();
|
2017-06-29 19:01:10 +00:00
|
|
|
void ClearQuickTransitionWidgets();
|
2016-02-23 23:16:51 +00:00
|
|
|
void RefreshQuickTransitions();
|
|
|
|
void CreateDefaultQuickTransitions();
|
|
|
|
|
2018-02-19 19:54:37 +00:00
|
|
|
QMenu *CreatePerSceneTransitionMenu();
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
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);
|
2018-02-19 19:54:37 +00:00
|
|
|
void SetCurrentScene(obs_scene_t *scene, bool force = false,
|
|
|
|
bool direct = false);
|
2016-02-23 23:16:51 +00:00
|
|
|
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;
|
2018-02-19 19:54:37 +00:00
|
|
|
bool overridingTransition = false;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
int programX = 0, programY = 0;
|
|
|
|
int programCX = 0, programCY = 0;
|
|
|
|
float programScale = 0.0f;
|
|
|
|
|
2017-06-29 19:01:10 +00:00
|
|
|
int disableOutputsRef = 0;
|
|
|
|
|
2016-10-10 19:01:40 +00:00
|
|
|
inline void OnActivate();
|
|
|
|
inline void OnDeactivate();
|
|
|
|
|
2017-04-19 19:54:15 +00:00
|
|
|
void AddDropSource(const char *file, DropType image);
|
2016-10-10 19:01:40 +00:00
|
|
|
void dragEnterEvent(QDragEnterEvent *event) override;
|
|
|
|
void dragLeaveEvent(QDragLeaveEvent *event) override;
|
|
|
|
void dragMoveEvent(QDragMoveEvent *event) override;
|
|
|
|
void dropEvent(QDropEvent *event) override;
|
|
|
|
|
2017-04-19 19:54:15 +00:00
|
|
|
void ReplayBufferClicked();
|
|
|
|
|
|
|
|
bool sysTrayMinimizeToTray();
|
|
|
|
|
|
|
|
void EnumDialogs();
|
|
|
|
|
|
|
|
QList<QDialog*> visDialogs;
|
|
|
|
QList<QDialog*> modalDialogs;
|
|
|
|
QList<QMessageBox*> visMsgBoxes;
|
|
|
|
|
|
|
|
QList<QPoint> visDlgPositions;
|
|
|
|
|
2018-02-19 19:54:37 +00:00
|
|
|
QByteArray startingDockLayout;
|
|
|
|
|
2017-04-19 19:54:15 +00:00
|
|
|
obs_data_array_t *SaveProjectors();
|
|
|
|
void LoadSavedProjectors(obs_data_array_t *savedProjectors);
|
|
|
|
|
2018-12-16 16:14:58 +00:00
|
|
|
void ReceivedIntroJson(const QString &text);
|
2017-04-19 19:54:15 +00:00
|
|
|
|
2018-12-16 16:14:58 +00:00
|
|
|
bool NoSourcesConfirmation();
|
2018-02-19 19:54:37 +00:00
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
public slots:
|
2018-12-16 16:14:58 +00:00
|
|
|
void DeferSaveBegin();
|
|
|
|
void DeferSaveEnd();
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
void StartStreaming();
|
|
|
|
void StopStreaming();
|
|
|
|
void ForceStopStreaming();
|
|
|
|
|
|
|
|
void StreamDelayStarting(int sec);
|
|
|
|
void StreamDelayStopping(int sec);
|
|
|
|
|
|
|
|
void StreamingStart();
|
2016-08-28 12:07:43 +00:00
|
|
|
void StreamStopping();
|
2017-06-29 19:01:10 +00:00
|
|
|
void StreamingStop(int errorcode, QString last_error);
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
void StartRecording();
|
|
|
|
void StopRecording();
|
|
|
|
|
|
|
|
void RecordingStart();
|
2016-08-28 12:07:43 +00:00
|
|
|
void RecordStopping();
|
2016-02-23 23:16:51 +00:00
|
|
|
void RecordingStop(int code);
|
|
|
|
|
2017-04-19 19:54:15 +00:00
|
|
|
void StartReplayBuffer();
|
|
|
|
void StopReplayBuffer();
|
|
|
|
|
|
|
|
void ReplayBufferStart();
|
2018-02-19 19:54:37 +00:00
|
|
|
void ReplayBufferSave();
|
2017-04-19 19:54:15 +00:00
|
|
|
void ReplayBufferStopping();
|
|
|
|
void ReplayBufferStop(int code);
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
void SaveProjectDeferred();
|
|
|
|
void SaveProject();
|
|
|
|
|
2016-10-10 19:01:40 +00:00
|
|
|
void SetTransition(OBSSource transition);
|
2018-02-19 19:54:37 +00:00
|
|
|
void TransitionToScene(OBSScene scene, bool force = false,
|
|
|
|
bool direct = false);
|
|
|
|
void TransitionToScene(OBSSource scene, bool force = false,
|
|
|
|
bool direct = false, bool quickTransition = false);
|
|
|
|
void SetCurrentScene(OBSSource scene, bool force = false,
|
|
|
|
bool direct = false);
|
2016-10-10 19:01:40 +00:00
|
|
|
|
2018-12-16 16:14:58 +00:00
|
|
|
bool AddSceneCollection(
|
|
|
|
bool create_new,
|
|
|
|
const QString &name = QString());
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
private slots:
|
|
|
|
void AddSceneItem(OBSSceneItem item);
|
|
|
|
void AddScene(OBSSource source);
|
|
|
|
void RemoveScene(OBSSource source);
|
2018-02-19 19:54:37 +00:00
|
|
|
void RenameSources(OBSSource source, QString newName, QString prevName);
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
void SelectSceneItem(OBSScene scene, OBSSceneItem item, bool select);
|
|
|
|
|
|
|
|
void ActivateAudioSource(OBSSource source);
|
|
|
|
void DeactivateAudioSource(OBSSource source);
|
|
|
|
|
|
|
|
void DuplicateSelectedScene();
|
|
|
|
void RemoveSelectedScene();
|
|
|
|
void RemoveSelectedSceneItem();
|
|
|
|
|
|
|
|
void ToggleAlwaysOnTop();
|
|
|
|
|
|
|
|
void ReorderSources(OBSScene scene);
|
|
|
|
|
|
|
|
void ProcessHotkey(obs_hotkey_id id, bool pressed);
|
|
|
|
|
2016-05-24 19:53:01 +00:00
|
|
|
void AddTransition();
|
|
|
|
void RenameTransition();
|
2016-02-23 23:16:51 +00:00
|
|
|
void TransitionClicked();
|
|
|
|
void TransitionStopped();
|
2018-02-19 19:54:37 +00:00
|
|
|
void TransitionFullyStopped();
|
2016-02-23 23:16:51 +00:00
|
|
|
void TriggerQuickTransition(int id);
|
|
|
|
|
2016-05-24 19:53:01 +00:00
|
|
|
void SetDeinterlacingMode();
|
|
|
|
void SetDeinterlacingOrder();
|
|
|
|
|
2016-08-28 12:07:43 +00:00
|
|
|
void SetScaleFilter();
|
|
|
|
|
2016-10-10 19:01:40 +00:00
|
|
|
void IconActivated(QSystemTrayIcon::ActivationReason reason);
|
|
|
|
void SetShowing(bool showing);
|
|
|
|
|
2017-04-19 19:54:15 +00:00
|
|
|
void ToggleShowHide();
|
2016-10-10 19:01:40 +00:00
|
|
|
|
2018-02-19 19:54:37 +00:00
|
|
|
void HideAudioControl();
|
|
|
|
void UnhideAllAudioControls();
|
|
|
|
void ToggleHideMixer();
|
|
|
|
|
|
|
|
void MixerRenameSource();
|
|
|
|
|
2018-12-16 16:14:58 +00:00
|
|
|
void on_vMixerScrollArea_customContextMenuRequested();
|
|
|
|
void on_hMixerScrollArea_customContextMenuRequested();
|
2018-02-19 19:54:37 +00:00
|
|
|
|
2017-06-29 19:01:10 +00:00
|
|
|
void on_actionCopySource_triggered();
|
|
|
|
void on_actionPasteRef_triggered();
|
|
|
|
void on_actionPasteDup_triggered();
|
|
|
|
|
|
|
|
void on_actionCopyFilters_triggered();
|
|
|
|
void on_actionPasteFilters_triggered();
|
|
|
|
|
2018-12-16 16:14:58 +00:00
|
|
|
void ColorChange();
|
|
|
|
|
|
|
|
SourceTreeItem *GetItemWidgetFromSceneItem(obs_sceneitem_t *sceneItem);
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
private:
|
|
|
|
/* OBS Callbacks */
|
|
|
|
static void SceneReordered(void *data, calldata_t *params);
|
|
|
|
static void SceneItemAdded(void *data, calldata_t *params);
|
|
|
|
static void SceneItemSelected(void *data, calldata_t *params);
|
|
|
|
static void SceneItemDeselected(void *data, calldata_t *params);
|
2018-12-16 16:14:58 +00:00
|
|
|
static void SourceCreated(void *data, calldata_t *params);
|
2016-02-23 23:16:51 +00:00
|
|
|
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);
|
|
|
|
static void RenderMain(void *data, uint32_t cx, uint32_t cy);
|
|
|
|
|
|
|
|
void ResizePreview(uint32_t cx, uint32_t cy);
|
|
|
|
|
|
|
|
void AddSource(const char *id);
|
|
|
|
QMenu *CreateAddSourcePopupMenu();
|
|
|
|
void AddSourcePopupMenu(const QPoint &pos);
|
|
|
|
void copyActionsDynamicProperties();
|
|
|
|
|
|
|
|
static void HotkeyTriggered(void *data, obs_hotkey_id id, bool pressed);
|
|
|
|
|
|
|
|
public:
|
2018-02-19 19:54:37 +00:00
|
|
|
OBSSource GetProgramSource();
|
|
|
|
OBSScene GetCurrentScene();
|
2016-02-23 23:16:51 +00:00
|
|
|
|
2016-10-10 19:01:40 +00:00
|
|
|
void SysTrayNotify(const QString &text, QSystemTrayIcon::MessageIcon n);
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
inline OBSSource GetCurrentSceneSource()
|
|
|
|
{
|
|
|
|
OBSScene curScene = GetCurrentScene();
|
|
|
|
return OBSSource(obs_scene_get_source(curScene));
|
|
|
|
}
|
|
|
|
|
|
|
|
obs_service_t *GetService();
|
|
|
|
void SetService(obs_service_t *service);
|
|
|
|
|
2018-02-19 19:54:37 +00:00
|
|
|
inline bool IsPreviewProgramMode() const
|
|
|
|
{
|
|
|
|
return os_atomic_load_bool(&previewProgramMode);
|
|
|
|
}
|
|
|
|
|
2016-08-28 12:07:43 +00:00
|
|
|
bool StreamingActive() const;
|
|
|
|
bool Active() const;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
2018-02-19 19:54:37 +00:00
|
|
|
void ResetUI();
|
2016-02-23 23:16:51 +00:00
|
|
|
int ResetVideo();
|
|
|
|
bool ResetAudio();
|
|
|
|
|
|
|
|
void ResetOutputs();
|
|
|
|
|
|
|
|
void ResetAudioDevice(const char *sourceId, const char *deviceId,
|
|
|
|
const char *deviceDesc, int channel);
|
|
|
|
|
|
|
|
void NewProject();
|
|
|
|
void LoadProject();
|
|
|
|
|
|
|
|
inline void GetDisplayRect(int &x, int &y, int &cx, int &cy)
|
|
|
|
{
|
|
|
|
x = previewX;
|
|
|
|
y = previewY;
|
|
|
|
cx = previewCX;
|
|
|
|
cy = previewCY;
|
|
|
|
}
|
|
|
|
|
2018-12-16 16:14:58 +00:00
|
|
|
inline bool SavingDisabled() const
|
|
|
|
{
|
|
|
|
return disableSaving;
|
|
|
|
}
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
inline double GetCPUUsage() const
|
|
|
|
{
|
|
|
|
return os_cpu_usage_info_query(cpuUsageInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SaveService();
|
|
|
|
bool LoadService();
|
|
|
|
|
2017-06-29 19:01:10 +00:00
|
|
|
inline void EnableOutputs(bool enable)
|
|
|
|
{
|
|
|
|
if (enable) {
|
|
|
|
if (--disableOutputsRef < 0)
|
|
|
|
disableOutputsRef = 0;
|
|
|
|
} else {
|
|
|
|
disableOutputsRef++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-24 19:53:01 +00:00
|
|
|
QMenu *AddDeinterlacingMenu(obs_source_t *source);
|
2016-08-28 12:07:43 +00:00
|
|
|
QMenu *AddScaleFilteringMenu(obs_sceneitem_t *item);
|
2018-12-16 16:14:58 +00:00
|
|
|
QMenu *AddBackgroundColorMenu(obs_sceneitem_t *item);
|
|
|
|
void CreateSourcePopupMenu(int idx, bool preview);
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
void UpdateTitleBar();
|
|
|
|
void UpdateSceneSelection(OBSSource source);
|
|
|
|
|
2016-10-10 19:01:40 +00:00
|
|
|
void SystemTrayInit();
|
|
|
|
void SystemTray(bool firstStarted);
|
|
|
|
|
2017-04-19 19:54:15 +00:00
|
|
|
void OpenSavedProjectors();
|
2018-12-16 16:14:58 +00:00
|
|
|
|
|
|
|
void CreateInteractionWindow(obs_source_t *source);
|
|
|
|
void CreatePropertiesWindow(obs_source_t *source);
|
|
|
|
void CreateFiltersWindow(obs_source_t *source);
|
2017-04-19 19:54:15 +00:00
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
protected:
|
|
|
|
virtual void closeEvent(QCloseEvent *event) override;
|
|
|
|
virtual void changeEvent(QEvent *event) override;
|
|
|
|
|
|
|
|
private slots:
|
2018-02-19 19:54:37 +00:00
|
|
|
void on_actionFullscreenInterface_triggered();
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
void on_actionShow_Recordings_triggered();
|
|
|
|
void on_actionRemux_triggered();
|
|
|
|
void on_action_Settings_triggered();
|
|
|
|
void on_actionAdvAudioProperties_triggered();
|
|
|
|
void on_advAudioProps_clicked();
|
|
|
|
void on_advAudioProps_destroyed();
|
|
|
|
void on_actionShowLogs_triggered();
|
|
|
|
void on_actionUploadCurrentLog_triggered();
|
|
|
|
void on_actionUploadLastLog_triggered();
|
|
|
|
void on_actionViewCurrentLog_triggered();
|
|
|
|
void on_actionCheckForUpdates_triggered();
|
|
|
|
|
2018-05-29 19:13:02 +00:00
|
|
|
void on_actionShowCrashLogs_triggered();
|
|
|
|
void on_actionUploadLastCrashLog_triggered();
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
void on_actionEditTransform_triggered();
|
2017-04-19 19:54:15 +00:00
|
|
|
void on_actionCopyTransform_triggered();
|
|
|
|
void on_actionPasteTransform_triggered();
|
2016-02-23 23:16:51 +00:00
|
|
|
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();
|
|
|
|
|
|
|
|
void on_scenes_currentItemChanged(QListWidgetItem *current,
|
|
|
|
QListWidgetItem *prev);
|
|
|
|
void on_scenes_customContextMenuRequested(const QPoint &pos);
|
|
|
|
void on_actionAddScene_triggered();
|
|
|
|
void on_actionRemoveScene_triggered();
|
|
|
|
void on_actionSceneUp_triggered();
|
|
|
|
void on_actionSceneDown_triggered();
|
|
|
|
void on_sources_customContextMenuRequested(const QPoint &pos);
|
2018-02-19 19:54:37 +00:00
|
|
|
void on_scenes_itemDoubleClicked(QListWidgetItem *item);
|
2016-02-23 23:16:51 +00:00
|
|
|
void on_actionAddSource_triggered();
|
|
|
|
void on_actionRemoveSource_triggered();
|
|
|
|
void on_actionInteract_triggered();
|
|
|
|
void on_actionSourceProperties_triggered();
|
|
|
|
void on_actionSourceUp_triggered();
|
|
|
|
void on_actionSourceDown_triggered();
|
|
|
|
|
|
|
|
void on_actionMoveUp_triggered();
|
|
|
|
void on_actionMoveDown_triggered();
|
|
|
|
void on_actionMoveToTop_triggered();
|
|
|
|
void on_actionMoveToBottom_triggered();
|
|
|
|
|
2016-08-28 12:07:43 +00:00
|
|
|
void on_actionLockPreview_triggered();
|
|
|
|
|
2017-04-19 19:54:15 +00:00
|
|
|
void on_scalingMenu_aboutToShow();
|
|
|
|
void on_actionScaleWindow_triggered();
|
|
|
|
void on_actionScaleCanvas_triggered();
|
|
|
|
void on_actionScaleOutput_triggered();
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
void on_streamButton_clicked();
|
|
|
|
void on_recordButton_clicked();
|
|
|
|
void on_settingsButton_clicked();
|
|
|
|
|
2018-02-19 19:54:37 +00:00
|
|
|
void on_actionHelpPortal_triggered();
|
2016-02-23 23:16:51 +00:00
|
|
|
void on_actionWebsite_triggered();
|
2018-12-16 16:14:58 +00:00
|
|
|
void on_actionDiscord_triggered();
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
void on_preview_customContextMenuRequested(const QPoint &pos);
|
2018-02-19 19:54:37 +00:00
|
|
|
void on_program_customContextMenuRequested(const QPoint &pos);
|
2016-02-23 23:16:51 +00:00
|
|
|
void on_previewDisabledLabel_customContextMenuRequested(
|
|
|
|
const QPoint &pos);
|
|
|
|
|
|
|
|
void on_actionNewSceneCollection_triggered();
|
|
|
|
void on_actionDupSceneCollection_triggered();
|
|
|
|
void on_actionRenameSceneCollection_triggered();
|
|
|
|
void on_actionRemoveSceneCollection_triggered();
|
2017-04-19 19:54:15 +00:00
|
|
|
void on_actionImportSceneCollection_triggered();
|
|
|
|
void on_actionExportSceneCollection_triggered();
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
void on_actionNewProfile_triggered();
|
|
|
|
void on_actionDupProfile_triggered();
|
|
|
|
void on_actionRenameProfile_triggered();
|
|
|
|
void on_actionRemoveProfile_triggered();
|
2017-04-19 19:54:15 +00:00
|
|
|
void on_actionImportProfile_triggered();
|
|
|
|
void on_actionExportProfile_triggered();
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
void on_actionShowSettingsFolder_triggered();
|
|
|
|
void on_actionShowProfileFolder_triggered();
|
|
|
|
|
|
|
|
void on_actionAlwaysOnTop_triggered();
|
|
|
|
|
2016-08-28 12:07:43 +00:00
|
|
|
void on_toggleListboxToolbars_toggled(bool visible);
|
|
|
|
void on_toggleStatusBar_toggled(bool visible);
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
void on_transitions_currentIndexChanged(int index);
|
2016-05-24 19:53:01 +00:00
|
|
|
void on_transitionAdd_clicked();
|
|
|
|
void on_transitionRemove_clicked();
|
2016-02-23 23:16:51 +00:00
|
|
|
void on_transitionProps_clicked();
|
|
|
|
|
|
|
|
void on_modeSwitch_clicked();
|
|
|
|
|
2017-06-29 19:01:10 +00:00
|
|
|
void on_autoConfigure_triggered();
|
|
|
|
void on_stats_triggered();
|
|
|
|
|
2018-02-19 19:54:37 +00:00
|
|
|
void on_resetUI_triggered();
|
|
|
|
void on_lockUI_toggled(bool lock);
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
void logUploadFinished(const QString &text, const QString &error);
|
|
|
|
|
2017-04-19 19:54:15 +00:00
|
|
|
void updateCheckFinished();
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
void AddSourceFromAction();
|
|
|
|
|
|
|
|
void MoveSceneToTop();
|
|
|
|
void MoveSceneToBottom();
|
|
|
|
|
|
|
|
void EditSceneName();
|
|
|
|
void EditSceneItemName();
|
|
|
|
|
|
|
|
void SceneNameEdited(QWidget *editor,
|
|
|
|
QAbstractItemDelegate::EndEditHint endHint);
|
|
|
|
|
|
|
|
void OpenSceneFilters();
|
|
|
|
void OpenFilters();
|
|
|
|
|
|
|
|
void EnablePreviewDisplay(bool enable);
|
|
|
|
void TogglePreview();
|
|
|
|
|
|
|
|
void NudgeUp();
|
|
|
|
void NudgeDown();
|
|
|
|
void NudgeLeft();
|
|
|
|
void NudgeRight();
|
|
|
|
|
2018-02-19 19:54:37 +00:00
|
|
|
void OpenStudioProgramProjector();
|
2016-02-23 23:16:51 +00:00
|
|
|
void OpenPreviewProjector();
|
|
|
|
void OpenSourceProjector();
|
2018-02-19 19:54:37 +00:00
|
|
|
void OpenMultiviewProjector();
|
2016-02-23 23:16:51 +00:00
|
|
|
void OpenSceneProjector();
|
|
|
|
|
2018-02-19 19:54:37 +00:00
|
|
|
void OpenStudioProgramWindow();
|
2017-06-29 19:01:10 +00:00
|
|
|
void OpenPreviewWindow();
|
|
|
|
void OpenSourceWindow();
|
2018-02-19 19:54:37 +00:00
|
|
|
void OpenMultiviewWindow();
|
2017-06-29 19:01:10 +00:00
|
|
|
void OpenSceneWindow();
|
|
|
|
|
2018-12-16 16:14:58 +00:00
|
|
|
void DeferredLoad(const QString &file, int requeueCount);
|
|
|
|
|
|
|
|
void StackedMixerAreaContextMenuRequested();
|
|
|
|
|
2016-10-10 19:01:40 +00:00
|
|
|
public slots:
|
|
|
|
void on_actionResetTransform_triggered();
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
public:
|
|
|
|
explicit OBSBasic(QWidget *parent = 0);
|
|
|
|
virtual ~OBSBasic();
|
|
|
|
|
|
|
|
virtual void OBSInit() override;
|
|
|
|
|
|
|
|
virtual config_t *Config() const override;
|
|
|
|
|
|
|
|
virtual int GetProfilePath(char *path, size_t size, const char *file)
|
|
|
|
const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::unique_ptr<Ui::OBSBasic> ui;
|
|
|
|
};
|
2018-12-16 16:14:58 +00:00
|
|
|
|
|
|
|
class ColorSelect : public QWidget {
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit ColorSelect(QWidget *parent = 0);
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::unique_ptr<Ui::ColorSelect> ui;
|
|
|
|
};
|