static void Main() { while (true) { Console.Clear(); Console.WriteLine("MP3 Player"); Console.WriteLine("Press:"); Console.WriteLine("Space - Pause/Start"); Console.WriteLine("Arrows Up/Down - volume Increase/Decrease"); Console.WriteLine("Esc - stop"); Mp3Player game = new Mp3Player(); while (true) { Console.WriteLine("Enter the full path to song:"); string path = Console.ReadLine(); if (!game.Path(path)) { Console.WriteLine("Wrong path! Enter again"); continue; } else { break; } } bool flag = true; while (flag) { ConsoleKey key = Console.ReadKey(true).Key; switch (key) { case ConsoleKey.Escape: game.Stop(); flag = false; break; case ConsoleKey.Spacebar: game.Pause(); break; case ConsoleKey.UpArrow: game.Volume += 10; break; case ConsoleKey.DownArrow: game.Volume -= 10; break; } } } }
public PlayerMp3() { InitializeComponent(); _mp3Player = new Mp3Player(); _mp3PlayList = new PlayList(); songTimer = new Timer(); songTimer.Tick += ChangeSongLength; FolderSong.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic); _resList = Properties.Resources.ResourceManager.GetResourceSet(CultureInfo.CurrentCulture, false, true) .Cast <DictionaryEntry>() .Where(x => x.Value.GetType() == typeof(Bitmap)) .Select(x => new ImageDTO { Name = x.Key.ToString(), Image = (Image)x.Value }) .ToList(); }
public ControlWindow(Mp3Player player) { InitializeComponent(); _player = player; ProgressBars(); }