Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ DocProject/Help/html
# Click-Once directory
publish/

# Local build output (portable exe + installer)
dist/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
Expand Down Expand Up @@ -351,5 +354,6 @@ MigrationBackup/
.idea/

.github/**/*instructions*
.claude

Benchmark
30 changes: 30 additions & 0 deletions AutoMidiPlayer.Data/AppPaths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,25 @@ public static class AppPaths
/// </summary>
public static readonly string UpdateCacheDirectory = Path.Combine(AppDataDirectory, "cache", "update");

/// <summary>
/// Directory where MIDI files downloaded from online sources (e.g. MidiShow) are stored.
/// These files are referenced by the song library, so the location must be persistent.
/// </summary>
public static readonly string OnlineMidiDirectory = Path.Combine(AppDataDirectory, "OnlineMidi");

/// <summary>
/// Path to the encrypted MidiShow account credentials file (per-user, DPAPI protected).
/// Legacy single-account store; superseded by <see cref="MidiShowAccountsPath"/> and only
/// read once for migration.
/// </summary>
public static readonly string MidiShowCredentialsPath = Path.Combine(AppDataDirectory, "midishow.cred");

/// <summary>
/// Path to the encrypted MidiShow account pool file (per-user, DPAPI protected). Holds the
/// list of configured accounts (password- or cookie-based) used for download rotation.
/// </summary>
public static readonly string MidiShowAccountsPath = Path.Combine(AppDataDirectory, "midishow.accounts");

/// <summary>
/// Ensures the app data directory exists
/// </summary>
Expand All @@ -97,4 +116,15 @@ public static void EnsureDirectoryExists()
if (!Directory.Exists(LogsDirectory))
Directory.CreateDirectory(LogsDirectory);
}

/// <summary>
/// Ensures the online MIDI download directory exists and returns its path.
/// </summary>
public static string EnsureOnlineMidiDirectory()
{
if (!Directory.Exists(OnlineMidiDirectory))
Directory.CreateDirectory(OnlineMidiDirectory);

return OnlineMidiDirectory;
}
}
5 changes: 3 additions & 2 deletions AutoMidiPlayer.Data/Midi/MidiFile.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
Expand All @@ -18,7 +18,8 @@ public class MidiFile : Screen

public MidiFile(Song song, ReadingSettings? settings = null)
{
_settings = settings;
_settings = settings ?? new ReadingSettings();
_settings.TextEncoding = System.Text.Encoding.UTF8;

Song = song;
InitializeMidi();
Expand Down
Loading