Skip to content

Commit bbbb7c2

Browse files
Merge pull request #170 from MattEqualsCoder/version-5.1.0
Version 5.1.0
2 parents ea314ba + 33a3f08 commit bbbb7c2

File tree

56 files changed

+2262
-1087
lines changed

Some content is hidden

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

56 files changed

+2262
-1087
lines changed

.idea/.idea.MSUScripter/.idea/avalonia.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MSUScripter/Configs/MsuSongMsuPcmInfo.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ public class MsuSongMsuPcmInfo
4040
[Description("Normalize the current track to the specified RMS level, overrides the global normalization value")]
4141
public double? Normalization { get; set; }
4242

43+
[Description("Alter the volume after msupcm++ has generated the PCM file")]
44+
public float? PostGenerateVolumeModifier { get; set; }
45+
46+
[Description("If the volume modifier after msupcm++ generation should be in decibels instead of percent")]
47+
public bool IsPostGenerateVolumeDecibels { get; set; }
48+
4349
[Description("Apply dynamic range compression to the current track")]
4450
public bool? Compression { get; set; }
4551

@@ -59,10 +65,10 @@ public class MsuSongMsuPcmInfo
5965
public bool ShowPanel { get; set; } = true;
6066

6167
[Description("Files which will be concatenated together to form the input to the parent track")]
62-
public List<MsuSongMsuPcmInfo> SubTracks { get; set; } = new();
68+
public List<MsuSongMsuPcmInfo> SubTracks { get; set; } = [];
6369

6470
[Description("Files which will be mixed together to form the input to the parent track")]
65-
public List<MsuSongMsuPcmInfo> SubChannels { get; set; } = new();
71+
public List<MsuSongMsuPcmInfo> SubChannels { get; set; } = [];
6672

