Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Representations/Sound/SoundRequest.h

Go to the documentation of this file.

    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       baetsch,
    00060       klick,
    00061       highvolt,
    00062       alert,
    00063       alarm,
    00064       alarm2,
    00065       evilaugh,
    00066       fanfare,
    00067       kuckuck,
    00068       growl2,
    00069       richtig,
    00070     numOfSoundIDs
    00071   };
    00072
    00073   static const char* getSoundIDName(SoundID id)
    00074   {
    00075     switch (id)
    00076     {
    00077     case none: return "none";
    00078     case test: return "test";
    00079     case bark1: return "bark1";
    00080     case bark2: return "bark2";
    00081     case bark3: return "bark3";
    00082     case hurtdog: return "hurtdog";
    00083     case howl: return "howl";
    00084     case growl: return "growl";
    00085     case startMe: return "startMe";
    00086     case ring: return "ring";
    00087     case space: return "space";
    00088     case bing01: return "bing01";
    00089     case bing02: return "bing02";
    00090     case bing03: return "bing03";
    00091     case bing04: return "bing04";
    00092     case bing05: return "bing05";
    00093     case bing06: return "bing06";
    00094     case bing07: return "bing07";
    00095     case rob001: return "rob001";
    00096     case rob002: return "rob002";
    00097     case rob003: return "rob003";
    00098     case rob004: return "rob004";
    00099     case rob005: return "rob005";
    00100     case rob006: return "rob006";
    00101     case rob101: return "rob101";
    00102     case okay: return "okay";
    00103     case notokay: return "notokay";
    00104     case accuracy: return "accuracy";
    00105     case impressive: return "imprssve";
    00106     case excellent: return "xcellent";
    00107     case baetsch: return "baetsch";
    00108     case highvolt: return "highvolt";
    00109     case klick: return "klick";
    00110     case alert: return "alert";
    00111     case alarm: return "alarm";
    00112     case alarm2: return "alarm2";
    00113     case evilaugh: return "evilaugh";
    00114     case fanfare: return "fanfare";
    00115     case kuckuck: return "kuckuck";
    00116     case growl2: return "growl2";
    00117     case richtig: return "richtig";
    00118     default: return "please edit SoundRequest::getSoundRequestName";
    00119     }
    00120   }
    00121
    00122   /** constructor */
    00123   SoundRequest()
    00124     :soundID(none)
    00125   {
    00126   }
    00127
    00128   bool operator==(const SoundRequest& other) const
    00129   {
    00130     return (soundID == other.soundID);
    00131   }
    00132
    00133   bool operator!=(const SoundRequest& other) const
    00134   { return !(*this==other); }
    00135
    00136   /** the id of the request */
    00137   SoundID soundID;
    00138 };
    00139
    00140 /**
    00141  * Streaming operator that reads a SoundRequest from a stream.
    00142  * @param stream The stream from which is read.
    00143  * @param soundRequest The SoundRequest object.
    00144  * @return The stream.
    00145  */
    00146 In& operator>>(In& stream,SoundRequest& soundRequest);
    00147
    00148 /**
    00149  * Streaming operator that writes a SoundRequest to a stream.
    00150  * @param stream The stream to write on.
    00151  * @param soundRequest The SoundRequest object.
    00152  * @return The stream.
    00153  */
    00154 Out& operator<<(Out& stream, const SoundRequest& soundRequest);
    00155
    00156
    00157
    00158 #endif //__SoundRequest_h_