13
0

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)
This commit is contained in:
Robin Gareus 2016-09-21 03:42:06 +02:00
parent 22e16b7904
commit ad0aef7dce
2 changed files with 10 additions and 0 deletions

View File

@ -79,6 +79,7 @@ public:
const std::string& origin() const { return _origin; }
virtual void set_path (const std::string&);
void replace_file (const std::string&);
static PBD::Signal2<int,std::string,std::vector<std::string> > AmbiguousFileName;

View File

@ -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 ()
{