#include <Stream.h>
Stream abstract class
- This abstract class has but a few
- See Also
- Codec to create Stream instances.
Definition at line 21 of file Stream.h.
Audio::Stream::Stream |
( |
const std::string & |
path) | |
|
throw | ( | Exception |
| ) | | |
|
protected |
Internal constructor used by derived classes
Definition at line 17 of file Stream.cpp.
Audio::Stream::~Stream |
( |
) | |
|
|
virtual |
virtual void Audio::Stream::getBufferImpl |
( |
void *& |
buffer, |
|
|
unsigned int & |
bufferSize |
|
) |
| |
throw | ( | Exception |
| ) | | |
|
protectedpure virtual |
Get the stream's current reading buffer.
- Asking the buffer where nextBufferImpl() has never been called would raise
- a NoBuffer exception.
const Format& Audio::Stream::getFormat |
( |
) | |
const |
throw | ( | |
| ) | | |
|
inline |
Return the format of the stream.
Definition at line 59 of file Stream.h.
59 {
return streamFormat; }
Format& Audio::Stream::getFormatInternal |
( |
) | |
|
throw | ( | |
| ) | | |
|
inlineprotected |
Internal write access to stream format, for derived classes
Definition at line 50 of file Stream.h.
50 {
return streamFormat; }
double Audio::Stream::getLength |
( |
) | |
|
throw | ( | Exception |
| ) | | |
virtual double Audio::Stream::getLengthImpl |
( |
) | |
const |
throw | ( | Exception |
| ) | | |
|
protectedpure virtual |
const std::string& Audio::Stream::getPath |
( |
) | |
const |
throw | ( | |
| ) | | |
|
inline |
Return the path of the associated file.
Definition at line 56 of file Stream.h.
double Audio::Stream::getPosition |
( |
) | |
const |
throw | ( | |
| ) | | |
virtual double Audio::Stream::getPositionImpl |
( |
) | |
const |
throw | ( | |
| ) | | |
|
protectedpure virtual |
virtual void Audio::Stream::nextBufferImpl |
( |
) | |
|
throw | ( | Exception |
| ) | | |
|
protectedpure virtual |
Advance the stream by reading a new buffer.
- After a successful call to this member, getBufferImpl will never raise
- a NoBuffer exception.
- See Also
- getBufferImpl
unsigned int Audio::Stream::read |
( |
void * |
buffer, |
|
|
unsigned int |
bufferSize |
|
) |
| |
throw | ( | Exception |
| ) | | |
Fill the specified buffer with data from the stream, and advance.
- Parameters
-
buffer | a pointer to a memory buffer where to extract data. |
bufferSize | the size of the memory area pointed to by buffer, and the maximum amount of data to be extracted from the stream, if available. |
Definition at line 40 of file Stream.cpp.
References buffer, VsnetOSS::memcpy(), and min().
44 unsigned int rbufferSize;
45 unsigned int rode = 0;
49 }
catch (NoBufferException) {
52 curBufferPos = rbuffer;
54 rbufferEnd = ((
char*)rbuffer) + rbufferSize;
56 while (bufferSize > 0) {
57 if (!((curBufferPos >= rbuffer) && (curBufferPos < rbufferEnd))) {
60 curBufferPos = rbuffer;
61 rbufferEnd = ((
char*)rbuffer) + rbufferSize;
64 size_t remaining =
min( bufferSize, (
unsigned int)((
char*)rbufferEnd - (
char*)curBufferPos) );
67 curBufferPos = (
void*)((
char*)curBufferPos + remaining);
68 bufferSize -= remaining;
void Audio::Stream::seek |
( |
double |
position) | |
|
throw | ( | Exception |
| ) | | |
Set the stream's position, in seconds
Definition at line 35 of file Stream.cpp.
virtual void Audio::Stream::seekImpl |
( |
double |
position) | |
|
throw | ( | Exception |
| ) | | |
|
protectedpure virtual |
The documentation for this class was generated from the following files: