00001 00008 /*************************************************************************** 00009 * * 00010 * This program is free software; you can redistribute it and/or modify * 00011 * it under the terms of the GNU General Public License as published by * 00012 * the Free Software Foundation; either version 2 of the License, or * 00013 * (at your option) any later version. * 00014 * * 00015 ***************************************************************************/ 00016 00017 #ifndef AUDIOSEND_H 00018 #define AUDIOSEND_H 00019 00020 #include <string> 00021 #include "callmodule.h" 00022 00023 class Connection; 00024 00025 using namespace std; 00026 00047 class AudioSend: public CallModule 00048 { 00049 public: 00058 AudioSend(Connection *conn, string file, bool DTMF_exit) throw (CapiWrongState,CapiExternalError); 00059 00066 void mainLoop() throw (CapiWrongState,CapiExternalError,CapiMsgError); 00067 00071 void transmissionComplete(); 00072 00077 long duration(); 00078 00079 private: 00080 string file; 00081 long start_time; 00082 }; 00083 00084 #endif 00085 00086 /* History 00087 00088 Old Log (for new changes see ChangeLog): 00089 00090 Revision 1.1.1.1 2003/02/19 08:19:53 gernot 00091 initial checkin of 0.4 00092 00093 Revision 1.13 2002/12/04 11:38:50 ghillie 00094 - added time measurement: save time in start_time at the begin of mainLoop() and return difference to getTime() in duration() 00095 00096 Revision 1.12 2002/12/02 12:32:21 ghillie 00097 renamed Connection::SPEECH to Connection::VOICE 00098 00099 Revision 1.11 2002/11/29 10:27:44 ghillie 00100 - updated comments, use doxygen format now 00101 00102 Revision 1.10 2002/11/25 21:00:53 ghillie 00103 - improved documentation, now doxygen-readabl 00104 00105 Revision 1.9 2002/11/25 11:54:35 ghillie 00106 - tests for speech mode before receiving now 00107 - small performance improvement (use string::empty() instead of comparison to "") 00108 00109 Revision 1.8 2002/11/22 15:16:20 ghillie 00110 added support for finishing when DTMF is received 00111 00112 Revision 1.7 2002/11/21 15:32:40 ghillie 00113 - moved code from constructor/destructor to overwritten mainLoop() method 00114 00115 Revision 1.6 2002/11/19 15:57:19 ghillie 00116 - Added missing throw() declarations 00117 - phew. Added error handling. All exceptions are caught now. 00118 00119 Revision 1.5 2002/11/14 17:05:19 ghillie 00120 major structural changes - much is easier, nicer and better prepared for the future now: 00121 - added DisconnectLogical handler to CallInterface 00122 - DTMF handling moved from CallControl to Connection 00123 - new call module ConnectModule for establishing connection 00124 - python script reduced from 2 functions to one (callWaiting, callConnected 00125 merged to callIncoming) 00126 - call modules implement the CallInterface now, not CallControl any more 00127 => this freed CallControl from nearly all communication stuff 00128 00129 Revision 1.4 2002/11/13 15:26:28 ghillie 00130 removed unnecessary member attribute filename 00131 00132 Revision 1.3 2002/11/13 08:34:54 ghillie 00133 moved history to the bottom 00134 00135 Revision 1.2 2002/10/29 14:28:22 ghillie 00136 added stop_file_* calls to make sure transmission is cancelled when it's time... 00137 00138 Revision 1.1 2002/10/25 13:29:39 ghillie 00139 grouped files into subdirectories 00140 00141 Revision 1.10 2002/10/23 15:37:50 ghillie 00142 typo... 00143 00144 Revision 1.9 2002/10/23 14:10:27 ghillie 00145 callmodules must register itself at connection class now 00146 00147 Revision 1.8 2002/10/10 12:45:40 gernot 00148 added AudioReceive module, some small details changed 00149 00150 Revision 1.7 2002/10/09 14:36:22 gernot 00151 added CallModule base class for all call handling modules 00152 00153 Revision 1.6 2002/10/05 20:43:32 gernot 00154 quick'n'dirty, but WORKS 00155 00156 Revision 1.5 2002/10/04 15:48:03 gernot 00157 structure changes completed & compiles now! 00158 00159 Revision 1.4 2002/10/04 13:27:15 gernot 00160 some restructuring to get it to a working state ;-) 00161 00162 does not do anything useful yet nor does it even compile... 00163 00164 Revision 1.3 2002/10/02 14:10:07 gernot 00165 first version 00166 00167 Revision 1.2 2002/10/01 09:02:04 gernot 00168 changes for compilation with gcc3.2 00169 00170 Revision 1.1 2002/09/22 14:55:21 gernot 00171 adding audio send module 00172 00173 */