X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Faudio_library.cc;h=662b8cb33e66f844dac4fa63231f76c3d89dc789;hb=bc3e1a212250a67e53e86c972287a275834a967a;hp=b64a9ee08dc10ecdf6076151e69cedb3eeed7be9;hpb=e0aaed6d65f160c328cb8b56d7c6552ee15d65e2;p=ardour.git diff --git a/libs/ardour/audio_library.cc b/libs/ardour/audio_library.cc index b64a9ee08d..662b8cb33e 100644 --- a/libs/ardour/audio_library.cc +++ b/libs/ardour/audio_library.cc @@ -35,6 +35,7 @@ #include "i18n.h" using namespace std; +using namespace PBD; using namespace ARDOUR; namespace { @@ -50,7 +51,7 @@ AudioLibrary::AudioLibrary () 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. @@ -76,11 +77,11 @@ AudioLibrary::set_tags (string member, vector tags) { sort (tags.begin(), tags.end()); tags.erase (unique(tags.begin(), tags.end()), tags.end()); - + const string file_uri(Glib::filename_to_uri (member)); - + lrdf_remove_uri_matches (file_uri.c_str()); - + for (vector::iterator i = tags.begin(); i != tags.end(); ++i) { lrdf_add_triple (src.c_str(), file_uri.c_str(), TAG, (*i).c_str(), lrdf_literal); } @@ -90,32 +91,32 @@ vector AudioLibrary::get_tags (string member) { vector tags; - + lrdf_statement pattern; pattern.subject = strdup(Glib::filename_to_uri(member).c_str()); pattern.predicate = (char*)TAG; pattern.object = 0; pattern.object_type = lrdf_literal; - + lrdf_statement* matches = lrdf_matches (&pattern); free (pattern.subject); - + lrdf_statement* current = matches; while (current != 0) { tags.push_back (current->object); - + current = current->next; } - + lrdf_free_statements (matches); - + sort (tags.begin(), tags.end()); - + return tags; } void -AudioLibrary::search_members_and (vector& members, const vector tags) +AudioLibrary::search_members_and (vector& members, const vector& tags) { lrdf_statement **head; lrdf_statement* pattern = 0;