Entire Class Index | Main Class Index | Cross Index | Global Index

# Class CL_Sample

ClanLib's datafile samples. This class can read samples from datafiles.
Contained in: global
Derived from: CL_StaticSoundProvider
Derived by: none
Group: Sound (Sound Providers)

#include <ClanLib/sound.h>

### public function member index:

### Construction:

``static` `CL_SoundBuffer`*` | `create` | `(`const` `std::string`& `sample_id`, `CL_InputSourceProvider`* `provider`)`;
`` | `CL_Sample` | `(`const` `std::string`& `sample_id`, `CL_InputSourceProvider`* `_provider`)`;
``virtual`` | `~CL_Sample` | `()`;

### Operations:

``virtual` `void`` | `lock` | `()`;
``virtual` `void`` | `unlock` | `()`;

### Attributes:

``virtual` `SoundFormat`` | `get_format` | `() `const``;
``virtual` `int`` | `data_size` | `() `const``;
``virtual` `void`*` | `get_data` | `() `const``;
``virtual` `int`` | `get_frequency` | `() `const``;

### private function member index:

### Implementation:

``void`` | `load_data` | `()`;

## Description:

## Function Member Descriptions:

CL_Sample::CL_Sample - Constructs a static sound provider that represents 'sample_id' from the
inputsource provider 'provider'.
`` `CL_Sample` `(`const` `std::string`& `sample_id`, `CL_InputSourceProvider`* `_provider`)`;

CL_Sample::create - Loads the sample 'sample_id' from the inputsource provider 'provider'.
Creates a CL_SoundBuffer using this sample and returns it.
``static` `CL_SoundBuffer`*` `create` `(`const` `std::string`& `sample_id`, `CL_InputSourceProvider`* `provider`)`;

CL_Sample::data_size - Returns the size of the sample.
``virtual` `int`` `data_size` `() `const``;

CL_Sample::get_data - Returns the sample data. Must be locked before this is done.
``virtual` `void`*` `get_data` `() `const``;

CL_Sample::get_format - Returns the sample format used by this sample.
``virtual` `SoundFormat`` `get_format` `() `const``;

CL_Sample::get_frequency - Returns the default frequency used when playing this sample.
``virtual` `int`` `get_frequency` `() `const``;

CL_Sample::lock - Locks the sample data.
``virtual` `void`` `lock` `()`;

CL_Sample::unlock - Unlocks the sample data.
``virtual` `void`` `unlock` `()`;

CL_Sample::~CL_Sample - Sample Destructor
``virtual`` `~CL_Sample` `()`;

## Variable Member Descriptions: