49 lines
2.0 KiB
C#
49 lines
2.0 KiB
C#
namespace Lumi.Companion.App;
|
|
|
|
public enum TrayHealth { Ready, Operating, Degraded, Failed }
|
|
public enum CompanionPage { Overview, Transcription, Test, Connection, Logs, Settings }
|
|
public enum TestStageState { Waiting, Running, Passed, Blocked, Failed }
|
|
|
|
public sealed record CompanionState(
|
|
bool Paired = false,
|
|
bool Connected = false,
|
|
bool ObsBridgeInstalled = false,
|
|
bool ObsConnected = false,
|
|
bool ObsStreaming = false,
|
|
bool ObsRecording = false,
|
|
bool TestRunning = false,
|
|
TrayHealth Health = TrayHealth.Degraded,
|
|
string Detail = "Pair Lumi Companion to get started.",
|
|
string? DeviceName = null,
|
|
string? Host = null,
|
|
DateTimeOffset? LastConnectedAt = null,
|
|
bool UpdateAvailable = false,
|
|
string? AvailableVersion = null,
|
|
string UpdateDetail = "Checking for updates…",
|
|
bool ObsBridgeRepairNeeded = false,
|
|
bool ObsBridgePackageAvailable = false,
|
|
string ObsBridgeDetail = "Checking the managed OBS integration…")
|
|
{
|
|
public string Summary => Health switch
|
|
{
|
|
TrayHealth.Operating => "Transcription active",
|
|
TrayHealth.Ready => "Ready",
|
|
TrayHealth.Failed => "Needs attention",
|
|
_ when !Paired => "Setup required",
|
|
_ when !Connected => "Lumi offline",
|
|
_ when !ObsBridgeInstalled => "OBS setup required",
|
|
_ => "Partially ready"
|
|
};
|
|
|
|
public bool RequiresQuitConfirmation => ObsStreaming || ObsRecording;
|
|
public string QuitWarning => ObsStreaming
|
|
? "OBS is streaming. Quitting Lumi Companion will stop transcription and closed captions, but it will not stop the OBS stream."
|
|
: ObsRecording ? "OBS is recording. Quitting Lumi Companion will stop active companion features." : string.Empty;
|
|
}
|
|
|
|
public sealed record TestStage(string Name, string Detail, TestStageState State);
|
|
public sealed record ObsSource(string Uuid, string Name, bool Active, bool Missing)
|
|
{
|
|
public override string ToString() => Missing ? $"{Name} (missing)" : Active ? $"{Name} (active)" : Name;
|
|
}
|