Fix some compiling warnings and errors in OS X
authorSakari Bergen <sakari.bergen@beatwaves.net>
Mon, 29 Dec 2008 19:50:19 +0000 (19:50 +0000)
committerSakari Bergen <sakari.bergen@beatwaves.net>
Mon, 29 Dec 2008 19:50:19 +0000 (19:50 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@4358 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/plugin_eq_gui.cc
libs/ardour/ardour/export_channel.h
libs/ardour/ardour/export_file_io.h
libs/ardour/export_file_io.cc
libs/ardour/midi_buffer.cc
libs/evoral/SConscript
libs/pbd/SConscript
libs/taglib/SConscript

index 34b77888194ae7088aa0cc51f536b8b7ef6d20b3..a7e6b4261c44e7dd86ed363ab779d7304b452b39 100644 (file)
@@ -31,7 +31,7 @@
 #include <gtkmm/checkbutton.h>
 
 #include <iostream>
-
+#include <cmath>
 
 PluginEqGui::PluginEqGui(boost::shared_ptr<ARDOUR::PluginInsert> pluginInsert)
        : _min_dB(-12.0),
@@ -683,13 +683,13 @@ PluginEqGui::plot_signal_amplitude_difference(Gtk::Widget *w, cairo_t *cr)
                }
                */
 
