#include "ardour/source_factory.h"
#include "ardour/utils.h"
+#include "audiographer/routines.h"
+
#if defined (__APPLE__)
#include <Carbon/Carbon.h> // For Gestalt
#endif
info << "No H/W specific optimizations in use" << endmsg;
}
+
+ AudioGrapher::Routines::override_compute_peak (compute_peak);
+ AudioGrapher::Routines::override_apply_gain_to_buffer (apply_gain_to_buffer);
}
static void
#include <cmath>
+#define routines_nframes_t uint32_t
+
namespace AudioGrapher
{
class Routines
{
public:
- typedef float (*compute_peak_t) (float const *, nframes_t, float);
- typedef void (*apply_gain_to_buffer_t) (float *, nframes_t, float);
+ typedef float (*compute_peak_t) (float const *, routines_nframes_t, float);
+ typedef void (*apply_gain_to_buffer_t) (float *, routines_nframes_t, float);
static void override_compute_peak (compute_peak_t func) { _compute_peak = func; }
static void override_apply_gain_to_buffer (apply_gain_to_buffer_t func) { _apply_gain_to_buffer = func; }
- static inline float compute_peak (float const * data, nframes_t frames, float current_peak)
+ static inline float compute_peak (float const * data, routines_nframes_t frames, float current_peak)
{
return (*_compute_peak) (data, frames, current_peak);
}
- static inline void apply_gain_to_buffer (float * data, nframes_t frames, float gain)
+ static inline void apply_gain_to_buffer (float * data, routines_nframes_t frames, float gain)
{
(*_apply_gain_to_buffer) (data, frames, gain);
}
private:
- static inline float default_compute_peak (float const * data, nframes_t frames, float current_peak)
+ static inline float default_compute_peak (float const * data, routines_nframes_t frames, float current_peak)
{
- for (nframes_t i = 0; i < frames; ++i) {
+ for (routines_nframes_t i = 0; i < frames; ++i) {
float abs = std::fabs(data[i]);
if (abs > current_peak) { current_peak = abs; }
}
return current_peak;
}
- static inline void default_apply_gain_to_buffer (float * data, nframes_t frames, float gain)
+ static inline void default_apply_gain_to_buffer (float * data, routines_nframes_t frames, float gain)
{
- for (nframes_t i = 0; i < frames; ++i) {
+ for (routines_nframes_t i = 0; i < frames; ++i) {
data[i] *= gain;
}
}
} // namespace
+#undef routines_nframes_t
+
#endif // AUDIOGRAPHER_ROUTINES_H
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import autowaf
+import os
# Version of this package (even if built as a child)
AUDIOGRAPHER_VERSION = '0.0.0'
audiographer.includes = ['.', './src']
audiographer.uselib = 'GLIB GLIBMM GTHREAD SAMPLERATE SNDFILE'
audiographer.vnum = AUDIOGRAPHER_LIB_VERSION
- audiographer.install_path = '${LIBDIR}'
-
+ audiographer.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
if bld.env['BUILD_TESTS'] and bld.env['HAVE_CPPUNIT']:
# Unit tests