projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
send a slightly more useful message if a control protocol's probe() method fails
[ardour.git]
/
libs
/
ardour
/
export_channel.cc
diff --git
a/libs/ardour/export_channel.cc
b/libs/ardour/export_channel.cc
index 8deb31956dbedbb0c8afd1e486a77988caf16537..cc388531df32fb96cb10a3ca9965f0bffb5d73dd 100644
(file)
--- a/
libs/ardour/export_channel.cc
+++ b/
libs/ardour/export_channel.cc
@@
-30,7
+30,7
@@
#include "pbd/error.h"
#include "pbd/error.h"
-#include "i18n.h"
+#include "
pbd/
i18n.h"
using namespace ARDOUR;
using namespace ARDOUR;
@@
-98,7
+98,7
@@
PortExportChannel::get_state (XMLNode * node) const
void
PortExportChannel::set_state (XMLNode * node, Session & session)
{
void
PortExportChannel::set_state (XMLNode * node, Session & session)
{
- XMLProperty * prop;
+ XMLProperty
const
* prop;
XMLNodeList xml_ports = node->children ("Port");
for (XMLNodeList::iterator it = xml_ports.begin(); it != xml_ports.end(); ++it) {
if ((prop = (*it)->property ("name"))) {
XMLNodeList xml_ports = node->children ("Port");
for (XMLNodeList::iterator it = xml_ports.begin(); it != xml_ports.end(); ++it) {
if ((prop = (*it)->property ("name"))) {
@@
-113,11
+113,11
@@
PortExportChannel::set_state (XMLNode * node, Session & session)
}
}
}
}
-RegionExportChannelFactory::RegionExportChannelFactory (Session * session, AudioRegion const & region, AudioTrack & track, Type type)
+RegionExportChannelFactory::RegionExportChannelFactory (Session * session, AudioRegion const & region, AudioTrack & track, Type type)
: region (region)
, track (track)
, type (type)
: region (region)
, track (track)
, type (type)
- , frames_per_cycle (session->engine().
fram
es_per_cycle ())
+ , frames_per_cycle (session->engine().
sampl
es_per_cycle ())
, buffers_up_to_date (false)
, region_start (region.position())
, position (region_start)
, buffers_up_to_date (false)
, region_start (region.position())
, position (region_start)
@@
-131,7
+131,7
@@
RegionExportChannelFactory::RegionExportChannelFactory (Session * session, Audio
mixdown_buffer.reset (new Sample [frames_per_cycle]);
gain_buffer.reset (new Sample [frames_per_cycle]);
mixdown_buffer.reset (new Sample [frames_per_cycle]);
gain_buffer.reset (new Sample [frames_per_cycle]);
-
memset (gain_buffer.get(), 1.0, sizeof (Sample) * frames_per_cycle
);
+
std::fill_n (gain_buffer.get(), frames_per_cycle, Sample (1.0)
);
break;
case Processed:
break;
case Processed:
@@
-187,11
+187,12
@@
RegionExportChannelFactory::update_buffers (framecnt_t frames)
assert (mixdown_buffer && gain_buffer);
for (size_t channel = 0; channel < n_channels; ++channel) {
memset (mixdown_buffer.get(), 0, sizeof (Sample) * frames);
assert (mixdown_buffer && gain_buffer);
for (size_t channel = 0; channel < n_channels; ++channel) {
memset (mixdown_buffer.get(), 0, sizeof (Sample) * frames);
+ buffers.get_audio (channel).silence(frames);
region.read_at (buffers.get_audio (channel).data(), mixdown_buffer.get(), gain_buffer.get(), position, frames, channel);
}
break;
case Processed:
region.read_at (buffers.get_audio (channel).data(), mixdown_buffer.get(), gain_buffer.get(), position, frames, channel);
}
break;
case Processed:
- track.export_stuff (buffers, position, frames, track.main_outs(), true, true);
+ track.export_stuff (buffers, position, frames, track.main_outs(), true, true
, false
);
break;
default:
throw ExportFailed ("Unhandled type in ExportChannelFactory::update_buffers");
break;
default:
throw ExportFailed ("Unhandled type in ExportChannelFactory::update_buffers");
@@
-214,9
+215,9
@@
RouteExportChannel::~RouteExportChannel()
}
void
}
void
-RouteExportChannel::create_from_route(std::list<ExportChannelPtr> & result,
Route &
route)
+RouteExportChannel::create_from_route(std::list<ExportChannelPtr> & result,
boost::shared_ptr<Route>
route)
{
{
- boost::shared_ptr<CapturingProcessor> processor = route
.
add_export_point();
+ boost::shared_ptr<CapturingProcessor> processor = route
->
add_export_point();
uint32_t channels = processor->input_streams().n_audio();
boost::shared_ptr<ProcessorRemover> remover (new ProcessorRemover (route, processor));
uint32_t channels = processor->input_streams().n_audio();
boost::shared_ptr<ProcessorRemover> remover (new ProcessorRemover (route, processor));
@@
-239,7
+240,11
@@
RouteExportChannel::read (Sample const *& data, framecnt_t frames) const
{
assert(processor);
AudioBuffer const & buffer = processor->get_capture_buffers().get_audio (channel);
{
assert(processor);
AudioBuffer const & buffer = processor->get_capture_buffers().get_audio (channel);
- assert (frames <= (framecnt_t) buffer.size());
+#ifndef NDEBUG
+ (void) frames;
+#else
+ assert (frames <= (framecnt_t) buffer.capacity());
+#endif
data = buffer.data();
}
data = buffer.data();
}
@@
-271,5
+276,5
@@
RouteExportChannel::operator< (ExportChannel const & other) const
RouteExportChannel::ProcessorRemover::~ProcessorRemover()
{
RouteExportChannel::ProcessorRemover::~ProcessorRemover()
{
- route
.
remove_processor (processor);
+ route
->
remove_processor (processor);
}
}