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