summaryrefslogtreecommitdiffstats
path: root/src/libs/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-07-28 22:50:37 +0000
committerDavid Robillard <d@drobilla.net>2007-07-28 22:50:37 +0000
commit26e10071914fe3ba3e2f168df85b2935884b44b7 (patch)
tree422dfe359fbfb27763aa5dd3a8f78d916dda6221 /src/libs/client
parent7dd171d955067c947168db2ca88f40d60aa5abbb (diff)
downloadingen-26e10071914fe3ba3e2f168df85b2935884b44b7.tar.gz
ingen-26e10071914fe3ba3e2f168df85b2935884b44b7.tar.bz2
ingen-26e10071914fe3ba3e2f168df85b2935884b44b7.zip
Remove (now) generated LV2 stuff Makefiles from repo.
Fix various port range/value/sync problems with the new sliders (fix tickets 64, 65). git-svn-id: http://svn.drobilla.net/lad/ingen@649 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client')
-rw-r--r--src/libs/client/NodeModel.cpp32
-rw-r--r--src/libs/client/NodeModel.hpp2
2 files changed, 22 insertions, 12 deletions
diff --git a/src/libs/client/NodeModel.cpp b/src/libs/client/NodeModel.cpp
index 76faa158..a910d67e 100644
--- a/src/libs/client/NodeModel.cpp
+++ b/src/libs/client/NodeModel.cpp
@@ -135,7 +135,7 @@ NodeModel::get_port(const string& port_name) const
void
NodeModel::add_program(int bank, int program, const string& name)
{
- _banks[bank][program] = name;
+ _banks[bank][program] = name;
}
@@ -149,28 +149,38 @@ NodeModel::remove_program(int bank, int program)
void
-NodeModel::port_value_range(const string& name, float& min, float& max)
+NodeModel::port_value_range(SharedPtr<PortModel> port, float& min, float& max)
{
- // FIXME: cache these values
- const Atom& min_atom = get_metadata("ingen:minimum");
- const Atom& max_atom = get_metadata("ingen:maximum");
- if (min_atom.type() == Atom::FLOAT)
- min = min_atom.get_float();
- if (max_atom.type() == Atom::FLOAT)
- max = max_atom.get_float();
+ assert(port->parent().get() == this);
+ // FIXME: cache these values
+
+ // Plugin value first
#ifdef HAVE_SLV2
if (plugin() && plugin()->type() == PluginModel::LV2) {
min = slv2_port_get_minimum_value(
plugin()->slv2_plugin(),
slv2_plugin_get_port_by_symbol(plugin()->slv2_plugin(),
- name.c_str()));
+ port->path().name().c_str()));
max = slv2_port_get_maximum_value(
plugin()->slv2_plugin(),
slv2_plugin_get_port_by_symbol(plugin()->slv2_plugin(),
- name.c_str()));
+ port->path().name().c_str()));
+
+ //cerr << "SLV2: " << min << " .. " << max << endl;
}
#endif
+
+ // Possibly overriden
+ const Atom& min_atom = port->get_metadata("ingen:minimum");
+ const Atom& max_atom = port->get_metadata("ingen:maximum");
+ if (min_atom.type() == Atom::FLOAT)
+ min = min_atom.get_float();
+ if (max_atom.type() == Atom::FLOAT)
+ max = max_atom.get_float();
+
+ //cerr << (unsigned)plugin()->type() << "::" << _path << ".port_value_range(" << port->path().name()
+ // << ") == " << min << " .. " << max << endl;
}
diff --git a/src/libs/client/NodeModel.hpp b/src/libs/client/NodeModel.hpp
index 05a92d7c..fe7faa0a 100644
--- a/src/libs/client/NodeModel.hpp
+++ b/src/libs/client/NodeModel.hpp
@@ -58,7 +58,7 @@ public:
const PortModelList& ports() const { return _ports; }
virtual bool polyphonic() const { return _polyphonic; }
- void port_value_range(const string& name, float& min, float& max);
+ void port_value_range(SharedPtr<PortModel> port, float& min, float& max);
// Signals
sigc::signal<void, SharedPtr<PortModel> > new_port_sig;