reintroduce use of optimized functions for gain into buffer code, and cleanup the...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 2 May 2007 15:21:51 +0000 (15:21 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 2 May 2007 15:21:51 +0000 (15:21 +0000)
git-svn-id: svn://localhost/ardour2/branches/midi@1775 d708f5d6-7413-0410-9779-e7cbd77b26cf

14 files changed:
gtk2_ardour/editor_ops.cc
libs/ardour/ardour/buffer.h
libs/ardour/ardour/mix.h
libs/ardour/ardour/peak.h
libs/ardour/ardour/runtime_functions.h [new file with mode: 0644]
libs/ardour/ardour/session.h
libs/ardour/audioregion.cc
libs/ardour/audiosource.cc
libs/ardour/globals.cc
libs/ardour/mix.cc
libs/ardour/panner.cc
libs/ardour/route.cc
libs/ardour/session.cc
libs/ardour/sse_functions_xmm.cc

index 95e0b5d255ada8524c14f0183251b9866d71c912..b352ee7110caeda1896423b37d74108227846416 100644 (file)
@@ -2835,7 +2835,7 @@ Editor::cut_copy_regions (CutCopyOp op)
                        
                case Copy:
                        /* copy region before adding, so we're not putting same object into two different playlists */
-                       npl->add_region (RegionFactory::create (r, r->position() - first_position);
+                       npl->add_region (RegionFactory::create (r), r->position() - first_position);
                        break;
                        
                case Clear:
index 828eac4d64304320bf8778834cec96ee3177ffe7..6000872bddc788a7e2f7f612da45b10df31e5e2c 100644 (file)
@@ -24,6 +24,7 @@
 #include <iostream>
 #include <ardour/types.h>
 #include <ardour/data_type.h>
+#include <ardour/runtime_functions.h>
 
 namespace ARDOUR {
 
@@ -142,21 +143,13 @@ public:
                Sample*       const dst_raw = _data + offset;
                const Sample* const src_raw = src.data(len);
 
-               for (jack_nframes_t n = 0; n < len; ++n) {
-                       dst_raw[n] += src_raw[n] * gain_coeff;
-               }
-               
+               mix_buffers_with_gain (dst_raw, src_raw, len, gain_coeff);
+
                _silent = ( (src.silent() && _silent) || (_silent && gain_coeff == 0) );
        }
        
        void apply_gain(gain_t gain, jack_nframes_t len, jack_nframes_t offset=0) {
-               Sample* const buf = _data + offset;
-
-               for (jack_nframes_t n = 0; n < len; ++n) {
-                       buf[n] *= gain;
-               }
-
-               _silent = (_silent || gain == 0);
+               apply_gain_to_buffer (_data + offset, len, gain);
        }
 
        /** Set the data contained by this buffer manually (for setting directly to jack buffer).
index 5555f5437ec2fba1c8653356d782612b5a45aa34..67779f0e077a8dc5ed0adbfdf27a6311f8904aaf 100644 (file)
 
 extern "C" {
 /* SSE functions */
-       float x86_sse_compute_peak              (ARDOUR::Sample *buf, nframes_t nsamples, float current);
-
-       void  x86_sse_apply_gain_to_buffer      (ARDOUR::Sample *buf, nframes_t nframes, float gain);
-
-       void  x86_sse_mix_buffers_with_gain     (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes, float gain);
-
-       void  x86_sse_mix_buffers_no_gain       (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes);
+       float x86_sse_compute_peak              (const ARDOUR::Sample * buf, nframes_t nsamples, float current);
+       void  x86_sse_apply_gain_to_buffer      (ARDOUR::Sample * buf, nframes_t nframes, float gain);
+       void  x86_sse_mix_buffers_with_gain     (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes, float gain);
+       void  x86_sse_mix_buffers_no_gain       (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes);
 }
 
-void x86_sse_find_peaks                        (ARDOUR::Sample *buf, nframes_t nsamples, float *min, float *max);
+void  x86_sse_find_peaks                (const ARDOUR::Sample * buf, nframes_t nsamples, float *min, float *max);
 
 /* debug wrappers for SSE functions */
 
-float debug_compute_peak               (ARDOUR::Sample *buf, nframes_t nsamples, float current);
-
-void  debug_apply_gain_to_buffer       (ARDOUR::Sample *buf, nframes_t nframes, float gain);
-
-void  debug_mix_buffers_with_gain      (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes, float gain);
-
-void  debug_mix_buffers_no_gain                (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes);
+float debug_compute_peak               (const ARDOUR::Sample * buf, nframes_t nsamples, float current);
+void  debug_apply_gain_to_buffer       (ARDOUR::Sample * buf, nframes_t nframes, float gain);
+void  debug_mix_buffers_with_gain      (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes, float gain);
+void  debug_mix_buffers_no_gain                (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes);
 
 #endif
 
 #if defined (__APPLE__)
 
-float veclib_compute_peak              (ARDOUR::Sample *buf, nframes_t nsamples, float current);
-
-void veclib_find_peaks                (ARDOUR::Sample *buf, nframes_t nsamples, float *min, float *max);
-
-void  veclib_apply_gain_to_buffer      (ARDOUR::Sample *buf, nframes_t nframes, float gain);
-
-void  veclib_mix_buffers_with_gain     (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes, float gain);
-
-void  veclib_mix_buffers_no_gain       (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes);
+float veclib_compute_peak              (const ARDOUR::Sample * buf, nframes_t nsamples, float current);
+void veclib_find_peaks                 (const ARDOUR::Sample * buf, nframes_t nsamples, float *min, float *max);
+void  veclib_apply_gain_to_buffer      (ARDOUR::Sample * buf, nframes_t nframes, float gain);
+void  veclib_mix_buffers_with_gain     (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes, float gain);
+void  veclib_mix_buffers_no_gain       (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes);
 
 #endif
 
 /* non-optimized functions */
 
-float compute_peak              (ARDOUR::Sample *buf, nframes_t nsamples, float current);
-
-void  find_peaks                (ARDOUR::Sample *buf, nframes_t nsamples, float *min, float *max);
-
-void  apply_gain_to_buffer      (ARDOUR::Sample *buf, nframes_t nframes, float gain);
-
-void  mix_buffers_with_gain     (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes, float gain);
-
-void  mix_buffers_no_gain       (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes);
+float default_compute_peak              (const ARDOUR::Sample * buf, nframes_t nsamples, float current);
+void  default_find_peaks                (const ARDOUR::Sample * buf, nframes_t nsamples, float *min, float *max);
+void  default_apply_gain_to_buffer      (ARDOUR::Sample * buf, nframes_t nframes, float gain);
+void  default_mix_buffers_with_gain     (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes, float gain);
+void  default_mix_buffers_no_gain       (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes);
 
 #endif /* __ardour_mix_h__ */
index eaeafe0f5d43b44d1e82adde7cba83224ed77d6d..bbec40eea7e65502a36ea0a3b099fdc2e69c1e2f 100644 (file)
@@ -25,7 +25,7 @@
 #include <ardour/utils.h>
 
 static inline float
-compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current) 
+default_compute_peak (const ARDOUR::Sample * const buf, nframes_t nsamples, float current) 
 {
        for (nframes_t i = 0; i < nsamples; ++i) {
                current = f_max (current, fabsf (buf[i]));
diff --git a/libs/ardour/ardour/runtime_functions.h b/libs/ardour/ardour/runtime_functions.h
new file mode 100644 (file)
index 0000000..c1dab4e
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+    Copyright (C) 2007 Paul Davis 
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef __ardour_runtime_functions_h__
+#define __ardour_runtime_functions_h__
+
+#include <ardour/types.h>
+
+namespace ARDOUR {
+
+       typedef float (*compute_peak_t)                 (const ARDOUR::Sample *, nframes_t, float);
+       typedef void  (*find_peaks_t)                   (const ARDOUR::Sample *, nframes_t, float *, float*);
+       typedef void  (*apply_gain_to_buffer_t)         (ARDOUR::Sample *, nframes_t, float);
+       typedef void  (*mix_buffers_with_gain_t)        (ARDOUR::Sample *, const ARDOUR::Sample *, nframes_t, float);
+       typedef void  (*mix_buffers_no_gain_t)          (ARDOUR::Sample *, const ARDOUR::Sample *, nframes_t);
+
+       extern compute_peak_t           compute_peak;
+       extern find_peaks_t             find_peaks;
+       extern apply_gain_to_buffer_t   apply_gain_to_buffer;
+       extern mix_buffers_with_gain_t  mix_buffers_with_gain;
+       extern mix_buffers_no_gain_t    mix_buffers_no_gain;
+}
+
+#endif /* __ardour_runtime_functions_h__ */
index d173f434070ea201de17a04c9270f493ba5f6a00..27bc781b7990abafe24b95ae0a53b54aacd8533d 100644 (file)
@@ -932,18 +932,6 @@ class Session : public PBD::StatefulDestructible
                                  void* ptr,
                                  float opt);
 
-       typedef float (*compute_peak_t)                 (Sample *, nframes_t, float);
-       typedef void  (*find_peaks_t)                   (Sample *, nframes_t, float *, float*);
-       typedef void  (*apply_gain_to_buffer_t)         (Sample *, nframes_t, float);
-       typedef void  (*mix_buffers_with_gain_t)        (Sample *, Sample *, nframes_t, float);
-       typedef void  (*mix_buffers_no_gain_t)          (Sample *, Sample *, nframes_t);
-
-       static compute_peak_t           compute_peak;
-       static find_peaks_t             find_peaks;
-       static apply_gain_to_buffer_t   apply_gain_to_buffer;
-       static mix_buffers_with_gain_t  mix_buffers_with_gain;
-       static mix_buffers_no_gain_t    mix_buffers_no_gain;
-
        static sigc::signal<void> SendFeedback;
 
        /* Controllables */
index 61ae3ca0736cbce4dbec97828c0ba51d4f50360e..e6646059e138f2b292007e01df25e018cdbdf7f9 100644 (file)
@@ -41,6 +41,7 @@
 #include <ardour/audiofilter.h>
 #include <ardour/audiofilesource.h>
 #include <ardour/region_factory.h>
+#include <ardour/runtime_functions.h>
 
 #include "i18n.h"
 #include <locale.h>
@@ -467,7 +468,7 @@ AudioRegion::_read_at (const SourceList& srcs, Sample *buf, Sample *mixdown_buff
                        }
                }
        } else if (_scale_amplitude != 1.0f) {
-               Session::apply_gain_to_buffer (mixdown_buffer, to_read, _scale_amplitude);
+               apply_gain_to_buffer (mixdown_buffer, to_read, _scale_amplitude);
        }
 
   merge:
@@ -1099,7 +1100,7 @@ AudioRegion::normalize_to (float target_dB)
                                return;
                        }
                        
-                       maxamp = Session::compute_peak (buf, to_read, maxamp);
+                       maxamp = compute_peak (buf, to_read, maxamp);
                }
 
                fpos += to_read;
index 6fe2f67e052dc03374493c06bd0f3fdfa0f47240..49cfc15a54d643d1d31eb795094670922fa94ab0 100644 (file)
@@ -35,7 +35,7 @@
 
 #include <ardour/audiosource.h>
 #include <ardour/cycle_timer.h>
-#include <ardour/session.h>
+#include <ardour/runtime_functions.h>
 
 #include "i18n.h"
 
@@ -696,7 +696,7 @@ AudioSource::compute_and_write_peaks (Sample* buf, nframes_t first_frame, nframe
                        
                        x.min = peak_leftovers[0];
                        x.max = peak_leftovers[0];
-                       Session::find_peaks (peak_leftovers + 1, peak_leftover_cnt - 1, &x.min, &x.max);
+                       find_peaks (peak_leftovers + 1, peak_leftover_cnt - 1, &x.min, &x.max);
 
                        off_t byte = (peak_leftover_frame / frames_per_peak) * sizeof (PeakData);
 
@@ -779,7 +779,7 @@ AudioSource::compute_and_write_peaks (Sample* buf, nframes_t first_frame, nframe
                peakbuf[peaks_computed].max = buf[0];
                peakbuf[peaks_computed].min = buf[0];
 
-               Session::find_peaks (buf+1, this_time-1, &peakbuf[peaks_computed].min, &peakbuf[peaks_computed].max);
+               find_peaks (buf+1, this_time-1, &peakbuf[peaks_computed].min, &peakbuf[peaks_computed].max);
 
                peaks_computed++;
                buf += this_time;
index a310bd598f5968c0123ef99747f5c6818961103c..ce0b333bcb160256b50ee234b47b4c741da08182 100644 (file)
@@ -54,6 +54,7 @@
 #endif
 
 #include <ardour/mix.h>
+#include <ardour/runtime_functions.h>
 
 #if defined (__APPLE__)
        #include <Carbon/Carbon.h> // For Gestalt
@@ -83,6 +84,12 @@ Change ARDOUR::PositionChanged = ARDOUR::new_change ();
 Change ARDOUR::NameChanged = ARDOUR::new_change ();
 Change ARDOUR::BoundsChanged = Change (0); // see init(), below
 
+compute_peak_t                 ARDOUR::compute_peak            = 0;
+find_peaks_t                   ARDOUR::find_peaks              = 0;
+apply_gain_to_buffer_t         ARDOUR::apply_gain_to_buffer    = 0;
+mix_buffers_with_gain_t                ARDOUR::mix_buffers_with_gain   = 0;
+mix_buffers_no_gain_t          ARDOUR::mix_buffers_no_gain     = 0;
+
 #ifdef HAVE_LIBLO
 static int
 setup_osc ()
@@ -236,11 +243,11 @@ setup_hardware_optimization (bool try_optimization)
                        info << "Using SSE optimized routines" << endmsg;
        
                        // SSE SET
-                       Session::compute_peak           = x86_sse_compute_peak;
-                       Session::find_peaks             = x86_sse_find_peaks;
-                       Session::apply_gain_to_buffer   = x86_sse_apply_gain_to_buffer;
-                       Session::mix_buffers_with_gain  = x86_sse_mix_buffers_with_gain;
-                       Session::mix_buffers_no_gain    = x86_sse_mix_buffers_no_gain;
+                       compute_peak            = x86_sse_compute_peak;
+                       find_peaks              = x86_sse_find_peaks;
+                       apply_gain_to_buffer    = x86_sse_apply_gain_to_buffer;
+                       mix_buffers_with_gain   = x86_sse_mix_buffers_with_gain;
+                       mix_buffers_no_gain     = x86_sse_mix_buffers_no_gain;
 
                        generic_mix_functions = false;
 
@@ -253,11 +260,11 @@ setup_hardware_optimization (bool try_optimization)
                         sysVersion = 0;
 
                 if (sysVersion >= 0x00001040) { // Tiger at least
-                        Session::compute_peak           = veclib_compute_peak;
-                       Session::find_peaks             = veclib_find_peaks;
-                        Session::apply_gain_to_buffer   = veclib_apply_gain_to_buffer;
-                        Session::mix_buffers_with_gain  = veclib_mix_buffers_with_gain;
-                        Session::mix_buffers_no_gain    = veclib_mix_buffers_no_gain;
+                        compute_peak           = veclib_compute_peak;
+                       find_peaks             = veclib_find_peaks;
+                        apply_gain_to_buffer   = veclib_apply_gain_to_buffer;
+                        mix_buffers_with_gain  = veclib_mix_buffers_with_gain;
+                        mix_buffers_no_gain    = veclib_mix_buffers_no_gain;
 
                         generic_mix_functions = false;
 
@@ -267,12 +274,12 @@ setup_hardware_optimization (bool try_optimization)
         }
 
         if (generic_mix_functions) {
-
-               Session::compute_peak           = compute_peak;
-               Session::find_peaks             = find_peaks;
-               Session::apply_gain_to_buffer   = apply_gain_to_buffer;
-               Session::mix_buffers_with_gain  = mix_buffers_with_gain;
-               Session::mix_buffers_no_gain    = mix_buffers_no_gain;
+               
+               compute_peak            = default_compute_peak;
+               find_peaks              = default_find_peaks;
+               apply_gain_to_buffer    = default_apply_gain_to_buffer;
+               mix_buffers_with_gain   = default_mix_buffers_with_gain;
+               mix_buffers_no_gain     = default_mix_buffers_no_gain;
                
                info << "No H/W specific optimizations in use" << endmsg;
        }
index 2d31c8ccc89fa0b5ab433d384c05b792a2dc9f05..1c5d2586610a25d2f616e3a61da9fd1d6888664c 100644 (file)
@@ -23,6 +23,8 @@
 #include <ardour/mix.h>
 #include <stdint.h>
 
+using namespace ARDOUR;
+
 #if defined (ARCH_X86) && defined (BUILD_SSE_OPTIMIZATIONS)
 // Debug wrappers
 
@@ -80,7 +82,7 @@ debug_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t n
 
 
 float
-compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current) 
+default_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float current) 
 {
        for (nframes_t i = 0; i < nsamples; ++i) {
                current = f_max (current, fabsf (buf[i]));
@@ -90,7 +92,7 @@ compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current)
 }      
 
 void
