Beispiel #1
0
 private void PlayNote(BaloonModel baloon)
 {
     noteTimer.Stop();
     if (currentNote != null)
     {
         MidiPlayer.Play(new NoteOff(0, 1, currentNote, 127));
     }
     currentNote = baloon.Note;
     MidiPlayer.Play(new NoteOn(0, 1, currentNote, 127));
     noteTimer.Start();
 }
Beispiel #2
0
        public BaloonModel NewBaloon()
        {
            int         maxDim = (int)Math.Max(CanvasWidth, CanvasHeight);
            int         radius = 10;
            BaloonModel baloon = new BaloonModel
            {
                Radius     = radius,
                MaxRadius  = random.Next(maxDim / 2) + 100,
                Center     = new Point(random.Next((int)CanvasWidth - radius * 2) + radius, random.Next((int)CanvasHeight - radius * 2) + radius),
                Color      = new SolidColorBrush(randomColor.SelectedNext()),
                TwineColor = new SolidColorBrush(randomColor.SelectedNext())
            };

            PlayNote(baloon);
            return(baloon);
        }
Beispiel #3
0
 internal void Release(BaloonModel baloon)
 {
     baloon.Release();
     PlayNote(baloon);
 }
Beispiel #4
0
 internal void Blow(BaloonModel baloon)
 {
     baloon.Blow();
     PlayNote(baloon);
 }