mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
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:
parent
e71ec730bf
commit
18e65da42b
1 changed files with 13 additions and 2 deletions
|
|
@ -23,25 +23,36 @@
|
||||||
|
|
||||||
#include <lrdf.h>
|
#include <lrdf.h>
|
||||||
|
|
||||||
|
#include <glibmm/convert.h>
|
||||||
|
|
||||||
#include <pbd/compose.h>
|
#include <pbd/compose.h>
|
||||||
|
|
||||||
#include <ardour/audio_library.h>
|
#include <ardour/audio_library.h>
|
||||||
#include <ardour/utils.h>
|
#include <ardour/utils.h>
|
||||||
|
#include <ardour/filesystem_paths.h>
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
const char* const sfdb_file_name = "sfdb";
|
||||||
|
} // anonymous namespace
|
||||||
|
|
||||||
static char* TAG = "http://ardour.org/ontology/Tag";
|
static char* TAG = "http://ardour.org/ontology/Tag";
|
||||||
|
|
||||||
AudioLibrary::AudioLibrary ()
|
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
|
// workaround for possible bug in raptor that crashes when saving to a
|
||||||
// non-existant file.
|
// non-existant file.
|
||||||
touch_file(get_user_ardour_path() + "sfdb");
|
touch_file(sfdb_file_path.to_string());
|
||||||
|
|
||||||
lrdf_read_file(src.c_str());
|
lrdf_read_file(src.c_str());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue