From 5fc1cbb65c94ce495d2c30c22d830a2975bee47f Mon Sep 17 00:00:00 2001 From: John Emmas Date: Mon, 13 Jan 2014 14:58:04 +0000 Subject: 'libs/audiographer' - DLL visibility stuff and associated changes needed for building with MSVC. Currently includes debugging information and things that are just commented out until we have known compatibility with the other platforms (i.e. contains stuff to be removed at a later date) --- libs/audiographer/audiographer/debuggable.h | 2 +- libs/audiographer/audiographer/flag_debuggable.h | 2 +- libs/audiographer/audiographer/general/chunker.h | 2 +- .../audiographer/general/deinterleaver.h | 2 +- .../audiographer/general/interleaver.h | 2 +- .../audiographer/audiographer/general/normalizer.h | 63 ++++------------------ .../audiographer/general/peak_reader.h | 2 +- .../audiographer/general/sample_format_converter.h | 2 +- .../audiographer/general/silence_trimmer.h | 2 +- libs/audiographer/audiographer/general/threader.h | 4 +- libs/audiographer/audiographer/process_context.h | 6 +-- libs/audiographer/audiographer/sink.h | 2 +- libs/audiographer/audiographer/source.h | 2 +- libs/audiographer/audiographer/throwing.h | 4 +- libs/audiographer/audiographer/type_utils.h | 2 +- .../audiographer/utils/identity_vertex.h | 2 +- .../audiographer/utils/listed_source.h | 2 +- 17 files changed, 29 insertions(+), 74 deletions(-) (limited to 'libs/audiographer/audiographer') diff --git a/libs/audiographer/audiographer/debuggable.h b/libs/audiographer/audiographer/debuggable.h index fc03d1e68d..8fe48159de 100644 --- a/libs/audiographer/audiographer/debuggable.h +++ b/libs/audiographer/audiographer/debuggable.h @@ -38,7 +38,7 @@ enum LIBAUDIOGRAPHER_API DebugLevel * logical and (short-circuiting). */ template -class LIBAUDIOGRAPHER_API Debuggable +class /*LIBAUDIOGRAPHER_API*/ Debuggable { protected: Debuggable(std::ostream & debug_stream = std::cerr) diff --git a/libs/audiographer/audiographer/flag_debuggable.h b/libs/audiographer/audiographer/flag_debuggable.h index 5cb948a3d0..7ff6a79ed1 100644 --- a/libs/audiographer/audiographer/flag_debuggable.h +++ b/libs/audiographer/audiographer/flag_debuggable.h @@ -14,7 +14,7 @@ namespace AudioGrapher /// A debugging class for nodes that support a certain set of flags. template -class LIBAUDIOGRAPHER_API FlagDebuggable : public Debuggable +class /*LIBAUDIOGRAPHER_API*/ FlagDebuggable : public Debuggable { public: typedef FlagField::Flag Flag; diff --git a/libs/audiographer/audiographer/general/chunker.h b/libs/audiographer/audiographer/general/chunker.h index 2ff766fef3..0ee0c20b20 100644 --- a/libs/audiographer/audiographer/general/chunker.h +++ b/libs/audiographer/audiographer/general/chunker.h @@ -12,7 +12,7 @@ namespace AudioGrapher /// A class that chunks process cycles into equal sized frames template -class LIBAUDIOGRAPHER_API Chunker +class /*LIBAUDIOGRAPHER_API*/ Chunker : public ListedSource , public Sink , public FlagDebuggable<> diff --git a/libs/audiographer/audiographer/general/deinterleaver.h b/libs/audiographer/audiographer/general/deinterleaver.h index f9374b67ad..fac38912d7 100644 --- a/libs/audiographer/audiographer/general/deinterleaver.h +++ b/libs/audiographer/audiographer/general/deinterleaver.h @@ -15,7 +15,7 @@ namespace AudioGrapher /// Converts on stream of interleaved data to many streams of uninterleaved data. template -class LIBAUDIOGRAPHER_API DeInterleaver +class /*LIBAUDIOGRAPHER_API*/ DeInterleaver : public Sink , public Throwing<> { diff --git a/libs/audiographer/audiographer/general/interleaver.h b/libs/audiographer/audiographer/general/interleaver.h index b0f0efdc66..fe174c9fcb 100644 --- a/libs/audiographer/audiographer/general/interleaver.h +++ b/libs/audiographer/audiographer/general/interleaver.h @@ -16,7 +16,7 @@ namespace AudioGrapher /// Interleaves many streams of non-interleaved data into one interleaved stream template -class LIBAUDIOGRAPHER_API Interleaver +class /*LIBAUDIOGRAPHER_API*/ Interleaver : public ListedSource , public Throwing<> { diff --git a/libs/audiographer/audiographer/general/normalizer.h b/libs/audiographer/audiographer/general/normalizer.h index 86fe26b790..e95f0e3852 100644 --- a/libs/audiographer/audiographer/general/normalizer.h +++ b/libs/audiographer/audiographer/general/normalizer.h @@ -6,8 +6,6 @@ #include "audiographer/routines.h" #include "audiographer/utils/listed_source.h" -#include - namespace AudioGrapher { @@ -17,71 +15,28 @@ class LIBAUDIOGRAPHER_API Normalizer , public Sink , 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 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 c_out (c, buffer); - ListedSource::output (c_out); - } + void process (ProcessContext const & c); /// Process a non-const ProcsesContext in-place \n RT safe - void process (ProcessContext & c) - { - if (enabled) { - Routines::apply_gain_to_buffer (c.data(), c.frames(), gain); - } - ListedSource::output(c); - } - - private: + void process (ProcessContext & c); + +private: bool enabled; float target; float gain; diff --git a/libs/audiographer/audiographer/general/peak_reader.h b/libs/audiographer/audiographer/general/peak_reader.h index 208a8989df..dd5d65491c 100644 --- a/libs/audiographer/audiographer/general/peak_reader.h +++ b/libs/audiographer/audiographer/general/peak_reader.h @@ -10,7 +10,7 @@ namespace AudioGrapher { /// A class that reads the maximum value from a stream -class LIBAUDIOGRAPHER_API PeakReader : public ListedSource, public Sink +class /*LIBAUDIOGRAPHER_API*/ PeakReader : public ListedSource, public Sink { public: /// Constructor \n RT safe diff --git a/libs/audiographer/audiographer/general/sample_format_converter.h b/libs/audiographer/audiographer/general/sample_format_converter.h index 62500d42dc..b2efc69cab 100644 --- a/libs/audiographer/audiographer/general/sample_format_converter.h +++ b/libs/audiographer/audiographer/general/sample_format_converter.h @@ -10,7 +10,7 @@ namespace AudioGrapher { /// 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 diff --git a/libs/audiographer/audiographer/general/silence_trimmer.h b/libs/audiographer/audiographer/general/silence_trimmer.h index 8a8dd920f5..165b29d4d5 100644 --- a/libs/audiographer/audiographer/general/silence_trimmer.h +++ b/libs/audiographer/audiographer/general/silence_trimmer.h @@ -14,7 +14,7 @@ namespace AudioGrapher { /// Removes and adds silent frames to beginning and/or end of stream template -class LIBAUDIOGRAPHER_API SilenceTrimmer +class /*LIBAUDIOGRAPHER_API*/ SilenceTrimmer : public ListedSource , public Sink , public FlagDebuggable<> diff --git a/libs/audiographer/audiographer/general/threader.h b/libs/audiographer/audiographer/general/threader.h index 98c6145ee9..e9a953ce44 100644 --- a/libs/audiographer/audiographer/general/threader.h +++ b/libs/audiographer/audiographer/general/threader.h @@ -19,7 +19,7 @@ namespace AudioGrapher { /// Class that stores exceptions thrown from different threads -class LIBAUDIOGRAPHER_API ThreaderException : public Exception +class /*LIBAUDIOGRAPHER_API*/ ThreaderException : public Exception { public: template @@ -33,7 +33,7 @@ class LIBAUDIOGRAPHER_API ThreaderException : public Exception /// Class for distributing processing across several threads template -class LIBAUDIOGRAPHER_API Threader : public Source, public Sink +class /*LIBAUDIOGRAPHER_API*/ Threader : public Source, public Sink { private: typedef std::vector::SinkPtr> OutputVec; diff --git a/libs/audiographer/audiographer/process_context.h b/libs/audiographer/audiographer/process_context.h index 61b95a2aa4..36abd4fba0 100644 --- a/libs/audiographer/audiographer/process_context.h +++ b/libs/audiographer/audiographer/process_context.h @@ -22,7 +22,7 @@ namespace AudioGrapher */ template -class LIBAUDIOGRAPHER_API ProcessContext +class /*LIBAUDIOGRAPHER_API*/ ProcessContext : public Throwing<> { // Support older compilers that don't support template base class initialization without template parameters @@ -126,7 +126,7 @@ protected: /// A process context that allocates and owns it's data buffer template -class LIBAUDIOGRAPHER_API AllocatingProcessContext : public ProcessContext +class /*LIBAUDIOGRAPHER_API*/ AllocatingProcessContext : public ProcessContext { public: /// Allocates uninitialized memory @@ -163,7 +163,7 @@ public: /// A wrapper for a const ProcesContext which can be created from const data template -class LIBAUDIOGRAPHER_API ConstProcessContext +class /*LIBAUDIOGRAPHER_API*/ ConstProcessContext { public: /// Basic constructor with data, frame and channel count diff --git a/libs/audiographer/audiographer/sink.h b/libs/audiographer/audiographer/sink.h index 84f7e12e40..e4248e8c33 100644 --- a/libs/audiographer/audiographer/sink.h +++ b/libs/audiographer/audiographer/sink.h @@ -14,7 +14,7 @@ namespace AudioGrapher * This is a pure virtual interface for all data sinks in AudioGrapher */ template -class LIBAUDIOGRAPHER_API Sink { +class /*LIBAUDIOGRAPHER_API*/ Sink { public: virtual ~Sink () {} diff --git a/libs/audiographer/audiographer/source.h b/libs/audiographer/audiographer/source.h index 9a3f80719b..945cb13298 100644 --- a/libs/audiographer/audiographer/source.h +++ b/libs/audiographer/audiographer/source.h @@ -15,7 +15,7 @@ namespace AudioGrapher * This is a pure virtual interface for all data sources in AudioGrapher */ template -class LIBAUDIOGRAPHER_API Source +class /*LIBAUDIOGRAPHER_API*/ Source { public: virtual ~Source () { } diff --git a/libs/audiographer/audiographer/throwing.h b/libs/audiographer/audiographer/throwing.h index e02958a521..ecf7aecd49 100644 --- a/libs/audiographer/audiographer/throwing.h +++ b/libs/audiographer/audiographer/throwing.h @@ -16,7 +16,7 @@ namespace AudioGrapher * 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. @@ -40,7 +40,7 @@ enum LIBAUDIOGRAPHER_API ThrowLevel * logical and (short-circuiting). */ template -class LIBAUDIOGRAPHER_API Throwing +class /*LIBAUDIOGRAPHER_API*/ Throwing { protected: Throwing() {} diff --git a/libs/audiographer/audiographer/type_utils.h b/libs/audiographer/audiographer/type_utils.h index a7c38fc660..7245822e26 100644 --- a/libs/audiographer/audiographer/type_utils.h +++ b/libs/audiographer/audiographer/type_utils.h @@ -29,7 +29,7 @@ class LIBAUDIOGRAPHER_API TypeUtilsBase /// Utilities for initializing, copying, moving, etc. data template -class LIBAUDIOGRAPHER_API TypeUtils : private TypeUtilsBase +class /*LIBAUDIOGRAPHER_API*/ TypeUtils : private TypeUtilsBase { BOOST_STATIC_ASSERT (boost::has_trivial_destructor::value); diff --git a/libs/audiographer/audiographer/utils/identity_vertex.h b/libs/audiographer/audiographer/utils/identity_vertex.h index 1d7ed80697..5c9cfc9934 100644 --- a/libs/audiographer/audiographer/utils/identity_vertex.h +++ b/libs/audiographer/audiographer/utils/identity_vertex.h @@ -11,7 +11,7 @@ namespace AudioGrapher /// Outputs its input directly to a number of Sinks template -class LIBAUDIOGRAPHER_API IdentityVertex : public ListedSource, Sink +class /*LIBAUDIOGRAPHER_API*/ IdentityVertex : public ListedSource, Sink { public: void process (ProcessContext const & c) { ListedSource::output(c); } diff --git a/libs/audiographer/audiographer/utils/listed_source.h b/libs/audiographer/audiographer/utils/listed_source.h index 6ceab6b27f..b9bfbc65f8 100644 --- a/libs/audiographer/audiographer/utils/listed_source.h +++ b/libs/audiographer/audiographer/utils/listed_source.h @@ -13,7 +13,7 @@ namespace AudioGrapher /// An generic \a Source that uses a \a std::list for managing outputs template -class LIBAUDIOGRAPHER_API ListedSource : public Source +class /*LIBAUDIOGRAPHER_API*/ ListedSource : public Source { public: void add_output (typename Source::SinkPtr output) { outputs.push_back(output); } -- cgit v1.2.3