diff --git a/libs/audiographer/private/sndfile.hh b/libs/audiographer/private/sndfile.hh index 76e2d545ea..870df6d8bb 100644 --- a/libs/audiographer/private/sndfile.hh +++ b/libs/audiographer/private/sndfile.hh @@ -52,22 +52,16 @@ #ifndef SNDFILE_HH #define SNDFILE_HH -#include -#include -#include - -#include -#include "pbd/gstdio_compat.h" +#include "audiographer/visibility.h" #include #include -#include // for std::nothrow // Prevent conflicts namespace AudioGrapher { -class SndfileHandle +class LIBAUDIOGRAPHER_API SndfileHandle { private : struct SNDFILE_ref { SNDFILE_ref (void) ; diff --git a/libs/audiographer/src/general/sndfile.cc b/libs/audiographer/src/general/sndfile.cc index 370f276fb8..52064a13b9 100644 --- a/libs/audiographer/src/general/sndfile.cc +++ b/libs/audiographer/src/general/sndfile.cc @@ -39,6 +39,15 @@ ** license, but the LGPL still holds for the libsndfile library itself. */ +#include +#include +#include + +#include +#include "pbd/gstdio_compat.h" + +#include // for std::nothrow + #include "private/sndfile.hh" namespace AudioGrapher { @@ -47,12 +56,10 @@ namespace AudioGrapher { ** Nothing but implementation below. */ -inline SndfileHandle::SNDFILE_ref::SNDFILE_ref (void) : ref (1) {} -inline SndfileHandle::SNDFILE_ref::~SNDFILE_ref (void) { if (sf != NULL) { sf_close (sf) ; } } @@ -68,7 +75,6 @@ SndfileHandle::close (void) } -inline SndfileHandle::SndfileHandle (const char *path, int mode, int fmt, int chans, int srate) : p (NULL) { @@ -103,7 +109,6 @@ SndfileHandle::SndfileHandle (const char *path, int mode, int fmt, int chans, in return ; } /* SndfileHandle const char * constructor */ -inline SndfileHandle::SndfileHandle (std::string const & path, int mode, int fmt, int chans, int srate) : p (NULL) { @@ -138,7 +143,6 @@ SndfileHandle::SndfileHandle (std::string const & path, int mode, int fmt, int c return ; } /* SndfileHandle std::string constructor */ -inline SndfileHandle::SndfileHandle (int fd, bool close_desc, int mode, int fmt, int chans, int srate) : p (NULL) { @@ -163,21 +167,20 @@ SndfileHandle::SndfileHandle (int fd, bool close_desc, int mode, int fmt, int ch return ; } /* SndfileHandle fd constructor */ -inline + SndfileHandle::~SndfileHandle (void) { if (p != NULL && --p->ref == 0) delete p ; } /* SndfileHandle destructor */ -inline SndfileHandle::SndfileHandle (const SndfileHandle &orig) : p (orig.p) { if (p != NULL) ++p->ref ; } /* SndfileHandle copy constructor */ -inline SndfileHandle & +SndfileHandle & SndfileHandle::operator = (const SndfileHandle &rhs) { if (&rhs == this) @@ -192,35 +195,35 @@ SndfileHandle::operator = (const SndfileHandle &rhs) return *this ; } /* SndfileHandle assignment operator */ -inline int +int SndfileHandle::error (void) const { return sf_error (p->sf) ; } -inline const char * +const char * SndfileHandle::strError (void) const { return sf_strerror (p->sf) ; } -inline int +int SndfileHandle::command (int cmd, void *data, int datasize) { return sf_command (p->sf, cmd, data, datasize) ; } -inline sf_count_t +sf_count_t SndfileHandle::seek (sf_count_t frame_count, int whence) { return sf_seek (p->sf, frame_count, whence) ; } -inline void +void SndfileHandle::writeSync (void) { sf_write_sync (p->sf) ; } -inline int +int SndfileHandle::setString (int str_type, const char* str) { return sf_set_string (p->sf, str_type, str) ; } -inline const char* +const char* SndfileHandle::getString (int str_type) const { return sf_get_string (p->sf, str_type) ; } -inline int +int SndfileHandle::formatCheck(int fmt, int chans, int srate) { SF_INFO sfinfo ; @@ -237,82 +240,81 @@ SndfileHandle::formatCheck(int fmt, int chans, int srate) /*---------------------------------------------------------------------*/ -inline sf_count_t +sf_count_t SndfileHandle::read (short *ptr, sf_count_t items) { return sf_read_short (p->sf, ptr, items) ; } -inline sf_count_t +sf_count_t SndfileHandle::read (int *ptr, sf_count_t items) { return sf_read_int (p->sf, ptr, items) ; } -inline sf_count_t +sf_count_t SndfileHandle::read (float *ptr, sf_count_t items) { return sf_read_float (p->sf, ptr, items) ; } -inline sf_count_t +sf_count_t SndfileHandle::read (double *ptr, sf_count_t items) { return sf_read_double (p->sf, ptr, items) ; } -inline sf_count_t +sf_count_t SndfileHandle::write (const short *ptr, sf_count_t items) { return sf_write_short (p->sf, ptr, items) ; } -inline sf_count_t +sf_count_t SndfileHandle::write (const int *ptr, sf_count_t items) { return sf_write_int (p->sf, ptr, items) ; } -inline sf_count_t +sf_count_t SndfileHandle::write (const float *ptr, sf_count_t items) { return sf_write_float (p->sf, ptr, items) ; } -inline sf_count_t +sf_count_t SndfileHandle::write (const double *ptr, sf_count_t items) { return sf_write_double (p->sf, ptr, items) ; } -inline sf_count_t +sf_count_t SndfileHandle::readf (short *ptr, sf_count_t frame_count) { return sf_readf_short (p->sf, ptr, frame_count) ; } -inline sf_count_t +sf_count_t SndfileHandle::readf (int *ptr, sf_count_t frame_count) { return sf_readf_int (p->sf, ptr, frame_count) ; } -inline sf_count_t +sf_count_t SndfileHandle::readf (float *ptr, sf_count_t frame_count) { return sf_readf_float (p->sf, ptr, frame_count) ; } -inline sf_count_t +sf_count_t SndfileHandle::readf (double *ptr, sf_count_t frame_count) { return sf_readf_double (p->sf, ptr, frame_count) ; } -inline sf_count_t +sf_count_t SndfileHandle::writef (const short *ptr, sf_count_t frame_count) { return sf_writef_short (p->sf, ptr, frame_count) ; } -inline sf_count_t +sf_count_t SndfileHandle::writef (const int *ptr, sf_count_t frame_count) { return sf_writef_int (p->sf, ptr, frame_count) ; } -inline sf_count_t +sf_count_t SndfileHandle::writef (const float *ptr, sf_count_t frame_count) { return sf_writef_float (p->sf, ptr, frame_count) ; } -inline sf_count_t +sf_count_t SndfileHandle::writef (const double *ptr, sf_count_t frame_count) { return sf_writef_double (p->sf, ptr, frame_count) ; } -inline sf_count_t +sf_count_t SndfileHandle::readRaw (void *ptr, sf_count_t bytes) { return sf_read_raw (p->sf, ptr, bytes) ; } -inline sf_count_t +sf_count_t SndfileHandle::writeRaw (const void *ptr, sf_count_t bytes) { return sf_write_raw (p->sf, ptr, bytes) ; } #ifdef ENABLE_SNDFILE_WINDOWS_PROTOTYPES -inline SndfileHandle::SndfileHandle (LPCWSTR wpath, int mode, int fmt, int chans, int srate) : p (NULL) {