Home | nevrax.com |
|
background_sound.hGo to the documentation of this file.00001 00006 /* Copyright, 2001 Nevrax Ltd. 00007 * 00008 * This file is part of NEVRAX NEL. 00009 * NEVRAX NEL is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2, or (at your option) 00012 * any later version. 00013 00014 * NEVRAX NEL is distributed in the hope that it will be useful, but 00015 * WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * General Public License for more details. 00018 00019 * You should have received a copy of the GNU General Public License 00020 * along with NEVRAX NEL; see the file COPYING. If not, write to the 00021 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 00022 * MA 02111-1307, USA. 00023 */ 00024 00025 #ifndef NL_BACKGROUND_SOUND_H 00026 #define NL_BACKGROUND_SOUND_H 00027 00028 #include "sound.h" 00029 00030 namespace NLSOUND { 00031 00032 //class ISoundDriver; 00033 //class IBuffer; 00034 //class CSound; 00035 00036 00037 00044 class CBackgroundSound : public CSound 00045 { 00046 public: 00048 CBackgroundSound(); 00050 ~CBackgroundSound(); 00051 00052 TSOUND_TYPE getSoundType() { return SOUND_BACKGROUND;} 00053 00055 virtual void importForm(const std::string& filename, NLGEORGES::UFormElm& formRoot); 00056 00058 bool isDetailed() const { return false;} 00060 virtual uint32 getDuration(); 00062 00064 virtual void getSubSoundList(std::vector<std::pair<std::string, CSound*> > &subsounds) const; 00065 00066 virtual float getMaxDistance() const; 00067 00068 void serial(NLMISC::IStream &s); 00069 00070 00071 00077 /* struct TBackgroundFilter 00078 { 00079 bool Day; 00080 bool Night; 00081 bool Spring; 00082 bool Summer; 00083 bool Autumn; 00084 bool Winter; 00085 bool Sunny; 00086 bool Cloudy; 00087 bool Foggy; 00088 bool Rainy; 00089 bool Snow; 00090 bool Storm; 00091 bool BadAtmosphere; 00092 bool GoodAtmosphere; 00093 }; 00094 */ 00096 struct TSoundInfo 00097 { 00098 std::string SoundName; 00100 uint32 FilterFadeIn; 00102 uint32 FilterFadeOut; 00103 UAudioMixer::TBackgroundFlags Filter; 00104 00105 void serial(NLMISC::IStream &s) 00106 { 00107 s.serial(SoundName); 00108 s.serial(FilterFadeIn); 00109 s.serial(FilterFadeOut); 00110 s.serial(Filter); 00111 } 00112 }; 00113 00114 const std::vector<TSoundInfo> &getSounds() const { return _Sounds;} 00115 00116 private: 00117 00118 00120 std::vector<TSoundInfo> _Sounds; 00121 00122 00123 // Duration of sound. 00124 uint32 _Duration; 00125 // flag for validity of duration (after first evaluation). 00126 bool _DurationValid; 00127 }; 00128 00129 } // NLSOUND 00130 00131 #endif // NL_BACKGROUND_SOUND_H 00132 |