アーキテクチャと開発者向けリファレンス
このページは、プラグインを拡張する開発者向けの「内部動作」リファレンスです。モジュール構造、ハンドラーベースのクライアント、シーケンサー統合、エディタの詳細パネルシステム、主要な型、新機能を追加するためのパターンを説明します。
ラムダバインディングをサポートするネイティブ C++ デリゲート(Native サフィックスのイベント)の完全な一覧については、ネイティブデリゲートを参照してください。
モジュール構造
プラグインは 3 つのモジュールで構成されています。
| モジュール | 種別 | 目的 |
|---|---|---|
InhyeongOBSWebSocket | ランタイム | コア機能、サブシステム、コンポーネント、シーケンサー統合 |
InhyeongOBSWebSocketEditor | エディタ | 詳細パネルのカスタマイズ、Editor Subsystem、シーケンサーのトラックエディタ |
InhyeongOBSWebSocketTakeRecorder | エディタ | Take Recorder 同期(PostEngineInit 時にロード。Takes plugin が有効な場合のみ) |
Take Recorder 同期の設定
設定は Config/DefaultInhyeongOBS.ini に保存されます。
[/Script/InhyeongOBSWebSocketTakeRecorder.InhyeongOBSTakeRecorderSync]
bEnabled=True
bShowNotifications=True
bWarnIfOBSNotConnected=True
bAutoStartRecord=True
bAutoStopRecord=True
PostRollSeconds=0.000000
bAutoStartVirtualCam=False
bAutoStopVirtualCam=False
bAutoStartStream=False
bAutoStopStream=False
bSwitchSceneOnStart=False
StartSceneName=
bSwitchSceneOnStop=False
StopSceneName=
bCreateChaptersOnMarkedFrames=True
bAddStartChapterWithMetadata=True
bMatchRecordDirectory=False
bLogFileCorrelation=True
ユーティリティクラス
| クラス | 場所 | 目的 |
|---|---|---|
FOBSRequestBatchBuilder | Utilities/ | バッチリクエスト用のフルエントビルダー |
FOBSJsonBuilder | Utilities/ | フルエントな JSON オブジェクト構築 |
リクエストタイプ定数
すべての OBS WebSocket リクエストタイプとフィールド名は Core/Types/InhyeongOBSRequestTypes.h に集約されています。
#include "Core/Types/InhyeongOBSRequestTypes.h"
// Request types
OBSRequests::GetSceneList // "GetSceneList"
OBSRequests::SetCurrentProgramScene // "SetCurrentProgramScene"
OBSRequests::StartRecord // "StartRecord"
// Field names
OBSFields::SceneName // "sceneName"
OBSFields::InputName // "inputName"
OBSFields::SceneItemId // "sceneItemId"
これによりタイポを防ぎ、プロトコルの更新管理が容易になります。
JSON ビルダーユーティリティ
FOBSJsonBuilder は OBS リクエスト向けのフルエントな JSON 構築機能を提供します。
#include "Utilities/InhyeongOBSJsonBuilder.h"
// Basic usage
TSharedPtr<FJsonObject> Data = FOBSJsonBuilder::Create()
.Add(TEXT("sceneName"), SceneName)
.Add(TEXT("sceneItemId"), SceneItemId)
.Add(TEXT("sceneItemEnabled"), true)
.Build();
// Conditional additions
TSharedPtr<FJsonObject> Settings = FOBSJsonBuilder::Create()
.Add(TEXT("sourceName"), SourceName)
.Add(TEXT("imageFormat"), TEXT("png"))
.AddIfPositive(TEXT("imageWidth"), Width) // Only adds if > 0
.AddIfPositive(TEXT("imageHeight"), Height)
.AddIfInRange(TEXT("imageCompressionQuality"), Quality, 0, 100)
.Build();
// Nested objects
TSharedPtr<FJsonObject> Transform = FOBSJsonBuilder::Create()
.Add(TEXT("positionX"), 100.0f)
.Add(TEXT("positionY"), 200.0f)
.Build();
TSharedPtr<FJsonObject> Request = FOBSJsonBuilder::Create()
.Add(TEXT("sceneName"), SceneName)
.Add(TEXT("sceneItemId"), ItemId)
.Add(TEXT("sceneItemTransform"), Transform)
.Build();
使用可能なメソッド:
| メソッド | 説明 |
|---|---|
Add(Key, Value) | 文字列、int32、int64、float、double、bool、または JSON オブジェクトを追加する |
AddIfNotEmpty(Key, String) | 文字列が空でない場合のみ追加する |
AddIfPositive(Key, Number) | 数値が 0 より大きい場合のみ追加する |
AddIfInRange(Key, Value, Min, Max) | 値が範囲内の場合のみ追加する |
Build() | 構築した TSharedPtr<FJsonObject> を返す |
HasFields() | フィールドが追加されているか確認する |
ハンドラーアーキテクチャ
WebSocket クライアントは整理のためにモジュール式のハンドラーを使用しています。
UInhyeongOBSWebSocketClient
├── UInhyeongOBSOutputs (Stream, Record, VirtualCam, ReplayBuffer)
├── UInhyeongOBSScenes (Scene switching, scene items)
├── UInhyeongOBSAudio (Audio inputs, volume, mute)
├── UInhyeongOBSInputSettings (Text, browser, image, media source settings)
├── UInhyeongOBSMediaInputs (Media playback control)
├── UInhyeongOBSStudioMode (Preview scene, studio transitions)
├── UInhyeongOBSTransitions (Scene transitions, duration, settings)
├── UInhyeongOBSFilters (Source filter management)
├── UInhyeongOBSScreenshots (Screenshot capture and texture conversion)
├── UInhyeongOBSConfig (Scene collections, profiles, video settings, persistent data)
└── UInhyeongOBSGeneral (Stats, hotkeys, vendor requests, custom events)
ハンドラーへのアクセス:
Client->GetOutputs()
Client->GetScenes()
Client->GetAudio()
Client->GetInputSettings()
Client->GetMediaInputs()
Client->GetStudioMode()
Client->GetTransitions()
Client->GetFilters()
Client->GetScreenshots()
Client->GetConfig()
Client->GetGeneral()
シーケンサーアーキテクチャ
シーケンサー統合は Unreal のムービーシーンパターンに従っています。
Runtime Module (InhyeongOBSWebSocket)
├── EventTriggersTrack/ Discrete action tracks
│ ├── UMovieSceneOBSTrack Track container with playback settings
│ ├── UMovieSceneOBSSection Section with action parameters
│ ├── FMovieSceneOBSTemplate Evaluation template (boundary detection)
│ ├── FOBSExecutionToken Execution token for firing actions
│ └── PreAnimatedState/ State restoration handlers
│ ├── FOBSOutputPreAnimatedState
│ ├── FOBSScenesPreAnimatedState
│ ├── FOBSAudioPreAnimatedState
│ ├── FOBSTransitionsPreAnimatedState
│ ├── FOBSStudioModePreAnimatedState
│ ├── FOBSFiltersPreAnimatedState
│ └── FOBSSourcesPreAnimatedState
├── KeyframeableTrack/ Interpolated property tracks
│ ├── Audio/
│ │ ├── UMovieSceneOBSVolumeTrack Volume track (targets InputName)
│ │ ├── UMovieSceneOBSVolumeSection Float channel for volume dB
│ │ ├── FMovieSceneOBSVolumeTemplate Continuous evaluation
│ │ ├── FOBSVolumePreAnimatedState Capture/restore volume
│ │ ├── UMovieSceneOBSBalanceTrack Balance track (targets InputName)
│ │ ├── UMovieSceneOBSBalanceSection Float channel for L/R balance
│ │ ├── FMovieSceneOBSBalanceTemplate Continuous evaluation
│ │ └── FOBSBalancePreAnimatedState Capture/restore balance
│ ├── Scene/
│ │ ├── UMovieSceneOBSTransformTrack Transform track (targets Scene+Source)
│ │ ├── UMovieSceneOBSTransformSection Float/Int channels for transform
│ │ ├── FMovieSceneOBSTransformTemplate Continuous evaluation
│ │ └── FOBSTransformPreAnimatedState Capture/restore transform
│ ├── Sources/
│ │ ├── UMovieSceneOBSColorSourceTrack Color source track (targets InputName)
│ │ ├── UMovieSceneOBSColorSourceSection 4 float channels for RGBA
│ │ ├── FMovieSceneOBSColorSourceTemplate Continuous evaluation, ABGR conversion
│ │ └── FOBSColorSourcePreAnimatedState Capture/restore with format conversion
│ ├── Media/
│ │ ├── UMovieSceneOBSMediaCursorTrack Media cursor track (targets InputName)
│ │ ├── UMovieSceneOBSMediaCursorSection Single float channel for cursor (ms)
│ │ ├── FMovieSceneOBSMediaCursorTemplate Continuous evaluation, float→int64
│ │ └── FOBSMediaCursorPreAnimatedState Capture/restore cursor position
│ ├── Filters/
│ │ ├── UMovieSceneOBSFilterSettingTrack Generic filter setting track (targets Source+Filter+Setting)
│ │ ├── UMovieSceneOBSFilterSettingSection Float channel for any numeric setting
│ │ ├── FMovieSceneOBSFilterSettingTemplate Continuous evaluation with JSON overlay
│ │ ├── FOBSFilterSettingPreAnimatedState Capture/restore from filter cache
│ │ └── FOBSCommonFilterSettings UI hints for known filter types
│ └── Transitions/
│ ├── UMovieSceneOBSTransitionDurationTrack Duration track (current transition)
│ ├── UMovieSceneOBSTransitionDurationSection Float channel for duration ms
│ ├── FMovieSceneOBSTransitionDurationTemplate Continuous evaluation, handles fixed transitions
│ └── FOBSTransitionDurationPreAnimatedState Capture/restore duration
├── ContinuousStateTrack/ State-holding tracks (no keyframes)
│ ├── Audio/
│ │ ├── OBSMuteStatePreAnimatedState Capture/restore mute state
│ │ ├── MovieSceneOBSMuteStateSection Section with bMuteState property
│ │ ├── MovieSceneOBSMuteStateTrack Track targeting InputName
│ │ ├── MovieSceneOBSMuteStateTemplate Setup/Evaluate/TearDown
│ │ ├── OBSMonitorTypeStatePreAnimatedState Capture/restore monitor type
│ │ ├── MovieSceneOBSMonitorTypeStateSection Section with MonitorType enum
│ │ ├── MovieSceneOBSMonitorTypeStateTrack Track targeting InputName
│ │ └── MovieSceneOBSMonitorTypeStateTemplate Setup/Evaluate/TearDown
│ ├── Scene/
│ │ ├── OBSVisibilityStatePreAnimatedState Capture/restore visibility
│ │ ├── MovieSceneOBSVisibilityStateSection Section with bVisible property
│ │ ├── MovieSceneOBSVisibilityStateTrack Track targeting Scene+ItemId
│ │ ├── MovieSceneOBSVisibilityStateTemplate Setup/Evaluate/TearDown
│ │ ├── OBSBlendModeStatePreAnimatedState Capture/restore blend mode
│ │ ├── MovieSceneOBSBlendModeStateSection Section with BlendMode enum
│ │ ├── MovieSceneOBSBlendModeStateTrack Track targeting Scene+ItemId
│ │ ├── MovieSceneOBSBlendModeStateTemplate Setup/Evaluate/TearDown
│ │ ├── OBSLockStatePreAnimatedState Capture/restore lock state
│ │ ├── MovieSceneOBSLockStateSection Section with bLocked property
│ │ ├── MovieSceneOBSLockStateTrack Track targeting Scene+ItemId
│ │ └── MovieSceneOBSLockStateTemplate Setup/Evaluate/TearDown
│ ├── Filter/
│ │ ├── OBSFilterEnabledStatePreAnimatedState Capture/restore filter enabled
│ │ ├── MovieSceneOBSFilterEnabledStateSection Section with bEnabled property
│ │ ├── MovieSceneOBSFilterEnabledStateTrack Track targeting Source+Filter
│ │ └── MovieSceneOBSFilterEnabledStateTemplate Setup/Evaluate/TearDown
│ ├── StudioMode/
│ │ ├── OBSStudioModeStatePreAnimatedState Capture/restore studio mode
│ │ ├── MovieSceneOBSStudioModeStateSection Section with bEnabled property
│ │ ├── MovieSceneOBSStudioModeStateTrack Global track (no target)
│ │ └── MovieSceneOBSStudioModeStateTemplate Setup/Evaluate/TearDown
│ └── Transitions/
│ ├── OBSTransitionStatePreAnimatedState Capture/restore current transition
│ ├── MovieSceneOBSTransitionStateSection Section (presence = apply)
│ ├── MovieSceneOBSTransitionStateTrack Track with TransitionName target
│ └── MovieSceneOBSTransitionStateTemplate Setup/Evaluate/TearDown
├── MediaSyncTrack/ Timeline-synchronized media playback
│ ├── OBSMediaSyncPreAnimatedState Capture/restore media state+position
│ ├── MovieSceneOBSMediaSyncSection Section defines sync window
│ ├── MovieSceneOBSMediaSyncTrack Track targeting MediaInputName
│ └── MovieSceneOBSMediaSyncTemplate Play/pause/seek synchronization
Editor Module (InhyeongOBSWebSocketEditor)
├── Sequencer/
│ ├── Shared/
│ │ └── OBSSequencerMenuRegistry Centralized menu building (prevents duplicates)
│ ├── EventTriggersTrack/
│ │ ├── FMovieSceneOBSTrackEditor Track editor for event trigger
│ │ └── FMovieSceneOBSSectionInterface Section display
│ ├── KeyframeableTrack/
│ │ ├── FOBSKeyframeableTrackEditorBase Shared base for all keyframeable editors
│ │ └── [Category]/FOBSXxxTrackEditor Per-track editors (Volume, Balance, etc.)
│ ├── ContinuousStateTrack/
│ │ ├── FOBSContinuousStateTrackEditorBase Shared base for all continuous state editors
│ │ ├── FOBSContinuousStateSectionInterface Shared section display (colored bar)
│ │ └── [Category]/FOBSXxxStateTrackEditor Per-track editors (Mute, Visibility, etc.)
│ └── MediaSyncTrack/
│ ├── FOBSMediaSyncTrackEditor Track editor with media input picker
│ └── FOBSMediaSyncSectionInterface Section display with offset indicator
└── DetailsCustomization/
└── Sequencer/
├── EventTriggersTrack/ Action params customization
├── KeyframeableTrack/ Target pickers (Input, Scene+Item, etc.)
├── ContinuousStateTrack/ Target pickers per track type
└── MediaSyncTrack/ Track + Section customizations
├── FOBSSequencerActionExecutor Routes to correct OBS client
├── FOBSSequencerActionQueue Throttling, deduplication, batching
└── FOBSSequencerActionRegistry Action metadata registry
主要クラス:
| クラス | 目的 |
|---|---|
FOBSSequencerActionRegistry | 40 以上のアクションとメタデータの静的レジストリ |
FOBSSequencerActionQueue | 33ms スロットリング(約 30fps)、重複排除、バッチ最適化(最大 48 アクション/バッチ)を備えたシングルトンキュー |
FOBSOutputPreAnimatedState | 再生前に出力の状態をキャプチャして復元するためのクラス |
FOBSSequencerActionExecutor | アクションを正しい OBS クライアント(Editor または Game サブシステム)にルーティングする |
新しいシーケンサーアクションの追加
InhyeongOBSSequencerTypes.hのEOBSSequencerActionに列挙値を追加する。InhyeongOBSSequencerTypes.cppにREGISTER_ACTIONブロックを追加する。OBSSequencerActionExecutor.cppに実行ケースを追加する。- バッチ処理を使用する場合は
OBSSequencerActionQueue.cppにバッチリクエスト構築を追加する。
事前アニメーション状態サポートの追加
OBS 設定を変更する State タイプのアクションには、状態の復元を実装します。
Sequencer/EventTriggersTrack/にFOBS[Handler]PreAnimatedStateを作成する。IPersistentEvaluationDataを継承する。- ハンドラーのキャッシュ値を使用して
CaptureFrom()を実装する(非同期不可)。 - 150ms のデバウンスを使って
RestoreTo()を実装する。 MovieSceneOBSTemplate::SupportsPreAnimatedState()を更新してカテゴリを含める。MovieSceneOBSTemplate.cppに Setup/TearDown ブロックを追加する。
事前アニメーション状態のパターン:
// In Setup() - capture before section modifies OBS
FOBS[Handler]PreAnimatedState& State = PersistentData.GetOrAddSectionData();
if (!State.bHasCapturedState)
{
State.CaptureFrom(Handler, EntryAction);
}
// In TearDown() - restore when section becomes inactive
FOBS[Handler]PreAnimatedState* State = PersistentData.FindSectionData();
if (State && State->bHasCapturedState)
{
State->RestoreTo(Handler);
}
新しい Continuous State Track の追加
各 Continuous State Track は Sequencer/ContinuousStateTrack/[Handler]/ に 4 つのファイルが必要です。
| ファイル | 目的 |
|---|---|
OBS[State]PreAnimatedState.h/.cpp | キャプチャ/復元、冪等な ApplyState() |
MovieSceneOBS[State]Section.h/.cpp | 単純なプロパティ(bool/enum)、チャンネルなし |
MovieSceneOBS[State]Track.h/.cpp | ターゲット識別を持つコンテナ |
MovieSceneOBS[State]Template.h/.cpp | Setup でキャプチャ、Evaluate で適用、TearDown で復元 |
重要な実装ルール:
- PreAnimatedState は
IPersistentEvaluationDataを継承する(USTRUCT は不可)。 ApplyState()は冪等でなければならない(送信前にbStateIsAppliedを確認すること)。Track::CreateTemplateForSectionは直接リターンを使用する(*newは不可)。- Section には
FMovieSceneFloatChannelを持たず、単純なプロパティのみ。 - Section のコンストラクタで
EvalOptions.CompletionMode = RestoreStateを設定する。 - テンプレートは永続データに
GetOrAddTrackData<>()/FindTrackData<>()を使用する。
新しい Keyframeable Track の追加
各キーフレーム対応プロパティは Sequencer/KeyframeableTrack/[Category]/ に 4 つのファイルが必要です。
| ファイル | 目的 |
|---|---|
OBS[Property]PreAnimatedState.h/.cpp | OBS の元の状態をキャプチャ/復元する |
MovieSceneOBS[Property]Section.h/.cpp | FMovieSceneFloatChannel キーフレームを格納する |
MovieSceneOBS[Property]Track.h/.cpp | ターゲット識別を持つコンテナ |
MovieSceneOBS[Property]Template.h/.cpp | 継続的な評価、差分しきい値の送信 |
重要な実装ルール:
- PreAnimatedState は
IPersistentEvaluationDataを継承する(USTRUCT は不可)。 Track::CreateTemplateForSectionは直接リターンを使用する(*newは不可)。- テンプレートは永続データに
GetOrAddSectionData<>()/FindSectionData<>()を使用する。 Setup()はFOBSSequencerActionExecutor::GetClientForContext()を通じてクライアントを PreAnimatedState にキャッシュする。Evaluate()はState->CachedClient.Get()からクライアントを取得する(Evaluateでは利用できない Player コンテキストからは取得しないこと)。Evaluate()はスロットリング/バッチ処理のためにFOBSSequencerActionQueue::Get().EnqueueAction()を経由してルーティングする。- 差分しきい値のチェックはエンキューの前に行い、不要なアクション生成を避ける。
シーケンサーエディタ UI
すべてのトラックには洗練されたエディタ体験が用意されています。
トラックアウトライナー:
- 接続ステータスインジケーター(緑/赤のドット)
- 再生ヘッドでセクションを追加するクイック「+」ボタン
FMovieSceneFloatChannelによるカーブエディタの自動統合
詳細パネルのカスタマイズ:
| トラック | ターゲット選択 | 備考 |
|---|---|---|
| Volume / Balance | 音声入力のドロップダウン | 音声対応の入力のみに絞り込まれる |
| Transform | シーン → シーンアイテムのカスケード | シーンアイテムは「SourceName (ID: 123)」形式で表示される |
| Filter Setting | ソース → フィルターのカスケード | 設定名は手動入力(OBS 内部キー) |
| Transition Duration | なし(現在のトランジションに影響) | 接続時に現在のトランジション情報を表示する |
| Color Source | カラーソースのドロップダウン | color_source 入力のみに絞り込まれる |
| Media Cursor | メディア入力のドロップダウン | ffmpeg_source/vlc_source のみに絞り込まれる |
ドロップダウンの設定:
- すべてのドロップダウンは OBS クライアントのキャッシュから設定されます。
- 更新ボタンは OBS からのフルデータ更新をトリガーします。
- 切断中はプレースホルダーテキスト「(Connect to OBS first)」が表示されます。
- カスケード選択では、親が変更されると子の選択がクリアされます。
エディタモジュールアーキテクチャ
エディタモジュールは詳細パネルのカスタマイズにセクションビルダーパターンを使用しています。
FInhyeongOBSComponentCustomization
├── FOBSConnectionSectionBuilder
├── FOBSScenesSectionBuilder
├── FOBSSceneItemTransformsSectionBuilder
├── FOBSStudioModeSectionBuilder
├── FOBSTransitionsSectionBuilder
├── FOBSRecordingStreamingSectionBuilder
├── FOBSVirtualCamSectionBuilder
├── FOBSReplayBufferSectionBuilder
├── FOBSAdvancedOutputsSectionBuilder
├── FOBSAudioInputsSectionBuilder
├── FOBSMediaInputsSectionBuilder
├── FOBSInputSettingsSectionBuilder
├── FOBSFiltersSectionBuilder
├── FOBSScreenshotsSectionBuilder
├── FOBSWatchedScenesSectionBuilder
└── FOBSConfigSectionBuilder
FInhyeongOBSTriggerVolumeCustomization
├── FOBSTriggerShapeSectionBuilder
├── FOBSTriggerSettingsSectionBuilder
├── FOBSTriggerConditionsSectionBuilder
├── FOBSTriggerActionsSectionBuilder
└── FOBSTriggerTestSectionBuilder
セクションビルダーの基底クラス
FOBSSectionBuilderBase: OBS Component セクションの基底クラス:
class FOBSSectionBuilderBase : public TSharedFromThis<FOBSSectionBuilderBase>
{
public:
void Initialize(const TSharedRef<FOBSSectionContext>& InContext);
virtual void BuildSection(IDetailCategoryBuilder& Category) = 0;
virtual FText GetSectionTitle() const = 0;
virtual bool IsInitiallyCollapsed() const { return false; }
virtual void BindToEvents() {}
virtual void UnbindFromEvents() {}
void RequestRefresh();
protected:
bool IsConnected() const;
UInhyeongOBSEditorSubsystem* GetSubsystem() const;
UInhyeongOBSWebSocketClient* GetClient() const;
TAttribute<bool> MakeEnabledWhenConnected() const;
};
FOBSTriggerVolumeSectionBuilderBase: Trigger Volume セクションの基底クラス:
class FOBSTriggerVolumeSectionBuilderBase : public TSharedFromThis<FOBSTriggerVolumeSectionBuilderBase>
{
public:
void Initialize(const TSharedRef<FOBSTriggerVolumeSectionContext>& InContext);
virtual void BuildSection(IDetailCategoryBuilder& Category) = 0;
virtual FText GetSectionTitle() const = 0;
protected:
AInhyeongOBSTriggerVolume* GetTriggerVolume() const;
// ... same helpers as FOBSSectionBuilderBase
};
セクションコンテキスト構造体
FOBSSectionContext: コンポーネントセクション用の共有データ:
struct FOBSSectionContext
{
UInhyeongOBSEditorSubsystem* Subsystem;
UInhyeongOBSWebSocketClient* Client;
TWeakObjectPtr<UInhyeongOBSComponent> Component;
IDetailLayoutBuilder* DetailBuilder;
TSharedPtr<bool> ValidityFlag; // Set false on destruction
bool IsValid() const;
bool IsConnected() const;
UInhyeongOBSOutputs* GetOutputs() const;
UInhyeongOBSScenes* GetScenes() const;
UInhyeongOBSAudio* GetAudio() const;
UInhyeongOBSInputSettings* GetInputSettings() const;
UInhyeongOBSMediaInputs* GetMediaInputs() const;
};
FOBSTriggerVolumeSectionContext: トリガーボリュームセクション用の共有データ:
struct FOBSTriggerVolumeSectionContext
{
UInhyeongOBSEditorSubsystem* Subsystem;
UInhyeongOBSWebSocketClient* Client;
TWeakObjectPtr<AInhyeongOBSTriggerVolume> TriggerVolume;
IDetailLayoutBuilder* DetailBuilder;
TSharedPtr<bool> ValidityFlag;
bool IsValid() const;
bool IsConnected() const;
// ... handler accessors
};
主要な型
列挙型:
EOBSConnectionState: Disconnected、Connecting、Authenticating、ConnectedEOBSOutputState: Starting、Started、Stopping、Stopped、Paused、Resumed などEOBSMediaInputAction: None、Play、Pause、Stop、Restart、Next、PreviousEOBSMediaState: Unknown、None、Playing、Paused、Stopped、Buffering、Ended、Error、OpeningEOBSTriggerActionType: サポートされるすべてのトリガーアクションEOBSTriggerShape: Box、SphereEOBSTriggerEvent: OnEnter、OnExit、BothEOBSRequestBatchExecutionType: SerialRealtime、SerialFrame、ParallelEOBSMonitorType: None、MonitorOnly、MonitorAndOutput
構造体:
FOBSScene: シーン名、UUID、インデックスFOBSSceneItem: シーン内のソース情報(ロック状態、ブレンドモードを含む)FOBSSceneWithItems: シーンとそのすべてのアイテムFOBSInput: 音量/ミュート情報を持つ入力FOBSStreamStatus/FOBSRecordStatus: タイムコード付きの出力ステータスFOBSMediaInputStatus: メディア状態、再生時間、カーソル位置FOBSTriggerAction: Trigger Volume のアクション設定FOBSTriggerConditions: トリガーの条件設定FOBSBatchRequest/FOBSBatchResult: バッチリクエスト/レスポンスデータFOBSTransition: トランジション名、UUID、種類、設定可能フラグ、固定フラグFOBSSourceFilter: フィルター名、種類、インデックス、有効状態、設定FOBSCurrentTransitionInfo: 設定を含む完全なトランジション詳細FOBSSceneItemTransform: 位置、スケール、回転、クロップ、バウンド、ソースのサイズEOBSBoundsType: None、Stretch、ScaleInner、ScaleOuter、ScaleToWidth、ScaleToHeight、MaxOnlyEOBSBlendMode: Normal、Additive、Subtract、Screen、Multiply、Lighten、DarkenFOBSScreenshotRequest: スクリーンショットのキャプチャパラメーター(ソース、フォーマット、サイズ、品質、パス)FOBSScreenshotResult: base64 画像データを含むキャプチャ結果FOBSScreenshotSavedResult: ファイルパス確認付きの保存結果FOBSSceneTransitionOverride: シーンごとのトランジションの上書き(名前、時間、bHasOverride)FOBSProfileParameter: パラメーター値とデフォルト値FOBSStreamServiceSettings: 配信先の設定(サーバー、ストリームキー、認証)FOBSAudioTracks: トラック 1 ~ 6 の有効状態とヘルパーメソッドFOBSSpecialInputs: デフォルト音声デバイス名(Desktop1/2、Mic1 ~ 4)FOBSOutput: 汎用出力情報(名前、種類、サイズ、アクティブ状態、フラグ)FOBSOutputStatus: 汎用出力ステータス(名前、アクティブ、再接続中、タイムコード、再生時間、輻輳、バイト数、フレーム数)
キャッシュ:
- 入力設定は
GetInputSettings()での取得後にUInhyeongOBSInputSettingsにキャッシュされます。 - キャッシュされたデータへのアクセスには
GetCachedInputSettings()/GetCachedInputSettingsString()を使用します。 - データが利用可能かどうかは
HasCachedSettings()で確認します。 - キャッシュの無効化には
ClearCachedSettings()/ClearAllCachedSettings()を使用します。
詳細パネルのカスタマイズ
プラグインは詳細パネルにモジュール式のセクションビルダーパターンを使用しています。
FOBSSectionBuilderBase: OBS Component セクションの基底クラスFOBSTriggerVolumeSectionBuilderBase: Trigger Volume セクションの基底クラスFOBSDetailsPanelStyle: 共有スタイル定数とウィジェットビルダー
各セクション(接続、シーン、録画など)は個別のビルダークラスとして実装されています。
アイデンティティリゾルバー(名前 → UUID の再バインド)
OBS はシーンアイテムを数値の SceneItemId でキー管理しており、この ID はデザイナーには見えず、ストリーム中にソースが名前変更されると変わります。Core/InhyeongOBSIdentityResolver.h(OBSIdentity::FindSceneItemByName / FindSceneItemByUuids および FOBSIdentityBindingCache)はソースを名前で解決し、シーン/ソースの UUID を記憶します。後で名前による検索が失敗した場合は UUID で再バインドするため、名前でソースをターゲットにするトリガーは名前変更後も動作し続けます。このリゾルバーは Trigger Volume の「Set Source Visibility」アクションに組み込まれています。キャッシュはランタイムのみで、シーンコレクション切り替え時にリセットされます。
認証
プラグインはプラットフォーム依存なしに SHA256 認証を内部で実装しています。実装の詳細については InhyeongOBSAuth.h を参照してください。
リクエストのバッチ処理
効率的なバッチリクエストには FOBSRequestBatchBuilder を使用します。
FOBSRequestBatchBuilder::Create(Client)
.SetCurrentProgramScene("Scene1")
.StartRecord()
.SetInputMute("Mic", false)
.HaltOnFailure(true)
.SetExecutionType(EOBSRequestBatchExecutionType::SerialRealtime)
.ExecuteWithCallback([](const FOBSBatchResult& Result) {
// Handle results
});
使用可能なバッチメソッド:
- シーン:
GetSceneList()、SetCurrentProgramScene()、GetCurrentProgramScene()、CreateScene()、RemoveScene()、SetSceneName()、GetSceneSceneTransitionOverride()、SetSceneSceneTransitionOverride()、SetSceneItemEnabled()、CreateSceneItem()、RemoveSceneItem()、DuplicateSceneItem()、GetSceneItemLocked()、SetSceneItemLocked()、GetSceneItemIndex()、SetSceneItemIndex()、GetSceneItemBlendMode()、SetSceneItemBlendMode() - 設定:
GetSceneCollectionList()、SetCurrentSceneCollection()、CreateSceneCollection()、GetProfileList()、SetCurrentProfile()、CreateProfile()、RemoveProfile()、GetProfileParameter()、SetProfileParameter()、GetVideoSettings()、SetVideoSettings()、SetBaseResolution()、SetOutputResolution()、SetFPS() - 配信:
StartStream()、StopStream()、ToggleStream()、GetStreamStatus() - 録画:
StartRecord()、StopRecord()、ToggleRecord()、PauseRecord()、ResumeRecord()、GetRecordStatus() - 仮想カメラ:
StartVirtualCam()、StopVirtualCam()、ToggleVirtualCam()、GetVirtualCamStatus() - リプレイバッファ:
StartReplayBuffer()、StopReplayBuffer()、ToggleReplayBuffer()、SaveReplayBuffer()、GetReplayBufferStatus() - 録画の保存先ディレクトリ:
GetRecordDirectory()、SetRecordDirectory() - 録画の分割/チャプター:
SplitRecordFile()、CreateRecordChapter() - 汎用出力:
GetOutputList()、GetOutputStatus()、GetOutputSettings()、SetOutputSettings()、StartOutput()、StopOutput()、ToggleOutput() - 配信キャプション:
SendStreamCaption() - 音声:
GetInputList()、SetInputMute()、ToggleInputMute()、SetInputVolume()、GetInputKindList()、CreateInput()、RemoveInput()、RemoveInputByUuid()、SetInputName()、GetInputAudioBalance()、GetInputAudioBalanceByUuid()、SetInputAudioBalance()、SetInputAudioBalanceByUuid()、GetInputAudioSyncOffset()、GetInputAudioSyncOffsetByUuid()、SetInputAudioSyncOffset()、SetInputAudioSyncOffsetByUuid()、GetInputAudioMonitorType()、GetInputAudioMonitorTypeByUuid()、SetInputAudioMonitorType()、SetInputAudioMonitorTypeByUuid()、GetInputAudioTracks()、GetInputAudioTracksByUuid()、SetInputAudioTracks()、SetInputAudioTracksByUuid()、GetSpecialInputs() - 入力設定:
GetInputSettings()、SetInputSettings()、GetInputDefaultSettings()、SetTextSourceText()、SetBrowserSourceUrl()、SetImageSourceFile()、SetMediaSourceFile()、SetColorSourceColor() - メディア:
TriggerMediaInputAction()、GetMediaInputStatus()、SetMediaInputCursor()、OffsetMediaInputCursor() - Studio Mode:
GetStudioModeEnabled()、SetStudioModeEnabled()、GetCurrentPreviewScene()、SetCurrentPreviewScene()、SetCurrentPreviewSceneByUuid()、TriggerStudioModeTransition() - トランジション:
GetSceneTransitionList()、GetCurrentSceneTransition()、SetCurrentSceneTransition()、SetCurrentSceneTransitionDuration()、SetCurrentSceneTransitionSettings()、GetCurrentSceneTransitionCursor() - スクリーンショット:
GetSourceScreenshot()、GetSourceScreenshotByUuid()、GetSourceScreenshotWithOptions()、SaveSourceScreenshot()、SaveSourceScreenshotByUuid()、SaveSourceScreenshotWithOptions() - フィルター:
GetSourceFilterKindList()、GetSourceFilterList()、GetSourceFilterListByUuid()、GetSourceFilter()、GetSourceFilterDefaultSettings()、CreateSourceFilter()、RemoveSourceFilter()、SetSourceFilterName()、SetSourceFilterIndex()、SetSourceFilterEnabled()、SetSourceFilterSettings()
内部構成:
バッチビルダーの実装は保守性のため複数のファイルに分割されています。
| ファイル | 内容 |
|---|---|
InhyeongOBSRequestBatch.cpp | コア、設定、実行 |
InhyeongOBSRequestBatch_Scenes.cpp | シーンおよびシーンアイテムのリクエスト |
InhyeongOBSRequestBatch_Outputs.cpp | 配信、録画、仮想カメラ、リプレイバッファ |
InhyeongOBSRequestBatch_Audio.cpp | 音声、メディア入力、入力設定 |
InhyeongOBSRequestBatch_Filters.cpp | ソースフィルターの管理 |
InhyeongOBSRequestBatch_StudioMode.cpp | Studio Mode とトランジション |
InhyeongOBSRequestBatch_Config.cpp | スクリーンショット、プロファイル、シーンコレクション、映像設定 |
新機能の追加
InhyeongOBSTypes.hに型/デリゲートを追加する。- 適切なハンドラー(
Outputs、Scenes、Inputs、MediaInputs)に実装する。 - 必要に応じて
Client、Subsystem、Componentに便利メソッドを追加する。 - クライアントの
ProcessOBSEvent()でイベントを処理する。 - 適切なセクションビルダーに UI を追加する。
新しいエディタセクションの追加
FOBSSectionBuilderBaseまたはFOBSTriggerVolumeSectionBuilderBaseを継承した新しいセクションビルダークラスを作成する。BuildSection()、GetSectionTitle()、および必要に応じてIsInitiallyCollapsed()を実装する。- セクションにライブ更新が必要な場合は
BindToEvents()とUnbindFromEvents()をオーバーライドする。 - カスタマイズクラスの
CreateSectionBuilders()メソッドにビルダーを追加する。 - 一貫したスタイリングのために
FOBSDetailsPanelStyleを使用する。