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 00040 class AudioSend: public CallModule 00041 { 00042 public: 00050 AudioSend(Connection *conn, string file, bool DTMF_exit) throw (CapiExternalError); 00051 00059 void mainLoop() throw (CapiError,CapiWrongState,CapiExternalError,CapiMsgError); 00060 00064 void transmissionComplete(); 00065 00070 long duration(); 00071 00072 private: 00073 string file; 00074 long start_time; 00075 }; 00076 00077 #endif 00078 00079 /* History 00080 00081 $Log: audiosend.h,v $ 00082 Revision 1.1 2003/02/19 08:19:53 gernot 00083 Initial revision 00084 00085 Revision 1.13 2002/12/04 11:38:50 ghillie 00086 - added time measurement: save time in start_time at the begin of mainLoop() and return difference to getTime() in duration() 00087 00088 Revision 1.12 2002/12/02 12:32:21 ghillie 00089 renamed Connection::SPEECH to Connection::VOICE 00090 00091 Revision 1.11 2002/11/29 10:27:44 ghillie 00092 - updated comments, use doxygen format now 00093 00094 Revision 1.10 2002/11/25 21:00:53 ghillie 00095 - improved documentation, now doxygen-readabl 00096 00097 Revision 1.9 2002/11/25 11:54:35 ghillie 00098 - tests for speech mode before receiving now 00099 - small performance improvement (use string::empty() instead of comparison to "") 00100 00101 Revision 1.8 2002/11/22 15:16:20 ghillie 00102 added support for finishing when DTMF is received 00103 00104 Revision 1.7 2002/11/21 15:32:40 ghillie 00105 - moved code from constructor/destructor to overwritten mainLoop() method 00106 00107 Revision 1.6 2002/11/19 15:57:19 ghillie 00108 - Added missing throw() declarations 00109 - phew. Added error handling. All exceptions are caught now. 00110 00111 Revision 1.5 2002/11/14 17:05:19 ghillie 00112 major structural changes - much is easier, nicer and better prepared for the future now: 00113 - added DisconnectLogical handler to CallInterface 00114 - DTMF handling moved from CallControl to Connection 00115 - new call module ConnectModule for establishing connection 00116 - python script reduced from 2 functions to one (callWaiting, callConnected 00117 merged to callIncoming) 00118 - call modules implement the CallInterface now, not CallControl any more 00119 => this freed CallControl from nearly all communication stuff 00120 00121 Revision 1.4 2002/11/13 15:26:28 ghillie 00122 removed unnecessary member attribute filename 00123 00124 Revision 1.3 2002/11/13 08:34:54 ghillie 00125 moved history to the bottom 00126 00127 Revision 1.2 2002/10/29 14:28:22 ghillie 00128 added stop_file_* calls to make sure transmission is cancelled when it's time... 00129 00130 Revision 1.1 2002/10/25 13:29:39 ghillie 00131 grouped files into subdirectories 00132 00133 Revision 1.10 2002/10/23 15:37:50 ghillie 00134 typo... 00135 00136 Revision 1.9 2002/10/23 14:10:27 ghillie 00137 callmodules must register itself at connection class now 00138 00139 Revision 1.8 2002/10/10 12:45:40 gernot 00140 added AudioReceive module, some small details changed 00141 00142 Revision 1.7 2002/10/09 14:36:22 gernot 00143 added CallModule base class for all call handling modules 00144 00145 Revision 1.6 2002/10/05 20:43:32 gernot 00146 quick'n'dirty, but WORKS 00147 00148 Revision 1.5 2002/10/04 15:48:03 gernot 00149 structure changes completed & compiles now! 00150 00151 Revision 1.4 2002/10/04 13:27:15 gernot 00152 some restructuring to get it to a working state ;-) 00153 00154 does not do anything useful yet nor does it even compile... 00155 00156 Revision 1.3 2002/10/02 14:10:07 gernot 00157 first version 00158 00159 Revision 1.2 2002/10/01 09:02:04 gernot 00160 changes for compilation with gcc3.2 00161 00162 Revision 1.1 2002/09/22 14:55:21 gernot 00163 adding audio send module 00164 00165 */