From c94231abbc601652e73423ec6e43a1e241024a17 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 17 Jul 2012 20:32:37 +0000 Subject: Implement worker extension correctly (for one voice only). Woring sequence port I/O for LV2 nodes. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4543 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/LV2RequestRunFeature.hpp | 86 ------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 src/server/LV2RequestRunFeature.hpp (limited to 'src/server/LV2RequestRunFeature.hpp') diff --git a/src/server/LV2RequestRunFeature.hpp b/src/server/LV2RequestRunFeature.hpp deleted file mode 100644 index aae05e3b..00000000 --- a/src/server/LV2RequestRunFeature.hpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - 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 . -*/ - -#ifndef INGEN_ENGINE_LV2_REQUEST_RUN_FEATURE_HPP -#define INGEN_ENGINE_LV2_REQUEST_RUN_FEATURE_HPP - -#include "lv2/lv2plug.in/ns/ext/worker/worker.h" - -#include "raul/log.hpp" - -#include "ingen/shared/LV2Features.hpp" - -#include "Driver.hpp" -#include "Engine.hpp" -#include "MessageContext.hpp" -#include "NodeImpl.hpp" -#include "PortImpl.hpp" - -namespace Ingen { -namespace Server { - -struct RequestRunFeature : public Ingen::Shared::LV2Features::Feature { - struct Info { - inline Info(Shared::World* w, Node* n) : world(w), node(n) {} - Shared::World* world; - Node* node; - }; - - static LV2_Worker_Status - schedule_work(LV2_Worker_Schedule_Handle handle, - uint32_t size, - const void* data) - { - Info* info = reinterpret_cast(handle); - if (!info->world->engine()) - return LV2_WORKER_ERR_UNKNOWN; - - Engine* engine = (Engine*)info->world->engine().get(); - engine->message_context().run( - engine->process_context(), - dynamic_cast(info->node), - engine->driver()->frame_time()); - - return LV2_WORKER_SUCCESS; - } - - static void delete_feature(LV2_Feature* feature) { - free(feature->data); - free(feature); - } - - SharedPtr feature(Shared::World* world, Node* n) { - const NodeImpl* node = dynamic_cast(n); - if (!node) - return SharedPtr(); - - LV2_Worker_Schedule* data = (LV2_Worker_Schedule*)malloc( - sizeof(LV2_Worker_Schedule)); - data->handle = new Info(world, n); - data->schedule_work = schedule_work; - - LV2_Feature* f = (LV2_Feature*)malloc(sizeof(LV2_Feature)); - f->URI = LV2_WORKER__schedule; - f->data = data; - - return SharedPtr(f, &delete_feature); - } -}; - -} // namespace Server -} // namespace Ingen - -#endif // INGEN_ENGINE_LV2_REQUEST_RUN_FEATURE_HPP -- cgit v1.2.1