Sion Tower (demo técnica) 0.1
|
00001 /* 00002 * This file is part of SionTower. 00003 * 00004 * 00005 * David Saltares Márquez (C) 2011 00006 * <david.saltares@gmail.com> 00007 * 00008 * 00009 * SionTower examples are free software: you can redistribute it and/or 00010 * modify it under the terms of the GNU General Public License ad 00011 * published by the Free Software Foundation, either version 3 of the 00012 * License, or (at your option) ant later version. 00013 * 00014 * SionTower examples are distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with SionTower examples. If not, see <http://www.gnu.org/licenses/>. 00021 */ 00022 #ifndef SIONTOWER_TRUNK_SRC_INCLUDE_SOUNDFX_H_ 00023 #define SIONTOWER_TRUNK_SRC_INCLUDE_SOUNDFX_H_ 00024 00025 #include <SDL/SDL_mixer.h> 00026 #include <OGRE/Ogre.h> 00027 00029 00041 class SoundFX: public Ogre::Resource { 00042 public: 00058 SoundFX(Ogre::ResourceManager* creator, 00059 const Ogre::String& name, 00060 Ogre::ResourceHandle handle, 00061 const Ogre::String& group, 00062 bool isManual = false, 00063 Ogre::ManualResourceLoader* loader = 0); 00064 00068 ~SoundFX(); 00069 00078 int play(int loop = 0); 00079 00080 protected: 00084 void loadImpl(); 00085 00089 void unloadImpl(); 00090 00094 size_t calculateSize() const; 00095 private: 00096 Mix_Chunk* _sound; 00097 Ogre::String _path; 00098 size_t _size; 00099 }; 00100 00101 00103 00112 class SoundFXPtr: public Ogre::SharedPtr<SoundFX> { 00113 public: 00117 SoundFXPtr(): Ogre::SharedPtr<SoundFX>() {} 00118 00125 explicit SoundFXPtr(SoundFX* s): Ogre::SharedPtr<SoundFX>(s) {} 00126 00133 SoundFXPtr(const SoundFXPtr& s): Ogre::SharedPtr<SoundFX>(s) {} 00134 00141 SoundFXPtr(const Ogre::ResourcePtr& r); 00142 00149 SoundFXPtr& operator= (const Ogre::ResourcePtr& r); 00150 }; 00151 00152 #endif // SIONTOWER_TRUNK_SRC_INCLUDE_SOUNDFX_H_