Пример #1
0
 /// <summary>
 /// NoteBubble Constructor.
 /// Creates a new NoteBubble object and its Note with its alteration
 /// </summary>
 /// <param name="sharp">sharp (#)</param>
 /// <param name="flat">flat (b)</param>
 public NoteBubble(bool sharp, bool flat)
 {
     Note = new Note(NoteValue.alteration);
     Note.Flat = flat;
     Note.Sharp = sharp;
     Id = GlobalVariables.idNoteBubble++;
 }
Пример #2
0
 /// <summary>
 /// Constructor by copie.
 /// </summary>
 /// <param name="note">the Note</param>
 public Note(Note note)
 {
     Octave = note.Octave;
     Duration = note.Duration;
     Pitch = note.Pitch;
     Sharp = note.Sharp;
     Flat = note.Flat;
     Position = note.Position;
 }
Пример #3
0
 /// <summary>
 /// NoteBubble Constructor.
 /// Creates a new NoteBubble object and its Note.
 /// </summary>
 /// <param name="note">The note</param>
 public NoteBubble(Note note)
 {
     Note = note;
     Id = GlobalVariables.idNoteBubble++;
 }
Пример #4
0
 /// <summary>
 /// NoteBubble Constructor.
 /// Creates a new NoteBubble object and its Note.
 /// </summary>
 /// <param name="noteValue">The NoteValue needed to create a Note</param>
 public NoteBubble(NoteValue noteValue)
 {
     Note = new Note(1, noteValue, "do", -1);
     Id = GlobalVariables.idNoteBubble++;
 }
Пример #5
0
 /// <summary>
 /// Plays the given note with the instrument.
 /// </summary>
 /// <param name="n">The note to play</param>
 public void PlayNote(Note n)
 {
     Instrument tmp = new Instrument(Name);
     Thread t = new Thread(tmp.ActionPlay);
     t.Start(n);
 }
Пример #6
0
 /// <summary>
 /// Return true if two notes are equals
 /// Don't mind about duration
 /// </summary>
 /// <param name="n"></param>
 /// <returns></returns>
 public bool equals(Note n)
 {
     return ((Octave == n.Octave) && (Position == n.Position) && (Pitch == n.Pitch));
 }
Пример #7
0
 /// <summary>
 /// Remove the note from the list Notes
 /// </summary>
 /// <param name="note">The note to remove</param>
 public void RemoveNote(Note note)
 {
     Notes.Remove(note);
 }
Пример #8
0
        /// <summary>
        /// Adds a Note on the stave at a defined position.
        /// </summary>
        /// <param name="note">The note to be added</param>
        /// <param name="position">The Note position</param>
        public void AddNote(Note note, int position)
        {
            note.Position = position;
            if (!Notes.Contains(note))
            {
                int i = 0;
                for (i=0; (i < Notes.Count && Notes[i].Position < position); i++);

                Notes.Insert(i, note);
                MaxPosition = Math.Max(MaxPosition, note.Position);
            }
        }