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:
parent
22e16b7904
commit
ad0aef7dce
@ -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;
|
||||
|
||||
|
@ -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 ()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user