Exemplo n.º 1
0
        public void SpotAnimateAllPositionsOfANote(Note note)
        {
            List <ObjectAnimator> animationsList = new List <ObjectAnimator>();

            foreach (Position position in note.Positions)
            {
                //Create a new visual representation of that note.
                NoteRepresentation noteRep = new NoteRepresentation(_activity, note);
                //Set name on note.
                noteRep.SetText(note.Name);
                //Create the note's animation, and add that animation to the animations array.
                animationsList.Add(noteRep.CreateNoteAnimation_FadeOnly(position));
            }
            AnimatorSet animatorSet = new AnimatorSet();

            animatorSet.PlayTogether(animationsList.ToArray());
            animatorSet.Start();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Converts a sequence to an array of animations.
        /// </summary>
        /// <param name="sequence">The sequence from which to gather animations information.</param>
        /// <returns>Returns a series of animations.</returns>
        protected ObjectAnimator[] PrepareNotesAnimations(Sequence sequence)
        {
            ObjectAnimator[] animations = new ObjectAnimator[sequence.Length];

            for (int i = 0; i < sequence.Length; i++)
            {
                //Get note from sequence.
                Note note = sequence[i];
                //Create a new visual representation of that note.
                NoteRepresentation noteRep = new NoteRepresentation(_activity, note);
                //Create the note's animation, and add that animation to the animations array.
                animations[i] = noteRep.CreateNoteAnimation();
                //Sign up for sound input window events.
                noteRep.OnNoteArraival += NotesPlayer_OnNoteArraival;
                noteRep.OnNoteGone     += NotesPlayer_OnNoteGone;
            }

            return(animations);
        }
 public void SpotAnimateAllPositionsOfANote(Note note)
 {
     List<ObjectAnimator> animationsList = new List<ObjectAnimator>();
     foreach (Position position in note.Positions)
     {
         //Create a new visual representation of that note.
         NoteRepresentation noteRep = new NoteRepresentation(_activity, note);
         //Set name on note.
         noteRep.SetText(note.Name);
         //Create the note's animation, and add that animation to the animations array.
         animationsList.Add(noteRep.CreateNoteAnimation_FadeOnly(position));
     }
     AnimatorSet animatorSet = new AnimatorSet();
     animatorSet.PlayTogether(animationsList.ToArray());
     animatorSet.Start();
 }
        private void NotesPlayer_OnNoteArraival(object sender, NoteRepresentation.OnNoteArraivalArgs songNote)
		{
			bool isOnPoint = CompareNotes(CurrentlyPlayedFrequency, songNote.Frequency);

			if (isOnPoint) 
			{
				//Change circle to a smiley face.
				((NoteRepresentation)sender).ChangeToSmileyFace(true);
			}
		}
        /// <summary>
        /// Converts a sequence to an array of animations.
        /// </summary>
        /// <param name="sequence">The sequence from which to gather animations information.</param>
        /// <returns>Returns a series of animations.</returns>
        protected ObjectAnimator[] PrepareNotesAnimations(Sequence sequence)
        {
            ObjectAnimator[] animations = new ObjectAnimator[sequence.Length];

            for (int i = 0; i < sequence.Length; i++)
            {
                //Get note from sequence.
                Note note = sequence[i];
                //Create a new visual representation of that note.
                NoteRepresentation noteRep = new NoteRepresentation(_activity, note);
                //Create the note's animation, and add that animation to the animations array.
                animations[i] = noteRep.CreateNoteAnimation();
				//Sign up for sound input window events.
				noteRep.OnNoteArraival += NotesPlayer_OnNoteArraival;
				noteRep.OnNoteGone += NotesPlayer_OnNoteGone;
            }

            return animations;
        }