Skip to content

Commit

Permalink
Merge pull request #1 from luizen/develop
Browse files Browse the repository at this point in the history
New changes...
  • Loading branch information
luizen authored Apr 24, 2022
2 parents d8d1b33 + e09c2e8 commit 6309d30
Show file tree
Hide file tree
Showing 52 changed files with 1,157 additions and 348 deletions.
Binary file modified .DS_Store
Binary file not shown.
20 changes: 8 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
bin/Debug/netcoreapp3.1/als-tools.deps.json
bin/Debug/netcoreapp3.1/als-tools.dll
bin/Debug/netcoreapp3.1/als-tools.pdb
bin/Debug/netcoreapp3.1/als-tools.runtimeconfig.dev.json
bin/Debug/netcoreapp3.1/als-tools.runtimeconfig.json
obj/als-tools.csproj.nuget.cache
obj/als-tools.csproj.nuget.dgspec.json
obj/project.assets.json
obj/Debug/netcoreapp3.1/als-tools.csproj.FileListAbsolute.txt
obj/Debug/netcoreapp3.1/als-tools.csprojAssemblyReference.cache
obj/Debug/netcoreapp3.1/als-tools.dll
obj/Debug/netcoreapp3.1/als-tools.pdb
/obj/
/bin/
*.dll
*.pdb
*.cache
/LiteDb/
.DS_Store
output/*
8 changes: 6 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/als-tools.dll",
"args": [],
"program": "${workspaceFolder}/bin/Debug/net6.0/als-tools.dll",
//"args": ["--locate=HG2;bx_tunner", "--folder=/Users/zenluiz/Desktop/Testes ALS"],
"args": ["--locate=kickbox;replika"],
// "args": ["--list"],
// "args": ["--initdb", "--folder=/Users/zenluiz/Desktop/Testes ALS"],
// "args": ["--initdb", "--folder=/Users/zenluiz/Splice"],
"cwd": "${workspaceFolder}",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
Expand Down
12 changes: 12 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@
],
"problemMatcher": "$msCompile"
},
{
"label": "clean",
"command": "dotnet",
"type": "process",
"args": [
"clean",
"${workspaceFolder}/als-tools.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
Expand Down
88 changes: 0 additions & 88 deletions AlsToolsManager.cs

This file was deleted.

102 changes: 102 additions & 0 deletions App.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AlsTools.Core.Entities;
using AlsTools.Core.Interfaces;
using Microsoft.Extensions.Logging;

namespace AlsTools
{
public class App
{
private readonly ILogger<App> logger;
private readonly ILiveProjectService liveProjectService;

public App(ILogger<App> logger, ILiveProjectService liveProjectService)
{
this.logger = logger;
this.liveProjectService = liveProjectService;
}

public async Task Run(ProgramArgs args)
{
logger.LogDebug("App start");

if (args.InitDb)
{
int count = 0;
if (!string.IsNullOrEmpty(args.File))
count = liveProjectService.InitializeDbFromFile(args.File);
else
count = liveProjectService.InitializeDbFromFolder(args.Folder, args.IncludeBackups);

await Console.Out.WriteLineAsync($"\nTotal of projects loaded into DB: {count}");
}
else if (args.CountProjects)
{
int count = liveProjectService.CountProjects();

await Console.Out.WriteLineAsync($"\nTotal of projects in the DB: {count}");
}
else if (args.ListPlugins)
{
var projects = liveProjectService.GetAllProjects().ToList();
await PrintProjectsAndPlugins(projects);
await Console.Out.WriteLineAsync($"\nTotal of projects: {projects.Count}");
}
else if (args.LocatePlugins)
{
var projects = liveProjectService.GetProjectsContainingPlugins(args.PluginsToLocate).ToList();
await PrintProjectsAndPlugins(projects);
await Console.Out.WriteLineAsync($"\nTotal of projects: {projects.Count}");
}
else if (args.Export)
{
var projects = liveProjectService.GetAllProjects().ToList();
await ExportProjectsAndPlugins(projects);
await Console.Out.WriteLineAsync($"\nTotal of projects: {projects.Count}");
}
else
{
throw new InvalidOperationException("Nothing to do?");
}
}

private Task ExportProjectsAndPlugins(List<LiveProject> projects)
{
throw new NotImplementedException();
}

private async Task PrintProjectsAndPlugins(IEnumerable<LiveProject> projects)
{
foreach (var p in projects)
await PrintProjectAndPlugins(p);
}

private async Task PrintProjectAndPlugins(LiveProject project)
{
await Console.Out.WriteLineAsync("------------------------------------------------------------------------------");
await Console.Out.WriteLineAsync($"Project name: {project.Name}");
await Console.Out.WriteLineAsync($"Live version (creator): {project.LiveVersion}");
await Console.Out.WriteLineAsync($"Full path: {project.Path}");
await Console.Out.WriteLineAsync("\tTracks and plugins:");

if (project.Tracks.Count == 0)
await Console.Out.WriteLineAsync("\t\tNo tracks found!");

foreach (var tr in project.Tracks)
{
await Console.Out.WriteLineAsync($"\t\tName = {tr.Name} | Type = {tr.Type}");

await Console.Out.WriteLineAsync("\t\t\tLive Devices:");
foreach (var ld in tr.Devices)
await Console.Out.WriteLineAsync($"\t\t\t\tName = {ld.Key}");

await Console.Out.WriteLineAsync("\t\t\tPlugins:");
foreach (var p in tr.Plugins)
await Console.Out.WriteLineAsync($"\t\t\t\tName = {p.Key} | Type = {p.Value.PluginType}");
}
}
}
}
7 changes: 7 additions & 0 deletions Config/LiteDbOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace AlsTools.Config
{
public class LiteDbOptions
{
public string DatabaseLocation { get; set; }
}
}
15 changes: 15 additions & 0 deletions Core/Entities/Devices/BaseDevice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

namespace AlsTools.Core.Entities.Devices
{
public abstract class BaseDevice : IDevice
{
public BaseDevice(DeviceType type)
{
Type = type;
}

public string Name { get; set; }

public DeviceType Type { get; protected set; }
}
}
9 changes: 9 additions & 0 deletions Core/Entities/Devices/DeviceType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace AlsTools.Core.Entities.Devices
{
public enum DeviceType
{
LiveDevice,

Plugin
}
}
9 changes: 9 additions & 0 deletions Core/Entities/Devices/IDevice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace AlsTools.Core.Entities.Devices
{
public interface IDevice
{
string Name { get; set; }

DeviceType Type { get; }
}
}
10 changes: 10 additions & 0 deletions Core/Entities/Devices/LiveDevice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

namespace AlsTools.Core.Entities.Devices
{
public class LiveDevice : BaseDevice, IDevice
{
public LiveDevice() : base(DeviceType.LiveDevice)
{
}
}
}
11 changes: 11 additions & 0 deletions Core/Entities/Devices/PluginDevice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace AlsTools.Core.Entities.Devices
{
public class PluginDevice : BaseDevice, IDevice
{
public PluginDevice() : base(DeviceType.Plugin)
{
}

public PluginType PluginType { get; set; }
}
}
10 changes: 7 additions & 3 deletions LiveProject.cs → Core/Entities/LiveProject.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
using System.Collections.Generic;
namespace AlsTools
using AlsTools.Core.Entities.Tracks;

namespace AlsTools.Core.Entities
{
public class LiveProject
{
public LiveProject()
{
Plugins = new SortedDictionary<string, PluginInfo>();
Tracks = new List<ITrack>();
}

public int Id { get; set; }

public string Name { get; set; }

public string Path { get; set; }

public string LiveVersion { get; set; }

public SortedDictionary<string, PluginInfo> Plugins { get; set; }
public IList<ITrack> Tracks { get; set; }
}
}
4 changes: 3 additions & 1 deletion PluginType.cs → Core/Entities/PluginType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ namespace AlsTools
{
public enum PluginType
{
VST,
VST2,

VST3,

AU
}
}
13 changes: 13 additions & 0 deletions Core/Entities/TrackType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace AlsTools.Core.Entities
{
public enum TrackType
{
Audio,

Midi,

Return,

Master
}
}
9 changes: 9 additions & 0 deletions Core/Entities/Tracks/AudioTrack.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace AlsTools.Core.Entities.Tracks
{
public class AudioTrack : BaseTrack, ITrack
{
public AudioTrack() : base(TrackType.Audio)
{
}
}
}
Loading

0 comments on commit 6309d30

Please sign in to comment.