TASK 21 Increment A: media-source model + persistence (schema migration + round-trip test)
SourceType.MediaSource added; MediaSourceType (Video/Audio) and MediaPlaybackState (Stopped/Playing/Paused) enums. Source gains MediaPath, MediaIsLooping, MediaVolume (0-1 clamped), MediaPlaybackState. LayoutStore: MigrateSourceTable adds 4 guarded ALTERs (MediaPath, MediaIsLooping, MediaVolume, MediaPlaybackState); SELECT appends indices 26-29, INSERT adds 4 columns + params. Round-trip test MediaSource_Config_Survives_Save_And_Reload passes. Build 0 warnings, 245/247 tests (2 known pre-existing). Gated on creator run for later integration (ffmpeg).
This commit is contained in:
+59
-1
@@ -12,7 +12,23 @@ public enum SourceType
|
||||
TextOverlay,
|
||||
Countdown,
|
||||
WebSource,
|
||||
ChatBox
|
||||
ChatBox,
|
||||
MediaSource
|
||||
}
|
||||
|
||||
/// <summary>Distinguishes how a media source presents its content (TASK 21).</summary>
|
||||
public enum MediaSourceType
|
||||
{
|
||||
Video,
|
||||
Audio
|
||||
}
|
||||
|
||||
/// <summary>Playback state of a media source (TASK 21).</summary>
|
||||
public enum MediaPlaybackState
|
||||
{
|
||||
Stopped,
|
||||
Playing,
|
||||
Paused
|
||||
}
|
||||
|
||||
public enum ClipShape
|
||||
@@ -113,6 +129,48 @@ public class Source : SceneElement
|
||||
private string? _webUri;
|
||||
public string? WebUri { get => _webUri; set => Set(ref _webUri, value); }
|
||||
|
||||
// Media source config (TASK 21: video/audio file playback)
|
||||
private MediaSourceType _mediaType = MediaSourceType.Video;
|
||||
public MediaSourceType MediaType
|
||||
{
|
||||
get => _mediaType;
|
||||
set => Set(ref _mediaType, value);
|
||||
}
|
||||
|
||||
private string? _mediaPath;
|
||||
public string? MediaPath
|
||||
{
|
||||
get => _mediaPath;
|
||||
set
|
||||
{
|
||||
if (Set(ref _mediaPath, value))
|
||||
Raise(nameof(IsMediaSource));
|
||||
}
|
||||
}
|
||||
|
||||
private bool _mediaIsLooping;
|
||||
public bool MediaIsLooping
|
||||
{
|
||||
get => _mediaIsLooping;
|
||||
set => Set(ref _mediaIsLooping, value);
|
||||
}
|
||||
|
||||
private double _mediaVolume = 1.0;
|
||||
public double MediaVolume
|
||||
{
|
||||
get => _mediaVolume;
|
||||
set => Set(ref _mediaVolume, Math.Clamp(value, 0.0, 1.0));
|
||||
}
|
||||
|
||||
private MediaPlaybackState _mediaPlaybackState = MediaPlaybackState.Stopped;
|
||||
public MediaPlaybackState MediaPlaybackState
|
||||
{
|
||||
get => _mediaPlaybackState;
|
||||
set => Set(ref _mediaPlaybackState, value);
|
||||
}
|
||||
|
||||
public bool IsMediaSource => Type == SourceType.MediaSource;
|
||||
|
||||
// Chat box config (TASK 3.18)
|
||||
private double _chatFontSize = 16;
|
||||
public double ChatFontSize
|
||||
|
||||
Reference in New Issue
Block a user