Exemplo n.º 1
0
 public Note(NoteName name, Position position, double delay, double duration)
     : this(name)
 {
     //_name = name;
     //_hertz = hertz;
     _position = position;
     _delay = delay;
     _duration = duration;
 }
Exemplo n.º 2
0
 public Note(NoteName name, NoteName alias, Hz hertz, Position[] positions)
     : this(name, hertz, positions)
 {
     _alias = alias;
 }
Exemplo n.º 3
0
 public Note this[Position requestedPosition]
 {
     get
     {
         foreach (Note note in _notes)
         {
             foreach (Position position in note.Positions)
             {
                 if (position == requestedPosition)
                     return note;
             }
         }
         //No matching position has been found.
         return null;
     }
 }
Exemplo n.º 4
0
 public Note(NoteName name, Hz hertz, Position[] positions)
 {
     _name = name;
     _hertz = hertz;
     _positions = positions;
 }
        public ObjectAnimator CreateNoteAnimation_FadeOnly(Position position)
        {
            const float TRANSPARENT = 0;
            const long DEFAULT_DURATION = 1000;
            DisplayMetrics screenDimensions = Generic.GetScreenDimentions(_currentActivity);
            //TODO: Add string positions as well.

            FretMetrics fretMetrics = GetFretMetrics(position.Fret);
            int Y_dest = fretMetrics.GetVerticalCenter() - _noteCircle.Height / 2;
            int X_dest = fretMetrics.GetHorizontalCenter() - _noteCircle.Width / 2;
            //Set initial location.
            _noteCircle.SetX(X_dest);
            _noteCircle.SetY(Y_dest);

            ObjectAnimator objAnimFadeOut = ObjectAnimator.OfFloat(_noteCircle, "Alpha", TRANSPARENT);
            objAnimFadeOut.SetDuration(DEFAULT_DURATION);

            objAnimFadeOut.AnimationEnd += (object sender, EventArgs e) =>
            {
                OnNoteGone(this, new EventArgs());
            };

            return objAnimFadeOut;
        }