Fix "Nobody" and "Nothing" being reversed in Discord RPC

This commit is contained in:
Royce551 2020-05-07 16:42:04 -05:00
parent 25e27e8158
commit 6a7f37fbf0
4 changed files with 55 additions and 9 deletions

View file

@ -16,11 +16,11 @@ namespace FRESHMusicPlayer.Forms
public partial class TagEditor : Form
{
public string[] filePaths;
public List<string> filePaths = new List<string>();
public Image albumArt;
public List<(Image coverArt, int width, int height, string format, string type)> coverArt = new List<(Image coverArt, int width, int height, string format, string type)>();
private List<string> FilePathsToSave = new List<string>();
public TagEditor(string[] filePaths)
public TagEditor(List<string> filePaths)
{
InitializeComponent();
this.filePaths = filePaths;
@ -62,7 +62,7 @@ namespace FRESHMusicPlayer.Forms
}
Editing_Label.Text = $"Editing {string.Join(", ", filePaths)}";
}
public void SaveChanges(string[] filePaths)
public void SaveChanges(List<string> filePaths)
{
foreach (string path in filePaths)
{
@ -85,7 +85,7 @@ namespace FRESHMusicPlayer.Forms
{
if (path == Player.filePath) break;
}
SaveChanges(FilePathsToSave.ToArray());
SaveChanges(FilePathsToSave);
FilePathsToSave.Clear();
if (!Visible) Close();
}

View file

@ -237,7 +237,7 @@ namespace FRESHMusicPlayer
paused = true;
if (Properties.Settings.Default.General_DiscordIntegration)
{
UpdateRPC("pause", "Nothing", "nobody");
UpdateRPC("pause", "Nobody", "Idle");
}
}// Pauses the music without completely disposing it
/// <summary>

View file

@ -154,6 +154,9 @@
this.progressTimer = new System.Windows.Forms.Timer(this.components);
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.VolumeBarTimer = new System.Windows.Forms.Timer(this.components);
this.tagEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.editSelectedInSongsTabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuBar.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage2.SuspendLayout();
@ -1430,9 +1433,10 @@
this.toolStripSeparator1,
this.queuemanagementMenuItem,
this.miniplayerMenuItem,
this.trackInfoToolStripMenuItem});
this.trackInfoToolStripMenuItem,
this.tagEditorToolStripMenuItem});
this.infobuttonContextMenu.Name = "infobuttonContextMenu";
this.infobuttonContextMenu.Size = new System.Drawing.Size(184, 164);
this.infobuttonContextMenu.Size = new System.Drawing.Size(184, 186);
//
// previousTrackToolStripMenuItem
//
@ -1549,6 +1553,29 @@
//
this.VolumeBarTimer.Tick += new System.EventHandler(this.VolumeBarTimer_Tick);
//
// tagEditorToolStripMenuItem
//
this.tagEditorToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.editToolStripMenuItem1,
this.editSelectedInSongsTabToolStripMenuItem});
this.tagEditorToolStripMenuItem.Name = "tagEditorToolStripMenuItem";
this.tagEditorToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
this.tagEditorToolStripMenuItem.Text = "Tag Editor";
//
// editToolStripMenuItem1
//
this.editToolStripMenuItem1.Name = "editToolStripMenuItem1";
this.editToolStripMenuItem1.Size = new System.Drawing.Size(218, 22);
this.editToolStripMenuItem1.Text = "Edit Currently Playing Track";
this.editToolStripMenuItem1.Click += new System.EventHandler(this.editToolStripMenuItem1_Click);
//
// editSelectedInSongsTabToolStripMenuItem
//
this.editSelectedInSongsTabToolStripMenuItem.Name = "editSelectedInSongsTabToolStripMenuItem";
this.editSelectedInSongsTabToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
this.editSelectedInSongsTabToolStripMenuItem.Text = "Edit Selected (In Songs Tab)";
this.editSelectedInSongsTabToolStripMenuItem.Click += new System.EventHandler(this.editSelectedInSongsTabToolStripMenuItem_Click);
//
// UserInterface
//
this.AllowDrop = true;
@ -1752,5 +1779,8 @@
private System.Windows.Forms.ToolStripMenuItem repeatOnceToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem shuffleToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem tagEditorToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem editSelectedInSongsTabToolStripMenuItem;
}
}

View file

@ -613,8 +613,7 @@ namespace FRESHMusicPlayer
StopButton();
return true;
case Keys.P:
/**/
TagEditor tagEditor = new TagEditor(new string[]{ Player.filePath });
TagEditor tagEditor = new TagEditor(new List<string> { Player.filePath });
tagEditor.Show();
return true;
case Keys.O:
@ -737,6 +736,23 @@ namespace FRESHMusicPlayer
Player.Shuffle = false;
}
}
private void editToolStripMenuItem1_Click(object sender, EventArgs e)
{
TagEditor tagEditor = new TagEditor(new List<string> { Player.filePath });
tagEditor.Show();
}
private void editSelectedInSongsTabToolStripMenuItem_Click(object sender, EventArgs e)
{
List<string> x = new List<string>();
foreach (int y in songsListBox.SelectedIndices)
{
x.Add(SongLibrary[y]);
}
TagEditor tagEditor = new TagEditor(x);
tagEditor.Show();
}
}
}