diff --git a/src/AudioAnalysisTools/AcousticEvent.cs b/src/AudioAnalysisTools/AcousticEvent.cs
index dc8e4f581..c58c2ef58 100644
--- a/src/AudioAnalysisTools/AcousticEvent.cs
+++ b/src/AudioAnalysisTools/AcousticEvent.cs
@@ -18,7 +18,9 @@ namespace AudioAnalysisTools
using Acoustics.Shared.ImageSharp;
using AnalysisBase.ResultBases;
using AudioAnalysisTools.DSP;
+ using AudioAnalysisTools.Events.Drawing;
using AudioAnalysisTools.Events.Interfaces;
+ using AudioAnalysisTools.Events.Tracks;
using AudioAnalysisTools.StandardSpectrograms;
using CsvHelper.Configuration;
using SixLabors.ImageSharp;
@@ -126,7 +128,7 @@ public AcousticEventClassMap()
///
/// Gets or sets a horizontal or vertical spectral track.
///
- public SpectralTrack_TO_BE_REMOVED TheTrack { get; set; }
+ public Track TheTrack { get; set; }
public bool IsMelscale { get; set; }
@@ -138,7 +140,7 @@ public AcousticEventClassMap()
///
public Oblong Oblong { get; set; }
- /// Gets or sets required for conversions to & from MEL scale AND for drawing event on spectrum.
+ /// Gets or sets required for conversions to/from MEL scale AND for drawing event on spectrum.
public int FreqBinCount { get; set; }
///
@@ -459,8 +461,20 @@ public void DrawEvent(Image imageToReturn, double framesPerSecond, double
if (this.TheTrack != null)
{
// currently this call assumes that the Track[frame, bin[ elements correspond to the pixels of the passed spectrogram.
- // That is, there is no rescaling of the time and frequency axes.
- this.TheTrack.DrawTrack(imageToReturn, framesPerSecond, freqBinWidth);
+ // That is, there is no rescaling of the time and frequency axes
+ var converter = new UnitConverters(
+ segmentStartOffset: this.SegmentStartSeconds,
+ segmentDuration: this.SegmentDurationSeconds,
+ nyquistFrequency: freqBinWidth * sonogramHeight,
+ imageWidth: imageToReturn.Width,
+ imageHeight: imageToReturn.Height);
+
+ var renderingOptions = new EventRenderingOptions(converter);
+ imageToReturn.Mutate(
+ context =>
+ {
+ this.TheTrack.Draw(context, renderingOptions);
+ });
return;
}
diff --git a/src/AudioAnalysisTools/StandardSpectrograms/Image_MultiTrack.cs b/src/AudioAnalysisTools/StandardSpectrograms/Image_MultiTrack.cs
index 8df8b42c6..151dadc05 100644
--- a/src/AudioAnalysisTools/StandardSpectrograms/Image_MultiTrack.cs
+++ b/src/AudioAnalysisTools/StandardSpectrograms/Image_MultiTrack.cs
@@ -6,6 +6,9 @@ namespace AudioAnalysisTools.StandardSpectrograms
{
using System;
using System.Collections.Generic;
+ using AudioAnalysisTools.Events.Drawing;
+ using AudioAnalysisTools.Events.Interfaces;
+ using AudioAnalysisTools.Events.Tracks;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
@@ -37,7 +40,7 @@ public Image_MultiTrack(Image image)
public IEnumerable EventList { get; set; }
- public List SpectralTracks { get; set; }
+ public List