00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 #include "jaus/extras/audio/queryaudio.h" 00041 00042 using namespace JAUS; 00043 00044 00053 QueryAudio::QueryAudio(const Address& dest, 00054 const Address& src) : Message(QUERY_AUDIO, dest, src) 00055 { 00056 mDeviceID = 0; 00057 } 00058 00059 00065 QueryAudio::QueryAudio(const QueryAudio& message) : Message(QUERY_AUDIO) 00066 { 00067 *this = message; 00068 } 00069 00070 00076 QueryAudio::~QueryAudio() 00077 { 00078 00079 } 00080 00081 00093 int QueryAudio::WriteMessageBody(Packet& packet) const 00094 { 00095 int total = 0; 00096 int expected = BYTE_SIZE; 00097 00098 total += packet.WriteByte(mDeviceID); 00099 00100 return total == expected ? total : -1; 00101 } 00102 00103 00115 int QueryAudio::ReadMessageBody(const Packet& packet) 00116 { 00117 int total = 0; 00118 int expected = BYTE_SIZE; 00119 00120 total += packet.Read(mDeviceID); 00121 00122 return total == expected ? total : -1; 00123 } 00124 00125 00131 void QueryAudio::ClearMessageBody() 00132 { 00133 mDeviceID = 0; 00134 } 00135 00136 00142 QueryAudio& QueryAudio::operator =(const QueryAudio& message) 00143 { 00144 if(this != &message) 00145 { 00146 CopyHeaderData(&message); 00147 mDeviceID = message.mDeviceID; 00148 } 00149 return *this; 00150 } 00151 00152 00153 /* End of File */