Beispiel #1
0
 public void Validate(UProject project, UTrack track, UVoicePart part, UNote note)
 {
     Error = note.Error;
     ValidateDuration(note);
     ValidateOto(track, note);
     ValidateOverlap(project, note);
     ValidateEnvelope(project, note);
 }
Beispiel #2
0
 public void AfterLoad(UProject project, UTrack track, UVoicePart part)
 {
     foreach (var exp in noteExpressions)
     {
         exp.descriptor = project.expressions[exp.abbr];
     }
     foreach (var exp in phonemeExpressions)
     {
         exp.descriptor = project.expressions[exp.abbr];
     }
 }
Beispiel #3
0
 public void BeforeSave(UProject project, UTrack track, UVoicePart part)
 {
     noteExpressions.ForEach(exp => exp.index = null);
     noteExpressions = noteExpressions
                       .OrderBy(exp => exp.abbr)
                       .ToList();
     phonemeExpressions = phonemeExpressions
                          .OrderBy(exp => exp.index)
                          .ThenBy(exp => exp.abbr)
                          .ToList();
 }
Beispiel #4
0
 public void Validate(UProject project, UTrack track, UVoicePart part)
 {
     duration = Math.Max(10, duration);
     if (Prev != null && Prev.End > position)
     {
         Error        = true;
         OverlapError = true;
         return;
     }
     Error        = false;
     OverlapError = false;
     if (track.Singer == null || !track.Singer.Loaded)
     {
         Error |= true;
     }
     if (pitch.snapFirst)
     {
         if (Prev != null && Prev.End == position)
         {
             pitch.data[0].Y = (Prev.tone - tone) * 10;
         }
         else
         {
             pitch.data[0].Y = 0;
         }
     }
     for (var i = 0; i < phonemes.Count; i++)
     {
         var phoneme = phonemes[i];
         phoneme.Parent = this;
         phoneme.Index  = i;
     }
     foreach (var phoneme in phonemes)
     {
         phoneme.Validate(project, track, part, this);
         Error |= phoneme.Error;
     }
     // Update has override bits.
     foreach (var phoneme in phonemes)
     {
         phoneme.HasPhonemeOverride = false;
         phoneme.HasOffsetOverride  = false;
         phoneme.preutterScale      = null;
         phoneme.overlapScale       = null;
     }
     foreach (var o in (Extends ?? this).phonemeOverrides)
     {
         int index = o.index - PhonemeOffset;
         if (index >= 0 && index < phonemes.Count)
         {
             if (o.phoneme != null)
             {
                 phonemes[index].HasPhonemeOverride = true;
             }
             if (o.offset != null)
             {
                 phonemes[index].HasOffsetOverride = true;
             }
             phonemes[index].preutterScale = o.preutterScale;
             phonemes[index].overlapScale  = o.overlapScale;
         }
     }
 }