NLSOUND::ILoader Class Reference

#include <loader.h>


Detailed Description

Sound loader interface

Deprecated:
In order to fill a static buffer, just call fillBuffer(). In order to stream into a buffer, call fillBufferPart() several times.

Author:
Olivier Cado

Nevrax France

Date:
2001

Definition at line 49 of file loader.h.

Public Member Functions

bool fillBuffer ()
 Fills the buffer entirely.

bool fillBufferPart (uint32 size)
virtual uint32 getSize ()=0
 Return the size of the data to load (or MAXINT32 if unknown).

 ILoader ()
 Constructor.

virtual void setBuffer (IBuffer *buffer)
 Set the destination buffer.

virtual ~ILoader ()
 Destructor.


Protected Member Functions

virtual void * provideData (uint32 size)=0
 Provide data (load).


Protected Attributes

IBuffer_Buffer


Constructor & Destructor Documentation

NLSOUND::ILoader::ILoader  )  [inline]
 

Constructor.

Definition at line 69 of file loader.h.

00069 : _Buffer(NULL) {}

virtual NLSOUND::ILoader::~ILoader  )  [inline, virtual]
 

Destructor.

Definition at line 72 of file loader.h.

00072 { _Buffer = NULL; }


Member Function Documentation

bool NLSOUND::ILoader::fillBuffer  ) 
 

Fills the buffer entirely.

Definition at line 66 of file loader.cpp.

References NLSOUND::IBuffer::fillBuffer(), getSize(), nlassert, provideData(), size, and uint32.

00067 {
00068         nlassert( _Buffer != NULL );
00069         uint32 size = getSize();
00070         return _Buffer->fillBuffer( provideData( size ), size );
00071 }

bool NLSOUND::ILoader::fillBufferPart uint32  size  ) 
 

Fill the buffer up to the specified size, calling fillMore() if the buffer supports it, otherwise, fills the buffer entirely, calling IBuffer::fillBuffer()

Definition at line 48 of file loader.cpp.

References NLSOUND::IBuffer::fillBuffer(), NLSOUND::IBuffer::fillMore(), NLSOUND::IBuffer::getSize(), getSize(), NLSOUND::IBuffer::isFillMoreSupported(), nlassert, provideData(), size, and uint32.

00049 {
00050         nlassert( (_Buffer != NULL) && (size<=getSize()) );
00051         if ( _Buffer->isFillMoreSupported() )
00052         {
00053                 nlassert( _Buffer->getSize() != 0 );
00054                 return _Buffer->fillMore( provideData( size ), size );
00055         }
00056         else
00057         {
00058                 return _Buffer->fillBuffer( provideData( size), size );
00059         }
00060 }

virtual uint32 NLSOUND::ILoader::getSize  )  [pure virtual]
 

Return the size of the data to load (or MAXINT32 if unknown).

Referenced by fillBuffer(), and fillBufferPart().

virtual void* NLSOUND::ILoader::provideData uint32  size  )  [protected, pure virtual]
 

Provide data (load).

Referenced by fillBuffer(), and fillBufferPart().

void NLSOUND::ILoader::setBuffer IBuffer buffer  )  [virtual]
 

Set the destination buffer.

Definition at line 37 of file loader.cpp.

References buffer, and nlassert.

00038 {
00039         nlassert( buffer!=NULL );
00040         _Buffer = buffer;
00041 }


Field Documentation

IBuffer* NLSOUND::ILoader::_Buffer [protected]
 

Definition at line 81 of file loader.h.


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 14:51:29 2004 for NeL by doxygen 1.3.6