static void Main(string[] args) { log4net.Config.BasicConfigurator.Configure(); var pen = TipToiPen.GetAll().FirstOrDefault(); if (pen == null) { pen = TipToiPen.Simulated; log.InfoFormat("Pen is not attached. Output will be written to {0}", pen.RootDirectory); } var package = Package.CreateFromInputPaths(args); var cacheDirectory = Path.Combine(About.LocalApplicationDataDirectory, "cache"); var converter = new MediaFileConverter(cacheDirectory); var structure = new PackageDirectoryStructure(pen.RootDirectory, package); var packageBuilder = new PackageBuilder(structure, converter, Settings.Read().CreateOidSvgWriter()); packageBuilder.Build(CancellationToken.None).Wait(); }
public async Task Build(string[] mp3FilesOrDirectories) { if (!mp3FilesOrDirectories.Any()) { throw new ArgumentOutOfRangeException(nameof(mp3FilesOrDirectories), String.Empty, "You must specify at least one audio file."); } var pen = TipToiPen.GetAll().FirstOrDefault(); if (pen == null) { pen = TipToiPen.Simulated; log.InfoFormat("Pen is not attached. Output will be written to {0}", pen.RootDirectory); } var package = Package.CreateFromInputPaths(mp3FilesOrDirectories); var cacheDirectory = Path.Combine(About.Get().LocalApplicationDataDirectory, "cache"); var converter = new MediaFileConverter(cacheDirectory); var structure = new PackageDirectoryStructure(pen.RootDirectory, package); var packageBuilder = new PackageBuilder(structure, converter, Settings.Read().CreateOidSvgWriter()); await packageBuilder.Build(CancellationToken.None); }
public async Task Upload(CancellationToken cancellationToken, TipToiPen pen) { await PathUtil.CopyToDir(cancellationToken, this.packageDirectoryStructure.GmeFile, pen.RootDirectory); }