X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fexport_channel.cc;h=c612b1f6684e6af3488138d3b9bdbb1c4347a1cd;hb=75ede0dd6bda0136aef612b0e427ae25b208d0d0;hp=a09e6e21b6c2a6cfd388b011bc7256d3d2deeb86;hpb=bd3f48aaa7cd07b830f92af49beef5a4e2b71985;p=ardour.git diff --git a/libs/ardour/export_channel.cc b/libs/ardour/export_channel.cc index a09e6e21b6..c612b1f668 100644 --- a/libs/ardour/export_channel.cc +++ b/libs/ardour/export_channel.cc @@ -22,10 +22,13 @@ #include "ardour/audio_port.h" #include "ardour/audio_track.h" #include "ardour/audioengine.h" +#include "ardour/audioregion.h" #include "ardour/export_channel.h" #include "ardour/export_failed.h" #include "ardour/session.h" +#include "pbd/error.h" + using namespace ARDOUR; bool @@ -39,13 +42,13 @@ PortExportChannel::operator< (ExportChannel const & other) const } void -PortExportChannel::read (Sample * data, nframes_t frames) const +PortExportChannel::read (Sample * data, framecnt_t frames) const { memset (data, 0, frames * sizeof (float)); for (PortSet::const_iterator it = ports.begin(); it != ports.end(); ++it) { if (*it != 0) { - Sample* port_buffer = (*it)->get_audio_buffer(frames, 0).data(); + Sample* port_buffer = (*it)->get_audio_buffer(frames).data(); for (uint32_t i = 0; i < frames; ++i) { data[i] += (float) port_buffer[i]; @@ -72,7 +75,13 @@ PortExportChannel::set_state (XMLNode * node, Session & session) XMLNodeList xml_ports = node->children ("Port"); for (XMLNodeList::iterator it = xml_ports.begin(); it != xml_ports.end(); ++it) { if ((prop = (*it)->property ("name"))) { - ports.insert (dynamic_cast (session.engine().get_port_by_name (prop->value()))); + std::string const & name = prop->value(); + AudioPort * port = dynamic_cast (session.engine().get_port_by_name (name)); + if (port) { + ports.insert (port); + } else { + PBD::warning << string_compose (_("Could not get port for export channel \"%1\", dropping the channel"), name) << endmsg; + } } } } @@ -128,7 +137,7 @@ RegionExportChannelFactory::create (uint32_t channel) } void -RegionExportChannelFactory::read (uint32_t channel, Sample * data, nframes_t frames_to_read) +RegionExportChannelFactory::read (uint32_t channel, Sample * data, framecnt_t frames_to_read) { assert (channel < n_channels); assert (frames_to_read <= frames_per_cycle); @@ -142,7 +151,7 @@ RegionExportChannelFactory::read (uint32_t channel, Sample * data, nframes_t fra } void -RegionExportChannelFactory::update_buffers (nframes_t frames) +RegionExportChannelFactory::update_buffers (framecnt_t frames) { assert (frames <= frames_per_cycle);