along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <list>
#include <ardour/session.h>
#include <ardour/tempo.h>
#include <ardour/io.h>
+#include <ardour/buffer_set.h>
#include <sndfile.h>
Pool Session::Click::pool ("click", sizeof (Click), 128);
void
-Session::click (jack_nframes_t start, jack_nframes_t nframes, jack_nframes_t offset)
+Session::click (nframes_t start, nframes_t nframes, nframes_t offset)
{
TempoMap::BBTPointList *points;
- jack_nframes_t end;
Sample *buf;
- vector<Sample*> bufs;
if (_click_io == 0) {
return;
return;
}
- end = start + nframes;
+ const nframes_t end = start + (nframes_t)floor(nframes * _transport_speed);
- buf = _passthru_buffers[0];
+ BufferSet& bufs = get_scratch_buffers(ChanCount(DataType::AUDIO, 1));
+ buf = bufs.get_audio(0).data();
points = _tempo_map->get_points (start, end);
if (points == 0) {
break;
}
}
-
+
run_clicks:
memset (buf, 0, sizeof (Sample) * nframes);
for (list<Click*>::iterator i = clicks.begin(); i != clicks.end(); ) {
- jack_nframes_t copy;
- jack_nframes_t internal_offset;
+ nframes_t copy;
+ nframes_t internal_offset;
Click *clk;
list<Click*>::iterator next;
i = next;
}
-
- _click_io->deliver_output (_passthru_buffers, 1, nframes, offset);
+
+ _click_io->deliver_output (bufs, start, end, nframes, offset);
}
void
click_data = 0;
}
- string path = Config->get_click_emphasis_sound();
+ string path = Config->get_click_sound();
if (path.empty()) {