Add ardour/template_utils.h that contains ARDOUR::user_template_directory and ARDOUR...
authorTim Mayberry <mojofunk@gmail.com>
Sun, 17 Jun 2007 00:52:45 +0000 (00:52 +0000)
committerTim Mayberry <mojofunk@gmail.com>
Sun, 17 Jun 2007 00:52:45 +0000 (00:52 +0000)
git-svn-id: svn://localhost/ardour2/trunk@2015 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/SConscript
libs/ardour/ardour/template_utils.h [new file with mode: 0644]
libs/ardour/template_utils.cc [new file with mode: 0644]

index 6c4764a73828996174866f81573a9f623044dd64..6b4dab456f2d0c7e3c7a63e376fe565a6a037f19 100644 (file)
@@ -33,6 +33,7 @@ diskstream.cc
 directory_names.cc
 filename_extensions.cc
 find_session.cc
+template_utils.cc
 track.cc
 audio_diskstream.cc
 audio_library.cc
diff --git a/libs/ardour/ardour/template_utils.h b/libs/ardour/ardour/template_utils.h
new file mode 100644 (file)
index 0000000..0676d5b
--- /dev/null
@@ -0,0 +1,20 @@
+
+#ifndef TEMPLATE_UTILS_INCLUDED
+#define TEMPLATE_UTILS_INCLUDED
+
+#include <vector>
+
+#include <pbd/filesystem.h>
+
+namespace ARDOUR {
+
+       using std::vector;
+       using namespace PBD;
+
+       sys::path system_template_directory ();
+
+       sys::path user_template_directory ();
+
+} // namespace ARDOUR
+
+#endif
diff --git a/libs/ardour/template_utils.cc b/libs/ardour/template_utils.cc
new file mode 100644 (file)
index 0000000..6e5f7a3
--- /dev/null
@@ -0,0 +1,28 @@
+
+#include <pbd/filesystem.h>
+
+#include <ardour/template_utils.h>
+#include <ardour/ardour.h>
+#include <ardour/directory_names.h>
+
+namespace ARDOUR {
+
+sys::path
+system_template_directory ()
+{
+       sys::path p(get_system_data_path());
+       p /= templates_dir_name;
+
+       return p;
+}
+
+sys::path
+user_template_directory ()
+{
+       sys::path p(get_user_ardour_path());
+       p /= templates_dir_name;
+
+       return p;
+}
+
+} // namespace ARDOUR