13
0
livetrax/libs/audiographer/audiographer/peak_reader.h
Sakari Bergen dde0848a98 Re-integrate export-optimization branch.
Export now happens directly to file (unless normalizing is required), and can be easily optimized even further.
The Session process connection is still broken during export (as it was before this commit also).


git-svn-id: svn://localhost/ardour2/branches/3.0@6401 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-12-27 14:46:23 +00:00

39 lines
722 B
C++

#ifndef AUDIOGRAPHER_PEAK_READER_H
#define AUDIOGRAPHER_PEAK_READER_H
#include "listed_source.h"
#include "sink.h"
#include "routines.h"
namespace AudioGrapher
{
class PeakReader : public ListedSource<float>, public Sink<float>
{
public:
PeakReader() : peak (0.0) {}
float get_peak() { return peak; }
void reset() { peak = 0.0; }
void process (ProcessContext<float> const & c)
{
peak = Routines::compute_peak (c.data(), c.frames(), peak);
ListedSource<float>::output(c);
}
void process (ProcessContext<float> & c)
{
peak = Routines::compute_peak (c.data(), c.frames(), peak);
ListedSource<float>::output(c);
}
private:
float peak;
};
} // namespace
#endif // AUDIOGRAPHER_PEAK_READER_H