Skip to content

Commit a499c10

Browse files
committed
Add Midi CLI Remapper App
0 parents  commit a499c10

30 files changed

+1071
-0
lines changed

β€Ž.gitignoreβ€Ž

Lines changed: 484 additions & 0 deletions
Large diffs are not rendered by default.

β€Ž.vscode/launch.jsonβ€Ž

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": ".NET Core Attach",
9+
"type": "coreclr",
10+
"request": "attach"
11+
},
12+
{
13+
"name": ".NET Core Launch (console)",
14+
"type": "coreclr",
15+
"request": "launch",
16+
"preLaunchTask": "build",
17+
"program": "${workspaceFolder}/src/CLI/bin/Debug/net9.0/CLI.dll",
18+
"args": [],
19+
"cwd": "${workspaceFolder}/src/CLI",
20+
"console": "internalConsole",
21+
"stopAtEntry": false
22+
},
23+
{
24+
"name": ".NET Core Attach",
25+
"type": "coreclr",
26+
"request": "attach"
27+
}
28+
]
29+
}

β€Ž.vscode/tasks.jsonβ€Ž

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/drum-midi-remapper.sln",
11+
"/property:GenerateFullPaths=true",
12+
"/consoleloggerparameters:NoSummary;ForceNoAlign"
13+
],
14+
"problemMatcher": "$msCompile"
15+
},
16+
{
17+
"label": "publish",
18+
"command": "dotnet",
19+
"type": "process",
20+
"args": [
21+
"publish",
22+
"${workspaceFolder}/drum-midi-remapper.sln",
23+
"/property:GenerateFullPaths=true",
24+
"/consoleloggerparameters:NoSummary;ForceNoAlign"
25+
],
26+
"problemMatcher": "$msCompile"
27+
},
28+
{
29+
"label": "watch",
30+
"command": "dotnet",
31+
"type": "process",
32+
"args": [
33+
"watch",
34+
"run",
35+
"--project",
36+
"${workspaceFolder}/drum-midi-remapper.sln"
37+
],
38+
"problemMatcher": "$msCompile"
39+
}
40+
]
41+
}

β€ŽREADME.mdβ€Ž

Whitespace-only changes.

