feat: migrate legacy playout workflow and scenes

This commit is contained in:
2026-07-10 23:58:45 +09:00
parent 491a740505
commit 8dae7b8e0d
128 changed files with 39177 additions and 205 deletions

View File

@@ -53,6 +53,16 @@ internal sealed class FakeK3dSession : IK3dGuardedConnectSession
public PlayoutKtapConnectState LastKtapConnectState { get; private set; }
public bool SupportsLifecycleCallbacks { get; set; }
public bool? KtapHelloObserved { get; set; }
public bool HasPendingLifecycleCallbacks { get; set; }
public bool HasPendingPlayCallbacks { get; set; }
public bool ClearPendingLifecycleCallbacksAfterProcess { get; set; } = true;
public ConcurrentQueue<string> Calls { get; } = new();
public ConcurrentQueue<int> ThreadIds { get; } = new();
@@ -69,10 +79,14 @@ internal sealed class FakeK3dSession : IK3dGuardedConnectSession
public Action<PlayoutCue, int>? PrepareAction { get; set; }
public Action<PlayoutCue, int>? UpdateOnAirAction { get; set; }
public Action<int>? PlayAction { get; set; }
public Action<int, PlayoutTakeOutScope>? TakeOutAction { get; set; }
public Func<int, K3dCallbackDrainResult>? ProcessPendingCallbacksAction { get; set; }
public Action? AbandonAction { get; set; }
public Action<string>? CallObserver { get; set; }
@@ -155,6 +169,12 @@ internal sealed class FakeK3dSession : IK3dGuardedConnectSession
PrepareAction?.Invoke(cue, layoutIndex);
}
public void UpdateOnAir(PlayoutCue cue, int layoutIndex)
{
Record($"UpdateOnAir:{cue.SceneName}");
UpdateOnAirAction?.Invoke(cue, layoutIndex);
}
public void Play(int layoutIndex)
{
Record("Play");
@@ -167,6 +187,20 @@ internal sealed class FakeK3dSession : IK3dGuardedConnectSession
TakeOutAction?.Invoke(layoutIndex, scope);
}
public K3dCallbackDrainResult ProcessPendingCallbacks(int layoutIndex)
{
Record("ProcessPendingCallbacks");
var result = ProcessPendingCallbacksAction?.Invoke(layoutIndex)
?? new K3dCallbackDrainResult(0, 0, KtapHelloObserved == true);
if (ClearPendingLifecycleCallbacksAfterProcess)
{
HasPendingLifecycleCallbacks = false;
HasPendingPlayCallbacks = false;
}
return result;
}
public void Abandon()
{
TryPreventKtapConnect();
@@ -268,7 +302,7 @@ internal sealed class FakeLiveAuthorization : ILiveAuthorization
IsAuthorizedForThisLaunch = isAuthorizedForThisLaunch;
}
public bool IsAuthorizedForThisLaunch { get; }
public bool IsAuthorizedForThisLaunch { get; set; }
}
internal sealed class TrackingStaDispatcherFactory : IStaDispatcherFactory