Browse Subversion Repository
Contents of /sound/SdlCdromInit.cpp
Parent Directory
| 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: 905 byte(s)
add CdromPlayer.cpp
| 1 |
/*! |
| 2 |
\file |
| 3 |
\brief SDL CDROM Ěúť |
| 4 |
|
| 5 |
\author Satofumi KAMIMURA |
| 6 |
|
| 7 |
$Id$ |
| 8 |
*/ |
| 9 |
|
| 10 |
#include "SdlCdromInit.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 SdlCdromInit::pImpl : private SdlInit { |
| 21 |
static bool initialized; |
| 22 |
}; |
| 23 |
|
| 24 |
bool SdlCdromInit::pImpl::initialized = false; |
| 25 |
|
| 26 |
|
| 27 |
SdlCdromInit::SdlCdromInit(void) : pimpl(new pImpl) { |
| 28 |
if (pimpl->initialized == false) { |
| 29 |
if (SDL_InitSubSystem(SDL_INIT_CDROM) < 0) { |
| 30 |
// OL^ |
| 31 |
LogManager* log = LogManager::getObject(); |
| 32 |
std::string message = "SDL_InitSubSystem(SDL_INIT_CDROM): " + |
| 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 |
SdlCdromInit::~SdlCdromInit(void) { |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
bool SdlCdromInit::isInitialized(void) { |
| 47 |
return pimpl->initialized; |
| 48 |
} |
|