00001 /** 00002 * @file SoundRequest.h 00003 * 00004 * Declaration of class SoundRequest 00005 * 00006 * @author Oliver Giese 00007 * 00008 */ 00009 #ifndef __SoundRequest_h_ 00010 #define __SoundRequest_h_ 00011 00012 #include "Platform/SystemCall.h" 00013 00014 #include "Tools/Streams/InOut.h" 00015 00016 /** 00017 * @class SoundRequest 00018 * 00019 * Represents an acoustic message 00020 */ 00021 class SoundRequest 00022 { 00023 public: 00024 /** 00025 ** ids for all acoustic message Ids 00026 ** signals have to be enumerated first 00027 **/ 00028 enum SoundID{ 00029 none, 00030 test, 00031 bark1, 00032 bark2, 00033 bark3, 00034 hurtdog, 00035 howl, 00036 growl, 00037 startMe, 00038 ring, 00039 space, 00040 bing01, 00041 bing02, 00042 bing03, 00043 bing04, 00044 bing05, 00045 bing06, 00046 bing07, 00047 rob001, 00048 rob002, 00049 rob003, 00050 rob004, 00051 rob005, 00052 rob006, 00053 rob101, 00054 okay, 00055 notokay, 00056 accuracy, 00057 impressive, 00058 excellent, 00059 numOfSoundIDs 00060 }; 00061 00062 static const char* getSoundIDName(SoundID id) 00063 { 00064 switch (id) 00065 { 00066 case none: return "none"; 00067 case test: return "test"; 00068 case bark1: return "bark1"; 00069 case bark2: return "bark2"; 00070 case bark3: return "bark3"; 00071 case hurtdog: return "hurtdog"; 00072 case howl: return "howl"; 00073 case growl: return "growl"; 00074 case startMe: return "startMe"; 00075 case ring: return "ring"; 00076 case space: return "space"; 00077 case bing01: return "bing01"; 00078 case bing02: return "bing02"; 00079 case bing03: return "bing03"; 00080 case bing04: return "bing04"; 00081 case bing05: return "bing05"; 00082 case bing06: return "bing06"; 00083 case bing07: return "bing07"; 00084 case rob001: return "rob001"; 00085 case rob002: return "rob002"; 00086 case rob003: return "rob003"; 00087 case rob004: return "rob004"; 00088 case rob005: return "rob005"; 00089 case rob006: return "rob006"; 00090 case rob101: return "rob101"; 00091 case okay: return "okay"; 00092 case notokay: return "notokay"; 00093 case accuracy: return "accuracy"; 00094 case impressive: return "imprssve"; 00095 case excellent: return "xcellent"; 00096 default: return "please edit SoundRequest::getSoundRequestName"; 00097 } 00098 } 00099 00100 /** constructor */ 00101 SoundRequest() 00102 :soundID(none) 00103 { 00104 } 00105 00106 bool operator==(const SoundRequest& other) const 00107 { 00108 return (soundID == other.soundID); 00109 } 00110 00111 bool operator!=(const SoundRequest& other) const 00112 { return !(*this==other); } 00113 00114 /** the id of the request */ 00115 SoundID soundID; 00116 }; 00117 00118 /** 00119 * Streaming operator that reads a SoundRequest from a stream. 00120 * @param stream The stream from which is read. 00121 * @param soundRequest The SoundRequest object. 00122 * @return The stream. 00123 */ 00124 In& operator>>(In& stream,SoundRequest& soundRequest); 00125 00126 /** 00127 * Streaming operator that writes a SoundRequest to a stream. 00128 * @param stream The stream to write on. 00129 * @param soundRequest The SoundRequest object. 00130 * @return The stream. 00131 */ 00132 Out& operator<<(Out& stream, const SoundRequest& soundRequest); 00133 00134 00135 00136 #endif //__SoundRequest_h_ 00137 00138 /* 00139 * Change log : 00140 * 00141 * $Log: SoundRequest.h,v $ 00142 * Revision 1.2 2004/05/22 22:52:05 juengel 00143 * Renamed ballP_osition to ballModel. 00144 * 00145 * Revision 1.1.1.1 2004/05/22 17:26:04 cvsadm 00146 * created new repository GT2004_WM 00147 * 00148 * Revision 1.3 2004/02/26 16:42:19 kindler 00149 * added some sounds. 00150 * 00151 * Revision 1.2 2003/12/09 16:27:14 jhoffman 00152 * "okay" and "notokay" sounds added 00153 * 00154 * Revision 1.1 2003/10/07 10:09:36 cvsadm 00155 * Created GT2004 (M.J.) 00156 * 00157 * Revision 1.2 2003/07/03 14:43:17 risler 00158 * new sounds 00159 * 00160 * Revision 1.1.1.1 2003/07/02 09:40:23 cvsadm 00161 * created new repository for the competitions in Padova from the 00162 * tamara CVS (Tuesday 2:00 pm) 00163 * 00164 * removed unused solutions 00165 * 00166 * Revision 1.7 2003/06/19 12:11:30 juengel 00167 * Removed some Sounds. 00168 * 00169 * Revision 1.6 2003/06/18 18:12:36 goehring 00170 * Sounds added 00171 * 00172 * Revision 1.5 2003/04/15 15:52:12 risler 00173 * DDD GO 2003 code integrated 00174 * 00175 * Revision 1.4 2003/04/06 12:32:44 max 00176 * added ddd sound stuff 00177 * 00178 * Revision 1.4 2003/04/06 13:22:15 wachter 00179 * added startMe.wav 00180 * 00181 * Revision 1.3 2002/11/28 18:56:28 juengel 00182 * Added some sounds 00183 * 00184 * Revision 1.2 2002/11/18 17:30:31 loetzsch 00185 * Sound requests generated from BehaviorControl are now automatically sent 00186 * to RobotControl and played there. 00187 * 00188 * Revision 1.1 2002/09/10 15:26:41 cvsadm 00189 * Created new project GT2003 (M.L.) 00190 * - Cleaned up the /Src/DataTypes directory 00191 * - Removed Challenge Code 00192 * - Removed processing of incoming audio data 00193 * - Renamed AcousticMessage to SoundRequest 00194 * 00195 * Revision 1.11 2002/07/23 13:32:56 loetzsch 00196 * new streaming classes 00197 * 00198 * removed many #include statements 00199 * 00200 * Revision 1.10 2002/06/03 19:20:49 dueffert 00201 * sound only once 00202 * 00203 * Revision 1.9 2002/06/03 18:54:43 dueffert 00204 * messagetype in AcousticMessage is now private 00205 * 00206 * Revision 1.8 2002/05/27 16:16:57 schley 00207 * ballp_osition can be transmitted 00208 * 00209 * Revision 1.7 2002/05/22 13:47:18 fischer 00210 * Changed SoundInProcessor interface to accept WorldState 00211 * 00212 * Revision 1.6 2002/05/21 15:43:03 hebbel 00213 * acoustic signals can be detected now 00214 * 00215 * Revision 1.5 2002/05/21 11:43:09 hebbel 00216 * Changed order of acousticIDs, added transmitBallp_osition 00217 * 00218 * Revision 1.4 2002/05/17 11:21:20 fischer 00219 * ball position exchange via acoustic communication 00220 * 00221 * Revision 1.3 2002/05/15 07:26:05 hebbel 00222 * Wavefiles for patternchallenge can be played 00223 * 00224 * Revision 1.2 2002/05/13 13:30:23 schley 00225 * Added signals 00226 * 00227 * Revision 1.1.1.1 2002/05/10 12:40:13 cvsadm 00228 * Moved GT2002 Project from ute to tamara. 00229 * 00230 * Revision 1.3 2002/05/06 15:06:12 schley 00231 * Added another Signal 00232 * 00233 * Revision 1.2 2002/05/03 13:46:30 giese 00234 * Added timestamp to AcousticMessage 00235 * 00236 * Revision 1.1 2002/04/28 19:09:52 giese 00237 * SoundPlay added... 00238 * 00239 */