all repos — mgba @ 74c4cbe33e5bc67ef2b0eb1cb6bd518270735e63

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#if SDL_VERSION_ATLEAST(2, 0, 0)
29	SDL_AudioDeviceID deviceId;
30#endif
31
32	struct GBAThread* thread;
33};
34
35bool GBASDLInitAudio(struct GBASDLAudio* context, struct GBAThread* threadContext);
36void GBASDLDeinitAudio(struct GBASDLAudio* context);
37void GBASDLPauseAudio(struct GBASDLAudio* context);
38void GBASDLResumeAudio(struct GBASDLAudio* context);
39
40#endif