From acbe9a26ec3ab689e430225d15e95e73a7378aa9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 7 Sep 2006 06:04:55 +0000 Subject: Patch port fixes. Port metadata fixes. Compatibility hacks for loading old patches. Internal node fixes, cleanups, minor refactor. Path fixes. git-svn-id: http://svn.drobilla.net/lad/ingen@118 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/PatchLibrarian.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src/libs/client/PatchLibrarian.h') diff --git a/src/libs/client/PatchLibrarian.h b/src/libs/client/PatchLibrarian.h index 817f98ca..5c199974 100644 --- a/src/libs/client/PatchLibrarian.h +++ b/src/libs/client/PatchLibrarian.h @@ -17,6 +17,8 @@ #ifndef PATCHLIBRARIAN_H #define PATCHLIBRARIAN_H +#include +#include #include #include #include @@ -42,21 +44,16 @@ class ModelClientInterface; class PatchLibrarian { public: - // FIXME: return booleans and set an errstr that can be checked? + // FIXME: return booleans and set an errstr that can be checked or something? - PatchLibrarian(OSCModelEngineInterface* const osc_model_engine_interface/*,ModelClientInterface* const client_hooks*/) - : m_patch_path("."), m_osc_model_engine_interface(osc_model_engine_interface)//, m_client_hooks(client_hooks) + PatchLibrarian(OSCModelEngineInterface* osc_model_engine_interface) + : _patch_search_path("."), _engine(osc_model_engine_interface) { - assert(m_osc_model_engine_interface); - //assert(m_client_hooks != NULL); + assert(_engine); } -// PatchLibrarian(OSCModelEngineInterface* osc_model_engine_interface) -// : m_osc_model_engine_interface(osc_model_engine_interface), m_client_hooks(new DummyModelClientInterface()) -// {} - - void path(const string& path) { m_patch_path = path; } - const string& path() { return m_patch_path; } + void path(const string& path) { _patch_search_path = path; } + const string& path() { return _patch_search_path; } string find_file(const string& filename, const string& additional_path = ""); @@ -64,8 +61,13 @@ public: string load_patch(PatchModel* pm, bool wait = true, bool existing = false); private: - string m_patch_path; - OSCModelEngineInterface* const m_osc_model_engine_interface; + string translate_load_path(const string& path); + + string _patch_search_path; + OSCModelEngineInterface* const _engine; + + /// Translations of paths from the loading file to actual paths (for deprecated patches) + std::map _load_path_translations; NodeModel* parse_node(const PatchModel* parent, xmlDocPtr doc, const xmlNodePtr cur); ConnectionModel* parse_connection(const PatchModel* parent, xmlDocPtr doc, const xmlNodePtr cur); -- cgit v1.2.1