From 8ecf0ff34b126f56dd06d6febf7046c0e98fb87e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 17 Feb 2011 20:40:48 +0000 Subject: Remove deprecated Om patch loading code (resolve ticket #32). Om patch loading is better achieved with a script than trying to maintain this functionality in ingen (and the associated dead code maintenance and protocol headaches). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2984 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/LoadPatchWindow.cpp | 4 +-- src/gui/LoadRemotePatchWindow.cpp | 2 +- src/gui/ThreadedLoader.cpp | 51 ++++++++++++--------------------------- src/gui/ThreadedLoader.hpp | 14 ++++------- src/gui/wscript | 1 - 5 files changed, 23 insertions(+), 49 deletions(-) (limited to 'src/gui') diff --git a/src/gui/LoadPatchWindow.cpp b/src/gui/LoadPatchWindow.cpp index 882f1368..81066a8c 100644 --- a/src/gui/LoadPatchWindow.cpp +++ b/src/gui/LoadPatchWindow.cpp @@ -175,7 +175,7 @@ LoadPatchWindow::ok_clicked() symbol = _patch->symbol(); } - App::instance().loader()->load_patch(true, get_uri(), Path("/"), + App::instance().loader()->load_patch(true, get_uri(), parent, symbol, _initial_data); } else { @@ -193,7 +193,7 @@ LoadPatchWindow::ok_clicked() symbol = avoid_symbol_clash(symbol); - App::instance().loader()->load_patch(false, *i, Path("/"), + App::instance().loader()->load_patch(false, *i, _patch->path(), symbol, _initial_data); } } diff --git a/src/gui/LoadRemotePatchWindow.cpp b/src/gui/LoadRemotePatchWindow.cpp index 0ad4d5b5..f48bd0bc 100644 --- a/src/gui/LoadRemotePatchWindow.cpp +++ b/src/gui/LoadRemotePatchWindow.cpp @@ -140,7 +140,7 @@ LoadRemotePatchWindow::open_clicked() if (!_patch->path().is_root()) parent = _patch->path().parent(); - App::instance().loader()->load_patch(true, uri, Path("/"), + App::instance().loader()->load_patch(true, uri, parent, symbol, _initial_data); hide(); diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp index 2a9646e2..c60d8c4c 100644 --- a/src/gui/ThreadedLoader.cpp +++ b/src/gui/ThreadedLoader.cpp @@ -1,5 +1,5 @@ /* This file is part of Ingen. - * Copyright (C) 2007-2009 David Robillard + * Copyright (C) 2007-2011 David Robillard * * Ingen is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software @@ -31,10 +31,8 @@ using namespace Raul; namespace Ingen { namespace GUI { - ThreadedLoader::ThreadedLoader(SharedPtr uris, SharedPtr engine) : _engine(engine) - , _deprecated_loader(uris, engine) { set_name("Loader"); @@ -44,7 +42,6 @@ ThreadedLoader::ThreadedLoader(SharedPtr uris, SharedPtr ThreadedLoader::parser() { @@ -56,7 +53,6 @@ ThreadedLoader::parser() return world->parser(); } - void ThreadedLoader::_whipped() { @@ -71,11 +67,10 @@ ThreadedLoader::_whipped() } void -ThreadedLoader::load_patch(bool merge, - const Glib::ustring& document_uri, - optional data_path, - optional engine_parent, - optional engine_symbol, +ThreadedLoader::load_patch(bool merge, + const Glib::ustring& document_uri, + optional engine_parent, + optional engine_symbol, optional engine_data) { _mutex.lock(); @@ -90,36 +85,22 @@ ThreadedLoader::load_patch(bool merge, engine_base = engine_parent.get().base(); } - // Filthy hack to load deprecated patches based on file extension - if (document_uri.substr(document_uri.length()-3) == ".om") { - _events.push_back(sigc::hide_return(sigc::bind( - sigc::mem_fun(_deprecated_loader, - &DeprecatedLoader::load_patch), - document_uri, - merge, - engine_parent, - engine_symbol, - *engine_data, - false))); - } else { - _events.push_back(sigc::hide_return(sigc::bind( - sigc::mem_fun(world->parser().get(), - &Ingen::Serialisation::Parser::parse_file), - App::instance().world(), - App::instance().world()->engine().get(), - document_uri, - data_path, - engine_parent, - engine_symbol, - engine_data))); - } + _events.push_back( + sigc::hide_return( + sigc::bind(sigc::mem_fun(world->parser().get(), + &Ingen::Serialisation::Parser::parse_file), + App::instance().world(), + App::instance().world()->engine().get(), + document_uri, + engine_parent, + engine_symbol, + engine_data))); whip(); _mutex.unlock(); } - void ThreadedLoader::save_patch(SharedPtr model, const string& filename) { @@ -134,7 +115,6 @@ ThreadedLoader::save_patch(SharedPtr model, const string& filename) whip(); } - void ThreadedLoader::save_patch_event(SharedPtr model, const string& filename) { @@ -146,6 +126,5 @@ ThreadedLoader::save_patch_event(SharedPtr model, const string& file } } - } // namespace GUI } // namespace Ingen diff --git a/src/gui/ThreadedLoader.hpp b/src/gui/ThreadedLoader.hpp index a6389df8..96c64af3 100644 --- a/src/gui/ThreadedLoader.hpp +++ b/src/gui/ThreadedLoader.hpp @@ -1,5 +1,5 @@ /* This file is part of Ingen. - * Copyright (C) 2007-2009 David Robillard + * Copyright (C) 2007-2011 David Robillard * * Ingen is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software @@ -26,7 +26,6 @@ #include "raul/Slave.hpp" #include #include "interface/EngineInterface.hpp" -#include "client/DeprecatedLoader.hpp" #include "serialisation/Serialiser.hpp" #include "serialisation/Parser.hpp" using std::string; @@ -40,7 +39,6 @@ using namespace Serialisation; namespace GUI { - /** Thread for loading patch files. * * This is a seperate thread so it can send all the loading message without @@ -55,11 +53,11 @@ namespace GUI { class ThreadedLoader : public Raul::Slave { public: - ThreadedLoader(SharedPtr uris, SharedPtr engine); + ThreadedLoader(SharedPtr uris, + SharedPtr engine); void load_patch(bool merge, const Glib::ustring& document_uri, - optional data_path, optional engine_parent, optional engine_symbol, optional engine_data); @@ -79,12 +77,10 @@ private: SharedPtr _engine; - DeprecatedLoader _deprecated_loader; - Glib::Mutex _mutex; - list _events; + Glib::Mutex _mutex; + list _events; }; - } // namespace GUI } // namespace Ingen diff --git a/src/gui/wscript b/src/gui/wscript index 54919362..8e6bf344 100644 --- a/src/gui/wscript +++ b/src/gui/wscript @@ -63,7 +63,6 @@ def build(bld): LV2CORE SLV2 SOUP - XML2 ''') # Glade XML UI definition -- cgit v1.2.1