audio: Renamed new API SDL_UnpauseAudioDevice to SDL_ResumeAudioDevice.

This commit is contained in:
Ryan C. Gordon 2023-08-05 19:20:14 -04:00
parent 2b0c0f5b6b
commit e7d56dd0b2
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
9 changed files with 15 additions and 15 deletions

View File

@ -308,10 +308,10 @@ expression e;
+ SDL_PauseAudioDevice(e)
|
- SDL_PauseAudioDevice(e, 0)
+ SDL_UnpauseAudioDevice(e)
+ SDL_ResumeAudioDevice(e)
|
- SDL_PauseAudioDevice(e, SDL_FALSE)
+ SDL_UnpauseAudioDevice(e)
+ SDL_ResumeAudioDevice(e)
)
@@
@ -321,7 +321,7 @@ expression e, pause_on;
+ if (pause_on) {
+ SDL_PauseAudioDevice(e);
+ } else {
+ SDL_UnpauseAudioDevice(e);
+ SDL_ResumeAudioDevice(e);
+ }

View File

@ -148,7 +148,7 @@ Rather than iterating over audio devices using a device index, there is a new fu
SDL_LockAudioDevice() and SDL_UnlockAudioDevice() have been removed, since there is no callback in another thread to protect. SDL's audio subsystem and SDL_AudioStream maintain their own locks internally, so audio streams are safe to use from any thread. If the app assigns a callback to a specific stream, it can use the stream's lock through SDL_LockAudioStream() if necessary.
SDL_PauseAudioDevice() no longer takes a second argument; it always pauses the device. To unpause, use SDL_UnpauseAudioDevice().
SDL_PauseAudioDevice() no longer takes a second argument; it always pauses the device. To unpause, use SDL_ResumeAudioDevice().
Audio devices, opened by SDL_OpenAudioDevice(), no longer start in a paused state, as they don't begin processing audio until a stream is bound.

View File

@ -438,7 +438,7 @@ extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDeviceID
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_UnpauseAudioDevice
* \sa SDL_ResumeAudioDevice
* \sa SDL_IsAudioDevicePaused
*/
extern DECLSPEC int SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
@ -466,10 +466,10 @@ extern DECLSPEC int SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_UnpauseAudioDevice
* \sa SDL_ResumeAudioDevice
* \sa SDL_IsAudioDevicePaused
*/
extern DECLSPEC int SDLCALL SDL_UnpauseAudioDevice(SDL_AudioDeviceID dev);
extern DECLSPEC int SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
/**
* Use this function to query if an audio device is paused.
@ -489,7 +489,7 @@ extern DECLSPEC int SDLCALL SDL_UnpauseAudioDevice(SDL_AudioDeviceID dev);
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_PauseAudioDevice
* \sa SDL_UnpauseAudioDevice
* \sa SDL_ResumeAudioDevice
* \sa SDL_IsAudioDevicePaused
*/
extern DECLSPEC SDL_bool SDLCALL SDL_IsAudioDevicePaused(SDL_AudioDeviceID dev);

View File

@ -1322,7 +1322,7 @@ int SDL_PauseAudioDevice(SDL_AudioDeviceID devid)
return SetLogicalAudioDevicePauseState(devid, 1);
}
int SDLCALL SDL_UnpauseAudioDevice(SDL_AudioDeviceID devid)
int SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID devid)
{
return SetLogicalAudioDevicePauseState(devid, 0);
}

View File

@ -884,7 +884,7 @@ SDL3_0.0.0 {
SDL_GetSilenceValueForFormat;
SDL_LoadWAV;
SDL_PauseAudioDevice;
SDL_UnpauseAudioDevice;
SDL_ResumeAudioDevice;
SDL_IsAudioDevicePaused;
SDL_GetAudioStreamBinding;
SDL_ShowWindowSystemMenu;

View File

@ -909,7 +909,7 @@
#define SDL_GetSilenceValueForFormat SDL_GetSilenceValueForFormat_REAL
#define SDL_LoadWAV SDL_LoadWAV_REAL
#define SDL_PauseAudioDevice SDL_PauseAudioDevice_REAL
#define SDL_UnpauseAudioDevice SDL_UnpauseAudioDevice_REAL
#define SDL_ResumeAudioDevice SDL_ResumeAudioDevice_REAL
#define SDL_IsAudioDevicePaused SDL_IsAudioDevicePaused_REAL
#define SDL_GetAudioStreamBinding SDL_GetAudioStreamBinding_REAL
#define SDL_ShowWindowSystemMenu SDL_ShowWindowSystemMenu_REAL

View File

@ -953,7 +953,7 @@ SDL_DYNAPI_PROC(int,SDL_ConvertAudioSamples,(const SDL_AudioSpec *a, const Uint8
SDL_DYNAPI_PROC(int,SDL_GetSilenceValueForFormat,(SDL_AudioFormat a),(a),return)
SDL_DYNAPI_PROC(int,SDL_LoadWAV,(const char *a, SDL_AudioSpec *b, Uint8 **c, Uint32 *d),(a,b,c,d),return)
SDL_DYNAPI_PROC(int,SDL_PauseAudioDevice,(SDL_AudioDeviceID a),(a),return)
SDL_DYNAPI_PROC(int,SDL_UnpauseAudioDevice,(SDL_AudioDeviceID a),(a),return)
SDL_DYNAPI_PROC(int,SDL_ResumeAudioDevice,(SDL_AudioDeviceID a),(a),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_IsAudioDevicePaused,(SDL_AudioDeviceID a),(a),return)
SDL_DYNAPI_PROC(SDL_AudioDeviceID,SDL_GetAudioStreamBinding,(SDL_AudioStream *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_ShowWindowSystemMenu,(SDL_Window *a, int b, int c),(a,b,c),return)

View File

@ -43,13 +43,13 @@ static void loop(void)
} else if (e.type == SDL_EVENT_MOUSE_BUTTON_DOWN) {
if (e.button.button == 1) {
SDL_PauseAudioDevice(devid_out);
SDL_UnpauseAudioDevice(devid_in);
SDL_ResumeAudioDevice(devid_in);
}
} else if (e.type == SDL_EVENT_MOUSE_BUTTON_UP) {
if (e.button.button == 1) {
SDL_PauseAudioDevice(devid_in);
SDL_FlushAudioStream(stream_in); /* so no samples are held back for resampling purposes. */
SDL_UnpauseAudioDevice(devid_out);
SDL_ResumeAudioDevice(devid_out);
}
}
}

View File

@ -123,7 +123,7 @@ test_multi_audio(SDL_AudioDeviceID *devices, int devcount)
/* try to start all the devices about the same time. SDL does not guarantee sync across physical devices. */
for (i = 0; i < devcount; i++) {
if (devices[i]) {
SDL_UnpauseAudioDevice(devices[i]);
SDL_ResumeAudioDevice(devices[i]);
}
}