private void SeekNextBlock()
{
if (this.ReachedEnd || this.CurrentState.BlockIndex >= BlockTotalCount)
{
this.ReachedEnd = true;
return;
}
var Block = BlockPointer[this.CurrentState.BlockIndex++];
switch (Block.Type)
{
case Vag.Block.TypeEnum.LoopStart:
{
var CopyState = this.CurrentState;
CopyState.BlockIndex--;
LoopStack.Push(CopyState);
}
break;
case Vag.Block.TypeEnum.LoopEnd:
{
if (this.CurrentLoopCount++ < this.TotalLoopCount)
{
this.CurrentState = LoopStack.Pop();
}
else
{
LoopStack.Pop();
}
}
break;
case Vag.Block.TypeEnum.End:
this.ReachedEnd = true;
return;
//default:
// //Console.Error.WriteLine("Not implemented: Vag.Block.Type: {0}", Block.Type);
// break;
}
DecodeBlock(Block);
}