From fa234f9663b992cf50bcf865a1cde6845b42193c Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 21 May 2018 16:02:00 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=94=B9audio=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/audio/audio.cpp | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) (limited to 'src/libjin/audio/audio.cpp') diff --git a/src/libjin/audio/audio.cpp b/src/libjin/audio/audio.cpp index 7142625..edba496 100644 --- a/src/libjin/audio/audio.cpp +++ b/src/libjin/audio/audio.cpp @@ -6,7 +6,7 @@ namespace jin { namespace audio { - + shared Audio* Audio::audio = NULL; bool Audio::init(const SettingBase* setting) @@ -20,40 +20,5 @@ namespace audio CallOnce(_quit()); } - onlyonce bool Audio::_init(const SettingBase* s) - { - if (SDL_Init(SDL_INIT_AUDIO) < 0) - return false; - - const AudioSetting* setting = (AudioSetting*)s; - SDL_AudioSpec wanted; - zero(wanted); - wanted.freq = setting->freq; - wanted.format = setting->format; - wanted.channels = setting->channels; - wanted.samples = setting->samples; - wanted.userdata = setting->userdata; - wanted.callback = setting->callback; - - if (SDL_OpenAudio(&wanted, NULL) < 0) - { - return false; - } - // start audio - SDL_PauseAudio(0); - return true; - } - - onlyonce void Audio::_quit() - { - SDL_CloseAudio(); - delete audio; - } - - shared void defaultCallback(void *udata, Uint8 *stream, int len) - { - - } - } } \ No newline at end of file -- cgit v1.1-26-g67d0