6773
public void ClearFieldsForYaml()
6874
{
@@ -81,12 +87,7 @@ public bool AreFilesValid()
8187

8288
public List<string> GetFiles()
8389
{
84-
if (!string.IsNullOrEmpty(Output))
85-
{
86-
var outputFile = Output;
87-
}
88-
89-
List<string> files = new List<string>();
90+
List<string> files = [];
9091

9192
if (!string.IsNullOrEmpty(File))
9293
{

MSUScripter/Configs/Settings.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,11 @@ public class Settings
2929
public bool ProjectTreeDisplayCheckCopyrightIcon { get; set; }
3030
public bool ProjectTreeDisplayCopyrightSafeIcon { get; set; }
3131
public bool SkipDesktopFile { get; set; }
32+
public bool TrackOverviewShowIsCompleteIcon { get; set; } = true;
33+
public bool TrackOverviewShowHasSongIcon { get; set; }
34+
public bool TrackOverviewShowCheckCopyrightIcon { get; set; }
35+
public bool TrackOverviewShowCopyrightSafeIcon { get; set; }
36+
public bool HasShownVolumeModifierWarning { get; set; }
37+
3238
public DefaultSongPanel DefaultSongPanel { get; set; } = DefaultSongPanel.Prompt;
3339
}

MSUScripter/FodyWeavers.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

MSUScripter/MSUScripter.csproj

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,41 @@
88
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
99
<ApplicationIcon>MSUScripterIcon.ico</ApplicationIcon>
1010
<PackageIcon>MSUScripterIcon.ico</PackageIcon>
11-
<Version>5.0.3</Version>
11+
<Version>5.1.0</Version>
1212
<RuntimeFrameworkVersion>9.0.0</RuntimeFrameworkVersion>
1313
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
14-
<LangVersion>12</LangVersion>
14+
<LangVersion>13</LangVersion>
1515
</PropertyGroup>
1616

1717

1818
<ItemGroup>
19-
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.3.2" />
19+
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.3.10" />
2020
<PackageReference Include="Deadpikle.AvaloniaProgressRing" Version="0.10.10" />
2121
<PackageReference Include="K4os.Hash.xxHash" Version="1.0.8" />
2222
<PackageReference Include="MattEqualsCoder.AppImageManager" Version="0.1.3" />
2323
<!--Condition
2424
below is needed to remove Avalonia.Diagnostics package from build output in Release
2525
configuration.-->
26-
<PackageReference Include="MattEqualsCoder.AvaloniaControls" Version="1.9.1" />
27-
<PackageReference Include="MattEqualsCoder.GitHubReleaseChecker" Version="1.1.3" />
28-
<PackageReference Include="MattEqualsCoder.MSURandomizer.Library" Version="3.2.1" />
29-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" />
30-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.9" />
26+
<PackageReference Include="MattEqualsCoder.AvaloniaControls" Version="2.0.0" />
27+
<PackageReference Include="MattEqualsCoder.GitHubReleaseChecker" Version="1.1.4" />
28+
<PackageReference Include="MattEqualsCoder.MSURandomizer.Library" Version="3.2.2" />
29+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.1" />
30+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.1" />
3131
<PackageReference Include="NAudio" Version="2.2.1" />
3232
<PackageReference Include="NAudio.WinMM" Version="2.2.1" />
33-
<PackageReference Include="NJsonSchema.CodeGeneration.CSharp" Version="11.5.1" />
34-
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
33+
<PackageReference Include="NJsonSchema.CodeGeneration.CSharp" Version="11.5.2" />
34+
<PackageReference Include="ReactiveUI.SourceGenerators" Version="2.5.1">
35+
<PrivateAssets>all</PrivateAssets>
36+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
37+
</PackageReference>
3538
<PackageReference Include="Serilog" Version="4.3.0" />
36-
<PackageReference Include="Serilog.Extensions.Hosting" Version="9.0.0" />
37-
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
39+
<PackageReference Include="Serilog.Extensions.Hosting" Version="10.0.0" />
40+
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
3841
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
3942
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
4043
<PackageReference Include="SharpZipLib" Version="1.4.2" />
41-
<PackageReference Include="SoundFlow" Version="1.1.1" />
42-
<PackageReference Include="System.Management" Version="9.0.9" />
44+
<PackageReference Include="SoundFlow" Version="1.1.2" />
45+
<PackageReference Include="System.Management" Version="10.0.1" />
4346
<PackageReference Include="TagLibSharp" Version="2.3.0" />
4447
</ItemGroup>
4548

MSUScripter/Models/MsuProjectGenerationCache.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,20 @@ public class MsuProjectGenerationCache
1010

1111
public class MsuProjectSongCache
1212
{
13+
public const int CurrentCacheVersion = 1;
1314
public ulong JsonHash { get; init; }
1415
public int JsonLength { get; init; }
1516
public DateTime FileGenerationTime { get; init; }
1617
public long FileLength { get; init; }
18+
public int? CacheVersion { get; init; }
19+
public float PostGenerateVolumeModifier { get; init; }
20+
public bool IsPostGenerateVolumeDecibels { get; init; }
1721

1822
public static bool IsValid(MsuProjectSongCache? a, MsuProjectSongCache? b)
1923
{
2024
if (a is null || b is null) return false;
2125
return a.JsonHash == b.JsonHash && a.JsonLength == b.JsonLength &&
22-
a.FileGenerationTime == b.FileGenerationTime & a.FileLength == b.FileLength;
26+
a.FileGenerationTime == b.FileGenerationTime & a.FileLength == b.FileLength && a.CacheVersion == b.CacheVersion &&
27+
Math.Abs(a.PostGenerateVolumeModifier - b.PostGenerateVolumeModifier) < 0.01 && a.IsPostGenerateVolumeDecibels == b.IsPostGenerateVolumeDecibels;
2328
}
2429
}

MSUScripter/Program.cs

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using Avalonia;
22
using System;
3+
using System.CodeDom.Compiler;
34
using System.Collections.Generic;
45
using System.IO;
6+
using System.Reflection;
57
// ReSharper disable once RedundantUsingDirective
68
using System.Linq;
79
using System.Threading;
@@ -13,9 +15,13 @@
1315
using GitHubReleaseChecker;
1416
using Microsoft.Extensions.DependencyInjection;
1517
using Microsoft.Extensions.Hosting;
18+
using Microsoft.Extensions.Logging;
1619
using MSURandomizerLibrary;
1720
using MSUScripter.Models;
1821
using MSUScripter.Services;
22+
using MSUScripter.ViewModels;
23+
using ReactiveUI;
24+
using ReactiveUI.SourceGenerators;
1925
using Serilog;
2026
using Win32RenderingMode = Avalonia.Win32RenderingMode;
2127

@@ -32,7 +38,6 @@ class Program
3238
[STAThread]
3339
public static void Main(string[] args)
3440
{
35-
3641
var loggerConfiguration = new LoggerConfiguration();
3742

3843
#if DEBUG
@@ -57,6 +62,10 @@ public static void Main(string[] args)
5762
#endif
5863
.CreateLogger();
5964

65+
#if DEBUG
66+
CheckReactiveProperties();
67+
#endif
68+
6069
if (args.Length == 1 && args[0].EndsWith(".msup", StringComparison.OrdinalIgnoreCase) && File.Exists(args[0]))
6170
{
6271
StartingProject = args[0];
@@ -121,6 +130,7 @@ private static IServiceCollection ConfigureServices(IServiceCollection collectio
121130
.AddSingleton<StatusBarService>()
122131
.AddSingleton<PythonCompanionService>()
123132
.AddSingleton<DependencyInstallerService>()
133+
.AddSingleton<PcmModifierService>()
124134
.AddAvaloniaControlServices<Program>()
125135
.AddTransient<ApplicationInitializationService>();
126136

@@ -166,5 +176,46 @@ await Dispatcher.UIThread.Invoke(async () =>
166176
#else
167177
private static string LogPath => Path.Combine(Directories.LogFolder, "msu-scripter_.log");
168178
#endif
179+
180+
private static void CheckReactiveProperties()
181+
{
182+
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
183+
184+
foreach (var asm in assemblies)
185+
{
186+
foreach (var type in asm.GetTypes())
187+
{
188+
if (!InheritsFromType<ReactiveObject>(type))
189+
{
190+
continue;
191+
}
192+
193+
var props = type.GetProperties(
194+
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
195+
.Select(x => (Property: x, Attributes: x.GetCustomAttributes(true)))
196+
.Where(x => x.Attributes.Any(a => a is ReactiveAttribute) && !x.Attributes.Any(a => a is GeneratedCodeAttribute))
197+
.ToList();
198+
199+
foreach (var prop in props)
200+
{
201+
Log.Logger.Warning("Class {Class} property {Property} has ReactiveAttribute but is missing partial", type.FullName, prop.Property.Name);
202+
}
203+
}
204+
}
205+
}
206+
207+
static bool InheritsFromType<T>(Type type)
208+
{
209+
var checkType = type;
210+
while (checkType != null && checkType != typeof(object))
211+
{
212+
if (checkType == typeof(T))
213+
return true;
214+
215+
checkType = checkType.BaseType;
216+
}
217+
218+
return false;
219+
}
169220

170221
}

MSUScripter/Services/ControlServices/AudioAnalysisWindowService.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.IO;
33
using System.Linq;
44
using System.Threading;
5-
using AvaloniaControls.ControlServices;
65
using AvaloniaControls.Services;
76
using Microsoft.Extensions.Logging;
87
using MSURandomizerLibrary.Services;

MSUScripter/Services/ControlServices/AudioControlService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Threading.Tasks;
33
using System.Timers;
4-
using AvaloniaControls.ControlServices;
4+
using AvaloniaControls.Services;
55
using Material.Icons;
66
using MSUScripter.Configs;
77
using MSUScripter.ViewModels;

MSUScripter/Services/ControlServices/CopyProjectWindowService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Linq;
55
using System.Threading.Tasks;
66
using Avalonia.Platform.Storage;
7-
using AvaloniaControls.ControlServices;
7+
using AvaloniaControls.Services;
88
using Microsoft.Extensions.Logging;
99
using MSUScripter.Configs;
1010
using MSUScripter.ViewModels;

0 commit comments

Comments
 (0)