/// <summary>
 /// The constructor of the tempo point in terms of the envelope.
 ///
 /// </summary>
 /// <param name="line"></param>
 public EnvelopeTempoPoint(string line)
 {
     string[] timingInformation = line.Split(char.Parse(""));
     time           = decimal.Parse(timingInformation[1]);
     bpm            = decimal.Parse(timingInformation[2]);
     envelopeShape  = (EnvelopeShape)int.Parse(timingInformation[3]);
     tempoSignature = timingInformation[4] != null?GetTempoSignature(timingInformation[4]) : new TempoSignature(4);
 }
Ejemplo n.º 2
0
        public bool ToDocumentElement(TablatureContext context, ILogger logger, out TempoSignature element)
        {
            if (this.ValueEquals(context.DocumentState.TempoSignature))
            {
                logger.Report(LogLevel.Suggestion, this.Range, Messages.Suggestion_UselessTempoInstruction);
                element = null;
                return(false);
            }

            element = new TempoSignature
            {
                Range = this.Range,
                Tempo = new Tempo(this.Beats.Value, this.NoteValue?.Value ?? BaseNoteValue.Quater)
            };

            return(true);
        }
Ejemplo n.º 3
0
        public bool ValueEquals(TempoSignature other)
        {
            if (other == null)
            {
                return(false);
            }

            if (this.NoteValue == null)
            {
                if (other.Tempo.NoteValue != BaseNoteValue.Quater)
                {
                    return(false);
                }
            }
            else if (this.NoteValue.Value != other.Tempo.NoteValue)
            {
                return(false);
            }

            return(this.Beats.Value == other.Tempo.Beats);
        }