ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

sound.cpp

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the AUTHORS
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #include "engines/grim/grim.h"
00024 #include "engines/grim/imuse/imuse.h"
00025 #include "engines/grim/emi/sound/emisound.h"
00026 #include "engines/grim/sound.h"
00027 
00028 namespace Grim {
00029 
00030 SoundPlayer *g_sound = nullptr;
00031 
00032 bool SoundPlayer::startVoice(const char *soundName, int volume, int pan) {
00033     if (g_grim->getGameType() == GType_GRIM)
00034         return g_imuse->startVoice(soundName, volume, pan);
00035     else
00036         return g_emiSound->startVoice(soundName, volume, pan);
00037 }
00038 
00039 bool SoundPlayer::getSoundStatus(const char *soundName) {
00040     if (g_grim->getGameType() == GType_GRIM)
00041         return g_imuse->getSoundStatus(soundName);
00042     else
00043         return g_emiSound->getSoundStatus(soundName);
00044 }
00045 
00046 void SoundPlayer::stopSound(const char *soundName) {
00047     if (g_grim->getGameType() == GType_GRIM) {
00048         g_imuse->stopSound(soundName);
00049         return;
00050     } else {
00051         g_emiSound->stopSound(soundName);
00052     }
00053 }
00054 
00055 int32 SoundPlayer::getPosIn16msTicks(const char *soundName) {
00056     if (g_grim->getGameType() == GType_GRIM)
00057         return g_imuse->getPosIn16msTicks(soundName);
00058     else
00059         return g_emiSound->getPosIn16msTicks(soundName);
00060 }
00061 
00062 void SoundPlayer::setVolume(const char *soundName, int volume) {
00063     if (g_grim->getGameType() == GType_GRIM) {
00064         g_imuse->setVolume(soundName, volume);
00065     } else {
00066         g_emiSound->setVolume(soundName, volume);
00067     }
00068 }
00069 
00070 void SoundPlayer::setPan(const char *soundName, int pan) {
00071     if (g_grim->getGameType() == GType_GRIM) {
00072         g_imuse->setPan(soundName, pan);
00073     } else {
00074         g_emiSound->setPan(soundName, pan);
00075     }
00076 }
00077 
00078 void SoundPlayer::setMusicState(int stateId) {
00079     if (g_grim->getGameType() == GType_GRIM) {
00080         g_imuse->setMusicState(stateId);
00081     } else {
00082         g_emiSound->setMusicState(stateId);
00083     }
00084 }
00085 
00086 void SoundPlayer::flushTracks() {
00087     if (g_grim->getGameType() == GType_GRIM) {
00088         g_imuse->flushTracks();
00089     } else {
00090         g_emiSound->flushTracks();
00091     }
00092 }
00093 
00094 void SoundPlayer::restoreState(SaveGame *savedState) {
00095     if (g_grim->getGameType() == GType_GRIM) {
00096         g_imuse->restoreState(savedState);
00097     } else {
00098         g_emiSound->restoreState(savedState);
00099     }
00100 }
00101 
00102 
00103 void SoundPlayer::saveState(SaveGame *savedState) {
00104     if (g_grim->getGameType() == GType_GRIM) {
00105         g_imuse->saveState(savedState);
00106     } else {
00107         g_emiSound->saveState(savedState);
00108     }
00109 }
00110 
00111 } // end of namespace Grim


Generated on Sat Oct 19 2019 05:01:06 for ResidualVM by doxygen 1.7.1
curved edge   curved edge