diff options
author | Sakari Bergen <sakari.bergen@beatwaves.net> | 2011-01-10 21:16:49 +0000 |
---|---|---|
committer | Sakari Bergen <sakari.bergen@beatwaves.net> | 2011-01-10 21:16:49 +0000 |
commit | ffccaaf0bbd23ea655d8027f5173b45ba3258edf (patch) | |
tree | 5b7ae5208275080ff148123bbc8e8a071a352d9a /libs/ardour/export_graph_builder.cc | |
parent | b67be86cbff5efe1fff35ca86a216a1e63e214d7 (diff) |
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
Diffstat (limited to 'libs/ardour/export_graph_builder.cc')
-rw-r--r-- | libs/ardour/export_graph_builder.cc | 10 |
1 files changed, 8 insertions, 2 deletions
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<Sample> context(process_buffer, frames, 1); if (last_cycle) { context.set_flag (ProcessContext<Sample>::EndOfInput); } @@ -85,6 +84,13 @@ ExportGraphBuilder::set_current_timespan (boost::shared_ptr<ExportTimespan> 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); |