diff options
author | Sakari Bergen <sakari.bergen@beatwaves.net> | 2010-12-18 17:56:41 +0000 |
---|---|---|
committer | Sakari Bergen <sakari.bergen@beatwaves.net> | 2010-12-18 17:56:41 +0000 |
commit | ffadfff6506e507b09853e4c7e50bcedffa29cce (patch) | |
tree | c8413307ce40afe6f7f908467de1eb06dcaf427f /libs/ardour/export_graph_builder.cc | |
parent | 850b7d24a9230c84183372691f11d29c8f9c3117 (diff) |
Add "session rate" as a possible sample rate for export formats
git-svn-id: svn://localhost/ardour2/branches/3.0@8294 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/export_graph_builder.cc')
-rw-r--r-- | libs/ardour/export_graph_builder.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/libs/ardour/export_graph_builder.cc b/libs/ardour/export_graph_builder.cc index ba7491c976..885bc9786d 100644 --- a/libs/ardour/export_graph_builder.cc +++ b/libs/ardour/export_graph_builder.cc @@ -77,8 +77,18 @@ ExportGraphBuilder::reset () void ExportGraphBuilder::add_config (FileSpec const & config) { - if (!config.channel_config->get_split ()) { - add_split_config (config); + // 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)); + 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; } @@ -86,11 +96,11 @@ ExportGraphBuilder::add_config (FileSpec const & config) // each corresponding to a file, at this stage typedef std::list<boost::shared_ptr<ExportChannelConfiguration> > ConfigList; ConfigList file_configs; - config.channel_config->configurations_for_files (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 = config; + FileSpec copy = new_config; copy.channel_config = *it; copy.filename.reset (new ExportFilename (*copy.filename)); |