/** ****************************************************************************** @file /common/rm/rmsoundi.cpp @brief Interface k RMsound @author Vta @version 1.0 ******************************************************************************/ #include "common/rm/rmsoundi.h" namespace rm { int TRM_sound_i::startNewGroup() { return this->rmsound->startNewGroup(); } int TRM_sound_i::freeLastGroup() { return this->rmsound->freeLastGroup(); } int TRM_sound_i::getGroupOfSound(int id) { return this->rmsound->getGroupOfObject(id); } int TRM_sound_i::getCurrentGroup() { return this->rmsound->getCurrentGroup(); } void TRM_sound_i::freeSound(int id) { this->rmsound->freeSound(id); } void TRM_sound_i::playMusic(int playlist) { this->rmsound->playMusic(playlist); } int TRM_sound_i::getMaxId() { return this->rmsound->getMaxId(); } #ifndef _K_EDITOR_ Mix_Music * TRM_sound_i::getMusic(int id) { TSound * temp=this->rmsound->getSound(id); if ( (temp->type!=SOUND_MUSIC_CODE) ) { GLOBALLOGID(PRIORITY_FATAL, "RMsound attempt of accesing unloaded sound or wrong format, id %i",id); THROW(E_8K_RM,"RMsound attempt of accesing unloaded sound or wrong format"); } return ((Mix_Music *)temp->data); } Mix_Chunk * TRM_sound_i::getSample(int id) { TSound * temp=this->rmsound->getSound(id); if ( temp->type!=SOUND_SAMPLE_CODE) { GLOBALLOGID(PRIORITY_FATAL, "RMsound attempt of accesing unloaded sound or wrong format, id %i",id); THROW(E_8K_RM,"RMsound attempt of accesing unloaded sound or wrong format"); } return ((Mix_Chunk *)temp->data); } #endif void TRM_sound_i::request(int id) { this->rmsound->request(id); } void TRM_sound_i::loadBuffer(void) { this->rmsound->loadBuffer(); } void TRM_sound_i::loadNow(int id) { this->rmsound->loadSound(id); } #ifndef _K_EDITOR_ int TRM_sound_i::getSounds(DA ** snds) { return this->rmsound->getSounds(snds); } int TRM_sound_i::getSounds(TSound ** sounds, int size) { DA * daids; int j=1,max; max=this->rmsound->getSounds(&daids); int i; for (i=0;irmsound->getSoundsCount(); } int TRM_sound_i::getSoundsLoaded() { return this->rmsound->getSoundsCount(); } TRM_sound_i::TRM_sound_i(TRM_sound * globalrmsound) { this->rmsound=globalrmsound; GLOBALLOGID(PRIORITY_CONFIRM ,"RMsoundi was created"); } TRM_sound_i::~TRM_sound_i() { GLOBALLOGID(PRIORITY_CONFIRM ,"RMsoundi was destroyed"); } } // namespace rm