-find_peaks (ARDOUR::Sample *buf, nframes_t nframes, float *min, float *max)
+default_find_peaks (const ARDOUR::Sample * buf, nframes_t nframes, float *min, float *max)
 {
        nframes_t i;
        float a, b;
@@ -109,14 +111,14 @@ find_peaks (ARDOUR::Sample *buf, nframes_t nframes, float *min, float *max)
 }
 
 void
-apply_gain_to_buffer (ARDOUR::Sample *buf, nframes_t nframes, float gain)
+default_apply_gain_to_buffer (ARDOUR::Sample * buf, nframes_t nframes, float gain)
 {              
        for (nframes_t i=0; i<nframes; i++)
                buf[i] *= gain;
 }
 
 void
-mix_buffers_with_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes, float gain)
+default_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes, float gain)
 {
        for (nframes_t i = 0; i < nframes; i++) {
                dst[i] += src[i] * gain;
@@ -124,7 +126,7 @@ mix_buffers_with_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nfram
 }
 
 void
-mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes)
+default_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes)
 {
        for (nframes_t i=0; i < nframes; i++) {
                dst[i] += src[i];
@@ -135,7 +137,7 @@ mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes
 #include <Accelerate/Accelerate.h>
 
 float
-veclib_compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current)
+veclib_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float current)
 {
        float tmpmax = 0.0f;
         vDSP_maxmgv(buf, 1, &tmpmax, nsamples);
@@ -143,26 +145,26 @@ veclib_compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current)
 }
 
 void
