# HG changeset patch # User John W. Eaton # Date 1420268483 18000 # Node ID 7f271cef5850536fef6b0c0f13481e3733b0a7e9 # Parent 18377fc879d0aaf289da9c9015e691177b93df3b protect all portaudio and sndfile dependent code with #ifdefs * audiodevinfo.cc: Protect all code that depends on portaudio with #ifdef HAVE_PORTAUDIO * audioread.cc: Protect all code that depends on sndfile with #ifdef HAVE_SNDFILE. diff -r 18377fc879d0 -r 7f271cef5850 libinterp/dldfcn/audiodevinfo.cc --- a/libinterp/dldfcn/audiodevinfo.cc Fri Jan 02 18:05:24 2015 -0800 +++ b/libinterp/dldfcn/audiodevinfo.cc Sat Jan 03 02:01:23 2015 -0500 @@ -40,8 +40,8 @@ #include "parse.h" #if defined (HAVE_PORTAUDIO) + #include -#endif PaSampleFormat bits_to_format (int bits) @@ -60,6 +60,8 @@ return 0; } +#endif + DEFUN_DLD (audiodevinfo, args, , "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{devinfo} =} audiodevinfo ()\n\ @@ -429,6 +431,8 @@ %! endfor */ +#ifdef HAVE_PORTAUDIO + enum audio_type { INT8, UINT8, INT16, DOUBLE }; class audioplayer : public octave_base_value @@ -1638,6 +1642,8 @@ return stream; } +#endif + DEFUN_DLD (__recorder_audiorecorder__, args, , "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{recorder} =} __recorder_audiorecorder__ (@var{fs}, @var{nbits}, @var{channels})\n\ @@ -1696,6 +1702,8 @@ return retval; } +#ifdef HAVE_PORTAUDIO + static audiorecorder * get_recorder (const octave_value& ov) { @@ -1706,6 +1714,8 @@ return dynamic_cast (ncrep); } +#endif + DEFUN_DLD (__recorder_getaudiodata__, args, , "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{data}} __recorder_getaudiodata__ (@var{recorder})\n\ @@ -2206,6 +2216,8 @@ return retval; } +#ifdef HAVE_PORTAUDIO + static audioplayer * get_player (const octave_value& ov) { @@ -2216,6 +2228,8 @@ return dynamic_cast (ncrep); } +#endif + DEFUN_DLD (__player_get_channels__, args, , "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{n} =} __player_get_channels__ (@var{player})\n\ diff -r 18377fc879d0 -r 7f271cef5850 libinterp/dldfcn/audioread.cc --- a/libinterp/dldfcn/audioread.cc Fri Jan 02 18:05:24 2015 -0800 +++ b/libinterp/dldfcn/audioread.cc Sat Jan 03 02:01:23 2015 -0500 @@ -153,6 +153,7 @@ } #ifdef HAVE_SNDFILE + static void fill_extension_table (std::map &table) { @@ -182,6 +183,7 @@ table["mpc2k"] = SF_FORMAT_MPC2K; table["rf64"] = SF_FORMAT_RF64; } + #endif DEFUN_DLD (audiowrite, args, , @@ -337,14 +339,14 @@ { octave_value retval; +#ifdef HAVE_SNDFILE + if (args.length () != 1) { print_usage (); return retval; } -#ifdef HAVE_SNDFILE - SF_INFO info; info.format = 0; SNDFILE *file = sf_open (args(0).string_value ().c_str (), SFM_READ, &info);