revert changes that totally break everything (try it on unix too)

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@229 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale
2007-06-07 01:45:32 +00:00
parent 23f5980fd7
commit 8e96687bb3
5 changed files with 27 additions and 35 deletions

View File

@@ -94,7 +94,7 @@ typedef struct {
#if !defined(M_PI)
/* C99 systems may not define M_PI */
#define M_PI 3.14159265358979323846264338327f
#define M_PI 3.14159265358979323846264338327
#endif
#ifdef _MSC_VER

View File

@@ -132,7 +132,7 @@ extern "C" {
#define DTMF_2ND_HARMONIC_COL 63.1 /* 18dB */
#define GRID_FACTOR 4
#define BLOCK_LEN 102
#define M_TWO_PI 2.0f*M_PI
#define M_TWO_PI 2.0*M_PI
/*! \brief A continer for the elements of a Goertzel Algorithm (The names are from his formula) */
typedef struct {

View File

@@ -79,23 +79,7 @@ extern "C" {
#include <stdio.h>
#include <stdlib.h>
#ifdef WIN32
#ifdef _MSC_VER
#ifndef __inline__
#define __inline__ __inline
#endif
#endif
typedef unsigned __int64 uint64_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int8 uint8_t;
typedef __int64 int64_t;
typedef __int32 int32_t;
typedef __int16 int16_t;
typedef __int8 int8_t;
#else
#include <stdint.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -105,9 +89,17 @@ extern float powf (float, float);
#endif
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifndef _MSC_VER
#include <unistd.h>
#include <stdint.h>
#endif
#include <fcntl.h>
#include <sys/types.h>
#include <errno.h>
#include <assert.h>
#include <stdarg.h>
#include <libteletone.h>
@@ -120,7 +112,7 @@ struct teletone_dds_state {
uint32_t scale_factor;
uint32_t phase_accumulator;
int16_t sample;
teletone_process_t tx_level;
float tx_level;
};
typedef struct teletone_dds_state teletone_dds_state_t;
@@ -153,7 +145,7 @@ static __inline__ int16_t teletone_dds_modulate_sample(teletone_dds_state_t *dds
return (int16_t) (sample * dds->scale_factor >> 15);
}
static __inline__ void teletone_dds_state_set_tone(teletone_dds_state_t *dds, teletone_process_t tone, uint32_t rate, teletone_process_t tx_level)
static __inline__ void teletone_dds_state_set_tone(teletone_dds_state_t *dds, float tone, uint32_t rate, float tx_level)
{
dds->phase_accumulator = 0;
dds->phase_rate = (int32_t) ((tone * MAX_PHASE_ACCUMULATOR) / rate);
@@ -166,7 +158,7 @@ static __inline__ void teletone_dds_state_set_tone(teletone_dds_state_t *dds, te
dds->tx_level = tx_level;
}
static __inline__ void teletone_dds_state_set_tx_level(teletone_dds_state_t *dds, teletone_process_t tx_level)
static __inline__ void teletone_dds_state_set_tx_level(teletone_dds_state_t *dds, float tx_level)
{
dds->scale_factor = (int) (powf(10.0f, (tx_level - DBM0_MAX_POWER) / 20.0f) * (32767.0f * 1.414214f));
}
@@ -204,13 +196,13 @@ struct teletone_generation_session {
/*! Number of loops to repeat the entire set of instructions*/
int LOOPS;
/*! Number to mutiply total samples by to determine when to begin ascent or decent e.g. 0=beginning 4=(last 25%) */
teletone_process_t decay_factor;
float decay_factor;
/*! Direction to perform volume increase/decrease 1/-1*/
int decay_direction;
/*! Number of samples between increase/decrease of volume */
int decay_step;
/*! Volume factor of the tone */
teletone_process_t volume;
float volume;
/*! Debug on/off */
int debug;
/*! FILE stream to write debug data to */