diff --git a/libs/ardour/ardour/file_source.h b/libs/ardour/ardour/file_source.h index 265b2e14ee..652c9f59ee 100644 --- a/libs/ardour/ardour/file_source.h +++ b/libs/ardour/ardour/file_source.h @@ -63,6 +63,7 @@ public: float gain() const { return _gain; } virtual void set_gain (float g, bool temporarily = false) { _gain = g; } + virtual void set_channel (uint16_t c) { _channel = c; } int set_state (const XMLNode&, int version); diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 076044f300..6cf035f984 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -5628,6 +5628,7 @@ Session::archive_session (const std::string& dest, std::map, std::string> orig_sources; std::map, std::string> orig_origin; std::map, float> orig_gain; + std::map, uint16_t> orig_channel; set > sources_used_by_this_snapshot; if (only_used_sources) { @@ -5746,6 +5747,7 @@ Session::archive_session (const std::string& dest, orig_sources[afs] = afs->path(); orig_gain[afs] = afs->gain(); + orig_channel[afs] = afs->channel(); std::string new_path = make_new_media_path (afs->path (), to_dir, name); @@ -5773,6 +5775,7 @@ Session::archive_session (const std::string& dest, SndFileSource* ns = new SndFileSource (*this, *(afs.get()), new_path, compress_audio == FLAC_16BIT, progress); afs->replace_file (new_path); afs->set_gain (ns->gain(), true); + afs->set_channel (0); delete ns; } catch (...) { error << "failed to encode " << afs->path() << " to " << new_path << endmsg; @@ -5902,6 +5905,9 @@ Session::archive_session (const std::string& dest, for (std::map, float>::iterator i = orig_gain.begin (); i != orig_gain.end (); ++i) { i->first->set_gain (i->second, true); } + for (std::map, uint16_t>::iterator i = orig_channel.begin (); i != orig_channel.end (); ++i) { + i->first->set_channel (i->second); + } int rv = ar.create (filemap, compression_level); remove_directory (to_dir);