- @if (Cuesheet?.GetSplitPointAtTrack(track) != null)
+ @if (Cuesheet?.GetSectionAtTrack(track) != null)
{
@@ -768,8 +768,8 @@ along with Foobar. If not, see
{
if (Cuesheet != null)
{
- Cuesheet.SplitPointAdded += Cuesheet_SplitPointAdded;
- Cuesheet.SplitPointRemoved += Cuesheet_SplitPointRemoved;
+ Cuesheet.SectionAdded += Cuesheet_SectionAdded;
+ Cuesheet.SectionRemoved += Cuesheet_SectionRemoved;
}
}
@@ -777,26 +777,27 @@ along with Foobar. If not, see
{
if (Cuesheet != null)
{
- Cuesheet.SplitPointAdded -= Cuesheet_SplitPointAdded;
- Cuesheet.SplitPointRemoved -= Cuesheet_SplitPointRemoved;
+ Cuesheet.SectionAdded -= Cuesheet_SectionAdded;
+ Cuesheet.SectionRemoved -= Cuesheet_SectionRemoved;
}
}
- void Cuesheet_SplitPointAdded(object? sender, SplitPointAddRemoveEventArgs args)
+ void Cuesheet_SectionAdded(object? sender, CuesheetSectionAddRemoveEventArgs args)
{
- args.SplitPoint.ValidateablePropertyChanged += SplitPoint_ValidateablePropertyChanged;
+ args.Section.ValidateablePropertyChanged += Section_ValidateablePropertyChanged;
}
- void Cuesheet_SplitPointRemoved(object? sender, SplitPointAddRemoveEventArgs args)
+ void Cuesheet_SectionRemoved(object? sender, CuesheetSectionAddRemoveEventArgs args)
{
- args.SplitPoint.ValidateablePropertyChanged -= SplitPoint_ValidateablePropertyChanged;
+ args.Section.ValidateablePropertyChanged -= Section_ValidateablePropertyChanged;
}
- void SplitPoint_ValidateablePropertyChanged(object? sender, string property)
+ void Section_ValidateablePropertyChanged(object? sender, string property)
{
switch (property)
{
- case nameof(SplitPoint.Moment):
+ case nameof(CuesheetSection.Begin):
+ case nameof(CuesheetSection.End):
StateHasChanged();
break;
}
diff --git a/AudioCuesheetEditorTests/Model/AudioCuesheet/CuesheetTests.cs b/AudioCuesheetEditorTests/Model/AudioCuesheet/CuesheetTests.cs
index 8eb7f310..ee82dc26 100644
--- a/AudioCuesheetEditorTests/Model/AudioCuesheet/CuesheetTests.cs
+++ b/AudioCuesheetEditorTests/Model/AudioCuesheet/CuesheetTests.cs
@@ -611,12 +611,12 @@ public void ImportProjectfileTest()
var fileContent = Encoding.UTF8.GetBytes("{\"Tracks\":[{\"Position\":1,\"Artist\":\"Artist 1\",\"Title\":\"Title 1\",\"Begin\":\"00:00:00\",\"End\":\"00:01:01\",\"Flags\":[\"4CH\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":2,\"Artist\":\"Artist 2\",\"Title\":\"Title 2\",\"Begin\":\"00:01:01\",\"End\":\"00:03:03\",\"Flags\":[\"4CH\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":3,\"Artist\":\"Artist 3\",\"Title\":\"Title 3\",\"Begin\":\"00:03:03\",\"End\":\"00:06:06\",\"Flags\":[\"4CH\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":4,\"Artist\":\"Artist 4\",\"Title\":\"Title 4\",\"Begin\":\"00:06:06\",\"End\":\"00:10:10\",\"Flags\":[\"4CH\",\"DCP\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":5,\"Artist\":\"Artist 5\",\"Title\":\"Title 5\",\"Begin\":\"00:10:10\",\"End\":\"00:15:15\",\"Flags\":[\"4CH\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":6,\"Artist\":\"Artist 6\",\"Title\":\"Title 6\",\"Begin\":\"00:15:15\",\"End\":\"00:21:21\",\"Flags\":[\"4CH\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":7,\"Artist\":\"Artist 7\",\"Title\":\"Title 7\",\"Begin\":\"00:21:21\",\"End\":\"00:28:28\",\"Flags\":[\"4CH\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":8,\"Artist\":\"Artist 8\",\"Title\":\"Title 8\",\"Begin\":\"00:28:28\",\"End\":\"00:36:36\",\"Flags\":[\"4CH\",\"DCP\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":9,\"Artist\":\"Artist 9\",\"Title\":\"Title 9\",\"Begin\":\"00:36:36\",\"End\":\"00:45:45\",\"Flags\":[\"4CH\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":10,\"Artist\":\"Artist 10\",\"Title\":\"Title 10\",\"Begin\":\"00:45:45\",\"End\":\"00:55:55\",\"Flags\":[\"4CH\",\"DCP\"],\"IsLinkedToPreviousTrack\":true}],\"Artist\":\"CuesheetArtist\",\"Title\":\"CuesheetTitle\",\"Audiofile\":{\"Name\":\"AudioFile.mp3\"},\"CDTextfile\":{\"Name\":\"CDTextfile.cdt\"},\"Cataloguenumber\":{\"Value\":\"A123\"},\"SplitPoints\":[{\"Artist\":\"CuesheetArtist\",\"Title\":\"CuesheetTitle\",\"Moment\":\"00:30:00\"},{\"Artist\":\"CuesheetArtist\",\"Title\":\"CuesheetTitle\",\"Moment\":\"01:00:00\"}]}");
var projectFileCuesheet = Projectfile.ImportFile(fileContent);
Assert.IsNotNull(projectFileCuesheet);
- Assert.AreEqual(2, projectFileCuesheet.SplitPoints.Count);
+ Assert.AreEqual(2, projectFileCuesheet.Sections.Count);
var cuesheet = new Cuesheet();
var testHelper = new TestHelper();
cuesheet.Import(projectFileCuesheet, testHelper.ApplicationOptions);
- Assert.AreEqual(2, cuesheet.SplitPoints.Count);
- Assert.IsTrue(cuesheet.SplitPoints.All(x => x.Cuesheet == cuesheet));
+ Assert.AreEqual(2, cuesheet.Sections.Count);
+ Assert.IsTrue(cuesheet.Sections.All(x => x.Cuesheet == cuesheet));
}
}
}
\ No newline at end of file
diff --git a/AudioCuesheetEditorTests/Model/IO/Export/SplitPointTests.cs b/AudioCuesheetEditorTests/Model/IO/Export/CuesheetSectionTests.cs
similarity index 66%
rename from AudioCuesheetEditorTests/Model/IO/Export/SplitPointTests.cs
rename to AudioCuesheetEditorTests/Model/IO/Export/CuesheetSectionTests.cs
index d4dc78e2..f44a40e0 100644
--- a/AudioCuesheetEditorTests/Model/IO/Export/SplitPointTests.cs
+++ b/AudioCuesheetEditorTests/Model/IO/Export/CuesheetSectionTests.cs
@@ -11,25 +11,25 @@
namespace AudioCuesheetEditor.Model.IO.Export.Tests
{
[TestClass()]
- public class SplitPointTests
+ public class CuesheetSectionTests
{
[TestMethod()]
public void ValidationTest()
{
var cuesheet = new Cuesheet();
- var splitPoint = new SplitPoint(cuesheet);
- Assert.IsNull(splitPoint.Moment);
- var validationResult = splitPoint.Validate(x => x.Moment);
+ var section = new CuesheetSection(cuesheet);
+ Assert.IsNull(section.Begin);
+ var validationResult = section.Validate(x => x.Begin);
Assert.AreEqual(ValidationStatus.Error, validationResult.Status);
- splitPoint.Moment = new TimeSpan(0, 30, 0);
- validationResult = splitPoint.Validate(x => x.Moment);
+ section.Begin = new TimeSpan(0, 30, 0);
+ validationResult = section.Validate(x => x.Begin);
Assert.AreEqual(ValidationStatus.Success, validationResult.Status);
cuesheet.AddTrack(new Track() { Position = 1});
cuesheet.AddTrack(new Track() { Position = 2, Begin = new TimeSpan(0, 8, 43), End = new TimeSpan(0, 15, 43) });
- validationResult = splitPoint.Validate(x => x.Moment);
+ validationResult = section.Validate(x => x.Begin);
Assert.AreEqual(ValidationStatus.Error, validationResult.Status);
- splitPoint.Moment = new TimeSpan(0, 15, 43);
- validationResult = splitPoint.Validate(x => x.Moment);
+ section.Begin = new TimeSpan(0, 15, 43);
+ validationResult = section.Validate(x => x.Begin);
Assert.AreEqual(ValidationStatus.Success, validationResult.Status);
}
}
diff --git a/AudioCuesheetEditorTests/Model/IO/Export/ExportfileGeneratorTests.cs b/AudioCuesheetEditorTests/Model/IO/Export/ExportfileGeneratorTests.cs
index a06551f6..433c998d 100644
--- a/AudioCuesheetEditorTests/Model/IO/Export/ExportfileGeneratorTests.cs
+++ b/AudioCuesheetEditorTests/Model/IO/Export/ExportfileGeneratorTests.cs
@@ -280,7 +280,7 @@ public void GenerateCuesheetFilesWithIncorrectTrackPositionsTest()
}
[TestMethod()]
- public void GenerateCuesheetFilesWithSplitPointsTest()
+ public void GenerateCuesheetFilesWithSectionsTest()
{
var testHelper = new TestHelper();
Cuesheet cuesheet = new()
@@ -302,21 +302,21 @@ public void GenerateCuesheetFilesWithSplitPointsTest()
track.End = begin;
cuesheet.AddTrack(track, testHelper.ApplicationOptions);
}
- var splitPoint = cuesheet.AddSplitPoint();
- splitPoint.Moment = new TimeSpan(2, 0, 0);
- splitPoint.Title = "Last part";
- splitPoint.AudiofileName = "Last part.mp3";
- splitPoint = cuesheet.AddSplitPoint();
- splitPoint.Moment = new TimeSpan(0, 30, 0);
- splitPoint.AudiofileName = "First part.mp3";
- splitPoint = cuesheet.AddSplitPoint();
- splitPoint.Moment = new TimeSpan(1, 0, 0);
- splitPoint.Artist = "Demo Artist Part2";
- splitPoint = cuesheet.AddSplitPoint();
- splitPoint.Artist = "Artist 3";
- splitPoint.Title = "Title 3";
- splitPoint.AudiofileName = "Part 3.mp3";
- splitPoint.Moment = new TimeSpan(1, 30, 0);
+ var section = cuesheet.AddSection();
+ section.Begin = new TimeSpan(2, 0, 0);
+ section.Title = "Last part";
+ section.AudiofileName = "Last part.mp3";
+ section = cuesheet.AddSection();
+ section.Begin = new TimeSpan(0, 30, 0);
+ section.AudiofileName = "First part.mp3";
+ section = cuesheet.AddSection();
+ section.Begin = new TimeSpan(1, 0, 0);
+ section.Artist = "Demo Artist Part2";
+ section = cuesheet.AddSection();
+ section.Artist = "Artist 3";
+ section.Title = "Title 3";
+ section.AudiofileName = "Part 3.mp3";
+ section.Begin = new TimeSpan(1, 30, 0);
testHelper.ApplicationOptions.CuesheetFilename = "Unit test.cue";
var generator = new ExportfileGenerator(ExportType.Cuesheet, cuesheet, applicationOptions: testHelper.ApplicationOptions);
Assert.AreEqual(ValidationStatus.Success, generator.Validate().Status);
@@ -324,7 +324,7 @@ public void GenerateCuesheetFilesWithSplitPointsTest()
Assert.AreEqual(5, generatedFiles.Count);
var position = 1;
var counter = 1;
- //Check split according to split points
+ //Check split according to sections
Assert.AreEqual(cuesheet.Tracks.Min(x => x.Begin), generatedFiles.First().Begin);
Assert.AreEqual(new TimeSpan(0, 30, 0), generatedFiles.First().End);
Assert.AreEqual(new TimeSpan(0, 30, 0), generatedFiles.ElementAt(1).Begin);
@@ -346,13 +346,13 @@ public void GenerateCuesheetFilesWithSplitPointsTest()
var fileContent = File.ReadAllLines(fileName);
File.Delete(fileName);
int positionDifference = 1 - position;
- // Check cuesheet header for splitpoint artist and title
- var splitPointForThisFile = cuesheet.SplitPoints.FirstOrDefault(x => x.Moment == generatedFile.End);
- if (splitPointForThisFile != null)
+ // Check cuesheet header for artist and title
+ var sectionForThisFile = cuesheet.Sections.FirstOrDefault(x => x.Begin == generatedFile.End);
+ if (sectionForThisFile != null)
{
- Assert.AreEqual(String.Format("{0} \"{1}\"", CuesheetConstants.CuesheetTitle, splitPointForThisFile.Title), fileContent.First());
- Assert.AreEqual(String.Format("{0} \"{1}\"", CuesheetConstants.CuesheetArtist, splitPointForThisFile.Artist), fileContent[1]);
- Assert.AreEqual(String.Format("{0} \"{1}\" {2}", CuesheetConstants.CuesheetFileName, splitPointForThisFile.AudiofileName, cuesheet.Audiofile?.AudioFileType), fileContent[2]);
+ Assert.AreEqual(String.Format("{0} \"{1}\"", CuesheetConstants.CuesheetTitle, sectionForThisFile.Title), fileContent.First());
+ Assert.AreEqual(String.Format("{0} \"{1}\"", CuesheetConstants.CuesheetArtist, sectionForThisFile.Artist), fileContent[1]);
+ Assert.AreEqual(String.Format("{0} \"{1}\" {2}", CuesheetConstants.CuesheetFileName, sectionForThisFile.AudiofileName, cuesheet.Audiofile?.AudioFileType), fileContent[2]);
}
else
{
@@ -592,7 +592,7 @@ public void GenerateExportfilesWithPregapAndPostgapTest()
}
[TestMethod()]
- public void GenerateExportfilesWithSplitPointsTest()
+ public void GenerateExportfilesWithSectionsTest()
{
var testHelper = new TestHelper();
//Prepare cuesheet
@@ -627,21 +627,21 @@ public void GenerateExportfilesWithSplitPointsTest()
cuesheet.Cataloguenumber.Value = "0123456789123";
cuesheet.CDTextfile = new CDTextfile("Testfile.cdt");
- var splitPoint = cuesheet.AddSplitPoint();
- splitPoint.Moment = new TimeSpan(2, 0, 0);
- splitPoint.Title = "Last part";
- splitPoint.AudiofileName = "Last part.mp3";
- splitPoint = cuesheet.AddSplitPoint();
- splitPoint.Moment = new TimeSpan(0, 30, 0);
- splitPoint.AudiofileName = "First part.mp3";
- splitPoint = cuesheet.AddSplitPoint();
- splitPoint.Moment = new TimeSpan(1, 0, 0);
- splitPoint.Artist = "Demo Artist Part2";
- splitPoint = cuesheet.AddSplitPoint();
- splitPoint.Artist = "Artist 3";
- splitPoint.Title = "Title 3";
- splitPoint.AudiofileName = "Part 3.mp3";
- splitPoint.Moment = new TimeSpan(1, 30, 0);
+ var section = cuesheet.AddSection();
+ section.Begin = new TimeSpan(2, 0, 0);
+ section.Title = "Last part";
+ section.AudiofileName = "Last part.mp3";
+ section = cuesheet.AddSection();
+ section.Begin = new TimeSpan(0, 30, 0);
+ section.AudiofileName = "First part.mp3";
+ section = cuesheet.AddSection();
+ section.Begin = new TimeSpan(1, 0, 0);
+ section.Artist = "Demo Artist Part2";
+ section = cuesheet.AddSection();
+ section.Artist = "Artist 3";
+ section.Title = "Title 3";
+ section.AudiofileName = "Part 3.mp3";
+ section.Begin = new TimeSpan(1, 30, 0);
//Test export
var exportProfile = new Exportprofile
{
@@ -654,7 +654,7 @@ public void GenerateExportfilesWithSplitPointsTest()
var generatedFiles = generator.GenerateExportfiles();
Assert.AreEqual(5, generatedFiles.Count);
- //Check split according to split points
+ //Check split according to sections
Assert.AreEqual(cuesheet.Tracks.Min(x => x.Begin), generatedFiles.First().Begin);
Assert.AreEqual(new TimeSpan(0, 30, 0), generatedFiles.First().End);
Assert.AreEqual(new TimeSpan(0, 30, 0), generatedFiles.ElementAt(1).Begin);
@@ -678,11 +678,11 @@ public void GenerateExportfilesWithSplitPointsTest()
var fileContent = File.ReadAllLines(fileName);
File.Delete(fileName);
int positionDifference = 1 - position;
- //Check cuesheet header for splitpoint artist and title
- var splitPointForThisFile = cuesheet.SplitPoints.FirstOrDefault(x => x.Moment == generatedFile.End);
- if (splitPointForThisFile != null)
+ //Check cuesheet header for artist and title
+ var sectionForThisFile = cuesheet.Sections.FirstOrDefault(x => x.Begin == generatedFile.End);
+ if (sectionForThisFile != null)
{
- Assert.AreEqual(String.Format("{0};{1};{2};0123456789123;Testfile.cdt", splitPointForThisFile.Artist, splitPointForThisFile.Title, splitPointForThisFile.AudiofileName), fileContent[0]);
+ Assert.AreEqual(String.Format("{0};{1};{2};0123456789123;Testfile.cdt", sectionForThisFile.Artist, sectionForThisFile.Title, sectionForThisFile.AudiofileName), fileContent[0]);
}
else
{
@@ -710,9 +710,9 @@ public void GenerateExportfilesWithSplitPointsTest()
}
Assert.AreEqual(String.Format("{0};{1};{2};{3};{4};{5}", track.Position + positionDifference, track.Artist, track.Title, trackBegin, trackEnd, trackEnd - trackBegin), fileContent[i]);
}
- if (splitPointForThisFile != null)
+ if (sectionForThisFile != null)
{
- Assert.AreEqual(String.Format("Exported {0} from {1} using AudioCuesheetEditor", splitPointForThisFile.Title, splitPointForThisFile.Artist), fileContent.Last());
+ Assert.AreEqual(String.Format("Exported {0} from {1} using AudioCuesheetEditor", sectionForThisFile.Title, sectionForThisFile.Artist), fileContent.Last());
}
else
{
diff --git a/AudioCuesheetEditorTests/Model/IO/ProjectfileTests.cs b/AudioCuesheetEditorTests/Model/IO/ProjectfileTests.cs
index 022cec94..433ff166 100644
--- a/AudioCuesheetEditorTests/Model/IO/ProjectfileTests.cs
+++ b/AudioCuesheetEditorTests/Model/IO/ProjectfileTests.cs
@@ -70,7 +70,7 @@ public void GenerateFileTest()
}
[TestMethod()]
- public void GenerateFileWithSplitPointsTest()
+ public void GenerateFileWithSectionsTest()
{
var cuesheet = new Cuesheet
{
@@ -100,10 +100,10 @@ public void GenerateFileWithSplitPointsTest()
track.End = begin;
cuesheet.AddTrack(track, new Options.ApplicationOptions() { LinkTracksWithPreviousOne = true });
}
- var splitPoint = cuesheet.AddSplitPoint();
- splitPoint.Moment = new TimeSpan(0, 30, 0);
- splitPoint = cuesheet.AddSplitPoint();
- splitPoint.Moment = new TimeSpan(1, 0, 0);
+ var section = cuesheet.AddSection();
+ section.Begin = new TimeSpan(0, 30, 0);
+ section = cuesheet.AddSection();
+ section.Begin = new TimeSpan(1, 0, 0);
var projectFile = new Projectfile(cuesheet);
var generatedFile = projectFile.GenerateFile();
Assert.IsNotNull(generatedFile);
@@ -139,7 +139,7 @@ public void ImportFileTest()
}
[TestMethod()]
- public void ImportFileWithSplitPointsTest()
+ public void ImportFileWithSectionsTest()
{
var fileContent = Encoding.UTF8.GetBytes("{\"Tracks\":[{\"Position\":1,\"Artist\":\"Artist 1\",\"Title\":\"Title 1\",\"Begin\":\"00:00:00\",\"End\":\"00:01:01\",\"Flags\":[\"4CH\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":2,\"Artist\":\"Artist 2\",\"Title\":\"Title 2\",\"Begin\":\"00:01:01\",\"End\":\"00:03:03\",\"Flags\":[\"4CH\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":3,\"Artist\":\"Artist 3\",\"Title\":\"Title 3\",\"Begin\":\"00:03:03\",\"End\":\"00:06:06\",\"Flags\":[\"4CH\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":4,\"Artist\":\"Artist 4\",\"Title\":\"Title 4\",\"Begin\":\"00:06:06\",\"End\":\"00:10:10\",\"Flags\":[\"4CH\",\"DCP\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":5,\"Artist\":\"Artist 5\",\"Title\":\"Title 5\",\"Begin\":\"00:10:10\",\"End\":\"00:15:15\",\"Flags\":[\"4CH\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":6,\"Artist\":\"Artist 6\",\"Title\":\"Title 6\",\"Begin\":\"00:15:15\",\"End\":\"00:21:21\",\"Flags\":[\"4CH\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":7,\"Artist\":\"Artist 7\",\"Title\":\"Title 7\",\"Begin\":\"00:21:21\",\"End\":\"00:28:28\",\"Flags\":[\"4CH\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":8,\"Artist\":\"Artist 8\",\"Title\":\"Title 8\",\"Begin\":\"00:28:28\",\"End\":\"00:36:36\",\"Flags\":[\"4CH\",\"DCP\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":9,\"Artist\":\"Artist 9\",\"Title\":\"Title 9\",\"Begin\":\"00:36:36\",\"End\":\"00:45:45\",\"Flags\":[\"4CH\"],\"IsLinkedToPreviousTrack\":true},{\"Position\":10,\"Artist\":\"Artist 10\",\"Title\":\"Title 10\",\"Begin\":\"00:45:45\",\"End\":\"00:55:55\",\"Flags\":[\"4CH\",\"DCP\"],\"IsLinkedToPreviousTrack\":true}],\"Artist\":\"CuesheetArtist\",\"Title\":\"CuesheetTitle\",\"Audiofile\":{\"Name\":\"AudioFile.mp3\"},\"CDTextfile\":{\"Name\":\"CDTextfile.cdt\"},\"Cataloguenumber\":{\"Value\":\"A123\"},\"SplitPoints\":[{\"Artist\":\"CuesheetArtist\",\"Title\":\"CuesheetTitle\",\"Moment\":\"00:30:00\"},{\"Artist\":\"CuesheetArtist\",\"Title\":\"CuesheetTitle\",\"Moment\":\"01:00:00\"}]}");
var cuesheet = Projectfile.ImportFile(fileContent);
@@ -159,9 +159,9 @@ public void ImportFileWithSplitPointsTest()
Assert.IsTrue(Object.ReferenceEquals(cuesheet.Tracks.First(), cuesheet.GetPreviousLinkedTrack(cuesheet.Tracks.ElementAt(1))));
Assert.AreEqual(cuesheet.Tracks.First(), cuesheet.GetPreviousLinkedTrack(cuesheet.Tracks.ElementAt(1)));
Assert.AreEqual((uint)10, cuesheet.Tracks.Last().Position);
- Assert.AreEqual(2, cuesheet.SplitPoints.Count);
- Assert.AreEqual(new TimeSpan(0, 30, 0), cuesheet.SplitPoints.First().Moment);
- Assert.AreEqual(new TimeSpan(1, 0, 0), cuesheet.SplitPoints.Last().Moment);
+ Assert.AreEqual(2, cuesheet.Sections.Count);
+ Assert.AreEqual(new TimeSpan(0, 30, 0), cuesheet.Sections.First().Begin);
+ Assert.AreEqual(new TimeSpan(1, 0, 0), cuesheet.Sections.Last().Begin);
}
}
}
\ No newline at end of file
From 7d5b4c0dd54b814cbd83e9430b5b191af687ab33 Mon Sep 17 00:00:00 2001
From: NeoCoderMatrix86 <40752681+NeoCoderMatrix86@users.noreply.github.com>
Date: Mon, 15 Apr 2024 09:04:38 +0200
Subject: [PATCH 15/46] Switched UI to use new entities
---
.../AudioCuesheetEditor.csproj | 8 +-
.../Model/IO/Export/CuesheetSection.cs | 2 +
...itSplitpoints.razor => EditSections.razor} | 73 +++++++++++--------
AudioCuesheetEditor/Pages/Index.razor | 4 +-
.../Pages/ViewModeImport.razor | 4 +-
.../{EditSplitpoints => EditSections}/de.json | 7 +-
.../{EditSplitpoints => EditSections}/en.json | 7 +-
.../Resources/Localization/Index/de.json | 2 +-
.../Resources/Localization/Index/en.json | 2 +-
.../Localization/ViewModeImport/de.json | 2 +-
.../Localization/ViewModeImport/en.json | 2 +-
11 files changed, 63 insertions(+), 50 deletions(-)
rename AudioCuesheetEditor/Pages/{EditSplitpoints.razor => EditSections.razor} (77%)
rename AudioCuesheetEditor/Resources/Localization/{EditSplitpoints => EditSections}/de.json (75%)
rename AudioCuesheetEditor/Resources/Localization/{EditSplitpoints => EditSections}/en.json (76%)
diff --git a/AudioCuesheetEditor/AudioCuesheetEditor.csproj b/AudioCuesheetEditor/AudioCuesheetEditor.csproj
index 46b61905..9fe666d8 100644
--- a/AudioCuesheetEditor/AudioCuesheetEditor.csproj
+++ b/AudioCuesheetEditor/AudioCuesheetEditor.csproj
@@ -22,8 +22,8 @@
-
-
+
+
@@ -61,8 +61,8 @@
-
-
+
+
diff --git a/AudioCuesheetEditor/Model/IO/Export/CuesheetSection.cs b/AudioCuesheetEditor/Model/IO/Export/CuesheetSection.cs
index b38598c4..084e1307 100644
--- a/AudioCuesheetEditor/Model/IO/Export/CuesheetSection.cs
+++ b/AudioCuesheetEditor/Model/IO/Export/CuesheetSection.cs
@@ -128,6 +128,8 @@ protected override ValidationResult Validate(string property)
{
ValidationStatus validationStatus = ValidationStatus.NoValidation;
List? validationMessages = null;
+ //TODO: Validate end also
+ //TODO: Change validation of begin to this entitys
switch (property)
{
case nameof(Begin):
diff --git a/AudioCuesheetEditor/Pages/EditSplitpoints.razor b/AudioCuesheetEditor/Pages/EditSections.razor
similarity index 77%
rename from AudioCuesheetEditor/Pages/EditSplitpoints.razor
rename to AudioCuesheetEditor/Pages/EditSections.razor
index 5f43ef00..4f9c19ea 100644
--- a/AudioCuesheetEditor/Pages/EditSplitpoints.razor
+++ b/AudioCuesheetEditor/Pages/EditSections.razor
@@ -17,7 +17,7 @@ along with Foobar. If not, see
-->
@implements IDisposable
-@inject ITextLocalizer _localizer
+@inject ITextLocalizer _localizer
@inject SessionStateContainer _sessionStateContainer
@inject ITextLocalizer _validationMessageLocalizer
@inject DateTimeUtility _dateTimeUtility
@@ -25,20 +25,20 @@ along with Foobar. If not, see
@inject TraceChangeManager _traceChangeManager
@inject IJSRuntime _jsRuntime
-@*
+
@if (Cuesheet != null)
{
@if (_sessionStateContainer.CurrentViewMode == ViewMode.ViewModeFull)
{
-
@@ -49,22 +49,23 @@ along with Foobar. If not, see
@_localizer["Controls"]
- @_localizer["Moment"]
+ @_localizer["Begin"]
+ @_localizer["End"]
@_localizer["CD artist"]
@_localizer["CD title"]
@_localizer["Audiofile name"]
- @foreach (var splitPoint in Cuesheet.Sections)
+ @foreach (var cuesheetSection in Cuesheet.Sections)
{
-
-
+
+
@@ -75,8 +76,8 @@ along with Foobar. If not, see
-
-
+
+
@@ -84,8 +85,8 @@ along with Foobar. If not, see
-
-
+
+
@@ -93,8 +94,8 @@ along with Foobar. If not, see
-
-
+
+
@@ -102,10 +103,19 @@ along with Foobar. If not, see
-
- @if (String.IsNullOrEmpty(splitPoint.AudiofileName))
+
+
+
+
+
+
+
+
+
+
+ @if (String.IsNullOrEmpty(cuesheetSection.AudiofileName))
{
- x.MimeType))" Changed="(args) => OnSplitpointAudiofileChanged(args, splitPoint)" AutoReset="false">
+ x.MimeType))" Changed="(args) => OnSectionAudiofileChanged(args, cuesheetSection)" AutoReset="false">
@@ -115,14 +125,14 @@ along with Foobar. If not, see
{
-
+
- @_localizer["Change"]
+ @_localizer["Change"]
}
@@ -133,12 +143,11 @@ along with Foobar. If not, see
}
- *@
+
@code {
- //TODO: Rename component!
Validations? validations;
ModalDialog? modalDialog;
Validation? audiofileValidation;
@@ -201,22 +210,22 @@ along with Foobar. If not, see
validations?.ValidateAll();
}
- Task AddSplitPointClicked()
+ Task AddSectionClicked()
{
if (Cuesheet != null)
{
- var splitPoint = Cuesheet.AddSection();
- _traceChangeManager.TraceChanges(splitPoint);
- fileEditAudiofileIds.Add(splitPoint, Guid.NewGuid());
+ var section = Cuesheet.AddSection();
+ _traceChangeManager.TraceChanges(section);
+ fileEditAudiofileIds.Add(section, Guid.NewGuid());
}
return Task.CompletedTask;
}
- Task DeleteSplitPointClicked(CuesheetSection splitPoint)
+ Task DeleteSectionClicked(CuesheetSection section)
{
if (Cuesheet != null)
{
- Cuesheet.RemoveSection(splitPoint);
+ Cuesheet.RemoveSection(section);
}
return Task.CompletedTask;
}
@@ -266,15 +275,15 @@ along with Foobar. If not, see
StateHasChanged();
}
- async Task OnSplitpointAudiofileChangedCliccked(CuesheetSection splitPoint)
+ async Task OnSectionAudiofileChangedClicked(CuesheetSection section)
{
- splitPoint.AudiofileName = null;
+ section.AudiofileName = null;
StateHasChanged();
await Task.Delay(1);
- await _jsRuntime.InvokeVoidAsync("triggerClick", fileEditAudiofileIds[splitPoint]);
+ await _jsRuntime.InvokeVoidAsync("triggerClick", fileEditAudiofileIds[section]);
}
- async Task OnSplitpointAudiofileChanged(FileChangedEventArgs e, CuesheetSection splitPoint)
+ async Task OnSectionAudiofileChanged(FileChangedEventArgs e, CuesheetSection section)
{
if (e.Files.FirstOrDefault() != null)
{
@@ -283,7 +292,7 @@ along with Foobar. If not, see
var file = e.Files.First();
if (IOUtility.CheckFileMimeTypeForAudioCodec(file) == true)
{
- splitPoint.AudiofileName = file.Name;
+ section.AudiofileName = file.Name;
}
else
{
diff --git a/AudioCuesheetEditor/Pages/Index.razor b/AudioCuesheetEditor/Pages/Index.razor
index 887d2a1e..7eb0dbd9 100644
--- a/AudioCuesheetEditor/Pages/Index.razor
+++ b/AudioCuesheetEditor/Pages/Index.razor
@@ -41,10 +41,10 @@ along with Foobar. If not, see
- @_localizer["Cuesheet split points"]
+ @_localizer["Cuesheet sections"]
-
+
diff --git a/AudioCuesheetEditor/Pages/ViewModeImport.razor b/AudioCuesheetEditor/Pages/ViewModeImport.razor
index dcf33b2d..b1de7655 100644
--- a/AudioCuesheetEditor/Pages/ViewModeImport.razor
+++ b/AudioCuesheetEditor/Pages/ViewModeImport.razor
@@ -274,10 +274,10 @@ along with Foobar. If not, see
{
- @_localizer["Cuesheet split points"]
+ @_localizer["Cuesheet sections"]
-
+
}
diff --git a/AudioCuesheetEditor/Resources/Localization/EditSplitpoints/de.json b/AudioCuesheetEditor/Resources/Localization/EditSections/de.json
similarity index 75%
rename from AudioCuesheetEditor/Resources/Localization/EditSplitpoints/de.json
rename to AudioCuesheetEditor/Resources/Localization/EditSections/de.json
index 1ade6c3a..2c343c56 100644
--- a/AudioCuesheetEditor/Resources/Localization/EditSplitpoints/de.json
+++ b/AudioCuesheetEditor/Resources/Localization/EditSections/de.json
@@ -1,10 +1,11 @@
{
"culture": "de",
"translations": {
- "Add new split point": "Neuen Aufteilungspunkt hinzufügen",
+ "Add new section": "Neuen Abschnitt hinzufügen",
"Controls": "Steuerung",
- "Moment": "Zeitpunkt",
- "Delete split tooltip": "Löscht diesen Aufteilungspunkt",
+ "Begin": "Anfang",
+ "End": "Ende",
+ "Delete section tooltip": "Löscht diesen Abschnitt",
"CD artist": "CD Künstler",
"CD title": "CD Titel",
"Audiofile name": "Audiodatei",
diff --git a/AudioCuesheetEditor/Resources/Localization/EditSplitpoints/en.json b/AudioCuesheetEditor/Resources/Localization/EditSections/en.json
similarity index 76%
rename from AudioCuesheetEditor/Resources/Localization/EditSplitpoints/en.json
rename to AudioCuesheetEditor/Resources/Localization/EditSections/en.json
index 7256528d..f6bb71d4 100644
--- a/AudioCuesheetEditor/Resources/Localization/EditSplitpoints/en.json
+++ b/AudioCuesheetEditor/Resources/Localization/EditSections/en.json
@@ -1,10 +1,11 @@
{
"culture": "en",
"translations": {
- "Add new split point": "Add new split point",
+ "Add new section": "Add new section",
"Controls": "Controls",
- "Moment": "Moment",
- "Delete split tooltip": "Deletes this split point",
+ "Begin": "Begin",
+ "End": "End",
+ "Delete section tooltip": "Deletes this section",
"CD artist": "CD artist",
"CD title": "CD title",
"Audiofile name": "Audiofile",
diff --git a/AudioCuesheetEditor/Resources/Localization/Index/de.json b/AudioCuesheetEditor/Resources/Localization/Index/de.json
index 32530bad..65c4083c 100644
--- a/AudioCuesheetEditor/Resources/Localization/Index/de.json
+++ b/AudioCuesheetEditor/Resources/Localization/Index/de.json
@@ -44,6 +44,6 @@
"DateTime": "Datum und Uhrzeit",
"Time": "Uhrzeit",
"Save changes": "Änderungen speichern",
- "Cuesheet split points": "Cuesheet Aufteilungspunkte"
+ "Cuesheet sections": "Cuesheet Abschnitte"
}
}
\ No newline at end of file
diff --git a/AudioCuesheetEditor/Resources/Localization/Index/en.json b/AudioCuesheetEditor/Resources/Localization/Index/en.json
index 494ed278..2e8bd0f6 100644
--- a/AudioCuesheetEditor/Resources/Localization/Index/en.json
+++ b/AudioCuesheetEditor/Resources/Localization/Index/en.json
@@ -44,6 +44,6 @@
"DateTime": "Date and Time",
"Time": "Time",
"Save changes": "Save changes",
- "Cuesheet split points": "Cuesheet split points"
+ "Cuesheet sections": "Cuesheet sections"
}
}
\ No newline at end of file
diff --git a/AudioCuesheetEditor/Resources/Localization/ViewModeImport/de.json b/AudioCuesheetEditor/Resources/Localization/ViewModeImport/de.json
index 2e2bd675..4d8539a4 100644
--- a/AudioCuesheetEditor/Resources/Localization/ViewModeImport/de.json
+++ b/AudioCuesheetEditor/Resources/Localization/ViewModeImport/de.json
@@ -61,6 +61,6 @@
"Please confirm": "Bestätigung erforderlich",
"Do you really want to reset the import options to default? This can not be undone!": "Möchten Sie wirklich die Import Optionen zurücksetzen? Dies kann nicht rückgängig gemacht werden!",
"Abort import of displayed data": "Import der angezeigten Daten abbrechen",
- "Cuesheet split points": "Cuesheet Aufteilungspunkte"
+ "Cuesheet sections": "Cuesheet Abschnitte"
}
}
\ No newline at end of file
diff --git a/AudioCuesheetEditor/Resources/Localization/ViewModeImport/en.json b/AudioCuesheetEditor/Resources/Localization/ViewModeImport/en.json
index 39c0634f..960cb5a1 100644
--- a/AudioCuesheetEditor/Resources/Localization/ViewModeImport/en.json
+++ b/AudioCuesheetEditor/Resources/Localization/ViewModeImport/en.json
@@ -60,6 +60,6 @@
"Please confirm": "Please confirm",
"Do you really want to reset the import options to default? This can not be undone!": "Do you really want to reset the import options to default? This can not be undone!",
"Abort import of displayed data": "Abort import of displayed data",
- "Cuesheet split points": "Cuesheet split points"
+ "Cuesheet sections": "Cuesheet sections"
}
}
\ No newline at end of file
From 44ae9541f20c2f4fbb71ddf5eb4113188b4d702d Mon Sep 17 00:00:00 2001
From: NeoCoderMatrix86 <40752681+NeoCoderMatrix86@users.noreply.github.com>
Date: Mon, 15 Apr 2024 09:19:05 +0200
Subject: [PATCH 16/46] Update Track.cs
---
.../Model/AudioCuesheet/Track.cs | 32 +++++++------------
1 file changed, 12 insertions(+), 20 deletions(-)
diff --git a/AudioCuesheetEditor/Model/AudioCuesheet/Track.cs b/AudioCuesheetEditor/Model/AudioCuesheet/Track.cs
index e34dd1d3..eadd50f1 100644
--- a/AudioCuesheetEditor/Model/AudioCuesheet/Track.cs
+++ b/AudioCuesheetEditor/Model/AudioCuesheet/Track.cs
@@ -27,7 +27,7 @@ public enum SetFlagMode
public class Track : Validateable