Classes
clanSound Sound Providers

## Classes
class | clan::SoundProvider_Raw
| Sound provider in a raw PCM format (no header in file). More...
class | clan::SoundProvider_Wave
| Windows WAVE sample format (.wav) sound provider. More...
class | clan::SoundProviderFactory
| Sound Provider Factor class. More...
class | clan::SoundProviderType
| Sound provider type. More...
class | clan::SoundProviderType_Register< SoundProviderClass >
| Class template to register a sound provider type. More...

## Operations
static SoundProvider * | clan::SoundProviderFactory::load (const std::string &filename, bool streamed, const FileSystem &fs, const std::string &type=std::string())
| Loads an sample file from 'filename', using the provider identified by 'type'. More...
static SoundProvider * | clan::SoundProviderFactory::load (const std::string &fullname, bool streamed, const std::string &type=std::string())
| Loads an sample file from 'filename', using the provider identified by 'type'. More...
static SoundProvider * | clan::SoundProviderFactory::load (IODevice &file, bool streamed, const std::string &type)
| Loads an sample file from 'file', using the provider identified by 'type'. More...

## Construction
| clan::SoundProvider_Raw::SoundProvider_Raw (void *sound_data, int num_samples, int bytes_per_sample, bool stereo, int frequency=22050)
| Constructs a sound provider based on some raw PCM data. More...
virtual | clan::SoundProvider_Raw::~SoundProvider_Raw ()

## Operations
virtual SoundProvider_Session * | clan::SoundProvider_Raw::begin_session () override
| Called by SoundBuffer when a new session starts. More...
virtual void | clan::SoundProvider_Raw::end_session (SoundProvider_Session *session) override
| Called by SoundBuffer when a session has finished. After this call,. More...

## Implementation
class | clan::SoundProvider_Raw::SoundProvider_Raw_Session

## Construction
| clan::SoundProviderType::SoundProviderType (const std::string &type)
| Registers a sound provider type in the SoundProviderFactory. More...
virtual | clan::SoundProviderType::~SoundProviderType ()
| Unregisters a sound provider type in the SoundProviderFactory. More...

## Operations
virtual SoundProvider * | clan::SoundProviderType::load (const std::string &filename, bool streamed, const FileSystem &file_system)=0
| Called to load with this sound provider type. More...
virtual SoundProvider * | clan::SoundProviderType::load (IODevice &file, bool streamed)=0

## Construction
| clan::SoundProviderType_Register< SoundProviderClass >::SoundProviderType_Register (const std::string &type)
| Registers sound provider type in the SoundProviderFactory. More...

## Operations
virtual SoundProvider * | clan::SoundProviderType_Register< SoundProviderClass >::load (const std::string &filename, bool stream, const FileSystem &fs) override
| Called to load static with this sound provider type. More...
virtual SoundProvider * | clan::SoundProviderType_Register< SoundProviderClass >::load (IODevice &file, bool stream) override
| Called to load static with this sound provider type. More...

## Construction
| clan::SoundProvider_Wave::SoundProvider_Wave (const std::string &filename, const FileSystem &fs, bool stream=false)
| Constructs a sound provider based on a Windows wave (.wav) file. More...
| clan::SoundProvider_Wave::SoundProvider_Wave (const std::string &fullname, bool stream=false)
| clan::SoundProvider_Wave::SoundProvider_Wave (IODevice &file, bool stream=false)
virtual | clan::SoundProvider_Wave::~SoundProvider_Wave ()

## Operations
virtual SoundProvider_Session * | clan::SoundProvider_Wave::begin_session () override
| Called by SoundBuffer when a new session starts. More...
virtual void | clan::SoundProvider_Wave::end_session (SoundProvider_Session *session) override
| Called by SoundBuffer when a session has finished. After this call,. More...

## Implementation
class | clan::SoundProvider_Wave::SoundProvider_Wave_Session

## Detailed Description

## Function Documentation

clan::SoundProvider_Raw::SoundProvider_Raw | ( | void * | sound_data,
|  | int | num_samples,
|  | int | bytes_per_sample,
|  | bool | stereo,
|  | int | frequency = `22050`
| ) |  |

Constructs a sound provider based on some raw PCM data.

Parameters

  sound_data | Raw PCM data.
  num_samples | Number of samples to be read out of sound_data.
  bytes_per_sample | The size of a sample in bytes. This is 2 for 16 bit (signed), and 1 for 8 bit (unsigned).
  stereo | True if sound is stereo (two channels).
  frequency | Playback frequency for sample data.

clan::SoundProvider_Wave::SoundProvider_Wave | ( | const std::string & | filename,
|  | const FileSystem & | fs,
|  | bool | stream = `false`
| ) |  |

