Beispiel #1
0
        public void jouer()
        {
            foreach (INote note in notes)
            {
                float pause = style.tempo();
                Console.Out.WriteLine(pause);
                System.Threading.Thread.Sleep((int)(pause));


                note.jouer();
            }
        }
Beispiel #2
0
        public void jouer()
        {
            Console.WriteLine("On ne dirait pas mais ça beep à la fréquence de " + frequency + " c'est une " + duration + "de durée " + (int)duration + " secondes");
            //System.Threading.Thread.Sleep((int)(Duration * style.tempo()));

            Task.Factory.StartNew(() =>
            {
                Enum test         = Enum.Parse(typeof(T), frequency.ToString()) as Enum;
                int realFrequency = Convert.ToInt32(test); // x is the integer value of enum


                Console.Beep(realFrequency + 37, (int)((int)duration / 100.0 * (int)style.tempo()));
            }
                                  );
        }