#define MA_DATA_FORMAT_FLAG_EXCLUSIVE_MODE (1U << 1); /* If set, this is supported in exclusive mode. Otherwise not natively supported by exclusive mode. */
typedefstruct
{
/* Basic info. This is the only information guaranteed to be filled in during device enumeration. */
ma_device_idid;
charname[256];
ma_bool32isDefault;
/*
Detailed info. As much of this is filled as possible with ma_context_get_device_info(). Note that you are allowed to initialize
...
...
@@ -1707,13 +1821,19 @@ typedef struct
ma_uint32minSampleRate;
ma_uint32maxSampleRate;
/* Experimental. Don't use these right now. */
ma_uint32nativeDataFormatCount;
struct
{
ma_bool32isDefault;
}_private;
ma_formatformat;/* Sample format. If set to ma_format_unknown, all sample formats are supported. */
ma_uint32channels;/* If set to 0, all channels are supported. */
ma_uint32sampleRate;/* If set to 0, all sample rates are supported. */
ma_uint32flags;
}nativeDataFormats[64];
}ma_device_info;
typedefstruct
structma_device_config
{
ma_device_typedeviceType;
ma_uint32sampleRate;
...
...
@@ -1774,9 +1894,146 @@ typedef struct
constchar*pStreamNamePlayback;
constchar*pStreamNameCapture;
}pulse;
}ma_device_config;
struct
{
ma_bool32allowNominalSampleRateChange;/* Desktop only. When enabled, allows changing of the sample rate at the operating system level. */
}coreaudio;
struct
{
ma_opensl_stream_typestreamType;
ma_opensl_recording_presetrecordingPreset;
}opensl;
struct
{
ma_aaudio_usageusage;
ma_aaudio_content_typecontentType;
ma_aaudio_input_presetinputPreset;
}aaudio;
};
/*
The callback for handling device enumeration. This is fired from `ma_context_enumerated_devices()`.
Parameters
----------
pContext (in)
A pointer to the context performing the enumeration.
deviceType (in)
The type of the device being enumerated. This will always be either `ma_device_type_playback` or `ma_device_type_capture`.
pInfo (in)
A pointer to a `ma_device_info` containing the ID and name of the enumerated device. Note that this will not include detailed information about the device,
only basic information (ID and name). The reason for this is that it would otherwise require opening the backend device to probe for the information which
is too inefficient.
pUserData (in)
The user data pointer passed into `ma_context_enumerate_devices()`.
The callback for handling device enumeration. This is fired from `ma_context_enumerated_devices()`.
Parameters
----------
pContext (in)
A pointer to the context performing the enumeration.
deviceType (in)
The type of the device being enumerated. This will always be either `ma_device_type_playback` or `ma_device_type_capture`.
pInfo (in)
A pointer to a `ma_device_info` containing the ID and name of the enumerated device. Note that this will not include detailed information about the device,
only basic information (ID and name). The reason for this is that it would otherwise require opening the backend device to probe for the information which
is too inefficient.
pUserData (in)
The user data pointer passed into `ma_context_enumerate_devices()`.
ma_bool32isBackendAsynchronous:1;/* Set when the context is initialized. Set to 1 for asynchronous backends such as Core Audio and JACK. Do not modify. */
ma_result(*onEnumDevices)(ma_context*pContext,ma_enum_devices_callback_proccallback,void*pUserData);/* Return false from the callback to stop enumeration. */