all repos — mgba @ 38cb3eeaa857e744917d3ed57263f7585bf74233

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
13#include "gba-audio.h"
14
15struct GBASDLAudio {
16	// Input
17	size_t samples;
18
19	// State
20	SDL_AudioSpec desiredSpec;
21	SDL_AudioSpec obtainedSpec;
22#if RESAMPLE_LIBRARY != RESAMPLE_BLIP_BUF
23	float ratio;
24#endif
25#if RESAMPLE_LIBRARY == RESAMPLE_NN
26	float drift;
27#endif
28
29	struct GBAThread* thread;
30};
31
32bool GBASDLInitAudio(struct GBASDLAudio* context, struct GBAThread* threadContext);
33void GBASDLDeinitAudio(struct GBASDLAudio* context);
34void GBASDLPauseAudio(struct GBASDLAudio* context);
35void GBASDLResumeAudio(struct GBASDLAudio* context);
36
37#endif