-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from luizen/develop
New changes...
- Loading branch information
Showing
52 changed files
with
1,157 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}"); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace AlsTools.Core.Entities.Devices | ||
{ | ||
public enum DeviceType | ||
{ | ||
LiveDevice, | ||
|
||
Plugin | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,10 @@ namespace AlsTools | |
{ | ||
public enum PluginType | ||
{ | ||
VST, | ||
VST2, | ||
|
||
VST3, | ||
|
||
AU | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
{ | ||
} | ||
} | ||
} |
Oops, something went wrong.