diff options
author | David Robillard <d@drobilla.net> | 2012-08-18 23:05:06 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-18 23:05:06 +0000 |
commit | 317627ef40f7654c298aa1ac707851c852259e3a (patch) | |
tree | 38f7ed57aafb7b3b8e21e6caa3429a39207e4a9a /src/server/LV2Node.hpp | |
parent | 160b2baf7df8b960f22619c013b3197c0dc51c2b (diff) | |
download | ingen-317627ef40f7654c298aa1ac707851c852259e3a.tar.gz ingen-317627ef40f7654c298aa1ac707851c852259e3a.tar.bz2 ingen-317627ef40f7654c298aa1ac707851c852259e3a.zip |
Node => Block
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4720 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/LV2Node.hpp')
-rw-r--r-- | src/server/LV2Node.hpp | 116 |
1 files changed, 0 insertions, 116 deletions
diff --git a/src/server/LV2Node.hpp b/src/server/LV2Node.hpp deleted file mode 100644 index e7f8eae6..00000000 --- a/src/server/LV2Node.hpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard <http://drobilla.net/> - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or any later version. - - Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef INGEN_ENGINE_LV2NODE_HPP -#define INGEN_ENGINE_LV2NODE_HPP - -#include "lilv/lilv.h" -#include "lv2/lv2plug.in/ns/ext/worker/worker.h" -#include "raul/Disposable.hpp" - -#include "BufferRef.hpp" -#include "NodeImpl.hpp" -#include "ingen/LV2Features.hpp" -#include "types.hpp" - -namespace Ingen { -namespace Server { - -class LV2Plugin; - -/** An instance of a LV2 plugin. - * - * \ingroup engine - */ -class LV2Node : public NodeImpl -{ -public: - LV2Node(LV2Plugin* plugin, - const Raul::Symbol& symbol, - bool polyphonic, - PatchImpl* parent, - SampleRate srate); - - ~LV2Node(); - - bool instantiate(BufferFactory& bufs); - - bool prepare_poly(BufferFactory& bufs, uint32_t poly); - bool apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly); - - void activate(BufferFactory& bufs); - void deactivate(); - - void work(uint32_t size, const void* data); - - void process(ProcessContext& context); - - void set_port_buffer(uint32_t voice, - uint32_t port_num, - BufferRef buf); - -protected: - SharedPtr<LilvInstance> make_instance(URIs& uris, - SampleRate rate, - uint32_t voice, - bool preparing); - - inline LilvInstance* instance(uint32_t voice) { - return (LilvInstance*)(*_instances)[voice].get(); - } - - typedef Raul::Array< SharedPtr<void> > Instances; - - struct Response : public Raul::Disposable - , public Raul::Noncopyable - , public boost::intrusive::slist_base_hook<> - { - inline Response(uint32_t s, const void* d) - : size(s) - , data(malloc(s)) - { - memcpy(data, d, s); - } - - ~Response() { - free(data); - } - - const uint32_t size; - void* const data; - }; - - typedef boost::intrusive::slist<Response, - boost::intrusive::cache_last<true>, - boost::intrusive::constant_time_size<false> - > Responses; - - static LV2_Worker_Status work_respond( - LV2_Worker_Respond_Handle handle, uint32_t size, const void* data); - - LV2Plugin* _lv2_plugin; - Instances* _instances; - Instances* _prepared_instances; - const LV2_Worker_Interface* _worker_iface; - Responses _responses; - SharedPtr<LV2Features::FeatureArray> _features; -}; - -} // namespace Server -} // namespace Ingen - -#endif // INGEN_ENGINE_LV2NODE_HPP - |