-veclib_find_peaks (ARDOUR::Sample *buf, nframes_t nframes, float *min, float *max)
+veclib_find_peaks (const ARDOUR::Sample * buf, nframes_t nframes, float *min, float *max)
 {
        vDSP_maxv (buf, 1, max, nframes);
        vDSP_minv (buf, 1, min, nframes);
 }
 
 void
-veclib_apply_gain_to_buffer (ARDOUR::Sample *buf, nframes_t nframes, float gain)
+veclib_apply_gain_to_buffer (ARDOUR::Sample * buf, nframes_t nframes, float gain)
 {
         vDSP_vsmul(buf, 1, &gain, buf, 1, nframes);
 }
 
 void
-veclib_mix_buffers_with_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes, float gain)
+veclib_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes, float gain)
 {
         vDSP_vsma(src, 1, &gain, dst, 1, dst, 1, nframes);
 }
 
 void
-veclib_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes)
+veclib_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes)
 {
         // It seems that a vector mult only operation does not exist...
         float gain = 1.0f;
index cb4faec148e07a28120b32eeb579be5914175b50..d3c0dc8d4e2bcd9a5c3d3519fe9126e468b31f96 100644 (file)
@@ -41,7 +41,7 @@
 #include <ardour/panner.h>
 #include <ardour/utils.h>
 
-#include <ardour/mix.h>
+#include <ardour/runtime_functions.h>
 #include <ardour/buffer_set.h>
 
 #include "i18n.h"
@@ -304,7 +304,7 @@ BaseStereoPanner::distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain
                
                pan = left * gain_coeff;
 
-               Session::mix_buffers_with_gain(dst+n,src+n,nframes-n,pan);
+               mix_buffers_with_gain(dst+n,src+n,nframes-n,pan);
                
        } else {
                
@@ -315,7 +315,7 @@ BaseStereoPanner::distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain
                        
                        if (pan != 0.0f) {
                                
-                               Session::mix_buffers_with_gain(dst,src,nframes,pan);
+                               mix_buffers_with_gain(dst,src,nframes,pan);
 
                                /* mark that we wrote into the buffer */
 
@@ -325,7 +325,7 @@ BaseStereoPanner::distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain
                        
                } else {
                        
-                       Session::mix_buffers_no_gain(dst,src,nframes);
+                       mix_buffers_no_gain(dst,src,nframes);
                        
                        /* mark that we wrote into the buffer */
                        
@@ -354,7 +354,7 @@ BaseStereoPanner::distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain
                
                pan = right * gain_coeff;
                
-               Session::mix_buffers_with_gain(dst+n,src+n,nframes-n,pan);
+               mix_buffers_with_gain(dst+n,src+n,nframes-n,pan);
                
                /* XXX it would be nice to mark the buffer as written to */
 
@@ -367,14 +367,14 @@ BaseStereoPanner::distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain
                        
                        if (pan != 0.0f) {
                                
-                               Session::mix_buffers_with_gain(dst,src,nframes,pan);
+                               mix_buffers_with_gain(dst,src,nframes,pan);
                                
                                /* XXX it would be nice to mark the buffer as written to */
                        }
                        
                } else {
                        
-                       Session::mix_buffers_no_gain(dst,src,nframes);
+                       mix_buffers_no_gain(dst,src,nframes);
                        
                        /* XXX it would be nice to mark the buffer as written to */
                }
@@ -666,7 +666,7 @@ Multi2dPanner::distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_co
                        }
                        
                        pan = left * gain_coeff;
