00001 /* 00002 Copyright 2011, CERTEC 00003 00004 This file is part of HIPP. 00005 00006 HIPP is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 HIPP is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with HIPP. If not, see <http://www.gnu.org/licenses/>. 00018 00019 */ 00020 00021 /*=============================================================================================== 00022 CPlaySoundFile FMod wrapper class for playing wav sound files 00023 00024 February 2006, Kirre Rassmus-Gröhn, Certec, Lund University 00025 http://www.certec.lth.se 00026 00027 Code may be copied and reused within MICOLE IST-2003-511592 STP 00028 Please refer to code originators 00029 00030 ===============================================================================================*/ 00031 #ifndef PLAYSOUNDFMOD_H 00032 #define PLAYSOUNDFMOD_H 00033 00034 #include "fmod.hpp" 00035 #include "fmod_errors.h" 00036 00037 class CFModSoundManager { 00038 public: 00039 CFModSoundManager(); 00040 ~CFModSoundManager(); 00041 00042 FMOD::System *m_system; 00043 FMOD_RESULT m_result; 00044 unsigned int m_version; 00045 }; 00046 00047 class CSampleSound { 00048 public: 00049 FMOD::Channel *m_channel; 00050 FMOD::Sound *m_sound; 00051 FMOD_RESULT m_result; 00052 CFModSoundManager *m_sound_mgr; 00053 00054 CSampleSound(CFModSoundManager *sound_mgr); 00055 ~CSampleSound(); 00056 void Load(const char *file_name); 00057 void Play(); 00058 void LoadAndPlay(const char *file_name); 00059 void Stop(); 00060 void ChangeVolume(float delta); 00061 void SetVolume(float new_vol); 00062 void ChangeFrequency(float delta); 00063 void SetFrequency(float new_freq); 00064 void ChangePan(float delta); 00065 void SetPan(float new_pan); 00066 void UpdateSound(); 00067 }; 00068 00069 #endif
1.7.1