Fix unused argument complaints.
authorbruceperens <bruceperens@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 18 Mar 2014 18:16:41 +0000 (18:16 +0000)
committerbruceperens <bruceperens@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 18 Mar 2014 18:16:41 +0000 (18:16 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1448 01035d8c-6547-0410-b346-abe4f91aad63

freedv-server/source/audio_sink.cpp
freedv-server/source/blank_panel.cpp
freedv-server/source/drivers.h
freedv-server/source/ptt_constant.cpp
freedv-server/source/text_constant.cpp
freedv-server/source/tone.cpp

index e9f224e4660537da462e42bf146cae2e5eb6b9f3..6d644dba61aaeda06966171b2046e219a0750839 100644 (file)
@@ -46,7 +46,7 @@ namespace FreeDV {
   }
 
   int
-  AudioSink::poll_fds(struct pollfd * array, int space)
+  AudioSink::poll_fds(struct pollfd *, int)
   {
     return 0;
   }
index 2d749453c93df31f4e8c8d6fe10f12ddaa243f33..961756846937c71d24a070ab7d4c3e43939ccf97 100644 (file)
@@ -33,7 +33,7 @@ namespace FreeDV {
   }
 
   int
-  BlankPanel::poll_fds(struct pollfd * array, int space)
+  BlankPanel::poll_fds(struct pollfd *, int)
   {
     return 0;
   }
index edd1b4b3115dd236833cb6a50805d386b4caddf3..83e1028a97d07083475d4e342fe5b64e335053ab 100644 (file)
@@ -16,11 +16,18 @@ extern const char * program_name;
 /// drivers.
 const unsigned int     SampleRate = 48000;
 
+/// The number of audio samples per millisecond, at SampleRate.
+const unsigned int     SamplesPerMillisecond = ((double)SampleRate / 1000.0);
+
 // The audio frame duration in milliseconds. The audio interfaces will
 // use this as a period size. It should be 1/2 of the smallest codec frame
 // size we expect to use.
 const unsigned int     AudioFrameDuration = 10;
 
+/// The number of audio samples in an audio frame.
+const unsigned int     AudioFrameSamples = SamplesPerMillisecond
+                        * AudioFrameDuration;
+
 /// Allocate memory and copy a string into it, so that it is permanently
 /// stored.
 /// \param s The string to be copied.
index a9f8b972f71a2364fad49f7401f0aac9c5c48de5..b673f03c8751d587d0b395d9e1c8f2d9e12a37d3 100644 (file)
@@ -49,7 +49,7 @@ namespace FreeDV {
   }
 
   int
-  PTTConstant::poll_fds(struct pollfd * array, int space)
+  PTTConstant::poll_fds(struct pollfd *, int)
   {
     return 0;
   }
index c3bf8fe2bfce11f8074ff4f6ed1af63c746ad119..57c9d888f5fb09b621dde68ea141b7e2c637d1ce 100644 (file)
@@ -40,7 +40,7 @@ namespace FreeDV {
   }
 
   int
-  TextConstant::poll_fds(struct pollfd * array, int space)
+  TextConstant::poll_fds(struct pollfd *, int)
   {
     return 0;
   }
index 79d0a0731b32af9ecd9933038613f1655d1cdb56..97c61fac1fc6b6f629e229a5bda94157cb590a68 100644 (file)
@@ -95,7 +95,7 @@ namespace FreeDV {
       input++;
     }
     tones[index].frequency = 0.0;
-    tones[index].amplitude = 0.0;
+    tones[index].amplitude = -1.0;
   }
 
   Tone::~Tone()
@@ -110,13 +110,14 @@ namespace FreeDV {
     for ( unsigned int i = 0; i < length; i++ ) {
       float value = 0;
       float sumOfAmplitudes = 0;
-      for ( unsigned int j = 0; j < array_length && tones[j].amplitude > 0.0;
+      for ( unsigned int j = 0; j < array_length && tones[j].amplitude >= 0.0;
        j++ ) {
         value += (sine_wave(tones[j].frequency, clock + i)
          * tones[j].amplitude);
        // FIX: Hoist this out of the inner loop after it's tested.
         sumOfAmplitudes += tones[j].amplitude;
       }
+      // FIX: Hoist this out of the inner loop after it's tested.
       // If the sum of amplitudes is greater than 1.0, normalize so that the
       // sum of amplitudes is 1.0.
       if ( sumOfAmplitudes > 1.0 )
@@ -131,7 +132,7 @@ namespace FreeDV {
   }
 
   int
-  Tone::poll_fds(struct pollfd * array, int space)
+  Tone::poll_fds(struct pollfd *, int)
   {
     return 0;
   }