Homepage Demos Overview Downloads Tutorials Reference
Credits

SoundManagerMsg.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_SoundManagerMsg_h
00003 #define INCLUDED_SoundManagerMsg_h
00004 
00005 class RCRegion;
00006 
00007 //! A small header that preceeds data sent by SoundManager between processes
00008 struct SoundManagerMsg {
00009   //! the type to use when referring to Sounds
00010   typedef unsigned short Snd_ID;
00011   //! maintains even word alignment
00012   static const unsigned int MSG_SIZE=16;
00013 
00014   //! constructor
00015   SoundManagerMsg() : type(unknown), id(static_cast<Snd_ID>(-1)), region(NULL) {}
00016 
00017   //! virtual destructor
00018   /*! doesn't do anything, but don't remove it, otherwise this would no longer be a virtual base class */
00019   virtual ~SoundManagerMsg() {}
00020 
00021   //! Accessor for the id number, set by SoundManager
00022   Snd_ID getID() const { return id; }
00023 
00024 private:
00025   friend class SoundManager;
00026 
00027   //! Denotes what type of message this is
00028   enum MsgType { add, del, wakeup, unknown } type;
00029   
00030   //! The id of the sound this is in reference to
00031   Snd_ID id;
00032 
00033   //! The RCRegion to free, if it's a deletion
00034   RCRegion * region;
00035 
00036   //! Sets up the header as an add message
00037   void setAdd(Snd_ID sndid) {
00038     type=add;
00039     id=sndid;
00040   }
00041 
00042   //! Sets up the header as an erase message
00043   void setDelete(RCRegion* rcregion) {
00044     type=del;
00045     region=rcregion;
00046   }
00047 
00048   //! Sets up the header as a wakeup message
00049   void setWakeup() {
00050     type=wakeup;
00051   }
00052 
00053   SoundManagerMsg(const SoundManagerMsg&); //!< don't call
00054   SoundManagerMsg operator=(const SoundManagerMsg&); //!< don't call
00055 };
00056 
00057 /*! @file
00058  * @brief Defines SoundManagerMsg, a small header used by SoundManager for sending messages between processes
00059  * @author ejt (Creator)
00060  *
00061  * $Author: ejt $
00062  * $Name: tekkotsu-2_2_2 $
00063  * $Revision: 1.4 $
00064  * $State: Rel $
00065  * $Date: 2003/09/25 15:32:08 $
00066  */
00067 
00068 #endif // INCLUDED_SoundManagerMsg_h

Tekkotsu v2.2.2
Generated Tue Jan 4 15:43:15 2005 by Doxygen 1.4.0