β€Ždrum-midi-remapper.slnβ€Ž

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Models", "src\Models\Models.csproj", "{E8D51051-F024-415B-A6AF-F68F0D6C777E}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Services", "src\Services\Services.csproj", "{E5A71B17-7DDC-452E-AE20-141AFDAE906A}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Managers", "src\Managers\Managers.csproj", "{92335A36-F5AE-45AA-B691-5054C217E33A}"
13+
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CLI", "src\CLI\CLI.csproj", "{36E27E57-4986-4178-98F8-3B4F6D985E2C}"
15+
EndProject
16+
Global
17+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
18+
Debug|Any CPU = Debug|Any CPU
19+
Debug|x64 = Debug|x64
20+
Debug|x86 = Debug|x86
21+
Release|Any CPU = Release|Any CPU
22+
Release|x64 = Release|x64
23+
Release|x86 = Release|x86
24+
EndGlobalSection
25+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
26+
{E8D51051-F024-415B-A6AF-F68F0D6C777E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{E8D51051-F024-415B-A6AF-F68F0D6C777E}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{E8D51051-F024-415B-A6AF-F68F0D6C777E}.Debug|x64.ActiveCfg = Debug|Any CPU
29+
{E8D51051-F024-415B-A6AF-F68F0D6C777E}.Debug|x64.Build.0 = Debug|Any CPU
30+
{E8D51051-F024-415B-A6AF-F68F0D6C777E}.Debug|x86.ActiveCfg = Debug|Any CPU
31+
{E8D51051-F024-415B-A6AF-F68F0D6C777E}.Debug|x86.Build.0 = Debug|Any CPU
32+
{E8D51051-F024-415B-A6AF-F68F0D6C777E}.Release|Any CPU.ActiveCfg = Release|Any CPU
33+
{E8D51051-F024-415B-A6AF-F68F0D6C777E}.Release|Any CPU.Build.0 = Release|Any CPU
34+
{E8D51051-F024-415B-A6AF-F68F0D6C777E}.Release|x64.ActiveCfg = Release|Any CPU
35+
{E8D51051-F024-415B-A6AF-F68F0D6C777E}.Release|x64.Build.0 = Release|Any CPU
36+
{E8D51051-F024-415B-A6AF-F68F0D6C777E}.Release|x86.ActiveCfg = Release|Any CPU
37+
{E8D51051-F024-415B-A6AF-F68F0D6C777E}.Release|x86.Build.0 = Release|Any CPU
38+
{E5A71B17-7DDC-452E-AE20-141AFDAE906A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39+
{E5A71B17-7DDC-452E-AE20-141AFDAE906A}.Debug|Any CPU.Build.0 = Debug|Any CPU
40+
{E5A71B17-7DDC-452E-AE20-141AFDAE906A}.Debug|x64.ActiveCfg = Debug|Any CPU
41+
{E5A71B17-7DDC-452E-AE20-141AFDAE906A}.Debug|x64.Build.0 = Debug|Any CPU
42+
{E5A71B17-7DDC-452E-AE20-141AFDAE906A}.Debug|x86.ActiveCfg = Debug|Any CPU
43+
{E5A71B17-7DDC-452E-AE20-141AFDAE906A}.Debug|x86.Build.0 = Debug|Any CPU
44+
{E5A71B17-7DDC-452E-AE20-141AFDAE906A}.Release|Any CPU.ActiveCfg = Release|Any CPU
45+
{E5A71B17-7DDC-452E-AE20-141AFDAE906A}.Release|Any CPU.Build.0 = Release|Any CPU
46+
{E5A71B17-7DDC-452E-AE20-141AFDAE906A}.Release|x64.ActiveCfg = Release|Any CPU
47+
{E5A71B17-7DDC-452E-AE20-141AFDAE906A}.Release|x64.Build.0 = Release|Any CPU
48+
{E5A71B17-7DDC-452E-AE20-141AFDAE906A}.Release|x86.ActiveCfg = Release|Any CPU
49+
{E5A71B17-7DDC-452E-AE20-141AFDAE906A}.Release|x86.Build.0 = Release|Any CPU
50+
{92335A36-F5AE-45AA-B691-5054C217E33A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
51+
{92335A36-F5AE-45AA-B691-5054C217E33A}.Debug|Any CPU.Build.0 = Debug|Any CPU
52+
{92335A36-F5AE-45AA-B691-5054C217E33A}.Debug|x64.ActiveCfg = Debug|Any CPU
53+
{92335A36-F5AE-45AA-B691-5054C217E33A}.Debug|x64.Build.0 = Debug|Any CPU
54+
{92335A36-F5AE-45AA-B691-5054C217E33A}.Debug|x86.ActiveCfg = Debug|Any CPU
55+
{92335A36-F5AE-45AA-B691-5054C217E33A}.Debug|x86.Build.0 = Debug|Any CPU
56+
{92335A36-F5AE-45AA-B691-5054C217E33A}.Release|Any CPU.ActiveCfg = Release|Any CPU
57+
{92335A36-F5AE-45AA-B691-5054C217E33A}.Release|Any CPU.Build.0 = Release|Any CPU
58+
{92335A36-F5AE-45AA-B691-5054C217E33A}.Release|x64.ActiveCfg = Release|Any CPU
59+
{92335A36-F5AE-45AA-B691-5054C217E33A}.Release|x64.Build.0 = Release|Any CPU
60+
{92335A36-F5AE-45AA-B691-5054C217E33A}.Release|x86.ActiveCfg = Release|Any CPU
61+
{92335A36-F5AE-45AA-B691-5054C217E33A}.Release|x86.Build.0 = Release|Any CPU
62+
{36E27E57-4986-4178-98F8-3B4F6D985E2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
63+
{36E27E57-4986-4178-98F8-3B4F6D985E2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
64+
{36E27E57-4986-4178-98F8-3B4F6D985E2C}.Debug|x64.ActiveCfg = Debug|Any CPU
65+
{36E27E57-4986-4178-98F8-3B4F6D985E2C}.Debug|x64.Build.0 = Debug|Any CPU
66+
{36E27E57-4986-4178-98F8-3B4F6D985E2C}.Debug|x86.ActiveCfg = Debug|Any CPU
67+
{36E27E57-4986-4178-98F8-3B4F6D985E2C}.Debug|x86.Build.0 = Debug|Any CPU
68+
{36E27E57-4986-4178-98F8-3B4F6D985E2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
69+
{36E27E57-4986-4178-98F8-3B4F6D985E2C}.Release|Any CPU.Build.0 = Release|Any CPU
70+
{36E27E57-4986-4178-98F8-3B4F6D985E2C}.Release|x64.ActiveCfg = Release|Any CPU
71+
{36E27E57-4986-4178-98F8-3B4F6D985E2C}.Release|x64.Build.0 = Release|Any CPU
72+
{36E27E57-4986-4178-98F8-3B4F6D985E2C}.Release|x86.ActiveCfg = Release|Any CPU
73+
{36E27E57-4986-4178-98F8-3B4F6D985E2C}.Release|x86.Build.0 = Release|Any CPU
74+
EndGlobalSection
75+
GlobalSection(SolutionProperties) = preSolution
76+
HideSolutionNode = FALSE
77+
EndGlobalSection
78+
GlobalSection(NestedProjects) = preSolution
79+
{E8D51051-F024-415B-A6AF-F68F0D6C777E} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
80+
{E5A71B17-7DDC-452E-AE20-141AFDAE906A} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
81+
{92335A36-F5AE-45AA-B691-5054C217E33A} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
82+
{36E27E57-4986-4178-98F8-3B4F6D985E2C} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
83+
EndGlobalSection
84+
EndGlobal

β€Žmidis/test.midβ€Ž

17.5 KB
Binary file not shown.

β€Žsrc/CLI/CLI.csprojβ€Ž

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<ItemGroup>
4+
<ProjectReference Include="..\Managers\Managers.csproj" />
5+
</ItemGroup>
6+
7+
<PropertyGroup>
8+
<OutputType>Exe</OutputType>
9+
<TargetFramework>net9.0</TargetFramework>
10+
<ImplicitUsings>enable</ImplicitUsings>
11+
<Nullable>enable</Nullable>
12+
</PropertyGroup>
13+
14+
</Project>

β€Žsrc/CLI/Program.csβ€Ž

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
ο»Ώusing Microsoft.Extensions.DependencyInjection;
2+
using Managers.Contracts;
3+
using Services;
4+
using Managers;
5+
6+
namespace CLI;
7+
8+
internal class Program
9+
{
10+
private const string SUCCESS_MESSAGE = "βœ… MIDI file remapped successfully.";
11+
12+
private static async Task Main(string[] args)
13+
{
14+
ServiceCollection services = new();
15+
16+
services.AddServices();
17+
services.AddManagers();
18+
19+
ServiceProvider provider = services.BuildServiceProvider();
20+
21+
ICliArgumentManager argumentManager = provider.GetRequiredService<ICliArgumentManager>();
22+
IMidiMapManager manager = provider.GetRequiredService<IMidiMapManager>();
23+
24+
try
25+
{
26+
Models.RemapVariables variables = await argumentManager.Execute(args);
27+
28+
await manager.RemapMidi(variables);
29+
Console.WriteLine(SUCCESS_MESSAGE);
30+
}
31+
catch (Exception ex)
32+
{
33+
Console.WriteLine($"❌ Error: {ex.Message}");
34+
}
35+
}
36+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Models;
2+
3+
namespace Managers.Contracts;
4+
5+
public interface ICliArgumentManager
6+
{
7+
Task<RemapVariables> Execute(string[] args);
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Models;
2+
3+
namespace Managers.Contracts;
4+
5+
public interface IMidiMapManager
6+
{
7+
Task RemapMidi(RemapVariables variables);
8+
}

0 commit comments

Comments
Β (0)