summaryrefslogtreecommitdiffstats
path: root/src/engine/GraphObjectImpl.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-20 21:52:36 +0000
committerDavid Robillard <d@drobilla.net>2010-02-20 21:52:36 +0000
commit46e5de590817756b21a7a5d99bd4963df343f455 (patch)
tree7d7b3b63297b24d84e5b42cc8aeb22d4212738b5 /src/engine/GraphObjectImpl.hpp
parentb96a4015ae39b5bdd9afbd82898c0168a0a8e613 (diff)
downloadingen-46e5de590817756b21a7a5d99bd4963df343f455.tar.gz
ingen-46e5de590817756b21a7a5d99bd4963df343f455.tar.bz2
ingen-46e5de590817756b21a7a5d99bd4963df343f455.zip
Heavy overhaul of buffer management and polyphony.
* Working polyphony when nodes are instantiated at desired polyphony level (dynamic still doesn't work) * Use shared silent buffer for disconnected audio inputs (save memory) * Eliminate redundant patch compiling on delete and disconnect-all events that have child events * Fix a ton of crash bugs and other issues I've since forgotten git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2468 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/GraphObjectImpl.hpp')
-rw-r--r--src/engine/GraphObjectImpl.hpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/engine/GraphObjectImpl.hpp b/src/engine/GraphObjectImpl.hpp
index 82ff7f53..854fdab1 100644
--- a/src/engine/GraphObjectImpl.hpp
+++ b/src/engine/GraphObjectImpl.hpp
@@ -35,6 +35,7 @@ namespace Ingen {
class PatchImpl;
class Context;
class ProcessContext;
+class BufferFactory;
/** An object on the audio graph - Patch, Node, Port, etc.
@@ -55,15 +56,12 @@ public:
const Raul::URI& uri() const { return _path; }
const Raul::Symbol& symbol() const { return _symbol; }
- bool polyphonic() const { return _polyphonic; }
- virtual bool set_polyphonic(Raul::Maid& maid, bool p) { _polyphonic = p; return true; }
-
GraphObject* graph_parent() const { return _parent; }
GraphObjectImpl* parent() const { return _parent; }
Resource& meta() { return _meta; }
const Resource& meta() const { return _meta; }
- virtual void process(ProcessContext& context) = 0;
+ //virtual void process(ProcessContext& context) = 0;
/** Rename */
virtual void set_path(const Raul::Path& new_path) {
@@ -83,14 +81,29 @@ public:
SharedPtr<GraphObject> find_child(const std::string& name) const;
+ /** Prepare for a new (external) polyphony value.
+ *
+ * Preprocessor thread, poly is actually applied by apply_poly.
+ * \return true on success.
+ */
+ virtual bool prepare_poly(BufferFactory& bufs, uint32_t poly) = 0;
+
+ /** Apply a new (external) polyphony value.
+ *
+ * Audio thread.
+ *
+ * \param poly Must be <= the most recent value passed to prepare_poly.
+ * \param maid Any objects no longer needed will be pushed to this
+ */
+ virtual bool apply_poly(Raul::Maid& maid, uint32_t poly) = 0;
+
protected:
- GraphObjectImpl(GraphObjectImpl* parent, const Raul::Symbol& symbol, bool polyphonic=false);
+ GraphObjectImpl(GraphObjectImpl* parent, const Raul::Symbol& symbol);
GraphObjectImpl* _parent;
Raul::Path _path;
Raul::Symbol _symbol;
ResourceImpl _meta;
- bool _polyphonic;
};