-               if (isinf(power)) {
+               if (std::isinf(power)) {
                        if (power < 0) {
                                power = _min_dB - 1.0;
                        } else {
                                power = _max_dB - 1.0;
                        }
-               } else if (isnan(power)) {
+               } else if (std::isnan(power)) {
                        power = _min_dB - 1.0;
                }
 
index d9e39c88505717053b4c944c69758101a88217a1..213bd2d9fa28136f2d9d3a76c78c8ac96a50ac6a 100644 (file)
@@ -38,6 +38,9 @@ class Session;
 class ExportChannel
 {
   public:
+
+       virtual ~ExportChannel () {}
+
        virtual void read (Sample * data, nframes_t frames) const = 0;
        virtual bool empty () const = 0;
        
@@ -69,13 +72,13 @@ class PortExportChannel : public ExportChannel
 
        PortExportChannel () {}
        
-       virtual void read (Sample * data, nframes_t frames) const;
-       virtual bool empty () const { return ports.empty(); }
+       void read (Sample * data, nframes_t frames) const;
+       bool empty () const { return ports.empty(); }
        
-       virtual void get_state (XMLNode * node) const;
-       virtual void set_state (XMLNode * node, Session & session);
+       void get_state (XMLNode * node) const;
+       void set_state (XMLNode * node, Session & session);
        
-       virtual bool operator< (ExportChannel const & other) const;
+       bool operator< (ExportChannel const & other) const;
 
        void add_port (AudioPort * port) { ports.insert (port); }
        PortSet const & get_ports () { return ports; }
@@ -126,12 +129,12 @@ class RegionExportChannel : public ExportChannel
        friend class RegionExportChannelFactory;
 
   public:
-       virtual void read (Sample * data, nframes_t frames_to_read) const { factory.read (channel, data, frames_to_read); }
-       virtual void get_state (XMLNode * node) const {};
-       virtual void set_state (XMLNode * node, Session & session) {};
-       virtual bool empty () const { return false; }
+       void read (Sample * data, nframes_t frames_to_read) const { factory.read (channel, data, frames_to_read); }
+       void get_state (XMLNode * node) const {};
+       void set_state (XMLNode * node, Session & session) {};
+       bool empty () const { return false; }
        // Region export should never have duplicate channels, so there need not be any semantics here
-       virtual bool operator< (ExportChannel const & other) const { return this < &other; }
+       bool operator< (ExportChannel const & other) const { return this < &other; }
 
   private:
 
index 6705b7736a15cc135e56b79bfcb146d2c63f2e56..0e15981c251eb1d09f15f2cfdc03fe6a286544f2 100644 (file)
@@ -77,8 +77,9 @@ class SndfileWriterBase : public ExportFileWriter
 template <typename T>
 class SndfileWriter : public SndfileWriterBase, public GraphSink<T>
 {
-  protected:
+       // FIXME: having this protected doesn't work with Apple's gcc
        // Should only be created vie ExportFileFactory and derived classes
+  public: // protected
        friend class ExportFileFactory;
        SndfileWriter (int channels, nframes_t samplerate, int format, string const & path);
 
index d4aa1870baa57a2aaf71d7653b78f96f9c2991a0..793b1dbea424a19a2b4f85699d12f174a544380c 100644 (file)
@@ -400,8 +400,6 @@ ExportFileFactory::create_sndfile (FormatPtr format, unsigned int channels, ustr
        typedef boost::shared_ptr<SndfileWriter<int> > IntWriterPtr;
        typedef boost::shared_ptr<SndfileWriter<float> > FloatWriterPtr;
        
-       FilePair ret;
-
        int real_format = format->format_id() | format->sample_format() | format->endianness();
 
        uint32_t data_width = sndfile_data_width (real_format);
@@ -422,14 +420,13 @@ ExportFileFactory::create_sndfile (FormatPtr format, unsigned int channels, ustr
                
                return std::make_pair (boost::static_pointer_cast<FloatSink> (sfc), boost::static_pointer_cast<ExportFileWriter> (sfw));
 
-       } else {
-       
-               FloatConverterPtr sfc = FloatConverterPtr (new SampleFormatConverter<float> (channels, format->dither_type(), data_width));
-               FloatWriterPtr sfw = FloatWriterPtr (new SndfileWriter<float> (channels, format->sample_rate(), real_format, filename));
-               sfc->pipe_to (sfw);
-               
-               return std::make_pair (boost::static_pointer_cast<FloatSink> (sfc), boost::static_pointer_cast<ExportFileWriter> (sfw));;
        }
+       
+       FloatConverterPtr sfc = FloatConverterPtr (new SampleFormatConverter<float> (channels, format->dither_type(), data_width));
+       FloatWriterPtr sfw = FloatWriterPtr (new SndfileWriter<float> (channels, format->sample_rate(), real_format, filename));
+       sfc->pipe_to (sfw);
+       
+       return std::make_pair (boost::static_pointer_cast<FloatSink> (sfc), boost::static_pointer_cast<ExportFileWriter> (sfw));
 }
 
 bool
index 705b94f422fcf87bf942c70ecb3d1de201199135..1f5b0c5fa9231663270f8941eb1ac33d12e95796 100644 (file)
@@ -74,7 +74,7 @@ MidiBuffer::resize (size_t size)
        _capacity = size;
 
 #ifdef NO_POSIX_MEMALIGN
-       _events = (Evoral::Event *) malloc(sizeof(Evoral::Event) * _capacity);
+       _events = (Evoral::MIDIEvent *) malloc(sizeof(Evoral::MIDIEvent) * _capacity);
        _data = (uint8_t *) malloc(sizeof(uint8_t) * _capacity * MAX_EVENT_SIZE);
 #else
        posix_memalign((void**)&_events, CPU_CACHE_ALIGN, sizeof(Evoral::Event) * _capacity);
index 29d0dfcaf9615ca25d33d94771d857c5f3f459ec..3f901e8fd9189dad5badc797c20499107c94cb1f 100644 (file)
@@ -12,7 +12,8 @@ evoral.Merge([
        libraries['sigc2'],
        libraries['glibmm2'],
        libraries['xml'], 
-       libraries['pbd'],       
+       libraries['pbd'],
+       libraries['boost']      
        ])
 
 if evoral['IS_OSX']:
index 5f2d20e405b9d5d7d8aad1b6e287a22e3617bf83..d7981be771376bf8cc808eb5698a7329d0b98f13 100644 (file)
@@ -60,7 +60,8 @@ pbd.Merge ([ libraries['sigc2'],
              libraries['xml'],
              libraries['uuid'],
              libraries['glibmm2'],
-             libraries['glib2'] ])
+             libraries['glib2'],
+             libraries['boost'] ])
 
 pbd.VersionBuild(['version.cc','pbd/version.h'], [])
 
index fed92ce0a3010a4df60f1692c33daec522fb749f..d9062889b6afd7b02b7ad6d314b54dfebab04203 100644 (file)
@@ -64,6 +64,8 @@ taglib.Append (CPPATH= [ '#libs/taglib/taglib',
                            ]
                )
 
+if env['IS_OSX']:
+    taglib.Append (LINKFLAGS= [ "-lz" ] )
 
 #conf = Configure(taglib)
 #taglib = conf.finish ()