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

#include <hikogui/audio/audio_device_win32.hpp>

Inheritance diagram for v1::audio_device_win32:
v1::audio_device

Public Member Functions

 audio_device_win32 (IMMDevice *device)
 
void update_state () noexcept override
 @beginprivatemethods
 
hi::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.
 
hi::speaker_mapping input_speaker_mapping () const noexcept override
 Get the currently configured input speaker mapping.
 
void set_input_speaker_mapping (hi::speaker_mapping speaker_mapping) noexcept override
 Set the input speaker mapping.
 
std::vector< hi::speaker_mapping > available_input_speaker_mappings () const noexcept override
 Speaker mapping that are available in the current configuration.
 
hi::speaker_mapping output_speaker_mapping () const noexcept override
 Get the currently configured output speaker mapping.
 
void set_output_speaker_mapping (hi::speaker_mapping speaker_mapping) noexcept override
 Set the output speaker mapping.
 
std::vector< hi::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
 
- Public Member Functions inherited from v1::audio_device
std::string const & id () const noexcept
 The nonephemeral unique id that for an audio device on the system.
 
std::string name () const noexcept
 Get a user friendly name of the audio device.
 

Static Public Member Functions

static std::string get_device_id (IMMDevice *device)
 Get the device id for the given win32 audio end-point.
 

Detailed Description

A class representing an audio device on the system.

Member Function Documentation

◆ available_input_speaker_mappings()

std::vector< hi::speaker_mapping > v1::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 v1::audio_device.

◆ available_output_speaker_mappings()

std::vector< hi::speaker_mapping > v1::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 v1::audio_device.

◆ direction()

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

Implements v1::audio_device.

◆ exclusive()

bool v1::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 v1::audio_device.

◆ get_device_id()

static std::string v1::audio_device_win32::get_device_id ( IMMDevice * device)
static

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

Parameters
deviceThe win32 device instance to get the device id from.
Returns
A device id as string, to differentiate with asio it will start with "win32:"
Exceptions
io_errorWhen the device id could not be retrieved.

◆ input_speaker_mapping()

hi::speaker_mapping v1::audio_device_win32::input_speaker_mapping ( ) const
overridevirtualnoexcept

Get the currently configured input speaker mapping.

Returns
The current configured input speaker mapping.

Implements v1::audio_device.

◆ label()

hi::label v1::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 v1::audio_device.

◆ output_speaker_mapping()

hi::speaker_mapping v1::audio_device_win32::output_speaker_mapping ( ) const
overridevirtualnoexcept

Get the currently configured output speaker mapping.

Returns
The current configured output speaker mapping.

Implements v1::audio_device.

◆ sample_rate()

double v1::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 v1::audio_device.

◆ set_exclusive()

void v1::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 v1::audio_device.

◆ set_input_speaker_mapping()

void v1::audio_device_win32::set_input_speaker_mapping ( hi::speaker_mapping speaker_mapping)
overridevirtualnoexcept

Set the input speaker mapping.

Parameters
speaker_mappingThe input speaker mapping to configure the device to.

Implements v1::audio_device.

◆ set_output_speaker_mapping()

void v1::audio_device_win32::set_output_speaker_mapping ( hi::speaker_mapping speaker_mapping)
overridevirtualnoexcept

Set the output speaker mapping.

Parameters
speaker_mappingThe output speaker mapping to configure the device to.

Implements v1::audio_device.

◆ set_sample_rate()

void v1::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 v1::audio_device.

◆ state()

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

Get the current state of the audio device.

Implements v1::audio_device.

◆ update_state()

void v1::audio_device_win32::update_state ( )
overridevirtualnoexcept

@beginprivatemethods

Implements v1::audio_device.


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