summaryrefslogtreecommitdiffstats
path: root/src/libs/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-05-20 00:30:50 +0000
committerDavid Robillard <d@drobilla.net>2008-05-20 00:30:50 +0000
commit1c746982c4d1b18308ce549852d8ecd83d612db5 (patch)
treeaca8ac8b6a6e3937277efc1c0961c29a1c84bbc2 /src/libs/client
parent239825b92b1d4c79ebd67cb3766355bf8e699bc7 (diff)
downloadingen-1c746982c4d1b18308ce549852d8ecd83d612db5.tar.gz
ingen-1c746982c4d1b18308ce549852d8ecd83d612db5.tar.bz2
ingen-1c746982c4d1b18308ce549852d8ecd83d612db5.zip
Fix various problems with control port values.
Fix control port feedback issues with LV2 plugin UIs. git-svn-id: http://svn.drobilla.net/lad/ingen@1218 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client')
-rw-r--r--src/libs/client/DeprecatedLoader.cpp2
-rw-r--r--src/libs/client/OSCClientReceiver.cpp2
-rw-r--r--src/libs/client/ObjectModel.cpp1
-rw-r--r--src/libs/client/PluginUI.cpp19
-rw-r--r--src/libs/client/PortModel.cpp6
-rw-r--r--src/libs/client/Store.cpp2
6 files changed, 21 insertions, 11 deletions
diff --git a/src/libs/client/DeprecatedLoader.cpp b/src/libs/client/DeprecatedLoader.cpp
index 68f7941d..4897137c 100644
--- a/src/libs/client/DeprecatedLoader.cpp
+++ b/src/libs/client/DeprecatedLoader.cpp
@@ -160,7 +160,7 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename,
/* Use parameter overridden polyphony, if given */
GraphObject::Variables::iterator poly_param = initial_data.find("ingen:polyphony");
if (poly_param != initial_data.end() && poly_param->second.type() == Atom::INT)
- poly = poly_param->second;
+ poly = poly_param->second.get_int32();
if (initial_data.find("filename") == initial_data.end())
initial_data["filename"] = Atom(filename.c_str()); // FIXME: URL?
diff --git a/src/libs/client/OSCClientReceiver.cpp b/src/libs/client/OSCClientReceiver.cpp
index 04b83d61..6002ca59 100644
--- a/src/libs/client/OSCClientReceiver.cpp
+++ b/src/libs/client/OSCClientReceiver.cpp
@@ -35,7 +35,7 @@ OSCClientReceiver::OSCClientReceiver(int listen_port)
_listen_port(listen_port),
_st(NULL)
{
- start(true); // true = dump, false = shutup
+ start(false); // true = dump, false = shutup
}
diff --git a/src/libs/client/ObjectModel.cpp b/src/libs/client/ObjectModel.cpp
index 1d22c8eb..b951bc6b 100644
--- a/src/libs/client/ObjectModel.cpp
+++ b/src/libs/client/ObjectModel.cpp
@@ -124,7 +124,6 @@ ObjectModel::set(SharedPtr<ObjectModel> model)
if (mine != _variables.end()) {
cerr << "WARNING: " << _path << "Client/Server data mismatch: " << other->first << endl;
- cerr << "Setting server value " << other->second;
}
_variables[other->first] = other->second;
diff --git a/src/libs/client/PluginUI.cpp b/src/libs/client/PluginUI.cpp
index 5215de25..9dcbfcba 100644
--- a/src/libs/client/PluginUI.cpp
+++ b/src/libs/client/PluginUI.cpp
@@ -16,12 +16,14 @@
*/
#include <iostream>
+#include "shared/LV2URIMap.hpp"
#include "PluginUI.hpp"
#include "NodeModel.hpp"
#include "PortModel.hpp"
using namespace std;
using Ingen::Shared::EngineInterface;
+using Ingen::Shared::LV2URIMap;
namespace Ingen {
namespace Client {
@@ -33,6 +35,7 @@ lv2_ui_write(LV2UI_Controller controller,
uint32_t format,
const void* buffer)
{
+#if 0
cerr << "********* LV2 UI WRITE (FORMAT " << format << "):" << endl;
/*lv2_osc_message_print((const LV2Message*)buffer);*/
@@ -45,16 +48,24 @@ lv2_ui_write(LV2UI_Controller controller,
fprintf(stderr, "%2X ", ((unsigned char*)buffer)[i]);
}
fprintf(stderr, "\n");
+#endif
PluginUI* ui = (PluginUI*)controller;
SharedPtr<PortModel> port = ui->node()->ports()[port_index];
- if (format == 0) {
- ui->world()->engine->set_port_value_immediate(port->path(),
- port->type().uri(),
- buffer_size, buffer);
+ LV2URIMap* map = (LV2URIMap*)ui->world()->lv2_features->feature(LV2_URI_MAP_URI);
+ assert(map);
+
+ if (format == 0) { // float (special case)
+ assert(buffer_size == 4);
+ if (*(float*)buffer == port->value().get_float())
+ return; // do nothing (handle stupid plugin UIs that feed back)
}
+
+ ui->world()->engine->set_port_value_immediate(port->path(),
+ port->type().uri(),
+ buffer_size, buffer);
}
diff --git a/src/libs/client/PortModel.cpp b/src/libs/client/PortModel.cpp
index 6b727747..ecf1070b 100644
--- a/src/libs/client/PortModel.cpp
+++ b/src/libs/client/PortModel.cpp
@@ -26,7 +26,7 @@ bool
PortModel::is_logarithmic() const
{
const Atom& hint = get_variable("ingen:logarithmic");
- return (hint && hint > 0);
+ return (hint.is_valid() && hint.get_bool() > 0);
}
@@ -34,7 +34,7 @@ bool
PortModel::is_integer() const
{
const Atom& hint = get_variable("ingen:integer");
- return (hint && hint > 0);
+ return (hint.is_valid() && hint.get_bool() > 0);
}
@@ -42,7 +42,7 @@ bool
PortModel::is_toggle() const
{
const Atom& hint = get_variable("ingen:toggled");
- return (hint && hint > 0);
+ return (hint.is_valid() && hint.get_bool() > 0);
}
} // namespace Client
diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp
index b679b01a..1eea354a 100644
--- a/src/libs/client/Store.cpp
+++ b/src/libs/client/Store.cpp
@@ -511,7 +511,7 @@ Store::variable_change_event(const Path& subject_path, const string& predicate,
{
SharedPtr<ObjectModel> subject = object(subject_path);
- if (!value) {
+ if (!value.is_valid()) {
cerr << "ERROR: variable '" << predicate << "' has no type" << endl;
} else if (subject) {
subject->set_variable(predicate, value);