all repos — mgba @ 93b7779cb22a8ec64cf3ef8c4874ac9ac7ccbe7b

mGBA Game Boy Advance Emulator

src/platform/sdl/sdl-audio.h (view raw)

 1/* Copyright (c) 2013-2014 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#ifndef SDL_AUDIO_H
 7#define SDL_AUDIO_H
 8
 9#include "util/common.h"
10
11#include <SDL.h>
12
13struct GBASDLAudio {
14	// Input
15	size_t samples;
16
17	// State
18	SDL_AudioSpec desiredSpec;
19	SDL_AudioSpec obtainedSpec;
20	float ratio;
21#ifndef USE_FFMPEG
22	float drift;
23#else
24	struct AVAudioResampleContext* avr;
25#endif
26
27	struct GBAThread* thread;
28};
29
30bool GBASDLInitAudio(struct GBASDLAudio* context, struct GBAThread* threadContext);
31void GBASDLDeinitAudio(struct GBASDLAudio* context);
32void GBASDLPauseAudio(struct GBASDLAudio* context);
33void GBASDLResumeAudio(struct GBASDLAudio* context);
34
35#endif