Constructs a sound provider based on a Windows wave (.wav) file.

Parameters

  filename | Filename of wave file.
  provider | Input source provider used to retrieve wave file.
  stream | If true, will stream from disk. If false, will load it to memory.

clan::SoundProvider_Wave::SoundProvider_Wave | ( | const std::string & | fullname,
|  | bool | stream = `false`
| ) |  |

clan::SoundProvider_Wave::SoundProvider_Wave | ( | IODevice & | file,
|  | bool | stream = `false`
| ) |  |

clan::SoundProviderType::SoundProviderType | ( | const std::string & | type | ) |

Registers a sound provider type in the SoundProviderFactory.

template<class SoundProviderClass >

clan::SoundProviderType_Register< SoundProviderClass >::SoundProviderType_Register | ( | const std::string & | type | ) |
| inline

Registers sound provider type in the SoundProviderFactory.

virtual clan::SoundProvider_Raw::~SoundProvider_Raw | ( |  | ) |
| virtual

virtual clan::SoundProvider_Wave::~SoundProvider_Wave | ( |  | ) |
| virtual

virtual clan::SoundProviderType::~SoundProviderType | ( |  | ) |
| virtual

Unregisters a sound provider type in the SoundProviderFactory.

virtual SoundProvider_Session* clan::SoundProvider_Raw::begin_session | ( |  | ) |
| override virtual

Called by SoundBuffer when a new session starts.

Returns
  The soundbuffer session to be attached to the newly started session.

Implements clan::SoundProvider.

virtual SoundProvider_Session* clan::SoundProvider_Wave::begin_session | ( |  | ) |
| override virtual

Called by SoundBuffer when a new session starts.

Returns
  The soundbuffer session to be attached to the newly started session.

Implements clan::SoundProvider.

virtual void clan::SoundProvider_Raw::end_session | ( | SoundProvider_Session * | session | ) |
| override virtual

Called by SoundBuffer when a session has finished. After this call,.

SoundBuffer will not access the session anymore. It can safely be deleted here (and in most cases should be delete here).

Implements clan::SoundProvider.

virtual void clan::SoundProvider_Wave::end_session | ( | SoundProvider_Session * | session | ) |
| override virtual

Called by SoundBuffer when a session has finished. After this call,.

SoundBuffer will not access the session anymore. It can safely be deleted here (and in most cases should be delete here).

Implements clan::SoundProvider.

template<class SoundProviderClass >

virtual SoundProvider* clan::SoundProviderType_Register< SoundProviderClass >::load | ( | const std::string & | filename,
|  | bool | stream,
|  | const FileSystem & | fs
| ) |  |
| inline override virtual

Called to load static with this sound provider type.

Implements clan::SoundProviderType.

virtual SoundProvider* clan::SoundProviderType::load | ( | const std::string & | filename,
|  | bool | streamed,
|  | const FileSystem & | file_system
| ) |  |
| pure virtual

Called to load with this sound provider type.

Implemented in clan::SoundProviderType_Register< SoundProviderClass >.

static SoundProvider* clan::SoundProviderFactory::load | ( | const std::string & | filename,
|  | bool | streamed,
|  | const FileSystem & | fs,
|  | const std::string & | type = `std::string()`
| ) |  |
| static

Loads an sample file from 'filename', using the provider identified by 'type'.

If the type is an empty string, it uses the extension of the filename to determine what type it is.

The input provider will be used as a the source for filename, if specified.

virtual SoundProvider* clan::SoundProviderType::load | ( | IODevice & | file,
|  | bool | streamed
| ) |  |
| pure virtual

Implemented in clan::SoundProviderType_Register< SoundProviderClass >.

template<class SoundProviderClass >

virtual SoundProvider* clan::SoundProviderType_Register< SoundProviderClass >::load | ( | IODevice & | file,
|  | bool | stream
| ) |  |
| inline override virtual

Called to load static with this sound provider type.

Implements clan::SoundProviderType.

static SoundProvider* clan::SoundProviderFactory::load | ( | const std::string & | fullname,
|  | bool | streamed,
|  | const std::string & | type = `std::string()`
| ) |  |
| static

Loads an sample file from 'filename', using the provider identified by 'type'.

static SoundProvider* clan::SoundProviderFactory::load | ( | IODevice & | file,
|  | bool | streamed,
|  | const std::string & | type
| ) |  |
| static

Loads an sample file from 'file', using the provider identified by 'type'.

## Friends

friend class SoundProvider_Raw_Session
| friend

friend class SoundProvider_Wave_Session
| friend