From ffccaaf0bbd23ea655d8027f5173b45ba3258edf Mon Sep 17 00:00:00 2001 From: Sakari Bergen Date: Mon, 10 Jan 2011 21:16:49 +0000 Subject: Make export channels own their buffers + some other small code tidy-ups. Preparation for more stem export options git-svn-id: svn://localhost/ardour2/branches/3.0@8494 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/export_graph_builder.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libs/ardour/export_graph_builder.cc') diff --git a/libs/ardour/export_graph_builder.cc b/libs/ardour/export_graph_builder.cc index 51b4c7042c..d0ce883385 100644 --- a/libs/ardour/export_graph_builder.cc +++ b/libs/ardour/export_graph_builder.cc @@ -30,12 +30,10 @@ ExportGraphBuilder::ExportGraphBuilder (Session const & session) , thread_pool (4) // FIXME thread amount to cores amount { process_buffer_frames = session.engine().frames_per_cycle(); - process_buffer = new Sample[process_buffer_frames]; } ExportGraphBuilder::~ExportGraphBuilder () { - delete [] process_buffer; } int @@ -44,6 +42,7 @@ ExportGraphBuilder::process (framecnt_t frames, bool last_cycle) assert(frames <= process_buffer_frames); for (ChannelMap::iterator it = channels.begin(); it != channels.end(); ++it) { + Sample * process_buffer = 0; it->first->read (process_buffer, frames); ProcessContext context(process_buffer, frames, 1); if (last_cycle) { context.set_flag (ProcessContext::EndOfInput); } @@ -85,6 +84,13 @@ ExportGraphBuilder::set_current_timespan (boost::shared_ptr span void ExportGraphBuilder::add_config (FileSpec const & config) { + ExportChannelConfiguration::ChannelList const & channels = + config.channel_config->get_channels(); + for(ExportChannelConfiguration::ChannelList::const_iterator it = channels.begin(); + it != channels.end(); ++it) { + (*it)->set_max_buffer_size(process_buffer_frames); + } + // If the sample rate is "session rate", change it to the real value. // However, we need to copy it to not change the config which is saved... FileSpec new_config (config); -- cgit v1.2.3