Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions se5/Haxor/PluginContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ public sealed class PluginRequest

public string VideoFileName { get; set; } = string.Empty;
public double FrameRate { get; set; }

/// <summary>Total video duration in seconds. Null when no video is loaded or on older SE versions.</summary>
public double? VideoDurationSeconds { get; set; }

/// <summary>Video frame width in pixels. Null when no video is loaded or on older SE versions.</summary>
public int? VideoWidth { get; set; }

/// <summary>Video frame height in pixels. Null when no video is loaded or on older SE versions.</summary>
public int? VideoHeight { get; set; }

public string UiLanguage { get; set; } = string.Empty;
public string Theme { get; set; } = string.Empty;

Expand All @@ -34,6 +44,12 @@ public sealed class PluginRequest

/// <summary>This plugin's settings as last persisted by Subtitle Edit (null on first run).</summary>
public JsonElement? Settings { get; set; }

/// <summary>
/// Schema version this plugin attached to <see cref="Settings"/> in its last response.
/// Null on first run, when settings were saved without a version, or on older SE versions.
/// </summary>
public int? SettingsVersion { get; set; }
}

/// <summary>Active theme colors. All values are <c>#AARRGGBB</c> hex strings.</summary>
Expand Down Expand Up @@ -78,5 +94,11 @@ public sealed class PluginResponse
/// <summary>Settings to persist; handed back unchanged in the next request.</summary>
public JsonElement? Settings { get; set; }

/// <summary>
/// Schema version for <see cref="Settings"/>. Bump when you change the shape of your
/// settings so you can migrate or reset on the next run. Optional; null = "unversioned".
/// </summary>
public int? SettingsVersion { get; set; }

public string? UndoDescription { get; set; }
}
25 changes: 25 additions & 0 deletions se5/Plugin-Shared/PluginContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ public sealed class PluginRequest
public List<int> SelectedIndices { get; set; } = new();
public string VideoFileName { get; set; } = string.Empty;
public double FrameRate { get; set; }

/// <summary>Total video duration in seconds. Null when no video is loaded or on older SE versions.</summary>
public double? VideoDurationSeconds { get; set; }

/// <summary>Video frame width in pixels. Null when no video is loaded or on older SE versions.</summary>
public int? VideoWidth { get; set; }

/// <summary>Video frame height in pixels. Null when no video is loaded or on older SE versions.</summary>
public int? VideoHeight { get; set; }

public string UiLanguage { get; set; } = string.Empty;
public string Theme { get; set; } = string.Empty;

Expand All @@ -24,6 +34,13 @@ public sealed class PluginRequest

public string SeVersion { get; set; } = string.Empty;
public JsonElement? Settings { get; set; }

/// <summary>
/// Schema version this plugin attached to <see cref="Settings"/> 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.
/// </summary>
public int? SettingsVersion { get; set; }
}

/// <summary>Active theme colors. All values are <c>#AARRGGBB</c> hex strings.</summary>
Expand Down Expand Up @@ -53,6 +70,14 @@ public sealed class PluginResponse
public string? Message { get; set; }
public PluginSubtitle? Subtitle { get; set; }
public JsonElement? Settings { get; set; }

/// <summary>
/// Schema version for <see cref="Settings"/>. Bump when you change the shape of your
/// settings so you can detect (and migrate or reset) stale data on the next run via
/// <see cref="PluginRequest.SettingsVersion"/>. Optional; null = "unversioned".
/// </summary>
public int? SettingsVersion { get; set; }

public string? UndoDescription { get; set; }
}

Expand Down
23 changes: 23 additions & 0 deletions se5/TypewriterEffect/PluginContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ public sealed class PluginRequest
public List<int> SelectedIndices { get; set; } = new();
public string VideoFileName { get; set; } = string.Empty;
public double FrameRate { get; set; }

/// <summary>Total video duration in seconds. Null when no video is loaded or on older SE versions.</summary>
public double? VideoDurationSeconds { get; set; }

/// <summary>Video frame width in pixels. Null when no video is loaded or on older SE versions.</summary>
public int? VideoWidth { get; set; }

/// <summary>Video frame height in pixels. Null when no video is loaded or on older SE versions.</summary>
public int? VideoHeight { get; set; }

public string UiLanguage { get; set; } = string.Empty;
public string Theme { get; set; } = string.Empty;

Expand All @@ -23,6 +33,12 @@ public sealed class PluginRequest

public string SeVersion { get; set; } = string.Empty;
public JsonElement? Settings { get; set; }

/// <summary>
/// Schema version this plugin attached to <see cref="Settings"/> in its last response.
/// Null on first run, when settings were saved without a version, or on older SE versions.
/// </summary>
public int? SettingsVersion { get; set; }
}

/// <summary>Active theme colors. All values are <c>#AARRGGBB</c> hex strings.</summary>
Expand Down Expand Up @@ -52,5 +68,12 @@ public sealed class PluginResponse
public string? Message { get; set; }
public PluginSubtitle? Subtitle { get; set; }
public JsonElement? Settings { get; set; }

/// <summary>
/// Schema version for <see cref="Settings"/>. Bump when you change the shape of your
/// settings so you can migrate or reset on the next run. Optional; null = "unversioned".
/// </summary>
public int? SettingsVersion { get; set; }

public string? UndoDescription { get; set; }
}
Loading