Skip to content

Commit 31c3304

Browse files
Merge pull request #389 from NeoCoderMatrix86/development
Deploy V7.0
2 parents 69ce162 + 86e557e commit 31c3304

62 files changed

Lines changed: 2291 additions & 1832 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AudioCuesheetEditor/AudioCuesheetEditor.csproj

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ImplicitUsings>enable</ImplicitUsings>
88
<PackageProjectUrl>https://github.com/NeoCoderMatrix86/AudioCuesheetEditor</PackageProjectUrl>
99
<RazorLangVersion>3.0</RazorLangVersion>
10-
<Version>6.0.0</Version>
10+
<Version>7.0.0</Version>
1111
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
1212
<PublishTrimmed>true</PublishTrimmed>
1313
<RunAOTCompilation>true</RunAOTCompilation>
@@ -53,6 +53,8 @@
5353
<Content Remove="Resources\Localization\Index\en.json" />
5454
<Content Remove="Resources\Localization\ValidationMessage\de.json" />
5555
<Content Remove="Resources\Localization\ValidationMessage\en.json" />
56+
<Content Remove="Resources\Localization\EditImportOptions\de.json" />
57+
<Content Remove="Resources\Localization\EditImportOptions\en.json" />
5658
<Content Remove="Resources\Localization\ViewModeImport\de.json" />
5759
<Content Remove="Resources\Localization\ViewModeImport\en.json" />
5860
<Content Remove="Resources\Localization\ViewModeRecord\de.json" />
@@ -98,6 +100,8 @@
98100
<EmbeddedResource Include="Resources\Localization\Index\de.json" />
99101
<EmbeddedResource Include="Resources\Localization\ValidationMessage\de.json" />
100102
<EmbeddedResource Include="Resources\Localization\ValidationMessage\en.json" />
103+
<EmbeddedResource Include="Resources\Localization\EditImportOptions\de.json" />
104+
<EmbeddedResource Include="Resources\Localization\EditImportOptions\en.json" />
101105
<EmbeddedResource Include="Resources\Localization\ViewModeImport\de.json" />
102106
<EmbeddedResource Include="Resources\Localization\ViewModeImport\en.json" />
103107
<EmbeddedResource Include="Resources\Localization\ViewModeRecord\de.json" />
@@ -110,20 +114,20 @@
110114
</ItemGroup>
111115

112116
<ItemGroup>
113-
<PackageReference Include="Blazorise.Bootstrap5" Version="1.5.2" />
114-
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.5.2" />
117+
<PackageReference Include="Blazorise.Bootstrap5" Version="1.6.1" />
118+
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.6.1" />
115119
<PackageReference Include="MetaBrainz.MusicBrainz" Version="6.1.0" />
116-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.7" />
117-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.7" PrivateAssets="all" />
120+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.8" />
121+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.8" PrivateAssets="all" />
118122
<PackageReference Include="BlazorDownloadFile" Version="2.4.0.2" />
119-
<PackageReference Include="Blazorise.Components" Version="1.5.2" />
123+
<PackageReference Include="Blazorise.Components" Version="1.6.1" />
120124
<PackageReference Include="Howler.Blazor" Version="0.9.8" />
121125
<PackageReference Include="Markdig" Version="0.37.0" />
122126
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
123127
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.0" />
124128
<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />
125129
<PackageReference Include="Toolbelt.Blazor.HotKeys2" Version="5.1.0" />
126-
<PackageReference Include="z440.atl.core" Version="5.25.0" />
130+
<PackageReference Include="z440.atl.core" Version="6.2.0" />
127131
</ItemGroup>
128132

