A single data packet from a logical Vorbis stream.
More...
|
virtual void | Done () |
| Indicates that the packet has been read and its data is no longer needed. More...
|
|
ulong | TryPeekBits (int count, out int bitsRead) |
| Attempts to read the specified number of bits from the packet, but may return fewer. Does not advance the position counter. More...
|
|
void | SkipBits (int count) |
| Advances the position counter by the specified number of bits. More...
|
|
ulong | ReadBits (int count) |
| Reads the specified number of bits from the packet and advances the position counter. More...
|
|
byte | PeekByte () |
| Reads the next byte from the packet. Does not advance the position counter. More...
|
|
byte | ReadByte () |
| Reads the next byte from the packet and advances the position counter. More...
|
|
byte[] | ReadBytes (int count) |
| Reads the specified number of bytes from the packet and advances the position counter. More...
|
|
int | Read (byte[] buffer, int index, int count) |
| Reads the specified number of bytes from the packet into the buffer specified and advances the position counter. More...
|
|
bool | ReadBit () |
| Reads the next bit from the packet and advances the position counter. More...
|
|
short | ReadInt16 () |
| Retrieves the next 16 bits from the packet as a short and advances the position counter. More...
|
|
int | ReadInt32 () |
| Retrieves the next 32 bits from the packet as a int and advances the position counter. More...
|
|
long | ReadInt64 () |
| Retrieves the next 64 bits from the packet as a long and advances the position counter. More...
|
|
ushort | ReadUInt16 () |
| Retrieves the next 16 bits from the packet as a ushort and advances the position counter. More...
|
|
uint | ReadUInt32 () |
| Retrieves the next 32 bits from the packet as a uint and advances the position counter. More...
|
|
ulong | ReadUInt64 () |
| Retrieves the next 64 bits from the packet as a ulong and advances the position counter. More...
|
|
void | SkipBytes (int count) |
| Advances the position counter by the specified number of bytes. More...
|
|
|
bool | IsResync [get, set] |
| Gets whether the packet was found after a stream resync. More...
|
|
long | GranulePosition [get, set] |
| Gets the position of the last granule in the packet. More...
|
|
long | PageGranulePosition [get, set] |
| Gets the position of the last granule in the page the packet is in. More...
|
|
int | Length [get, protected set] |
| Gets the length of the packet. More...
|
|
bool | IsEndOfStream [get, set] |
| Gets whether the packet is the last one in the logical stream. More...
|
|
long | BitsRead [get] |
| Gets the number of bits read from the packet. More...
|
|
int? | GranuleCount [get, set] |
| Gets the number of granules in the packet. If null , the packet has not been decoded yet. More...
|
|
A single data packet from a logical Vorbis stream.
◆ PacketFlags
Defines flags to apply to the current packet
Enumerator |
---|
IsResync | Packet is first since reader had to resync with stream.
|
IsEndOfStream | Packet is the last in the logical stream.
|
IsShort | Packet does not have all its data available.
|
HasGranuleCount | Packet has a granule count defined.
|
User1 | Flag for use by inheritors.
|
User2 | Flag for use by inheritors.
|
User3 | Flag for use by inheritors.
|
User4 | Flag for use by inheritors.
|
◆ DataPacket()
Crosstales.NVorbis.DataPacket.DataPacket |
( |
int |
length | ) |
|
|
protected |
Creates a new instance with the specified length.
- Parameters
-
length | The length of the packet. |
◆ Done()
virtual void Crosstales.NVorbis.DataPacket.Done |
( |
| ) |
|
|
virtual |
◆ GetFlag()
bool Crosstales.NVorbis.DataPacket.GetFlag |
( |
PacketFlags |
flag | ) |
|
|
protected |
Gets the value of the specified flag.
◆ PeekByte()
byte Crosstales.NVorbis.DataPacket.PeekByte |
( |
| ) |
|
Reads the next byte from the packet. Does not advance the position counter.
- Returns
- The byte read from the packet.
◆ Read()
int Crosstales.NVorbis.DataPacket.Read |
( |
byte[] |
buffer, |
|
|
int |
index, |
|
|
int |
count |
|
) |
| |
Reads the specified number of bytes from the packet into the buffer specified and advances the position counter.
- Parameters
-
buffer | The buffer to read into. |
index | The index into the buffer to start placing the read data. |
count | The number of bytes to read. |
- Returns
- The number of bytes read.
- Exceptions
-
ArgumentOutOfRangeException | index is less than 0 or index + count is past the end of buffer . |
◆ ReadBit()
bool Crosstales.NVorbis.DataPacket.ReadBit |
( |
| ) |
|
Reads the next bit from the packet and advances the position counter.
- Returns
- The value of the bit read.
◆ ReadBits()
ulong Crosstales.NVorbis.DataPacket.ReadBits |
( |
int |
count | ) |
|
Reads the specified number of bits from the packet and advances the position counter.
- Parameters
-
count | The number of bits to read. |
- Returns
- The value of the bits read.
- Exceptions
-
ArgumentOutOfRangeException | The number of bits specified is not between 0 and 64. |
◆ ReadByte()
byte Crosstales.NVorbis.DataPacket.ReadByte |
( |
| ) |
|
Reads the next byte from the packet and advances the position counter.
- Returns
- The byte read from the packet.
◆ ReadBytes()
byte [] Crosstales.NVorbis.DataPacket.ReadBytes |
( |
int |
count | ) |
|
Reads the specified number of bytes from the packet and advances the position counter.
- Parameters
-
count | The number of bytes to read. |
- Returns
- A byte array holding the data read.
◆ ReadInt16()
short Crosstales.NVorbis.DataPacket.ReadInt16 |
( |
| ) |
|
Retrieves the next 16 bits from the packet as a short and advances the position counter.
- Returns
- The value of the next 16 bits.
◆ ReadInt32()
int Crosstales.NVorbis.DataPacket.ReadInt32 |
( |
| ) |
|
Retrieves the next 32 bits from the packet as a int and advances the position counter.
- Returns
- The value of the next 32 bits.
◆ ReadInt64()
long Crosstales.NVorbis.DataPacket.ReadInt64 |
( |
| ) |
|
Retrieves the next 64 bits from the packet as a long and advances the position counter.
- Returns
- The value of the next 64 bits.
◆ ReadNextByte()
abstract int Crosstales.NVorbis.DataPacket.ReadNextByte |
( |
| ) |
|
|
protectedpure virtual |
◆ ReadUInt16()
ushort Crosstales.NVorbis.DataPacket.ReadUInt16 |
( |
| ) |
|
Retrieves the next 16 bits from the packet as a ushort and advances the position counter.
- Returns
- The value of the next 16 bits.
◆ ReadUInt32()
uint Crosstales.NVorbis.DataPacket.ReadUInt32 |
( |
| ) |
|
Retrieves the next 32 bits from the packet as a uint and advances the position counter.
- Returns
- The value of the next 32 bits.
◆ ReadUInt64()
ulong Crosstales.NVorbis.DataPacket.ReadUInt64 |
( |
| ) |
|
Retrieves the next 64 bits from the packet as a ulong and advances the position counter.
- Returns
- The value of the next 64 bits.
◆ ResetBitReader()
void Crosstales.NVorbis.DataPacket.ResetBitReader |
( |
| ) |
|
|
protected |
◆ SetFlag()
void Crosstales.NVorbis.DataPacket.SetFlag |
( |
PacketFlags |
flag, |
|
|
bool |
value |
|
) |
| |
|
protected |
Sets the value of the specified flag.
◆ SkipBits()
void Crosstales.NVorbis.DataPacket.SkipBits |
( |
int |
count | ) |
|
Advances the position counter by the specified number of bits.
- Parameters
-
count | The number of bits to advance. |
◆ SkipBytes()
void Crosstales.NVorbis.DataPacket.SkipBytes |
( |
int |
count | ) |
|
Advances the position counter by the specified number of bytes.
- Parameters
-
count | The number of bytes to advance. |
◆ TryPeekBits()
ulong Crosstales.NVorbis.DataPacket.TryPeekBits |
( |
int |
count, |
|
|
out int |
bitsRead |
|
) |
| |
Attempts to read the specified number of bits from the packet, but may return fewer. Does not advance the position counter.
- Parameters
-
count | The number of bits to attempt to read. |
bitsRead | The number of bits actually read. |
- Returns
- The value of the bits read.
- Exceptions
-
ArgumentOutOfRangeException | count is not between 0 and 64. |
◆ BitsRead
long Crosstales.NVorbis.DataPacket.BitsRead |
|
get |
Gets the number of bits read from the packet.
◆ GranuleCount
int? Crosstales.NVorbis.DataPacket.GranuleCount |
|
getset |
Gets the number of granules in the packet. If null
, the packet has not been decoded yet.
◆ GranulePosition
long Crosstales.NVorbis.DataPacket.GranulePosition |
|
getset |
Gets the position of the last granule in the packet.
◆ IsEndOfStream
bool Crosstales.NVorbis.DataPacket.IsEndOfStream |
|
getset |
Gets whether the packet is the last one in the logical stream.
◆ IsResync
bool Crosstales.NVorbis.DataPacket.IsResync |
|
getset |
Gets whether the packet was found after a stream resync.
◆ Length
int Crosstales.NVorbis.DataPacket.Length |
|
getprotected set |
Gets the length of the packet.
◆ PageGranulePosition
long Crosstales.NVorbis.DataPacket.PageGranulePosition |
|
getset |
Gets the position of the last granule in the page the packet is in.
The documentation for this class was generated from the following file:
- C:/Users/slaub/Unity/assets/DJPro/DJPro/Assets/Plugins/crosstales/Common/Libraries/NVorbis/DataPacket.cs