/// <summary> /// Reads in the content of the TZX file so that it can be played /// </summary> /// <returns>True, if read was successful; otherwise, false</returns> public override bool ReadContent() { var success = base.ReadContent(); var blocks = DataBlocks.Where(b => b is ISupportsTapeBlockPlayback) .Cast<ISupportsTapeBlockPlayback>() .ToList(); _player = new TapeBlockSetPlayer(blocks); return success; }
public int GetSectionOffset(int section) { if (section < 0 || section >= SectionCount) { throw new ArgumentOutOfRangeException(nameof(section)); } //treat 0 as being the header if (section == 0) { return(0); } var totalPrevious = DataBlocks.Where(b => b.Section < section).Sum(b => b.Size); return(Header.HeaderSize + totalPrevious); }