Develop and Download Open Source Software

Browse Subversion Repository

Contents of /sound/SdlAudioInit.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 302 - (show annotations) (download) (as text)
Tue Mar 25 22:35:24 2008 UTC (16 years ago) by satofumi
File MIME type: text/x-c++src
File size: 907 byte(s)
add CdromPlayer.cpp
1 /*!
2 \file
3 \brief SDL ‰šŠyŽ‘Œš‚̏‰Šú‰ť
4
5 \author Satofumi KAMIMURA
6
7 $Id$
8 */
9
10 #include "SdlAudioInit.h"
11 #include "SdlInit.h"
12 #include "LogManager.h"
13 #include <SDL.h>
14 #include <stdlib.h>
15 #include <string>
16
17 using namespace beego;
18
19
20 struct SdlAudioInit::pImpl : private SdlInit {
21 static bool initialized;
22 };
23
24 bool SdlAudioInit::pImpl::initialized = false;
25
26
27 SdlAudioInit::SdlAudioInit(void) : pimpl(new pImpl) {
28 if (pimpl->initialized == false) {
29 if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) {
30 // ƒƒO‹L˜^
31 LogManager* log = LogManager::getObject();
32 std::string message = "SDL_InitSubSystem(SDL_INIT_AUDIO): " +
33 std::string(SDL_GetError());
34 log->write(LogManager::Error, message.c_str());
35 }
36 atexit(SDL_Quit);
37 pimpl->initialized = true;
38 }
39 }
40
41
42 SdlAudioInit::~SdlAudioInit(void) {
43 }
44
45
46 bool SdlAudioInit::isInitialized(void) {
47 return pimpl->initialized;
48 }

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26