13
0

Use sys::path and ARDOUR::user_config_directory in AudioLibrary for portablility

Use Glib::filename_to_uri to create the src uri(which didn't look valid as it was)


git-svn-id: svn://localhost/ardour2/trunk@2046 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Tim Mayberry 2007-06-27 12:12:10 +00:00
parent e71ec730bf
commit 18e65da42b

View File

@ -23,25 +23,36 @@
#include <lrdf.h>
#include <glibmm/convert.h>
#include <pbd/compose.h>
#include <ardour/audio_library.h>
#include <ardour/utils.h>
#include <ardour/filesystem_paths.h>
#include "i18n.h"
using namespace std;
using namespace ARDOUR;
namespace {
const char* const sfdb_file_name = "sfdb";
} // anonymous namespace
static char* TAG = "http://ardour.org/ontology/Tag";
AudioLibrary::AudioLibrary ()
{
src = "file:" + get_user_ardour_path() + "sfdb";
sys::path sfdb_file_path(user_config_directory ());
sfdb_file_path /= sfdb_file_name;
src = Glib::filename_to_uri (sfdb_file_path.to_string ());
// workaround for possible bug in raptor that crashes when saving to a
// non-existant file.
touch_file(get_user_ardour_path() + "sfdb");
touch_file(sfdb_file_path.to_string());
lrdf_read_file(src.c_str());
}