mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
allow templates to load via absolute path
git-svn-id: svn://localhost/trunk/ardour2@294 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
3ca8d77dfd
commit
21bdbaefbf
1 changed files with 1 additions and 27 deletions
|
|
@ -505,33 +505,7 @@ Session::create (bool& new_session, string* mix_template, jack_nframes_t initial
|
||||||
|
|
||||||
if (mix_template) {
|
if (mix_template) {
|
||||||
if (new_session){
|
if (new_session){
|
||||||
|
std::string in_path = *mix_template;
|
||||||
string lookfor = "^";
|
|
||||||
lookfor += *mix_template;
|
|
||||||
lookfor += _template_suffix;
|
|
||||||
lookfor += '$';
|
|
||||||
|
|
||||||
PathScanner scanner;
|
|
||||||
string tpath = template_path();
|
|
||||||
string in_path;
|
|
||||||
string out_path;
|
|
||||||
|
|
||||||
vector<string*>* result= scanner (tpath, lookfor, false, true);
|
|
||||||
|
|
||||||
if (result == 0) {
|
|
||||||
error << string_compose (_("Could not find a template called %1 in %2"), *mix_template, tpath)
|
|
||||||
<< endmsg;
|
|
||||||
*mix_template = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result->size() == 0) {
|
|
||||||
delete result;
|
|
||||||
error << string_compose (_("Could not find a template called %1 in %2"), *mix_template, tpath)
|
|
||||||
<< endmsg;
|
|
||||||
*mix_template = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
in_path = *(result->front());
|
|
||||||
|
|
||||||
ifstream in(in_path.c_str());
|
ifstream in(in_path.c_str());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue