From 48f87f1f1649fb7e169fdaac2cd38370e8a4a1fa Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 8 Sep 2006 03:58:00 +0000 Subject: De-singleton-ified Engine Slight rework of Responder/ClientKey/ClientInterface for Requests git-svn-id: http://svn.drobilla.net/lad/ingen@119 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/events/ConnectionEvent.cpp | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/libs/engine/events/ConnectionEvent.cpp') diff --git a/src/libs/engine/events/ConnectionEvent.cpp b/src/libs/engine/events/ConnectionEvent.cpp index bf64df0a..b873bccb 100644 --- a/src/libs/engine/events/ConnectionEvent.cpp +++ b/src/libs/engine/events/ConnectionEvent.cpp @@ -36,8 +36,8 @@ namespace Ingen { //// ConnectionEvent //// -ConnectionEvent::ConnectionEvent(CountedPtr responder, SampleCount timestamp, const string& src_port_path, const string& dst_port_path) -: QueuedEvent(responder, timestamp), +ConnectionEvent::ConnectionEvent(Engine& engine, CountedPtr responder, SampleCount timestamp, const string& src_port_path, const string& dst_port_path) +: QueuedEvent(engine, responder, timestamp), m_src_port_path(src_port_path), m_dst_port_path(dst_port_path), m_patch(NULL), @@ -66,7 +66,7 @@ ConnectionEvent::pre_process() return; } - /*m_patch = Engine::instance().object_store()->find_patch(m_src_port_path.parent().parent()); + /*m_patch = _engine.object_store()->find_patch(m_src_port_path.parent().parent()); if (m_patch == NULL) { m_error = PORT_NOT_FOUND; @@ -74,8 +74,8 @@ ConnectionEvent::pre_process() return; }*/ - m_src_port = Engine::instance().object_store()->find_port(m_src_port_path); - m_dst_port = Engine::instance().object_store()->find_port(m_dst_port_path); + m_src_port = _engine.object_store()->find_port(m_src_port_path); + m_dst_port = _engine.object_store()->find_port(m_dst_port_path); if (m_src_port == NULL || m_dst_port == NULL) { m_error = PORT_NOT_FOUND; @@ -104,10 +104,10 @@ ConnectionEvent::pre_process() // Create the typed event to actually do the work const DataType type = m_src_port->type(); if (type == DataType::FLOAT) { - m_typed_event = new TypedConnectionEvent(_responder, _time_stamp, + m_typed_event = new TypedConnectionEvent(_engine, _responder, _time, dynamic_cast*>(m_src_port), dynamic_cast*>(m_dst_port)); } else if (type == DataType::MIDI) { - m_typed_event = new TypedConnectionEvent(_responder, _time_stamp, + m_typed_event = new TypedConnectionEvent(_engine, _responder, _time, dynamic_cast*>(m_src_port), dynamic_cast*>(m_dst_port)); } else { m_error = TYPE_MISMATCH; @@ -122,12 +122,12 @@ ConnectionEvent::pre_process() void -ConnectionEvent::execute(SampleCount offset) +ConnectionEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) { - QueuedEvent::execute(offset); + QueuedEvent::execute(nframes, start, end); if (m_error == NO_ERROR) - m_typed_event->execute(offset); + m_typed_event->execute(nframes, start, end); } @@ -150,8 +150,8 @@ ConnectionEvent::post_process() template -TypedConnectionEvent::TypedConnectionEvent(CountedPtr responder, SampleCount timestamp, OutputPort* src_port, InputPort* dst_port) -: QueuedEvent(responder, timestamp), +TypedConnectionEvent::TypedConnectionEvent(Engine& engine, CountedPtr responder, SampleCount timestamp, OutputPort* src_port, InputPort* dst_port) +: QueuedEvent(engine, responder, timestamp), m_src_port(src_port), m_dst_port(dst_port), m_patch(NULL), @@ -221,21 +221,21 @@ TypedConnectionEvent::pre_process() src_node->dependants()->push_back(new ListNode(dst_node)); } - if (m_patch->process()) + if (m_patch->enabled()) m_process_order = m_patch->build_process_order(); } template void -TypedConnectionEvent::execute(SampleCount offset) +TypedConnectionEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) { if (m_succeeded) { // These must be inserted here, since they're actually used by the audio thread m_dst_port->add_connection(m_port_listnode); m_patch->add_connection(m_patch_listnode); if (m_patch->process_order() != NULL) - Engine::instance().maid()->push(m_patch->process_order()); + _engine.maid()->push(m_patch->process_order()); m_patch->process_order(m_process_order); } } @@ -250,7 +250,7 @@ TypedConnectionEvent::post_process() _responder->respond_ok(); - Engine::instance().client_broadcaster()->send_connection(m_connection); + _engine.client_broadcaster()->send_connection(m_connection); } else { _responder->respond_error("Unable to make connection."); } -- cgit v1.2.1