示例#1
0
        static void Main(string[] args)
        {
            pm = new PlayerModule();
            if (args.Length <= 0)
            {
                Console.WriteLine("Usage: LRCPlayer music");
                Console.WriteLine("F**k");
                return;
            }
            if (!File.Exists(args[0]))
            {
                Console.WriteLine("Music File not found. F**k you.");
                return;
            }
            Regex rgx     = new Regex(@"\.[a-zA-Z0-9_]+$");
            var   lrcPath = rgx.Replace(args[0], ".lrc");

            if (!File.Exists(lrcPath))
            {
                Console.WriteLine("LRC not found");
            }
            else
            {
                pm.Open(args[0]);
                var _lyrics = LRCParser.ParseLyricInstant(lrcPath);
                int pos     = 0;
                pm.Play();
                while (pos < _lyrics.Count)
                {
                    if (pm.Position > _lyrics[pos].Time)
                    {
                        Console.WriteLine(_lyrics[pos].Time.ToString(@"mm\:ss\,ff") + " " + _lyrics[pos].ToString());
                        pos++;
                    }
                }
            }
        }