From 1b5e58d95a55bcf0a2bb28718a3731f3a2b38fcb Mon Sep 17 00:00:00 2001 From: Sheldon Lee Date: Mon, 4 Nov 2024 23:11:42 +0800 Subject: [PATCH] Update function names + use new function --- main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 73f90c8..81c30a2 100644 --- a/main.c +++ b/main.c @@ -143,7 +143,7 @@ int handle_input(SDL_Event* event, state* state) if (state->device_index == -1 || !state->audio.recording_device_id) break; audio_buffer_reset(&state->audio); state->audio.recording_buffer_position = 0; - audio_playback_pause(&state->audio, 1, 0); + audio_device_pause(&state->audio, 1, 0); state->application_state = RECORDING; state->update_ui = 1; break; @@ -156,7 +156,7 @@ int handle_input(SDL_Event* event, state* state) if (device_index_new == -1) break; if (device_index_new == state->device_index) break; state->device_index = device_index_new; - SDL_CloseAudioDevice(state->audio.recording_device_id); + audio_device_close(&state->audio, 1); audio_recording_init(&state->audio, state->device_index); state->update_ui = 1; @@ -166,7 +166,7 @@ int handle_input(SDL_Event* event, state* state) switch (keysym) { case SDLK_q: case SDLK_ESCAPE: - audio_playback_pause(&state->audio, 1, 1); + audio_device_pause(&state->audio, 1, 1); state->application_state = SELECTING_DEVICE; state->update_ui = 1; break; @@ -180,7 +180,7 @@ int handle_input(SDL_Event* event, state* state) if (!state->audio.playback_device_id) audio_playback_init(&state->audio); state->audio.recording_buffer_position = 0; - audio_playback_pause(&state->audio, 0, 0); + audio_device_pause(&state->audio, 0, 0); state->application_state = PLAYBACK; state->update_ui = 1; break; @@ -196,7 +196,7 @@ int handle_input(SDL_Event* event, state* state) switch (keysym) { case SDLK_q: case SDLK_ESCAPE: - audio_playback_pause(&state->audio, 0, 1); + audio_device_pause(&state->audio, 0, 1); state->application_state = RECORDED; state->update_ui = 1; break;