]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 7 Jun 2007 03:28:07 +0000 (03:28 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 7 Jun 2007 03:28:07 +0000 (03:28 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@231 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/freetdm/src/include/libteletone_generate.h

index be791555bd19f6737a8b15b4aa636a022eb2c788..11012127081732371027082bd83c1a97fa97d350 100644 (file)
@@ -112,7 +112,7 @@ struct teletone_dds_state {
        uint32_t scale_factor;
        uint32_t phase_accumulator;
        int16_t sample;
-       float tx_level;
+       teletone_process_t tx_level;
 };
 typedef struct teletone_dds_state teletone_dds_state_t;
 
@@ -145,24 +145,24 @@ 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, float tone, uint32_t rate, float tx_level)
+static __inline__ void teletone_dds_state_set_tx_level(teletone_dds_state_t *dds, teletone_process_t tx_level)
+{
+       dds->scale_factor = (int) (powf(10.0f, (tx_level - DBM0_MAX_POWER) / 20.0f) * (32767.0f * 1.414214f));
+}
+
+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)
 {
        dds->phase_accumulator = 0;
        dds->phase_rate = (int32_t) ((tone * MAX_PHASE_ACCUMULATOR) / rate);
-
+       
 
        if (dds->tx_level != tx_level || !dds->scale_factor) {
-               dds->scale_factor = (int) (powf(10.0f, (tx_level - DBM0_MAX_POWER) / 20.0f) * (32767.0f * 1.414214f));
+               teletone_dds_state_set_tx_level(dds, tx_level);
        }
        
        dds->tx_level = 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));
-}
-
 
 
 /*! \file libteletone_generate.h