| 55 | |
| 56 | public: |
| 57 | void beginTrack() override |
| 58 | { |
| 59 | /* Find the start-of-track index marks, which will be an interval |
| 60 | * of about 6ms. */ |
| 61 | |
| 62 | seekToIndexMark(); |
| 63 | _sectorId = 99; |
| 64 | for (;;) |
| 65 | { |
| 66 | auto pos = tell(); |
| 67 | advanceToNextSector(); |
| 68 | if (_sectorId < 99) |
| 69 | { |
| 70 | seek(pos); |
| 71 | break; |
| 72 | } |
| 73 | |
| 74 | if (eof()) |
| 75 | return; |
| 76 | } |
| 77 | |
| 78 | /* Now we know where to start counting, start finding sectors. */ |
| 79 | |
| 80 | _sectorStarts.clear(); |
| 81 | for (;;) |
| 82 | { |
| 83 | auto now = tell(); |
| 84 | if (eof()) |
| 85 | break; |
| 86 | |
| 87 | int id = advanceToNextSector(); |
| 88 | if (id < 16) |
| 89 | _sectorStarts.push_back(std::make_pair(id, now)); |
| 90 | } |
| 91 | |
| 92 | _sectorIndex = 0; |
| 93 | } |
| 94 | |
| 95 | nanoseconds_t advanceToNextRecord() override |
| 96 | { |