mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
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
2 changed files with 10 additions and 0 deletions
|
|
@ -79,6 +79,7 @@ public:
|
||||||
const std::string& origin() const { return _origin; }
|
const std::string& origin() const { return _origin; }
|
||||||
|
|
||||||
virtual void set_path (const std::string&);
|
virtual void set_path (const std::string&);
|
||||||
|
void replace_file (const std::string&);
|
||||||
|
|
||||||
static PBD::Signal2<int,std::string,std::vector<std::string> > AmbiguousFileName;
|
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
|
void
|
||||||
FileSource::inc_use_count ()
|
FileSource::inc_use_count ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue