1.11
Public Member Functions | List of all members
SoundEffect::SoundDevice Class Reference

The SoundDevice object is used to describe an ALSA PCM device. More...

#include <sound_effect.h>

Public Member Functions

 SoundDevice (int card_index=0, int device_index=0) noexcept
 
EGT_NODISCARD int card_index () const
 Get the sound card index.
 
void card_index (int card_index)
 Set the sound card index.
 
EGT_NODISCARD std::string card_name () const
 Get the sound card name.
 
void card_name (const std::string &card_name)
 Set the sound card name.
 
EGT_NODISCARD int device_index () const
 Get the sound device index.
 
void device_index (int device_index)
 Set the sound device index.
 
EGT_NODISCARD std::string device_name () const
 Get the sound device name.
 
void device_name (std::string device_name)
 Set the sound device name.
 

Detailed Description

The SoundDevice object is used to describe an ALSA PCM device.

It includes information such as card and device indexes, which can be retrieved using the aplay -l command.

Constructor & Destructor Documentation

◆ SoundDevice()

SoundDevice ( int  card_index = 0,
int  device_index = 0 
)
inlinenoexcept
Parameters
[in]card_indexThe Alsa card index.
[in]device_indexThe Alsa device index.

Member Function Documentation

◆ card_index() [1/2]

EGT_NODISCARD int card_index ( ) const
inline

Get the sound card index.

◆ card_index() [2/2]

void card_index ( int  card_index)
inline

Set the sound card index.

Parameters
[in]card_indexThe Alsa card index.

◆ card_name() [1/2]

EGT_NODISCARD std::string card_name ( ) const
inline

Get the sound card name.

◆ card_name() [2/2]

void card_name ( const std::string &  card_name)
inline

Set the sound card name.

Parameters
[in]card_nameThe Alsa card name.

◆ device_index() [1/2]

EGT_NODISCARD int device_index ( ) const
inline

Get the sound device index.

◆ device_index() [2/2]

void device_index ( int  device_index)
inline

Set the sound device index.

Parameters
[in]device_indexThe Alsa device index.

◆ device_name() [1/2]

EGT_NODISCARD std::string device_name ( ) const
inline

Get the sound device name.

◆ device_name() [2/2]

void device_name ( std::string  device_name)
inline

Set the sound device name.

Parameters
[in]card_nameThe Alsa card name.