X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Faudio_library.cc;h=662b8cb33e66f844dac4fa63231f76c3d89dc789;hb=204baa31d842d4c2f833d319b6fa55e402a1bfb8;hp=42ec5378307f08fc92d5c5a492649072080d067a;hpb=022818b4a796f52c0a91eea42e65aec0bc7bed43;p=ardour.git diff --git a/libs/ardour/audio_library.cc b/libs/ardour/audio_library.cc index 42ec537830..662b8cb33e 100644 --- a/libs/ardour/audio_library.cc +++ b/libs/ardour/audio_library.cc @@ -26,15 +26,16 @@ #include -#include +#include "pbd/compose.h" -#include -#include -#include +#include "ardour/audio_library.h" +#include "ardour/utils.h" +#include "ardour/filesystem_paths.h" #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;