129133
<ItemGroup>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//This file is part of AudioCuesheetEditor.
2+
3+
//AudioCuesheetEditor is free software: you can redistribute it and/or modify
4+
//it under the terms of the GNU General Public License as published by
5+
//the Free Software Foundation, either version 3 of the License, or
6+
//(at your option) any later version.
7+
8+
//AudioCuesheetEditor is distributed in the hope that it will be useful,
9+
//but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
//GNU General Public License for more details.
12+
13+
//You should have received a copy of the GNU General Public License
14+
//along with Foobar. If not, see
15+
//<http: //www.gnu.org/licenses />.
16+
using AudioCuesheetEditor.Model.Options;
17+
using System.Linq.Expressions;
18+
19+
namespace AudioCuesheetEditor.Data.Options
20+
{
21+
public interface ILocalStorageOptionsProvider
22+
{
23+
event EventHandler<IOptions>? OptionSaved;
24+
Task<T> GetOptions<T>() where T : IOptions;
25+
Task SaveOptions(IOptions options);
26+
Task SaveOptionsValue<T>(Expression<Func<T, object>> propertyExpression, object value) where T : class, IOptions, new();
27+
}
28+
}

AudioCuesheetEditor/Data/Options/LocalStorageOptionsProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
namespace AudioCuesheetEditor.Data.Options
2424
{
25-
public class LocalStorageOptionsProvider(IJSRuntime jsRuntime)
25+
public class LocalStorageOptionsProvider(IJSRuntime jsRuntime): ILocalStorageOptionsProvider
2626
{
2727
public event EventHandler<IOptions>? OptionSaved;
2828

AudioCuesheetEditor/Extensions/SessionStateContainer.cs

Lines changed: 5 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ public class SessionStateContainer
3131
private ViewMode currentViewMode;
3232
private Cuesheet cuesheet;
3333
private Cuesheet? importCuesheet;
34-
private TextImportfile? textImportFile;
35-
private CuesheetImportfile? cuesheetImportFile;
3634
private Audiofile? importAudiofile;
3735

3836
public SessionStateContainer(TraceChangeManager traceChangeManager)
@@ -65,50 +63,6 @@ public Cuesheet? ImportCuesheet
6563
}
6664
}
6765

68-
public TextImportfile? TextImportFile
69-
{
70-
get { return textImportFile; }
71-
set
72-
{
73-
if (textImportFile != null)
74-
{
75-
textImportFile.AnalysisFinished -= TextImportScheme_AnalysisFinished;
76-
}
77-
textImportFile = value;
78-
if (textImportFile != null)
79-
{
80-
textImportFile.AnalysisFinished += TextImportScheme_AnalysisFinished;
81-
ImportCuesheet = textImportFile.Cuesheet;
82-
}
83-
else
84-
{
85-
ImportCuesheet = null;
86-
}
87-
}
88-
}
89-
90-
public CuesheetImportfile? CuesheetImportFile
91-
{
92-
get { return cuesheetImportFile; }
93-
set
94-
{
95-
if (cuesheetImportFile != null)
96-
{
97-
cuesheetImportFile.AnalysisFinished -= CuesheetImportFile_AnalysisFinished;
98-
}
99-
cuesheetImportFile = value;
100-
if ((CuesheetImportFile != null) && (CuesheetImportFile.Cuesheet != null))
101-
{
102-
CuesheetImportFile.AnalysisFinished += CuesheetImportFile_AnalysisFinished;
103-
ImportCuesheet = CuesheetImportFile.Cuesheet;
104-
}
105-
else
106-
{
107-
ImportCuesheet = null;
108-
}
109-
}
110-
}
111-
11266
public Audiofile? ImportAudiofile
11367
{
11468
get => importAudiofile;
@@ -133,74 +87,26 @@ public ViewMode CurrentViewMode
13387
}
13488
}
13589

136-
public IImportfile? Importfile
137-
{
138-
get
139-
{
140-
if (TextImportFile != null)
141-
{
142-
return TextImportFile;
143-
}
144-
if (CuesheetImportFile != null)
145-
{
146-
return CuesheetImportFile;
147-
}
148-
return null;
149-
}
150-
}
90+
public IImportfile? Importfile{ get; set; }
15191

15292
public void ResetImport()
15393
{
154-
TextImportFile = null;
155-
CuesheetImportFile = null;
94+
Importfile = null;
15695
ImportAudiofile = null;
157-
}
158-
159-
public void StartImportCuesheet(ApplicationOptions applicationOptions)
160-
{
161-
if (ImportCuesheet != null)
162-
{
163-
Cuesheet.Import(ImportCuesheet, applicationOptions, _traceChangeManager);
164-
ImportCuesheet = null;
165-
}
166-
ResetImport();
96+
ImportCuesheet = null;
16797
}
16898

