New upstream version 22.0.3+dfsg1
This commit is contained in:
parent
665f64a933
commit
cdc9a9fc87
334 changed files with 14525 additions and 2639 deletions
|
|
@ -29,6 +29,7 @@
|
|||
#include "window-basic-transform.hpp"
|
||||
#include "window-basic-adv-audio.hpp"
|
||||
#include "window-basic-filters.hpp"
|
||||
#include "window-projector.hpp"
|
||||
|
||||
#include <obs-frontend-internal.hpp>
|
||||
|
||||
|
|
@ -41,10 +42,10 @@
|
|||
class QMessageBox;
|
||||
class QListWidgetItem;
|
||||
class VolControl;
|
||||
class QNetworkReply;
|
||||
class OBSBasicStats;
|
||||
|
||||
#include "ui_OBSBasic.h"
|
||||
#include "ui_ColorSelect.h"
|
||||
|
||||
#define DESKTOP_AUDIO_1 Str("DesktopAudioDevice1")
|
||||
#define DESKTOP_AUDIO_2 Str("DesktopAudioDevice2")
|
||||
|
|
@ -67,26 +68,33 @@ enum class QtDataRole {
|
|||
OBSSignals,
|
||||
};
|
||||
|
||||
enum class ProjectorType {
|
||||
Source,
|
||||
Preview,
|
||||
StudioProgram,
|
||||
Multiview
|
||||
struct SavedProjectorInfo {
|
||||
ProjectorType type;
|
||||
int monitor;
|
||||
std::string geometry;
|
||||
std::string name;
|
||||
};
|
||||
|
||||
struct QuickTransition {
|
||||
QPushButton *button = nullptr;
|
||||
OBSSource source;
|
||||
obs_hotkey_id hotkey = 0;
|
||||
obs_hotkey_id hotkey = OBS_INVALID_HOTKEY_ID;
|
||||
int duration = 0;
|
||||
int id = 0;
|
||||
|
||||
inline QuickTransition() {}
|
||||
inline QuickTransition(OBSSource source_, int duration_, int id_)
|
||||
: source (source_),
|
||||
duration (duration_),
|
||||
id (id_)
|
||||
: source (source_),
|
||||
duration (duration_),
|
||||
id (id_),
|
||||
renamedSignal (std::make_shared<OBSSignal>(
|
||||
obs_source_get_signal_handler(source),
|
||||
"rename", SourceRenamed, this))
|
||||
{}
|
||||
|
||||
private:
|
||||
static void SourceRenamed(void *param, calldata_t *data);
|
||||
std::shared_ptr<OBSSignal> renamedSignal;
|
||||
};
|
||||
|
||||
class OBSBasic : public OBSMainWindow {
|
||||
|
|
@ -120,11 +128,6 @@ private:
|
|||
|
||||
std::vector<OBSSignal> signalHandlers;
|
||||
|
||||
std::vector<std::string> projectorArray;
|
||||
std::vector<int> studioProgramProjectorArray;
|
||||
std::vector<int> multiviewProjectorArray;
|
||||
std::vector<int> previewProjectorArray;
|
||||
|
||||
bool loaded = false;
|
||||
long disableSaving = 1;
|
||||
bool projectChanged = false;
|
||||
|
|
@ -135,8 +138,9 @@ private:
|
|||
const char *copyFiltersString;
|
||||
bool copyVisible = true;
|
||||
|
||||
QPointer<QThread> updateCheckThread;
|
||||
QPointer<QThread> logUploadThread;
|
||||
QScopedPointer<QThread> updateCheckThread;
|
||||
QScopedPointer<QThread> introCheckThread;
|
||||
QScopedPointer<QThread> logUploadThread;
|
||||
|
||||
QPointer<OBSBasicInteraction> interaction;
|
||||
QPointer<OBSBasicProperties> properties;
|
||||
|
|
@ -169,16 +173,18 @@ private:
|
|||
|
||||
ConfigFile basicConfig;
|
||||
|
||||
std::vector<SavedProjectorInfo*> savedProjectorsArray;
|
||||
QPointer<QWidget> projectors[10];
|
||||
QList<QPointer<QWidget>> windowProjectors;
|
||||
|
||||
QPointer<QWidget> stats;
|
||||
QPointer<QWidget> remux;
|
||||
|
||||
QPointer<QMenu> startStreamMenu;
|
||||
|
||||
QPointer<QPushButton> replayBufferButton;
|
||||
|
||||
QPointer<QSystemTrayIcon> trayIcon;
|
||||
QScopedPointer<QSystemTrayIcon> trayIcon;
|
||||
QPointer<QAction> sysTrayStream;
|
||||
QPointer<QAction> sysTrayRecord;
|
||||
QPointer<QAction> sysTrayReplayBuffer;
|
||||
|
|
@ -197,6 +203,7 @@ private:
|
|||
void CreateDefaultScene(bool firstStart);
|
||||
|
||||
void UpdateVolumeControlsDecayRate();
|
||||
void UpdateVolumeControlsPeakMeterType();
|
||||
void ClearVolumeControls();
|
||||
|
||||
void UploadLog(const char *subdir, const char *file);
|
||||
|
|
@ -217,6 +224,8 @@ private:
|
|||
|
||||
void InitPrimitives();
|
||||
|
||||
void OnFirstLoad();
|
||||
|
||||
OBSSceneItem GetSceneItem(QListWidgetItem *item);
|
||||
OBSSceneItem GetCurrentSceneItem();
|
||||
|
||||
|
|
@ -233,9 +242,6 @@ private:
|
|||
|
||||
void UpdatePreviewScalingMenu();
|
||||
|
||||
void UpdateSources(OBSScene scene);
|
||||
void InsertSceneItem(obs_sceneitem_t *item);
|
||||
|
||||
void LoadSceneListOrder(obs_data_array_t *array);
|
||||
obs_data_array_t *SaveSceneListOrder();
|
||||
void ChangeSceneIndex(bool relative, int idx, int invalidIdx);
|
||||
|
|
@ -244,23 +250,20 @@ private:
|
|||
void TempStreamOutput(const char *url, const char *key,
|
||||
int vBitrate, int aBitrate);
|
||||
|
||||
void CreateInteractionWindow(obs_source_t *source);
|
||||
void CreatePropertiesWindow(obs_source_t *source);
|
||||
void CreateFiltersWindow(obs_source_t *source);
|
||||
|
||||
void CloseDialogs();
|
||||
void ClearSceneData();
|
||||
|
||||
void Nudge(int dist, MoveDir dir);
|
||||
void OpenProjector(obs_source_t *source, int monitor, bool window,
|
||||
QString title = nullptr,
|
||||
ProjectorType type = ProjectorType::Source);
|
||||
|
||||
OBSProjector *OpenProjector(obs_source_t *source, int monitor,
|
||||
QString title, ProjectorType type);
|
||||
|
||||
void GetAudioSourceFilters();
|
||||
void GetAudioSourceProperties();
|
||||
void VolControlContextMenu();
|
||||
void ToggleVolControlLayout();
|
||||
void ToggleMixerLayout(bool vertical);
|
||||
|
||||
void AddSceneCollection(bool create_new);
|
||||
void RefreshSceneCollections();
|
||||
void ChangeSceneCollection();
|
||||
void LogScenes();
|
||||
|
|
@ -276,7 +279,7 @@ private:
|
|||
|
||||
void SaveProjectNow();
|
||||
|
||||
QListWidgetItem *GetTopSelectedSourceItem();
|
||||
int GetTopSelectedSourceItem();
|
||||
|
||||
obs_hotkey_pair_id streamingHotkeys, recordingHotkeys,
|
||||
replayBufHotkeys;
|
||||
|
|
@ -367,19 +370,14 @@ private:
|
|||
obs_data_array_t *SaveProjectors();
|
||||
void LoadSavedProjectors(obs_data_array_t *savedProjectors);
|
||||
|
||||
obs_data_array_t *SavePreviewProjectors();
|
||||
void LoadSavedPreviewProjectors(
|
||||
obs_data_array_t *savedPreviewProjectors);
|
||||
void ReceivedIntroJson(const QString &text);
|
||||
|
||||
obs_data_array_t *SaveStudioProgramProjectors();
|
||||
void LoadSavedStudioProgramProjectors(
|
||||
obs_data_array_t *savedStudioProgramProjectors);
|
||||
|
||||
obs_data_array_t *SaveMultiviewProjectors();
|
||||
void LoadSavedMultiviewProjectors(
|
||||
obs_data_array_t *savedMultiviewProjectors);
|
||||
bool NoSourcesConfirmation();
|
||||
|
||||
public slots:
|
||||
void DeferSaveBegin();
|
||||
void DeferSaveEnd();
|
||||
|
||||
void StartStreaming();
|
||||
void StopStreaming();
|
||||
void ForceStopStreaming();
|
||||
|
|
@ -417,9 +415,12 @@ public slots:
|
|||
void SetCurrentScene(OBSSource scene, bool force = false,
|
||||
bool direct = false);
|
||||
|
||||
bool AddSceneCollection(
|
||||
bool create_new,
|
||||
const QString &name = QString());
|
||||
|
||||
private slots:
|
||||
void AddSceneItem(OBSSceneItem item);
|
||||
void RemoveSceneItem(OBSSceneItem item);
|
||||
void AddScene(OBSSource source);
|
||||
void RemoveScene(OBSSource source);
|
||||
void RenameSources(OBSSource source, QString newName, QString prevName);
|
||||
|
|
@ -462,7 +463,8 @@ private slots:
|
|||
|
||||
void MixerRenameSource();
|
||||
|
||||
void on_mixerScrollArea_customContextMenuRequested();
|
||||
void on_vMixerScrollArea_customContextMenuRequested();
|
||||
void on_hMixerScrollArea_customContextMenuRequested();
|
||||
|
||||
void on_actionCopySource_triggered();
|
||||
void on_actionPasteRef_triggered();
|
||||
|
|
@ -471,14 +473,17 @@ private slots:
|
|||
void on_actionCopyFilters_triggered();
|
||||
void on_actionPasteFilters_triggered();
|
||||
|
||||
void ColorChange();
|
||||
|
||||
SourceTreeItem *GetItemWidgetFromSceneItem(obs_sceneitem_t *sceneItem);
|
||||
|
||||
private:
|
||||
/* OBS Callbacks */
|
||||
static void SceneReordered(void *data, calldata_t *params);
|
||||
static void SceneItemAdded(void *data, calldata_t *params);
|
||||
static void SceneItemRemoved(void *data, calldata_t *params);
|
||||
static void SceneItemSelected(void *data, calldata_t *params);
|
||||
static void SceneItemDeselected(void *data, calldata_t *params);
|
||||
static void SourceLoaded(void *data, obs_source_t *source);
|
||||
static void SourceCreated(void *data, calldata_t *params);
|
||||
static void SourceRemoved(void *data, calldata_t *params);
|
||||
static void SourceActivated(void *data, calldata_t *params);
|
||||
static void SourceDeactivated(void *data, calldata_t *params);
|
||||
|
|
@ -537,6 +542,11 @@ public:
|
|||
cy = previewCY;
|
||||
}
|
||||
|
||||
inline bool SavingDisabled() const
|
||||
{
|
||||
return disableSaving;
|
||||
}
|
||||
|
||||
inline double GetCPUUsage() const
|
||||
{
|
||||
return os_cpu_usage_info_query(cpuUsageInfo);
|
||||
|
|
@ -555,11 +565,10 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void ReorderSceneItem(obs_sceneitem_t *item, size_t idx);
|
||||
|
||||
QMenu *AddDeinterlacingMenu(obs_source_t *source);
|
||||
QMenu *AddScaleFilteringMenu(obs_sceneitem_t *item);
|
||||
void CreateSourcePopupMenu(QListWidgetItem *item, bool preview);
|
||||
QMenu *AddBackgroundColorMenu(obs_sceneitem_t *item);
|
||||
void CreateSourcePopupMenu(int idx, bool preview);
|
||||
|
||||
void UpdateTitleBar();
|
||||
void UpdateSceneSelection(OBSSource source);
|
||||
|
|
@ -568,7 +577,10 @@ public:
|
|||
void SystemTray(bool firstStarted);
|
||||
|
||||
void OpenSavedProjectors();
|
||||
void RemoveSavedProjectors(int monitor);
|
||||
|
||||
void CreateInteractionWindow(obs_source_t *source);
|
||||
void CreatePropertiesWindow(obs_source_t *source);
|
||||
void CreateFiltersWindow(obs_source_t *source);
|
||||
|
||||
protected:
|
||||
virtual void closeEvent(QCloseEvent *event) override;
|
||||
|
|
@ -611,9 +623,7 @@ private slots:
|
|||
void on_actionRemoveScene_triggered();
|
||||
void on_actionSceneUp_triggered();
|
||||
void on_actionSceneDown_triggered();
|
||||
void on_sources_itemSelectionChanged();
|
||||
void on_sources_customContextMenuRequested(const QPoint &pos);
|
||||
void on_sources_itemDoubleClicked(QListWidgetItem *item);
|
||||
void on_scenes_itemDoubleClicked(QListWidgetItem *item);
|
||||
void on_actionAddSource_triggered();
|
||||
void on_actionRemoveSource_triggered();
|
||||
|
|
@ -640,6 +650,7 @@ private slots:
|
|||
|
||||
void on_actionHelpPortal_triggered();
|
||||
void on_actionWebsite_triggered();
|
||||
void on_actionDiscord_triggered();
|
||||
|
||||
void on_preview_customContextMenuRequested(const QPoint &pos);
|
||||
void on_program_customContextMenuRequested(const QPoint &pos);
|
||||
|
|
@ -695,8 +706,6 @@ private slots:
|
|||
|
||||
void SceneNameEdited(QWidget *editor,
|
||||
QAbstractItemDelegate::EndEditHint endHint);
|
||||
void SceneItemNameEdited(QWidget *editor,
|
||||
QAbstractItemDelegate::EndEditHint endHint);
|
||||
|
||||
void OpenSceneFilters();
|
||||
void OpenFilters();
|
||||
|
|
@ -721,6 +730,10 @@ private slots:
|
|||
void OpenMultiviewWindow();
|
||||
void OpenSceneWindow();
|
||||
|
||||
void DeferredLoad(const QString &file, int requeueCount);
|
||||
|
||||
void StackedMixerAreaContextMenuRequested();
|
||||
|
||||
public slots:
|
||||
void on_actionResetTransform_triggered();
|
||||
|
||||
|
|
@ -738,3 +751,12 @@ public:
|
|||
private:
|
||||
std::unique_ptr<Ui::OBSBasic> ui;
|
||||
};
|
||||
|
||||
class ColorSelect : public QWidget {
|
||||
|
||||
public:
|
||||
explicit ColorSelect(QWidget *parent = 0);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui::ColorSelect> ui;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue