using namespace std;
using namespace ARDOUR;
+using namespace PBD;
using namespace soundtouch;
AudioRegion*
for (uint32_t i = 0; i < sources.size(); ++i) {
gain_t gain_buffer[bufsize];
Sample buffer[bufsize];
- char workbuf[bufsize*4];
jack_nframes_t pos = 0;
jack_nframes_t this_read = 0;
+ AudioSource* const asrc = dynamic_cast<AudioSource*>(sources[i]);
+ if (!asrc) {
+ cerr << "FIXME: TimeFX for non-audio" << endl;
+ continue;
+ }
+
st.clear();
while (tsr.running && pos < tsr.region->length()) {
jack_nframes_t this_time;
not the ones currently in use, in case it's already been
subject to timefx. */
- if ((this_read = tsr.region->master_read_at (buffer, buffer, gain_buffer, workbuf, pos + tsr.region->position(), this_time)) != this_time) {
+ if ((this_read = tsr.region->master_read_at (buffer, buffer, gain_buffer, pos + tsr.region->position(), this_time)) != this_time) {
error << string_compose (_("tempoize: error reading data from %1"), sources[i]->name()) << endmsg;
goto out;
}
st.putSamples (buffer, this_read);
while ((this_read = st.receiveSamples (buffer, bufsize)) > 0 && tsr.running) {
- if (sources[i]->write (buffer, this_read, workbuf) != this_read) {
+ if (asrc->write (buffer, this_read) != this_read) {
error << string_compose (_("error writing tempo-adjusted data to %1"), sources[i]->name()) << endmsg;
goto out;
}
}
while (tsr.running && (this_read = st.receiveSamples (buffer, bufsize)) > 0) {
- if (sources[i]->write (buffer, this_read, workbuf) != this_read) {
+ if (asrc->write (buffer, this_read) != this_read) {
error << string_compose (_("error writing tempo-adjusted data to %1"), sources[i]->name()) << endmsg;
goto out;
}