diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 94c0af07eb..52f9d8e99b 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -259,7 +259,6 @@ class Session : public PBD::StatefulDestructible sigc::signal DirtyChanged; std::string sound_dir (bool with_path = true) const; - std::string midi_dir (bool with_path = true) const; std::string peak_dir () const; std::string automation_dir () const; diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index ed2aaff4b5..fd1b7b14b9 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -3134,9 +3134,13 @@ Session::midi_path_from_name (string name) for (i = session_dirs.begin(); i != session_dirs.end(); ++i) { - spath = (*i).path; + SessionDirectory sdir((*i).path); + + sys::path p = sdir.midi_path(); - spath += midi_dir(false) + "/" + legalized; + p /= legalized; + + spath = p.to_string(); snprintf (buf, sizeof(buf), "%s-%u.mid", spath.c_str(), cnt); diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 24a335a128..2d4c5208cf 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -1917,33 +1917,6 @@ Session::sound_dir (bool with_path) const return res; } -string -Session::midi_dir (bool with_path) const -{ - string res; - string full; - - if (with_path) { - res = _path; - } else { - full = _path; - } - - res += interchange_dir_name; - res += '/'; - res += legalize_for_path (_name); - res += '/'; - res += midi_dir_name; - - if (with_path) { - full = res; - } else { - full += res; - } - - return res; -} - string Session::peak_dir () const {