DummyBackend: fix midi event mux+sorting
[ardour.git] / libs / ardour / session_directory.cc
index 5f3e984955de7ee82773e3fc41e00a8fa950d608..9d0be414da7edee302ed307da83a435cf849713e 100644 (file)
@@ -16,6 +16,8 @@
        Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include <cerrno>
+
 #include <glibmm/fileutils.h>
 #include <glibmm/miscutils.h>
 
@@ -100,6 +102,22 @@ SessionDirectory::sources_root () const
        return Glib::build_filename (sources_root_path, legalized_root);
 }
 
+const std::string
+SessionDirectory::sources_root_2X () const
+{
+       std::string p = m_root_path;
+       std::string filename = Glib::path_get_basename(p);
+
+       if (filename == ".") {
+               p = PBD::get_absolute_path (m_root_path);
+       }
+
+       const string legalized_root (legalize_for_path_2X (Glib::path_get_basename(p)));
+
+       std::string sources_root_path = Glib::build_filename (m_root_path, interchange_dir_name);
+       return Glib::build_filename (sources_root_path, legalized_root);
+}
+
 const std::string
 SessionDirectory::sound_path () const
 {
@@ -109,6 +127,12 @@ SessionDirectory::sound_path () const
        return Glib::build_filename (sources_root(), sound_dir_name);
 }
 
+const std::string
+SessionDirectory::sound_path_2X () const
+{
+       return Glib::build_filename (sources_root_2X(), sound_dir_name);
+}
+
 const std::string
 SessionDirectory::midi_path () const
 {
@@ -121,6 +145,12 @@ SessionDirectory::midi_patch_path () const
        return Glib::build_filename (sources_root(), midi_patch_dir_name);
 }
 
+const std::string
+SessionDirectory::video_path () const
+{
+       return Glib::build_filename (sources_root(), video_dir_name);
+}
+
 const std::string
 SessionDirectory::peak_path () const
 {