* logical and (short-circuiting).
*/
template<DebugLevel L = DEFAULT_DEBUG_LEVEL>
-class LIBAUDIOGRAPHER_API Debuggable
+class /*LIBAUDIOGRAPHER_API*/ Debuggable
{
protected:
Debuggable(std::ostream & debug_stream = std::cerr)
/// A debugging class for nodes that support a certain set of flags.
template<DebugLevel L = DEFAULT_DEBUG_LEVEL>
-class LIBAUDIOGRAPHER_API FlagDebuggable : public Debuggable<L>
+class /*LIBAUDIOGRAPHER_API*/ FlagDebuggable : public Debuggable<L>
{
public:
typedef FlagField::Flag Flag;
/// A class that chunks process cycles into equal sized frames
template<typename T = DefaultSampleType>
-class LIBAUDIOGRAPHER_API Chunker
+class /*LIBAUDIOGRAPHER_API*/ Chunker
: public ListedSource<T>
, public Sink<T>
, public FlagDebuggable<>
/// Converts on stream of interleaved data to many streams of uninterleaved data.
template<typename T = DefaultSampleType>
-class LIBAUDIOGRAPHER_API DeInterleaver
+class /*LIBAUDIOGRAPHER_API*/ DeInterleaver
: public Sink<T>
, public Throwing<>
{
/// Interleaves many streams of non-interleaved data into one interleaved stream
template<typename T = DefaultSampleType>
-class LIBAUDIOGRAPHER_API Interleaver
+class /*LIBAUDIOGRAPHER_API*/ Interleaver
: public ListedSource<T>
, public Throwing<>
{
#include "audiographer/routines.h"
#include "audiographer/utils/listed_source.h"
-#include <cstring>
-
namespace AudioGrapher
{
, public Sink<float>
, public Throwing<>
{
- public:
+public:
/// Constructs a normalizer with a specific target in dB \n RT safe
- Normalizer (float target_dB)
- : enabled (false)
- , buffer (0)
- , buffer_size (0)
- {
- target = pow (10.0f, target_dB * 0.05f);
- }
-
- ~Normalizer()
- {
- delete [] buffer;
- }
+ Normalizer (float target_dB);
+ ~Normalizer();
/// Sets the peak found in the material to be normalized \see PeakReader \n RT safe
- void set_peak (float peak)
- {
- if (peak == 0.0f || peak == target) {
- /* don't even try */
- enabled = false;
- } else {
- enabled = true;
- gain = target / peak;
- }
- }
+ void set_peak (float peak);
/** Allocates a buffer for using with const ProcessContexts
* This function does not need to be called if
* non-const ProcessContexts are given to \a process() .
* \n Not RT safe
*/
- void alloc_buffer(framecnt_t frames)
- {
- delete [] buffer;
- buffer = new float[frames];
- buffer_size = frames;
- }
+ void alloc_buffer(framecnt_t frames);
/// Process a const ProcessContext \see alloc_buffer() \n RT safe
- void process (ProcessContext<float> const & c)
- {
- if (throw_level (ThrowProcess) && c.frames() > buffer_size) {
- throw Exception (*this, "Too many frames given to process()");
- }
-
- if (enabled) {
- memcpy (buffer, c.data(), c.frames() * sizeof(float));
- Routines::apply_gain_to_buffer (buffer, c.frames(), gain);
- }
-
- ProcessContext<float> c_out (c, buffer);
- ListedSource<float>::output (c_out);
- }
+ void process (ProcessContext<float> const & c);
/// Process a non-const ProcsesContext in-place \n RT safe
- void process (ProcessContext<float> & c)
- {
- if (enabled) {
- Routines::apply_gain_to_buffer (c.data(), c.frames(), gain);
- }
- ListedSource<float>::output(c);
- }
-
- private:
+ void process (ProcessContext<float> & c);
+
+private:
bool enabled;
float target;
float gain;
{
/// A class that reads the maximum value from a stream
-class LIBAUDIOGRAPHER_API PeakReader : public ListedSource<float>, public Sink<float>
+class /*LIBAUDIOGRAPHER_API*/ PeakReader : public ListedSource<float>, public Sink<float>
{
public:
/// Constructor \n RT safe
{
/// Dither types from the gdither library
-enum LIBAUDIOGRAPHER_API DitherType
+enum /*LIBAUDIOGRAPHER_API*/ DitherType
{
D_None = GDitherNone, ///< No didtering
D_Rect = GDitherRect, ///< Rectangular dithering, i.e. white noise
/// Removes and adds silent frames to beginning and/or end of stream
template<typename T = DefaultSampleType>
-class LIBAUDIOGRAPHER_API SilenceTrimmer
+class /*LIBAUDIOGRAPHER_API*/ SilenceTrimmer
: public ListedSource<T>
, public Sink<T>
, public FlagDebuggable<>
{
/// Class that stores exceptions thrown from different threads
-class LIBAUDIOGRAPHER_API ThreaderException : public Exception
+class /*LIBAUDIOGRAPHER_API*/ ThreaderException : public Exception
{
public:
template<typename T>
/// Class for distributing processing across several threads
template <typename T = DefaultSampleType>
-class LIBAUDIOGRAPHER_API Threader : public Source<T>, public Sink<T>
+class /*LIBAUDIOGRAPHER_API*/ Threader : public Source<T>, public Sink<T>
{
private:
typedef std::vector<typename Source<T>::SinkPtr> OutputVec;
*/
template <typename T = DefaultSampleType>
-class LIBAUDIOGRAPHER_API ProcessContext
+class /*LIBAUDIOGRAPHER_API*/ ProcessContext
: public Throwing<>
{
// Support older compilers that don't support template base class initialization without template parameters
/// A process context that allocates and owns it's data buffer
template <typename T = DefaultSampleType>
-class LIBAUDIOGRAPHER_API AllocatingProcessContext : public ProcessContext<T>
+class /*LIBAUDIOGRAPHER_API*/ AllocatingProcessContext : public ProcessContext<T>
{
public:
/// Allocates uninitialized memory
/// A wrapper for a const ProcesContext which can be created from const data
template <typename T = DefaultSampleType>
-class LIBAUDIOGRAPHER_API ConstProcessContext
+class /*LIBAUDIOGRAPHER_API*/ ConstProcessContext
{
public:
/// Basic constructor with data, frame and channel count
* This is a pure virtual interface for all data sinks in AudioGrapher
*/
template <typename T>
-class LIBAUDIOGRAPHER_API Sink {
+class /*LIBAUDIOGRAPHER_API*/ Sink {
public:
virtual ~Sink () {}
* This is a pure virtual interface for all data sources in AudioGrapher
*/
template<typename T>
-class LIBAUDIOGRAPHER_API Source
+class /*LIBAUDIOGRAPHER_API*/ Source
{
public:
virtual ~Source () { }
* However, if you want ultra-optimized code and/or don't care about handling
* error situations, feel free to use whatever you want.
*/
-enum LIBAUDIOGRAPHER_API ThrowLevel
+enum /*LIBAUDIOGRAPHER_API*/ ThrowLevel
{
ThrowNone, ///< Not allowed to throw
ThrowObject, ///< Object level stuff, ctors, initalizers etc.
* logical and (short-circuiting).
*/
template<ThrowLevel L = DEFAULT_THROW_LEVEL>
-class LIBAUDIOGRAPHER_API Throwing
+class /*LIBAUDIOGRAPHER_API*/ Throwing
{
protected:
Throwing() {}
/// Utilities for initializing, copying, moving, etc. data
template<typename T = DefaultSampleType>
-class LIBAUDIOGRAPHER_API TypeUtils : private TypeUtilsBase
+class /*LIBAUDIOGRAPHER_API*/ TypeUtils : private TypeUtilsBase
{
BOOST_STATIC_ASSERT (boost::has_trivial_destructor<T>::value);
/// Outputs its input directly to a number of Sinks
template<typename T = DefaultSampleType>
-class LIBAUDIOGRAPHER_API IdentityVertex : public ListedSource<T>, Sink<T>
+class /*LIBAUDIOGRAPHER_API*/ IdentityVertex : public ListedSource<T>, Sink<T>
{
public:
void process (ProcessContext<T> const & c) { ListedSource<T>::output(c); }
/// An generic \a Source that uses a \a std::list for managing outputs
template<typename T = DefaultSampleType>
-class LIBAUDIOGRAPHER_API ListedSource : public Source<T>
+class /*LIBAUDIOGRAPHER_API*/ ListedSource : public Source<T>
{
public:
void add_output (typename Source<T>::SinkPtr output) { outputs.push_back(output); }