00001 /* 00002 * SpanDSP - a series of DSP components for telephony 00003 * 00004 * private/tone_generate.h - General telephony tone generation. 00005 * 00006 * Written by Steve Underwood <steveu@coppice.org> 00007 * 00008 * Copyright (C) 2001 Steve Underwood 00009 * 00010 * All rights reserved. 00011 * 00012 * This program is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU Lesser General Public License version 2.1, 00014 * as published by the Free Software Foundation. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00024 * 00025 * $Id: tone_generate.h,v 1.1 2008/11/30 10:17:31 steveu Exp $ 00026 */ 00027 00028 #if !defined(_SPANDSP_PRIVATE_TONE_GENERATE_H_) 00029 #define _SPANDSP_PRIVATE_TONE_GENERATE_H_ 00030 00031 struct tone_gen_tone_descriptor_s 00032 { 00033 int32_t phase_rate; 00034 #if defined(SPANDSP_USE_FIXED_POINT) 00035 int16_t gain; 00036 #else 00037 float gain; 00038 #endif 00039 }; 00040 00041 /*! 00042 Cadenced multi-tone generator descriptor. 00043 */ 00044 struct tone_gen_descriptor_s 00045 { 00046 tone_gen_tone_descriptor_t tone[4]; 00047 int duration[4]; 00048 int repeat; 00049 }; 00050 00051 /*! 00052 Cadenced multi-tone generator state descriptor. This defines the state of 00053 a single working instance of a generator. 00054 */ 00055 struct tone_gen_state_s 00056 { 00057 tone_gen_tone_descriptor_t tone[4]; 00058 00059 uint32_t phase[4]; 00060 int duration[4]; 00061 int repeat; 00062 00063 int current_section; 00064 int current_position; 00065 }; 00066 00067 #endif 00068 /*- End of file ------------------------------------------------------------*/