Пример #1
0
 public bool validateAction()
 {
     if (measure == null || chords == null || chords.Count <= 1 || new_lengths == null || !new_lengths.Any() || type == TupletType.None)
     {
         return(false);
     }
     if (chords.Count != new_lengths.Count)
     {
         return(false);
     }
     foreach (Chord chord in chords)
     {
         if (!measure.ModelCollection.Contains(chord))
         {
             return(false);
         }
     }
     if (!canCreateTuple())
     {
         return(false);
     }
     if (measure.getSpaceTaken() - getPreivousLength() + getNextLength() > measure.getTotalSpace())
     {
         return(false);
     }
     return(true);
 }
Пример #2
0
 public bool validateAction()
 {
     if (chord is null || first_measure is null || second_measure is null || position == null)
     {
         return(false);
     }
     if (first_measure.Equals(second_measure))
     {
         if (chord.Position.Index == position)
         {
             return(false);
         }
         if (position > second_measure.getLastChordPosition())
         {
             return(false);
         }
     }
     else
     {
         if (position > second_measure.getLastChordPosition() + 1)
         {
             return(false);
         }
         if (second_measure.getSpaceTaken() + chord.Length.getLength() > second_measure.getTotalSpace())
         {
             return(false);
         }
     }
     return(true);
 }
Пример #3
0
        public bool validateAction()
        {
            if (first_measure == null || second_measure == null || first_chord == null || second_chord == null || note == null || note_string == null)
            {
                return(false);
            }
            if (!first_measure.ModelCollection.Contains(first_chord))
            {
                return(false);
            }
            if (!first_chord.ModelCollection.Contains(note))
            {
                return(false);
            }
            if (second_chord.Position.Index < 0 || second_chord.Position.Index > second_measure.getLastChordPosition())
            {
                return(false);
            }
            if (second_measure.getSpaceTaken() + second_chord.Length.getLength() > second_measure.getTotalSpace())
            {
                return(false);
            }

            return(true);
        }
Пример #4
0
        public int getSpaceTaken()
        {
            int curr_length = measure.getSpaceTaken();

            foreach (Chord chord in chords)
            {
                curr_length += length.getLength() - chord.Length.getLength();
            }
            return(curr_length);
        }
Пример #5
0
        public int getNewSpaceTaken()
        {
            int length = dest_measure.getSpaceTaken();

            foreach (Chord chord in chords)
            {
                length += chord.Length.getLength();
            }
            return(length);
        }
Пример #6
0
 public bool validateAction()
 {
     if (part == null || measure == null || num_beats == null || beat_type == null)
     {
         return(false);
     }
     if (!part.ModelCollection.Contains(measure))
     {
         return(false);
     }
     if (!TimeSignature.canSetTimeSignature((int)num_beats, (NoteLength)beat_type))
     {
         return(false);
     }
     return(measure.getSpaceTaken() <= ((int)num_beats * (int)beat_type));
 }
Пример #7
0
 public bool validateAction()
 {
     if (chord is null || measure is null)
     {
         return(false);
     }
     if (chord.Position.Index < 0 || chord.Position.Index > measure.getLastChordPosition() + 1)
     {
         return(false);
     }
     if (measure.getSpaceTaken() + chord.Length.getLength() > measure.getTotalSpace())
     {
         return(false);
     }
     return(true);
 }
Пример #8
0
        public bool validateAction()
        {
            if (measure is null || chord is null || length is null)
            {
                return(false);
            }
            if (length is TupleLength && !validateTuple(length as TupleLength))
            {
                return(false);
            }

            if (measure.getSpaceTaken() - chord.Length.getLength() + length.getLength() > measure.getTotalSpace())
            {
                return(false);
            }
            return(true);
        }