|
resonance 1.0.1
|
Cursor over the chunks inside one RIFF list or Standard MIDI File. More...
#include <hxilistchunk.h>

Public Member Functions | |
| HxIListChunk (HxStream *pStream, bool bReadHeader) | |
| Open a reader on a stream at its read position. | |
| HxIListChunk (HxIListChunk *pParent) | |
| Open a reader on the chunks inside the current chunk of another reader, and lock it. | |
| ~HxIListChunk () | |
| Unlock the parent reader, if any, and free the enclosing header. | |
| void | Init () |
| Compute mEnd from the enclosing header, lock the parent reader, if any, and reset. | |
| void | Reset () |
| Seek back to the first chunk and forget the current one. | |
| HxChunkHeader * | Next () |
| Advance to the next chunk and read its header. | |
| HxChunkHeader * | CurSubChunkHeader () |
| Report the current chunk header. | |
| HxChunkHeader * | Next (const HxChunkName &name) |
| Advance until a chunk with the given name is current. | |
| void | Lock () |
| Mark the reader as having a nested reader or chunk open. | |
| void | Unlock () |
| Clear the mark Lock() sets. | |
Public Attributes | |
| HxIListChunk * | mParent |
| HxStream * | mStream |
| HxChunkHeader * | mHeader |
| int | mStart |
| int | mEnd |
| int | mLocked |
| HxChunkHeader | mCurrent |
| int | mHasCurrent |
| int | mAtStart |
| int | mNext |
Cursor over the chunks inside one RIFF list or Standard MIDI File.
The class is not polymorphic and has no RTTI. Its name comes from the debugging symbols of the North American demo release. The reader walks the chunk headers between mStart and mEnd on a shared HxStream, seeking to each header in turn. Opening a nested reader or an HxIDataChunk on the current chunk locks the parent reader, and destroying the nested object unlocks it. No routine tests mLocked.
Every member is public, because HxIDataChunk and Mid::Reader read the fields directly and the image exposes no accessor.
| HxIListChunk::HxIListChunk | ( | HxStream * | pStream, |
| bool | bReadHeader ) |
Open a reader on a stream at its read position.
With bReadHeader set, the reader reads the chunk header at the read position and walks the chunks inside it. Otherwise the reader treats the rest of the stream as one LIST whose size is HxStream::Size() less HxStream::GetMarker().
| pStream | The stream to read. The reader does not take ownership. |
| bReadHeader | Read an enclosing chunk header first. |
|
explicit |
Open a reader on the chunks inside the current chunk of another reader, and lock it.
The enclosing header is a heap copy of pParent's current header.
| pParent | The reader whose current chunk is a list. |
| HxIListChunk::~HxIListChunk | ( | ) |
Unlock the parent reader, if any, and free the enclosing header.
| void HxIListChunk::Init | ( | ) |
Compute mEnd from the enclosing header, lock the parent reader, if any, and reset.
| void HxIListChunk::Reset | ( | ) |
Seek back to the first chunk and forget the current one.
| HxChunkHeader * HxIListChunk::Next | ( | ) |
Advance to the next chunk and read its header.
The next chunk begins after the header and payload of this one. Every chunk except an MTrk track is padded to an even size.
| HxChunkHeader * HxIListChunk::CurSubChunkHeader | ( | ) |
Report the current chunk header.
| HxChunkHeader * HxIListChunk::Next | ( | const HxChunkName & | name | ) |
Advance until a chunk with the given name is current.
The search starts from the chunk after the current one and does not rewind.
| name | The chunk name, or a list's form type. |
| void HxIListChunk::Lock | ( | ) |
Mark the reader as having a nested reader or chunk open.
| void HxIListChunk::Unlock | ( | ) |
| HxIListChunk* HxIListChunk::mParent |
The enclosing reader, or null for a top-level reader. +0x00
| HxStream* HxIListChunk::mStream |
The stream every chunk lies in. +0x04
| HxChunkHeader* HxIListChunk::mHeader |
Heap header of the enclosing chunk. +0x08
| int HxIListChunk::mStart |
Stream position of the first chunk. +0x0c
| int HxIListChunk::mEnd |
Stream position after the last chunk. +0x10
| int HxIListChunk::mLocked |
Non-zero while a nested reader or chunk is open. +0x14
| HxChunkHeader HxIListChunk::mCurrent |
Header of the current chunk. +0x18
| int HxIListChunk::mHasCurrent |
Non-zero while mCurrent is valid. +0x24
| int HxIListChunk::mNext |
Stream position of the next chunk header. +0x2c