summaryrefslogtreecommitdiffstats
path: root/src/libs/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-07-27 05:43:45 +0000
committerDavid Robillard <d@drobilla.net>2007-07-27 05:43:45 +0000
commitbb1f9e95381a75951f6f4948de986553c16dace4 (patch)
treed9daadb012ca354932ccdf8c9b7035466a4319ee /src/libs/client
parent25b610f12b8e46b48e8eda252d029da211ec6ad5 (diff)
downloadingen-bb1f9e95381a75951f6f4948de986553c16dace4.tar.gz
ingen-bb1f9e95381a75951f6f4948de986553c16dace4.tar.bz2
ingen-bb1f9e95381a75951f6f4948de986553c16dace4.zip
Track control values for port 'sliders' (module sliders move in sync with node control window sliders or whatever else).
git-svn-id: http://svn.drobilla.net/lad/ingen@646 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client')
-rw-r--r--src/libs/client/NodeModel.cpp29
-rw-r--r--src/libs/client/NodeModel.hpp2
-rw-r--r--src/libs/client/PortModel.cpp3
3 files changed, 32 insertions, 2 deletions
diff --git a/src/libs/client/NodeModel.cpp b/src/libs/client/NodeModel.cpp
index 4e3a0a11..76faa158 100644
--- a/src/libs/client/NodeModel.cpp
+++ b/src/libs/client/NodeModel.cpp
@@ -15,6 +15,8 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "../../../config/config.h"
+
#include "NodeModel.hpp"
#include "PatchModel.hpp"
#include <cassert>
@@ -146,5 +148,32 @@ NodeModel::remove_program(int bank, int program)
}
+void
+NodeModel::port_value_range(const string& name, 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();
+
+#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()));
+ max = slv2_port_get_maximum_value(
+ plugin()->slv2_plugin(),
+ slv2_plugin_get_port_by_symbol(plugin()->slv2_plugin(),
+ name.c_str()));
+ }
+#endif
+}
+
+
+
} // namespace Client
} // namespace Ingen
diff --git a/src/libs/client/NodeModel.hpp b/src/libs/client/NodeModel.hpp
index fcaacd0e..05a92d7c 100644
--- a/src/libs/client/NodeModel.hpp
+++ b/src/libs/client/NodeModel.hpp
@@ -58,6 +58,8 @@ public:
const PortModelList& ports() const { return _ports; }
virtual bool polyphonic() const { return _polyphonic; }
+ void port_value_range(const string& name, float& min, float& max);
+
// Signals
sigc::signal<void, SharedPtr<PortModel> > new_port_sig;
sigc::signal<void, SharedPtr<PortModel> > removed_port_sig;
diff --git a/src/libs/client/PortModel.cpp b/src/libs/client/PortModel.cpp
index af80e250..ed59c8ca 100644
--- a/src/libs/client/PortModel.cpp
+++ b/src/libs/client/PortModel.cpp
@@ -16,6 +16,7 @@
*/
#include "PortModel.hpp"
+#include "NodeModel.hpp"
namespace Ingen {
namespace Client {
@@ -44,7 +45,5 @@ PortModel::is_toggle() const
return (hint && hint > 0);
}
-
-
} // namespace Client
} // namespace Ingen