00001 //////////////////////////////////////////////////////////////////////////////// 00002 // Scorched3D (c) 2000-2009 00003 // 00004 // This file is part of Scorched3D. 00005 // 00006 // Scorched3D 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 2 of the License, or 00009 // (at your option) any later version. 00010 // 00011 // Scorched3D 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 Scorched3D; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 //////////////////////////////////////////////////////////////////////////////// 00020 00021 #if !defined(__INCLUDE_LandscapeSoundh_INCLUDE__) 00022 #define __INCLUDE_LandscapeSoundh_INCLUDE__ 00023 00024 #include <XML/XMLFile.h> 00025 #include <string> 00026 #include <vector> 00027 00028 class LandscapeSoundTiming 00029 { 00030 public: 00031 virtual bool readXML(XMLNode *node) = 0; 00032 virtual float getNextEventTime() = 0; 00033 }; 00034 00035 class LandscapeSoundTimingLooped : public LandscapeSoundTiming 00036 { 00037 public: 00038 virtual bool readXML(XMLNode *node); 00039 virtual float getNextEventTime(); 00040 }; 00041 00042 class LandscapeSoundTimingRepeat : public LandscapeSoundTiming 00043 { 00044 public: 00045 virtual bool readXML(XMLNode *node); 00046 virtual float getNextEventTime(); 00047 00048 protected: 00049 float min, max; 00050 }; 00051 00052 class VirtualSoundSource; 00053 class LandscapeSoundPosition 00054 { 00055 public: 00056 virtual bool readXML(XMLNode *node) = 0; 00057 virtual bool setPosition(VirtualSoundSource *source, unsigned int data) = 0; 00058 00059 virtual int getInitCount() { return 1; } 00060 virtual unsigned int getInitData(int count) { return 0; } 00061 }; 00062 00063 class LandscapeSoundPositionAmbient : public LandscapeSoundPosition 00064 { 00065 public: 00066 virtual bool readXML(XMLNode *node); 00067 virtual bool setPosition(VirtualSoundSource *source, unsigned int data); 00068 }; 00069 00070 class LandscapeSoundPositionAbsoulte : public LandscapeSoundPosition 00071 { 00072 public: 00073 virtual bool readXML(XMLNode *node); 00074 virtual bool setPosition(VirtualSoundSource *source, unsigned int data); 00075 00076 protected: 00077 Vector position; 00078 }; 00079 00080 class LandscapeSoundPositionWater : public LandscapeSoundPosition 00081 { 00082 public: 00083 virtual bool readXML(XMLNode *node); 00084 virtual bool setPosition(VirtualSoundSource *source, unsigned int data); 00085 00086 protected: 00087 float falloff; 00088 }; 00089 00090 class LandscapeSoundPositionGroup : public LandscapeSoundPosition 00091 { 00092 public: 00093 virtual bool readXML(XMLNode *node); 00094 virtual bool setPosition(VirtualSoundSource *source, unsigned int data); 00095 00096 protected: 00097 std::string name; 00098 float falloff; 00099 }; 00100 00101 class LandscapeSoundPositionSet : public LandscapeSoundPosition 00102 { 00103 public: 00104 virtual bool readXML(XMLNode *node); 00105 virtual bool setPosition(VirtualSoundSource *source, unsigned int data); 00106 00107 virtual int getInitCount(); 00108 virtual unsigned int getInitData(int count); 00109 00110 protected: 00111 std::string name; 00112 int maxsounds; 00113 }; 00114 00115 class LandscapeSoundSound 00116 { 00117 public: 00118 virtual bool readXML(XMLNode *node) = 0; 00119 virtual bool play(VirtualSoundSource *source) = 0; 00120 }; 00121 00122 class LandscapeSoundSoundFile : public LandscapeSoundSound 00123 { 00124 public: 00125 virtual bool readXML(XMLNode *node); 00126 virtual bool play(VirtualSoundSource *source); 00127 00128 protected: 00129 std::vector<std::string> files; 00130 float gain; 00131 float referencedistance; 00132 float rolloff; 00133 }; 00134 00135 class LandscapeSoundType 00136 { 00137 public: 00138 LandscapeSoundType(); 00139 virtual ~LandscapeSoundType(); 00140 00141 virtual bool readXML(XMLNode *node); 00142 00143 LandscapeSoundPosition *position; 00144 LandscapeSoundTiming *timing; 00145 LandscapeSoundSound *sound; 00146 }; 00147 00148 #endif // __INCLUDE_LandscapeSoundh_INCLUDE__
1.5.3