diff --git a/se5/Haxor/PluginContract.cs b/se5/Haxor/PluginContract.cs index 9be97cc1..d9a9cbda 100644 --- a/se5/Haxor/PluginContract.cs +++ b/se5/Haxor/PluginContract.cs @@ -24,6 +24,16 @@ public sealed class PluginRequest public string VideoFileName { get; set; } = string.Empty; public double FrameRate { get; set; } + + /// Total video duration in seconds. Null when no video is loaded or on older SE versions. + public double? VideoDurationSeconds { get; set; } + + /// Video frame width in pixels. Null when no video is loaded or on older SE versions. + public int? VideoWidth { get; set; } + + /// Video frame height in pixels. Null when no video is loaded or on older SE versions. + public int? VideoHeight { get; set; } + public string UiLanguage { get; set; } = string.Empty; public string Theme { get; set; } = string.Empty; @@ -34,6 +44,12 @@ public sealed class PluginRequest /// This plugin's settings as last persisted by Subtitle Edit (null on first run). public JsonElement? Settings { get; set; } + + /// + /// Schema version this plugin attached to in its last response. + /// Null on first run, when settings were saved without a version, or on older SE versions. + /// + public int? SettingsVersion { get; set; } } /// Active theme colors. All values are #AARRGGBB hex strings. @@ -78,5 +94,11 @@ public sealed class PluginResponse /// Settings to persist; handed back unchanged in the next request. public JsonElement? Settings { get; set; } + /// + /// Schema version for . Bump when you change the shape of your + /// settings so you can migrate or reset on the next run. Optional; null = "unversioned". + /// + public int? SettingsVersion { get; set; } + public string? UndoDescription { get; set; } } diff --git a/se5/Plugin-Shared/PluginContract.cs b/se5/Plugin-Shared/PluginContract.cs index 00147bd6..061e791d 100644 --- a/se5/Plugin-Shared/PluginContract.cs +++ b/se5/Plugin-Shared/PluginContract.cs @@ -16,6 +16,16 @@ public sealed class PluginRequest public List SelectedIndices { get; set; } = new(); public string VideoFileName { get; set; } = string.Empty; public double FrameRate { get; set; } + + /// Total video duration in seconds. Null when no video is loaded or on older SE versions. + public double? VideoDurationSeconds { get; set; } + + /// Video frame width in pixels. Null when no video is loaded or on older SE versions. + public int? VideoWidth { get; set; } + + /// Video frame height in pixels. Null when no video is loaded or on older SE versions. + public int? VideoHeight { get; set; } + public string UiLanguage { get; set; } = string.Empty; public string Theme { get; set; } = string.Empty; @@ -24,6 +34,13 @@ public sealed class PluginRequest public string SeVersion { get; set; } = string.Empty; public JsonElement? Settings { get; set; } + + /// + /// Schema version this plugin attached to in its last response. + /// Null on first run, when settings were saved without a version, or on older SE versions. + /// Use it to migrate or reset settings written by an older build of this plugin. + /// + public int? SettingsVersion { get; set; } } /// Active theme colors. All values are #AARRGGBB hex strings. @@ -53,6 +70,14 @@ public sealed class PluginResponse public string? Message { get; set; } public PluginSubtitle? Subtitle { get; set; } public JsonElement? Settings { get; set; } + + /// + /// Schema version for . Bump when you change the shape of your + /// settings so you can detect (and migrate or reset) stale data on the next run via + /// . Optional; null = "unversioned". + /// + public int? SettingsVersion { get; set; } + public string? UndoDescription { get; set; } } diff --git a/se5/TypewriterEffect/PluginContract.cs b/se5/TypewriterEffect/PluginContract.cs index aa497852..121af386 100644 --- a/se5/TypewriterEffect/PluginContract.cs +++ b/se5/TypewriterEffect/PluginContract.cs @@ -15,6 +15,16 @@ public sealed class PluginRequest public List SelectedIndices { get; set; } = new(); public string VideoFileName { get; set; } = string.Empty; public double FrameRate { get; set; } + + /// Total video duration in seconds. Null when no video is loaded or on older SE versions. + public double? VideoDurationSeconds { get; set; } + + /// Video frame width in pixels. Null when no video is loaded or on older SE versions. + public int? VideoWidth { get; set; } + + /// Video frame height in pixels. Null when no video is loaded or on older SE versions. + public int? VideoHeight { get; set; } + public string UiLanguage { get; set; } = string.Empty; public string Theme { get; set; } = string.Empty; @@ -23,6 +33,12 @@ public sealed class PluginRequest public string SeVersion { get; set; } = string.Empty; public JsonElement? Settings { get; set; } + + /// + /// Schema version this plugin attached to in its last response. + /// Null on first run, when settings were saved without a version, or on older SE versions. + /// + public int? SettingsVersion { get; set; } } /// Active theme colors. All values are #AARRGGBB hex strings. @@ -52,5 +68,12 @@ public sealed class PluginResponse public string? Message { get; set; } public PluginSubtitle? Subtitle { get; set; } public JsonElement? Settings { get; set; } + + /// + /// Schema version for . Bump when you change the shape of your + /// settings so you can migrate or reset on the next run. Optional; null = "unversioned". + /// + public int? SettingsVersion { get; set; } + public string? UndoDescription { get; set; } }