From 0a9297ed2a1622d252a389d8babc0656fedbe7fd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 15 Aug 2012 04:18:31 +0000 Subject: Simpler and more unified EnginePort implementation. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4699 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/EnginePort.hpp | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) (limited to 'src/server/EnginePort.hpp') diff --git a/src/server/EnginePort.hpp b/src/server/EnginePort.hpp index c911c118..3bda2998 100644 --- a/src/server/EnginePort.hpp +++ b/src/server/EnginePort.hpp @@ -17,53 +17,43 @@ #ifndef INGEN_ENGINE_ENGINE_PORT_HPP #define INGEN_ENGINE_ENGINE_PORT_HPP -#include - #include "raul/Deletable.hpp" #include "raul/Noncopyable.hpp" -#include "DuplexPort.hpp" +#include -namespace Raul { class Path; } +#include "DuplexPort.hpp" namespace Ingen { namespace Server { -class DuplexPort; -class ProcessContext; - -/** Representation of a "system" port (e.g. a Jack port). - * - * This is the class through which the rest of the engine manages everything - * related to driver ports. Derived classes are expected to have a pointer to - * their driver (to be able to perform the operation necessary). +/** A "system" port (e.g. a Jack port, an external port on Ingen). * - * \ingroup engine + * @ingroup engine */ -class EnginePort : public Raul::Noncopyable, public Raul::Deletable { +class EnginePort : public Raul::Noncopyable + , public Raul::Deletable + , public boost::intrusive::list_base_hook<> +{ public: explicit EnginePort(DuplexPort* port) : _patch_port(port) , _buffer(NULL) + , _handle(NULL) {} - virtual ~EnginePort() {} + void set_buffer(void* buf) { _buffer = buf; } + void set_handle(void* buf) { _handle = buf; } - /** Create system port */ - virtual void create() {} - - /** Destroy system port */ - virtual void destroy() {} - - void* buffer() const { return _buffer; } - void set_buffer(void* buf) { _buffer = buf; } - - bool is_input() const { return _patch_port->is_input(); } + void* buffer() const { return _buffer; } + void* handle() const { return _handle; } DuplexPort* patch_port() const { return _patch_port; } + bool is_input() const { return _patch_port->is_input(); } protected: DuplexPort* _patch_port; void* _buffer; + void* _handle; }; } // namespace Server -- cgit v1.2.1