private void ProcessCmdLine() { if (args.Length < 2) { return; } if (new System.IO.FileInfo(args[1]).Extension == ".xspf") { List <PlaylistItem> loaded = XSPF.Load(args[1]); if (loaded.Count != 0) { foreach (PlaylistItem p in loaded) { AddToPlaylist(p); } } } else { for (int i = 1; i < args.Length; i++) //skip the first argument, it's just the exe { AddToPlaylist(XSPF.GetTags(args[i])); } } Play(); }
private void GetTags() { PlaylistItem item = XSPF.GetTags(list[activeTrack].Path); list[activeTrack].ListViewItem.SubItems[1].Text = item.Title; list[activeTrack].ListViewItem.SubItems[2].Text = item.Artist; list[activeTrack].ListViewItem.SubItems[3].Text = item.Album; lblTag.Text = item.Artist.Replace("&", "&&") + " - " + item.Title.Replace("&", "&&"); //escape ampersands (no keyboard shortcuts) Text = "Player | " + item.Artist + " - " + item.Title; }
private void lstPlaylist_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, false); foreach (string file in files) { AddToPlaylist(XSPF.GetTags(file)); } } }
private void addFilesToolStripMenuItem_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog() != DialogResult.OK) { return; } foreach (string f in openFileDialog.FileNames) { AddToPlaylist(XSPF.GetTags(f)); } if (stopped) { Play(); } }
private void addUrlToolStripMenuItem_Click(object sender, EventArgs e) { AddUrlForm form = new AddUrlForm(); if (form.ShowDialog() != DialogResult.OK) { return; } if (!stopped) { Stop(); } AddToPlaylist(XSPF.GetTags(form.path)); if (stopped) { Play(); } }