2 Copyright (C) 2014 Waves Audio Ltd.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include "waves_audioport.h"
22 using namespace ARDOUR;
24 WavesAudioPort::WavesAudioPort (const std::string& port_name, PortFlags flags)
25 : WavesDataPort (port_name, flags)
27 memset (_buffer, 0, sizeof (_buffer));
31 void* WavesAudioPort::get_buffer (pframes_t nframes)
35 std::vector<WavesDataPort*>::const_iterator it = get_connections ().begin ();
37 if (it != get_connections ().end ()) {
38 /* In fact, the static casting to (const WavesAudioPort*) is not that safe.
39 * However, mixing the buffers is assumed in the time critical conditions.
40 * Base class WavesDataPort takes is supposed to provide enough consistentcy
43 for (memcpy (_buffer, ((const WavesAudioPort*)*it)->const_buffer (), nframes * sizeof (Sample)), ++it;
44 it != get_connections ().end ();
46 Sample* tgt = buffer ();
47 const Sample* src = ((const WavesAudioPort*)*it)->const_buffer ();
48 for (uint32_t frame = 0; frame < nframes; ++frame, ++tgt, ++src) {
59 WavesAudioPort::_wipe_buffer()
61 memset (_buffer, 0, sizeof (_buffer));