add export control with -fvisibility=hidden to audiographer

This commit is contained in:
Paul Davis 2013-10-17 15:37:11 -04:00
parent 5b2a5d77b8
commit a2d55d088a
25 changed files with 92 additions and 46 deletions

View File

@ -26,12 +26,14 @@
#include <sndfile.h>
#include "audiographer/visibility.h"
namespace AudioGrapher
{
class SndfileHandle;
class LIBAUDIOGRAPHER_API SndfileHandle;
class BroadcastInfo
class LIBAUDIOGRAPHER_API BroadcastInfo
{
public:

View File

@ -10,11 +10,13 @@
#include <cxxabi.h>
#endif
#include "audiographer/visibility.h"
namespace AudioGrapher
{
/// Utilities for debugging
struct DebugUtils
struct LIBAUDIOGRAPHER_API DebugUtils
{
/// Returns the demangled name of the object passed as the parameter
template<typename T>

View File

@ -7,11 +7,13 @@
#include <iostream>
#include "audiographer/visibility.h"
namespace AudioGrapher
{
/// Compile time defined debug level
enum DebugLevel
enum LIBAUDIOGRAPHER_API DebugLevel
{
DebugNone, ///< Disabled
DebugObject, ///< Object level stuff, ctors, initalizers etc.
@ -36,7 +38,7 @@ enum DebugLevel
* logical and (short-circuiting).
*/
template<DebugLevel L = DEFAULT_DEBUG_LEVEL>
class Debuggable
class LIBAUDIOGRAPHER_API Debuggable
{
protected:
Debuggable(std::ostream & debug_stream = std::cerr)

View File

@ -6,6 +6,7 @@
#include <boost/format.hpp>
#include "audiographer/visibility.h"
#include "audiographer/debug_utils.h"
namespace AudioGrapher
@ -14,7 +15,7 @@ namespace AudioGrapher
/** AudioGrapher Exception class.
* Automatically tells which class an exception was thrown from.
*/
class Exception : public std::exception
class LIBAUDIOGRAPHER_API Exception : public std::exception
{
public:
template<typename T>
@ -38,4 +39,4 @@ class Exception : public std::exception
} // namespace AudioGrapher
#endif // AUDIOGRAPHER_EXCEPTION_H
#endif // AUDIOGRAPHER_EXCEPTION_H

View File

@ -1,6 +1,7 @@
#ifndef AUDIOGRAPHER_FLAG_DEBUGGABLE_H
#define AUDIOGRAPHER_FLAG_DEBUGGABLE_H
#include "audiographer/visibility.h"
#include "debuggable.h"
#include "debug_utils.h"
#include "process_context.h"
@ -13,7 +14,7 @@ namespace AudioGrapher
/// A debugging class for nodes that support a certain set of flags.
template<DebugLevel L = DEFAULT_DEBUG_LEVEL>
class FlagDebuggable : public Debuggable<L>
class LIBAUDIOGRAPHER_API FlagDebuggable : public Debuggable<L>
{
public:
typedef FlagField::Flag Flag;

View File

@ -7,12 +7,14 @@
#include <boost/operators.hpp>
#include "audiographer/visibility.h"
namespace AudioGrapher {
/** Flag field capable of holding 32 flags.
* Easily grown in size to 64 flags by changing storage_type.
*/
class FlagField
class LIBAUDIOGRAPHER_API FlagField
: public boost::less_than_comparable<FlagField>
, boost::equivalent<FlagField>
, boost::equality_comparable<FlagField>
@ -103,4 +105,4 @@ class FlagField
} // namespace
#endif // AUDIOGRAPHER_FLAG_FIELD_H
#endif // AUDIOGRAPHER_FLAG_FIELD_H

View File

@ -1,6 +1,7 @@
#ifndef AUDIOGRAPHER_CHUNKER_H
#define AUDIOGRAPHER_CHUNKER_H
#include "audiographer/visibility.h"
#include "audiographer/flag_debuggable.h"
#include "audiographer/sink.h"
#include "audiographer/type_utils.h"
@ -11,7 +12,7 @@ namespace AudioGrapher
/// A class that chunks process cycles into equal sized frames
template<typename T = DefaultSampleType>
class Chunker
class LIBAUDIOGRAPHER_API Chunker
: public ListedSource<T>
, public Sink<T>
, public FlagDebuggable<>

View File

@ -1,6 +1,7 @@
#ifndef AUDIOGRAPHER_DEINTERLEAVER_H
#define AUDIOGRAPHER_DEINTERLEAVER_H
#include "audiographer/visibility.h"
#include "audiographer/types.h"
#include "audiographer/source.h"
#include "audiographer/sink.h"
@ -14,7 +15,7 @@ namespace AudioGrapher
/// Converts on stream of interleaved data to many streams of uninterleaved data.
template<typename T = DefaultSampleType>
class DeInterleaver
class LIBAUDIOGRAPHER_API DeInterleaver
: public Sink<T>
, public Throwing<>
{

View File

@ -1,6 +1,7 @@
#ifndef AUDIOGRAPHER_INTERLEAVER_H
#define AUDIOGRAPHER_INTERLEAVER_H
#include "audiographer/visibility.h"
#include "audiographer/types.h"
#include "audiographer/sink.h"
#include "audiographer/exception.h"
@ -15,7 +16,7 @@ namespace AudioGrapher
/// Interleaves many streams of non-interleaved data into one interleaved stream
template<typename T = DefaultSampleType>
class Interleaver
class LIBAUDIOGRAPHER_API Interleaver
: public ListedSource<T>
, public Throwing<>
{

View File

@ -1,6 +1,7 @@
#ifndef AUDIOGRAPHER_NORMALIZER_H
#define AUDIOGRAPHER_NORMALIZER_H
#include "audiographer/visibility.h"
#include "audiographer/sink.h"
#include "audiographer/routines.h"
#include "audiographer/utils/listed_source.h"
@ -11,7 +12,7 @@ namespace AudioGrapher
{
/// A class for normalizing to a specified target in dB
class Normalizer
class LIBAUDIOGRAPHER_API Normalizer
: public ListedSource<float>
, public Sink<float>
, public Throwing<>

View File

@ -1,6 +1,7 @@
#ifndef AUDIOGRAPHER_PEAK_READER_H
#define AUDIOGRAPHER_PEAK_READER_H
#include "audiographer/visibility.h"
#include "audiographer/sink.h"
#include "audiographer/routines.h"
#include "audiographer/utils/listed_source.h"
@ -9,7 +10,7 @@ namespace AudioGrapher
{
/// A class that reads the maximum value from a stream
class PeakReader : public ListedSource<float>, public Sink<float>
class LIBAUDIOGRAPHER_API PeakReader : public ListedSource<float>, public Sink<float>
{
public:
/// Constructor \n RT safe

View File

@ -1,6 +1,7 @@
#ifndef AUDIOGRAPHER_SAMPLE_FORMAT_CONVERTER_H
#define AUDIOGRAPHER_SAMPLE_FORMAT_CONVERTER_H
#include "audiographer/visibility.h"
#include "audiographer/sink.h"
#include "audiographer/utils/listed_source.h"
#include "private/gdither/gdither_types.h"
@ -9,7 +10,7 @@ namespace AudioGrapher
{
/// Dither types from the gdither library
enum DitherType
enum LIBAUDIOGRAPHER_API DitherType
{
D_None = GDitherNone, ///< No didtering
D_Rect = GDitherRect, ///< Rectangular dithering, i.e. white noise
@ -21,7 +22,7 @@ enum DitherType
* This class can only convert floats to either \a float, \a int32_t, \a int16_t, or \a uint8_t
*/
template <typename TOut>
class SampleFormatConverter
class LIBAUDIOGRAPHER_API SampleFormatConverter
: public Sink<float>
, public ListedSource<TOut>
, public Throwing<>

View File

@ -1,6 +1,7 @@
#ifndef AUDIOGRAPHER_SILENCE_TRIMMER_H
#define AUDIOGRAPHER_SILENCE_TRIMMER_H
#include "audiographer/visibility.h"
#include "audiographer/debug_utils.h"
#include "audiographer/flag_debuggable.h"
#include "audiographer/sink.h"
@ -13,7 +14,7 @@ namespace AudioGrapher {
/// Removes and adds silent frames to beginning and/or end of stream
template<typename T = DefaultSampleType>
class SilenceTrimmer
class LIBAUDIOGRAPHER_API SilenceTrimmer
: public ListedSource<T>
, public Sink<T>
, public FlagDebuggable<>

View File

@ -3,6 +3,7 @@
#include <samplerate.h>
#include "audiographer/visibility.h"
#include "audiographer/flag_debuggable.h"
#include "audiographer/sink.h"
#include "audiographer/throwing.h"
@ -13,7 +14,7 @@ namespace AudioGrapher
{
/// Samplerate converter
class SampleRateConverter
class LIBAUDIOGRAPHER_API SampleRateConverter
: public ListedSource<float>
, public Sink<float>
, public FlagDebuggable<>

View File

@ -10,6 +10,7 @@
#include <vector>
#include <algorithm>
#include "audiographer/visibility.h"
#include "audiographer/source.h"
#include "audiographer/sink.h"
#include "audiographer/exception.h"
@ -18,7 +19,7 @@ namespace AudioGrapher
{
/// Class that stores exceptions thrown from different threads
class ThreaderException : public Exception
class LIBAUDIOGRAPHER_API ThreaderException : public Exception
{
public:
template<typename T>
@ -32,7 +33,7 @@ class ThreaderException : public Exception
/// Class for distributing processing across several threads
template <typename T = DefaultSampleType>
class 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;

View File

@ -5,6 +5,7 @@
#include <boost/type_traits.hpp>
#include <boost/format.hpp>
#include "audiographer/visibility.h"
#include "exception.h"
#include "debug_utils.h"
#include "types.h"
@ -21,7 +22,7 @@ namespace AudioGrapher
*/
template <typename T = DefaultSampleType>
class ProcessContext
class LIBAUDIOGRAPHER_API ProcessContext
: public Throwing<>
{
// Support older compilers that don't support template base class initialization without template parameters
@ -125,7 +126,7 @@ protected:
/// A process context that allocates and owns it's data buffer
template <typename T = DefaultSampleType>
class AllocatingProcessContext : public ProcessContext<T>
class LIBAUDIOGRAPHER_API AllocatingProcessContext : public ProcessContext<T>
{
public:
/// Allocates uninitialized memory
@ -162,7 +163,7 @@ public:
/// A wrapper for a const ProcesContext which can be created from const data
template <typename T = DefaultSampleType>
class ConstProcessContext
class LIBAUDIOGRAPHER_API ConstProcessContext
{
public:
/// Basic constructor with data, frame and channel count

View File

@ -5,11 +5,13 @@
#include <cmath>
#include "audiographer/visibility.h"
namespace AudioGrapher
{
/// Allows overriding some routines with more efficient ones.
class Routines
class LIBAUDIOGRAPHER_API Routines
{
public:
typedef uint32_t uint_type;

View File

@ -5,6 +5,8 @@
#include "process_context.h"
#include "audiographer/visibility.h"
namespace AudioGrapher
{
@ -12,7 +14,7 @@ namespace AudioGrapher
* This is a pure virtual interface for all data sinks in AudioGrapher
*/
template <typename T>
class Sink {
class LIBAUDIOGRAPHER_API Sink {
public:
virtual ~Sink () {}

View File

@ -6,6 +6,8 @@
#include <boost/shared_ptr.hpp>
#include "audiographer/visibility.h"
namespace AudioGrapher
{
@ -13,7 +15,7 @@ namespace AudioGrapher
* This is a pure virtual interface for all data sources in AudioGrapher
*/
template<typename T>
class Source
class LIBAUDIOGRAPHER_API Source
{
public:
virtual ~Source () { }

View File

@ -5,6 +5,8 @@
#define DEFAULT_THROW_LEVEL ThrowStrict
#endif
#include "audiographer/visibility.h"
namespace AudioGrapher
{
@ -14,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 ThrowLevel
enum LIBAUDIOGRAPHER_API ThrowLevel
{
ThrowNone, ///< Not allowed to throw
ThrowObject, ///< Object level stuff, ctors, initalizers etc.
@ -38,7 +40,7 @@ enum ThrowLevel
* logical and (short-circuiting).
*/
template<ThrowLevel L = DEFAULT_THROW_LEVEL>
class Throwing
class LIBAUDIOGRAPHER_API Throwing
{
protected:
Throwing() {}

View File

@ -1,18 +1,20 @@
#ifndef AUDIOGRAPHER_TYPE_UTILS_H
#define AUDIOGRAPHER_TYPE_UTILS_H
#include "audiographer/types.h"
#include <boost/static_assert.hpp>
#include <boost/type_traits.hpp>
#include <memory>
#include <algorithm>
#include <cstring>
#include "audiographer/visibility.h"
#include "audiographer/types.h"
namespace AudioGrapher
{
/// Non-template base class for TypeUtils
class TypeUtilsBase
class LIBAUDIOGRAPHER_API TypeUtilsBase
{
protected:
@ -27,7 +29,7 @@ class TypeUtilsBase
/// Utilities for initializing, copying, moving, etc. data
template<typename T = DefaultSampleType>
class TypeUtils : private TypeUtilsBase
class LIBAUDIOGRAPHER_API TypeUtils : private TypeUtilsBase
{
BOOST_STATIC_ASSERT (boost::has_trivial_destructor<T>::value);

View File

@ -3,6 +3,8 @@
#include <stdint.h>
#include "audiographer/visibility.h"
namespace AudioGrapher {
/* XXX: copied from libardour */

View File

@ -1,6 +1,8 @@
#ifndef AUDIOGRAPHER_IDENTITY_VERTEX_H
#define AUDIOGRAPHER_IDENTITY_VERTEX_H
#include "audiographer/visibility.h"
#include "audiographer/types.h"
#include "audiographer/utils/listed_source.h"
#include "audiographer/sink.h"
@ -9,7 +11,7 @@ namespace AudioGrapher
/// Outputs its input directly to a number of Sinks
template<typename T = DefaultSampleType>
class 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); }

View File

@ -1,6 +1,8 @@
#ifndef AUDIOGRAPHER_LISTED_SOURCE_H
#define AUDIOGRAPHER_LISTED_SOURCE_H
#include "audiographer/visibility.h"
#include "audiographer/types.h"
#include "audiographer/types.h"
#include "audiographer/source.h"
@ -11,7 +13,7 @@ namespace AudioGrapher
/// An generic \a Source that uses a \a std::list for managing outputs
template<typename T = DefaultSampleType>
class ListedSource : public Source<T>
class LIBAUDIOGRAPHER_API ListedSource : public Source<T>
{
public:
void add_output (typename Source<T>::SinkPtr output) { outputs.push_back(output); }

View File

@ -54,19 +54,29 @@ def build(bld):
and bld.is_defined('HAVE_GLIBMM')
and bld.is_defined('HAVE_GTHREAD'))
audiographer = bld(features = 'cxx cxxshlib')
audiographer.source = '''
private/gdither/gdither.cc
src/general/sample_format_converter.cc
src/routines.cc
src/debug_utils.cc
src/general/broadcast_info.cc
'''
audiographer_sources = [
'private/gdither/gdither.cc',
'src/general/sample_format_converter.cc',
'src/routines.cc',
'src/debug_utils.cc',
'src/general/broadcast_info.cc'
]
if bld.is_defined('HAVE_SAMPLERATE'):
audiographer.source += '''
src/general/sr_converter.cc
'''
audiographer_sources += [ 'src/general/sr_converter.cc' ]
if bld.is_defined ('INTERNAL_SHARED_LIBS'):
audiographer = bld.shlib(features = 'c cxx cshlib cxxshlib', source=audiographer_sources)
# macros for this shared library
audiographer.defines = [ 'LIBAUDIOGRAPHER_DLL=1', 'LIBAUDIOGRAPHER_DLL_EXPORTS=1' ]
# macros for this other internal shared libraries that we use
audiographer.defines += [ 'LIBPBD_DLL=1' ]
audiographer.cflags = [ '-fvisibility=hidden' ]
audiographer.cxxflags = [ '-fvisibility=hidden' ]
else:
audiographer = bld.stlib(features = 'c cxx cstlib cxxstlib', source=libardour_sources)
audiographer.cxxflags = [ '-fPIC' ]
audiographer.cflags = [ '-fPIC' ]
audiographer.defines = []
audiographer.name = 'libaudiographer'
audiographer.target = 'audiographer'