From 30b087ab3d28f1585987fa3f6ae006562ae192e3 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 18 Sep 2017 12:39:17 -0400 Subject: globally change all use of "frame" to refer to audio into "sample". Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode and video in order to keep the legible --- libs/audiographer/audiographer/routines.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'libs/audiographer/audiographer/routines.h') diff --git a/libs/audiographer/audiographer/routines.h b/libs/audiographer/audiographer/routines.h index d78fa602b6..468580807d 100644 --- a/libs/audiographer/audiographer/routines.h +++ b/libs/audiographer/audiographer/routines.h @@ -25,39 +25,39 @@ class LIBAUDIOGRAPHER_API Routines /** Computes peak in float buffer * \n RT safe * \param data buffer from which the peak is computed - * \param frames length of the portion of \a buffer that is checked + * \param samples length of the portion of \a buffer that is checked * \param current_peak current peak of buffer, if calculated in several passes - * \return maximum of values in [\a data, \a data + \a frames) and \a current_peak + * \return maximum of values in [\a data, \a data + \a samples) and \a current_peak */ - static inline float compute_peak (float const * data, uint_type frames, float current_peak) + static inline float compute_peak (float const * data, uint_type samples, float current_peak) { - return (*_compute_peak) (data, frames, current_peak); + return (*_compute_peak) (data, samples, current_peak); } /** Applies constant gain to buffer * \n RT safe * \param data data to which the gain is applied - * \param frames length of data + * \param samples length of data * \param gain gain that is applied */ - static inline void apply_gain_to_buffer (float * data, uint_type frames, float gain) + static inline void apply_gain_to_buffer (float * data, uint_type samples, float gain) { - (*_apply_gain_to_buffer) (data, frames, gain); + (*_apply_gain_to_buffer) (data, samples, gain); } private: - static inline float default_compute_peak (float const * data, uint_type frames, float current_peak) + static inline float default_compute_peak (float const * data, uint_type samples, float current_peak) { - for (uint_type i = 0; i < frames; ++i) { + for (uint_type i = 0; i < samples; ++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, uint_type frames, float gain) + static inline void default_apply_gain_to_buffer (float * data, uint_type samples, float gain) { - for (uint_type i = 0; i < frames; ++i) { + for (uint_type i = 0; i < samples; ++i) { data[i] *= gain; } } -- cgit v1.2.3