summaryrefslogtreecommitdiffstats
path: root/src/gui/NodeModule.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-09-18 21:36:48 -0400
committerDavid Robillard <d@drobilla.net>2016-09-18 21:40:46 -0400
commitbb64f80bb139314a06e0b22fddbea7a330b6e149 (patch)
tree51e78a387bc8f1df6ecff3c1799ae7f0dc3f2bdc /src/gui/NodeModule.cpp
parent01deca45d8aa5fbfff75e204cd248a9dd79ab041 (diff)
downloadingen-bb64f80bb139314a06e0b22fddbea7a330b6e149.tar.gz
ingen-bb64f80bb139314a06e0b22fddbea7a330b6e149.tar.bz2
ingen-bb64f80bb139314a06e0b22fddbea7a330b6e149.zip
Preliminary parameter support workparameters
Diffstat (limited to 'src/gui/NodeModule.cpp')
-rw-r--r--src/gui/NodeModule.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index 746083fb..5914fd2e 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -35,6 +35,7 @@
#include "GraphWindow.hpp"
#include "NodeMenu.hpp"
#include "NodeModule.hpp"
+#include "Parameter.hpp"
#include "Port.hpp"
#include "RenameWindow.hpp"
#include "Style.hpp"
@@ -60,6 +61,8 @@ NodeModule::NodeModule(GraphCanvas& canvas,
{
block->signal_new_port().connect(
sigc::mem_fun(this, &NodeModule::new_port_view));
+ block->signal_new_parameter().connect(
+ sigc::mem_fun(this, &NodeModule::new_parameter_view));
block->signal_removed_port().connect(
sigc::hide_return(sigc::mem_fun(this, &NodeModule::delete_port_view)));
block->signal_property().connect(
@@ -124,6 +127,9 @@ NodeModule::create(GraphCanvas& canvas,
for (const auto& p : block->ports())
ret->new_port_view(p);
+ for (const auto& p : block->parameters())
+ ret->new_parameter_view(p);
+
ret->set_stacked(block->polyphonic());
if (human)
@@ -205,8 +211,12 @@ NodeModule::port_value_changed(uint32_t index, const Atom& value)
void
NodeModule::plugin_changed()
{
- for (iterator p = begin(); p != end(); ++p)
- dynamic_cast<Ingen::GUI::Port*>(*p)->update_metadata();
+ for (iterator p = begin(); p != end(); ++p) {
+ Ingen::GUI::Port* port = dynamic_cast<Ingen::GUI::Port*>(*p);
+ if (port) {
+ port->update_metadata();
+ }
+ }
}
void
@@ -308,6 +318,22 @@ NodeModule::delete_port_view(SPtr<const PortModel> model)
}
}
+void
+NodeModule::new_parameter_view(SPtr<const ParameterModel> parameter)
+{
+ fprintf(stderr, "New parameter!\n");
+
+ Parameter::create(app(), *this, parameter);
+
+ // parameter->signal_value_changed().connect(
+ // sigc::bind<0>(sigc::mem_fun(this, &NodeModule::parameter_value_changed),
+ // parameter->index()));
+
+ // parameter->signal_activity().connect(
+ // sigc::bind<0>(sigc::mem_fun(this, &NodeModule::parameter_activity),
+ // parameter->index()));
+}
+
bool
NodeModule::popup_gui()
{