#include "ardour/export_failed.h"
#include "ardour/session.h"
+#include "pbd/error.h"
+
using namespace ARDOUR;
bool
}
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];
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<AudioPort *> (session.engine().get_port_by_name (prop->value())));
+ std::string const & name = prop->value();
+ AudioPort * port = dynamic_cast<AudioPort *> (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;
+ }
}
}
}
throw ExportFailed ("Unhandled type in ExportChannelFactory constructor");
}
- session->ProcessExport.connect (export_connection, boost::bind (&RegionExportChannelFactory::new_cycle_started, this, _1));
+ session->ProcessExport.connect_same_thread (export_connection, boost::bind (&RegionExportChannelFactory::new_cycle_started, this, _1));
- buffers.set_count (ChanCount (DataType::AUDIO, n_channels));
buffers.ensure_buffers (DataType::AUDIO, n_channels, frames_per_cycle);
+ buffers.set_count (ChanCount (DataType::AUDIO, n_channels));
}
RegionExportChannelFactory::~RegionExportChannelFactory ()
}
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);
}
void
-RegionExportChannelFactory::update_buffers (nframes_t frames)
+RegionExportChannelFactory::update_buffers (framecnt_t frames)
{
assert (frames <= frames_per_cycle);