~ubuntu-branches/ubuntu/intrepid/iaxmodem/intrepid

« back to all changes in this revision

Viewing changes to lib/spandsp/src/spandsp/dtmf.h

  • Committer: Bazaar Package Importer
  • Author(s): Julien BLACHE
  • Date: 2008-02-12 15:29:42 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20080212152942-28cxxstfy8iujm0p
Tags: 1.1.0~dfsg-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 * along with this program; if not, write to the Free Software
23
23
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24
24
 *
25
 
 * $Id: dtmf.h,v 1.13 2007/06/26 15:54:12 steveu Exp $
 
25
 * $Id: dtmf.h,v 1.18 2007/12/20 11:11:16 steveu Exp $
26
26
 */
27
27
 
28
28
#if !defined(_SPANDSP_DTMF_H_)
81
81
*/
82
82
typedef struct
83
83
{
84
 
    tone_gen_descriptor_t *tone_descriptors;
85
84
    tone_gen_state_t tones;
86
85
    int current_sample;
87
86
    /* The queue structure MUST be followed immediately by the buffer */
110
109
    float reverse_twist;
111
110
 
112
111
    /*! 350Hz filter state for the optional dialtone filter */
113
 
    float z350_1;
114
 
    float z350_2;
 
112
    float z350[2];
115
113
    /*! 440Hz filter state for the optional dialtone filter */
116
 
    float z440_1;
117
 
    float z440_2;
 
114
    float z440[2];
118
115
 
119
 
    /*! Tone detector working states */
 
116
    /*! Tone detector working states for the row tones. */
120
117
    goertzel_state_t row_out[4];
 
118
    /*! Tone detector working states for the column tones. */
121
119
    goertzel_state_t col_out[4];
122
120
    /*! The accumlating total energy on the same period over which the Goertzels work. */
123
121
    float energy;
152
150
/*! \brief Put a string of digits in a DTMF generator's input buffer.
153
151
    \param s The DTMF generator context.
154
152
    \param digits The string of digits to be added.
 
153
    \param len The length of the string of digits. If negative, the string is
 
154
           assumed to be a NULL terminated string.
155
155
    \return The number of digits actually added. This may be less than the
156
156
            length of the digit string, if the buffer fills up. */
157
 
size_t dtmf_tx_put(dtmf_tx_state_t *s, const char *digits);
 
157
size_t dtmf_tx_put(dtmf_tx_state_t *s, const char *digits, ssize_t len);
 
158
 
 
159
/*! \brief Change the transmit level for a DTMF tone generator context.
 
160
    \param s The DTMF generator context.
 
161
    \param level The level of the low tone, in dBm0.
 
162
    \param twist The twist, in dB. */
 
163
void dtmf_tx_set_level(dtmf_tx_state_t *s, int level, int twist);
158
164
 
159
165
/*! \brief Initialise a DTMF tone generator context.
160
166
    \param s The DTMF generator context.
161
167
    \return A pointer to the DTMF generator context. */
162
168
dtmf_tx_state_t *dtmf_tx_init(dtmf_tx_state_t *s);
163
169
 
 
170
/*! \brief Free a DTMF tone generator context.
 
171
    \param s The DTMF tone generator context.
 
172
    \return 0 for OK, else -1. */
 
173
int dtmf_tx_free(dtmf_tx_state_t *s);
 
174
 
164
175
/*! Set a optional realtime callback for a DTMF receiver context. This function
165
176
    is called immediately a confirmed state change occurs in the received DTMF. It
166
177
    is called with the ASCII value for a DTMF tone pair, or zero to indicate no tone
218
229
                              dtmf_rx_callback_t callback,
219
230
                              void *user_data);
220
231
 
 
232
/*! \brief Free a DTMF receiver context.
 
233
    \param s The DTMF receiver context.
 
234
    \return 0 for OK, else -1. */
 
235
int dtmf_rx_free(dtmf_rx_state_t *s);
 
236
 
221
237
#if defined(__cplusplus)
222
238
}
223
239
#endif