+{
+ 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);
+ new_config.format.reset(new ExportFormatSpecification(*new_config.format, false));
+ if(new_config.format->sample_rate() == ExportFormatBase::SR_Session) {
+ framecnt_t session_rate = session.nominal_frame_rate();
+ new_config.format->set_sample_rate(ExportFormatBase::nearest_sample_rate(session_rate));
+ }
+
+
+ if (!new_config.channel_config->get_split ()) {
+ add_split_config (new_config);
+ return;
+ }
+
+ // Split channel configurations are split into several channel configurations,
+ // each corresponding to a file, at this stage
+ typedef std::list<boost::shared_ptr<ExportChannelConfiguration> > ConfigList;
+ ConfigList file_configs;
+ new_config.channel_config->configurations_for_files (file_configs);
+
+ unsigned chan = 1;
+ for (ConfigList::iterator it = file_configs.begin(); it != file_configs.end(); ++it, ++chan) {
+ FileSpec copy = new_config;
+ copy.channel_config = *it;
+
+ copy.filename.reset (new ExportFilename (*copy.filename));
+ copy.filename->include_channel = true;
+ copy.filename->set_channel (chan);
+
+ add_split_config (copy);
+ }
+}
+
+void
+ExportGraphBuilder::add_split_config (FileSpec const & config)