HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions
tt::audio_device_win32 Class Reference

#include <ttauri/audio/audio_device_win32.hpp>

Inheritance diagram for tt::audio_device_win32:
tt::audio_device

Public Member Functions

 audio_device_win32 (IMMDevice *device)
 
std::string name () const noexcept override
 Get a user friendly name of the audio device.
 
tt::label label () const noexcept override
 Get a user friendly label of the audio device.
 
audio_device_state state () const noexcept override
 Get the current state of the audio device.
 
audio_direction direction () const noexcept override
 
bool exclusive () const noexcept override
 Check if the device is in exclusive mode.
 
void set_exclusive (bool exclusive) noexcept override
 Set the device in exclusive or shared mode.
 
double sample_rate () const noexcept override
 Get the currently configured sample rate.
 
void set_sample_rate (double sample_rate) noexcept override
 Set the sample rate.
 
tt::speaker_mapping input_speaker_mapping () const noexcept override
 Get the currently configured input speaker mapping.
 
void set_input_speaker_mapping (tt::speaker_mapping speaker_mapping) noexcept override
 Set the input speaker mapping.
 
std::vector< tt::speaker_mapping > available_input_speaker_mappings () const noexcept override
 Speaker mapping that are available in the current configuration.
 
tt::speaker_mapping output_speaker_mapping () const noexcept override
 Get the currently configured output speaker mapping.
 
void set_output_speaker_mapping (tt::speaker_mapping speaker_mapping) noexcept override
 Set the output speaker mapping.
 
std::vector< tt::speaker_mapping > available_output_speaker_mappings () const noexcept override
 Speaker mapping that are available in the current configuration.
 
bool supports_format (audio_stream_format const &format) const noexcept
 

Static Public Member Functions

static audio_device_id get_id (IMMDevice *device) noexcept
 Get the device id for the given win32 audio end-point.
 

Additional Inherited Members

- Data Fields inherited from tt::audio_device
audio_device_id id
 The nonephemeral unique id that for an audio device on the system.
 

Detailed Description

A class representing an audio device on the system.

Member Function Documentation

◆ available_input_speaker_mappings()

std::vector< tt::speaker_mapping > tt::audio_device_win32::available_input_speaker_mappings ( ) const
overridevirtualnoexcept

Speaker mapping that are available in the current configuration.

Returns
A list of speaker mappings.

Implements tt::audio_device.

◆ available_output_speaker_mappings()

std::vector< tt::speaker_mapping > tt::audio_device_win32::available_output_speaker_mappings ( ) const
overridevirtualnoexcept

Speaker mapping that are available in the current configuration.

Returns
A list of speaker mappings.

Implements tt::audio_device.

◆ direction()

audio_direction tt::audio_device_win32::direction ( ) const
overridevirtualnoexcept

Implements tt::audio_device.

◆ exclusive()

bool tt::audio_device_win32::exclusive ( ) const
overridevirtualnoexcept

Check if the device is in exclusive mode.

Returns
True to if exclusive mode, False if shared mode

Implements tt::audio_device.

◆ get_id()

static audio_device_id tt::audio_device_win32::get_id ( IMMDevice * device)
staticnoexcept

Get the device id for the given win32 audio end-point.

◆ input_speaker_mapping()

tt::speaker_mapping tt::audio_device_win32::input_speaker_mapping ( ) const
overridevirtualnoexcept

Get the currently configured input speaker mapping.

Returns
The current configured input speaker mapping.

Implements tt::audio_device.

◆ label()

tt::label tt::audio_device_win32::label ( ) const
overridevirtualnoexcept

Get a user friendly label of the audio device.

This is a combination of the name of the device and the name of the end-point, plus an icon for the driver architecture.

Implements tt::audio_device.

◆ name()

std::string tt::audio_device_win32::name ( ) const
overridevirtualnoexcept

Get a user friendly name of the audio device.

This is a combination of the name of the device and the name of the end-point.

Implements tt::audio_device.

◆ output_speaker_mapping()

tt::speaker_mapping tt::audio_device_win32::output_speaker_mapping ( ) const
overridevirtualnoexcept

Get the currently configured output speaker mapping.

Returns
The current configured output speaker mapping.

Implements tt::audio_device.

◆ sample_rate()

double tt::audio_device_win32::sample_rate ( ) const
overridevirtualnoexcept

Get the currently configured sample rate.

Returns
The current sample rate, or 0.0f when the sample rate is not configured.

Implements tt::audio_device.

◆ set_exclusive()

void tt::audio_device_win32::set_exclusive ( bool exclusive)
overridevirtualnoexcept

Set the device in exclusive or shared mode.

In shared mode:

  • The sample rate is the same as the operating system's mixer.
  • The speaker mapping is the same as the operating system's mixer.

In exclusive mode:

  • The sample rate can be changed, and the physical audio device will be configured to it.
  • The speaker mapping can be changed, and the physical device will configure its input and outputs accordingly.
Parameters
exclusiveTrue to get exclusive mode, False to get shared mode.

Implements tt::audio_device.

◆ set_input_speaker_mapping()

void tt::audio_device_win32::set_input_speaker_mapping ( tt::speaker_mapping speaker_mapping)
overridevirtualnoexcept

Set the input speaker mapping.

Parameters
speaker_mappingThe input speaker mapping to configure the device to.

Implements tt::audio_device.

◆ set_output_speaker_mapping()

void tt::audio_device_win32::set_output_speaker_mapping ( tt::speaker_mapping speaker_mapping)
overridevirtualnoexcept

Set the output speaker mapping.

Parameters
speaker_mappingThe output speaker mapping to configure the device to.

Implements tt::audio_device.

◆ set_sample_rate()

void tt::audio_device_win32::set_sample_rate ( double sample_rate)
overridevirtualnoexcept

Set the sample rate.

Parameters
sample_rateThe sample rate to configure the device to.

Implements tt::audio_device.

◆ state()

audio_device_state tt::audio_device_win32::state ( ) const
overridevirtualnoexcept

Get the current state of the audio device.

Implements tt::audio_device.


The documentation for this class was generated from the following file: