diff --git a/WinampNowPlayingToFile/Business/NowPlayingToFileManager.cs b/WinampNowPlayingToFile/Business/NowPlayingToFileManager.cs index 658da89..57252b7 100644 --- a/WinampNowPlayingToFile/Business/NowPlayingToFileManager.cs +++ b/WinampNowPlayingToFile/Business/NowPlayingToFileManager.cs @@ -11,6 +11,7 @@ using WinampNowPlayingToFile.Facade; using WinampNowPlayingToFile.Settings; using Song = WinampNowPlayingToFile.Facade.Song; +using System.Drawing.Text; namespace WinampNowPlayingToFile.Business; @@ -36,7 +37,13 @@ public class NowPlayingToFileManager: INowPlayingToFileManager { private readonly FormatCompiler templateCompiler = new(); internal readonly Timer renderTextTimer = new(1000); - private Generator? cachedTemplate; + internal struct templateWithGenerator { + internal string fileName { get; set; } + internal Generator generator { get; set; } + } + + private List cachedTemplates = new List(); + private bool _textTemplateDependsOnTime; private bool textTemplateDependsOnTime { @@ -63,7 +70,7 @@ public NowPlayingToFileManager(ISettings settings, WinampController winampContro }; this.settings.settingsUpdated += delegate { - cachedTemplate = null; + cachedTemplates.Clear(); textTemplateDependsOnTime = false; update(); }; @@ -82,7 +89,9 @@ public NowPlayingToFileManager(ISettings settings, WinampController winampContro internal void update(bool updateAlbumArt = true) { try { if (winampController.currentSong is { Filename: not "" } currentSong) { - saveText(renderText(currentSong)); + foreach (textTemplate template in settings.textTemplates) { + saveText(template.fileName, renderText(currentSong, template)); + } if (updateAlbumArt) { saveImage(findAlbumArt(currentSong)); @@ -93,21 +102,24 @@ internal void update(bool updateAlbumArt = true) { } } - internal string renderText(Song currentSong) { - return winampController.status == Status.Playing ? getTemplate().Render(currentSong) : string.Empty; + internal string renderText(Song currentSong, textTemplate template) { + return winampController.status == Status.Playing ? getTemplate(template).Render(currentSong) : string.Empty; } - private void saveText(string nowPlayingText) { - File.WriteAllText(settings.textFilename, nowPlayingText, UTF8); + private void saveText(string fileName, string nowPlayingText) { + File.WriteAllText(fileName, nowPlayingText, UTF8); } - private Generator getTemplate() { - if (cachedTemplate == null) { - cachedTemplate = templateCompiler.Compile(settings.textTemplate); - cachedTemplate.KeyNotFound += fetchExtraMetadata; + private Generator getTemplate(textTemplate template) { + Generator templateGenerator; + if (cachedTemplates.Exists(x => x.fileName == template.fileName)) { + templateGenerator = cachedTemplates.Single(x => x.fileName == template.fileName).generator; + } else { + templateGenerator = templateCompiler.Compile(template.text); + templateGenerator.KeyNotFound += fetchExtraMetadata; + cachedTemplates.Add(new templateWithGenerator() { fileName = template.fileName, generator = templateGenerator }); } - - return cachedTemplate; + return templateGenerator; } private void fetchExtraMetadata(object sender, KeyNotFoundEventArgs args) { @@ -211,7 +223,9 @@ private void startOrStopTextRenderingTimer(Status? playbackStatus = null) { public virtual void onQuit() { renderTextTimer.Stop(); - saveText(string.Empty); + foreach (textTemplate template in settings.textTemplates) { + saveText(template.fileName, string.Empty); + } saveImage(albumArtWhenStopped); } diff --git a/WinampNowPlayingToFile/Facade/textTemplate.cs b/WinampNowPlayingToFile/Facade/textTemplate.cs new file mode 100644 index 0000000..32c93d7 --- /dev/null +++ b/WinampNowPlayingToFile/Facade/textTemplate.cs @@ -0,0 +1,16 @@ +namespace WinampNowPlayingToFile.Facade; + +public struct textTemplate { + public textTemplate(string fileName = null!, string text = null!) { + this.fileName = fileName!; + this.text = text!; + } + + public string fileName { get; set; } + public string text { get; set; } + + public override string ToString() { + return text; + } +} + diff --git a/WinampNowPlayingToFile/Presentation/SettingsDialog.Designer.cs b/WinampNowPlayingToFile/Presentation/SettingsDialog.Designer.cs index 71d1395..7b1d340 100644 --- a/WinampNowPlayingToFile/Presentation/SettingsDialog.Designer.cs +++ b/WinampNowPlayingToFile/Presentation/SettingsDialog.Designer.cs @@ -28,379 +28,383 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.Windows.Forms.ToolStripMenuItem albumToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem artistToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem filenameToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem titleToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem yearToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem albumArtistToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem bitrateToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem bpmToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem categoryToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem commentToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem composerToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem conductorToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem directorToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem discToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem familyToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem gainToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem genreToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem isrcToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem keyToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem lengthToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem losslessToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem lyricistToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem mediaToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem producerToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem publisherToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem ratingToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem replayGainAlbumGainToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem replayGainAlbumPeakToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem replayGainTrackGainToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem replayGainTrackPeakToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem stereoToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem subtitleToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem toolToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem trackToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem typeToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem vbrToolStripMenuItem; - System.Windows.Forms.ToolStripMenuItem elapsedToolStripMenuItem; - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsDialog)); - this.otherToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.fileBasenameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.fileBasenameWithoutExtensionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.writeToFileLabel = new System.Windows.Forms.Label(); - this.textFilenameEditor = new System.Windows.Forms.SaveFileDialog(); - this.textBrowseButton = new System.Windows.Forms.Button(); - this.textFilename = new System.Windows.Forms.TextBox(); - this.templateLabel = new System.Windows.Forms.Label(); - this.templateEditor = new System.Windows.Forms.TextBox(); - this.templateInsertButton = new System.Windows.Forms.Button(); - this.okButton = new System.Windows.Forms.Button(); - this.cancelButton = new System.Windows.Forms.Button(); - this.templatePreview = new System.Windows.Forms.TextBox(); - this.previewLabel = new System.Windows.Forms.Label(); - this.insertTemplatePlaceholderMenu = new System.Windows.Forms.ContextMenuStrip(this.components); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.ifToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ifElseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newLineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.explanationLabel = new System.Windows.Forms.Label(); - this.horizontalRule1 = new System.Windows.Forms.Label(); - this.applyButton = new System.Windows.Forms.Button(); - this.albumArtLabel = new System.Windows.Forms.Label(); - this.albumArtBrowseButton = new System.Windows.Forms.Button(); - this.albumArtFilename = new System.Windows.Forms.TextBox(); - this.albumArtFilenameEditor = new System.Windows.Forms.SaveFileDialog(); - albumToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - artistToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - filenameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - titleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - yearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - albumArtistToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - bitrateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - bpmToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - categoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - commentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - composerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - conductorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - directorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - discToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - familyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - gainToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - genreToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - isrcToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - keyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - lengthToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - losslessToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - lyricistToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - mediaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - producerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - publisherToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - ratingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - replayGainAlbumGainToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - replayGainAlbumPeakToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - replayGainTrackGainToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - replayGainTrackPeakToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - stereoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - subtitleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - toolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - trackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - typeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - vbrToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - elapsedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.insertTemplatePlaceholderMenu.SuspendLayout(); - this.SuspendLayout(); - // - // albumToolStripMenuItem - // - albumToolStripMenuItem.Name = "albumToolStripMenuItem"; - albumToolStripMenuItem.ShowShortcutKeys = false; - albumToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - albumToolStripMenuItem.Text = "Album"; - // - // artistToolStripMenuItem - // - artistToolStripMenuItem.Name = "artistToolStripMenuItem"; - artistToolStripMenuItem.ShowShortcutKeys = false; - artistToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - artistToolStripMenuItem.Text = "Artist"; - // - // filenameToolStripMenuItem - // - filenameToolStripMenuItem.Name = "filenameToolStripMenuItem"; - filenameToolStripMenuItem.ShowShortcutKeys = false; - filenameToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - filenameToolStripMenuItem.Text = "Filename"; - filenameToolStripMenuItem.ToolTipText = "The absolute path to the file, e.g. \"C:\\Users\\Ben\\Music\\Song.mp3\""; - // - // titleToolStripMenuItem - // - titleToolStripMenuItem.Name = "titleToolStripMenuItem"; - titleToolStripMenuItem.ShowShortcutKeys = false; - titleToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - titleToolStripMenuItem.Text = "Title"; - // - // yearToolStripMenuItem - // - yearToolStripMenuItem.Name = "yearToolStripMenuItem"; - yearToolStripMenuItem.ShowShortcutKeys = false; - yearToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - yearToolStripMenuItem.Text = "Year"; - // - // albumArtistToolStripMenuItem - // - albumArtistToolStripMenuItem.Name = "albumArtistToolStripMenuItem"; - albumArtistToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - albumArtistToolStripMenuItem.Tag = "AlbumArtist"; - albumArtistToolStripMenuItem.Text = "Album artist"; - // - // bitrateToolStripMenuItem - // - bitrateToolStripMenuItem.Name = "bitrateToolStripMenuItem"; - bitrateToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - bitrateToolStripMenuItem.Text = "Bitrate"; - bitrateToolStripMenuItem.ToolTipText = "Number of kilobits per second, e.g. \"320\""; - // - // bpmToolStripMenuItem - // - bpmToolStripMenuItem.Name = "bpmToolStripMenuItem"; - bpmToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - bpmToolStripMenuItem.Tag = "BPM"; - bpmToolStripMenuItem.Text = "BPM"; - bpmToolStripMenuItem.ToolTipText = "Number of beats per minute, e.g. \"86\""; - // - // categoryToolStripMenuItem - // - categoryToolStripMenuItem.Name = "categoryToolStripMenuItem"; - categoryToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - categoryToolStripMenuItem.Text = "Category"; - categoryToolStripMenuItem.ToolTipText = "e.g. \"Rock\""; - // - // commentToolStripMenuItem - // - commentToolStripMenuItem.Name = "commentToolStripMenuItem"; - commentToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - commentToolStripMenuItem.Text = "Comment"; - // - // composerToolStripMenuItem - // - composerToolStripMenuItem.Name = "composerToolStripMenuItem"; - composerToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - composerToolStripMenuItem.Text = "Composer"; - // - // conductorToolStripMenuItem - // - conductorToolStripMenuItem.Name = "conductorToolStripMenuItem"; - conductorToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - conductorToolStripMenuItem.Text = "Conductor"; - // - // directorToolStripMenuItem - // - directorToolStripMenuItem.Name = "directorToolStripMenuItem"; - directorToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - directorToolStripMenuItem.Text = "Director"; - directorToolStripMenuItem.ToolTipText = "For video files"; - // - // discToolStripMenuItem - // - discToolStripMenuItem.Name = "discToolStripMenuItem"; - discToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - discToolStripMenuItem.Text = "Disc"; - discToolStripMenuItem.ToolTipText = "e.g. \"1\" or \"1/2\""; - // - // familyToolStripMenuItem - // - familyToolStripMenuItem.Name = "familyToolStripMenuItem"; - familyToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - familyToolStripMenuItem.Text = "Family"; - familyToolStripMenuItem.ToolTipText = "e.g. \"MPEG Layer 3 Audio File\""; - // - // gainToolStripMenuItem - // - gainToolStripMenuItem.Name = "gainToolStripMenuItem"; - gainToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - gainToolStripMenuItem.Text = "Gain"; - gainToolStripMenuItem.ToolTipText = "e.g. \"+0.40 dB\""; - // - // genreToolStripMenuItem - // - genreToolStripMenuItem.Name = "genreToolStripMenuItem"; - genreToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - genreToolStripMenuItem.Text = "Genre"; - // - // isrcToolStripMenuItem - // - isrcToolStripMenuItem.Name = "isrcToolStripMenuItem"; - isrcToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - isrcToolStripMenuItem.Tag = "ISRC"; - isrcToolStripMenuItem.Text = "ISRC"; - isrcToolStripMenuItem.ToolTipText = "e.g. \"USLZJ2006066\""; - // - // keyToolStripMenuItem - // - keyToolStripMenuItem.Name = "keyToolStripMenuItem"; - keyToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - keyToolStripMenuItem.Text = "Key"; - keyToolStripMenuItem.ToolTipText = "e.g. \"A\""; - // - // lengthToolStripMenuItem - // - lengthToolStripMenuItem.Name = "lengthToolStripMenuItem"; - lengthToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - lengthToolStripMenuItem.Tag = "Length:m\\:ss"; - lengthToolStripMenuItem.Text = "Length"; - lengthToolStripMenuItem.ToolTipText = "Duration of media with millisecond resolution, to be formatted as a .NET TimeSpan" + + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.ToolStripMenuItem albumToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem artistToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem filenameToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem titleToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem yearToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem albumArtistToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem bitrateToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem bpmToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem categoryToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem commentToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem composerToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem conductorToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem directorToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem discToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem familyToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem gainToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem genreToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem isrcToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem keyToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem lengthToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem losslessToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem lyricistToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem mediaToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem producerToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem publisherToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem ratingToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem replayGainAlbumGainToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem replayGainAlbumPeakToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem replayGainTrackGainToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem replayGainTrackPeakToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem stereoToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem subtitleToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem toolToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem trackToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem typeToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem vbrToolStripMenuItem; + System.Windows.Forms.ToolStripMenuItem elapsedToolStripMenuItem; + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsDialog)); + this.otherToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.fileBasenameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.fileBasenameWithoutExtensionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.writeToFileLabel = new System.Windows.Forms.Label(); + this.textFilenameEditor = new System.Windows.Forms.SaveFileDialog(); + this.textBrowseButton = new System.Windows.Forms.Button(); + this.textFilename = new System.Windows.Forms.TextBox(); + this.templateLabel = new System.Windows.Forms.Label(); + this.templateEditor = new System.Windows.Forms.TextBox(); + this.templateInsertButton = new System.Windows.Forms.Button(); + this.okButton = new System.Windows.Forms.Button(); + this.cancelButton = new System.Windows.Forms.Button(); + this.templatePreview = new System.Windows.Forms.TextBox(); + this.previewLabel = new System.Windows.Forms.Label(); + this.insertTemplatePlaceholderMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.ifToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ifElseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newLineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.explanationLabel = new System.Windows.Forms.Label(); + this.horizontalRule1 = new System.Windows.Forms.Label(); + this.applyButton = new System.Windows.Forms.Button(); + this.albumArtLabel = new System.Windows.Forms.Label(); + this.albumArtBrowseButton = new System.Windows.Forms.Button(); + this.albumArtFilename = new System.Windows.Forms.TextBox(); + this.albumArtFilenameEditor = new System.Windows.Forms.SaveFileDialog(); + this.templateSelector = new System.Windows.Forms.ComboBox(); + this.templateSelectorLabel = new System.Windows.Forms.Label(); + this.templateAdd = new System.Windows.Forms.Button(); + this.templateRemove = new System.Windows.Forms.Button(); + albumToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + artistToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + filenameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + titleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + yearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + albumArtistToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + bitrateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + bpmToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + categoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + commentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + composerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + conductorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + directorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + discToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + familyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + gainToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + genreToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + isrcToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + keyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + lengthToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + losslessToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + lyricistToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + mediaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + producerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + publisherToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + ratingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + replayGainAlbumGainToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + replayGainAlbumPeakToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + replayGainTrackGainToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + replayGainTrackPeakToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + stereoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + subtitleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + toolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + trackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + typeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + vbrToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + elapsedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.insertTemplatePlaceholderMenu.SuspendLayout(); + this.SuspendLayout(); + // + // albumToolStripMenuItem + // + albumToolStripMenuItem.Name = "albumToolStripMenuItem"; + albumToolStripMenuItem.ShowShortcutKeys = false; + albumToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + albumToolStripMenuItem.Text = "Album"; + // + // artistToolStripMenuItem + // + artistToolStripMenuItem.Name = "artistToolStripMenuItem"; + artistToolStripMenuItem.ShowShortcutKeys = false; + artistToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + artistToolStripMenuItem.Text = "Artist"; + // + // filenameToolStripMenuItem + // + filenameToolStripMenuItem.Name = "filenameToolStripMenuItem"; + filenameToolStripMenuItem.ShowShortcutKeys = false; + filenameToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + filenameToolStripMenuItem.Text = "Filename"; + filenameToolStripMenuItem.ToolTipText = "The absolute path to the file, e.g. \"C:\\Users\\Ben\\Music\\Song.mp3\""; + // + // titleToolStripMenuItem + // + titleToolStripMenuItem.Name = "titleToolStripMenuItem"; + titleToolStripMenuItem.ShowShortcutKeys = false; + titleToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + titleToolStripMenuItem.Text = "Title"; + // + // yearToolStripMenuItem + // + yearToolStripMenuItem.Name = "yearToolStripMenuItem"; + yearToolStripMenuItem.ShowShortcutKeys = false; + yearToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + yearToolStripMenuItem.Text = "Year"; + // + // albumArtistToolStripMenuItem + // + albumArtistToolStripMenuItem.Name = "albumArtistToolStripMenuItem"; + albumArtistToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + albumArtistToolStripMenuItem.Tag = "AlbumArtist"; + albumArtistToolStripMenuItem.Text = "Album artist"; + // + // bitrateToolStripMenuItem + // + bitrateToolStripMenuItem.Name = "bitrateToolStripMenuItem"; + bitrateToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + bitrateToolStripMenuItem.Text = "Bitrate"; + bitrateToolStripMenuItem.ToolTipText = "Number of kilobits per second, e.g. \"320\""; + // + // bpmToolStripMenuItem + // + bpmToolStripMenuItem.Name = "bpmToolStripMenuItem"; + bpmToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + bpmToolStripMenuItem.Tag = "BPM"; + bpmToolStripMenuItem.Text = "BPM"; + bpmToolStripMenuItem.ToolTipText = "Number of beats per minute, e.g. \"86\""; + // + // categoryToolStripMenuItem + // + categoryToolStripMenuItem.Name = "categoryToolStripMenuItem"; + categoryToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + categoryToolStripMenuItem.Text = "Category"; + categoryToolStripMenuItem.ToolTipText = "e.g. \"Rock\""; + // + // commentToolStripMenuItem + // + commentToolStripMenuItem.Name = "commentToolStripMenuItem"; + commentToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + commentToolStripMenuItem.Text = "Comment"; + // + // composerToolStripMenuItem + // + composerToolStripMenuItem.Name = "composerToolStripMenuItem"; + composerToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + composerToolStripMenuItem.Text = "Composer"; + // + // conductorToolStripMenuItem + // + conductorToolStripMenuItem.Name = "conductorToolStripMenuItem"; + conductorToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + conductorToolStripMenuItem.Text = "Conductor"; + // + // directorToolStripMenuItem + // + directorToolStripMenuItem.Name = "directorToolStripMenuItem"; + directorToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + directorToolStripMenuItem.Text = "Director"; + directorToolStripMenuItem.ToolTipText = "For video files"; + // + // discToolStripMenuItem + // + discToolStripMenuItem.Name = "discToolStripMenuItem"; + discToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + discToolStripMenuItem.Text = "Disc"; + discToolStripMenuItem.ToolTipText = "e.g. \"1\" or \"1/2\""; + // + // familyToolStripMenuItem + // + familyToolStripMenuItem.Name = "familyToolStripMenuItem"; + familyToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + familyToolStripMenuItem.Text = "Family"; + familyToolStripMenuItem.ToolTipText = "e.g. \"MPEG Layer 3 Audio File\""; + // + // gainToolStripMenuItem + // + gainToolStripMenuItem.Name = "gainToolStripMenuItem"; + gainToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + gainToolStripMenuItem.Text = "Gain"; + gainToolStripMenuItem.ToolTipText = "e.g. \"+0.40 dB\""; + // + // genreToolStripMenuItem + // + genreToolStripMenuItem.Name = "genreToolStripMenuItem"; + genreToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + genreToolStripMenuItem.Text = "Genre"; + // + // isrcToolStripMenuItem + // + isrcToolStripMenuItem.Name = "isrcToolStripMenuItem"; + isrcToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + isrcToolStripMenuItem.Tag = "ISRC"; + isrcToolStripMenuItem.Text = "ISRC"; + isrcToolStripMenuItem.ToolTipText = "e.g. \"USLZJ2006066\""; + // + // keyToolStripMenuItem + // + keyToolStripMenuItem.Name = "keyToolStripMenuItem"; + keyToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + keyToolStripMenuItem.Text = "Key"; + keyToolStripMenuItem.ToolTipText = "e.g. \"A\""; + // + // lengthToolStripMenuItem + // + lengthToolStripMenuItem.Name = "lengthToolStripMenuItem"; + lengthToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + lengthToolStripMenuItem.Tag = "Length:m\\:ss"; + lengthToolStripMenuItem.Text = "Length"; + lengthToolStripMenuItem.ToolTipText = "Duration of media with millisecond resolution, to be formatted as a .NET TimeSpan" + ""; - // - // losslessToolStripMenuItem - // - losslessToolStripMenuItem.Name = "losslessToolStripMenuItem"; - losslessToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - losslessToolStripMenuItem.Text = "Lossless"; - losslessToolStripMenuItem.ToolTipText = "\"0\" (lossy) or \"1\" (lossless)"; - // - // lyricistToolStripMenuItem - // - lyricistToolStripMenuItem.Name = "lyricistToolStripMenuItem"; - lyricistToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - lyricistToolStripMenuItem.Text = "Lyricist"; - // - // mediaToolStripMenuItem - // - mediaToolStripMenuItem.Name = "mediaToolStripMenuItem"; - mediaToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - mediaToolStripMenuItem.Text = "Media"; - mediaToolStripMenuItem.ToolTipText = "The MEDIATYPE ID3v2 tag"; - // - // producerToolStripMenuItem - // - producerToolStripMenuItem.Name = "producerToolStripMenuItem"; - producerToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - producerToolStripMenuItem.Text = "Producer"; - // - // publisherToolStripMenuItem - // - publisherToolStripMenuItem.Name = "publisherToolStripMenuItem"; - publisherToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - publisherToolStripMenuItem.Text = "Publisher"; - // - // ratingToolStripMenuItem - // - ratingToolStripMenuItem.Name = "ratingToolStripMenuItem"; - ratingToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - ratingToolStripMenuItem.Text = "Rating"; - ratingToolStripMenuItem.ToolTipText = "\"1\", \"2\", \"3\", \"4\", \"5\", or empty"; - // - // replayGainAlbumGainToolStripMenuItem - // - replayGainAlbumGainToolStripMenuItem.Name = "replayGainAlbumGainToolStripMenuItem"; - replayGainAlbumGainToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - replayGainAlbumGainToolStripMenuItem.Tag = "ReplayGain_Album_Gain"; - replayGainAlbumGainToolStripMenuItem.Text = "ReplayGain album gain"; - replayGainAlbumGainToolStripMenuItem.ToolTipText = "e.g. \"-7.29 dB\""; - // - // replayGainAlbumPeakToolStripMenuItem - // - replayGainAlbumPeakToolStripMenuItem.Name = "replayGainAlbumPeakToolStripMenuItem"; - replayGainAlbumPeakToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - replayGainAlbumPeakToolStripMenuItem.Tag = "ReplayGain_Album_Peak"; - replayGainAlbumPeakToolStripMenuItem.Text = "ReplayGain album peak"; - replayGainAlbumPeakToolStripMenuItem.ToolTipText = "e.g. \"0.965118408\""; - // - // replayGainTrackGainToolStripMenuItem - // - replayGainTrackGainToolStripMenuItem.Name = "replayGainTrackGainToolStripMenuItem"; - replayGainTrackGainToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - replayGainTrackGainToolStripMenuItem.Tag = "ReplayGain_Track_Gain"; - replayGainTrackGainToolStripMenuItem.Text = "ReplayGain track gain"; - replayGainTrackGainToolStripMenuItem.ToolTipText = "e.g. \"-7.29 dB\""; - // - // replayGainTrackPeakToolStripMenuItem - // - replayGainTrackPeakToolStripMenuItem.Name = "replayGainTrackPeakToolStripMenuItem"; - replayGainTrackPeakToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - replayGainTrackPeakToolStripMenuItem.Tag = "ReplayGain_Track_Peak"; - replayGainTrackPeakToolStripMenuItem.Text = "ReplayGain track peak"; - replayGainTrackPeakToolStripMenuItem.ToolTipText = "e.g. \"0.965118408\""; - // - // stereoToolStripMenuItem - // - stereoToolStripMenuItem.Name = "stereoToolStripMenuItem"; - stereoToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - stereoToolStripMenuItem.Text = "Stereo"; - stereoToolStripMenuItem.ToolTipText = "\"0\" (mono) or \"1\" (stereo)"; - // - // subtitleToolStripMenuItem - // - subtitleToolStripMenuItem.Name = "subtitleToolStripMenuItem"; - subtitleToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - subtitleToolStripMenuItem.Text = "Subtitle"; - // - // toolToolStripMenuItem - // - toolToolStripMenuItem.Name = "toolToolStripMenuItem"; - toolToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - toolToolStripMenuItem.Text = "Tool"; - toolToolStripMenuItem.ToolTipText = "The ENCODEDBY ID3v2 tag, e.g. \"iTunes 10.5.1\""; - // - // trackToolStripMenuItem - // - trackToolStripMenuItem.Name = "trackToolStripMenuItem"; - trackToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - trackToolStripMenuItem.Text = "Track"; - trackToolStripMenuItem.ToolTipText = "e.g. \"1\" or \"1/5\""; - // - // typeToolStripMenuItem - // - typeToolStripMenuItem.Name = "typeToolStripMenuItem"; - typeToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - typeToolStripMenuItem.Text = "Type"; - typeToolStripMenuItem.ToolTipText = "\"0\" (audio) or \"1\" (video)"; - // - // vbrToolStripMenuItem - // - vbrToolStripMenuItem.Name = "vbrToolStripMenuItem"; - vbrToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - vbrToolStripMenuItem.Tag = "VBR"; - vbrToolStripMenuItem.Text = "VBR"; - vbrToolStripMenuItem.ToolTipText = "\"0\" (constant bitrate) or \"1\" (variable bitrate)"; - // - // elapsedToolStripMenuItem - // - elapsedToolStripMenuItem.Name = "elapsedToolStripMenuItem"; - elapsedToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - elapsedToolStripMenuItem.Tag = "Elapsed:m\\:ss"; - elapsedToolStripMenuItem.Text = "Elapsed"; - elapsedToolStripMenuItem.ToolTipText = "Playback time position of the current media with millisecond resolution, updated " + + // + // losslessToolStripMenuItem + // + losslessToolStripMenuItem.Name = "losslessToolStripMenuItem"; + losslessToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + losslessToolStripMenuItem.Text = "Lossless"; + losslessToolStripMenuItem.ToolTipText = "\"0\" (lossy) or \"1\" (lossless)"; + // + // lyricistToolStripMenuItem + // + lyricistToolStripMenuItem.Name = "lyricistToolStripMenuItem"; + lyricistToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + lyricistToolStripMenuItem.Text = "Lyricist"; + // + // mediaToolStripMenuItem + // + mediaToolStripMenuItem.Name = "mediaToolStripMenuItem"; + mediaToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + mediaToolStripMenuItem.Text = "Media"; + mediaToolStripMenuItem.ToolTipText = "The MEDIATYPE ID3v2 tag"; + // + // producerToolStripMenuItem + // + producerToolStripMenuItem.Name = "producerToolStripMenuItem"; + producerToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + producerToolStripMenuItem.Text = "Producer"; + // + // publisherToolStripMenuItem + // + publisherToolStripMenuItem.Name = "publisherToolStripMenuItem"; + publisherToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + publisherToolStripMenuItem.Text = "Publisher"; + // + // ratingToolStripMenuItem + // + ratingToolStripMenuItem.Name = "ratingToolStripMenuItem"; + ratingToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + ratingToolStripMenuItem.Text = "Rating"; + ratingToolStripMenuItem.ToolTipText = "\"1\", \"2\", \"3\", \"4\", \"5\", or empty"; + // + // replayGainAlbumGainToolStripMenuItem + // + replayGainAlbumGainToolStripMenuItem.Name = "replayGainAlbumGainToolStripMenuItem"; + replayGainAlbumGainToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + replayGainAlbumGainToolStripMenuItem.Tag = "ReplayGain_Album_Gain"; + replayGainAlbumGainToolStripMenuItem.Text = "ReplayGain album gain"; + replayGainAlbumGainToolStripMenuItem.ToolTipText = "e.g. \"-7.29 dB\""; + // + // replayGainAlbumPeakToolStripMenuItem + // + replayGainAlbumPeakToolStripMenuItem.Name = "replayGainAlbumPeakToolStripMenuItem"; + replayGainAlbumPeakToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + replayGainAlbumPeakToolStripMenuItem.Tag = "ReplayGain_Album_Peak"; + replayGainAlbumPeakToolStripMenuItem.Text = "ReplayGain album peak"; + replayGainAlbumPeakToolStripMenuItem.ToolTipText = "e.g. \"0.965118408\""; + // + // replayGainTrackGainToolStripMenuItem + // + replayGainTrackGainToolStripMenuItem.Name = "replayGainTrackGainToolStripMenuItem"; + replayGainTrackGainToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + replayGainTrackGainToolStripMenuItem.Tag = "ReplayGain_Track_Gain"; + replayGainTrackGainToolStripMenuItem.Text = "ReplayGain track gain"; + replayGainTrackGainToolStripMenuItem.ToolTipText = "e.g. \"-7.29 dB\""; + // + // replayGainTrackPeakToolStripMenuItem + // + replayGainTrackPeakToolStripMenuItem.Name = "replayGainTrackPeakToolStripMenuItem"; + replayGainTrackPeakToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + replayGainTrackPeakToolStripMenuItem.Tag = "ReplayGain_Track_Peak"; + replayGainTrackPeakToolStripMenuItem.Text = "ReplayGain track peak"; + replayGainTrackPeakToolStripMenuItem.ToolTipText = "e.g. \"0.965118408\""; + // + // stereoToolStripMenuItem + // + stereoToolStripMenuItem.Name = "stereoToolStripMenuItem"; + stereoToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + stereoToolStripMenuItem.Text = "Stereo"; + stereoToolStripMenuItem.ToolTipText = "\"0\" (mono) or \"1\" (stereo)"; + // + // subtitleToolStripMenuItem + // + subtitleToolStripMenuItem.Name = "subtitleToolStripMenuItem"; + subtitleToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + subtitleToolStripMenuItem.Text = "Subtitle"; + // + // toolToolStripMenuItem + // + toolToolStripMenuItem.Name = "toolToolStripMenuItem"; + toolToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + toolToolStripMenuItem.Text = "Tool"; + toolToolStripMenuItem.ToolTipText = "The ENCODEDBY ID3v2 tag, e.g. \"iTunes 10.5.1\""; + // + // trackToolStripMenuItem + // + trackToolStripMenuItem.Name = "trackToolStripMenuItem"; + trackToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + trackToolStripMenuItem.Text = "Track"; + trackToolStripMenuItem.ToolTipText = "e.g. \"1\" or \"1/5\""; + // + // typeToolStripMenuItem + // + typeToolStripMenuItem.Name = "typeToolStripMenuItem"; + typeToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + typeToolStripMenuItem.Text = "Type"; + typeToolStripMenuItem.ToolTipText = "\"0\" (audio) or \"1\" (video)"; + // + // vbrToolStripMenuItem + // + vbrToolStripMenuItem.Name = "vbrToolStripMenuItem"; + vbrToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + vbrToolStripMenuItem.Tag = "VBR"; + vbrToolStripMenuItem.Text = "VBR"; + vbrToolStripMenuItem.ToolTipText = "\"0\" (constant bitrate) or \"1\" (variable bitrate)"; + // + // elapsedToolStripMenuItem + // + elapsedToolStripMenuItem.Name = "elapsedToolStripMenuItem"; + elapsedToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + elapsedToolStripMenuItem.Tag = "Elapsed:m\\:ss"; + elapsedToolStripMenuItem.Text = "Elapsed"; + elapsedToolStripMenuItem.ToolTipText = "Playback time position of the current media with millisecond resolution, updated " + "every second. To be formatted as a .NET TimeSpan."; - // - // otherToolStripMenuItem - // - this.otherToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + // + // otherToolStripMenuItem + // + this.otherToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { albumArtistToolStripMenuItem, bitrateToolStripMenuItem, bpmToolStripMenuItem, @@ -435,140 +439,140 @@ private void InitializeComponent() trackToolStripMenuItem, typeToolStripMenuItem, vbrToolStripMenuItem}); - this.otherToolStripMenuItem.Name = "otherToolStripMenuItem"; - this.otherToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - this.otherToolStripMenuItem.Text = "More"; - this.otherToolStripMenuItem.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.onTemplateMenuSelection); - // - // fileBasenameToolStripMenuItem - // - this.fileBasenameToolStripMenuItem.Name = "fileBasenameToolStripMenuItem"; - this.fileBasenameToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - this.fileBasenameToolStripMenuItem.Tag = "FileBasename"; - this.fileBasenameToolStripMenuItem.Text = "File basename"; - this.fileBasenameToolStripMenuItem.ToolTipText = "Name of file without path, e.g. \"Song.mp3\""; - // - // fileBasenameWithoutExtensionToolStripMenuItem - // - this.fileBasenameWithoutExtensionToolStripMenuItem.Name = "fileBasenameWithoutExtensionToolStripMenuItem"; - this.fileBasenameWithoutExtensionToolStripMenuItem.Size = new System.Drawing.Size(247, 22); - this.fileBasenameWithoutExtensionToolStripMenuItem.Tag = "FileBasenameWithoutExtension"; - this.fileBasenameWithoutExtensionToolStripMenuItem.Text = "File basename without extension"; - this.fileBasenameWithoutExtensionToolStripMenuItem.ToolTipText = "Name of file without path or extension, e.g. \"Song\""; - // - // writeToFileLabel - // - this.writeToFileLabel.AutoSize = true; - this.writeToFileLabel.Location = new System.Drawing.Point(13, 76); - this.writeToFileLabel.Name = "writeToFileLabel"; - this.writeToFileLabel.Size = new System.Drawing.Size(66, 13); - this.writeToFileLabel.TabIndex = 5; - this.writeToFileLabel.Text = "&Save text as"; - // - // textFilenameEditor - // - this.textFilenameEditor.DefaultExt = "txt"; - this.textFilenameEditor.Filter = "Text files|*.txt"; - this.textFilenameEditor.Title = "Choose file to save Now Playing text into"; - this.textFilenameEditor.FileOk += new System.ComponentModel.CancelEventHandler(this.onSubmitFilename); - // - // textBrowseButton - // - this.textBrowseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.textBrowseButton.Location = new System.Drawing.Point(499, 71); - this.textBrowseButton.Name = "textBrowseButton"; - this.textBrowseButton.Size = new System.Drawing.Size(75, 23); - this.textBrowseButton.TabIndex = 7; - this.textBrowseButton.Text = "&Browse…"; - this.textBrowseButton.UseVisualStyleBackColor = true; - this.textBrowseButton.Click += new System.EventHandler(this.onTextFileBrowseButtonClick); - // - // textFilename - // - this.textFilename.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.otherToolStripMenuItem.Name = "otherToolStripMenuItem"; + this.otherToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + this.otherToolStripMenuItem.Text = "More"; + this.otherToolStripMenuItem.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.onTemplateMenuSelection); + // + // fileBasenameToolStripMenuItem + // + this.fileBasenameToolStripMenuItem.Name = "fileBasenameToolStripMenuItem"; + this.fileBasenameToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + this.fileBasenameToolStripMenuItem.Tag = "FileBasename"; + this.fileBasenameToolStripMenuItem.Text = "File basename"; + this.fileBasenameToolStripMenuItem.ToolTipText = "Name of file without path, e.g. \"Song.mp3\""; + // + // fileBasenameWithoutExtensionToolStripMenuItem + // + this.fileBasenameWithoutExtensionToolStripMenuItem.Name = "fileBasenameWithoutExtensionToolStripMenuItem"; + this.fileBasenameWithoutExtensionToolStripMenuItem.Size = new System.Drawing.Size(247, 22); + this.fileBasenameWithoutExtensionToolStripMenuItem.Tag = "FileBasenameWithoutExtension"; + this.fileBasenameWithoutExtensionToolStripMenuItem.Text = "File basename without extension"; + this.fileBasenameWithoutExtensionToolStripMenuItem.ToolTipText = "Name of file without path or extension, e.g. \"Song\""; + // + // writeToFileLabel + // + this.writeToFileLabel.AutoSize = true; + this.writeToFileLabel.Location = new System.Drawing.Point(13, 102); + this.writeToFileLabel.Name = "writeToFileLabel"; + this.writeToFileLabel.Size = new System.Drawing.Size(66, 13); + this.writeToFileLabel.TabIndex = 5; + this.writeToFileLabel.Text = "&Save text as"; + // + // textFilenameEditor + // + this.textFilenameEditor.DefaultExt = "txt"; + this.textFilenameEditor.Filter = "Text files|*.txt"; + this.textFilenameEditor.Title = "Choose file to save Now Playing text into"; + this.textFilenameEditor.FileOk += new System.ComponentModel.CancelEventHandler(this.onSubmitFilename); + // + // textBrowseButton + // + this.textBrowseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.textBrowseButton.Location = new System.Drawing.Point(499, 97); + this.textBrowseButton.Name = "textBrowseButton"; + this.textBrowseButton.Size = new System.Drawing.Size(75, 23); + this.textBrowseButton.TabIndex = 7; + this.textBrowseButton.Text = "&Browse…"; + this.textBrowseButton.UseVisualStyleBackColor = true; + this.textBrowseButton.Click += new System.EventHandler(this.onTextFileBrowseButtonClick); + // + // textFilename + // + this.textFilename.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.textFilename.Location = new System.Drawing.Point(127, 73); - this.textFilename.Name = "textFilename"; - this.textFilename.Size = new System.Drawing.Size(366, 20); - this.textFilename.TabIndex = 6; - this.textFilename.TextChanged += new System.EventHandler(this.onFilenameChange); - // - // templateLabel - // - this.templateLabel.AutoSize = true; - this.templateLabel.Location = new System.Drawing.Point(13, 18); - this.templateLabel.Name = "templateLabel"; - this.templateLabel.Size = new System.Drawing.Size(71, 13); - this.templateLabel.TabIndex = 0; - this.templateLabel.Text = "&Text template"; - // - // templateEditor - // - this.templateEditor.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.textFilename.Location = new System.Drawing.Point(119, 99); + this.textFilename.Name = "textFilename"; + this.textFilename.Size = new System.Drawing.Size(374, 20); + this.textFilename.TabIndex = 6; + this.textFilename.TextChanged += new System.EventHandler(this.onFilenameChange); + // + // templateLabel + // + this.templateLabel.AutoSize = true; + this.templateLabel.Location = new System.Drawing.Point(13, 44); + this.templateLabel.Name = "templateLabel"; + this.templateLabel.Size = new System.Drawing.Size(71, 13); + this.templateLabel.TabIndex = 0; + this.templateLabel.Text = "&Text template"; + // + // templateEditor + // + this.templateEditor.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.templateEditor.Location = new System.Drawing.Point(127, 15); - this.templateEditor.Name = "templateEditor"; - this.templateEditor.Size = new System.Drawing.Size(366, 20); - this.templateEditor.TabIndex = 1; - this.templateEditor.TextChanged += new System.EventHandler(this.onTemplateChange); - // - // templateInsertButton - // - this.templateInsertButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.templateInsertButton.Location = new System.Drawing.Point(499, 13); - this.templateInsertButton.Name = "templateInsertButton"; - this.templateInsertButton.Size = new System.Drawing.Size(75, 23); - this.templateInsertButton.TabIndex = 2; - this.templateInsertButton.Text = "&Insert"; - this.templateInsertButton.UseVisualStyleBackColor = true; - this.templateInsertButton.Click += new System.EventHandler(this.showTemplateMenu); - // - // okButton - // - this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.okButton.Location = new System.Drawing.Point(337, 196); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 23); - this.okButton.TabIndex = 13; - this.okButton.Text = "OK"; - this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.onClickOk); - // - // cancelButton - // - this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.Location = new System.Drawing.Point(418, 196); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(75, 23); - this.cancelButton.TabIndex = 14; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - this.cancelButton.Click += new System.EventHandler(this.onCancel); - // - // templatePreview - // - this.templatePreview.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.templateEditor.Location = new System.Drawing.Point(119, 41); + this.templateEditor.Name = "templateEditor"; + this.templateEditor.Size = new System.Drawing.Size(374, 20); + this.templateEditor.TabIndex = 1; + this.templateEditor.TextChanged += new System.EventHandler(this.onTemplateChange); + // + // templateInsertButton + // + this.templateInsertButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.templateInsertButton.Location = new System.Drawing.Point(499, 39); + this.templateInsertButton.Name = "templateInsertButton"; + this.templateInsertButton.Size = new System.Drawing.Size(75, 23); + this.templateInsertButton.TabIndex = 2; + this.templateInsertButton.Text = "&Insert"; + this.templateInsertButton.UseVisualStyleBackColor = true; + this.templateInsertButton.Click += new System.EventHandler(this.showTemplateMenu); + // + // okButton + // + this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.okButton.Location = new System.Drawing.Point(337, 226); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(75, 23); + this.okButton.TabIndex = 13; + this.okButton.Text = "OK"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.onClickOk); + // + // cancelButton + // + this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(418, 226); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 23); + this.cancelButton.TabIndex = 14; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.onCancel); + // + // templatePreview + // + this.templatePreview.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.templatePreview.Location = new System.Drawing.Point(127, 44); - this.templatePreview.Name = "templatePreview"; - this.templatePreview.ReadOnly = true; - this.templatePreview.Size = new System.Drawing.Size(447, 20); - this.templatePreview.TabIndex = 4; - this.templatePreview.TabStop = false; - // - // previewLabel - // - this.previewLabel.AutoSize = true; - this.previewLabel.Location = new System.Drawing.Point(13, 47); - this.previewLabel.Name = "previewLabel"; - this.previewLabel.Size = new System.Drawing.Size(68, 13); - this.previewLabel.TabIndex = 3; - this.previewLabel.Text = "Text preview"; - // - // insertTemplatePlaceholderMenu - // - this.insertTemplatePlaceholderMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.templatePreview.Location = new System.Drawing.Point(119, 70); + this.templatePreview.Name = "templatePreview"; + this.templatePreview.ReadOnly = true; + this.templatePreview.Size = new System.Drawing.Size(455, 20); + this.templatePreview.TabIndex = 4; + this.templatePreview.TabStop = false; + // + // previewLabel + // + this.previewLabel.AutoSize = true; + this.previewLabel.Location = new System.Drawing.Point(13, 73); + this.previewLabel.Name = "previewLabel"; + this.previewLabel.Size = new System.Drawing.Size(68, 13); + this.previewLabel.TabIndex = 3; + this.previewLabel.Text = "Text preview"; + // + // insertTemplatePlaceholderMenu + // + this.insertTemplatePlaceholderMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { albumToolStripMenuItem, artistToolStripMenuItem, filenameToolStripMenuItem, @@ -581,148 +585,191 @@ private void InitializeComponent() this.newLineToolStripMenuItem, this.toolStripSeparator2, this.helpToolStripMenuItem}); - this.insertTemplatePlaceholderMenu.Name = "insertTemplatePlaceholderMenu"; - this.insertTemplatePlaceholderMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; - this.insertTemplatePlaceholderMenu.ShowImageMargin = false; - this.insertTemplatePlaceholderMenu.Size = new System.Drawing.Size(156, 258); - this.insertTemplatePlaceholderMenu.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.onTemplateMenuSelection); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(152, 6); - // - // ifToolStripMenuItem - // - this.ifToolStripMenuItem.Name = "ifToolStripMenuItem"; - this.ifToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - this.ifToolStripMenuItem.Text = "If"; - // - // ifElseToolStripMenuItem - // - this.ifElseToolStripMenuItem.Name = "ifElseToolStripMenuItem"; - this.ifElseToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - this.ifElseToolStripMenuItem.Text = "If else"; - // - // newLineToolStripMenuItem - // - this.newLineToolStripMenuItem.Name = "newLineToolStripMenuItem"; - this.newLineToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - this.newLineToolStripMenuItem.Text = "New line"; - // - // toolStripSeparator2 - // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(152, 6); - // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - this.helpToolStripMenuItem.Text = "Help"; - // - // explanationLabel - // - this.explanationLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.insertTemplatePlaceholderMenu.Name = "insertTemplatePlaceholderMenu"; + this.insertTemplatePlaceholderMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; + this.insertTemplatePlaceholderMenu.ShowImageMargin = false; + this.insertTemplatePlaceholderMenu.Size = new System.Drawing.Size(96, 236); + this.insertTemplatePlaceholderMenu.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.onTemplateMenuSelection); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(92, 6); + // + // ifToolStripMenuItem + // + this.ifToolStripMenuItem.Name = "ifToolStripMenuItem"; + this.ifToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + this.ifToolStripMenuItem.Text = "If"; + // + // ifElseToolStripMenuItem + // + this.ifElseToolStripMenuItem.Name = "ifElseToolStripMenuItem"; + this.ifElseToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + this.ifElseToolStripMenuItem.Text = "If else"; + // + // newLineToolStripMenuItem + // + this.newLineToolStripMenuItem.Name = "newLineToolStripMenuItem"; + this.newLineToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + this.newLineToolStripMenuItem.Text = "New line"; + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(92, 6); + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + this.helpToolStripMenuItem.Text = "Help"; + // + // explanationLabel + // + this.explanationLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.explanationLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.explanationLabel.Location = new System.Drawing.Point(22, 148); - this.explanationLabel.Name = "explanationLabel"; - this.explanationLabel.Size = new System.Drawing.Size(544, 30); - this.explanationLabel.TabIndex = 12; - this.explanationLabel.Text = "When Winamp plays a track, this plug-in will save the track information and album" + - " art to files. The format of the text can be customized with the template."; - // - // horizontalRule1 - // - this.horizontalRule1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.explanationLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.explanationLabel.Location = new System.Drawing.Point(30, 170); + this.explanationLabel.Name = "explanationLabel"; + this.explanationLabel.Size = new System.Drawing.Size(544, 49); + this.explanationLabel.TabIndex = 12; + this.explanationLabel.Text = resources.GetString("explanationLabel.Text"); + // + // horizontalRule1 + // + this.horizontalRule1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.horizontalRule1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.horizontalRule1.Location = new System.Drawing.Point(17, 136); - this.horizontalRule1.Name = "horizontalRule1"; - this.horizontalRule1.Size = new System.Drawing.Size(555, 2); - this.horizontalRule1.TabIndex = 11; - // - // applyButton - // - this.applyButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.applyButton.Location = new System.Drawing.Point(499, 196); - this.applyButton.Name = "applyButton"; - this.applyButton.Size = new System.Drawing.Size(75, 23); - this.applyButton.TabIndex = 15; - this.applyButton.Text = "&Apply"; - this.applyButton.UseVisualStyleBackColor = true; - this.applyButton.Click += new System.EventHandler(this.onClickApply); - // - // albumArtLabel - // - this.albumArtLabel.AutoSize = true; - this.albumArtLabel.Location = new System.Drawing.Point(13, 105); - this.albumArtLabel.Name = "albumArtLabel"; - this.albumArtLabel.Size = new System.Drawing.Size(92, 13); - this.albumArtLabel.TabIndex = 8; - this.albumArtLabel.Text = "Save a&lbum art as"; - // - // albumArtBrowseButton - // - this.albumArtBrowseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.albumArtBrowseButton.Location = new System.Drawing.Point(499, 100); - this.albumArtBrowseButton.Name = "albumArtBrowseButton"; - this.albumArtBrowseButton.Size = new System.Drawing.Size(75, 23); - this.albumArtBrowseButton.TabIndex = 10; - this.albumArtBrowseButton.Text = "B&rowse…"; - this.albumArtBrowseButton.UseVisualStyleBackColor = true; - this.albumArtBrowseButton.Click += new System.EventHandler(this.onAlbumArtBrowseButtonClick); - // - // albumArtFilename - // - this.albumArtFilename.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.horizontalRule1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.horizontalRule1.Location = new System.Drawing.Point(16, 155); + this.horizontalRule1.Name = "horizontalRule1"; + this.horizontalRule1.Size = new System.Drawing.Size(555, 2); + this.horizontalRule1.TabIndex = 11; + // + // applyButton + // + this.applyButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.applyButton.Location = new System.Drawing.Point(499, 226); + this.applyButton.Name = "applyButton"; + this.applyButton.Size = new System.Drawing.Size(75, 23); + this.applyButton.TabIndex = 15; + this.applyButton.Text = "&Apply"; + this.applyButton.UseVisualStyleBackColor = true; + this.applyButton.Click += new System.EventHandler(this.onClickApply); + // + // albumArtLabel + // + this.albumArtLabel.AutoSize = true; + this.albumArtLabel.Location = new System.Drawing.Point(13, 128); + this.albumArtLabel.Name = "albumArtLabel"; + this.albumArtLabel.Size = new System.Drawing.Size(92, 13); + this.albumArtLabel.TabIndex = 8; + this.albumArtLabel.Text = "Save a&lbum art as"; + // + // albumArtBrowseButton + // + this.albumArtBrowseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.albumArtBrowseButton.Location = new System.Drawing.Point(499, 123); + this.albumArtBrowseButton.Name = "albumArtBrowseButton"; + this.albumArtBrowseButton.Size = new System.Drawing.Size(75, 23); + this.albumArtBrowseButton.TabIndex = 10; + this.albumArtBrowseButton.Text = "B&rowse…"; + this.albumArtBrowseButton.UseVisualStyleBackColor = true; + this.albumArtBrowseButton.Click += new System.EventHandler(this.onAlbumArtBrowseButtonClick); + // + // albumArtFilename + // + this.albumArtFilename.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.albumArtFilename.Location = new System.Drawing.Point(127, 102); - this.albumArtFilename.Name = "albumArtFilename"; - this.albumArtFilename.Size = new System.Drawing.Size(366, 20); - this.albumArtFilename.TabIndex = 9; - this.albumArtFilename.TextChanged += new System.EventHandler(this.onFilenameChange); - // - // albumArtFilenameEditor - // - this.albumArtFilenameEditor.DefaultExt = "png"; - this.albumArtFilenameEditor.Filter = "Image files|*.jpg,*.png"; - this.albumArtFilenameEditor.Title = "Choose file to save Now Playing album art into"; - this.albumArtFilenameEditor.FileOk += new System.ComponentModel.CancelEventHandler(this.onSubmitFilename); - // - // SettingsDialog - // - this.AcceptButton = this.okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.cancelButton; - this.ClientSize = new System.Drawing.Size(586, 232); - this.Controls.Add(this.applyButton); - this.Controls.Add(this.horizontalRule1); - this.Controls.Add(this.explanationLabel); - this.Controls.Add(this.templatePreview); - this.Controls.Add(this.cancelButton); - this.Controls.Add(this.okButton); - this.Controls.Add(this.templateInsertButton); - this.Controls.Add(this.templateEditor); - this.Controls.Add(this.previewLabel); - this.Controls.Add(this.templateLabel); - this.Controls.Add(this.albumArtFilename); - this.Controls.Add(this.textFilename); - this.Controls.Add(this.albumArtBrowseButton); - this.Controls.Add(this.textBrowseButton); - this.Controls.Add(this.albumArtLabel); - this.Controls.Add(this.writeToFileLabel); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "SettingsDialog"; - this.Text = "Now Playing to File plug-in configuration"; - this.Load += new System.EventHandler(this.SettingsDialog_Load); - this.insertTemplatePlaceholderMenu.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); + this.albumArtFilename.Location = new System.Drawing.Point(119, 125); + this.albumArtFilename.Name = "albumArtFilename"; + this.albumArtFilename.Size = new System.Drawing.Size(374, 20); + this.albumArtFilename.TabIndex = 9; + this.albumArtFilename.TextChanged += new System.EventHandler(this.onFilenameChange); + // + // albumArtFilenameEditor + // + this.albumArtFilenameEditor.DefaultExt = "png"; + this.albumArtFilenameEditor.Filter = "Image files|*.jpg,*.png"; + this.albumArtFilenameEditor.Title = "Choose file to save Now Playing album art into"; + this.albumArtFilenameEditor.FileOk += new System.ComponentModel.CancelEventHandler(this.onSubmitFilename); + // + // templateSelector + // + this.templateSelector.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.templateSelector.FormattingEnabled = true; + this.templateSelector.Location = new System.Drawing.Point(119, 12); + this.templateSelector.Name = "templateSelector"; + this.templateSelector.Size = new System.Drawing.Size(374, 21); + this.templateSelector.TabIndex = 16; + this.templateSelector.SelectedIndexChanged += new System.EventHandler(this.onTemplateSelectorChanged); + // + // templateSelectorLabel + // + this.templateSelectorLabel.AutoSize = true; + this.templateSelectorLabel.Location = new System.Drawing.Point(13, 15); + this.templateSelectorLabel.Name = "templateSelectorLabel"; + this.templateSelectorLabel.Size = new System.Drawing.Size(80, 13); + this.templateSelectorLabel.TabIndex = 17; + this.templateSelectorLabel.Text = "Select template"; + // + // templateAdd + // + this.templateAdd.Location = new System.Drawing.Point(539, 10); + this.templateAdd.Name = "templateAdd"; + this.templateAdd.Size = new System.Drawing.Size(35, 23); + this.templateAdd.TabIndex = 18; + this.templateAdd.Text = "+"; + this.templateAdd.UseVisualStyleBackColor = true; + this.templateAdd.Click += new System.EventHandler(this.onTemplateAdd); + // + // templateRemove + // + this.templateRemove.Location = new System.Drawing.Point(499, 10); + this.templateRemove.Name = "templateRemove"; + this.templateRemove.Size = new System.Drawing.Size(35, 23); + this.templateRemove.TabIndex = 18; + this.templateRemove.Text = "-"; + this.templateRemove.UseVisualStyleBackColor = true; + this.templateRemove.Click += new System.EventHandler(this.onTemmplateRemove); + // + // SettingsDialog + // + this.AcceptButton = this.okButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancelButton; + this.ClientSize = new System.Drawing.Size(586, 262); + this.Controls.Add(this.templateRemove); + this.Controls.Add(this.templateAdd); + this.Controls.Add(this.templateSelectorLabel); + this.Controls.Add(this.templateSelector); + this.Controls.Add(this.applyButton); + this.Controls.Add(this.horizontalRule1); + this.Controls.Add(this.explanationLabel); + this.Controls.Add(this.templatePreview); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.okButton); + this.Controls.Add(this.templateInsertButton); + this.Controls.Add(this.templateEditor); + this.Controls.Add(this.previewLabel); + this.Controls.Add(this.templateLabel); + this.Controls.Add(this.albumArtFilename); + this.Controls.Add(this.textFilename); + this.Controls.Add(this.albumArtBrowseButton); + this.Controls.Add(this.textBrowseButton); + this.Controls.Add(this.albumArtLabel); + this.Controls.Add(this.writeToFileLabel); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "SettingsDialog"; + this.Text = "Now Playing to File plug-in configuration"; + this.Load += new System.EventHandler(this.SettingsDialog_Load); + this.insertTemplatePlaceholderMenu.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -756,5 +803,9 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem fileBasenameToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem fileBasenameWithoutExtensionToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem otherToolStripMenuItem; - } + private System.Windows.Forms.ComboBox templateSelector; + private System.Windows.Forms.Label templateSelectorLabel; + private System.Windows.Forms.Button templateAdd; + private System.Windows.Forms.Button templateRemove; + } } \ No newline at end of file diff --git a/WinampNowPlayingToFile/Presentation/SettingsDialog.cs b/WinampNowPlayingToFile/Presentation/SettingsDialog.cs index cc4db14..3bb4ce5 100644 --- a/WinampNowPlayingToFile/Presentation/SettingsDialog.cs +++ b/WinampNowPlayingToFile/Presentation/SettingsDialog.cs @@ -76,26 +76,32 @@ public SettingsDialog(ISettings settings, WinampControllerImpl winampController) } private void SettingsDialog_Load(object sender, EventArgs e) { - textFilenameEditor.InitialDirectory = Path.GetDirectoryName(settings.textFilename); - textFilenameEditor.FileName = settings.textFilename; + // Since the templateSelector holds all textTemplates let's not fire textBox events since those update the templateSelector too + templateEditor.TextChanged -= onTemplateChange; + textFilename.TextChanged -= onFilenameChange; + albumArtFilename.TextChanged -= onFilenameChange; - albumArtFilenameEditor.InitialDirectory = Path.GetDirectoryName(settings.albumArtFilename); - albumArtFilenameEditor.FileName = settings.albumArtFilename; + albumArtFilenameEditor.InitialDirectory = Path.GetDirectoryName(settings.albumArtFilename); + albumArtFilenameEditor.FileName = settings.albumArtFilename; + albumArtFilename.Text = settings.albumArtFilename; - textFilename.Text = settings.textFilename; - albumArtFilename.Text = settings.albumArtFilename; + foreach (textTemplate item in settings.textTemplates) { + templateSelector.Items.Add(item); + } + templateSelector.SelectedIndex = 0; - templateEditor.Text = settings.textTemplate; - templateEditor.Select(templateEditor.TextLength, 0); + templateEditor.TextChanged += onTemplateChange; + textFilename.TextChanged += onFilenameChange; + albumArtFilename.TextChanged += onFilenameChange; - winampController.songChanged += delegate { renderPreview(); }; - renderTextTimer.Elapsed += delegate { renderPreview(); }; + winampController.songChanged += delegate { renderPreview(templatePreview); }; + renderTextTimer.Elapsed += delegate { renderPreview(templatePreview); }; applyButton.Enabled = false; } private void onTextFileBrowseButtonClick(object sender, EventArgs e) { - onBrowseButtonClick(textFilenameEditor, textFilename); + onBrowseButtonClick(textFilenameEditor, textFilename); } private void onAlbumArtBrowseButtonClick(object sender, EventArgs e) { @@ -124,19 +130,20 @@ private void onCancel(object sender, EventArgs e) { } private void onTemplateChange(object sender, EventArgs e) { - renderPreview(); - onFormDirty(); + renderPreview(sender); + templateSelector.Items[templateSelector.SelectedIndex] = new textTemplate(textFilename.Text, templateEditor.Text); + onFormDirty(); } - private void renderPreview() { + private void renderPreview(object sender) { Song previewSong = isSongPlaying() ? winampController.currentSong : EXAMPLE_SONG; try { - templatePreview.Text = compileTemplate().Render(previewSong); + templatePreview.Text = compileTemplate().Render(previewSong); } catch (KeyNotFoundException e) { - templatePreview.Text = $"Template key not found: {e.Message}"; + templatePreview.Text = $"Template key not found: {e.Message}"; } catch (FormatException e) { - templatePreview.Text = $"Template format error: {e.Message}"; + templatePreview.Text = $"Template format error: {e.Message}"; } } @@ -156,8 +163,9 @@ private Generator compileTemplate() { return generator; } + private void showTemplateMenu(object sender, EventArgs e) { - insertTemplatePlaceholderMenu.Show(templateInsertButton, new Point(0, templateInsertButton.Height)); + insertTemplatePlaceholderMenu.Show(templateInsertButton, new Point(0, templateInsertButton.Height)); } private void onTemplateMenuSelection(object sender, ToolStripItemClickedEventArgs e) { @@ -177,7 +185,7 @@ private void onTemplateMenuSelection(object sender, ToolStripItemClickedEventArg textToInsert = e.ClickedItem.Text; } - string placeholder = $$$"""{{{{{textToInsert}}}}}"""; + string placeholder = $$$"""{{{{{textToInsert}}}}}"""; string originalTemplate = templateEditor.Text; int selectionStart = templateEditor.SelectionStart; int selectionEnd = selectionStart + templateEditor.SelectionLength; @@ -187,10 +195,10 @@ private void onTemplateMenuSelection(object sender, ToolStripItemClickedEventArg newTemplate.Append(placeholder); newTemplate.Append(originalTemplate.Substring(selectionEnd)); - templateEditor.Text = newTemplate.ToString(); - templateEditor.SelectionLength = 0; - templateEditor.SelectionStart = selectionStart + placeholder.Length; - templateEditor.Focus(); + templateEditor.Text = newTemplate.ToString(); + templateEditor.SelectionLength = 0; + templateEditor.SelectionStart = selectionStart + placeholder.Length; + templateEditor.Focus(); } } @@ -215,9 +223,10 @@ private void save() { try { compileTemplate().Render(EXAMPLE_SONG); - settings.textFilename = textFilename.Text; - settings.albumArtFilename = albumArtFilename.Text; - settings.textTemplate = templateEditor.Text; + // Actually the templateSelector will hold all of the templates now + settings.textTemplates = templateSelector.Items.Cast().ToList(); + + settings.albumArtFilename = albumArtFilename.Text; settings.save(); applyButton.Enabled = false; @@ -236,7 +245,8 @@ private void onSubmitFilename(object sender, CancelEventArgs e) { } private void onFilenameChange(object sender, EventArgs e) { - onFormDirty(); + templateSelector.Items[templateSelector.SelectedIndex] = new textTemplate(textFilename.Text, templateEditor.Text); + onFormDirty(); } protected override void OnClosed(EventArgs e) { @@ -244,4 +254,39 @@ protected override void OnClosed(EventArgs e) { base.OnClosed(e); } + private void onTemplateSelectorChanged(object sender, EventArgs e) { + bool applyButtonState = applyButton.Enabled; + + textTemplate selectedTemplate = (textTemplate)templateSelector.SelectedItem; + textFilenameEditor.InitialDirectory = Path.GetDirectoryName(selectedTemplate.fileName); + textFilenameEditor.FileName = selectedTemplate.fileName; + + textFilename.Text = selectedTemplate.fileName; + + templateEditor.Text = selectedTemplate.text; + + applyButton.Enabled = applyButtonState; // Restore dirty state + } + + private void onTemplateAdd(object sender, EventArgs e) { + textTemplate newTemplate = settings.getDefault(); // Add an index to the new template's file name + FileInfo newTemplatePath = new FileInfo(newTemplate.fileName); + string newTemplateFileName = Path.Combine( + newTemplatePath.DirectoryName, + $"{Path.GetFileNameWithoutExtension(newTemplatePath.FullName)}{(settings.textTemplates.Count+1)}{newTemplatePath.Extension}" + ); + newTemplate.fileName = newTemplateFileName; + settings.textTemplates.Add(newTemplate); + + templateSelector.Items.Add(settings.textTemplates.Last()); + templateSelector.SelectedIndex = templateSelector.Items.Count - 1; + onFormDirty(); + } + + private void onTemmplateRemove(object sender, EventArgs e) { + settings.textTemplates.Remove((textTemplate)templateSelector.SelectedItem); + templateSelector.Items.Remove(templateSelector.SelectedItem); + templateSelector.SelectedIndex = templateSelector.Items.Count - 1; + onFormDirty(); + } } \ No newline at end of file diff --git a/WinampNowPlayingToFile/Presentation/SettingsDialog.resx b/WinampNowPlayingToFile/Presentation/SettingsDialog.resx index b58ce05..a31d79b 100644 --- a/WinampNowPlayingToFile/Presentation/SettingsDialog.resx +++ b/WinampNowPlayingToFile/Presentation/SettingsDialog.resx @@ -234,6 +234,9 @@ 161, 17 + + When Winamp plays a track, this plug-in will save the track information and album art to files. The format of the text can be customized with templates. Create more text files with different templates by adding more with the plus button. Note: All templates will be saved at once upon pressing OK or Apply. + 374, 21 diff --git a/WinampNowPlayingToFile/Settings/BaseSettings.cs b/WinampNowPlayingToFile/Settings/BaseSettings.cs index 84702e5..246610b 100644 --- a/WinampNowPlayingToFile/Settings/BaseSettings.cs +++ b/WinampNowPlayingToFile/Settings/BaseSettings.cs @@ -1,27 +1,39 @@ #nullable enable using System; +using System.Collections.Generic; + +using TagLib.Riff; + +using WinampNowPlayingToFile.Facade; namespace WinampNowPlayingToFile.Settings; public abstract class BaseSettings: ISettings { - public string textFilename { get; set; } = null!; public string albumArtFilename { get; set; } = null!; - public string textTemplate { get; set; } = null!; + public List textTemplates { get; set; } = null!; - public event EventHandler? settingsUpdated; + public event EventHandler? settingsUpdated; public abstract void load(); public virtual void save() { } public ISettings loadDefaults() { - textFilename = Environment.ExpandEnvironmentVariables(@"%TEMP%\winamp_now_playing.txt"); + textTemplates = new List() { + getDefault() + }; albumArtFilename = Environment.ExpandEnvironmentVariables(@"%TEMP%\winamp_now_playing.png"); - textTemplate = "{{#if Artist}}{{Artist}} \u2013 {{/if}}{{Title}}{{#if Album}} \u2013 {{Album}}{{/if}}"; return this; } + public textTemplate getDefault() { + return new textTemplate( + fileName: Environment.ExpandEnvironmentVariables(@"%TEMP%\winamp_now_playing.txt"), + text: "{{#if Artist}}{{Artist}} \u2013 {{/if}}{{Title}}{{#if Album}} \u2013 {{Album}}{{/if}}" + ); + } + protected void onSettingsUpdated() { settingsUpdated?.Invoke(this, EventArgs.Empty); } diff --git a/WinampNowPlayingToFile/Settings/ISettings.cs b/WinampNowPlayingToFile/Settings/ISettings.cs index 096772d..8fc2041 100644 --- a/WinampNowPlayingToFile/Settings/ISettings.cs +++ b/WinampNowPlayingToFile/Settings/ISettings.cs @@ -1,17 +1,21 @@ using System; +using System.Collections.Generic; -namespace WinampNowPlayingToFile.Settings; +using WinampNowPlayingToFile.Facade; -public interface ISettings { +namespace WinampNowPlayingToFile.Settings; + +public partial interface ISettings { - string textFilename { get; set; } string albumArtFilename { get; set; } - string textTemplate { get; set; } + + abstract List textTemplates { get; set; } event EventHandler settingsUpdated; void load(); ISettings loadDefaults(); + textTemplate getDefault(); void save(); } \ No newline at end of file diff --git a/WinampNowPlayingToFile/Settings/RegistrySettings.cs b/WinampNowPlayingToFile/Settings/RegistrySettings.cs index 9587f5e..f7c79f6 100644 --- a/WinampNowPlayingToFile/Settings/RegistrySettings.cs +++ b/WinampNowPlayingToFile/Settings/RegistrySettings.cs @@ -1,7 +1,12 @@ #nullable enable +using System.Linq; +using System.Windows.Forms; + using Microsoft.Win32; +using WinampNowPlayingToFile.Facade; + namespace WinampNowPlayingToFile.Settings; public class RegistrySettings: BaseSettings { @@ -13,20 +18,32 @@ public override void load() { using RegistryKey? key = Registry.CurrentUser.OpenSubKey(keyPath); if (key != null) { - textFilename = key.GetValue(nameof(textFilename)) as string ?? textFilename; - albumArtFilename = key.GetValue(nameof(albumArtFilename)) as string ?? albumArtFilename; - textTemplate = key.GetValue(nameof(textTemplate)) as string ?? textTemplate; + int savedTemplateCount = key.GetValueNames().Count(x => x.StartsWith($"{nameof(textTemplate.fileName)}")); + if (savedTemplateCount > 0) { + textTemplates.Clear(); + for (int i = 0; i < savedTemplateCount; i++) { + textTemplates.Add(new textTemplate( + fileName: key.GetValue($"{nameof(textTemplate.fileName)}{i}") as string, + text: key.GetValue($"{nameof(textTemplate.text)}{i}") as string + )); + } + albumArtFilename = key.GetValue(nameof(albumArtFilename)) as string ?? albumArtFilename; + } } - } public override void save() { base.save(); + Registry.CurrentUser.DeleteSubKey(keyPath); // Actually remove text templates removed in settings using RegistryKey? key = Registry.CurrentUser.CreateSubKey(keyPath); if (key != null) { - key.SetValue(nameof(textFilename), textFilename); - key.SetValue(nameof(albumArtFilename), albumArtFilename); - key.SetValue(nameof(textTemplate), textTemplate); + for (int i = 0; i < textTemplates.Count; i++) { + textTemplate template = textTemplates[i]; + key.SetValue($"{nameof(template.fileName)}{i}", template.fileName); + key.SetValue($"{nameof(template.text)}{i}", template.text); + } + key.SetValue(nameof(albumArtFilename), albumArtFilename); + onSettingsUpdated(); } diff --git a/WinampNowPlayingToFile/WinampNowPlayingToFile.csproj b/WinampNowPlayingToFile/WinampNowPlayingToFile.csproj index 879b0d7..b680828 100644 --- a/WinampNowPlayingToFile/WinampNowPlayingToFile.csproj +++ b/WinampNowPlayingToFile/WinampNowPlayingToFile.csproj @@ -78,6 +78,7 @@ +