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 GBSDLAudio {
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 GBAudio* psg;
26 struct GBAThread* thread;
27 struct mCoreSync* sync;
28};
29
30bool GBSDLInitAudio(struct GBSDLAudio* context, struct GBAThread*);
31void GBSDLDeinitAudio(struct GBSDLAudio* context);
32void GBSDLPauseAudio(struct GBSDLAudio* context);
33void GBSDLResumeAudio(struct GBSDLAudio* context);
34
35#endif