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 mSDLAudio {
14 // Input
15 size_t samples;
16 unsigned sampleRate;
17
18 // State
19 SDL_AudioSpec desiredSpec;
20 SDL_AudioSpec obtainedSpec;
21#if SDL_VERSION_ATLEAST(2, 0, 0)
22 SDL_AudioDeviceID deviceId;
23#endif
24
25 struct mCore* core;
26 struct GBAThread* thread;
27 struct mCoreSync* sync;
28};
29
30bool mSDLInitAudio(struct mSDLAudio* context, struct GBAThread*);
31void mSDLDeinitAudio(struct mSDLAudio* context);
32void mSDLPauseAudio(struct mSDLAudio* context);
33void mSDLResumeAudio(struct mSDLAudio* context);
34
35#endif