first part of fixing up send/return metering ; make send-controlling faders work...
[ardour.git] / libs / ardour / utils.cc
index 58443bd0053a937b8333dcaa117b6700631e5ef3..e12ae2cd893fffb798daff6a45859291bd624007 100644 (file)
 
 */
 
+#ifdef WAF_BUILD
+#include "libardour-config.h"
+#endif
+
 #define __STDC_FORMAT_MACROS 1
 #include <stdint.h>
 
@@ -24,7 +28,7 @@
 #include <cstring>
 #include <cmath>
 #include <cctype>
-#include <string>
+#include <cstring>
 #include <cerrno>
 #include <iostream>
 #include <sys/types.h>
 #include <wordexp.h>
 #endif
 
-#include <pbd/error.h>
-#include <pbd/stacktrace.h>
-#include <pbd/xml++.h>
-#include <pbd/basename.h>
-#include <ardour/utils.h>
+#include "pbd/error.h"
+#include "pbd/stacktrace.h"
+#include "pbd/xml++.h"
+#include "pbd/basename.h"
+#include "ardour/utils.h"
 
 #include "i18n.h"
 
@@ -282,7 +286,7 @@ compute_equal_power_fades (nframes_t nframes, float* in, float* out)
 {
        double step;
 
-       step = 1.0/nframes;
+       step = 1.0/(nframes-1);
 
        in[0] = 0.0f;
 
@@ -378,19 +382,6 @@ slave_source_to_string (SlaveSource src)
        }
 }
 
-/* I don't really like hard-coding these falloff rates here
- * Probably should use a map of some kind that could be configured
- * These rates are db/sec.
-*/
-
-#define METER_FALLOFF_OFF     0.0f
-#define METER_FALLOFF_SLOWEST 6.6f // BBC standard
-#define METER_FALLOFF_SLOW    8.6f // BBC standard
-#define METER_FALLOFF_MEDIUM  20.0f
-#define METER_FALLOFF_FAST    32.0f
-#define METER_FALLOFF_FASTER  46.0f
-#define METER_FALLOFF_FASTEST 70.0f
-
 float
 meter_falloff_to_float (MeterFalloff falloff)
 {
@@ -440,22 +431,6 @@ meter_falloff_from_float (float val)
        }
 }
 
-float
-meter_hold_to_float (MeterHold hold)
-{
-       switch (hold) {
-       case MeterHoldOff:
-               return 0.0f;
-       case MeterHoldShort:
-               return 40.0f;
-       case MeterHoldMedium:
-               return 100.0f;
-       case MeterHoldLong:
-       default:
-               return 200.0f;
-       }
-}
-
 AutoState
 ARDOUR::string_to_auto_state (std::string str)
 {