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

# Class CL_Sound

Sound interface in ClanLib.
Contained in: global
Derived from: none
Derived by: none
Group: Sound (Audio Mixing)

#include <ClanLib/sound.h>

### public function member index:

### Construction:

``virtual`` | `~CL_Sound` | `()`;

### Attributes:

``static` `CL_StreamSoundProvider`*` | `get_microphone` | `()`;
``static` `CL_StreamSoundProvider`*` | `get_line_in` | `()`;
``static` `CL_SoundCard`*` | `get_current_card` | `()`;

### Operations:

``static` `void`` | `clear_card_preload` | `()`;
``static` `void`` | `add_card_preload` | `(`CL_SoundCard`* `card`)`;
``static` `void`` | `remove_card_preload` | `(`CL_SoundCard`* `card`)`;
``static` `void`` | `select_card` | `(`CL_SoundCard`* `card`)`;
``static` `void`` | `select_card` | `(`int` `card_no`)`;

## Description:

This class provides a list of all soundcards available on the system. It is also a wrapper class for the CL_SoundCard class, providing an easier access to a single selected soundcard.
All the functions that share name with those in CL_SoundCard have the same functionality. The only difference is, that the ones CL_Sound operate on a selected soundcard. This saves the trouble of passing around a pointer to the soundcard, when only a single one is used anyway.
See also - CL_SoundCard - Soundcard interface class.
See also - CL_SoundBuffer - Sample class in ClanLib.

## Function Member Descriptions:

CL_Sound::add_card_preload - Adds 'card' to the preloaded soundcards list. This means all soundbuffers will be automatically preloaded onto the card. By default the first card is always on the preload list.
If a card isn't on the list, the soundbuffer's data will first be loaded when the sample is actually played for the first time.
``static` `void`` `add_card_preload` `(`CL_SoundCard`* `card`)`;

> card - The card to be added to the preload list.

CL_Sound::clear_card_preload - Clears the list of preloaded soundcards.
``static` `void`` `clear_card_preload` `()`;

CL_Sound::get_current_card - Returns the current selected soundcard.
``static` `CL_SoundCard`*` `get_current_card` `()`;

> Returns - Current soundcard.

CL_Sound::get_line_in - Returns the streamed soundprovider representing the line in.
``static` `CL_StreamSoundProvider`*` `get_line_in` `()`;

> Returns - The line in.

CL_Sound::get_microphone - Returns the streamed soundprovider representing the microphone.
``static` `CL_StreamSoundProvider`*` `get_microphone` `()`;

> Returns - The microphone.

CL_Sound::remove_card_preload - Removes the specified card from the preload list.
``static` `void`` `remove_card_preload` `(`CL_SoundCard`* `card`)`;

> card - The card to be removed from the list.

CL_Sound::select_card - Change the current selected soundcard to 'card'.
``static` `void`` `select_card` `(`CL_SoundCard`* `card`)`;

> card - The new current selected soundcard.

CL_Sound::select_card - Change the current selected soundcard to soundcard number 'card_no'.
``static` `void`` `select_card` `(`int` `card_no`)`;

> card_no - Card number in the CL_Sound::cards list.

CL_Sound::~CL_Sound - Sound Destructor
``virtual`` `~CL_Sound` `()`;

## Variable Member Descriptions:

CL_Sound::cards - The list of soundcards available on this system.
``static` `std::vector`<`CL_SoundCard`*>` ``cards`;`

CL_Sound::preload_cards - List of all cards where soundbuffers are automatically preloaded.
``static` `std::list`<`CL_SoundCard`*>` ``preload_cards`;`