diff options
author | Robin Gareus <robin@gareus.org> | 2016-09-21 03:42:06 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-09-21 03:42:06 +0200 |
commit | ad0aef7dce247ac69fc9c86554d0acbe6c3045bd (patch) | |
tree | 93ae652087c18ee0bac271c3141ffe36123e910c /libs/ardour/file_source.cc | |
parent | 22e16b7904d0a8a4068ecc21c7751334aa050d80 (diff) |
add API to change FileSource path in-place
This allows to retain IDs and References of a FileSource, while
changing the actual file under the hood (e.g. from .wav to .flac)
Diffstat (limited to 'libs/ardour/file_source.cc')
-rw-r--r-- | libs/ardour/file_source.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc index 32f8a1b124..726b223273 100644 --- a/libs/ardour/file_source.cc +++ b/libs/ardour/file_source.cc @@ -556,6 +556,15 @@ FileSource::set_path (const std::string& newpath) } } + +void +FileSource::replace_file (const std::string& newpath) +{ + close (); + _path = newpath; + _name = Glib::path_get_basename (newpath); +} + void FileSource::inc_use_count () { |