private void BarMeta(Bar bar)
{
var master = bar.MasterBar;
while (_sy == AlphaTexSymbols.MetaCommand)
{
var syData = _syData.ToString().ToLower();
if (syData == "ts")
{
NewSy();
if (_sy != AlphaTexSymbols.Number)
{
Error("timesignature-numerator", AlphaTexSymbols.Number);
}
master.TimeSignatureNumerator = (int)_syData;
NewSy();
if (_sy != AlphaTexSymbols.Number)
{
Error("timesignature-denominator", AlphaTexSymbols.Number);
}
master.TimeSignatureDenominator = (int)_syData;
}
else if (syData == "ro")
{
master.IsRepeatStart = true;
}
else if (syData == "rc")
{
NewSy();
if (_sy != AlphaTexSymbols.Number)
{
Error("repeatclose", AlphaTexSymbols.Number);
}
master.RepeatCount = ((int)_syData) - 1;
}
else if (syData == "ks")
{
NewSy();
if (_sy != AlphaTexSymbols.String)
{
Error("keysignature", AlphaTexSymbols.String);
}
master.KeySignature = ParseKeySignature(_syData.ToString().ToLower());
}
else if (syData == "clef")
{
NewSy();
if (_sy != AlphaTexSymbols.String && _sy != AlphaTexSymbols.Tuning)
{
Error("clef", AlphaTexSymbols.String);
}
bar.Clef = ParseClef(_syData.ToString().ToLower());
}
else if (syData == "tempo")
{
NewSy();
if (_sy != AlphaTexSymbols.Number)
{
Error("tempo", AlphaTexSymbols.Number);
}
var tempoAutomation = new Automation();
tempoAutomation.IsLinear = true;
tempoAutomation.Type = AutomationType.Tempo;
tempoAutomation.Value = (float)_syData;
master.TempoAutomation = tempoAutomation;
}
else
{
Error("measure-effects", AlphaTexSymbols.String, false);
}
NewSy();
}
}