diff --git a/Source/AppScaffolding/LibationScaffolding.cs b/Source/AppScaffolding/LibationScaffolding.cs index eb113cdd..924256db 100644 --- a/Source/AppScaffolding/LibationScaffolding.cs +++ b/Source/AppScaffolding/LibationScaffolding.cs @@ -4,7 +4,6 @@ using System.IO; using System.Linq; using System.Reflection; using ApplicationServices; -using AppScaffolding.OSInterop; using AudibleUtilities; using Dinah.Core.Collections.Generic; using Dinah.Core.IO; @@ -30,10 +29,6 @@ namespace AppScaffolding public static class LibationScaffolding { - public static bool IsWindows { get; } = OperatingSystem.IsWindows(); - public static bool IsLinux { get; } = OperatingSystem.IsLinux(); - public static bool IsMacOs { get; } = OperatingSystem.IsMacOS(); - public static ReleaseIdentifier ReleaseIdentifier { get; private set; } public static VarietyType Variety => ReleaseIdentifier == ReleaseIdentifier.WindowsClassic ? VarietyType.Classic @@ -60,8 +55,6 @@ namespace AppScaffolding ??= new[] { ExecutingAssembly.GetName(), EntryAssembly.GetName() } .Max(a => a.Version); - public static OSInteropProxy InteropInstance { get; private set; } - /// Run migrations before loading Configuration for the first time. Then load and return Configuration public static Configuration RunPreConfigMigrations() { @@ -95,10 +88,13 @@ namespace AppScaffolding { config.InProgress ??= Configuration.WinTemp; - if (!config.Exists(nameof(config.BetaOptIn))) - config.BetaOptIn = false; + if (!config.Exists(nameof(config.UseCoverAsFolderIcon))) + config.UseCoverAsFolderIcon = false; - if (!config.Exists(nameof(config.AllowLibationFixup))) + if (!config.Exists(nameof(config.BetaOptIn))) + config.BetaOptIn = false; + + if (!config.Exists(nameof(config.AllowLibationFixup))) config.AllowLibationFixup = true; if (!config.Exists(nameof(config.CreateCueSheet))) @@ -192,7 +188,6 @@ namespace AppScaffolding // all else should occur after logging - loadOSInterop(config); wireUpSystemEvents(config); } @@ -307,12 +302,6 @@ namespace AppScaffolding if (System.Diagnostics.Debugger.IsAttached) mode += " (Debugger attached)"; - string OS - = IsLinux ? "Linux" - : IsMacOs ? "MacOS" - : IsWindows ? "Windows" - : "UNKNOWN_OS"; - // begin logging session with a form feed Log.Logger.Information("\r\n\f"); Log.Logger.Information("Begin. {@DebugInfo}", new @@ -320,7 +309,8 @@ namespace AppScaffolding AppName = EntryAssembly.GetName().Name, Version = BuildVersion.ToString(), ReleaseIdentifier, - OS, + Configuration.OS, + InteropFactory.InteropFunctionsType, Mode = mode, LogLevel_Verbose_Enabled = Log.Logger.IsVerboseEnabled(), LogLevel_Debug_Enabled = Log.Logger.IsDebugEnabled(), @@ -329,8 +319,9 @@ namespace AppScaffolding LogLevel_Error_Enabled = Log.Logger.IsErrorEnabled(), LogLevel_Fatal_Enabled = Log.Logger.IsFatalEnabled(), - config.BetaOptIn, - config.LibationFiles, + config.BetaOptIn, + config.UseCoverAsFolderIcon, + config.LibationFiles, AudibleFileStorage.BooksDirectory, config.InProgress, @@ -341,19 +332,9 @@ namespace AppScaffolding AudibleFileStorage.DecryptInProgressDirectory, DecryptInProgressFiles = FileManager.FileUtility.SaferEnumerateFiles(AudibleFileStorage.DecryptInProgressDirectory).Count(), }); - } - private static void loadOSInterop(Configuration configuration) - { - InteropInstance = new OSInteropProxy(); - Serilog.Log.Logger.Information("InteropInstance:{@DebugInfo}", new - { - type = OSInteropProxy.InteropFunctionsType, - instance = InteropInstance.InteropFunctions - }); - - if (OSInteropProxy.InteropFunctionsType is null) - Serilog.Log.Logger.Warning("WARNING: OSInteropProxy.InteropFunctionsType is null"); + if (InteropFactory.InteropFunctionsType is null) + Serilog.Log.Logger.Warning("WARNING: OSInteropProxy.InteropFunctionsType is null"); } private static void wireUpSystemEvents(Configuration configuration) diff --git a/Source/AppScaffolding/OSInterop/OSConfigBase.cs b/Source/AppScaffolding/OSConfigBase.cs similarity index 96% rename from Source/AppScaffolding/OSInterop/OSConfigBase.cs rename to Source/AppScaffolding/OSConfigBase.cs index 812d854a..d07eb639 100644 --- a/Source/AppScaffolding/OSInterop/OSConfigBase.cs +++ b/Source/AppScaffolding/OSConfigBase.cs @@ -1,6 +1,6 @@ using System; -namespace AppScaffolding.OSInterop +namespace AppScaffolding { public abstract class OSConfigBase { diff --git a/Source/AppScaffolding/OSInterop/IInteropFunctions.cs b/Source/AppScaffolding/OSInterop/IInteropFunctions.cs deleted file mode 100644 index 80c6c41f..00000000 --- a/Source/AppScaffolding/OSInterop/IInteropFunctions.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace AppScaffolding.OSInterop -{ - public interface IInteropFunctions - { - // examples until the real interface is filled out - /* - public string TransformInit1(); - public int TransformInit2(); - public void CopyTextToClipboard(string text); - public void ShowForm(); - */ - } -} diff --git a/Source/AppScaffolding/OSInterop/NullInteropFunctions.cs b/Source/AppScaffolding/OSInterop/NullInteropFunctions.cs deleted file mode 100644 index 7b81b015..00000000 --- a/Source/AppScaffolding/OSInterop/NullInteropFunctions.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace AppScaffolding.OSInterop -{ - internal class NullInteropFunctions : IInteropFunctions - { - public NullInteropFunctions() { } - public NullInteropFunctions(params object[] values) { } - - // examples until the real interface is filled out - public string TransformInit1() => throw new PlatformNotSupportedException(); - public int TransformInit2() => throw new PlatformNotSupportedException(); - public void CopyTextToClipboard(string text) => throw new PlatformNotSupportedException(); - public void ShowForm() => throw new PlatformNotSupportedException(); - } -} diff --git a/Source/FileLiberator/DownloadDecryptBook.cs b/Source/FileLiberator/DownloadDecryptBook.cs index 7399b48f..a5607bd4 100644 --- a/Source/FileLiberator/DownloadDecryptBook.cs +++ b/Source/FileLiberator/DownloadDecryptBook.cs @@ -74,16 +74,19 @@ namespace FileLiberator // moves new files from temp dir to final dest. // This could take a few seconds if moving hundreds of files. - var movedAudioFile = await Task.Run(() => moveFilesToBooksDir(libraryBook, entries)); + var finalStorageDir = await Task.Run(() => moveFilesToBooksDir(libraryBook, entries)); // decrypt failed - if (!movedAudioFile) + if (finalStorageDir is null) return new StatusHandler { "Cannot find final audio file after decryption" }; if (Configuration.Instance.DownloadCoverArt) - DownloadCoverArt(libraryBook); + downloadCoverArt(libraryBook); - libraryBook.Book.UpdateBookStatus(LiberatedStatus.Liberated); + // contains logic to check for config setting and OS + WindowsDirectory.SetCoverAsFolderIcon(pictureId: libraryBook.Book.PictureId, directory: finalStorageDir); + + libraryBook.Book.UpdateBookStatus(LiberatedStatus.Liberated); return new StatusHandler(); } @@ -345,8 +348,8 @@ namespace FileLiberator } /// Move new files to 'Books' directory - /// True if audiobook file(s) were successfully created and can be located on disk. Else false. - private static bool moveFilesToBooksDir(LibraryBook libraryBook, List entries) + /// Return directory if audiobook file(s) were successfully created and can be located on disk. Else null. + private static string moveFilesToBooksDir(LibraryBook libraryBook, List entries) { // create final directory. move each file into it var destinationDir = AudibleFileStorage.Audio.GetDestinationDirectory(libraryBook); @@ -355,7 +358,7 @@ namespace FileLiberator FilePathCache.CacheEntry getFirstAudio() => entries.FirstOrDefault(f => f.FileType == FileType.Audio); if (getFirstAudio() == default) - return false; + return null; for (var i = 0; i < entries.Count; i++) { @@ -374,36 +377,31 @@ namespace FileLiberator AudibleFileStorage.Audio.Refresh(); - return true; + return destinationDir; } - private void DownloadCoverArt(LibraryBook libraryBook) + private static void downloadCoverArt(LibraryBook libraryBook) { - var destinationDir = AudibleFileStorage.Audio.GetDestinationDirectory(libraryBook); - var coverPath = AudibleFileStorage.Audio.GetBooksDirectoryFilename(libraryBook, ".jpg"); - coverPath = Path.Combine(destinationDir, Path.GetFileName(coverPath)); + var coverPath = "[null]"; try { + var destinationDir = AudibleFileStorage.Audio.GetDestinationDirectory(libraryBook); + coverPath = AudibleFileStorage.Audio.GetBooksDirectoryFilename(libraryBook, ".jpg"); + coverPath = Path.Combine(destinationDir, Path.GetFileName(coverPath)); + if (File.Exists(coverPath)) FileUtility.SaferDelete(coverPath); - (string picId, PictureSize size) = libraryBook.Book.PictureLarge is null ? - (libraryBook.Book.PictureId, PictureSize.Native) : - (libraryBook.Book.PictureLarge, PictureSize.Native); - - var picBytes = PictureStorage.GetPictureSynchronously(new PictureDefinition(picId, size)); - + var picBytes = PictureStorage.GetPictureSynchronously(new(libraryBook.Book.PictureLarge ?? libraryBook.Book.PictureId, PictureSize.Native)); if (picBytes.Length > 0) File.WriteAllBytes(coverPath, picBytes); } catch (Exception ex) { - //Failure to download cover art should not be - //considered a failure to download the book + //Failure to download cover art should not be considered a failure to download the book Serilog.Log.Logger.Error(ex, $"Error downloading cover art of {libraryBook.Book.AudibleProductId} to {coverPath} catalog product."); } - } - + } } } diff --git a/Source/LibationAvalonia/Dialogs/ImageDisplayDialog.axaml.cs b/Source/LibationAvalonia/Dialogs/ImageDisplayDialog.axaml.cs index 049f3203..992ae7a3 100644 --- a/Source/LibationAvalonia/Dialogs/ImageDisplayDialog.axaml.cs +++ b/Source/LibationAvalonia/Dialogs/ImageDisplayDialog.axaml.cs @@ -51,7 +51,7 @@ namespace LibationAvalonia.Dialogs saveFileDialog.Filters.Add(new FileDialogFilter { Name = "Jpeg", Extensions = new System.Collections.Generic.List() { "jpg" } }); saveFileDialog.InitialFileName = PictureFileName; saveFileDialog.Directory - = !AppScaffolding.LibationScaffolding.IsWindows ? null + = !LibationFileManager.Configuration.IsWindows ? null : Directory.Exists(BookSaveDirectory) ? BookSaveDirectory : Path.GetDirectoryName(BookSaveDirectory); diff --git a/Source/LibationAvalonia/Dialogs/SettingsDialog.axaml.cs b/Source/LibationAvalonia/Dialogs/SettingsDialog.axaml.cs index 0a44dc0b..aedb5863 100644 --- a/Source/LibationAvalonia/Dialogs/SettingsDialog.axaml.cs +++ b/Source/LibationAvalonia/Dialogs/SettingsDialog.axaml.cs @@ -381,7 +381,7 @@ namespace LibationAvalonia.Dialogs private int _lameVBRQuality; private string _chapterTitleTemplate; - public bool IsMp3Supported => AppScaffolding.LibationScaffolding.IsLinux || AppScaffolding.LibationScaffolding.IsWindows; + public bool IsMp3Supported => Configuration.IsLinux || Configuration.IsWindows; public AudioSettings(Configuration config) { diff --git a/Source/LibationAvalonia/FormSaveExtension.cs b/Source/LibationAvalonia/FormSaveExtension.cs index 352b9808..4f4bdd1b 100644 --- a/Source/LibationAvalonia/FormSaveExtension.cs +++ b/Source/LibationAvalonia/FormSaveExtension.cs @@ -113,7 +113,7 @@ namespace LibationAvalonia public static void HideMinMaxBtns(this Window form) { - if (Design.IsDesignMode || !AppScaffolding.LibationScaffolding.IsWindows) + if (Design.IsDesignMode || !Configuration.IsWindows) return; var handle = form.PlatformImpl.Handle.Handle; var currentStyle = GetWindowLong(handle, GWL_STYLE); diff --git a/Source/LibationAvalonia/Program.cs b/Source/LibationAvalonia/Program.cs index a42878ba..6df5f735 100644 --- a/Source/LibationAvalonia/Program.cs +++ b/Source/LibationAvalonia/Program.cs @@ -30,11 +30,11 @@ namespace LibationAvalonia var classicLifetimeTask = Task.Run(() => new ClassicDesktopStyleApplicationLifetime()); var appBuilderTask = Task.Run(BuildAvaloniaApp); - if (AppScaffolding.LibationScaffolding.IsWindows) + if (Configuration.IsWindows) AppScaffolding.LibationScaffolding.SetReleaseIdentifier(AppScaffolding.ReleaseIdentifier.WindowsAvalonia); - else if (AppScaffolding.LibationScaffolding.IsLinux) + else if (Configuration.IsLinux) AppScaffolding.LibationScaffolding.SetReleaseIdentifier(AppScaffolding.ReleaseIdentifier.LinuxAvalonia); - else if (AppScaffolding.LibationScaffolding.IsMacOs) + else if (Configuration.IsMacOs) AppScaffolding.LibationScaffolding.SetReleaseIdentifier(AppScaffolding.ReleaseIdentifier.MacOSAvalonia); else return; diff --git a/Source/LibationAvalonia/ViewModels/MainWindowViewModel.cs b/Source/LibationAvalonia/ViewModels/MainWindowViewModel.cs index 5a8b75d4..0fca0bb4 100644 --- a/Source/LibationAvalonia/ViewModels/MainWindowViewModel.cs +++ b/Source/LibationAvalonia/ViewModels/MainWindowViewModel.cs @@ -19,7 +19,7 @@ namespace LibationAvalonia.ViewModels private int _visibleCount = 1; private LibraryCommands.LibraryStats _libraryStats; private int _visibleNotLiberated = 1; - public bool IsMp3Supported => AppScaffolding.LibationScaffolding.IsLinux || AppScaffolding.LibationScaffolding.IsWindows; + public bool IsMp3Supported => Configuration.IsLinux || Configuration.IsWindows; /// The Process Queue's viewmodel public ProcessQueueViewModel ProcessQueue { get; } = new ProcessQueueViewModel(); diff --git a/Source/LibationFileManager/Configuration.Environment.cs b/Source/LibationFileManager/Configuration.Environment.cs new file mode 100644 index 00000000..f18c9944 --- /dev/null +++ b/Source/LibationFileManager/Configuration.Environment.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace LibationFileManager +{ + public partial class Configuration + { + public static bool IsWindows { get; } = OperatingSystem.IsWindows(); + public static bool IsLinux { get; } = OperatingSystem.IsLinux(); + public static bool IsMacOs { get; } = OperatingSystem.IsMacOS(); + + public static string OS { get; } + = IsLinux ? "Linux" + : IsMacOs ? "MacOS" + : IsWindows ? "Windows" + : "UNKNOWN_OS"; + } +} diff --git a/Source/LibationFileManager/Configuration.KnownDirectories.cs b/Source/LibationFileManager/Configuration.KnownDirectories.cs new file mode 100644 index 00000000..c69d16a1 --- /dev/null +++ b/Source/LibationFileManager/Configuration.KnownDirectories.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Linq; +using Dinah.Core; + +namespace LibationFileManager +{ + public partial class Configuration + { + public static string AppDir_Relative => $@".{Path.PathSeparator}{LIBATION_FILES_KEY}"; + public static string AppDir_Absolute => Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Exe.FileLocationOnDisk), LIBATION_FILES_KEY)); + public static string MyDocs => Path.GetFullPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Libation")); + public static string WinTemp => Path.GetFullPath(Path.Combine(Path.GetTempPath(), "Libation")); + public static string UserProfile => Path.GetFullPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Libation")); + + public enum KnownDirectories + { + None = 0, + + [Description("My Users folder")] + UserProfile = 1, + + [Description("The same folder that Libation is running from")] + AppDir = 2, + + [Description("Windows temporary folder")] + WinTemp = 3, + + [Description("My Documents")] + MyDocs = 4, + + [Description("Your settings folder (aka: Libation Files)")] + LibationFiles = 5 + } + // use func calls so we always get the latest value of LibationFiles + private static List<(KnownDirectories directory, Func getPathFunc)> directoryOptionsPaths { get; } = new() + { + (KnownDirectories.None, () => null), + (KnownDirectories.UserProfile, () => UserProfile), + (KnownDirectories.AppDir, () => AppDir_Relative), + (KnownDirectories.WinTemp, () => WinTemp), + (KnownDirectories.MyDocs, () => MyDocs), + // this is important to not let very early calls try to accidentally load LibationFiles too early. + // also, keep this at bottom of this list + (KnownDirectories.LibationFiles, () => libationFilesPathCache) + }; + public static string GetKnownDirectoryPath(KnownDirectories directory) + { + var dirFunc = directoryOptionsPaths.SingleOrDefault(dirFunc => dirFunc.directory == directory); + return dirFunc == default ? null : dirFunc.getPathFunc(); + } + public static KnownDirectories GetKnownDirectory(string directory) + { + // especially important so a very early call doesn't match null => LibationFiles + if (string.IsNullOrWhiteSpace(directory)) + return KnownDirectories.None; + + // 'First' instead of 'Single' because LibationFiles could match other directories. eg: default value of LibationFiles == UserProfile. + // since it's a list, order matters and non-LibationFiles will be returned first + var dirFunc = directoryOptionsPaths.FirstOrDefault(dirFunc => dirFunc.getPathFunc() == directory); + return dirFunc == default ? KnownDirectories.None : dirFunc.directory; + } + } +} diff --git a/Source/LibationFileManager/Configuration.LibationFiles.cs b/Source/LibationFileManager/Configuration.LibationFiles.cs new file mode 100644 index 00000000..1a068770 --- /dev/null +++ b/Source/LibationFileManager/Configuration.LibationFiles.cs @@ -0,0 +1,113 @@ +using System; +using System.ComponentModel; +using System.IO; +using FileManager; +using Newtonsoft.Json.Linq; +using Newtonsoft.Json; +using Serilog; + +namespace LibationFileManager +{ + public partial class Configuration + { + private static string APPSETTINGS_JSON { get; } = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "appsettings.json"); + private const string LIBATION_FILES_KEY = "LibationFiles"; + + [Description("Location for storage of program-created files")] + public string LibationFiles + { + get + { + if (libationFilesPathCache is not null) + return libationFilesPathCache; + + // FIRST: must write here before SettingsFilePath in next step reads cache + libationFilesPathCache = getLibationFilesSettingFromJson(); + + // SECOND. before setting to json file with SetWithJsonPath, PersistentDictionary must exist + persistentDictionary = new PersistentDictionary(SettingsFilePath); + + // Config init in ensureSerilogConfig() only happens when serilog setting is first created (prob on 1st run). + // This Set() enforces current LibationFiles every time we restart Libation or redirect LibationFiles + var logPath = Path.Combine(LibationFiles, "Log.log"); + + // BAD: Serilog.WriteTo[1].Args + // "[1]" assumes ordinal position + // GOOD: Serilog.WriteTo[?(@.Name=='File')].Args + var jsonpath = "Serilog.WriteTo[?(@.Name=='File')].Args"; + + SetWithJsonPath(jsonpath, "path", logPath, true); + + return libationFilesPathCache; + } + } + + private static string libationFilesPathCache { get; set; } + + private string getLibationFilesSettingFromJson() + { + string startingContents = null; + try + { + if (File.Exists(APPSETTINGS_JSON)) + { + startingContents = File.ReadAllText(APPSETTINGS_JSON); + var startingJObj = JObject.Parse(startingContents); + + if (startingJObj.ContainsKey(LIBATION_FILES_KEY)) + { + var startingValue = startingJObj[LIBATION_FILES_KEY].Value(); + if (!string.IsNullOrWhiteSpace(startingValue)) + return startingValue; + } + } + } + catch { } + + // not found. write to file. read from file + var endingContents = new JObject { { LIBATION_FILES_KEY, UserProfile.ToString() } }.ToString(Formatting.Indented); + if (startingContents != endingContents) + { + File.WriteAllText(APPSETTINGS_JSON, endingContents); + System.Threading.Thread.Sleep(100); + } + + // do not check whether directory exists. special/meta directory (eg: AppDir) is valid + // verify from live file. no try/catch. want failures to be visible + var jObjFinal = JObject.Parse(File.ReadAllText(APPSETTINGS_JSON)); + var valueFinal = jObjFinal[LIBATION_FILES_KEY].Value(); + return valueFinal; + } + + public void SetLibationFiles(string directory) + { + // ensure exists + if (!File.Exists(APPSETTINGS_JSON)) + { + // getter creates new file, loads PersistentDictionary + var _ = LibationFiles; + System.Threading.Thread.Sleep(100); + } + + libationFilesPathCache = null; + + var startingContents = File.ReadAllText(APPSETTINGS_JSON); + var jObj = JObject.Parse(startingContents); + + jObj[LIBATION_FILES_KEY] = directory; + + var endingContents = JsonConvert.SerializeObject(jObj, Formatting.Indented); + if (startingContents == endingContents) + return; + + // now it's set in the file again but no settings have moved yet + File.WriteAllText(APPSETTINGS_JSON, endingContents); + + try + { + Log.Logger.Information("Libation files changed {@DebugInfo}", new { APPSETTINGS_JSON, LIBATION_FILES_KEY, directory }); + } + catch { } + } + } +} diff --git a/Source/LibationFileManager/Configuration.Logging.cs b/Source/LibationFileManager/Configuration.Logging.cs new file mode 100644 index 00000000..aa0fae3e --- /dev/null +++ b/Source/LibationFileManager/Configuration.Logging.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using Dinah.Core; +using Dinah.Core.Logging; +using Microsoft.Extensions.Configuration; +using Serilog; +using Serilog.Events; + +namespace LibationFileManager +{ + public partial class Configuration + { + private IConfigurationRoot configuration; + + public void ConfigureLogging() + { + configuration = new ConfigurationBuilder() + .AddJsonFile(SettingsFilePath, optional: false, reloadOnChange: true) + .Build(); + Log.Logger = new LoggerConfiguration() + .ReadFrom.Configuration(configuration) + .CreateLogger(); + } + + [Description("The importance of a log event")] + public LogEventLevel LogLevel + { + get + { + var logLevelStr = persistentDictionary.GetStringFromJsonPath("Serilog", "MinimumLevel"); + return Enum.TryParse(logLevelStr, out var logLevelEnum) ? logLevelEnum : LogEventLevel.Information; + } + set + { + var valueWasChanged = persistentDictionary.SetWithJsonPath("Serilog", "MinimumLevel", value.ToString()); + if (!valueWasChanged) + { + Log.Logger.Debug("LogLevel.set attempt. No change"); + return; + } + + configuration.Reload(); + + Log.Logger.Information("Updated LogLevel MinimumLevel. {@DebugInfo}", new + { + LogLevel_Verbose_Enabled = Log.Logger.IsVerboseEnabled(), + LogLevel_Debug_Enabled = Log.Logger.IsDebugEnabled(), + LogLevel_Information_Enabled = Log.Logger.IsInformationEnabled(), + LogLevel_Warning_Enabled = Log.Logger.IsWarningEnabled(), + LogLevel_Error_Enabled = Log.Logger.IsErrorEnabled(), + LogLevel_Fatal_Enabled = Log.Logger.IsFatalEnabled() + }); + } + } + } +} diff --git a/Source/LibationFileManager/Configuration.PersistentSettings.cs b/Source/LibationFileManager/Configuration.PersistentSettings.cs new file mode 100644 index 00000000..a0193e83 --- /dev/null +++ b/Source/LibationFileManager/Configuration.PersistentSettings.cs @@ -0,0 +1,322 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Linq; +using FileManager; + +namespace LibationFileManager +{ + public partial class Configuration + { + // note: any potential file manager static ctors can't compensate if storage dir is changed at run time via settings. this is partly bad architecture. but the side effect is desirable. if changing LibationFiles location: restart app + + // default setting and directory creation occur in class responsible for files. + // config class is only responsible for path. not responsible for setting defaults, dir validation, or dir creation + // exceptions: appsettings.json, LibationFiles dir, Settings.json + + private PersistentDictionary persistentDictionary; + + public T GetNonString(string propertyName) => persistentDictionary.GetNonString(propertyName); + public object GetObject(string propertyName) => persistentDictionary.GetObject(propertyName); + public void SetObject(string propertyName, object newValue) => persistentDictionary.SetNonString(propertyName, newValue); + + /// WILL ONLY set if already present. WILL NOT create new + public void SetWithJsonPath(string jsonPath, string propertyName, string newValue, bool suppressLogging = false) + { + var settingWasChanged = persistentDictionary.SetWithJsonPath(jsonPath, propertyName, newValue, suppressLogging); + if (settingWasChanged) + configuration?.Reload(); + } + + public string SettingsFilePath => Path.Combine(LibationFiles, "Settings.json"); + + public static string GetDescription(string propertyName) + { + var attribute = typeof(Configuration) + .GetProperty(propertyName) + ?.GetCustomAttributes(typeof(DescriptionAttribute), true) + .SingleOrDefault() + as DescriptionAttribute; + + return attribute?.Description; + } + + public bool Exists(string propertyName) => persistentDictionary.Exists(propertyName); + + [Description("Set cover art as the folder's icon. (Windows only)")] + public bool UseCoverAsFolderIcon + { + get => persistentDictionary.GetNonString(nameof(UseCoverAsFolderIcon)); + set => persistentDictionary.SetNonString(nameof(UseCoverAsFolderIcon), value); + } + + [Description("Use the beta version of Libation\r\nNew and experimental features, but probably buggy.\r\n(requires restart to take effect)")] + public bool BetaOptIn + { + get => persistentDictionary.GetNonString(nameof(BetaOptIn)); + set => persistentDictionary.SetNonString(nameof(BetaOptIn), value); + } + + [Description("Location for book storage. Includes destination of newly liberated books")] + public string Books + { + get => persistentDictionary.GetString(nameof(Books)); + set => persistentDictionary.SetString(nameof(Books), value); + } + + // temp/working dir(s) should be outside of dropbox + [Description("Temporary location of files while they're in process of being downloaded and decrypted.\r\nWhen decryption is complete, the final file will be in Books location\r\nRecommend not using a folder which is backed up real time. Eg: Dropbox, iCloud, Google Drive")] + public string InProgress + { + get => persistentDictionary.GetString(nameof(InProgress)); + set => persistentDictionary.SetString(nameof(InProgress), value); + } + + [Description("Allow Libation to fix up audiobook metadata")] + public bool AllowLibationFixup + { + get => persistentDictionary.GetNonString(nameof(AllowLibationFixup)); + set => persistentDictionary.SetNonString(nameof(AllowLibationFixup), value); + } + + [Description("Create a cue sheet (.cue)")] + public bool CreateCueSheet + { + get => persistentDictionary.GetNonString(nameof(CreateCueSheet)); + set => persistentDictionary.SetNonString(nameof(CreateCueSheet), value); + } + + [Description("Retain the Aax file after successfully decrypting")] + public bool RetainAaxFile + { + get => persistentDictionary.GetNonString(nameof(RetainAaxFile)); + set => persistentDictionary.SetNonString(nameof(RetainAaxFile), value); + } + + [Description("Split my books into multiple files by chapter")] + public bool SplitFilesByChapter + { + get => persistentDictionary.GetNonString(nameof(SplitFilesByChapter)); + set => persistentDictionary.SetNonString(nameof(SplitFilesByChapter), value); + } + + [Description("Merge Opening/End Credits into the following/preceding chapters")] + public bool MergeOpeningAndEndCredits + { + get => persistentDictionary.GetNonString(nameof(MergeOpeningAndEndCredits)); + set => persistentDictionary.SetNonString(nameof(MergeOpeningAndEndCredits), value); + } + + [Description("Strip \"(Unabridged)\" from audiobook metadata tags")] + public bool StripUnabridged + { + get => persistentDictionary.GetNonString(nameof(StripUnabridged)); + set => persistentDictionary.SetNonString(nameof(StripUnabridged), value); + } + + [Description("Strip audible branding from the start and end of audiobooks.\r\n(e.g. \"This is Audible\")")] + public bool StripAudibleBrandAudio + { + get => persistentDictionary.GetNonString(nameof(StripAudibleBrandAudio)); + set => persistentDictionary.SetNonString(nameof(StripAudibleBrandAudio), value); + } + + [Description("Decrypt to lossy format?")] + public bool DecryptToLossy + { + get => persistentDictionary.GetNonString(nameof(DecryptToLossy)); + set => persistentDictionary.SetNonString(nameof(DecryptToLossy), value); + } + + [Description("Lame encoder target. true = Bitrate, false = Quality")] + public bool LameTargetBitrate + { + get => persistentDictionary.GetNonString(nameof(LameTargetBitrate)); + set => persistentDictionary.SetNonString(nameof(LameTargetBitrate), value); + } + + [Description("Lame encoder downsamples to mono")] + public bool LameDownsampleMono + { + get => persistentDictionary.GetNonString(nameof(LameDownsampleMono)); + set => persistentDictionary.SetNonString(nameof(LameDownsampleMono), value); + } + + [Description("Lame target bitrate [16,320]")] + public int LameBitrate + { + get => persistentDictionary.GetNonString(nameof(LameBitrate)); + set => persistentDictionary.SetNonString(nameof(LameBitrate), value); + } + + [Description("Restrict encoder to constant bitrate?")] + public bool LameConstantBitrate + { + get => persistentDictionary.GetNonString(nameof(LameConstantBitrate)); + set => persistentDictionary.SetNonString(nameof(LameConstantBitrate), value); + } + + [Description("Match the source bitrate?")] + public bool LameMatchSourceBR + { + get => persistentDictionary.GetNonString(nameof(LameMatchSourceBR)); + set => persistentDictionary.SetNonString(nameof(LameMatchSourceBR), value); + } + + [Description("Lame target VBR quality [10,100]")] + public int LameVBRQuality + { + get => persistentDictionary.GetNonString(nameof(LameVBRQuality)); + set => persistentDictionary.SetNonString(nameof(LameVBRQuality), value); + } + + [Description("A Dictionary of GridView data property names and bool indicating its column's visibility in ProductsGrid")] + public Dictionary GridColumnsVisibilities + { + get => persistentDictionary.GetNonString>(nameof(GridColumnsVisibilities)); + set => persistentDictionary.SetNonString(nameof(GridColumnsVisibilities), value); + } + + [Description("A Dictionary of GridView data property names and int indicating its column's display index in ProductsGrid")] + public Dictionary GridColumnsDisplayIndices + { + get => persistentDictionary.GetNonString>(nameof(GridColumnsDisplayIndices)); + set => persistentDictionary.SetNonString(nameof(GridColumnsDisplayIndices), value); + } + + [Description("A Dictionary of GridView data property names and int indicating its column's width in ProductsGrid")] + public Dictionary GridColumnsWidths + { + get => persistentDictionary.GetNonString>(nameof(GridColumnsWidths)); + set => persistentDictionary.SetNonString(nameof(GridColumnsWidths), value); + } + + [Description("Save cover image alongside audiobook?")] + public bool DownloadCoverArt + { + get => persistentDictionary.GetNonString(nameof(DownloadCoverArt)); + set => persistentDictionary.SetNonString(nameof(DownloadCoverArt), value); + } + + public enum BadBookAction + { + [Description("Ask each time what action to take.")] + Ask = 0, + [Description("Stop processing books.")] + Abort = 1, + [Description("Retry book later. Skip for now. Continue processing books.")] + Retry = 2, + [Description("Permanently ignore book. Continue processing books. Do not try book again.")] + Ignore = 3 + } + + [Description("When liberating books and there is an error, Libation should:")] + public BadBookAction BadBook + { + get + { + var badBookStr = persistentDictionary.GetString(nameof(BadBook)); + return Enum.TryParse(badBookStr, out var badBookEnum) ? badBookEnum : BadBookAction.Ask; + } + set => persistentDictionary.SetString(nameof(BadBook), value.ToString()); + } + + [Description("Show number of newly imported titles? When unchecked, no pop-up will appear after library scan.")] + public bool ShowImportedStats + { + get => persistentDictionary.GetNonString(nameof(ShowImportedStats)); + set => persistentDictionary.SetNonString(nameof(ShowImportedStats), value); + } + + [Description("Import episodes? (eg: podcasts) When unchecked, episodes will not be imported into Libation.")] + public bool ImportEpisodes + { + get => persistentDictionary.GetNonString(nameof(ImportEpisodes)); + set => persistentDictionary.SetNonString(nameof(ImportEpisodes), value); + } + + [Description("Download episodes? (eg: podcasts). When unchecked, episodes already in Libation will not be downloaded.")] + public bool DownloadEpisodes + { + get => persistentDictionary.GetNonString(nameof(DownloadEpisodes)); + set => persistentDictionary.SetNonString(nameof(DownloadEpisodes), value); + } + + public event EventHandler AutoScanChanged; + + [Description("Automatically run periodic scans in the background?")] + public bool AutoScan + { + get => persistentDictionary.GetNonString(nameof(AutoScan)); + set + { + if (AutoScan != value) + { + persistentDictionary.SetNonString(nameof(AutoScan), value); + AutoScanChanged?.Invoke(null, null); + } + } + } + + [Description("Auto download episodes? After scan, download new books in 'checked' accounts.")] + public bool AutoDownloadEpisodes + { + get => persistentDictionary.GetNonString(nameof(AutoDownloadEpisodes)); + set => persistentDictionary.SetNonString(nameof(AutoDownloadEpisodes), value); + } + + [Description("Save all podcast episodes in a series to the series parent folder?")] + public bool SavePodcastsToParentFolder + { + get => persistentDictionary.GetNonString(nameof(SavePodcastsToParentFolder)); + set => persistentDictionary.SetNonString(nameof(SavePodcastsToParentFolder), value); + } + + #region templates: custom file naming + + [Description("Edit how illegal filename characters are replaced")] + public ReplacementCharacters ReplacementCharacters + { + get => persistentDictionary.GetNonString(nameof(ReplacementCharacters)); + set => persistentDictionary.SetNonString(nameof(ReplacementCharacters), value); + } + + [Description("How to format the folders in which files will be saved")] + public string FolderTemplate + { + get => getTemplate(nameof(FolderTemplate), Templates.Folder); + set => setTemplate(nameof(FolderTemplate), Templates.Folder, value); + } + + [Description("How to format the saved pdf and audio files")] + public string FileTemplate + { + get => getTemplate(nameof(FileTemplate), Templates.File); + set => setTemplate(nameof(FileTemplate), Templates.File, value); + } + + [Description("How to format the saved audio files when split by chapters")] + public string ChapterFileTemplate + { + get => getTemplate(nameof(ChapterFileTemplate), Templates.ChapterFile); + set => setTemplate(nameof(ChapterFileTemplate), Templates.ChapterFile, value); + } + + [Description("How to format the file's Tile stored in metadata")] + public string ChapterTitleTemplate + { + get => getTemplate(nameof(ChapterTitleTemplate), Templates.ChapterTitle); + set => setTemplate(nameof(ChapterTitleTemplate), Templates.ChapterTitle, value); + } + + private string getTemplate(string settingName, Templates templ) => templ.GetValid(persistentDictionary.GetString(settingName)); + private void setTemplate(string settingName, Templates templ, string newValue) + { + var template = newValue?.Trim(); + if (templ.IsValid(template)) + persistentDictionary.SetString(settingName, template); + } + #endregion + } +} diff --git a/Source/LibationFileManager/Configuration.cs b/Source/LibationFileManager/Configuration.cs index a3cb7ad3..518dac78 100644 --- a/Source/LibationFileManager/Configuration.cs +++ b/Source/LibationFileManager/Configuration.cs @@ -1,20 +1,14 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.IO; using System.Linq; using Dinah.Core; -using Dinah.Core.Logging; using FileManager; -using Microsoft.Extensions.Configuration; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using Serilog; -using Serilog.Events; + namespace LibationFileManager { - public class Configuration + public partial class Configuration { public bool LibationSettingsAreValid => File.Exists(APPSETTINGS_JSON) @@ -37,519 +31,9 @@ namespace LibationFileManager return true; } - #region persistent configuration settings/values - - // note: any potential file manager static ctors can't compensate if storage dir is changed at run time via settings. this is partly bad architecture. but the side effect is desirable. if changing LibationFiles location: restart app - - // default setting and directory creation occur in class responsible for files. - // config class is only responsible for path. not responsible for setting defaults, dir validation, or dir creation - // exceptions: appsettings.json, LibationFiles dir, Settings.json - - private PersistentDictionary persistentDictionary; - - public T GetNonString(string propertyName) => persistentDictionary.GetNonString(propertyName); - public object GetObject(string propertyName) => persistentDictionary.GetObject(propertyName); - public void SetObject(string propertyName, object newValue) => persistentDictionary.SetNonString(propertyName, newValue); - - /// WILL ONLY set if already present. WILL NOT create new - public void SetWithJsonPath(string jsonPath, string propertyName, string newValue, bool suppressLogging = false) - { - var settingWasChanged = persistentDictionary.SetWithJsonPath(jsonPath, propertyName, newValue, suppressLogging); - if (settingWasChanged) - configuration?.Reload(); - } - - public string SettingsFilePath => Path.Combine(LibationFiles, "Settings.json"); - - public static string GetDescription(string propertyName) - { - var attribute = typeof(Configuration) - .GetProperty(propertyName) - ?.GetCustomAttributes(typeof(DescriptionAttribute), true) - .SingleOrDefault() - as DescriptionAttribute; - - return attribute?.Description; - } - - public bool Exists(string propertyName) => persistentDictionary.Exists(propertyName); - - [Description("Use the beta version of Libation\r\nNew and experimental features, but probably buggy.\r\n(requires restart to take effect)")] - public bool BetaOptIn - { - get => persistentDictionary.GetNonString(nameof(BetaOptIn)); - set => persistentDictionary.SetNonString(nameof(BetaOptIn), value); - } - - [Description("Location for book storage. Includes destination of newly liberated books")] - public string Books - { - get => persistentDictionary.GetString(nameof(Books)); - set => persistentDictionary.SetString(nameof(Books), value); - } - - // temp/working dir(s) should be outside of dropbox - [Description("Temporary location of files while they're in process of being downloaded and decrypted.\r\nWhen decryption is complete, the final file will be in Books location\r\nRecommend not using a folder which is backed up real time. Eg: Dropbox, iCloud, Google Drive")] - public string InProgress - { - get => persistentDictionary.GetString(nameof(InProgress)); - set => persistentDictionary.SetString(nameof(InProgress), value); - } - - [Description("Allow Libation to fix up audiobook metadata")] - public bool AllowLibationFixup - { - get => persistentDictionary.GetNonString(nameof(AllowLibationFixup)); - set => persistentDictionary.SetNonString(nameof(AllowLibationFixup), value); - } - - [Description("Create a cue sheet (.cue)")] - public bool CreateCueSheet - { - get => persistentDictionary.GetNonString(nameof(CreateCueSheet)); - set => persistentDictionary.SetNonString(nameof(CreateCueSheet), value); - } - - [Description("Retain the Aax file after successfully decrypting")] - public bool RetainAaxFile - { - get => persistentDictionary.GetNonString(nameof(RetainAaxFile)); - set => persistentDictionary.SetNonString(nameof(RetainAaxFile), value); - } - - [Description("Split my books into multiple files by chapter")] - public bool SplitFilesByChapter - { - get => persistentDictionary.GetNonString(nameof(SplitFilesByChapter)); - set => persistentDictionary.SetNonString(nameof(SplitFilesByChapter), value); - } - - [Description("Merge Opening/End Credits into the following/preceding chapters")] - public bool MergeOpeningAndEndCredits - { - get => persistentDictionary.GetNonString(nameof(MergeOpeningAndEndCredits)); - set => persistentDictionary.SetNonString(nameof(MergeOpeningAndEndCredits), value); - } - - [Description("Strip \"(Unabridged)\" from audiobook metadata tags")] - public bool StripUnabridged - { - get => persistentDictionary.GetNonString(nameof(StripUnabridged)); - set => persistentDictionary.SetNonString(nameof(StripUnabridged), value); - } - - [Description("Strip audible branding from the start and end of audiobooks.\r\n(e.g. \"This is Audible\")")] - public bool StripAudibleBrandAudio - { - get => persistentDictionary.GetNonString(nameof(StripAudibleBrandAudio)); - set => persistentDictionary.SetNonString(nameof(StripAudibleBrandAudio), value); - } - - [Description("Decrypt to lossy format?")] - public bool DecryptToLossy - { - get => persistentDictionary.GetNonString(nameof(DecryptToLossy)); - set => persistentDictionary.SetNonString(nameof(DecryptToLossy), value); - } - - [Description("Lame encoder target. true = Bitrate, false = Quality")] - public bool LameTargetBitrate - { - get => persistentDictionary.GetNonString(nameof(LameTargetBitrate)); - set => persistentDictionary.SetNonString(nameof(LameTargetBitrate), value); - } - - [Description("Lame encoder downsamples to mono")] - public bool LameDownsampleMono - { - get => persistentDictionary.GetNonString(nameof(LameDownsampleMono)); - set => persistentDictionary.SetNonString(nameof(LameDownsampleMono), value); - } - - [Description("Lame target bitrate [16,320]")] - public int LameBitrate - { - get => persistentDictionary.GetNonString(nameof(LameBitrate)); - set => persistentDictionary.SetNonString(nameof(LameBitrate), value); - } - - [Description("Restrict encoder to constant bitrate?")] - public bool LameConstantBitrate - { - get => persistentDictionary.GetNonString(nameof(LameConstantBitrate)); - set => persistentDictionary.SetNonString(nameof(LameConstantBitrate), value); - } - - [Description("Match the source bitrate?")] - public bool LameMatchSourceBR - { - get => persistentDictionary.GetNonString(nameof(LameMatchSourceBR)); - set => persistentDictionary.SetNonString(nameof(LameMatchSourceBR), value); - } - - [Description("Lame target VBR quality [10,100]")] - public int LameVBRQuality - { - get => persistentDictionary.GetNonString(nameof(LameVBRQuality)); - set => persistentDictionary.SetNonString(nameof(LameVBRQuality), value); - } - - [Description("A Dictionary of GridView data property names and bool indicating its column's visibility in ProductsGrid")] - public Dictionary GridColumnsVisibilities - { - get => persistentDictionary.GetNonString>(nameof(GridColumnsVisibilities)); - set => persistentDictionary.SetNonString(nameof(GridColumnsVisibilities), value); - } - - [Description("A Dictionary of GridView data property names and int indicating its column's display index in ProductsGrid")] - public Dictionary GridColumnsDisplayIndices - { - get => persistentDictionary.GetNonString>(nameof(GridColumnsDisplayIndices)); - set => persistentDictionary.SetNonString(nameof(GridColumnsDisplayIndices), value); - } - - [Description("A Dictionary of GridView data property names and int indicating its column's width in ProductsGrid")] - public Dictionary GridColumnsWidths - { - get => persistentDictionary.GetNonString>(nameof(GridColumnsWidths)); - set => persistentDictionary.SetNonString(nameof(GridColumnsWidths), value); - } - - [Description("Save cover image alongside audiobook?")] - public bool DownloadCoverArt - { - get => persistentDictionary.GetNonString(nameof(DownloadCoverArt)); - set => persistentDictionary.SetNonString(nameof(DownloadCoverArt), value); - } - - public enum BadBookAction - { - [Description("Ask each time what action to take.")] - Ask = 0, - [Description("Stop processing books.")] - Abort = 1, - [Description("Retry book later. Skip for now. Continue processing books.")] - Retry = 2, - [Description("Permanently ignore book. Continue processing books. Do not try book again.")] - Ignore = 3 - } - - [Description("When liberating books and there is an error, Libation should:")] - public BadBookAction BadBook - { - get - { - var badBookStr = persistentDictionary.GetString(nameof(BadBook)); - return Enum.TryParse(badBookStr, out var badBookEnum) ? badBookEnum : BadBookAction.Ask; - } - set => persistentDictionary.SetString(nameof(BadBook), value.ToString()); - } - - [Description("Show number of newly imported titles? When unchecked, no pop-up will appear after library scan.")] - public bool ShowImportedStats - { - get => persistentDictionary.GetNonString(nameof(ShowImportedStats)); - set => persistentDictionary.SetNonString(nameof(ShowImportedStats), value); - } - - [Description("Import episodes? (eg: podcasts) When unchecked, episodes will not be imported into Libation.")] - public bool ImportEpisodes - { - get => persistentDictionary.GetNonString(nameof(ImportEpisodes)); - set => persistentDictionary.SetNonString(nameof(ImportEpisodes), value); - } - - [Description("Download episodes? (eg: podcasts). When unchecked, episodes already in Libation will not be downloaded.")] - public bool DownloadEpisodes - { - get => persistentDictionary.GetNonString(nameof(DownloadEpisodes)); - set => persistentDictionary.SetNonString(nameof(DownloadEpisodes), value); - } - - public event EventHandler AutoScanChanged; - - [Description("Automatically run periodic scans in the background?")] - public bool AutoScan - { - get => persistentDictionary.GetNonString(nameof(AutoScan)); - set - { - if (AutoScan != value) - { - persistentDictionary.SetNonString(nameof(AutoScan), value); - AutoScanChanged?.Invoke(null, null); - } - } - } - - [Description("Auto download episodes? After scan, download new books in 'checked' accounts.")] - public bool AutoDownloadEpisodes - { - get => persistentDictionary.GetNonString(nameof(AutoDownloadEpisodes)); - set => persistentDictionary.SetNonString(nameof(AutoDownloadEpisodes), value); - } - - [Description("Save all podcast episodes in a series to the series parent folder?")] - public bool SavePodcastsToParentFolder - { - get => persistentDictionary.GetNonString(nameof(SavePodcastsToParentFolder)); - set => persistentDictionary.SetNonString(nameof(SavePodcastsToParentFolder), value); - } - - #region templates: custom file naming - - [Description("Edit how illegal filename characters are replaced")] - public ReplacementCharacters ReplacementCharacters - { - get => persistentDictionary.GetNonString(nameof(ReplacementCharacters)); - set => persistentDictionary.SetNonString(nameof(ReplacementCharacters), value); - } - - [Description("How to format the folders in which files will be saved")] - public string FolderTemplate - { - get => getTemplate(nameof(FolderTemplate), Templates.Folder); - set => setTemplate(nameof(FolderTemplate), Templates.Folder, value); - } - - [Description("How to format the saved pdf and audio files")] - public string FileTemplate - { - get => getTemplate(nameof(FileTemplate), Templates.File); - set => setTemplate(nameof(FileTemplate), Templates.File, value); - } - - [Description("How to format the saved audio files when split by chapters")] - public string ChapterFileTemplate - { - get => getTemplate(nameof(ChapterFileTemplate), Templates.ChapterFile); - set => setTemplate(nameof(ChapterFileTemplate), Templates.ChapterFile, value); - } - - [Description("How to format the file's Tile stored in metadata")] - public string ChapterTitleTemplate - { - get => getTemplate(nameof(ChapterTitleTemplate), Templates.ChapterTitle); - set => setTemplate(nameof(ChapterTitleTemplate), Templates.ChapterTitle, value); - } - - private string getTemplate(string settingName, Templates templ) => templ.GetValid(persistentDictionary.GetString(settingName)); - private void setTemplate(string settingName, Templates templ, string newValue) - { - var template = newValue?.Trim(); - if (templ.IsValid(template)) - persistentDictionary.SetString(settingName, template); - } - #endregion - - #endregion - - #region known directories - public static string AppDir_Relative => $@".{Path.PathSeparator}{LIBATION_FILES_KEY}"; - public static string AppDir_Absolute => Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Exe.FileLocationOnDisk), LIBATION_FILES_KEY)); - public static string MyDocs => Path.GetFullPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Libation")); - public static string WinTemp => Path.GetFullPath(Path.Combine(Path.GetTempPath(), "Libation")); - public static string UserProfile => Path.GetFullPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Libation")); - - public enum KnownDirectories - { - None = 0, - - [Description("My Users folder")] - UserProfile = 1, - - [Description("The same folder that Libation is running from")] - AppDir = 2, - - [Description("Windows temporary folder")] - WinTemp = 3, - - [Description("My Documents")] - MyDocs = 4, - - [Description("Your settings folder (aka: Libation Files)")] - LibationFiles = 5 - } - // use func calls so we always get the latest value of LibationFiles - private static List<(KnownDirectories directory, Func getPathFunc)> directoryOptionsPaths { get; } = new() - { - (KnownDirectories.None, () => null), - (KnownDirectories.UserProfile, () => UserProfile), - (KnownDirectories.AppDir, () => AppDir_Relative), - (KnownDirectories.WinTemp, () => WinTemp), - (KnownDirectories.MyDocs, () => MyDocs), - // this is important to not let very early calls try to accidentally load LibationFiles too early. - // also, keep this at bottom of this list - (KnownDirectories.LibationFiles, () => libationFilesPathCache) - }; - public static string GetKnownDirectoryPath(KnownDirectories directory) - { - var dirFunc = directoryOptionsPaths.SingleOrDefault(dirFunc => dirFunc.directory == directory); - return dirFunc == default ? null : dirFunc.getPathFunc(); - } - public static KnownDirectories GetKnownDirectory(string directory) - { - // especially important so a very early call doesn't match null => LibationFiles - if (string.IsNullOrWhiteSpace(directory)) - return KnownDirectories.None; - - // 'First' instead of 'Single' because LibationFiles could match other directories. eg: default value of LibationFiles == UserProfile. - // since it's a list, order matters and non-LibationFiles will be returned first - var dirFunc = directoryOptionsPaths.FirstOrDefault(dirFunc => dirFunc.getPathFunc() == directory); - return dirFunc == default ? KnownDirectories.None : dirFunc.directory; - } - #endregion - - #region logging - private IConfigurationRoot configuration; - - public void ConfigureLogging() - { - configuration = new ConfigurationBuilder() - .AddJsonFile(SettingsFilePath, optional: false, reloadOnChange: true) - .Build(); - Log.Logger = new LoggerConfiguration() - .ReadFrom.Configuration(configuration) - .CreateLogger(); - } - - [Description("The importance of a log event")] - public LogEventLevel LogLevel - { - get - { - var logLevelStr = persistentDictionary.GetStringFromJsonPath("Serilog", "MinimumLevel"); - return Enum.TryParse(logLevelStr, out var logLevelEnum) ? logLevelEnum : LogEventLevel.Information; - } - set - { - var valueWasChanged = persistentDictionary.SetWithJsonPath("Serilog", "MinimumLevel", value.ToString()); - if (!valueWasChanged) - { - Log.Logger.Debug("LogLevel.set attempt. No change"); - return; - } - - configuration.Reload(); - - Log.Logger.Information("Updated LogLevel MinimumLevel. {@DebugInfo}", new - { - LogLevel_Verbose_Enabled = Log.Logger.IsVerboseEnabled(), - LogLevel_Debug_Enabled = Log.Logger.IsDebugEnabled(), - LogLevel_Information_Enabled = Log.Logger.IsInformationEnabled(), - LogLevel_Warning_Enabled = Log.Logger.IsWarningEnabled(), - LogLevel_Error_Enabled = Log.Logger.IsErrorEnabled(), - LogLevel_Fatal_Enabled = Log.Logger.IsFatalEnabled() - }); - } - } - #endregion - #region singleton stuff public static Configuration Instance { get; } = new Configuration(); private Configuration() { } #endregion - - #region LibationFiles - private static string APPSETTINGS_JSON { get; } = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "appsettings.json"); - private const string LIBATION_FILES_KEY = "LibationFiles"; - - [Description("Location for storage of program-created files")] - public string LibationFiles - { - get - { - if (libationFilesPathCache is not null) - return libationFilesPathCache; - - // FIRST: must write here before SettingsFilePath in next step reads cache - libationFilesPathCache = getLibationFilesSettingFromJson(); - - // SECOND. before setting to json file with SetWithJsonPath, PersistentDictionary must exist - persistentDictionary = new PersistentDictionary(SettingsFilePath); - - // Config init in ensureSerilogConfig() only happens when serilog setting is first created (prob on 1st run). - // This Set() enforces current LibationFiles every time we restart Libation or redirect LibationFiles - var logPath = Path.Combine(LibationFiles, "Log.log"); - - // BAD: Serilog.WriteTo[1].Args - // "[1]" assumes ordinal position - // GOOD: Serilog.WriteTo[?(@.Name=='File')].Args - var jsonpath = "Serilog.WriteTo[?(@.Name=='File')].Args"; - - SetWithJsonPath(jsonpath, "path", logPath, true); - - return libationFilesPathCache; - } - } - - private static string libationFilesPathCache { get; set; } - - private string getLibationFilesSettingFromJson() - { - string startingContents = null; - try - { - if (File.Exists(APPSETTINGS_JSON)) - { - startingContents = File.ReadAllText(APPSETTINGS_JSON); - var startingJObj = JObject.Parse(startingContents); - - if (startingJObj.ContainsKey(LIBATION_FILES_KEY)) - { - var startingValue = startingJObj[LIBATION_FILES_KEY].Value(); - if (!string.IsNullOrWhiteSpace(startingValue)) - return startingValue; - } - } - } - catch { } - - // not found. write to file. read from file - var endingContents = new JObject { { LIBATION_FILES_KEY, UserProfile.ToString() } }.ToString(Formatting.Indented); - if (startingContents != endingContents) - { - File.WriteAllText(APPSETTINGS_JSON, endingContents); - System.Threading.Thread.Sleep(100); - } - - // do not check whether directory exists. special/meta directory (eg: AppDir) is valid - // verify from live file. no try/catch. want failures to be visible - var jObjFinal = JObject.Parse(File.ReadAllText(APPSETTINGS_JSON)); - var valueFinal = jObjFinal[LIBATION_FILES_KEY].Value(); - return valueFinal; - } - - public void SetLibationFiles(string directory) - { - // ensure exists - if (!File.Exists(APPSETTINGS_JSON)) - { - // getter creates new file, loads PersistentDictionary - var _ = LibationFiles; - System.Threading.Thread.Sleep(100); - } - - libationFilesPathCache = null; - - var startingContents = File.ReadAllText(APPSETTINGS_JSON); - var jObj = JObject.Parse(startingContents); - - jObj[LIBATION_FILES_KEY] = directory; - - var endingContents = JsonConvert.SerializeObject(jObj, Formatting.Indented); - if (startingContents == endingContents) - return; - - // now it's set in the file again but no settings have moved yet - File.WriteAllText(APPSETTINGS_JSON, endingContents); - - try - { - Log.Logger.Information("Libation files changed {@DebugInfo}", new { APPSETTINGS_JSON, LIBATION_FILES_KEY, directory }); - } - catch { } - } - #endregion } } diff --git a/Source/LibationFileManager/IInteropFunctions.cs b/Source/LibationFileManager/IInteropFunctions.cs new file mode 100644 index 00000000..a6ba31c7 --- /dev/null +++ b/Source/LibationFileManager/IInteropFunctions.cs @@ -0,0 +1,10 @@ +using System; + +namespace LibationFileManager +{ + public interface IInteropFunctions + { + void SetFolderIcon(string image, string directory); + void DeleteFolderIcon(string directory); + } +} diff --git a/Source/AppScaffolding/OSInterop/OSInteropProxy.cs b/Source/LibationFileManager/InteropFactory.cs similarity index 68% rename from Source/AppScaffolding/OSInterop/OSInteropProxy.cs rename to Source/LibationFileManager/InteropFactory.cs index 02a6bdc2..6e5cf96b 100644 --- a/Source/AppScaffolding/OSInterop/OSInteropProxy.cs +++ b/Source/LibationFileManager/InteropFactory.cs @@ -7,28 +7,34 @@ using System.Reflection; using System.Threading; using Dinah.Core; -namespace AppScaffolding.OSInterop +namespace LibationFileManager { - public class OSInteropProxy : IInteropFunctions + public static class InteropFactory { - public static bool IsWindows { get; } = OperatingSystem.IsWindows(); - public static bool IsLinux { get; } = OperatingSystem.IsLinux(); - public static bool IsMacOs { get; } = OperatingSystem.IsMacOS(); + public static Type InteropFunctionsType { get; } + + public static IInteropFunctions Create() => _create(); + + //// examples of the pattern which could be useful later + //public static IInteropFunctions Create(string str, int i) => _create(str, i); + //public static IInteropFunctions Create(params object[] values) => _create(values); + + private static IInteropFunctions _create(params object[] values) + => InteropFunctionsType is null ? new NullInteropFunctions() +//: values is null || values.Length == 0 ? Activator.CreateInstance(InteropFunctionsType) as IInteropFunctions + : Activator.CreateInstance(InteropFunctionsType, values) as IInteropFunctions; + + #region load types public static Func MatchesOS { get; } - = IsWindows ? a => Path.GetFileName(a).StartsWithInsensitive("win") - : IsLinux ? a => Path.GetFileName(a).StartsWithInsensitive("linux") - : IsMacOs ? a => Path.GetFileName(a).StartsWithInsensitive("mac") || a.StartsWithInsensitive("osx") + = Configuration.IsWindows ? a => Path.GetFileName(a).StartsWithInsensitive("win") + : Configuration.IsLinux ? a => Path.GetFileName(a).StartsWithInsensitive("linux") + : Configuration.IsMacOs ? a => Path.GetFileName(a).StartsWithInsensitive("mac") || Path.GetFileName(a).StartsWithInsensitive("osx") : _ => false; - public IInteropFunctions InteropFunctions { get; } = new NullInteropFunctions(); - - #region Singleton Stuff - private const string CONFIG_APP_ENDING = "ConfigApp.exe"; private static List ModuleList { get; } = new(); - public static Type InteropFunctionsType { get; } - static OSInteropProxy() + static InteropFactory() { // searches file names for potential matches; doesn't run anything var configApp = getOSConfigApp(); @@ -118,30 +124,5 @@ namespace AppScaffolding.OSInterop } #endregion - - public OSInteropProxy() : this(new object[0]) { } - - //// example of the pattern which could be useful later - //public OSInteropProxy(string str, int i) : this(new object[] { str, i }) { } - - private OSInteropProxy(params object[] values) - { - if (InteropFunctionsType is null) - return; - - InteropFunctions = - values is null || values.Length == 0 - ? Activator.CreateInstance(InteropFunctionsType) as IInteropFunctions - : Activator.CreateInstance(InteropFunctionsType, values) as IInteropFunctions; - } - - // Interface Members - /* - // examples until the real interface is filled out - public void CopyTextToClipboard(string text) => InteropFunctions.CopyTextToClipboard(text); - public void ShowForm() => InteropFunctions.ShowForm(); - public string TransformInit1() => InteropFunctions.TransformInit1(); - public int TransformInit2() => InteropFunctions.TransformInit2(); - */ } } diff --git a/Source/LibationFileManager/LibationFileManager.csproj b/Source/LibationFileManager/LibationFileManager.csproj index cc29e0b3..b3bd2f9a 100644 --- a/Source/LibationFileManager/LibationFileManager.csproj +++ b/Source/LibationFileManager/LibationFileManager.csproj @@ -14,12 +14,22 @@ - - embedded - + + + Configuration.cs + + + + + + + + + embedded + + + + embedded + - - embedded - - diff --git a/Source/LibationFileManager/NullInteropFunctions.cs b/Source/LibationFileManager/NullInteropFunctions.cs new file mode 100644 index 00000000..74e891b1 --- /dev/null +++ b/Source/LibationFileManager/NullInteropFunctions.cs @@ -0,0 +1,13 @@ +using System; + +namespace LibationFileManager +{ + public class NullInteropFunctions : IInteropFunctions + { + public NullInteropFunctions() { } + public NullInteropFunctions(params object[] values) { } + + public void SetFolderIcon(string image, string directory) => throw new PlatformNotSupportedException(); + public void DeleteFolderIcon(string directory) => throw new PlatformNotSupportedException(); + } +} diff --git a/Source/LibationFileManager/WindowsDirectory.cs b/Source/LibationFileManager/WindowsDirectory.cs new file mode 100644 index 00000000..1fc0cd58 --- /dev/null +++ b/Source/LibationFileManager/WindowsDirectory.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace LibationFileManager +{ + public static class WindowsDirectory + { + public static void SetCoverAsFolderIcon(string pictureId, string directory) + { + try + { + if (!Configuration.Instance.UseCoverAsFolderIcon || !Configuration.IsWindows) + return; + + // get path of cover art in Images dir. Download first if not exists + var coverArtPath = PictureStorage.GetPicturePathSynchronously(new(pictureId, PictureSize._300x300)); + + InteropFactory.Create().SetFolderIcon(image: coverArtPath, directory: directory); + } + catch (Exception ex) + { + // Failure to 'set cover as folder icon' should not be considered a failure to download the book + Serilog.Log.Logger.Error(ex, "Error setting cover art as folder icon. {@DebugInfo}", new { directory }); + + try + { + InteropFactory.Create().DeleteFolderIcon(directory); + } + catch + { + Serilog.Log.Logger.Error(ex, "Error rolling back: setting cover art as folder icon. {@DebugInfo}", new { directory }); + } + } + } + } +} diff --git a/Source/LibationWinForms/Dialogs/SettingsDialog.Designer.cs b/Source/LibationWinForms/Dialogs/SettingsDialog.Designer.cs index c32ac641..fa724771 100644 --- a/Source/LibationWinForms/Dialogs/SettingsDialog.Designer.cs +++ b/Source/LibationWinForms/Dialogs/SettingsDialog.Designer.cs @@ -28,1088 +28,1104 @@ /// private void InitializeComponent() { - this.booksLocationDescLbl = new System.Windows.Forms.Label(); - this.inProgressDescLbl = new System.Windows.Forms.Label(); - this.saveBtn = new System.Windows.Forms.Button(); - this.cancelBtn = new System.Windows.Forms.Button(); - this.importEpisodesCb = new System.Windows.Forms.CheckBox(); - this.downloadEpisodesCb = new System.Windows.Forms.CheckBox(); - this.badBookGb = new System.Windows.Forms.GroupBox(); - this.badBookIgnoreRb = new System.Windows.Forms.RadioButton(); - this.badBookRetryRb = new System.Windows.Forms.RadioButton(); - this.badBookAbortRb = new System.Windows.Forms.RadioButton(); - this.badBookAskRb = new System.Windows.Forms.RadioButton(); - this.stripAudibleBrandingCbox = new System.Windows.Forms.CheckBox(); - this.splitFilesByChapterCbox = new System.Windows.Forms.CheckBox(); - this.allowLibationFixupCbox = new System.Windows.Forms.CheckBox(); - this.convertLossyRb = new System.Windows.Forms.RadioButton(); - this.convertLosslessRb = new System.Windows.Forms.RadioButton(); - this.inProgressSelectControl = new LibationWinForms.Dialogs.DirectorySelectControl(); - this.logsBtn = new System.Windows.Forms.Button(); - this.booksSelectControl = new LibationWinForms.Dialogs.DirectoryOrCustomSelectControl(); - this.loggingLevelLbl = new System.Windows.Forms.Label(); - this.loggingLevelCb = new System.Windows.Forms.ComboBox(); - this.tabControl = new System.Windows.Forms.TabControl(); - this.tab1ImportantSettings = new System.Windows.Forms.TabPage(); - this.booksGb = new System.Windows.Forms.GroupBox(); - this.saveEpisodesToSeriesFolderCbox = new System.Windows.Forms.CheckBox(); - this.tab2ImportLibrary = new System.Windows.Forms.TabPage(); - this.autoDownloadEpisodesCb = new System.Windows.Forms.CheckBox(); - this.autoScanCb = new System.Windows.Forms.CheckBox(); - this.showImportedStatsCb = new System.Windows.Forms.CheckBox(); - this.tab3DownloadDecrypt = new System.Windows.Forms.TabPage(); - this.inProgressFilesGb = new System.Windows.Forms.GroupBox(); - this.customFileNamingGb = new System.Windows.Forms.GroupBox(); - this.editCharreplacementBtn = new System.Windows.Forms.Button(); - this.chapterFileTemplateBtn = new System.Windows.Forms.Button(); - this.chapterFileTemplateTb = new System.Windows.Forms.TextBox(); - this.chapterFileTemplateLbl = new System.Windows.Forms.Label(); - this.fileTemplateBtn = new System.Windows.Forms.Button(); - this.fileTemplateTb = new System.Windows.Forms.TextBox(); - this.fileTemplateLbl = new System.Windows.Forms.Label(); - this.folderTemplateBtn = new System.Windows.Forms.Button(); - this.folderTemplateTb = new System.Windows.Forms.TextBox(); - this.folderTemplateLbl = new System.Windows.Forms.Label(); - this.tab4AudioFileOptions = new System.Windows.Forms.TabPage(); - this.audiobookFixupsGb = new System.Windows.Forms.GroupBox(); - this.stripUnabridgedCbox = new System.Windows.Forms.CheckBox(); - this.chapterTitleTemplateGb = new System.Windows.Forms.GroupBox(); - this.chapterTitleTemplateBtn = new System.Windows.Forms.Button(); - this.chapterTitleTemplateTb = new System.Windows.Forms.TextBox(); - this.lameOptionsGb = new System.Windows.Forms.GroupBox(); - this.lameDownsampleMonoCbox = new System.Windows.Forms.CheckBox(); - this.lameBitrateGb = new System.Windows.Forms.GroupBox(); - this.LameMatchSourceBRCbox = new System.Windows.Forms.CheckBox(); - this.lameConstantBitrateCbox = new System.Windows.Forms.CheckBox(); - this.label7 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.label11 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.lameBitrateTb = new System.Windows.Forms.TrackBar(); - this.label1 = new System.Windows.Forms.Label(); - this.lameQualityGb = new System.Windows.Forms.GroupBox(); - this.label19 = new System.Windows.Forms.Label(); - this.label18 = new System.Windows.Forms.Label(); - this.label17 = new System.Windows.Forms.Label(); - this.label16 = new System.Windows.Forms.Label(); - this.label12 = new System.Windows.Forms.Label(); - this.label15 = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.label13 = new System.Windows.Forms.Label(); - this.label10 = new System.Windows.Forms.Label(); - this.label14 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.lameVBRQualityTb = new System.Windows.Forms.TrackBar(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.lameTargetQualityRb = new System.Windows.Forms.RadioButton(); - this.lameTargetBitrateRb = new System.Windows.Forms.RadioButton(); - this.mergeOpeningEndCreditsCbox = new System.Windows.Forms.CheckBox(); - this.retainAaxFileCbox = new System.Windows.Forms.CheckBox(); - this.downloadCoverArtCbox = new System.Windows.Forms.CheckBox(); - this.createCueSheetCbox = new System.Windows.Forms.CheckBox(); - this.betaOptInCbox = new System.Windows.Forms.CheckBox(); - this.badBookGb.SuspendLayout(); - this.tabControl.SuspendLayout(); - this.tab1ImportantSettings.SuspendLayout(); - this.booksGb.SuspendLayout(); - this.tab2ImportLibrary.SuspendLayout(); - this.tab3DownloadDecrypt.SuspendLayout(); - this.inProgressFilesGb.SuspendLayout(); - this.customFileNamingGb.SuspendLayout(); - this.tab4AudioFileOptions.SuspendLayout(); - this.audiobookFixupsGb.SuspendLayout(); - this.chapterTitleTemplateGb.SuspendLayout(); - this.lameOptionsGb.SuspendLayout(); - this.lameBitrateGb.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.lameBitrateTb)).BeginInit(); - this.lameQualityGb.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.lameVBRQualityTb)).BeginInit(); - this.groupBox2.SuspendLayout(); - this.SuspendLayout(); - // - // booksLocationDescLbl - // - this.booksLocationDescLbl.AutoSize = true; - this.booksLocationDescLbl.Location = new System.Drawing.Point(7, 19); - this.booksLocationDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.booksLocationDescLbl.Name = "booksLocationDescLbl"; - this.booksLocationDescLbl.Size = new System.Drawing.Size(69, 15); - this.booksLocationDescLbl.TabIndex = 1; - this.booksLocationDescLbl.Text = "[book desc]"; - // - // inProgressDescLbl - // - this.inProgressDescLbl.AutoSize = true; - this.inProgressDescLbl.Location = new System.Drawing.Point(7, 19); - this.inProgressDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.inProgressDescLbl.Name = "inProgressDescLbl"; - this.inProgressDescLbl.Size = new System.Drawing.Size(100, 45); - this.inProgressDescLbl.TabIndex = 18; - this.inProgressDescLbl.Text = "[in progress desc]\r\n[line 2]\r\n[line 3]"; - // - // saveBtn - // - this.saveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.saveBtn.Location = new System.Drawing.Point(667, 461); - this.saveBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.saveBtn.Name = "saveBtn"; - this.saveBtn.Size = new System.Drawing.Size(88, 27); - this.saveBtn.TabIndex = 98; - this.saveBtn.Text = "Save"; - this.saveBtn.UseVisualStyleBackColor = true; - this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click); - // - // cancelBtn - // - this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelBtn.Location = new System.Drawing.Point(785, 461); - this.cancelBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.cancelBtn.Name = "cancelBtn"; - this.cancelBtn.Size = new System.Drawing.Size(88, 27); - this.cancelBtn.TabIndex = 99; - this.cancelBtn.Text = "Cancel"; - this.cancelBtn.UseVisualStyleBackColor = true; - this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click); - // - // importEpisodesCb - // - this.importEpisodesCb.AutoSize = true; - this.importEpisodesCb.Location = new System.Drawing.Point(6, 56); - this.importEpisodesCb.Name = "importEpisodesCb"; - this.importEpisodesCb.Size = new System.Drawing.Size(146, 19); - this.importEpisodesCb.TabIndex = 3; - this.importEpisodesCb.Text = "[import episodes desc]"; - this.importEpisodesCb.UseVisualStyleBackColor = true; - // - // downloadEpisodesCb - // - this.downloadEpisodesCb.AutoSize = true; - this.downloadEpisodesCb.Location = new System.Drawing.Point(6, 81); - this.downloadEpisodesCb.Name = "downloadEpisodesCb"; - this.downloadEpisodesCb.Size = new System.Drawing.Size(163, 19); - this.downloadEpisodesCb.TabIndex = 4; - this.downloadEpisodesCb.Text = "[download episodes desc]"; - this.downloadEpisodesCb.UseVisualStyleBackColor = true; - // - // badBookGb - // - this.badBookGb.Controls.Add(this.badBookIgnoreRb); - this.badBookGb.Controls.Add(this.badBookRetryRb); - this.badBookGb.Controls.Add(this.badBookAbortRb); - this.badBookGb.Controls.Add(this.badBookAskRb); - this.badBookGb.Location = new System.Drawing.Point(7, 6); - this.badBookGb.Name = "badBookGb"; - this.badBookGb.Size = new System.Drawing.Size(888, 76); - this.badBookGb.TabIndex = 13; - this.badBookGb.TabStop = false; - this.badBookGb.Text = "[bad book desc]"; - // - // badBookIgnoreRb - // - this.badBookIgnoreRb.AutoSize = true; - this.badBookIgnoreRb.Location = new System.Drawing.Point(384, 47); - this.badBookIgnoreRb.Name = "badBookIgnoreRb"; - this.badBookIgnoreRb.Size = new System.Drawing.Size(94, 19); - this.badBookIgnoreRb.TabIndex = 17; - this.badBookIgnoreRb.TabStop = true; - this.badBookIgnoreRb.Text = "[ignore desc]"; - this.badBookIgnoreRb.UseVisualStyleBackColor = true; - // - // badBookRetryRb - // - this.badBookRetryRb.AutoSize = true; - this.badBookRetryRb.Location = new System.Drawing.Point(5, 47); - this.badBookRetryRb.Name = "badBookRetryRb"; - this.badBookRetryRb.Size = new System.Drawing.Size(84, 19); - this.badBookRetryRb.TabIndex = 16; - this.badBookRetryRb.TabStop = true; - this.badBookRetryRb.Text = "[retry desc]"; - this.badBookRetryRb.UseVisualStyleBackColor = true; - // - // badBookAbortRb - // - this.badBookAbortRb.AutoSize = true; - this.badBookAbortRb.Location = new System.Drawing.Point(384, 22); - this.badBookAbortRb.Name = "badBookAbortRb"; - this.badBookAbortRb.Size = new System.Drawing.Size(88, 19); - this.badBookAbortRb.TabIndex = 15; - this.badBookAbortRb.TabStop = true; - this.badBookAbortRb.Text = "[abort desc]"; - this.badBookAbortRb.UseVisualStyleBackColor = true; - // - // badBookAskRb - // - this.badBookAskRb.AutoSize = true; - this.badBookAskRb.Location = new System.Drawing.Point(6, 22); - this.badBookAskRb.Name = "badBookAskRb"; - this.badBookAskRb.Size = new System.Drawing.Size(77, 19); - this.badBookAskRb.TabIndex = 14; - this.badBookAskRb.TabStop = true; - this.badBookAskRb.Text = "[ask desc]"; - this.badBookAskRb.UseVisualStyleBackColor = true; - // - // stripAudibleBrandingCbox - // - this.stripAudibleBrandingCbox.AutoSize = true; - this.stripAudibleBrandingCbox.Location = new System.Drawing.Point(13, 72); - this.stripAudibleBrandingCbox.Name = "stripAudibleBrandingCbox"; - this.stripAudibleBrandingCbox.Size = new System.Drawing.Size(143, 34); - this.stripAudibleBrandingCbox.TabIndex = 13; - this.stripAudibleBrandingCbox.Text = "[StripAudibleBranding\r\ndesc]"; - this.stripAudibleBrandingCbox.UseVisualStyleBackColor = true; - // - // splitFilesByChapterCbox - // - this.splitFilesByChapterCbox.AutoSize = true; - this.splitFilesByChapterCbox.Location = new System.Drawing.Point(13, 22); - this.splitFilesByChapterCbox.Name = "splitFilesByChapterCbox"; - this.splitFilesByChapterCbox.Size = new System.Drawing.Size(162, 19); - this.splitFilesByChapterCbox.TabIndex = 13; - this.splitFilesByChapterCbox.Text = "[SplitFilesByChapter desc]"; - this.splitFilesByChapterCbox.UseVisualStyleBackColor = true; - this.splitFilesByChapterCbox.CheckedChanged += new System.EventHandler(this.splitFilesByChapterCbox_CheckedChanged); - // - // allowLibationFixupCbox - // - this.allowLibationFixupCbox.AutoSize = true; - this.allowLibationFixupCbox.Checked = true; - this.allowLibationFixupCbox.CheckState = System.Windows.Forms.CheckState.Checked; - this.allowLibationFixupCbox.Location = new System.Drawing.Point(19, 118); - this.allowLibationFixupCbox.Name = "allowLibationFixupCbox"; - this.allowLibationFixupCbox.Size = new System.Drawing.Size(163, 19); - this.allowLibationFixupCbox.TabIndex = 10; - this.allowLibationFixupCbox.Text = "[AllowLibationFixup desc]"; - this.allowLibationFixupCbox.UseVisualStyleBackColor = true; - this.allowLibationFixupCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); - // - // convertLossyRb - // - this.convertLossyRb.AutoSize = true; - this.convertLossyRb.Location = new System.Drawing.Point(13, 136); - this.convertLossyRb.Name = "convertLossyRb"; - this.convertLossyRb.Size = new System.Drawing.Size(329, 19); - this.convertLossyRb.TabIndex = 12; - this.convertLossyRb.Text = "Download my books as .MP3 files (transcode if necessary)"; - this.convertLossyRb.UseVisualStyleBackColor = true; - this.convertLossyRb.CheckedChanged += new System.EventHandler(this.convertFormatRb_CheckedChanged); - // - // convertLosslessRb - // - this.convertLosslessRb.AutoSize = true; - this.convertLosslessRb.Checked = true; - this.convertLosslessRb.Location = new System.Drawing.Point(13, 111); - this.convertLosslessRb.Name = "convertLosslessRb"; - this.convertLosslessRb.Size = new System.Drawing.Size(335, 19); - this.convertLosslessRb.TabIndex = 11; - this.convertLosslessRb.TabStop = true; - this.convertLosslessRb.Text = "Download my books in the original audio format (Lossless)"; - this.convertLosslessRb.UseVisualStyleBackColor = true; - this.convertLosslessRb.CheckedChanged += new System.EventHandler(this.convertFormatRb_CheckedChanged); - // - // inProgressSelectControl - // - this.inProgressSelectControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.booksLocationDescLbl = new System.Windows.Forms.Label(); + this.inProgressDescLbl = new System.Windows.Forms.Label(); + this.saveBtn = new System.Windows.Forms.Button(); + this.cancelBtn = new System.Windows.Forms.Button(); + this.importEpisodesCb = new System.Windows.Forms.CheckBox(); + this.downloadEpisodesCb = new System.Windows.Forms.CheckBox(); + this.badBookGb = new System.Windows.Forms.GroupBox(); + this.badBookIgnoreRb = new System.Windows.Forms.RadioButton(); + this.badBookRetryRb = new System.Windows.Forms.RadioButton(); + this.badBookAbortRb = new System.Windows.Forms.RadioButton(); + this.badBookAskRb = new System.Windows.Forms.RadioButton(); + this.stripAudibleBrandingCbox = new System.Windows.Forms.CheckBox(); + this.splitFilesByChapterCbox = new System.Windows.Forms.CheckBox(); + this.allowLibationFixupCbox = new System.Windows.Forms.CheckBox(); + this.convertLossyRb = new System.Windows.Forms.RadioButton(); + this.convertLosslessRb = new System.Windows.Forms.RadioButton(); + this.inProgressSelectControl = new LibationWinForms.Dialogs.DirectorySelectControl(); + this.logsBtn = new System.Windows.Forms.Button(); + this.booksSelectControl = new LibationWinForms.Dialogs.DirectoryOrCustomSelectControl(); + this.loggingLevelLbl = new System.Windows.Forms.Label(); + this.loggingLevelCb = new System.Windows.Forms.ComboBox(); + this.tabControl = new System.Windows.Forms.TabControl(); + this.tab1ImportantSettings = new System.Windows.Forms.TabPage(); + this.betaOptInCbox = new System.Windows.Forms.CheckBox(); + this.booksGb = new System.Windows.Forms.GroupBox(); + this.saveEpisodesToSeriesFolderCbox = new System.Windows.Forms.CheckBox(); + this.tab2ImportLibrary = new System.Windows.Forms.TabPage(); + this.autoDownloadEpisodesCb = new System.Windows.Forms.CheckBox(); + this.autoScanCb = new System.Windows.Forms.CheckBox(); + this.showImportedStatsCb = new System.Windows.Forms.CheckBox(); + this.tab3DownloadDecrypt = new System.Windows.Forms.TabPage(); + this.useCoverAsFolderIconCb = new System.Windows.Forms.CheckBox(); + this.inProgressFilesGb = new System.Windows.Forms.GroupBox(); + this.customFileNamingGb = new System.Windows.Forms.GroupBox(); + this.editCharreplacementBtn = new System.Windows.Forms.Button(); + this.chapterFileTemplateBtn = new System.Windows.Forms.Button(); + this.chapterFileTemplateTb = new System.Windows.Forms.TextBox(); + this.chapterFileTemplateLbl = new System.Windows.Forms.Label(); + this.fileTemplateBtn = new System.Windows.Forms.Button(); + this.fileTemplateTb = new System.Windows.Forms.TextBox(); + this.fileTemplateLbl = new System.Windows.Forms.Label(); + this.folderTemplateBtn = new System.Windows.Forms.Button(); + this.folderTemplateTb = new System.Windows.Forms.TextBox(); + this.folderTemplateLbl = new System.Windows.Forms.Label(); + this.tab4AudioFileOptions = new System.Windows.Forms.TabPage(); + this.audiobookFixupsGb = new System.Windows.Forms.GroupBox(); + this.stripUnabridgedCbox = new System.Windows.Forms.CheckBox(); + this.chapterTitleTemplateGb = new System.Windows.Forms.GroupBox(); + this.chapterTitleTemplateBtn = new System.Windows.Forms.Button(); + this.chapterTitleTemplateTb = new System.Windows.Forms.TextBox(); + this.lameOptionsGb = new System.Windows.Forms.GroupBox(); + this.lameDownsampleMonoCbox = new System.Windows.Forms.CheckBox(); + this.lameBitrateGb = new System.Windows.Forms.GroupBox(); + this.LameMatchSourceBRCbox = new System.Windows.Forms.CheckBox(); + this.lameConstantBitrateCbox = new System.Windows.Forms.CheckBox(); + this.label7 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.lameBitrateTb = new System.Windows.Forms.TrackBar(); + this.label1 = new System.Windows.Forms.Label(); + this.lameQualityGb = new System.Windows.Forms.GroupBox(); + this.label19 = new System.Windows.Forms.Label(); + this.label18 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.lameVBRQualityTb = new System.Windows.Forms.TrackBar(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.lameTargetQualityRb = new System.Windows.Forms.RadioButton(); + this.lameTargetBitrateRb = new System.Windows.Forms.RadioButton(); + this.mergeOpeningEndCreditsCbox = new System.Windows.Forms.CheckBox(); + this.retainAaxFileCbox = new System.Windows.Forms.CheckBox(); + this.downloadCoverArtCbox = new System.Windows.Forms.CheckBox(); + this.createCueSheetCbox = new System.Windows.Forms.CheckBox(); + this.badBookGb.SuspendLayout(); + this.tabControl.SuspendLayout(); + this.tab1ImportantSettings.SuspendLayout(); + this.booksGb.SuspendLayout(); + this.tab2ImportLibrary.SuspendLayout(); + this.tab3DownloadDecrypt.SuspendLayout(); + this.inProgressFilesGb.SuspendLayout(); + this.customFileNamingGb.SuspendLayout(); + this.tab4AudioFileOptions.SuspendLayout(); + this.audiobookFixupsGb.SuspendLayout(); + this.chapterTitleTemplateGb.SuspendLayout(); + this.lameOptionsGb.SuspendLayout(); + this.lameBitrateGb.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.lameBitrateTb)).BeginInit(); + this.lameQualityGb.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.lameVBRQualityTb)).BeginInit(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // booksLocationDescLbl + // + this.booksLocationDescLbl.AutoSize = true; + this.booksLocationDescLbl.Location = new System.Drawing.Point(7, 19); + this.booksLocationDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.booksLocationDescLbl.Name = "booksLocationDescLbl"; + this.booksLocationDescLbl.Size = new System.Drawing.Size(69, 15); + this.booksLocationDescLbl.TabIndex = 1; + this.booksLocationDescLbl.Text = "[book desc]"; + // + // inProgressDescLbl + // + this.inProgressDescLbl.AutoSize = true; + this.inProgressDescLbl.Location = new System.Drawing.Point(7, 19); + this.inProgressDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.inProgressDescLbl.Name = "inProgressDescLbl"; + this.inProgressDescLbl.Size = new System.Drawing.Size(100, 45); + this.inProgressDescLbl.TabIndex = 18; + this.inProgressDescLbl.Text = "[in progress desc]\r\n[line 2]\r\n[line 3]"; + // + // saveBtn + // + this.saveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.saveBtn.Location = new System.Drawing.Point(667, 491); + this.saveBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.saveBtn.Name = "saveBtn"; + this.saveBtn.Size = new System.Drawing.Size(88, 27); + this.saveBtn.TabIndex = 98; + this.saveBtn.Text = "Save"; + this.saveBtn.UseVisualStyleBackColor = true; + this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click); + // + // cancelBtn + // + this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelBtn.Location = new System.Drawing.Point(785, 491); + this.cancelBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.cancelBtn.Name = "cancelBtn"; + this.cancelBtn.Size = new System.Drawing.Size(88, 27); + this.cancelBtn.TabIndex = 99; + this.cancelBtn.Text = "Cancel"; + this.cancelBtn.UseVisualStyleBackColor = true; + this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click); + // + // importEpisodesCb + // + this.importEpisodesCb.AutoSize = true; + this.importEpisodesCb.Location = new System.Drawing.Point(6, 56); + this.importEpisodesCb.Name = "importEpisodesCb"; + this.importEpisodesCb.Size = new System.Drawing.Size(146, 19); + this.importEpisodesCb.TabIndex = 3; + this.importEpisodesCb.Text = "[import episodes desc]"; + this.importEpisodesCb.UseVisualStyleBackColor = true; + // + // downloadEpisodesCb + // + this.downloadEpisodesCb.AutoSize = true; + this.downloadEpisodesCb.Location = new System.Drawing.Point(6, 81); + this.downloadEpisodesCb.Name = "downloadEpisodesCb"; + this.downloadEpisodesCb.Size = new System.Drawing.Size(163, 19); + this.downloadEpisodesCb.TabIndex = 4; + this.downloadEpisodesCb.Text = "[download episodes desc]"; + this.downloadEpisodesCb.UseVisualStyleBackColor = true; + // + // badBookGb + // + this.badBookGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.inProgressSelectControl.Location = new System.Drawing.Point(7, 68); - this.inProgressSelectControl.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.inProgressSelectControl.Name = "inProgressSelectControl"; - this.inProgressSelectControl.Size = new System.Drawing.Size(828, 52); - this.inProgressSelectControl.TabIndex = 19; - // - // logsBtn - // - this.logsBtn.Location = new System.Drawing.Point(256, 198); - this.logsBtn.Name = "logsBtn"; - this.logsBtn.Size = new System.Drawing.Size(132, 23); - this.logsBtn.TabIndex = 5; - this.logsBtn.Text = "Open log folder"; - this.logsBtn.UseVisualStyleBackColor = true; - this.logsBtn.Click += new System.EventHandler(this.logsBtn_Click); - // - // booksSelectControl - // - this.booksSelectControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.badBookGb.Controls.Add(this.badBookIgnoreRb); + this.badBookGb.Controls.Add(this.badBookRetryRb); + this.badBookGb.Controls.Add(this.badBookAbortRb); + this.badBookGb.Controls.Add(this.badBookAskRb); + this.badBookGb.Location = new System.Drawing.Point(7, 6); + this.badBookGb.Name = "badBookGb"; + this.badBookGb.Size = new System.Drawing.Size(834, 76); + this.badBookGb.TabIndex = 13; + this.badBookGb.TabStop = false; + this.badBookGb.Text = "[bad book desc]"; + // + // badBookIgnoreRb + // + this.badBookIgnoreRb.AutoSize = true; + this.badBookIgnoreRb.Location = new System.Drawing.Point(384, 47); + this.badBookIgnoreRb.Name = "badBookIgnoreRb"; + this.badBookIgnoreRb.Size = new System.Drawing.Size(94, 19); + this.badBookIgnoreRb.TabIndex = 17; + this.badBookIgnoreRb.TabStop = true; + this.badBookIgnoreRb.Text = "[ignore desc]"; + this.badBookIgnoreRb.UseVisualStyleBackColor = true; + // + // badBookRetryRb + // + this.badBookRetryRb.AutoSize = true; + this.badBookRetryRb.Location = new System.Drawing.Point(5, 47); + this.badBookRetryRb.Name = "badBookRetryRb"; + this.badBookRetryRb.Size = new System.Drawing.Size(84, 19); + this.badBookRetryRb.TabIndex = 16; + this.badBookRetryRb.TabStop = true; + this.badBookRetryRb.Text = "[retry desc]"; + this.badBookRetryRb.UseVisualStyleBackColor = true; + // + // badBookAbortRb + // + this.badBookAbortRb.AutoSize = true; + this.badBookAbortRb.Location = new System.Drawing.Point(384, 22); + this.badBookAbortRb.Name = "badBookAbortRb"; + this.badBookAbortRb.Size = new System.Drawing.Size(88, 19); + this.badBookAbortRb.TabIndex = 15; + this.badBookAbortRb.TabStop = true; + this.badBookAbortRb.Text = "[abort desc]"; + this.badBookAbortRb.UseVisualStyleBackColor = true; + // + // badBookAskRb + // + this.badBookAskRb.AutoSize = true; + this.badBookAskRb.Location = new System.Drawing.Point(6, 22); + this.badBookAskRb.Name = "badBookAskRb"; + this.badBookAskRb.Size = new System.Drawing.Size(77, 19); + this.badBookAskRb.TabIndex = 14; + this.badBookAskRb.TabStop = true; + this.badBookAskRb.Text = "[ask desc]"; + this.badBookAskRb.UseVisualStyleBackColor = true; + // + // stripAudibleBrandingCbox + // + this.stripAudibleBrandingCbox.AutoSize = true; + this.stripAudibleBrandingCbox.Location = new System.Drawing.Point(13, 72); + this.stripAudibleBrandingCbox.Name = "stripAudibleBrandingCbox"; + this.stripAudibleBrandingCbox.Size = new System.Drawing.Size(143, 34); + this.stripAudibleBrandingCbox.TabIndex = 13; + this.stripAudibleBrandingCbox.Text = "[StripAudibleBranding\r\ndesc]"; + this.stripAudibleBrandingCbox.UseVisualStyleBackColor = true; + // + // splitFilesByChapterCbox + // + this.splitFilesByChapterCbox.AutoSize = true; + this.splitFilesByChapterCbox.Location = new System.Drawing.Point(13, 22); + this.splitFilesByChapterCbox.Name = "splitFilesByChapterCbox"; + this.splitFilesByChapterCbox.Size = new System.Drawing.Size(162, 19); + this.splitFilesByChapterCbox.TabIndex = 13; + this.splitFilesByChapterCbox.Text = "[SplitFilesByChapter desc]"; + this.splitFilesByChapterCbox.UseVisualStyleBackColor = true; + this.splitFilesByChapterCbox.CheckedChanged += new System.EventHandler(this.splitFilesByChapterCbox_CheckedChanged); + // + // allowLibationFixupCbox + // + this.allowLibationFixupCbox.AutoSize = true; + this.allowLibationFixupCbox.Checked = true; + this.allowLibationFixupCbox.CheckState = System.Windows.Forms.CheckState.Checked; + this.allowLibationFixupCbox.Location = new System.Drawing.Point(19, 118); + this.allowLibationFixupCbox.Name = "allowLibationFixupCbox"; + this.allowLibationFixupCbox.Size = new System.Drawing.Size(163, 19); + this.allowLibationFixupCbox.TabIndex = 10; + this.allowLibationFixupCbox.Text = "[AllowLibationFixup desc]"; + this.allowLibationFixupCbox.UseVisualStyleBackColor = true; + this.allowLibationFixupCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); + // + // convertLossyRb + // + this.convertLossyRb.AutoSize = true; + this.convertLossyRb.Location = new System.Drawing.Point(13, 136); + this.convertLossyRb.Name = "convertLossyRb"; + this.convertLossyRb.Size = new System.Drawing.Size(329, 19); + this.convertLossyRb.TabIndex = 12; + this.convertLossyRb.Text = "Download my books as .MP3 files (transcode if necessary)"; + this.convertLossyRb.UseVisualStyleBackColor = true; + this.convertLossyRb.CheckedChanged += new System.EventHandler(this.convertFormatRb_CheckedChanged); + // + // convertLosslessRb + // + this.convertLosslessRb.AutoSize = true; + this.convertLosslessRb.Checked = true; + this.convertLosslessRb.Location = new System.Drawing.Point(13, 111); + this.convertLosslessRb.Name = "convertLosslessRb"; + this.convertLosslessRb.Size = new System.Drawing.Size(335, 19); + this.convertLosslessRb.TabIndex = 11; + this.convertLosslessRb.TabStop = true; + this.convertLosslessRb.Text = "Download my books in the original audio format (Lossless)"; + this.convertLosslessRb.UseVisualStyleBackColor = true; + this.convertLosslessRb.CheckedChanged += new System.EventHandler(this.convertFormatRb_CheckedChanged); + // + // inProgressSelectControl + // + this.inProgressSelectControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.booksSelectControl.Location = new System.Drawing.Point(7, 37); - this.booksSelectControl.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.booksSelectControl.Name = "booksSelectControl"; - this.booksSelectControl.Size = new System.Drawing.Size(829, 87); - this.booksSelectControl.TabIndex = 2; - // - // loggingLevelLbl - // - this.loggingLevelLbl.AutoSize = true; - this.loggingLevelLbl.Location = new System.Drawing.Point(6, 201); - this.loggingLevelLbl.Name = "loggingLevelLbl"; - this.loggingLevelLbl.Size = new System.Drawing.Size(78, 15); - this.loggingLevelLbl.TabIndex = 3; - this.loggingLevelLbl.Text = "Logging level"; - // - // loggingLevelCb - // - this.loggingLevelCb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.loggingLevelCb.FormattingEnabled = true; - this.loggingLevelCb.Location = new System.Drawing.Point(90, 198); - this.loggingLevelCb.Name = "loggingLevelCb"; - this.loggingLevelCb.Size = new System.Drawing.Size(129, 23); - this.loggingLevelCb.TabIndex = 4; - // - // tabControl - // - this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.inProgressSelectControl.Location = new System.Drawing.Point(7, 68); + this.inProgressSelectControl.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.inProgressSelectControl.Name = "inProgressSelectControl"; + this.inProgressSelectControl.Size = new System.Drawing.Size(828, 52); + this.inProgressSelectControl.TabIndex = 19; + // + // logsBtn + // + this.logsBtn.Location = new System.Drawing.Point(256, 198); + this.logsBtn.Name = "logsBtn"; + this.logsBtn.Size = new System.Drawing.Size(132, 23); + this.logsBtn.TabIndex = 5; + this.logsBtn.Text = "Open log folder"; + this.logsBtn.UseVisualStyleBackColor = true; + this.logsBtn.Click += new System.EventHandler(this.logsBtn_Click); + // + // booksSelectControl + // + this.booksSelectControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.booksSelectControl.Location = new System.Drawing.Point(7, 37); + this.booksSelectControl.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.booksSelectControl.Name = "booksSelectControl"; + this.booksSelectControl.Size = new System.Drawing.Size(829, 87); + this.booksSelectControl.TabIndex = 2; + // + // loggingLevelLbl + // + this.loggingLevelLbl.AutoSize = true; + this.loggingLevelLbl.Location = new System.Drawing.Point(6, 201); + this.loggingLevelLbl.Name = "loggingLevelLbl"; + this.loggingLevelLbl.Size = new System.Drawing.Size(78, 15); + this.loggingLevelLbl.TabIndex = 3; + this.loggingLevelLbl.Text = "Logging level"; + // + // loggingLevelCb + // + this.loggingLevelCb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.loggingLevelCb.FormattingEnabled = true; + this.loggingLevelCb.Location = new System.Drawing.Point(90, 198); + this.loggingLevelCb.Name = "loggingLevelCb"; + this.loggingLevelCb.Size = new System.Drawing.Size(129, 23); + this.loggingLevelCb.TabIndex = 4; + // + // tabControl + // + this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.tabControl.Controls.Add(this.tab1ImportantSettings); - this.tabControl.Controls.Add(this.tab2ImportLibrary); - this.tabControl.Controls.Add(this.tab3DownloadDecrypt); - this.tabControl.Controls.Add(this.tab4AudioFileOptions); - this.tabControl.Location = new System.Drawing.Point(12, 12); - this.tabControl.Name = "tabControl"; - this.tabControl.SelectedIndex = 0; - this.tabControl.Size = new System.Drawing.Size(862, 443); - this.tabControl.TabIndex = 100; - // - // tab1ImportantSettings - // - this.tab1ImportantSettings.Controls.Add(this.betaOptInCbox); - this.tab1ImportantSettings.Controls.Add(this.booksGb); - this.tab1ImportantSettings.Controls.Add(this.logsBtn); - this.tab1ImportantSettings.Controls.Add(this.loggingLevelCb); - this.tab1ImportantSettings.Controls.Add(this.loggingLevelLbl); - this.tab1ImportantSettings.Location = new System.Drawing.Point(4, 24); - this.tab1ImportantSettings.Name = "tab1ImportantSettings"; - this.tab1ImportantSettings.Padding = new System.Windows.Forms.Padding(3); - this.tab1ImportantSettings.Size = new System.Drawing.Size(854, 415); - this.tab1ImportantSettings.TabIndex = 0; - this.tab1ImportantSettings.Text = "Important settings"; - this.tab1ImportantSettings.UseVisualStyleBackColor = true; - // - // booksGb - // - this.booksGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.tabControl.Controls.Add(this.tab1ImportantSettings); + this.tabControl.Controls.Add(this.tab2ImportLibrary); + this.tabControl.Controls.Add(this.tab3DownloadDecrypt); + this.tabControl.Controls.Add(this.tab4AudioFileOptions); + this.tabControl.Location = new System.Drawing.Point(12, 12); + this.tabControl.Name = "tabControl"; + this.tabControl.SelectedIndex = 0; + this.tabControl.Size = new System.Drawing.Size(862, 473); + this.tabControl.TabIndex = 100; + // + // tab1ImportantSettings + // + this.tab1ImportantSettings.Controls.Add(this.betaOptInCbox); + this.tab1ImportantSettings.Controls.Add(this.booksGb); + this.tab1ImportantSettings.Controls.Add(this.logsBtn); + this.tab1ImportantSettings.Controls.Add(this.loggingLevelCb); + this.tab1ImportantSettings.Controls.Add(this.loggingLevelLbl); + this.tab1ImportantSettings.Location = new System.Drawing.Point(4, 24); + this.tab1ImportantSettings.Name = "tab1ImportantSettings"; + this.tab1ImportantSettings.Padding = new System.Windows.Forms.Padding(3); + this.tab1ImportantSettings.Size = new System.Drawing.Size(854, 445); + this.tab1ImportantSettings.TabIndex = 0; + this.tab1ImportantSettings.Text = "Important settings"; + this.tab1ImportantSettings.UseVisualStyleBackColor = true; + // + // betaOptInCbox + // + this.betaOptInCbox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.betaOptInCbox.AutoSize = true; + this.betaOptInCbox.Enabled = false; + this.betaOptInCbox.Location = new System.Drawing.Point(13, 399); + this.betaOptInCbox.Name = "betaOptInCbox"; + this.betaOptInCbox.Size = new System.Drawing.Size(107, 19); + this.betaOptInCbox.TabIndex = 6; + this.betaOptInCbox.Text = "[Opt in to Beta]"; + this.betaOptInCbox.UseVisualStyleBackColor = true; + // + // booksGb + // + this.booksGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.booksGb.Controls.Add(this.saveEpisodesToSeriesFolderCbox); - this.booksGb.Controls.Add(this.booksSelectControl); - this.booksGb.Controls.Add(this.booksLocationDescLbl); - this.booksGb.Location = new System.Drawing.Point(6, 6); - this.booksGb.Name = "booksGb"; - this.booksGb.Size = new System.Drawing.Size(842, 156); - this.booksGb.TabIndex = 0; - this.booksGb.TabStop = false; - this.booksGb.Text = "Books location"; - // - // saveEpisodesToSeriesFolderCbox - // - this.saveEpisodesToSeriesFolderCbox.AutoSize = true; - this.saveEpisodesToSeriesFolderCbox.Location = new System.Drawing.Point(7, 131); - this.saveEpisodesToSeriesFolderCbox.Name = "saveEpisodesToSeriesFolderCbox"; - this.saveEpisodesToSeriesFolderCbox.Size = new System.Drawing.Size(191, 19); - this.saveEpisodesToSeriesFolderCbox.TabIndex = 3; - this.saveEpisodesToSeriesFolderCbox.Text = "[Save Episodes To Series Folder]"; - this.saveEpisodesToSeriesFolderCbox.UseVisualStyleBackColor = true; - // - // tab2ImportLibrary - // - this.tab2ImportLibrary.Controls.Add(this.autoDownloadEpisodesCb); - this.tab2ImportLibrary.Controls.Add(this.autoScanCb); - this.tab2ImportLibrary.Controls.Add(this.showImportedStatsCb); - this.tab2ImportLibrary.Controls.Add(this.importEpisodesCb); - this.tab2ImportLibrary.Controls.Add(this.downloadEpisodesCb); - this.tab2ImportLibrary.Location = new System.Drawing.Point(4, 24); - this.tab2ImportLibrary.Name = "tab2ImportLibrary"; - this.tab2ImportLibrary.Padding = new System.Windows.Forms.Padding(3); - this.tab2ImportLibrary.Size = new System.Drawing.Size(854, 415); - this.tab2ImportLibrary.TabIndex = 1; - this.tab2ImportLibrary.Text = "Import library"; - this.tab2ImportLibrary.UseVisualStyleBackColor = true; - // - // autoDownloadEpisodesCb - // - this.autoDownloadEpisodesCb.AutoSize = true; - this.autoDownloadEpisodesCb.Location = new System.Drawing.Point(6, 106); - this.autoDownloadEpisodesCb.Name = "autoDownloadEpisodesCb"; - this.autoDownloadEpisodesCb.Size = new System.Drawing.Size(190, 19); - this.autoDownloadEpisodesCb.TabIndex = 5; - this.autoDownloadEpisodesCb.Text = "[auto download episodes desc]"; - this.autoDownloadEpisodesCb.UseVisualStyleBackColor = true; - // - // autoScanCb - // - this.autoScanCb.AutoSize = true; - this.autoScanCb.Location = new System.Drawing.Point(6, 6); - this.autoScanCb.Name = "autoScanCb"; - this.autoScanCb.Size = new System.Drawing.Size(112, 19); - this.autoScanCb.TabIndex = 1; - this.autoScanCb.Text = "[auto scan desc]"; - this.autoScanCb.UseVisualStyleBackColor = true; - // - // showImportedStatsCb - // - this.showImportedStatsCb.AutoSize = true; - this.showImportedStatsCb.Location = new System.Drawing.Point(6, 31); - this.showImportedStatsCb.Name = "showImportedStatsCb"; - this.showImportedStatsCb.Size = new System.Drawing.Size(168, 19); - this.showImportedStatsCb.TabIndex = 2; - this.showImportedStatsCb.Text = "[show imported stats desc]"; - this.showImportedStatsCb.UseVisualStyleBackColor = true; - // - // tab3DownloadDecrypt - // - this.tab3DownloadDecrypt.Controls.Add(this.inProgressFilesGb); - this.tab3DownloadDecrypt.Controls.Add(this.customFileNamingGb); - this.tab3DownloadDecrypt.Controls.Add(this.badBookGb); - this.tab3DownloadDecrypt.Location = new System.Drawing.Point(4, 24); - this.tab3DownloadDecrypt.Name = "tab3DownloadDecrypt"; - this.tab3DownloadDecrypt.Padding = new System.Windows.Forms.Padding(3); - this.tab3DownloadDecrypt.Size = new System.Drawing.Size(854, 415); - this.tab3DownloadDecrypt.TabIndex = 2; - this.tab3DownloadDecrypt.Text = "Download/Decrypt"; - this.tab3DownloadDecrypt.UseVisualStyleBackColor = true; - // - // inProgressFilesGb - // - this.inProgressFilesGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.booksGb.Controls.Add(this.saveEpisodesToSeriesFolderCbox); + this.booksGb.Controls.Add(this.booksSelectControl); + this.booksGb.Controls.Add(this.booksLocationDescLbl); + this.booksGb.Location = new System.Drawing.Point(6, 6); + this.booksGb.Name = "booksGb"; + this.booksGb.Size = new System.Drawing.Size(842, 156); + this.booksGb.TabIndex = 0; + this.booksGb.TabStop = false; + this.booksGb.Text = "Books location"; + // + // saveEpisodesToSeriesFolderCbox + // + this.saveEpisodesToSeriesFolderCbox.AutoSize = true; + this.saveEpisodesToSeriesFolderCbox.Location = new System.Drawing.Point(7, 131); + this.saveEpisodesToSeriesFolderCbox.Name = "saveEpisodesToSeriesFolderCbox"; + this.saveEpisodesToSeriesFolderCbox.Size = new System.Drawing.Size(191, 19); + this.saveEpisodesToSeriesFolderCbox.TabIndex = 3; + this.saveEpisodesToSeriesFolderCbox.Text = "[Save Episodes To Series Folder]"; + this.saveEpisodesToSeriesFolderCbox.UseVisualStyleBackColor = true; + // + // tab2ImportLibrary + // + this.tab2ImportLibrary.Controls.Add(this.autoDownloadEpisodesCb); + this.tab2ImportLibrary.Controls.Add(this.autoScanCb); + this.tab2ImportLibrary.Controls.Add(this.showImportedStatsCb); + this.tab2ImportLibrary.Controls.Add(this.importEpisodesCb); + this.tab2ImportLibrary.Controls.Add(this.downloadEpisodesCb); + this.tab2ImportLibrary.Location = new System.Drawing.Point(4, 24); + this.tab2ImportLibrary.Name = "tab2ImportLibrary"; + this.tab2ImportLibrary.Padding = new System.Windows.Forms.Padding(3); + this.tab2ImportLibrary.Size = new System.Drawing.Size(854, 445); + this.tab2ImportLibrary.TabIndex = 1; + this.tab2ImportLibrary.Text = "Import library"; + this.tab2ImportLibrary.UseVisualStyleBackColor = true; + // + // autoDownloadEpisodesCb + // + this.autoDownloadEpisodesCb.AutoSize = true; + this.autoDownloadEpisodesCb.Location = new System.Drawing.Point(6, 106); + this.autoDownloadEpisodesCb.Name = "autoDownloadEpisodesCb"; + this.autoDownloadEpisodesCb.Size = new System.Drawing.Size(190, 19); + this.autoDownloadEpisodesCb.TabIndex = 5; + this.autoDownloadEpisodesCb.Text = "[auto download episodes desc]"; + this.autoDownloadEpisodesCb.UseVisualStyleBackColor = true; + // + // autoScanCb + // + this.autoScanCb.AutoSize = true; + this.autoScanCb.Location = new System.Drawing.Point(6, 6); + this.autoScanCb.Name = "autoScanCb"; + this.autoScanCb.Size = new System.Drawing.Size(112, 19); + this.autoScanCb.TabIndex = 1; + this.autoScanCb.Text = "[auto scan desc]"; + this.autoScanCb.UseVisualStyleBackColor = true; + // + // showImportedStatsCb + // + this.showImportedStatsCb.AutoSize = true; + this.showImportedStatsCb.Location = new System.Drawing.Point(6, 31); + this.showImportedStatsCb.Name = "showImportedStatsCb"; + this.showImportedStatsCb.Size = new System.Drawing.Size(168, 19); + this.showImportedStatsCb.TabIndex = 2; + this.showImportedStatsCb.Text = "[show imported stats desc]"; + this.showImportedStatsCb.UseVisualStyleBackColor = true; + // + // tab3DownloadDecrypt + // + this.tab3DownloadDecrypt.Controls.Add(this.useCoverAsFolderIconCb); + this.tab3DownloadDecrypt.Controls.Add(this.inProgressFilesGb); + this.tab3DownloadDecrypt.Controls.Add(this.customFileNamingGb); + this.tab3DownloadDecrypt.Controls.Add(this.badBookGb); + this.tab3DownloadDecrypt.Location = new System.Drawing.Point(4, 24); + this.tab3DownloadDecrypt.Name = "tab3DownloadDecrypt"; + this.tab3DownloadDecrypt.Padding = new System.Windows.Forms.Padding(3); + this.tab3DownloadDecrypt.Size = new System.Drawing.Size(854, 445); + this.tab3DownloadDecrypt.TabIndex = 2; + this.tab3DownloadDecrypt.Text = "Download/Decrypt"; + this.tab3DownloadDecrypt.UseVisualStyleBackColor = true; + // + // useCoverAsFolderIconCb + // + this.useCoverAsFolderIconCb.AutoSize = true; + this.useCoverAsFolderIconCb.Location = new System.Drawing.Point(7, 415); + this.useCoverAsFolderIconCb.Name = "useCoverAsFolderIconCb"; + this.useCoverAsFolderIconCb.Size = new System.Drawing.Size(180, 19); + this.useCoverAsFolderIconCb.TabIndex = 22; + this.useCoverAsFolderIconCb.Text = "[UseCoverAsFolderIcon desc]"; + this.useCoverAsFolderIconCb.UseVisualStyleBackColor = true; + // + // inProgressFilesGb + // + this.inProgressFilesGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.inProgressFilesGb.Controls.Add(this.inProgressDescLbl); - this.inProgressFilesGb.Controls.Add(this.inProgressSelectControl); - this.inProgressFilesGb.Location = new System.Drawing.Point(6, 281); - this.inProgressFilesGb.Name = "inProgressFilesGb"; - this.inProgressFilesGb.Size = new System.Drawing.Size(841, 128); - this.inProgressFilesGb.TabIndex = 21; - this.inProgressFilesGb.TabStop = false; - this.inProgressFilesGb.Text = "In progress files"; - // - // customFileNamingGb - // - this.customFileNamingGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.inProgressFilesGb.Controls.Add(this.inProgressDescLbl); + this.inProgressFilesGb.Controls.Add(this.inProgressSelectControl); + this.inProgressFilesGb.Location = new System.Drawing.Point(6, 281); + this.inProgressFilesGb.Name = "inProgressFilesGb"; + this.inProgressFilesGb.Size = new System.Drawing.Size(841, 128); + this.inProgressFilesGb.TabIndex = 21; + this.inProgressFilesGb.TabStop = false; + this.inProgressFilesGb.Text = "In progress files"; + // + // customFileNamingGb + // + this.customFileNamingGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.customFileNamingGb.Controls.Add(this.editCharreplacementBtn); - this.customFileNamingGb.Controls.Add(this.chapterFileTemplateBtn); - this.customFileNamingGb.Controls.Add(this.chapterFileTemplateTb); - this.customFileNamingGb.Controls.Add(this.chapterFileTemplateLbl); - this.customFileNamingGb.Controls.Add(this.fileTemplateBtn); - this.customFileNamingGb.Controls.Add(this.fileTemplateTb); - this.customFileNamingGb.Controls.Add(this.fileTemplateLbl); - this.customFileNamingGb.Controls.Add(this.folderTemplateBtn); - this.customFileNamingGb.Controls.Add(this.folderTemplateTb); - this.customFileNamingGb.Controls.Add(this.folderTemplateLbl); - this.customFileNamingGb.Location = new System.Drawing.Point(7, 88); - this.customFileNamingGb.Name = "customFileNamingGb"; - this.customFileNamingGb.Size = new System.Drawing.Size(841, 187); - this.customFileNamingGb.TabIndex = 20; - this.customFileNamingGb.TabStop = false; - this.customFileNamingGb.Text = "Custom file naming"; - // - // editCharreplacementBtn - // - this.editCharreplacementBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.editCharreplacementBtn.Location = new System.Drawing.Point(5, 158); - this.editCharreplacementBtn.Name = "editCharreplacementBtn"; - this.editCharreplacementBtn.Size = new System.Drawing.Size(387, 23); - this.editCharreplacementBtn.TabIndex = 8; - this.editCharreplacementBtn.Text = "[edit char replacement desc]"; - this.editCharreplacementBtn.UseVisualStyleBackColor = true; - this.editCharreplacementBtn.Click += new System.EventHandler(this.editCharreplacementBtn_Click); - // - // chapterFileTemplateBtn - // - this.chapterFileTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.chapterFileTemplateBtn.Location = new System.Drawing.Point(761, 124); - this.chapterFileTemplateBtn.Name = "chapterFileTemplateBtn"; - this.chapterFileTemplateBtn.Size = new System.Drawing.Size(75, 23); - this.chapterFileTemplateBtn.TabIndex = 8; - this.chapterFileTemplateBtn.Text = "Edit..."; - this.chapterFileTemplateBtn.UseVisualStyleBackColor = true; - this.chapterFileTemplateBtn.Click += new System.EventHandler(this.chapterFileTemplateBtn_Click); - // - // chapterFileTemplateTb - // - this.chapterFileTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.customFileNamingGb.Controls.Add(this.editCharreplacementBtn); + this.customFileNamingGb.Controls.Add(this.chapterFileTemplateBtn); + this.customFileNamingGb.Controls.Add(this.chapterFileTemplateTb); + this.customFileNamingGb.Controls.Add(this.chapterFileTemplateLbl); + this.customFileNamingGb.Controls.Add(this.fileTemplateBtn); + this.customFileNamingGb.Controls.Add(this.fileTemplateTb); + this.customFileNamingGb.Controls.Add(this.fileTemplateLbl); + this.customFileNamingGb.Controls.Add(this.folderTemplateBtn); + this.customFileNamingGb.Controls.Add(this.folderTemplateTb); + this.customFileNamingGb.Controls.Add(this.folderTemplateLbl); + this.customFileNamingGb.Location = new System.Drawing.Point(7, 88); + this.customFileNamingGb.Name = "customFileNamingGb"; + this.customFileNamingGb.Size = new System.Drawing.Size(841, 187); + this.customFileNamingGb.TabIndex = 20; + this.customFileNamingGb.TabStop = false; + this.customFileNamingGb.Text = "Custom file naming"; + // + // editCharreplacementBtn + // + this.editCharreplacementBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.editCharreplacementBtn.Location = new System.Drawing.Point(5, 158); + this.editCharreplacementBtn.Name = "editCharreplacementBtn"; + this.editCharreplacementBtn.Size = new System.Drawing.Size(387, 23); + this.editCharreplacementBtn.TabIndex = 8; + this.editCharreplacementBtn.Text = "[edit char replacement desc]"; + this.editCharreplacementBtn.UseVisualStyleBackColor = true; + this.editCharreplacementBtn.Click += new System.EventHandler(this.editCharreplacementBtn_Click); + // + // chapterFileTemplateBtn + // + this.chapterFileTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.chapterFileTemplateBtn.Location = new System.Drawing.Point(761, 124); + this.chapterFileTemplateBtn.Name = "chapterFileTemplateBtn"; + this.chapterFileTemplateBtn.Size = new System.Drawing.Size(75, 23); + this.chapterFileTemplateBtn.TabIndex = 8; + this.chapterFileTemplateBtn.Text = "Edit..."; + this.chapterFileTemplateBtn.UseVisualStyleBackColor = true; + this.chapterFileTemplateBtn.Click += new System.EventHandler(this.chapterFileTemplateBtn_Click); + // + // chapterFileTemplateTb + // + this.chapterFileTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.chapterFileTemplateTb.Location = new System.Drawing.Point(6, 125); - this.chapterFileTemplateTb.Name = "chapterFileTemplateTb"; - this.chapterFileTemplateTb.ReadOnly = true; - this.chapterFileTemplateTb.Size = new System.Drawing.Size(749, 23); - this.chapterFileTemplateTb.TabIndex = 7; - // - // chapterFileTemplateLbl - // - this.chapterFileTemplateLbl.AutoSize = true; - this.chapterFileTemplateLbl.Location = new System.Drawing.Point(6, 107); - this.chapterFileTemplateLbl.Name = "chapterFileTemplateLbl"; - this.chapterFileTemplateLbl.Size = new System.Drawing.Size(132, 15); - this.chapterFileTemplateLbl.TabIndex = 6; - this.chapterFileTemplateLbl.Text = "[chapter template desc]"; - // - // fileTemplateBtn - // - this.fileTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.fileTemplateBtn.Location = new System.Drawing.Point(761, 80); - this.fileTemplateBtn.Name = "fileTemplateBtn"; - this.fileTemplateBtn.Size = new System.Drawing.Size(75, 23); - this.fileTemplateBtn.TabIndex = 5; - this.fileTemplateBtn.Text = "Edit..."; - this.fileTemplateBtn.UseVisualStyleBackColor = true; - this.fileTemplateBtn.Click += new System.EventHandler(this.fileTemplateBtn_Click); - // - // fileTemplateTb - // - this.fileTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.chapterFileTemplateTb.Location = new System.Drawing.Point(6, 125); + this.chapterFileTemplateTb.Name = "chapterFileTemplateTb"; + this.chapterFileTemplateTb.ReadOnly = true; + this.chapterFileTemplateTb.Size = new System.Drawing.Size(749, 23); + this.chapterFileTemplateTb.TabIndex = 7; + // + // chapterFileTemplateLbl + // + this.chapterFileTemplateLbl.AutoSize = true; + this.chapterFileTemplateLbl.Location = new System.Drawing.Point(6, 107); + this.chapterFileTemplateLbl.Name = "chapterFileTemplateLbl"; + this.chapterFileTemplateLbl.Size = new System.Drawing.Size(132, 15); + this.chapterFileTemplateLbl.TabIndex = 6; + this.chapterFileTemplateLbl.Text = "[chapter template desc]"; + // + // fileTemplateBtn + // + this.fileTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.fileTemplateBtn.Location = new System.Drawing.Point(761, 80); + this.fileTemplateBtn.Name = "fileTemplateBtn"; + this.fileTemplateBtn.Size = new System.Drawing.Size(75, 23); + this.fileTemplateBtn.TabIndex = 5; + this.fileTemplateBtn.Text = "Edit..."; + this.fileTemplateBtn.UseVisualStyleBackColor = true; + this.fileTemplateBtn.Click += new System.EventHandler(this.fileTemplateBtn_Click); + // + // fileTemplateTb + // + this.fileTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.fileTemplateTb.Location = new System.Drawing.Point(6, 81); - this.fileTemplateTb.Name = "fileTemplateTb"; - this.fileTemplateTb.ReadOnly = true; - this.fileTemplateTb.Size = new System.Drawing.Size(749, 23); - this.fileTemplateTb.TabIndex = 4; - // - // fileTemplateLbl - // - this.fileTemplateLbl.AutoSize = true; - this.fileTemplateLbl.Location = new System.Drawing.Point(6, 63); - this.fileTemplateLbl.Name = "fileTemplateLbl"; - this.fileTemplateLbl.Size = new System.Drawing.Size(108, 15); - this.fileTemplateLbl.TabIndex = 3; - this.fileTemplateLbl.Text = "[file template desc]"; - // - // folderTemplateBtn - // - this.folderTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.folderTemplateBtn.Location = new System.Drawing.Point(760, 36); - this.folderTemplateBtn.Name = "folderTemplateBtn"; - this.folderTemplateBtn.Size = new System.Drawing.Size(75, 23); - this.folderTemplateBtn.TabIndex = 2; - this.folderTemplateBtn.Text = "Edit..."; - this.folderTemplateBtn.UseVisualStyleBackColor = true; - this.folderTemplateBtn.Click += new System.EventHandler(this.folderTemplateBtn_Click); - // - // folderTemplateTb - // - this.folderTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.fileTemplateTb.Location = new System.Drawing.Point(6, 81); + this.fileTemplateTb.Name = "fileTemplateTb"; + this.fileTemplateTb.ReadOnly = true; + this.fileTemplateTb.Size = new System.Drawing.Size(749, 23); + this.fileTemplateTb.TabIndex = 4; + // + // fileTemplateLbl + // + this.fileTemplateLbl.AutoSize = true; + this.fileTemplateLbl.Location = new System.Drawing.Point(6, 63); + this.fileTemplateLbl.Name = "fileTemplateLbl"; + this.fileTemplateLbl.Size = new System.Drawing.Size(108, 15); + this.fileTemplateLbl.TabIndex = 3; + this.fileTemplateLbl.Text = "[file template desc]"; + // + // folderTemplateBtn + // + this.folderTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.folderTemplateBtn.Location = new System.Drawing.Point(760, 36); + this.folderTemplateBtn.Name = "folderTemplateBtn"; + this.folderTemplateBtn.Size = new System.Drawing.Size(75, 23); + this.folderTemplateBtn.TabIndex = 2; + this.folderTemplateBtn.Text = "Edit..."; + this.folderTemplateBtn.UseVisualStyleBackColor = true; + this.folderTemplateBtn.Click += new System.EventHandler(this.folderTemplateBtn_Click); + // + // folderTemplateTb + // + this.folderTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.folderTemplateTb.Location = new System.Drawing.Point(5, 37); - this.folderTemplateTb.Name = "folderTemplateTb"; - this.folderTemplateTb.ReadOnly = true; - this.folderTemplateTb.Size = new System.Drawing.Size(749, 23); - this.folderTemplateTb.TabIndex = 1; - // - // folderTemplateLbl - // - this.folderTemplateLbl.AutoSize = true; - this.folderTemplateLbl.Location = new System.Drawing.Point(5, 19); - this.folderTemplateLbl.Name = "folderTemplateLbl"; - this.folderTemplateLbl.Size = new System.Drawing.Size(123, 15); - this.folderTemplateLbl.TabIndex = 0; - this.folderTemplateLbl.Text = "[folder template desc]"; - // - // tab4AudioFileOptions - // - this.tab4AudioFileOptions.Controls.Add(this.audiobookFixupsGb); - this.tab4AudioFileOptions.Controls.Add(this.chapterTitleTemplateGb); - this.tab4AudioFileOptions.Controls.Add(this.lameOptionsGb); - this.tab4AudioFileOptions.Controls.Add(this.mergeOpeningEndCreditsCbox); - this.tab4AudioFileOptions.Controls.Add(this.retainAaxFileCbox); - this.tab4AudioFileOptions.Controls.Add(this.downloadCoverArtCbox); - this.tab4AudioFileOptions.Controls.Add(this.createCueSheetCbox); - this.tab4AudioFileOptions.Controls.Add(this.allowLibationFixupCbox); - this.tab4AudioFileOptions.Location = new System.Drawing.Point(4, 24); - this.tab4AudioFileOptions.Name = "tab4AudioFileOptions"; - this.tab4AudioFileOptions.Padding = new System.Windows.Forms.Padding(3); - this.tab4AudioFileOptions.Size = new System.Drawing.Size(854, 415); - this.tab4AudioFileOptions.TabIndex = 3; - this.tab4AudioFileOptions.Text = "Audio File Options"; - this.tab4AudioFileOptions.UseVisualStyleBackColor = true; - // - // audiobookFixupsGb - // - this.audiobookFixupsGb.Controls.Add(this.splitFilesByChapterCbox); - this.audiobookFixupsGb.Controls.Add(this.stripUnabridgedCbox); - this.audiobookFixupsGb.Controls.Add(this.convertLosslessRb); - this.audiobookFixupsGb.Controls.Add(this.convertLossyRb); - this.audiobookFixupsGb.Controls.Add(this.stripAudibleBrandingCbox); - this.audiobookFixupsGb.Location = new System.Drawing.Point(6, 143); - this.audiobookFixupsGb.Name = "audiobookFixupsGb"; - this.audiobookFixupsGb.Size = new System.Drawing.Size(403, 160); - this.audiobookFixupsGb.TabIndex = 19; - this.audiobookFixupsGb.TabStop = false; - this.audiobookFixupsGb.Text = "Audiobook Fix-ups"; - // - // stripUnabridgedCbox - // - this.stripUnabridgedCbox.AutoSize = true; - this.stripUnabridgedCbox.Location = new System.Drawing.Point(13, 47); - this.stripUnabridgedCbox.Name = "stripUnabridgedCbox"; - this.stripUnabridgedCbox.Size = new System.Drawing.Size(147, 19); - this.stripUnabridgedCbox.TabIndex = 13; - this.stripUnabridgedCbox.Text = "[StripUnabridged desc]"; - this.stripUnabridgedCbox.UseVisualStyleBackColor = true; - // - // chapterTitleTemplateGb - // - this.chapterTitleTemplateGb.Controls.Add(this.chapterTitleTemplateBtn); - this.chapterTitleTemplateGb.Controls.Add(this.chapterTitleTemplateTb); - this.chapterTitleTemplateGb.Location = new System.Drawing.Point(6, 335); - this.chapterTitleTemplateGb.Name = "chapterTitleTemplateGb"; - this.chapterTitleTemplateGb.Size = new System.Drawing.Size(842, 54); - this.chapterTitleTemplateGb.TabIndex = 18; - this.chapterTitleTemplateGb.TabStop = false; - this.chapterTitleTemplateGb.Text = "[chapter title template desc]"; - // - // chapterTitleTemplateBtn - // - this.chapterTitleTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.chapterTitleTemplateBtn.Location = new System.Drawing.Point(764, 22); - this.chapterTitleTemplateBtn.Name = "chapterTitleTemplateBtn"; - this.chapterTitleTemplateBtn.Size = new System.Drawing.Size(75, 23); - this.chapterTitleTemplateBtn.TabIndex = 17; - this.chapterTitleTemplateBtn.Text = "Edit..."; - this.chapterTitleTemplateBtn.UseVisualStyleBackColor = true; - this.chapterTitleTemplateBtn.Click += new System.EventHandler(this.chapterTitleTemplateBtn_Click); - // - // chapterTitleTemplateTb - // - this.chapterTitleTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.folderTemplateTb.Location = new System.Drawing.Point(5, 37); + this.folderTemplateTb.Name = "folderTemplateTb"; + this.folderTemplateTb.ReadOnly = true; + this.folderTemplateTb.Size = new System.Drawing.Size(749, 23); + this.folderTemplateTb.TabIndex = 1; + // + // folderTemplateLbl + // + this.folderTemplateLbl.AutoSize = true; + this.folderTemplateLbl.Location = new System.Drawing.Point(5, 19); + this.folderTemplateLbl.Name = "folderTemplateLbl"; + this.folderTemplateLbl.Size = new System.Drawing.Size(123, 15); + this.folderTemplateLbl.TabIndex = 0; + this.folderTemplateLbl.Text = "[folder template desc]"; + // + // tab4AudioFileOptions + // + this.tab4AudioFileOptions.Controls.Add(this.audiobookFixupsGb); + this.tab4AudioFileOptions.Controls.Add(this.chapterTitleTemplateGb); + this.tab4AudioFileOptions.Controls.Add(this.lameOptionsGb); + this.tab4AudioFileOptions.Controls.Add(this.mergeOpeningEndCreditsCbox); + this.tab4AudioFileOptions.Controls.Add(this.retainAaxFileCbox); + this.tab4AudioFileOptions.Controls.Add(this.downloadCoverArtCbox); + this.tab4AudioFileOptions.Controls.Add(this.createCueSheetCbox); + this.tab4AudioFileOptions.Controls.Add(this.allowLibationFixupCbox); + this.tab4AudioFileOptions.Location = new System.Drawing.Point(4, 24); + this.tab4AudioFileOptions.Name = "tab4AudioFileOptions"; + this.tab4AudioFileOptions.Padding = new System.Windows.Forms.Padding(3); + this.tab4AudioFileOptions.Size = new System.Drawing.Size(854, 445); + this.tab4AudioFileOptions.TabIndex = 3; + this.tab4AudioFileOptions.Text = "Audio File Options"; + this.tab4AudioFileOptions.UseVisualStyleBackColor = true; + // + // audiobookFixupsGb + // + this.audiobookFixupsGb.Controls.Add(this.splitFilesByChapterCbox); + this.audiobookFixupsGb.Controls.Add(this.stripUnabridgedCbox); + this.audiobookFixupsGb.Controls.Add(this.convertLosslessRb); + this.audiobookFixupsGb.Controls.Add(this.convertLossyRb); + this.audiobookFixupsGb.Controls.Add(this.stripAudibleBrandingCbox); + this.audiobookFixupsGb.Location = new System.Drawing.Point(6, 143); + this.audiobookFixupsGb.Name = "audiobookFixupsGb"; + this.audiobookFixupsGb.Size = new System.Drawing.Size(403, 160); + this.audiobookFixupsGb.TabIndex = 19; + this.audiobookFixupsGb.TabStop = false; + this.audiobookFixupsGb.Text = "Audiobook Fix-ups"; + // + // stripUnabridgedCbox + // + this.stripUnabridgedCbox.AutoSize = true; + this.stripUnabridgedCbox.Location = new System.Drawing.Point(13, 47); + this.stripUnabridgedCbox.Name = "stripUnabridgedCbox"; + this.stripUnabridgedCbox.Size = new System.Drawing.Size(147, 19); + this.stripUnabridgedCbox.TabIndex = 13; + this.stripUnabridgedCbox.Text = "[StripUnabridged desc]"; + this.stripUnabridgedCbox.UseVisualStyleBackColor = true; + // + // chapterTitleTemplateGb + // + this.chapterTitleTemplateGb.Controls.Add(this.chapterTitleTemplateBtn); + this.chapterTitleTemplateGb.Controls.Add(this.chapterTitleTemplateTb); + this.chapterTitleTemplateGb.Location = new System.Drawing.Point(6, 335); + this.chapterTitleTemplateGb.Name = "chapterTitleTemplateGb"; + this.chapterTitleTemplateGb.Size = new System.Drawing.Size(842, 54); + this.chapterTitleTemplateGb.TabIndex = 18; + this.chapterTitleTemplateGb.TabStop = false; + this.chapterTitleTemplateGb.Text = "[chapter title template desc]"; + // + // chapterTitleTemplateBtn + // + this.chapterTitleTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.chapterTitleTemplateBtn.Location = new System.Drawing.Point(764, 22); + this.chapterTitleTemplateBtn.Name = "chapterTitleTemplateBtn"; + this.chapterTitleTemplateBtn.Size = new System.Drawing.Size(75, 23); + this.chapterTitleTemplateBtn.TabIndex = 17; + this.chapterTitleTemplateBtn.Text = "Edit..."; + this.chapterTitleTemplateBtn.UseVisualStyleBackColor = true; + this.chapterTitleTemplateBtn.Click += new System.EventHandler(this.chapterTitleTemplateBtn_Click); + // + // chapterTitleTemplateTb + // + this.chapterTitleTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.chapterTitleTemplateTb.Location = new System.Drawing.Point(6, 22); - this.chapterTitleTemplateTb.Name = "chapterTitleTemplateTb"; - this.chapterTitleTemplateTb.ReadOnly = true; - this.chapterTitleTemplateTb.Size = new System.Drawing.Size(752, 23); - this.chapterTitleTemplateTb.TabIndex = 16; - // - // lameOptionsGb - // - this.lameOptionsGb.Controls.Add(this.lameDownsampleMonoCbox); - this.lameOptionsGb.Controls.Add(this.lameBitrateGb); - this.lameOptionsGb.Controls.Add(this.label1); - this.lameOptionsGb.Controls.Add(this.lameQualityGb); - this.lameOptionsGb.Controls.Add(this.groupBox2); - this.lameOptionsGb.Location = new System.Drawing.Point(415, 6); - this.lameOptionsGb.Name = "lameOptionsGb"; - this.lameOptionsGb.Size = new System.Drawing.Size(433, 323); - this.lameOptionsGb.TabIndex = 14; - this.lameOptionsGb.TabStop = false; - this.lameOptionsGb.Text = "Mp3 Encoding Options"; - // - // lameDownsampleMonoCbox - // - this.lameDownsampleMonoCbox.AutoSize = true; - this.lameDownsampleMonoCbox.Location = new System.Drawing.Point(234, 35); - this.lameDownsampleMonoCbox.Name = "lameDownsampleMonoCbox"; - this.lameDownsampleMonoCbox.Size = new System.Drawing.Size(184, 34); - this.lameDownsampleMonoCbox.TabIndex = 1; - this.lameDownsampleMonoCbox.Text = "Downsample stereo to mono?\r\n(Recommended)\r\n"; - this.lameDownsampleMonoCbox.UseVisualStyleBackColor = true; - // - // lameBitrateGb - // - this.lameBitrateGb.Controls.Add(this.LameMatchSourceBRCbox); - this.lameBitrateGb.Controls.Add(this.lameConstantBitrateCbox); - this.lameBitrateGb.Controls.Add(this.label7); - this.lameBitrateGb.Controls.Add(this.label6); - this.lameBitrateGb.Controls.Add(this.label5); - this.lameBitrateGb.Controls.Add(this.label4); - this.lameBitrateGb.Controls.Add(this.label11); - this.lameBitrateGb.Controls.Add(this.label3); - this.lameBitrateGb.Controls.Add(this.lameBitrateTb); - this.lameBitrateGb.Location = new System.Drawing.Point(6, 84); - this.lameBitrateGb.Name = "lameBitrateGb"; - this.lameBitrateGb.Size = new System.Drawing.Size(421, 101); - this.lameBitrateGb.TabIndex = 0; - this.lameBitrateGb.TabStop = false; - this.lameBitrateGb.Text = "Bitrate"; - // - // LameMatchSourceBRCbox - // - this.LameMatchSourceBRCbox.AutoSize = true; - this.LameMatchSourceBRCbox.Location = new System.Drawing.Point(260, 77); - this.LameMatchSourceBRCbox.Name = "LameMatchSourceBRCbox"; - this.LameMatchSourceBRCbox.Size = new System.Drawing.Size(140, 19); - this.LameMatchSourceBRCbox.TabIndex = 3; - this.LameMatchSourceBRCbox.Text = "Match source bitrate?"; - this.LameMatchSourceBRCbox.UseVisualStyleBackColor = true; - this.LameMatchSourceBRCbox.CheckedChanged += new System.EventHandler(this.LameMatchSourceBRCbox_CheckedChanged); - // - // lameConstantBitrateCbox - // - this.lameConstantBitrateCbox.AutoSize = true; - this.lameConstantBitrateCbox.Location = new System.Drawing.Point(6, 77); - this.lameConstantBitrateCbox.Name = "lameConstantBitrateCbox"; - this.lameConstantBitrateCbox.Size = new System.Drawing.Size(216, 19); - this.lameConstantBitrateCbox.TabIndex = 2; - this.lameConstantBitrateCbox.Text = "Restrict encoder to constant bitrate?"; - this.lameConstantBitrateCbox.UseVisualStyleBackColor = true; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.label7.Location = new System.Drawing.Point(390, 52); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(25, 15); - this.label7.TabIndex = 1; - this.label7.Text = "320"; - // - // label6 - // - this.label6.AutoSize = true; - this.label6.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.label6.Location = new System.Drawing.Point(309, 52); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(25, 15); - this.label6.TabIndex = 1; - this.label6.Text = "256"; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.label5.Location = new System.Drawing.Point(228, 52); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(25, 15); - this.label5.TabIndex = 1; - this.label5.Text = "192"; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.label4.Location = new System.Drawing.Point(147, 52); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(25, 15); - this.label4.TabIndex = 1; - this.label4.Text = "128"; - // - // label11 - // - this.label11.AutoSize = true; - this.label11.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.label11.Location = new System.Drawing.Point(10, 52); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(19, 15); - this.label11.TabIndex = 1; - this.label11.Text = "16"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.label3.Location = new System.Drawing.Point(71, 52); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(19, 15); - this.label3.TabIndex = 1; - this.label3.Text = "64"; - // - // lameBitrateTb - // - this.lameBitrateTb.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.lameBitrateTb.LargeChange = 32; - this.lameBitrateTb.Location = new System.Drawing.Point(6, 22); - this.lameBitrateTb.Maximum = 320; - this.lameBitrateTb.Minimum = 16; - this.lameBitrateTb.Name = "lameBitrateTb"; - this.lameBitrateTb.Size = new System.Drawing.Size(409, 45); - this.lameBitrateTb.SmallChange = 8; - this.lameBitrateTb.TabIndex = 0; - this.lameBitrateTb.TickFrequency = 16; - this.lameBitrateTb.Value = 64; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Enabled = false; - this.label1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point); - this.label1.Location = new System.Drawing.Point(6, 298); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(172, 15); - this.label1.TabIndex = 1; - this.label1.Text = "Using L.A.M.E. encoding engine"; - // - // lameQualityGb - // - this.lameQualityGb.Controls.Add(this.label19); - this.lameQualityGb.Controls.Add(this.label18); - this.lameQualityGb.Controls.Add(this.label17); - this.lameQualityGb.Controls.Add(this.label16); - this.lameQualityGb.Controls.Add(this.label12); - this.lameQualityGb.Controls.Add(this.label15); - this.lameQualityGb.Controls.Add(this.label9); - this.lameQualityGb.Controls.Add(this.label8); - this.lameQualityGb.Controls.Add(this.label13); - this.lameQualityGb.Controls.Add(this.label10); - this.lameQualityGb.Controls.Add(this.label14); - this.lameQualityGb.Controls.Add(this.label2); - this.lameQualityGb.Controls.Add(this.lameVBRQualityTb); - this.lameQualityGb.Location = new System.Drawing.Point(6, 186); - this.lameQualityGb.Name = "lameQualityGb"; - this.lameQualityGb.Size = new System.Drawing.Size(421, 109); - this.lameQualityGb.TabIndex = 0; - this.lameQualityGb.TabStop = false; - this.lameQualityGb.Text = "Quality"; - // - // label19 - // - this.label19.AutoSize = true; - this.label19.Location = new System.Drawing.Point(349, 52); - this.label19.Name = "label19"; - this.label19.Size = new System.Drawing.Size(20, 15); - this.label19.TabIndex = 1; - this.label19.Text = "V8"; - // - // label18 - // - this.label18.AutoSize = true; - this.label18.Location = new System.Drawing.Point(307, 52); - this.label18.Name = "label18"; - this.label18.Size = new System.Drawing.Size(20, 15); - this.label18.TabIndex = 1; - this.label18.Text = "V7"; - // - // label17 - // - this.label17.AutoSize = true; - this.label17.Location = new System.Drawing.Point(265, 52); - this.label17.Name = "label17"; - this.label17.Size = new System.Drawing.Size(20, 15); - this.label17.TabIndex = 1; - this.label17.Text = "V6"; - // - // label16 - // - this.label16.AutoSize = true; - this.label16.Location = new System.Drawing.Point(223, 52); - this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(20, 15); - this.label16.TabIndex = 1; - this.label16.Text = "V5"; - // - // label12 - // - this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(182, 52); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(20, 15); - this.label12.TabIndex = 1; - this.label12.Text = "V4"; - // - // label15 - // - this.label15.AutoSize = true; - this.label15.Location = new System.Drawing.Point(140, 52); - this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(20, 15); - this.label15.TabIndex = 1; - this.label15.Text = "V3"; - // - // label9 - // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(97, 52); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(20, 15); - this.label9.TabIndex = 1; - this.label9.Text = "V2"; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(391, 52); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(20, 15); - this.label8.TabIndex = 1; - this.label8.Text = "V9"; - // - // label13 - // - this.label13.AutoSize = true; - this.label13.Location = new System.Drawing.Point(376, 81); - this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(39, 15); - this.label13.TabIndex = 1; - this.label13.Text = "Lower"; - // - // label10 - // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(6, 81); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(43, 15); - this.label10.TabIndex = 1; - this.label10.Text = "Higher"; - // - // label14 - // - this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(56, 52); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(20, 15); - this.label14.TabIndex = 1; - this.label14.Text = "V1"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(14, 52); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(20, 15); - this.label2.TabIndex = 1; - this.label2.Text = "V0"; - // - // lameVBRQualityTb - // - this.lameVBRQualityTb.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.lameVBRQualityTb.LargeChange = 1; - this.lameVBRQualityTb.Location = new System.Drawing.Point(10, 22); - this.lameVBRQualityTb.Maximum = 9; - this.lameVBRQualityTb.Name = "lameVBRQualityTb"; - this.lameVBRQualityTb.Size = new System.Drawing.Size(405, 45); - this.lameVBRQualityTb.TabIndex = 0; - this.lameVBRQualityTb.Value = 9; - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.lameTargetQualityRb); - this.groupBox2.Controls.Add(this.lameTargetBitrateRb); - this.groupBox2.Location = new System.Drawing.Point(6, 22); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(222, 56); - this.groupBox2.TabIndex = 0; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Target"; - // - // lameTargetQualityRb - // - this.lameTargetQualityRb.AutoSize = true; - this.lameTargetQualityRb.Location = new System.Drawing.Point(138, 23); - this.lameTargetQualityRb.Name = "lameTargetQualityRb"; - this.lameTargetQualityRb.Size = new System.Drawing.Size(63, 19); - this.lameTargetQualityRb.TabIndex = 0; - this.lameTargetQualityRb.TabStop = true; - this.lameTargetQualityRb.Text = "Quality"; - this.lameTargetQualityRb.UseVisualStyleBackColor = true; - this.lameTargetQualityRb.CheckedChanged += new System.EventHandler(this.lameTargetRb_CheckedChanged); - // - // lameTargetBitrateRb - // - this.lameTargetBitrateRb.AutoSize = true; - this.lameTargetBitrateRb.Location = new System.Drawing.Point(6, 23); - this.lameTargetBitrateRb.Name = "lameTargetBitrateRb"; - this.lameTargetBitrateRb.Size = new System.Drawing.Size(59, 19); - this.lameTargetBitrateRb.TabIndex = 0; - this.lameTargetBitrateRb.TabStop = true; - this.lameTargetBitrateRb.Text = "Bitrate"; - this.lameTargetBitrateRb.UseVisualStyleBackColor = true; - this.lameTargetBitrateRb.CheckedChanged += new System.EventHandler(this.lameTargetRb_CheckedChanged); - // - // mergeOpeningEndCreditsCbox - // - this.mergeOpeningEndCreditsCbox.AutoSize = true; - this.mergeOpeningEndCreditsCbox.Location = new System.Drawing.Point(19, 93); - this.mergeOpeningEndCreditsCbox.Name = "mergeOpeningEndCreditsCbox"; - this.mergeOpeningEndCreditsCbox.Size = new System.Drawing.Size(198, 19); - this.mergeOpeningEndCreditsCbox.TabIndex = 13; - this.mergeOpeningEndCreditsCbox.Text = "[MergeOpeningEndCredits desc]"; - this.mergeOpeningEndCreditsCbox.UseVisualStyleBackColor = true; - // - // retainAaxFileCbox - // - this.retainAaxFileCbox.AutoSize = true; - this.retainAaxFileCbox.Location = new System.Drawing.Point(19, 68); - this.retainAaxFileCbox.Name = "retainAaxFileCbox"; - this.retainAaxFileCbox.Size = new System.Drawing.Size(132, 19); - this.retainAaxFileCbox.TabIndex = 10; - this.retainAaxFileCbox.Text = "[RetainAaxFile desc]"; - this.retainAaxFileCbox.UseVisualStyleBackColor = true; - this.retainAaxFileCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); - // - // downloadCoverArtCbox - // - this.downloadCoverArtCbox.AutoSize = true; - this.downloadCoverArtCbox.Checked = true; - this.downloadCoverArtCbox.CheckState = System.Windows.Forms.CheckState.Checked; - this.downloadCoverArtCbox.Location = new System.Drawing.Point(19, 43); - this.downloadCoverArtCbox.Name = "downloadCoverArtCbox"; - this.downloadCoverArtCbox.Size = new System.Drawing.Size(162, 19); - this.downloadCoverArtCbox.TabIndex = 10; - this.downloadCoverArtCbox.Text = "[DownloadCoverArt desc]"; - this.downloadCoverArtCbox.UseVisualStyleBackColor = true; - this.downloadCoverArtCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); - // - // createCueSheetCbox - // - this.createCueSheetCbox.AutoSize = true; - this.createCueSheetCbox.Checked = true; - this.createCueSheetCbox.CheckState = System.Windows.Forms.CheckState.Checked; - this.createCueSheetCbox.Location = new System.Drawing.Point(19, 18); - this.createCueSheetCbox.Name = "createCueSheetCbox"; - this.createCueSheetCbox.Size = new System.Drawing.Size(145, 19); - this.createCueSheetCbox.TabIndex = 10; - this.createCueSheetCbox.Text = "[CreateCueSheet desc]"; - this.createCueSheetCbox.UseVisualStyleBackColor = true; - this.createCueSheetCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); - // - // betaOptInCbox - // - this.betaOptInCbox.AutoSize = true; - this.betaOptInCbox.Enabled = false; - this.betaOptInCbox.Location = new System.Drawing.Point(13, 358); - this.betaOptInCbox.Name = "betaOptInCbox"; - this.betaOptInCbox.Size = new System.Drawing.Size(107, 19); - this.betaOptInCbox.TabIndex = 6; - this.betaOptInCbox.Text = "[Opt in to Beta]"; - this.betaOptInCbox.UseVisualStyleBackColor = true; - // - // SettingsDialog - // - this.AcceptButton = this.saveBtn; - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.cancelBtn; - this.ClientSize = new System.Drawing.Size(886, 504); - this.Controls.Add(this.tabControl); - this.Controls.Add(this.cancelBtn); - this.Controls.Add(this.saveBtn); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "SettingsDialog"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Edit Settings"; - this.Load += new System.EventHandler(this.SettingsDialog_Load); - this.badBookGb.ResumeLayout(false); - this.badBookGb.PerformLayout(); - this.tabControl.ResumeLayout(false); - this.tab1ImportantSettings.ResumeLayout(false); - this.tab1ImportantSettings.PerformLayout(); - this.booksGb.ResumeLayout(false); - this.booksGb.PerformLayout(); - this.tab2ImportLibrary.ResumeLayout(false); - this.tab2ImportLibrary.PerformLayout(); - this.tab3DownloadDecrypt.ResumeLayout(false); - this.inProgressFilesGb.ResumeLayout(false); - this.inProgressFilesGb.PerformLayout(); - this.customFileNamingGb.ResumeLayout(false); - this.customFileNamingGb.PerformLayout(); - this.tab4AudioFileOptions.ResumeLayout(false); - this.tab4AudioFileOptions.PerformLayout(); - this.audiobookFixupsGb.ResumeLayout(false); - this.audiobookFixupsGb.PerformLayout(); - this.chapterTitleTemplateGb.ResumeLayout(false); - this.chapterTitleTemplateGb.PerformLayout(); - this.lameOptionsGb.ResumeLayout(false); - this.lameOptionsGb.PerformLayout(); - this.lameBitrateGb.ResumeLayout(false); - this.lameBitrateGb.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.lameBitrateTb)).EndInit(); - this.lameQualityGb.ResumeLayout(false); - this.lameQualityGb.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.lameVBRQualityTb)).EndInit(); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); - this.ResumeLayout(false); + this.chapterTitleTemplateTb.Location = new System.Drawing.Point(6, 22); + this.chapterTitleTemplateTb.Name = "chapterTitleTemplateTb"; + this.chapterTitleTemplateTb.ReadOnly = true; + this.chapterTitleTemplateTb.Size = new System.Drawing.Size(752, 23); + this.chapterTitleTemplateTb.TabIndex = 16; + // + // lameOptionsGb + // + this.lameOptionsGb.Controls.Add(this.lameDownsampleMonoCbox); + this.lameOptionsGb.Controls.Add(this.lameBitrateGb); + this.lameOptionsGb.Controls.Add(this.label1); + this.lameOptionsGb.Controls.Add(this.lameQualityGb); + this.lameOptionsGb.Controls.Add(this.groupBox2); + this.lameOptionsGb.Location = new System.Drawing.Point(415, 6); + this.lameOptionsGb.Name = "lameOptionsGb"; + this.lameOptionsGb.Size = new System.Drawing.Size(433, 323); + this.lameOptionsGb.TabIndex = 14; + this.lameOptionsGb.TabStop = false; + this.lameOptionsGb.Text = "Mp3 Encoding Options"; + // + // lameDownsampleMonoCbox + // + this.lameDownsampleMonoCbox.AutoSize = true; + this.lameDownsampleMonoCbox.Location = new System.Drawing.Point(234, 35); + this.lameDownsampleMonoCbox.Name = "lameDownsampleMonoCbox"; + this.lameDownsampleMonoCbox.Size = new System.Drawing.Size(184, 34); + this.lameDownsampleMonoCbox.TabIndex = 1; + this.lameDownsampleMonoCbox.Text = "Downsample stereo to mono?\r\n(Recommended)\r\n"; + this.lameDownsampleMonoCbox.UseVisualStyleBackColor = true; + // + // lameBitrateGb + // + this.lameBitrateGb.Controls.Add(this.LameMatchSourceBRCbox); + this.lameBitrateGb.Controls.Add(this.lameConstantBitrateCbox); + this.lameBitrateGb.Controls.Add(this.label7); + this.lameBitrateGb.Controls.Add(this.label6); + this.lameBitrateGb.Controls.Add(this.label5); + this.lameBitrateGb.Controls.Add(this.label4); + this.lameBitrateGb.Controls.Add(this.label11); + this.lameBitrateGb.Controls.Add(this.label3); + this.lameBitrateGb.Controls.Add(this.lameBitrateTb); + this.lameBitrateGb.Location = new System.Drawing.Point(6, 84); + this.lameBitrateGb.Name = "lameBitrateGb"; + this.lameBitrateGb.Size = new System.Drawing.Size(421, 101); + this.lameBitrateGb.TabIndex = 0; + this.lameBitrateGb.TabStop = false; + this.lameBitrateGb.Text = "Bitrate"; + // + // LameMatchSourceBRCbox + // + this.LameMatchSourceBRCbox.AutoSize = true; + this.LameMatchSourceBRCbox.Location = new System.Drawing.Point(260, 77); + this.LameMatchSourceBRCbox.Name = "LameMatchSourceBRCbox"; + this.LameMatchSourceBRCbox.Size = new System.Drawing.Size(140, 19); + this.LameMatchSourceBRCbox.TabIndex = 3; + this.LameMatchSourceBRCbox.Text = "Match source bitrate?"; + this.LameMatchSourceBRCbox.UseVisualStyleBackColor = true; + this.LameMatchSourceBRCbox.CheckedChanged += new System.EventHandler(this.LameMatchSourceBRCbox_CheckedChanged); + // + // lameConstantBitrateCbox + // + this.lameConstantBitrateCbox.AutoSize = true; + this.lameConstantBitrateCbox.Location = new System.Drawing.Point(6, 77); + this.lameConstantBitrateCbox.Name = "lameConstantBitrateCbox"; + this.lameConstantBitrateCbox.Size = new System.Drawing.Size(216, 19); + this.lameConstantBitrateCbox.TabIndex = 2; + this.lameConstantBitrateCbox.Text = "Restrict encoder to constant bitrate?"; + this.lameConstantBitrateCbox.UseVisualStyleBackColor = true; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.label7.Location = new System.Drawing.Point(390, 52); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(25, 15); + this.label7.TabIndex = 1; + this.label7.Text = "320"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.label6.Location = new System.Drawing.Point(309, 52); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(25, 15); + this.label6.TabIndex = 1; + this.label6.Text = "256"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.label5.Location = new System.Drawing.Point(228, 52); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(25, 15); + this.label5.TabIndex = 1; + this.label5.Text = "192"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.label4.Location = new System.Drawing.Point(147, 52); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(25, 15); + this.label4.TabIndex = 1; + this.label4.Text = "128"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.label11.Location = new System.Drawing.Point(10, 52); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(19, 15); + this.label11.TabIndex = 1; + this.label11.Text = "16"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.label3.Location = new System.Drawing.Point(71, 52); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(19, 15); + this.label3.TabIndex = 1; + this.label3.Text = "64"; + // + // lameBitrateTb + // + this.lameBitrateTb.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.lameBitrateTb.LargeChange = 32; + this.lameBitrateTb.Location = new System.Drawing.Point(6, 22); + this.lameBitrateTb.Maximum = 320; + this.lameBitrateTb.Minimum = 16; + this.lameBitrateTb.Name = "lameBitrateTb"; + this.lameBitrateTb.Size = new System.Drawing.Size(409, 45); + this.lameBitrateTb.SmallChange = 8; + this.lameBitrateTb.TabIndex = 0; + this.lameBitrateTb.TickFrequency = 16; + this.lameBitrateTb.Value = 64; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Enabled = false; + this.label1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point); + this.label1.Location = new System.Drawing.Point(6, 298); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(172, 15); + this.label1.TabIndex = 1; + this.label1.Text = "Using L.A.M.E. encoding engine"; + // + // lameQualityGb + // + this.lameQualityGb.Controls.Add(this.label19); + this.lameQualityGb.Controls.Add(this.label18); + this.lameQualityGb.Controls.Add(this.label17); + this.lameQualityGb.Controls.Add(this.label16); + this.lameQualityGb.Controls.Add(this.label12); + this.lameQualityGb.Controls.Add(this.label15); + this.lameQualityGb.Controls.Add(this.label9); + this.lameQualityGb.Controls.Add(this.label8); + this.lameQualityGb.Controls.Add(this.label13); + this.lameQualityGb.Controls.Add(this.label10); + this.lameQualityGb.Controls.Add(this.label14); + this.lameQualityGb.Controls.Add(this.label2); + this.lameQualityGb.Controls.Add(this.lameVBRQualityTb); + this.lameQualityGb.Location = new System.Drawing.Point(6, 186); + this.lameQualityGb.Name = "lameQualityGb"; + this.lameQualityGb.Size = new System.Drawing.Size(421, 109); + this.lameQualityGb.TabIndex = 0; + this.lameQualityGb.TabStop = false; + this.lameQualityGb.Text = "Quality"; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(349, 52); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(20, 15); + this.label19.TabIndex = 1; + this.label19.Text = "V8"; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(307, 52); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(20, 15); + this.label18.TabIndex = 1; + this.label18.Text = "V7"; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(265, 52); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(20, 15); + this.label17.TabIndex = 1; + this.label17.Text = "V6"; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(223, 52); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(20, 15); + this.label16.TabIndex = 1; + this.label16.Text = "V5"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(182, 52); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(20, 15); + this.label12.TabIndex = 1; + this.label12.Text = "V4"; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(140, 52); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(20, 15); + this.label15.TabIndex = 1; + this.label15.Text = "V3"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(97, 52); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(20, 15); + this.label9.TabIndex = 1; + this.label9.Text = "V2"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(391, 52); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(20, 15); + this.label8.TabIndex = 1; + this.label8.Text = "V9"; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(376, 81); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(39, 15); + this.label13.TabIndex = 1; + this.label13.Text = "Lower"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(6, 81); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(43, 15); + this.label10.TabIndex = 1; + this.label10.Text = "Higher"; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(56, 52); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(20, 15); + this.label14.TabIndex = 1; + this.label14.Text = "V1"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(14, 52); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(20, 15); + this.label2.TabIndex = 1; + this.label2.Text = "V0"; + // + // lameVBRQualityTb + // + this.lameVBRQualityTb.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.lameVBRQualityTb.LargeChange = 1; + this.lameVBRQualityTb.Location = new System.Drawing.Point(10, 22); + this.lameVBRQualityTb.Maximum = 9; + this.lameVBRQualityTb.Name = "lameVBRQualityTb"; + this.lameVBRQualityTb.Size = new System.Drawing.Size(405, 45); + this.lameVBRQualityTb.TabIndex = 0; + this.lameVBRQualityTb.Value = 9; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.lameTargetQualityRb); + this.groupBox2.Controls.Add(this.lameTargetBitrateRb); + this.groupBox2.Location = new System.Drawing.Point(6, 22); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(222, 56); + this.groupBox2.TabIndex = 0; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Target"; + // + // lameTargetQualityRb + // + this.lameTargetQualityRb.AutoSize = true; + this.lameTargetQualityRb.Location = new System.Drawing.Point(138, 23); + this.lameTargetQualityRb.Name = "lameTargetQualityRb"; + this.lameTargetQualityRb.Size = new System.Drawing.Size(63, 19); + this.lameTargetQualityRb.TabIndex = 0; + this.lameTargetQualityRb.TabStop = true; + this.lameTargetQualityRb.Text = "Quality"; + this.lameTargetQualityRb.UseVisualStyleBackColor = true; + this.lameTargetQualityRb.CheckedChanged += new System.EventHandler(this.lameTargetRb_CheckedChanged); + // + // lameTargetBitrateRb + // + this.lameTargetBitrateRb.AutoSize = true; + this.lameTargetBitrateRb.Location = new System.Drawing.Point(6, 23); + this.lameTargetBitrateRb.Name = "lameTargetBitrateRb"; + this.lameTargetBitrateRb.Size = new System.Drawing.Size(59, 19); + this.lameTargetBitrateRb.TabIndex = 0; + this.lameTargetBitrateRb.TabStop = true; + this.lameTargetBitrateRb.Text = "Bitrate"; + this.lameTargetBitrateRb.UseVisualStyleBackColor = true; + this.lameTargetBitrateRb.CheckedChanged += new System.EventHandler(this.lameTargetRb_CheckedChanged); + // + // mergeOpeningEndCreditsCbox + // + this.mergeOpeningEndCreditsCbox.AutoSize = true; + this.mergeOpeningEndCreditsCbox.Location = new System.Drawing.Point(19, 93); + this.mergeOpeningEndCreditsCbox.Name = "mergeOpeningEndCreditsCbox"; + this.mergeOpeningEndCreditsCbox.Size = new System.Drawing.Size(198, 19); + this.mergeOpeningEndCreditsCbox.TabIndex = 13; + this.mergeOpeningEndCreditsCbox.Text = "[MergeOpeningEndCredits desc]"; + this.mergeOpeningEndCreditsCbox.UseVisualStyleBackColor = true; + // + // retainAaxFileCbox + // + this.retainAaxFileCbox.AutoSize = true; + this.retainAaxFileCbox.Location = new System.Drawing.Point(19, 68); + this.retainAaxFileCbox.Name = "retainAaxFileCbox"; + this.retainAaxFileCbox.Size = new System.Drawing.Size(132, 19); + this.retainAaxFileCbox.TabIndex = 10; + this.retainAaxFileCbox.Text = "[RetainAaxFile desc]"; + this.retainAaxFileCbox.UseVisualStyleBackColor = true; + this.retainAaxFileCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); + // + // downloadCoverArtCbox + // + this.downloadCoverArtCbox.AutoSize = true; + this.downloadCoverArtCbox.Checked = true; + this.downloadCoverArtCbox.CheckState = System.Windows.Forms.CheckState.Checked; + this.downloadCoverArtCbox.Location = new System.Drawing.Point(19, 43); + this.downloadCoverArtCbox.Name = "downloadCoverArtCbox"; + this.downloadCoverArtCbox.Size = new System.Drawing.Size(162, 19); + this.downloadCoverArtCbox.TabIndex = 10; + this.downloadCoverArtCbox.Text = "[DownloadCoverArt desc]"; + this.downloadCoverArtCbox.UseVisualStyleBackColor = true; + this.downloadCoverArtCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); + // + // createCueSheetCbox + // + this.createCueSheetCbox.AutoSize = true; + this.createCueSheetCbox.Checked = true; + this.createCueSheetCbox.CheckState = System.Windows.Forms.CheckState.Checked; + this.createCueSheetCbox.Location = new System.Drawing.Point(19, 18); + this.createCueSheetCbox.Name = "createCueSheetCbox"; + this.createCueSheetCbox.Size = new System.Drawing.Size(145, 19); + this.createCueSheetCbox.TabIndex = 10; + this.createCueSheetCbox.Text = "[CreateCueSheet desc]"; + this.createCueSheetCbox.UseVisualStyleBackColor = true; + this.createCueSheetCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); + // + // SettingsDialog + // + this.AcceptButton = this.saveBtn; + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancelBtn; + this.ClientSize = new System.Drawing.Size(886, 534); + this.Controls.Add(this.tabControl); + this.Controls.Add(this.cancelBtn); + this.Controls.Add(this.saveBtn); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "SettingsDialog"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Edit Settings"; + this.Load += new System.EventHandler(this.SettingsDialog_Load); + this.badBookGb.ResumeLayout(false); + this.badBookGb.PerformLayout(); + this.tabControl.ResumeLayout(false); + this.tab1ImportantSettings.ResumeLayout(false); + this.tab1ImportantSettings.PerformLayout(); + this.booksGb.ResumeLayout(false); + this.booksGb.PerformLayout(); + this.tab2ImportLibrary.ResumeLayout(false); + this.tab2ImportLibrary.PerformLayout(); + this.tab3DownloadDecrypt.ResumeLayout(false); + this.tab3DownloadDecrypt.PerformLayout(); + this.inProgressFilesGb.ResumeLayout(false); + this.inProgressFilesGb.PerformLayout(); + this.customFileNamingGb.ResumeLayout(false); + this.customFileNamingGb.PerformLayout(); + this.tab4AudioFileOptions.ResumeLayout(false); + this.tab4AudioFileOptions.PerformLayout(); + this.audiobookFixupsGb.ResumeLayout(false); + this.audiobookFixupsGb.PerformLayout(); + this.chapterTitleTemplateGb.ResumeLayout(false); + this.chapterTitleTemplateGb.PerformLayout(); + this.lameOptionsGb.ResumeLayout(false); + this.lameOptionsGb.PerformLayout(); + this.lameBitrateGb.ResumeLayout(false); + this.lameBitrateGb.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.lameBitrateTb)).EndInit(); + this.lameQualityGb.ResumeLayout(false); + this.lameQualityGb.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.lameVBRQualityTb)).EndInit(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.ResumeLayout(false); } @@ -1197,5 +1213,6 @@ private System.Windows.Forms.CheckBox mergeOpeningEndCreditsCbox; private System.Windows.Forms.GroupBox audiobookFixupsGb; private System.Windows.Forms.CheckBox betaOptInCbox; - } + private System.Windows.Forms.CheckBox useCoverAsFolderIconCb; + } } \ No newline at end of file diff --git a/Source/LibationWinForms/Dialogs/SettingsDialog.DownloadDecrypt.cs b/Source/LibationWinForms/Dialogs/SettingsDialog.DownloadDecrypt.cs index 035fdf98..d6d70113 100644 --- a/Source/LibationWinForms/Dialogs/SettingsDialog.DownloadDecrypt.cs +++ b/Source/LibationWinForms/Dialogs/SettingsDialog.DownloadDecrypt.cs @@ -25,12 +25,13 @@ namespace LibationWinForms.Dialogs editCharreplacementBtn.Text = desc(nameof(config.ReplacementCharacters)); badBookGb.Text = desc(nameof(config.BadBook)); - badBookAskRb.Text = Configuration.BadBookAction.Ask.GetDescription(); + badBookAskRb.Text = Configuration.BadBookAction.Ask.GetDescription(); badBookAbortRb.Text = Configuration.BadBookAction.Abort.GetDescription(); badBookRetryRb.Text = Configuration.BadBookAction.Retry.GetDescription(); badBookIgnoreRb.Text = Configuration.BadBookAction.Ignore.GetDescription(); + useCoverAsFolderIconCb.Text = desc(nameof(config.UseCoverAsFolderIcon)); - inProgressSelectControl.SetDirectoryItems(new() + inProgressSelectControl.SetDirectoryItems(new() { Configuration.KnownDirectories.WinTemp, Configuration.KnownDirectories.UserProfile, @@ -56,7 +57,8 @@ namespace LibationWinForms.Dialogs folderTemplateTb.Text = config.FolderTemplate; fileTemplateTb.Text = config.FileTemplate; chapterFileTemplateTb.Text = config.ChapterFileTemplate; - } + useCoverAsFolderIconCb.Checked = config.UseCoverAsFolderIcon; + } private void Save_DownloadDecrypt(Configuration config) { @@ -72,6 +74,7 @@ namespace LibationWinForms.Dialogs config.FolderTemplate = folderTemplateTb.Text; config.FileTemplate = fileTemplateTb.Text; config.ChapterFileTemplate = chapterFileTemplateTb.Text; + config.UseCoverAsFolderIcon = useCoverAsFolderIconCb.Checked; } } } diff --git a/Source/LibationWinForms/LibationWinForms.csproj b/Source/LibationWinForms/LibationWinForms.csproj index 8d4373a7..e99afc3b 100644 --- a/Source/LibationWinForms/LibationWinForms.csproj +++ b/Source/LibationWinForms/LibationWinForms.csproj @@ -44,7 +44,7 @@ - + diff --git a/Source/LoadByOS/LinuxConfigApp/LinuxInterop.cs b/Source/LoadByOS/LinuxConfigApp/LinuxInterop.cs index 74533de5..a2963f1e 100644 --- a/Source/LoadByOS/LinuxConfigApp/LinuxInterop.cs +++ b/Source/LoadByOS/LinuxConfigApp/LinuxInterop.cs @@ -1,4 +1,4 @@ -using AppScaffolding.OSInterop; +using LibationFileManager; namespace LinuxConfigApp { @@ -7,22 +7,7 @@ namespace LinuxConfigApp public LinuxInterop() { } public LinuxInterop(params object[] values) { } - - // examples until the real interface is filled out - private string InitValue1 { get; } - private int InitValue2 { get; } - - public LinuxInterop(string initValue1, int initValue2) - { - InitValue1 = initValue1; - InitValue2 = initValue2; - } - - public string TransformInit1() => InitValue1.ToLower(); - - public int TransformInit2() => InitValue2 + InitValue2; - - public void CopyTextToClipboard(string text) => throw new PlatformNotSupportedException(); - public void ShowForm() => throw new PlatformNotSupportedException(); + public void SetFolderIcon(string image, string directory) => throw new PlatformNotSupportedException(); + public void DeleteFolderIcon(string directory) => throw new PlatformNotSupportedException(); } } diff --git a/Source/LoadByOS/LinuxConfigApp/Program.cs b/Source/LoadByOS/LinuxConfigApp/Program.cs index be568de8..e98c8ff9 100644 --- a/Source/LoadByOS/LinuxConfigApp/Program.cs +++ b/Source/LoadByOS/LinuxConfigApp/Program.cs @@ -1,4 +1,4 @@ -using AppScaffolding.OSInterop; +using AppScaffolding; namespace LinuxConfigApp { diff --git a/Source/LoadByOS/MacOSConfigApp/MacOSInterop.cs b/Source/LoadByOS/MacOSConfigApp/MacOSInterop.cs index 6e92064d..2fafef09 100644 --- a/Source/LoadByOS/MacOSConfigApp/MacOSInterop.cs +++ b/Source/LoadByOS/MacOSConfigApp/MacOSInterop.cs @@ -1,4 +1,4 @@ -using AppScaffolding.OSInterop; +using LibationFileManager; namespace MacOSConfigApp { @@ -7,22 +7,7 @@ namespace MacOSConfigApp public MacOSInterop() { } public MacOSInterop(params object[] values) { } - - // examples until the real interface is filled out - private string InitValue1 { get; } - private int InitValue2 { get; } - - public MacOSInterop(string initValue1, int initValue2) - { - InitValue1 = initValue1; - InitValue2 = initValue2; - } - - public string TransformInit1() => InitValue1.ToLower(); - - public int TransformInit2() => InitValue2 + InitValue2; - - public void CopyTextToClipboard(string text) => throw new PlatformNotSupportedException(); - public void ShowForm() => throw new PlatformNotSupportedException(); + public void SetFolderIcon(string image, string directory) => throw new PlatformNotSupportedException(); + public void DeleteFolderIcon(string directory) => throw new PlatformNotSupportedException(); } } diff --git a/Source/LoadByOS/MacOSConfigApp/Program.cs b/Source/LoadByOS/MacOSConfigApp/Program.cs index 84aae9dd..bab9d875 100644 --- a/Source/LoadByOS/MacOSConfigApp/Program.cs +++ b/Source/LoadByOS/MacOSConfigApp/Program.cs @@ -1,4 +1,4 @@ -using AppScaffolding.OSInterop; +using AppScaffolding; namespace MacOSConfigApp { diff --git a/Source/LoadByOS/README.txt b/Source/LoadByOS/README.txt index 9dc6c2a3..0035d9c8 100644 --- a/Source/LoadByOS/README.txt +++ b/Source/LoadByOS/README.txt @@ -1 +1,7 @@ -Streamlined example is in \Source\_Demos\LoadByOS \ No newline at end of file +Streamlined example is in \Source\_Demos\LoadByOS + +MUST follow naming conventions in InteropFactory + +Windows : Path.GetFileName(a).StartsWithInsensitive("win") +Linux : Path.GetFileName(a).StartsWithInsensitive("linux") +MacOs : Path.GetFileName(a).StartsWithInsensitive("mac") || a.StartsWithInsensitive("osx") \ No newline at end of file diff --git a/Source/LoadByOS/WindowsConfigApp/Program.cs b/Source/LoadByOS/WindowsConfigApp/Program.cs index 2d793c2c..19887184 100644 --- a/Source/LoadByOS/WindowsConfigApp/Program.cs +++ b/Source/LoadByOS/WindowsConfigApp/Program.cs @@ -1,4 +1,4 @@ -using AppScaffolding.OSInterop; +using AppScaffolding; namespace WindowsConfigApp { @@ -9,6 +9,7 @@ namespace WindowsConfigApp { typeof(Form1), typeof(Bitmap), + typeof(Icon), typeof(Accessibility.IAccIdentity), typeof(Microsoft.Win32.SystemEvents) }; diff --git a/Source/LoadByOS/WindowsConfigApp/WinInterop.cs b/Source/LoadByOS/WindowsConfigApp/WinInterop.cs index 4c76aac4..fe3eef35 100644 --- a/Source/LoadByOS/WindowsConfigApp/WinInterop.cs +++ b/Source/LoadByOS/WindowsConfigApp/WinInterop.cs @@ -1,4 +1,11 @@ -using AppScaffolding.OSInterop; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Dinah.Core.WindowsDesktop; +using Dinah.Core.WindowsDesktop.Drawing; +using LibationFileManager; namespace WindowsConfigApp { @@ -7,27 +14,26 @@ namespace WindowsConfigApp public WinInterop() { } public WinInterop(params object[] values) { } - - // examples until the real interface is filled out - private string InitValue1 { get; } - private int InitValue2 { get; } - - public WinInterop(string initValue1, int initValue2) + public void SetFolderIcon(string image, string directory) { - InitValue1 = initValue1; - InitValue2 = initValue2; + string iconPath = null; + + try + { + var icon = ImageReader.ToIcon(image); + iconPath = Path.Combine(directory, $"{Guid.NewGuid()}.ico"); + icon.Save(iconPath); + + new DirectoryInfo(directory).SetIcon(iconPath, Directories.FolderTypes.Music); + } + finally + { + if (File.Exists(iconPath)) + File.Delete(iconPath); + } } - public void CopyTextToClipboard(string text) => Clipboard.SetDataObject(text, true, 5, 150); - - public void ShowForm() - { - ApplicationConfiguration.Initialize(); - Application.Run(new Form1()); - } - - public string TransformInit1() => InitValue1.ToUpper(); - - public int TransformInit2() => InitValue2 * InitValue2; + public void DeleteFolderIcon(string directory) + => new DirectoryInfo(directory)?.DeleteIcon(); } } diff --git a/Source/LoadByOS/WindowsConfigApp/WindowsConfigApp.csproj b/Source/LoadByOS/WindowsConfigApp/WindowsConfigApp.csproj index 29c5a9a4..93d3c6e0 100644 --- a/Source/LoadByOS/WindowsConfigApp/WindowsConfigApp.csproj +++ b/Source/LoadByOS/WindowsConfigApp/WindowsConfigApp.csproj @@ -19,6 +19,10 @@ embedded + + + + diff --git a/Source/_Demos/LoadByOS/CrossPlatformClientExe/OSInteropProxy.cs b/Source/_Demos/LoadByOS/CrossPlatformClientExe/OSInteropProxy.cs index 9dbaf318..f4adeb2d 100644 --- a/Source/_Demos/LoadByOS/CrossPlatformClientExe/OSInteropProxy.cs +++ b/Source/_Demos/LoadByOS/CrossPlatformClientExe/OSInteropProxy.cs @@ -18,7 +18,7 @@ namespace CrossPlatformClientExe public static Func MatchesOS { get; } = IsWindows ? a => Path.GetFileName(a).StartsWithInsensitive("win") : IsLinux ? a => Path.GetFileName(a).StartsWithInsensitive("linux") - : IsMacOs ? a => Path.GetFileName(a).StartsWithInsensitive("mac") || a.StartsWithInsensitive("osx") + : IsMacOs ? a => Path.GetFileName(a).StartsWithInsensitive("mac") || Path.GetFileName(a).StartsWithInsensitive("osx") : _ => false; private IInteropFunctions InteropFunctions { get; } = new NullInteropFunctions();