16999
private void SetCuesheetReference(Cuesheet value)
170100
{
171-
cuesheet.CuesheetImported -= Cuesheet_CuesheetImported;
172101
cuesheet = value;
173-
cuesheet.CuesheetImported += Cuesheet_CuesheetImported;
174102
_traceChangeManager.Reset();
175103
_traceChangeManager.TraceChanges(Cuesheet);
176104
CuesheetChanged?.Invoke(this, EventArgs.Empty);
177105
}
178-
private void TextImportScheme_AnalysisFinished(object? sender, EventArgs eventArgs)
179-
{
180-
if (textImportFile != null)
181-
{
182-
ImportCuesheet = textImportFile.Cuesheet;
183-
}
184-
else
185-
{
186-
ImportCuesheet = null;
187-
}
188-
}
189-
private void Cuesheet_CuesheetImported(object? sender, EventArgs e)
106+
107+
public void FireCuesheetImported()
190108
{
191109
CuesheetChanged?.Invoke(this, EventArgs.Empty);
192110
}
193-
194-
void CuesheetImportFile_AnalysisFinished(object? sender, EventArgs e)
195-
{
196-
if (CuesheetImportFile != null)
197-
{
198-
ImportCuesheet = CuesheetImportFile.Cuesheet;
199-
}
200-
else
201-
{
202-
ImportCuesheet = null;
203-
}
204-
}
205111
}
206112
}

AudioCuesheetEditor/Extensions/WebAssemblyHostExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static class WebAssemblyHostExtension
2424
{
2525
public async static Task SetDefaultCulture(this WebAssemblyHost host)
2626
{
27-
var localStorageOptionsProvider = host.Services.GetRequiredService<LocalStorageOptionsProvider>();
27+
var localStorageOptionsProvider = host.Services.GetRequiredService<ILocalStorageOptionsProvider>();
2828
var options = await localStorageOptionsProvider.GetOptions<ApplicationOptions>();
2929

3030
CultureInfo.DefaultThreadCurrentCulture = options.Culture;

AudioCuesheetEditor/Model/AudioCuesheet/CatalogueNumber.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ protected override ValidationResult Validate(string property)
4646
validationStatus = ValidationStatus.Success;
4747
if (Value.All(Char.IsDigit) == false)
4848
{
49-
validationMessages ??= new();
49+
validationMessages ??= [];
5050
validationMessages.Add(new ValidationMessage("{0} must only contain numbers!", nameof(Value)));
5151
}
5252
if (Value.Length != 13)
5353
{
54-
validationMessages ??= new();
54+
validationMessages ??= [];
5555
validationMessages.Add(new ValidationMessage("{0} has an invalid length. Allowed length is {1}!", nameof(Value), 13));
5656
}
5757
}

AudioCuesheetEditor/Model/AudioCuesheet/Cuesheet.cs

Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
//along with Foobar. If not, see
1515
//<http: //www.gnu.org/licenses />.
1616
using AudioCuesheetEditor.Model.Entity;
17-
using AudioCuesheetEditor.Model.IO;
1817
using AudioCuesheetEditor.Model.IO.Audio;
1918
using AudioCuesheetEditor.Model.IO.Export;
2019
using AudioCuesheetEditor.Model.Options;
@@ -39,11 +38,8 @@ public class CuesheetSectionAddRemoveEventArgs(CuesheetSection section) : EventA
3938
public CuesheetSection Section { get; } = section;
4039
}
4140

42-
public class Cuesheet(TraceChangeManager? traceChangeManager = null) : Validateable<Cuesheet>, ICuesheetEntity, ITraceable
41+
public class Cuesheet(TraceChangeManager? traceChangeManager = null) : Validateable<Cuesheet>, ITraceable, ICuesheet
4342
{
44-
public const String MimeType = "text/*";
45-
public const String FileExtension = ".cue";
46-
4743
private readonly object syncLock = new();
4844

4945
private List<Track> tracks = [];
@@ -62,7 +58,6 @@ public class Cuesheet(TraceChangeManager? traceChangeManager = null) : Validatea
6258
public event EventHandler<TrackAddRemoveEventArgs>? TrackRemoved;
6359
public event EventHandler<CuesheetSectionAddRemoveEventArgs>? SectionAdded;
6460
public event EventHandler<CuesheetSectionAddRemoveEventArgs>? SectionRemoved;
65-
public event EventHandler? CuesheetImported;
6661

6762
[JsonInclude]
6863
public IReadOnlyCollection<Track> Tracks
@@ -176,7 +171,7 @@ public TimeSpan? RecordingTime
176171
}
177172

