private static void TestPlayer2(string file)
        {
            var lst = file.IsDirectory() ? Directory.GetFiles(file, "*", SearchOption.AllDirectories).ToList() : new List <string> {
                file
            };

            var player = new XMediaPlayer(lst);

            player.Play();
            var res = "";

            while (res != "x")
            {
                res = Console.ReadLine();
                float tempo = player.CurrentTempo();
                if (float.TryParse(res, out tempo))
                {
                    player.SetTempo(tempo);
                }
                if (res == "n")
                {
                    player.Next();
                }
                if (res == "p")
                {
                    player.Previous();
                }
                if (res == "s")
                {
                    player.Shuffle();
                }
            }
            player.Stop();
        }
Exemple #2
0
        private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            int index = this.listBox1.IndexFromPoint(e.Location);

            if (index != System.Windows.Forms.ListBox.NoMatches)
            {
                var selectedItem = (listBox1.Items[index] as ListItem).Value;
                player.currentIndex = index;
                player.Play();
            }
        }
 private void Play()
 {
     ClearGridSelection();
     player.Play();
     SetGridSelection();
 }