summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-02 01:22:20 +0000
committerDavid Robillard <d@drobilla.net>2010-02-02 01:22:20 +0000
commitc1ac1f31457708db618143f54a3dfef7eb3361aa (patch)
tree88c91e75f4a90cf6efab9ab6f8219d53dd5b892f /src/client
parent6e8877ee110b774caef800adbe35b21338b3372f (diff)
downloadingen-c1ac1f31457708db618143f54a3dfef7eb3361aa.tar.gz
ingen-c1ac1f31457708db618143f54a3dfef7eb3361aa.tar.bz2
ingen-c1ac1f31457708db618143f54a3dfef7eb3361aa.zip
Remove set_port_value from CommonInterface (replaced with set_property(path, "ingen:value", value)).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2404 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r--src/client/ClientStore.cpp12
-rw-r--r--src/client/ClientStore.hpp1
-rw-r--r--src/client/DeprecatedLoader.cpp3
-rw-r--r--src/client/HTTPEngineSender.cpp7
-rw-r--r--src/client/HTTPEngineSender.hpp3
-rw-r--r--src/client/OSCClientReceiver.cpp13
-rw-r--r--src/client/OSCClientReceiver.hpp1
-rw-r--r--src/client/OSCEngineSender.cpp14
-rw-r--r--src/client/OSCEngineSender.hpp3
-rw-r--r--src/client/PluginUI.cpp6
-rw-r--r--src/client/PortModel.hpp8
-rw-r--r--src/client/SigClientInterface.hpp3
-rw-r--r--src/client/ThreadedSigClientInterface.hpp3
13 files changed, 13 insertions, 64 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp
index 40c11323..762bb2e6 100644
--- a/src/client/ClientStore.cpp
+++ b/src/client/ClientStore.cpp
@@ -51,7 +51,6 @@ ClientStore::ClientStore(SharedPtr<EngineInterface> engine, SharedPtr<SigClientI
emitter->signal_connection.connect(sigc::mem_fun(this, &ClientStore::connect));
emitter->signal_disconnection.connect(sigc::mem_fun(this, &ClientStore::disconnect));
emitter->signal_property_change.connect(sigc::mem_fun(this, &ClientStore::set_property));
- emitter->signal_port_value.connect(sigc::mem_fun(this, &ClientStore::set_port_value));
emitter->signal_voice_value.connect(sigc::mem_fun(this, &ClientStore::set_voice_value));
emitter->signal_activity.connect(sigc::mem_fun(this, &ClientStore::activity));
emitter->signal_binding.connect(sigc::mem_fun(this, &ClientStore::binding));
@@ -353,17 +352,6 @@ ClientStore::set_property(const URI& subject_uri, const URI& predicate, const At
void
-ClientStore::set_port_value(const Path& port_path, const Atom& value)
-{
- SharedPtr<PortModel> port = PtrCast<PortModel>(object(port_path));
- if (port)
- port->value(value);
- else
- LOG(error) << "Control change for non-existent port " << port_path << endl;
-}
-
-
-void
ClientStore::set_voice_value(const Path& port_path, uint32_t voice, const Atom& value)
{
SharedPtr<PortModel> port = PtrCast<PortModel>(object(port_path));
diff --git a/src/client/ClientStore.hpp b/src/client/ClientStore.hpp
index 1421ca13..309e7795 100644
--- a/src/client/ClientStore.hpp
+++ b/src/client/ClientStore.hpp
@@ -71,7 +71,6 @@ public:
void put(const Raul::URI& path, const Shared::Resource::Properties& properties);
void move(const Raul::Path& old_path, const Raul::Path& new_path);
void set_property(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value);
- void set_port_value(const Raul::Path& port_path, const Raul::Atom& value);
void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value);
void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path);
void disconnect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path);
diff --git a/src/client/DeprecatedLoader.cpp b/src/client/DeprecatedLoader.cpp
index 32dd8059..9af1a781 100644
--- a/src/client/DeprecatedLoader.cpp
+++ b/src/client/DeprecatedLoader.cpp
@@ -339,7 +339,8 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename,
list<ControlModel>::const_iterator i = pm->controls().begin();
for ( ; i != pm->controls().end(); ++i) {
const float value = i->value();
- _engine->set_port_value(translate_load_path(i->port_path().str()), Atom(value));
+ _engine->set_property(translate_load_path(i->port_path().str()),
+ "ingen:value", Atom(value));
}
} else {
LOG(warn) << "Unknown preset `" << pm->name() << "'" << endl;
diff --git a/src/client/HTTPEngineSender.cpp b/src/client/HTTPEngineSender.cpp
index ece89ca0..91c8d76c 100644
--- a/src/client/HTTPEngineSender.cpp
+++ b/src/client/HTTPEngineSender.cpp
@@ -178,13 +178,6 @@ HTTPEngineSender::disconnect_all(const Path& parent_patch_path,
void
-HTTPEngineSender::set_port_value(const Path& port_path,
- const Atom& value)
-{
-}
-
-
-void
HTTPEngineSender::set_voice_value(const Path& port_path,
uint32_t voice,
const Atom& value)
diff --git a/src/client/HTTPEngineSender.hpp b/src/client/HTTPEngineSender.hpp
index 9d84fc2e..dc0a24c7 100644
--- a/src/client/HTTPEngineSender.hpp
+++ b/src/client/HTTPEngineSender.hpp
@@ -101,9 +101,6 @@ public:
const Raul::URI& predicate,
const Raul::Atom& value);
- virtual void set_port_value(const Raul::Path& port_path,
- const Raul::Atom& value);
-
virtual void set_voice_value(const Raul::Path& port_path,
uint32_t voice,
const Raul::Atom& value);
diff --git a/src/client/OSCClientReceiver.cpp b/src/client/OSCClientReceiver.cpp
index 09687f2c..faccef15 100644
--- a/src/client/OSCClientReceiver.cpp
+++ b/src/client/OSCClientReceiver.cpp
@@ -150,7 +150,6 @@ OSCClientReceiver::setup_callbacks()
lo_server_thread_add_method(_st, "/ingen/disconnection", "ss", disconnection_cb, this);
lo_server_thread_add_method(_st, "/ingen/new_port", "sisi", new_port_cb, this);
lo_server_thread_add_method(_st, "/ingen/set_property", NULL, set_property_cb, this);
- lo_server_thread_add_method(_st, "/ingen/set_port_value", "sf", set_port_value_cb, this);
lo_server_thread_add_method(_st, "/ingen/set_voice_value", "sif", set_voice_value_cb, this);
lo_server_thread_add_method(_st, "/ingen/activity", "s", activity_cb, this);
}
@@ -238,18 +237,6 @@ OSCClientReceiver::_set_property_cb(const char* path, const char* types, lo_arg*
int
-OSCClientReceiver::_set_port_value_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg)
-{
- const char* const port_path = &argv[0]->s;
- const float value = argv[1]->f;
-
- _target->set_port_value(port_path, value);
-
- return 0;
-}
-
-
-int
OSCClientReceiver::_set_voice_value_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg)
{
const char* const port_path = &argv[0]->s;
diff --git a/src/client/OSCClientReceiver.hpp b/src/client/OSCClientReceiver.hpp
index cd955363..8f191f9c 100644
--- a/src/client/OSCClientReceiver.hpp
+++ b/src/client/OSCClientReceiver.hpp
@@ -92,7 +92,6 @@ private:
LO_HANDLER(new_port);
LO_HANDLER(put);
LO_HANDLER(set_property);
- LO_HANDLER(set_port_value);
LO_HANDLER(set_voice_value);
LO_HANDLER(activity);
};
diff --git a/src/client/OSCEngineSender.cpp b/src/client/OSCEngineSender.cpp
index e7fc4078..150f8020 100644
--- a/src/client/OSCEngineSender.cpp
+++ b/src/client/OSCEngineSender.cpp
@@ -208,20 +208,6 @@ OSCEngineSender::disconnect_all(const Path& parent_patch_path,
void
-OSCEngineSender::set_port_value(const Path& port_path,
- const Atom& value)
-{
- lo_message m = lo_message_new();
- lo_message_add_int32(m, next_id());
- lo_message_add_string(m, port_path.c_str());
- if (value.type() == Atom::BLOB)
- lo_message_add_string(m, value.get_blob_type());
- Raul::AtomLiblo::lo_message_add_atom(m, value);
- send_message("/ingen/set_port_value", m);
-}
-
-
-void
OSCEngineSender::set_voice_value(const Path& port_path,
uint32_t voice,
const Atom& value)
diff --git a/src/client/OSCEngineSender.hpp b/src/client/OSCEngineSender.hpp
index 04075e39..e3d76b01 100644
--- a/src/client/OSCEngineSender.hpp
+++ b/src/client/OSCEngineSender.hpp
@@ -98,9 +98,6 @@ public:
const Raul::URI& predicate,
const Raul::Atom& value);
- virtual void set_port_value(const Raul::Path& port_path,
- const Raul::Atom& value);
-
virtual void set_voice_value(const Raul::Path& port_path,
uint32_t voice,
const Raul::Atom& value);
diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp
index f9882be1..4c8016fd 100644
--- a/src/client/PluginUI.cpp
+++ b/src/client/PluginUI.cpp
@@ -64,7 +64,7 @@ lv2_ui_write(LV2UI_Controller controller,
if (*(float*)buffer == port->value().get_float())
return; // do nothing (handle stupid plugin UIs that feed back)
- ui->world()->engine->set_port_value(port->path(), Atom(*(float*)buffer));
+ ui->world()->engine->set_property(port->path(), "ingen:value", Atom(*(float*)buffer));
} else if (format == map->ui_format_events) {
LV2_Event_Buffer* buf = (LV2_Event_Buffer*)buffer;
@@ -75,7 +75,7 @@ lv2_ui_write(LV2UI_Controller controller,
LV2_Event* const ev = lv2_event_get(&iter, &data);
if (ev->type == map->midi_event) {
// FIXME: bundle multiple events by writing an entire buffer here
- ui->world()->engine->set_port_value(port->path(),
+ ui->world()->engine->set_property(port->path(), "ingen:value",
Atom("lv2midi:MidiEvent", ev->size, data));
} else {
warn << "Unable to send event type " << ev->type <<
@@ -89,7 +89,7 @@ lv2_ui_write(LV2UI_Controller controller,
LV2_Object* buf = (LV2_Object*)buffer;
Raul::Atom val;
Shared::LV2Object::to_atom(ui->world(), buf, val);
- ui->world()->engine->set_port_value(port->path(), val);
+ ui->world()->engine->set_property(port->path(), "ingen:value", val);
} else {
warn << "Unknown value format " << format
diff --git a/src/client/PortModel.hpp b/src/client/PortModel.hpp
index 8cf0dccb..58f3262e 100644
--- a/src/client/PortModel.hpp
+++ b/src/client/PortModel.hpp
@@ -59,6 +59,14 @@ public:
inline bool operator==(const PortModel& pm) const { return (_path == pm._path); }
+ Raul::Atom& set_property(const Raul::URI& uri,
+ const Raul::Atom& value) {
+ Raul::Atom& ret = ObjectModel::set_property(uri, value);
+ if (uri.str() == "ingen:value")
+ this->value(value);
+ return ret;
+ }
+
inline void value(const Raul::Atom& val) {
if (val != _current_val) {
_current_val = val;
diff --git a/src/client/SigClientInterface.hpp b/src/client/SigClientInterface.hpp
index f3f572ad..382813d3 100644
--- a/src/client/SigClientInterface.hpp
+++ b/src/client/SigClientInterface.hpp
@@ -107,9 +107,6 @@ protected:
void set_property(const Raul::URI& subject, const Raul::URI& key, const Raul::Atom& value)
{ EMIT(property_change, subject, key, value); }
- void set_port_value(const Raul::Path& port_path, const Raul::Atom& value)
- { EMIT(port_value, port_path, value); }
-
void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value)
{ EMIT(voice_value, port_path, voice, value); }
diff --git a/src/client/ThreadedSigClientInterface.hpp b/src/client/ThreadedSigClientInterface.hpp
index e0065fab..16eb98c3 100644
--- a/src/client/ThreadedSigClientInterface.hpp
+++ b/src/client/ThreadedSigClientInterface.hpp
@@ -103,9 +103,6 @@ public:
void set_property(const Raul::URI& subject, const Raul::URI& key, const Raul::Atom& value)
{ push_sig(sigc::bind(property_change_slot, subject, key, value)); }
- void set_port_value(const Raul::Path& port_path, const Raul::Atom& value)
- { push_sig(sigc::bind(port_value_slot, port_path, value)); }
-
void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value)
{ push_sig(sigc::bind(voice_value_slot, port_path, voice, value)); }