summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-04-29 06:26:57 +0000
committerDavid Robillard <d@drobilla.net>2007-04-29 06:26:57 +0000
commita74b55b40612a63b0be4964e626497fa24c55305 (patch)
tree78e5f4063430b89363696500b13e543bd162bb57 /src/libs
parent67fff73eaa9c78cfbae53ac1948f38fe3812c77f (diff)
downloadingen-a74b55b40612a63b0be4964e626497fa24c55305.tar.gz
ingen-a74b55b40612a63b0be4964e626497fa24c55305.tar.bz2
ingen-a74b55b40612a63b0be4964e626497fa24c55305.zip
Fixed incomplete transfer of loaded plugins to client, bundle transfer.
git-svn-id: http://svn.drobilla.net/lad/ingen@482 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/client/Store.cpp1
-rw-r--r--src/libs/engine/NodeFactory.cpp2
-rw-r--r--src/libs/engine/OSCClientSender.cpp30
3 files changed, 25 insertions, 8 deletions
diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp
index fa9707d1..5a989c3c 100644
--- a/src/libs/client/Store.cpp
+++ b/src/libs/client/Store.cpp
@@ -325,6 +325,7 @@ Store::add_plugin(SharedPtr<PluginModel> pm)
// FIXME: dupes? merge, like with objects?
_plugins[pm->uri()] = pm;
+ //cerr << "Plugin: " << pm->uri() << ", # plugins: " << _plugins.size() << endl;
}
diff --git a/src/libs/engine/NodeFactory.cpp b/src/libs/engine/NodeFactory.cpp
index 8386667b..151e3c6c 100644
--- a/src/libs/engine/NodeFactory.cpp
+++ b/src/libs/engine/NodeFactory.cpp
@@ -155,6 +155,8 @@ NodeFactory::load_plugins()
_has_loaded = true;
}
+
+ //cerr << "[NodeFactory] # Plugins: " << _plugins.size() << endl;
}
diff --git a/src/libs/engine/OSCClientSender.cpp b/src/libs/engine/OSCClientSender.cpp
index e8eb9d05..7126c67b 100644
--- a/src/libs/engine/OSCClientSender.cpp
+++ b/src/libs/engine/OSCClientSender.cpp
@@ -38,30 +38,32 @@ namespace Ingen {
void
OSCClientSender::bundle_begin()
{
- // FIXME
+ // FIXME: Don't split bundles as for 'transfers'
+ _transfer = lo_bundle_new(LO_TT_IMMEDIATE);
}
void
OSCClientSender::bundle_end()
{
- // FIXME
+ // FIXME: Don't split bundles as for 'transfers'
+ transfer_end();
}
void
OSCClientSender::transfer_begin()
{
- //_transfer = lo_bundle_new(LO_TT_IMMEDIATE);
+ _transfer = lo_bundle_new(LO_TT_IMMEDIATE);
}
void
OSCClientSender::transfer_end()
{
- /*assert(_transfer);
+ assert(_transfer);
lo_send_bundle(_address, _transfer);
lo_bundle_free(_transfer);
- _transfer = NULL;*/
+ _transfer = NULL;
}
@@ -504,15 +506,27 @@ OSCClientSender::new_plugin(string uri, string type_uri, string name)
if (!_enabled)
return;
+ // FIXME: size? liblo doesn't export this.
+ // don't want to exceed max UDP packet size
+ static const size_t MAX_BUNDLE_SIZE = 32768; // FIXME: best value?
+
lo_message m = lo_message_new();
lo_message_add_string(m, uri.c_str());
lo_message_add_string(m, type_uri.c_str());
lo_message_add_string(m, name.c_str());
+
+ if (_transfer) {
+
+ if (lo_bundle_length(_transfer) + lo_message_length(m, "/ingen/plugin")
+ > MAX_BUNDLE_SIZE) {
+ lo_send_bundle(_address, _transfer);
+ _transfer = lo_bundle_new(LO_TT_IMMEDIATE);
+ }
+ lo_bundle_add_message(_transfer, "/ingen/plugin", m);
- //if (_transfer)
- // lo_bundle_add_message(_transfer, "/ingen/plugin", m);
- //else
+ } else {
lo_send_message(_address, "/ingen/plugin", m);
+ }
}