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