-                       Session::mix_buffers_with_gain(dst+n,src+n,nframes-n,pan);
+                       mix_buffers_with_gain(dst+n,src+n,nframes-n,pan);
                        
                } else {
 
@@ -676,10 +676,10 @@ Multi2dPanner::distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_co
                        if ((pan *= gain_coeff) != 1.0f) {
                                
                                if (pan != 0.0f) {
-                                       Session::mix_buffers_with_gain(dst,src,nframes,pan);
+                                       mix_buffers_with_gain(dst,src,nframes,pan);
                                } 
                        } else {
-                                       Session::mix_buffers_no_gain(dst,src,nframes);
+                                       mix_buffers_no_gain(dst,src,nframes);
                        }
 #endif
 #ifdef CAN_INTERP
index d37ae725af19c6386364fa0c2747247011b09731..b161afa6a53ed4cf716765845110c8dc53b60d72 100644 (file)
@@ -41,7 +41,6 @@
 #include <ardour/ladspa_plugin.h>
 #include <ardour/panner.h>
 #include <ardour/dB.h>
-#include <ardour/mix.h>
 #include <ardour/amp.h>
 #include <ardour/meter.h>
 #include <ardour/buffer_set.h>
@@ -507,7 +506,7 @@ Route::process_output_buffers (BufferSet& bufs,
                                
                                for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i) {
                                        Sample* const sp = i->data(nframes);
-                                       Session::apply_gain_to_buffer(sp,nframes,this_gain);
+                                       apply_gain_to_buffer(sp,nframes,this_gain);
                                }
 
                        } else if (_gain == 0) {
index 8f02904fb1f985764113a942cd3cc2474946d914..00c8deb36b183d9e678e285eb90d05e5fda1f92e 100644 (file)
@@ -100,12 +100,6 @@ const char* Session::dead_sound_dir_name = X_("dead_sounds");
 const char* Session::interchange_dir_name = X_("interchange");
 const char* Session::export_dir_name = X_("export");
 
-Session::compute_peak_t                        Session::compute_peak           = 0;
-Session::find_peaks_t                  Session::find_peaks             = 0;
-Session::apply_gain_to_buffer_t                Session::apply_gain_to_buffer   = 0;
-Session::mix_buffers_with_gain_t       Session::mix_buffers_with_gain  = 0;
-Session::mix_buffers_no_gain_t         Session::mix_buffers_no_gain    = 0;
-
 sigc::signal<int> Session::AskAboutPendingState;
 sigc::signal<void> Session::SendFeedback;
 
index 5554462132d09275bcfb862d0ac562d13f328b05..9b37c37912c08ad0965e4e3bf3d2694f48abdcf1 100644 (file)
@@ -22,7 +22,7 @@
 #include <ardour/types.h>
 
 void
-x86_sse_find_peaks(float *buf, nframes_t nframes, float *min, float *max)
+x86_sse_find_peaks(const ARDOUR::Sample* buf, nframes_t nframes, float *min, float *max)
 {
        __m128 current_max, current_min, work;