diff options
author | Taybin Rutkin <taybin@taybin.com> | 2005-09-24 19:13:41 +0000 |
---|---|---|
committer | Taybin Rutkin <taybin@taybin.com> | 2005-09-24 19:13:41 +0000 |
commit | 8af0757b61990767f2a85e68f535a5af9976fd79 (patch) | |
tree | f9e06fe12cac866d658a2e7074a61aa74d12f68f /libs/ardour/ardour/peak.h | |
parent | f9546e5c76afa101e9dbe8a057e72463b03430e5 (diff) |
libardour added.
git-svn-id: svn://localhost/trunk/ardour2@17 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/peak.h')
-rw-r--r-- | libs/ardour/ardour/peak.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/ardour/ardour/peak.h b/libs/ardour/ardour/peak.h new file mode 100644 index 0000000000..d08357024b --- /dev/null +++ b/libs/ardour/ardour/peak.h @@ -0,0 +1,17 @@ +#ifndef __ardour_peak_h__ +#define __ardour_peak_h__ + +#include <cmath> +#include <ardour/types.h> +#include <ardour/utils.h> + +static inline float +compute_peak (ARDOUR::Sample *buf, jack_nframes_t nsamples, float current) +{ + for (jack_nframes_t i = 0; i < nsamples; ++i) { + current = f_max (current, fabsf (buf[i])); + } + return current; +} + +#endif /* __ardour_peak_h__ */ |