Browse Source

respect z_index on all graphics element types (#2765)

pull/2766/head
Jason Dove 4 months ago committed by GitHub
parent
commit
b0b7bd17b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 2
      ErsatzTV.Infrastructure/Streaming/Graphics/GraphicsElement.cs
  3. 4
      ErsatzTV.Infrastructure/Streaming/Graphics/Image/ImageElement.cs
  4. 2
      ErsatzTV.Infrastructure/Streaming/Graphics/Image/WatermarkElement.cs
  5. 2
      ErsatzTV.Infrastructure/Streaming/Graphics/Motion/MotionElement.cs
  6. 2
      ErsatzTV.Infrastructure/Streaming/Graphics/Script/ScriptElement.cs
  7. 2
      ErsatzTV.Infrastructure/Streaming/Graphics/Subtitle/SubtitleElement.cs
  8. 4
      ErsatzTV.Infrastructure/Streaming/Graphics/Text/TextElement.cs

1
CHANGELOG.md

@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Fixed
- Use code signing on all Windows executables (`ErsatzTV-Windows.exe`, `ErsatzTV.exe`, `ErsatzTV.Scanner.exe`)
- Respect `z_index` (draw order) on all graphics element types
## [26.1.1] - 2026-01-08
### Fixed

2
ErsatzTV.Infrastructure/Streaming/Graphics/GraphicsElement.cs

@ -7,7 +7,7 @@ namespace ErsatzTV.Infrastructure.Streaming.Graphics; @@ -7,7 +7,7 @@ namespace ErsatzTV.Infrastructure.Streaming.Graphics;
public abstract class GraphicsElement : IGraphicsElement
{
public int ZIndex { get; protected set; }
public abstract int ZIndex { get; }
public bool IsFinished { get; set; }

4
ErsatzTV.Infrastructure/Streaming/Graphics/Image/ImageElement.cs

@ -11,6 +11,8 @@ public class ImageElement(ImageGraphicsElement imageGraphicsElement, ILogger log @@ -11,6 +11,8 @@ public class ImageElement(ImageGraphicsElement imageGraphicsElement, ILogger log
private Option<Expression> _maybeOpacityExpression;
private float _opacity;
public override int ZIndex { get; } = imageGraphicsElement.ZIndex ?? 0;
public override async Task InitializeAsync(GraphicsEngineContext context, CancellationToken cancellationToken)
{
try
@ -26,8 +28,6 @@ public class ImageElement(ImageGraphicsElement imageGraphicsElement, ILogger log @@ -26,8 +28,6 @@ public class ImageElement(ImageGraphicsElement imageGraphicsElement, ILogger log
_opacity = (imageGraphicsElement.OpacityPercent ?? 100) / 100.0f;
}
ZIndex = imageGraphicsElement.ZIndex ?? 0;
foreach (Expression expression in _maybeOpacityExpression)
{
expression.EvaluateFunction += OpacityExpressionHelper.EvaluateFunction;

2
ErsatzTV.Infrastructure/Streaming/Graphics/Image/WatermarkElement.cs

@ -29,6 +29,8 @@ public class WatermarkElement : ImageElementBase @@ -29,6 +29,8 @@ public class WatermarkElement : ImageElementBase
public bool IsValid => _imagePath != null && _watermark != null;
public override int ZIndex { get; }
public override async Task InitializeAsync(GraphicsEngineContext context, CancellationToken cancellationToken)
{
try

2
ErsatzTV.Infrastructure/Streaming/Graphics/Motion/MotionElement.cs

@ -30,6 +30,8 @@ public class MotionElement( @@ -30,6 +30,8 @@ public class MotionElement(
private TimeSpan _endTime;
private MotionElementState _state;
public override int ZIndex { get; } = motionElement.ZIndex ?? 0;
public void Dispose()
{
GC.SuppressFinalize(this);

2
ErsatzTV.Infrastructure/Streaming/Graphics/Script/ScriptElement.cs

@ -27,6 +27,8 @@ public class ScriptElement(ScriptGraphicsElement scriptElement, ILogger logger) @@ -27,6 +27,8 @@ public class ScriptElement(ScriptGraphicsElement scriptElement, ILogger logger)
private int _repeatCount;
private long _totalBytes;
public override int ZIndex { get; } = scriptElement.ZIndex ?? 0;
public void Dispose()
{
logger.LogDebug(

2
ErsatzTV.Infrastructure/Streaming/Graphics/Subtitle/SubtitleElement.cs

@ -30,6 +30,8 @@ public class SubtitleElement( @@ -30,6 +30,8 @@ public class SubtitleElement(
private SKBitmap _videoFrame;
private bool _isFinished;
public override int ZIndex { get; } = subtitleElement.ZIndex ?? 0;
public void Dispose()
{
GC.SuppressFinalize(this);

4
ErsatzTV.Infrastructure/Streaming/Graphics/Text/TextElement.cs

@ -21,6 +21,8 @@ public partial class TextElement( @@ -21,6 +21,8 @@ public partial class TextElement(
private Option<Expression> _maybeOpacityExpression;
private float _opacity;
public override int ZIndex { get; } = textElement.ZIndex ?? 0;
public void Dispose()
{
GC.SuppressFinalize(this);
@ -44,8 +46,6 @@ public partial class TextElement( @@ -44,8 +46,6 @@ public partial class TextElement(
_opacity = (textElement.OpacityPercent ?? 100) / 100.0f;
}
ZIndex = textElement.ZIndex ?? 0;
if (!string.IsNullOrWhiteSpace(textElement.IncludeFontsFrom))
{
if (Directory.Exists(textElement.IncludeFontsFrom))

Loading…
Cancel
Save