volatilema_uint32encodedReadOffset;/* Most significant bit is the loop flag. Lower 31 bits contains the actual offset in bytes. */
volatilema_uint32encodedReadOffset;/* Most significant bit is the loop flag. Lower 31 bits contains the actual offset in bytes. */
volatilema_uint32encodedWriteOffset;/* Most significant bit is the loop flag. Lower 31 bits contains the actual offset in bytes. */
volatilema_uint32encodedWriteOffset;/* Most significant bit is the loop flag. Lower 31 bits contains the actual offset in bytes. */
ma_bool32ownsBuffer:1;/* Used to know whether or not miniaudio is responsible for free()-ing the buffer. */
ma_bool8ownsBuffer;/* Used to know whether or not miniaudio is responsible for free()-ing the buffer. */
ma_bool32clearOnWriteAcquire:1;/* When set, clears the acquired write buffer before returning from ma_rb_acquire_write(). */
ma_bool8clearOnWriteAcquire;/* When set, clears the acquired write buffer before returning from ma_rb_acquire_write(). */
ma_allocation_callbacksallocationCallbacks;
ma_allocation_callbacksallocationCallbacks;
}ma_rb;
}ma_rb;
...
@@ -1811,7 +1813,7 @@ typedef struct
...
@@ -1811,7 +1813,7 @@ typedef struct
a device with settings outside of this range, but it just means the data will be converted using miniaudio's data conversion
a device with settings outside of this range, but it just means the data will be converted using miniaudio's data conversion
pipeline before sending the data to/from the device. Most programs will need to not worry about these values, but it's provided
pipeline before sending the data to/from the device. Most programs will need to not worry about these values, but it's provided
here mainly for informational purposes or in the rare case that someone might find it useful.
here mainly for informational purposes or in the rare case that someone might find it useful.
These will be set to 0 when returned by ma_context_enumerate_devices() or ma_context_get_devices().
These will be set to 0 when returned by ma_context_enumerate_devices() or ma_context_get_devices().
*/
*/
ma_uint32formatCount;
ma_uint32formatCount;
...
@@ -1829,7 +1831,7 @@ typedef struct
...
@@ -1829,7 +1831,7 @@ typedef struct
ma_formatformat;/* Sample format. If set to ma_format_unknown, all sample formats are supported. */
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_uint32channels;/* If set to 0, all channels are supported. */
ma_uint32sampleRate;/* If set to 0, all sample rates are supported. */
ma_uint32sampleRate;/* If set to 0, all sample rates are supported. */
ma_uint32flags;
ma_uint32flags;
}nativeDataFormats[64];
}nativeDataFormats[64];
}ma_device_info;
}ma_device_info;
...
@@ -1841,8 +1843,8 @@ struct ma_device_config
...
@@ -1841,8 +1843,8 @@ struct ma_device_config
ma_uint32periodSizeInMilliseconds;
ma_uint32periodSizeInMilliseconds;
ma_uint32periods;
ma_uint32periods;
ma_performance_profileperformanceProfile;
ma_performance_profileperformanceProfile;
ma_bool32noPreZeroedOutputBuffer;/* When set to true, the contents of the output buffer passed into the data callback will be left undefined rather than initialized to zero. */
ma_bool8noPreZeroedOutputBuffer;/* When set to true, the contents of the output buffer passed into the data callback will be left undefined rather than initialized to zero. */
ma_bool32noClip;/* When set to true, the contents of the output buffer passed into the data callback will be clipped after returning. Only applies when the playback sample format is f32. */
ma_bool8noClip;/* When set to true, the contents of the output buffer passed into the data callback will be clipped after returning. Only applies when the playback sample format is f32. */
ma_device_callback_procdataCallback;
ma_device_callback_procdataCallback;
ma_stop_procstopCallback;
ma_stop_procstopCallback;
void*pUserData;
void*pUserData;
...
@@ -1877,10 +1879,10 @@ struct ma_device_config
...
@@ -1877,10 +1879,10 @@ struct ma_device_config
struct
struct
{
{
ma_bool32noAutoConvertSRC;/* When set to true, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */
ma_bool8noAutoConvertSRC;/* When set to true, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */
ma_bool32noDefaultQualitySRC;/* When set to true, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */
ma_bool8noDefaultQualitySRC;/* When set to true, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */
ma_mutexdeviceEnumLock;/* Used to make ma_context_get_devices() thread safe. */
ma_mutexdeviceEnumLock;/* Used to make ma_context_get_devices() thread safe. */
ma_mutexdeviceInfoLock;/* Used to make ma_context_get_device_info() thread safe. */
ma_mutexdeviceInfoLock;/* Used to make ma_context_get_device_info() thread safe. */
ma_uint32deviceInfoCapacity;/* Total capacity of pDeviceInfos. */
ma_uint32deviceInfoCapacity;/* Total capacity of pDeviceInfos. */
ma_uint32playbackDeviceInfoCount;
ma_uint32playbackDeviceInfoCount;
ma_uint32captureDeviceInfoCount;
ma_uint32captureDeviceInfoCount;
ma_device_info*pDeviceInfos;/* Playback devices first, then capture. */
ma_device_info*pDeviceInfos;/* Playback devices first, then capture. */
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_bool8isBackendAsynchronous;/* Set when the context is initialized. Set to 1 for asynchronous backends such as Core Audio and JACK. Do not modify. */
ma_result(*onUninit)(ma_context*pContext);
ma_result(*onUninit)(ma_context*pContext);
ma_result(*onEnumDevices)(ma_context*pContext,ma_enum_devices_callback_proccallback,void*pUserData);/* Return false from the callback to stop enumeration. */
ma_result(*onEnumDevices)(ma_context*pContext,ma_enum_devices_callback_proccallback,void*pUserData);/* Return false from the callback to stop enumeration. */
...
@@ -2294,14 +2296,14 @@ struct ma_context
...
@@ -2294,14 +2296,14 @@ struct ma_context
ma_handlehCoreFoundation;
ma_handlehCoreFoundation;
ma_procCFStringGetCString;
ma_procCFStringGetCString;
ma_procCFRelease;
ma_procCFRelease;
ma_handlehCoreAudio;
ma_handlehCoreAudio;
ma_procAudioObjectGetPropertyData;
ma_procAudioObjectGetPropertyData;
ma_procAudioObjectGetPropertyDataSize;
ma_procAudioObjectGetPropertyDataSize;
ma_procAudioObjectSetPropertyData;
ma_procAudioObjectSetPropertyData;
ma_procAudioObjectAddPropertyListener;
ma_procAudioObjectAddPropertyListener;
ma_procAudioObjectRemovePropertyListener;
ma_procAudioObjectRemovePropertyListener;
ma_handlehAudioUnit;/* Could possibly be set to AudioToolbox on later versions of macOS. */
ma_handlehAudioUnit;/* Could possibly be set to AudioToolbox on later versions of macOS. */
ma_procAudioComponentFindNext;
ma_procAudioComponentFindNext;
ma_procAudioComponentInstanceDispose;
ma_procAudioComponentInstanceDispose;
...
@@ -2314,9 +2316,9 @@ struct ma_context
...
@@ -2314,9 +2316,9 @@ struct ma_context
ma_procAudioUnitSetProperty;
ma_procAudioUnitSetProperty;
ma_procAudioUnitInitialize;
ma_procAudioUnitInitialize;
ma_procAudioUnitRender;
ma_procAudioUnitRender;
/*AudioComponent*/ma_ptrcomponent;
/*AudioComponent*/ma_ptrcomponent;
ma_bool32noAudioSessionDeactivate;/* For tracking whether or not the iOS audio session should be explicitly deactivated. Set from the config in ma_context_init__coreaudio(). */
ma_bool32noAudioSessionDeactivate;/* For tracking whether or not the iOS audio session should be explicitly deactivated. Set from the config in ma_context_init__coreaudio(). */
}coreaudio;
}coreaudio;
#endif
#endif
...
@@ -2481,12 +2483,12 @@ struct ma_device
...
@@ -2481,12 +2483,12 @@ struct ma_device
ma_eventstopEvent;
ma_eventstopEvent;
ma_threadthread;
ma_threadthread;
ma_resultworkResult;/* This is set by the worker thread after it's finished doing a job. */
ma_resultworkResult;/* This is set by the worker thread after it's finished doing a job. */
ma_bool32usingDefaultSampleRate:1;
ma_bool8usingDefaultSampleRate;
ma_bool32usingDefaultBufferSize:1;
ma_bool8usingDefaultBufferSize;
ma_bool32usingDefaultPeriods:1;
ma_bool8usingDefaultPeriods;
ma_bool32isOwnerOfContext:1;/* When set to true, uninitializing the device will also uninitialize the context. Set to true when NULL is passed into ma_device_init(). */
ma_bool8isOwnerOfContext;/* When set to true, uninitializing the device will also uninitialize the context. Set to true when NULL is passed into ma_device_init(). */
ma_bool32noPreZeroedOutputBuffer:1;
ma_bool8noPreZeroedOutputBuffer;
ma_bool32noClip:1;
ma_bool8noClip;
volatilefloatmasterVolumeFactor;/* Volatile so we can use some thread safety when applying volume to periods. */
volatilefloatmasterVolumeFactor;/* Volatile so we can use some thread safety when applying volume to periods. */
ma_duplex_rbduplexRB;/* Intermediary buffer for duplex device on asynchronous backends. */
ma_duplex_rbduplexRB;/* Intermediary buffer for duplex device on asynchronous backends. */
struct
struct
...
@@ -2506,9 +2508,6 @@ struct ma_device
...
@@ -2506,9 +2508,6 @@ struct ma_device
ma_device_idid;/* If using an explicit device, will be set to a copy of the ID used for initialization. Otherwise cleared to 0. */
ma_device_idid;/* If using an explicit device, will be set to a copy of the ID used for initialization. Otherwise cleared to 0. */
charname[256];/* Maybe temporary. Likely to be replaced with a query API. */
charname[256];/* Maybe temporary. Likely to be replaced with a query API. */
ma_share_modeshareMode;/* Set to whatever was passed in when the device was initialized. */
ma_share_modeshareMode;/* Set to whatever was passed in when the device was initialized. */
ma_bool32usingDefaultFormat:1;
ma_bool32usingDefaultChannels:1;
ma_bool32usingDefaultChannelMap:1;
ma_formatformat;
ma_formatformat;
ma_uint32channels;
ma_uint32channels;
ma_channelchannelMap[MA_MAX_CHANNELS];
ma_channelchannelMap[MA_MAX_CHANNELS];
...
@@ -2519,15 +2518,15 @@ struct ma_device
...
@@ -2519,15 +2518,15 @@ struct ma_device
ma_uint32internalPeriodSizeInFrames;
ma_uint32internalPeriodSizeInFrames;
ma_uint32internalPeriods;
ma_uint32internalPeriods;
ma_data_converterconverter;
ma_data_converterconverter;
ma_bool8usingDefaultFormat;
ma_bool8usingDefaultChannels;
ma_bool8usingDefaultChannelMap;
}playback;
}playback;
struct
struct
{
{
ma_device_idid;/* If using an explicit device, will be set to a copy of the ID used for initialization. Otherwise cleared to 0. */
ma_device_idid;/* If using an explicit device, will be set to a copy of the ID used for initialization. Otherwise cleared to 0. */
charname[256];/* Maybe temporary. Likely to be replaced with a query API. */
charname[256];/* Maybe temporary. Likely to be replaced with a query API. */
ma_share_modeshareMode;/* Set to whatever was passed in when the device was initialized. */
ma_share_modeshareMode;/* Set to whatever was passed in when the device was initialized. */
ma_bool32usingDefaultFormat:1;
ma_bool32usingDefaultChannels:1;
ma_bool32usingDefaultChannelMap:1;
ma_formatformat;
ma_formatformat;
ma_uint32channels;
ma_uint32channels;
ma_channelchannelMap[MA_MAX_CHANNELS];
ma_channelchannelMap[MA_MAX_CHANNELS];
...
@@ -2538,6 +2537,9 @@ struct ma_device
...
@@ -2538,6 +2537,9 @@ struct ma_device
ma_uint32internalPeriodSizeInFrames;
ma_uint32internalPeriodSizeInFrames;
ma_uint32internalPeriods;
ma_uint32internalPeriods;
ma_data_converterconverter;
ma_data_converterconverter;
ma_bool8usingDefaultFormat;
ma_bool8usingDefaultChannels;
ma_bool8usingDefaultChannelMap;
}capture;
}capture;
union
union
...
@@ -2549,26 +2551,27 @@ struct ma_device
...
@@ -2549,26 +2551,27 @@ struct ma_device
/*IAudioClient**/ma_ptrpAudioClientCapture;
/*IAudioClient**/ma_ptrpAudioClientCapture;
/*IAudioRenderClient**/ma_ptrpRenderClient;
/*IAudioRenderClient**/ma_ptrpRenderClient;
/*IAudioCaptureClient**/ma_ptrpCaptureClient;
/*IAudioCaptureClient**/ma_ptrpCaptureClient;
/*IMMDeviceEnumerator**/ma_ptrpDeviceEnumerator;/* Used for IMMNotificationClient notifications. Required for detecting default device changes. */
/*IMMDeviceEnumerator**/ma_ptrpDeviceEnumerator;/* Used for IMMNotificationClient notifications. Required for detecting default device changes. */
ma_IMMNotificationClientnotificationClient;
ma_IMMNotificationClientnotificationClient;
/*HANDLE*/ma_handlehEventPlayback;/* Auto reset. Initialized to signaled. */
/*HANDLE*/ma_handlehEventPlayback;/* Auto reset. Initialized to signaled. */
/*HANDLE*/ma_handlehEventCapture;/* Auto reset. Initialized to unsignaled. */
/*HANDLE*/ma_handlehEventCapture;/* Auto reset. Initialized to unsignaled. */
ma_uint32actualPeriodSizeInFramesPlayback;/* Value from GetBufferSize(). internalPeriodSizeInFrames is not set to the _actual_ buffer size when low-latency shared mode is being used due to the way the IAudioClient3 API works. */
ma_uint32actualPeriodSizeInFramesPlayback;/* Value from GetBufferSize(). internalPeriodSizeInFrames is not set to the _actual_ buffer size when low-latency shared mode is being used due to the way the IAudioClient3 API works. */
ma_uint32actualPeriodSizeInFramesCapture;
ma_uint32actualPeriodSizeInFramesCapture;
ma_uint32originalPeriodSizeInFrames;
ma_uint32originalPeriodSizeInFrames;
ma_uint32originalPeriodSizeInMilliseconds;
ma_uint32originalPeriodSizeInMilliseconds;
ma_uint32originalPeriods;
ma_uint32originalPeriods;
ma_bool32hasDefaultPlaybackDeviceChanged;/* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */
ma_performance_profileoriginalPerformanceProfile;
ma_bool32hasDefaultCaptureDeviceChanged;/* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */
ma_bool32hasDefaultPlaybackDeviceChanged;/* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */
ma_bool32hasDefaultCaptureDeviceChanged;/* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */
ma_uint32periodSizeInFramesPlayback;
ma_uint32periodSizeInFramesPlayback;
ma_uint32periodSizeInFramesCapture;
ma_uint32periodSizeInFramesCapture;
ma_bool32isStartedCapture;/* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */
ma_bool32isStartedCapture;/* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */
ma_bool32isStartedPlayback;/* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */
ma_bool32isStartedPlayback;/* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */
ma_bool32noAutoConvertSRC:1;/* When set to true, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */
ma_bool8noAutoConvertSRC;/* When set to true, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */
ma_bool32noDefaultQualitySRC:1;/* When set to true, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */
ma_bool8noDefaultQualitySRC;/* When set to true, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */