@@ -2095,12 +2095,12 @@ extern fn SDL_GetCurrentAudioDriver() [*:0]const u8;
2095
2095
///
2096
2096
/// Returns a 0 terminated array of device instance IDs or NULL on error;
2097
2097
/// call SDL_free() when it is no longer needed.
2098
- pub fn getAudioPlaybackDevices () Error ! []AudioDeviceID {
2098
+ pub fn getAudioPlaybackDevices () Error ! []AudioDeviceId {
2099
2099
var count : c_int = undefined ;
2100
2100
const maybe_list = SDL_GetAudioPlaybackDevices (& count );
2101
2101
return if (maybe_list ) | list | list [0.. @intCast (count )] else makeError ();
2102
2102
}
2103
- extern fn SDL_GetAudioPlaybackDevices (out_count : ? * c_int ) ? [* ]AudioDeviceID ;
2103
+ extern fn SDL_GetAudioPlaybackDevices (out_count : ? * c_int ) ? [* ]AudioDeviceId ;
2104
2104
2105
2105
/// Get a list of currently-connected audio recording devices.
2106
2106
///
@@ -2111,27 +2111,27 @@ extern fn SDL_GetAudioPlaybackDevices(out_count: ?*c_int) ?[*]AudioDeviceID;
2111
2111
///
2112
2112
/// Returns a 0 terminated array of device instance IDs or NULL on error;
2113
2113
/// call SDL_free() when it is no longer needed.
2114
- pub fn getAudioRecordingDevices () Error ! []AudioDeviceID {
2114
+ pub fn getAudioRecordingDevices () Error ! []AudioDeviceId {
2115
2115
var count : c_int = undefined ;
2116
2116
const maybe_list = SDL_GetAudioRecordingDevices (& count );
2117
2117
return if (maybe_list ) | list | list [0.. @intCast (count )] else makeError ();
2118
2118
}
2119
- extern fn SDL_GetAudioRecordingDevices (out_count : ? * c_int ) ? [* ]AudioDeviceID ;
2119
+ extern fn SDL_GetAudioRecordingDevices (out_count : ? * c_int ) ? [* ]AudioDeviceId ;
2120
2120
2121
2121
/// Get the human-readable name of a specific audio device.
2122
2122
pub const getAudioDeviceName = SDL_GetAudioDeviceName ;
2123
- extern fn SDL_GetAudioDeviceName (AudioDeviceID ) [* :0 ]const u8 ;
2123
+ extern fn SDL_GetAudioDeviceName (AudioDeviceId ) [* :0 ]const u8 ;
2124
2124
2125
2125
/// Get the current audio format of a specific audio device.
2126
- pub fn getAudioDeviceFormat (devid : AudioDeviceID ) Error ! struct { spec : AudioSpec , sample_frames : c_int } {
2126
+ pub fn getAudioDeviceFormat (devid : AudioDeviceId ) Error ! struct { spec : AudioSpec , sample_frames : c_int } {
2127
2127
var spec : AudioSpec = undefined ;
2128
2128
var sample_frames : c_int = undefined ;
2129
2129
if (SDL_GetAudioDeviceFormat (devid , & spec , & sample_frames ) == False ) {
2130
2130
return makeError ();
2131
2131
}
2132
2132
return .{ .spec = spec , .sample_frames = sample_frames };
2133
2133
}
2134
- extern fn SDL_GetAudioDeviceFormat (AudioDeviceID , out_spec : * AudioSpec , out_sample_frames : * c_int ) Bool ;
2134
+ extern fn SDL_GetAudioDeviceFormat (AudioDeviceId , out_spec : * AudioSpec , out_sample_frames : * c_int ) Bool ;
2135
2135
2136
2136
/// Get the current audio format of a specific audio device.
2137
2137
/// Channel maps are optional; most things do not need them, instead passing
@@ -2143,29 +2143,29 @@ extern fn SDL_GetAudioDeviceFormat(AudioDeviceID, out_spec: *AudioSpec, out_samp
2143
2143
/// Returns an array of the current channel mapping, with as many elements as
2144
2144
/// the current output spec's channels, or NULL if default. This
2145
2145
/// should be freed with SDL_free() when it is no longer needed.
2146
- pub fn getAudioDeviceChannelMap (devid : AudioDeviceID ) ? []c_int {
2146
+ pub fn getAudioDeviceChannelMap (devid : AudioDeviceId ) ? []c_int {
2147
2147
var count : c_int = undefined ;
2148
2148
return if (SDL_GetAudioDeviceChannelMap (devid , & count )) | list_ptr | list_ptr [0.. @intCast (count )] else null ;
2149
2149
}
2150
- extern fn SDL_GetAudioDeviceChannelMap (AudioDeviceID , out_count : * c_int ) [* c ]c_int ;
2150
+ extern fn SDL_GetAudioDeviceChannelMap (AudioDeviceId , out_count : * c_int ) [* c ]c_int ;
2151
2151
2152
2152
/// Open a specific audio device.
2153
- pub fn openAudioDevice (device : AudioDeviceID , spec : ? * const AudioSpec ) Error ! void {
2153
+ pub fn openAudioDevice (device : AudioDeviceId , spec : ? * const AudioSpec ) Error ! void {
2154
2154
if (SDL_OpenAudioDevice (device , spec ) == 0 ) {
2155
2155
return makeError ();
2156
2156
}
2157
2157
}
2158
- extern fn SDL_OpenAudioDevice (AudioDeviceID , ? * const AudioSpec ) AudioDeviceID ;
2158
+ extern fn SDL_OpenAudioDevice (AudioDeviceId , ? * const AudioSpec ) AudioDeviceId ;
2159
2159
2160
- pub fn isAudioDevicePhysical (devid : AudioDeviceID ) bool {
2160
+ pub fn isAudioDevicePhysical (devid : AudioDeviceId ) bool {
2161
2161
return SDL_IsAudioDevicePhysical (devid ) == True ;
2162
2162
}
2163
- extern fn SDL_IsAudioDevicePhysical (AudioDeviceID ) Bool ;
2163
+ extern fn SDL_IsAudioDevicePhysical (AudioDeviceId ) Bool ;
2164
2164
2165
- pub fn isAudioDevicePlayback (devid : AudioDeviceID ) bool {
2165
+ pub fn isAudioDevicePlayback (devid : AudioDeviceId ) bool {
2166
2166
return SDL_IsAudioDevicePlayback (devid ) == True ;
2167
2167
}
2168
- extern fn SDL_IsAudioDevicePlayback (AudioDeviceID ) Bool ;
2168
+ extern fn SDL_IsAudioDevicePlayback (AudioDeviceId ) Bool ;
2169
2169
2170
2170
/// Use this function to pause audio playback on a specified device.
2171
2171
///
@@ -2183,10 +2183,10 @@ extern fn SDL_IsAudioDevicePlayback(AudioDeviceID) Bool;
2183
2183
///
2184
2184
/// Physical devices can not be paused or unpaused, only logical devices
2185
2185
/// created through SDL_OpenAudioDevice() can be.
2186
- pub fn pauseAudioDevice (device : AudioDeviceID ) bool {
2186
+ pub fn pauseAudioDevice (device : AudioDeviceId ) bool {
2187
2187
return SDL_PauseAudioDevice (device ) == True ;
2188
2188
}
2189
- extern fn SDL_PauseAudioDevice (AudioDeviceID ) Bool ;
2189
+ extern fn SDL_PauseAudioDevice (AudioDeviceId ) Bool ;
2190
2190
2191
2191
/// Use this function to unpause audio playback on a specified device.
2192
2192
///
@@ -2201,10 +2201,10 @@ extern fn SDL_PauseAudioDevice(AudioDeviceID) Bool;
2201
2201
///
2202
2202
/// Physical devices can not be paused or unpaused, only logical devices
2203
2203
/// created through SDL_OpenAudioDevice() can be.
2204
- pub fn resumeAudioDevice (device : AudioDeviceID ) bool {
2204
+ pub fn resumeAudioDevice (device : AudioDeviceId ) bool {
2205
2205
return SDL_ResumeAudioDevice (device ) == True ;
2206
2206
}
2207
- extern fn SDL_ResumeAudioDevice (AudioDeviceID ) Bool ;
2207
+ extern fn SDL_ResumeAudioDevice (AudioDeviceId ) Bool ;
2208
2208
2209
2209
/// Use this function to query if an audio device is paused.
2210
2210
///
@@ -2214,20 +2214,20 @@ extern fn SDL_ResumeAudioDevice(AudioDeviceID) Bool;
2214
2214
///
2215
2215
/// Physical devices can not be paused or unpaused, only logical devices
2216
2216
/// created through SDL_OpenAudioDevice() can be.
2217
- pub fn audioDevicePaused (device : AudioDeviceID ) bool {
2217
+ pub fn audioDevicePaused (device : AudioDeviceId ) bool {
2218
2218
return SDL_AudioDevicePaused (device ) == True ;
2219
2219
}
2220
- extern fn SDL_AudioDevicePaused (AudioDeviceID ) Bool ;
2220
+ extern fn SDL_AudioDevicePaused (AudioDeviceId ) Bool ;
2221
2221
2222
2222
/// Get the gain of an audio device.
2223
2223
///
2224
2224
/// Physical devices may not have their gain changed, only logical devices, and
2225
2225
/// this function will always return -1.0f when used on physical devices.
2226
- pub fn getAudioDeviceGain (device : AudioDeviceID ) Error ! f32 {
2226
+ pub fn getAudioDeviceGain (device : AudioDeviceId ) Error ! f32 {
2227
2227
const gain = SDL_GetAudioDeviceGain (device );
2228
2228
return if (gain == -1.0 ) makeError () else gain ;
2229
2229
}
2230
- extern fn SDL_GetAudioDeviceGain (AudioDeviceID ) f32 ;
2230
+ extern fn SDL_GetAudioDeviceGain (AudioDeviceId ) f32 ;
2231
2231
2232
2232
/// Change the gain of an audio device.
2233
2233
///
@@ -2243,12 +2243,12 @@ extern fn SDL_GetAudioDeviceGain(AudioDeviceID) f32;
2243
2243
/// an audiostream; that recording audiostream can then adjust its gain further
2244
2244
/// when outputting the data elsewhere, if it likes, but that second gain is
2245
2245
/// not applied until the data leaves the audiostream again.
2246
- pub fn setAudioDeviceGain (device : AudioDeviceID , gain : f32 ) Error ! void {
2246
+ pub fn setAudioDeviceGain (device : AudioDeviceId , gain : f32 ) Error ! void {
2247
2247
if (SDL_SetAudioDeviceGain (device , gain ) == False ) {
2248
2248
return makeError ();
2249
2249
}
2250
2250
}
2251
- extern fn SDL_SetAudioDeviceGain (AudioDeviceID , f32 ) Bool ;
2251
+ extern fn SDL_SetAudioDeviceGain (AudioDeviceId , f32 ) Bool ;
2252
2252
2253
2253
/// Close a previously-opened audio device.
2254
2254
///
@@ -2258,7 +2258,7 @@ extern fn SDL_SetAudioDeviceGain(AudioDeviceID, f32) Bool;
2258
2258
/// hardware, so that applications don't drop the last buffer of data they
2259
2259
/// supplied if terminating immediately afterwards.
2260
2260
pub const closeAudioDevice = SDL_CloseAudioDevice ;
2261
- extern fn SDL_CloseAudioDevice (AudioDeviceID ) void ;
2261
+ extern fn SDL_CloseAudioDevice (AudioDeviceId ) void ;
2262
2262
2263
2263
// TODO
2264
2264
// - SDL_BindAudioStreams
@@ -2272,7 +2272,7 @@ extern fn SDL_CloseAudioDevice(AudioDeviceID) void;
2272
2272
///
2273
2273
/// If not bound, or invalid, this returns zero, which is not a valid device ID.
2274
2274
pub const getAudioStreamDevice = SDL_GetAudioStreamDevice ;
2275
- extern fn SDL_GetAudioStreamDevice (* AudioStream ) AudioDeviceID ;
2275
+ extern fn SDL_GetAudioStreamDevice (* AudioStream ) AudioDeviceId ;
2276
2276
2277
2277
// TODO
2278
2278
// - SDL_CreateAudioStream
@@ -2413,11 +2413,11 @@ pub const AudioStreamCallback = *const fn (
2413
2413
///
2414
2414
/// Destroying the returned stream with SDL_DestroyAudioStream will also close
2415
2415
/// the audio device associated with this stream.
2416
- pub fn openAudioDeviceStream (device : AudioDeviceID , spec : * const AudioSpec , callback : ? AudioStreamCallback , userdata : * anyopaque ) Error ! * AudioStream {
2416
+ pub fn openAudioDeviceStream (device : AudioDeviceId , spec : * const AudioSpec , callback : ? AudioStreamCallback , userdata : * anyopaque ) Error ! * AudioStream {
2417
2417
const maybe_stream = SDL_OpenAudioDeviceStream (device , spec , callback , userdata );
2418
2418
return if (maybe_stream ) | stream | stream else makeError ();
2419
2419
}
2420
- extern fn SDL_OpenAudioDeviceStream (AudioDeviceID , * const AudioSpec , ? AudioStreamCallback , * anyopaque ) ? * AudioStream ;
2420
+ extern fn SDL_OpenAudioDeviceStream (AudioDeviceId , * const AudioSpec , ? AudioStreamCallback , * anyopaque ) ? * AudioStream ;
2421
2421
2422
2422
// TODO
2423
2423
// - SDL_AudioPostmixCallback
0 commit comments