Beispiel #1
0
        static void musicProgressBar(float percentagePlayed, string musicData, int x, int y)
        {
            AsciiArt asciiArt = new AsciiArt();
            //int barWidth = Math.Abs(Console.WindowWidth - 53);
            int    barWidth = 65;
            string progress = asciiArt.ProgressBar(barWidth, percentagePlayed);

            WriteInRegion(x, y, "\n" + "│\n" + "└─ \n", ConsoleColor.Red);
            WriteInRegion(x, y, musicData, ConsoleColor.Red);
            WriteInRegion(x + 2, y + 1, new string('─', barWidth + 1) + "┤", ConsoleColor.Gray);
            WriteInRegion(x + 2, y + 1, progress, ConsoleColor.Red);

            string percentageProgressed = Convert.ToInt16(percentagePlayed * 100) + "% progressed ";

            if (percentagePlayed * 100 <= 9 && percentagePlayed >= 0)
            {
                percentageProgressed = "0" + percentageProgressed;
            }
            WriteInRegion(x + 4, y + 2, percentageProgressed, ConsoleColor.Red);
            Thread.Sleep(250);
        }