178173
[JsonIgnore]
179-
public Boolean IsImporting { get; private set; }
174+
public Boolean IsImporting { get; set; }
180175

181176
[JsonInclude]
182177
public IReadOnlyCollection<CuesheetSection> Sections
@@ -393,27 +388,6 @@ public void MoveTrack(Track track, MoveDirection moveDirection)
393388
}
394389
}
395390

396-
public void Import(Cuesheet cuesheet, ApplicationOptions applicationOptions, TraceChangeManager? traceChangeManager = null)
397-
{
398-
//Since we use a stack for several changes we need to lock execution for everything else
399-
lock (syncLock)
400-
{
401-
IsImporting = true;
402-
//We are doing a bulk edit, so inform the TraceChangeManager
403-
if (traceChangeManager != null)
404-
{
405-
traceChangeManager.BulkEdit = true;
406-
}
407-
CopyValues(cuesheet, applicationOptions);
408-
if (traceChangeManager != null)
409-
{
410-
traceChangeManager.BulkEdit = false;
411-
}
412-
IsImporting = false;
413-
}
414-
CuesheetImported?.Invoke(this, EventArgs.Empty);
415-
}
416-
417391
public void StartRecording()
418392
{
419393
recordingStart = DateTime.UtcNow;
@@ -554,32 +528,6 @@ private void ReCalculateTrackProperties(Track trackToCalculate)
554528
}
555529
}
556530

557-
/// <summary>
558-
/// Copy values from import cuesheet to this cuesheet
559-
/// </summary>
560-
/// <param name="cuesheet">Reference to import cuesheet</param>
561-
/// <param name="applicationOptions">Reference to application options</param>
562-
private void CopyValues(Cuesheet cuesheet, ApplicationOptions applicationOptions)
563-
{
564-
Artist = cuesheet.Artist;
565-
Title = cuesheet.Title;
566-
Audiofile = cuesheet.Audiofile;
567-
CDTextfile = cuesheet.CDTextfile;
568-
Cataloguenumber = cuesheet.Cataloguenumber;
569-
foreach (var importTrack in cuesheet.Tracks)
570-
{
571-
//We don't want to copy the cuesheet reference since we are doing a copy and want to assign the track to this object
572-
var track = new Track(importTrack, false);
573-
AddTrack(track, applicationOptions);
574-
}
575-
// Copy sections
576-
foreach (var splitPoint in cuesheet.Sections)
577-
{
578-
var newSplitPoint = AddSection();
579-
newSplitPoint.CopyValues(splitPoint);
580-
}
581-
}
582-
583531
private void Track_RankPropertyValueChanged(object? sender, string e)
584532
{
585533
if (sender is Track trackRaisedEvent)

AudioCuesheetEditor/Model/AudioCuesheet/ICuesheetEntity.cs renamed to AudioCuesheetEditor/Model/AudioCuesheet/ICuesheet.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,12 @@
1313
//You should have received a copy of the GNU General Public License
1414
//along with Foobar. If not, see
1515
//<http: //www.gnu.org/licenses />.
16-
using System;
17-
using System.Collections.Generic;
18-
using System.Linq;
19-
using System.Threading.Tasks;
2016

2117
namespace AudioCuesheetEditor.Model.AudioCuesheet
2218
{
23-
/// <summary>
24-
/// Interface for cuesheet entities (Cuesheet, track, etc.)
25-
/// </summary>
26-
public interface ICuesheetEntity
19+
public interface ICuesheet
2720
{
28-
public String? Artist { get; set; }
29-
public String? Title { get; set; }
21+
string? Artist { get; set; }
22+
string? Title { get; set; }
3023
}
3124
}

0 commit comments

Comments
 (0)