summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-07-24 21:23:22 +0000
committerDavid Robillard <d@drobilla.net>2007-07-24 21:23:22 +0000
commitbac31a50f17608c514afce5ad014316cccde3d5a (patch)
treede4ec623cc5099e3de4b9b5a1883b51694fe6bf9 /src/libs/engine/events
parentbb1c49dfa484db080938cff6f8f70167c9026a1c (diff)
downloadingen-bac31a50f17608c514afce5ad014316cccde3d5a.tar.gz
ingen-bac31a50f17608c514afce5ad014316cccde3d5a.tar.bz2
ingen-bac31a50f17608c514afce5ad014316cccde3d5a.zip
Scrapped ClientKey in favour of a URI string (towards a simpler closer-to-straight-C engine interface).
Fixed client deregistration. Added metadata value requesting. git-svn-id: http://svn.drobilla.net/lad/ingen@614 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r--src/libs/engine/events/RegisterClientEvent.cpp17
-rw-r--r--src/libs/engine/events/RegisterClientEvent.hpp6
-rw-r--r--src/libs/engine/events/RequestAllObjectsEvent.cpp2
-rw-r--r--src/libs/engine/events/RequestMetadataEvent.cpp2
-rw-r--r--src/libs/engine/events/RequestObjectEvent.cpp2
-rw-r--r--src/libs/engine/events/RequestPluginEvent.cpp2
-rw-r--r--src/libs/engine/events/RequestPluginsEvent.cpp2
-rw-r--r--src/libs/engine/events/RequestPortValueEvent.cpp2
-rw-r--r--src/libs/engine/events/UnregisterClientEvent.cpp6
-rw-r--r--src/libs/engine/events/UnregisterClientEvent.hpp7
10 files changed, 22 insertions, 26 deletions
diff --git a/src/libs/engine/events/RegisterClientEvent.cpp b/src/libs/engine/events/RegisterClientEvent.cpp
index ace2b3e0..ac2dbbc3 100644
--- a/src/libs/engine/events/RegisterClientEvent.cpp
+++ b/src/libs/engine/events/RegisterClientEvent.cpp
@@ -23,13 +23,14 @@
namespace Ingen {
-RegisterClientEvent::RegisterClientEvent(Engine& engine, SharedPtr<Shared::Responder> responder,
- SampleCount timestamp,
- ClientKey key,
- SharedPtr<ClientInterface> client)
-: QueuedEvent(engine, responder, timestamp)
-, _key(key)
-, _client(client)
+RegisterClientEvent::RegisterClientEvent(Engine& engine,
+ SharedPtr<Shared::Responder> responder,
+ SampleCount timestamp,
+ const string& uri,
+ SharedPtr<ClientInterface> client)
+ : QueuedEvent(engine, responder, timestamp)
+ , _uri(uri)
+ , _client(client)
{
}
@@ -37,7 +38,7 @@ RegisterClientEvent::RegisterClientEvent(Engine& engine, SharedPtr<Shared::Respo
void
RegisterClientEvent::pre_process()
{
- _engine.broadcaster()->register_client(_key, _client);
+ _engine.broadcaster()->register_client(_uri, _client);
QueuedEvent::pre_process();
}
diff --git a/src/libs/engine/events/RegisterClientEvent.hpp b/src/libs/engine/events/RegisterClientEvent.hpp
index be02fd41..90528956 100644
--- a/src/libs/engine/events/RegisterClientEvent.hpp
+++ b/src/libs/engine/events/RegisterClientEvent.hpp
@@ -19,12 +19,10 @@
#define REGISTERCLIENTEVENT_H
#include "QueuedEvent.hpp"
-#include "interface/ClientKey.hpp"
#include "interface/ClientInterface.hpp"
#include <string>
using std::string;
using Ingen::Shared::ClientInterface;
-using Ingen::Shared::ClientKey;
using Ingen::Shared::Responder;
namespace Ingen {
@@ -40,14 +38,14 @@ public:
RegisterClientEvent(Engine& engine,
SharedPtr<Shared::Responder> responder,
SampleCount timestamp,
- ClientKey key,
+ const string& uri,
SharedPtr<ClientInterface> client);
void pre_process();
void post_process();
private:
- ClientKey _key;
+ string _uri;
SharedPtr<ClientInterface> _client;
};
diff --git a/src/libs/engine/events/RequestAllObjectsEvent.cpp b/src/libs/engine/events/RequestAllObjectsEvent.cpp
index a6940442..4b068536 100644
--- a/src/libs/engine/events/RequestAllObjectsEvent.cpp
+++ b/src/libs/engine/events/RequestAllObjectsEvent.cpp
@@ -34,7 +34,7 @@ RequestAllObjectsEvent::RequestAllObjectsEvent(Engine& engine, SharedPtr<Shared:
void
RequestAllObjectsEvent::pre_process()
{
- _client = _engine.broadcaster()->client(_responder->client_key());
+ _client = _engine.broadcaster()->client(_responder->client_uri());
QueuedEvent::pre_process();
}
diff --git a/src/libs/engine/events/RequestMetadataEvent.cpp b/src/libs/engine/events/RequestMetadataEvent.cpp
index 5000256f..b9696c4a 100644
--- a/src/libs/engine/events/RequestMetadataEvent.cpp
+++ b/src/libs/engine/events/RequestMetadataEvent.cpp
@@ -41,7 +41,7 @@ RequestMetadataEvent::RequestMetadataEvent(Engine& engine, SharedPtr<Shared::Res
void
RequestMetadataEvent::pre_process()
{
- _client = _engine.broadcaster()->client(_responder->client_key());
+ _client = _engine.broadcaster()->client(_responder->client_uri());
if (_client) {
_object = _engine.object_store()->find(_path);
diff --git a/src/libs/engine/events/RequestObjectEvent.cpp b/src/libs/engine/events/RequestObjectEvent.cpp
index 25f95d00..8efe37b7 100644
--- a/src/libs/engine/events/RequestObjectEvent.cpp
+++ b/src/libs/engine/events/RequestObjectEvent.cpp
@@ -43,7 +43,7 @@ RequestObjectEvent::RequestObjectEvent(Engine& engine, SharedPtr<Shared::Respond
void
RequestObjectEvent::pre_process()
{
- _client = _engine.broadcaster()->client(_responder->client_key());
+ _client = _engine.broadcaster()->client(_responder->client_uri());
_object = _engine.object_store()->find(_path);
QueuedEvent::pre_process();
diff --git a/src/libs/engine/events/RequestPluginEvent.cpp b/src/libs/engine/events/RequestPluginEvent.cpp
index 4e1a1660..981c98e7 100644
--- a/src/libs/engine/events/RequestPluginEvent.cpp
+++ b/src/libs/engine/events/RequestPluginEvent.cpp
@@ -42,7 +42,7 @@ RequestPluginEvent::RequestPluginEvent(Engine& engine, SharedPtr<Shared::Respond
void
RequestPluginEvent::pre_process()
{
- _client = _engine.broadcaster()->client(_responder->client_key());
+ _client = _engine.broadcaster()->client(_responder->client_uri());
_plugin = _engine.node_factory()->plugin(_uri);
QueuedEvent::pre_process();
diff --git a/src/libs/engine/events/RequestPluginsEvent.cpp b/src/libs/engine/events/RequestPluginsEvent.cpp
index 3976dd08..50271b7f 100644
--- a/src/libs/engine/events/RequestPluginsEvent.cpp
+++ b/src/libs/engine/events/RequestPluginsEvent.cpp
@@ -33,7 +33,7 @@ RequestPluginsEvent::RequestPluginsEvent(Engine& engine, SharedPtr<Shared::Respo
void
RequestPluginsEvent::pre_process()
{
- _client = _engine.broadcaster()->client(_responder->client_key());
+ _client = _engine.broadcaster()->client(_responder->client_uri());
// Take a copy to send in the post processing thread (to avoid problems
// because std::list isn't thread safe)
diff --git a/src/libs/engine/events/RequestPortValueEvent.cpp b/src/libs/engine/events/RequestPortValueEvent.cpp
index 7444068e..113369b3 100644
--- a/src/libs/engine/events/RequestPortValueEvent.cpp
+++ b/src/libs/engine/events/RequestPortValueEvent.cpp
@@ -42,7 +42,7 @@ RequestPortValueEvent::RequestPortValueEvent(Engine& engine, SharedPtr<Shared::R
void
RequestPortValueEvent::pre_process()
{
- _client = _engine.broadcaster()->client(_responder->client_key());
+ _client = _engine.broadcaster()->client(_responder->client_uri());
_port = _engine.object_store()->find_port(_port_path);
QueuedEvent::pre_process();
diff --git a/src/libs/engine/events/UnregisterClientEvent.cpp b/src/libs/engine/events/UnregisterClientEvent.cpp
index be03f151..11424003 100644
--- a/src/libs/engine/events/UnregisterClientEvent.cpp
+++ b/src/libs/engine/events/UnregisterClientEvent.cpp
@@ -24,9 +24,9 @@
namespace Ingen {
-UnregisterClientEvent::UnregisterClientEvent(Engine& engine, SharedPtr<Shared::Responder> responder, SampleCount timestamp, ClientKey key)
+UnregisterClientEvent::UnregisterClientEvent(Engine& engine, SharedPtr<Shared::Responder> responder, SampleCount timestamp, const string& uri)
: QueuedEvent(engine, responder, timestamp)
-, _key(key)
+, _uri(uri)
{
}
@@ -34,7 +34,7 @@ UnregisterClientEvent::UnregisterClientEvent(Engine& engine, SharedPtr<Shared::R
void
UnregisterClientEvent::post_process()
{
- if (_engine.broadcaster()->unregister_client(_key))
+ if (_engine.broadcaster()->unregister_client(_uri))
_responder->respond_ok();
else
_responder->respond_error("Unable to unregister client");
diff --git a/src/libs/engine/events/UnregisterClientEvent.hpp b/src/libs/engine/events/UnregisterClientEvent.hpp
index 17d85b93..500c1250 100644
--- a/src/libs/engine/events/UnregisterClientEvent.hpp
+++ b/src/libs/engine/events/UnregisterClientEvent.hpp
@@ -19,7 +19,6 @@
#define UNREGISTERCLIENTEVENT_H
#include "QueuedEvent.hpp"
-#include "interface/ClientKey.hpp"
#include <string>
using std::string;
@@ -27,10 +26,8 @@ namespace Ingen {
namespace Shared {
class ClientInterface;
- class ClientKey;
}
using Shared::ClientInterface;
-using Shared::ClientKey;
/** Unregisters an OSC client so it no longer receives notifications.
@@ -43,12 +40,12 @@ public:
UnregisterClientEvent(Engine& engine,
SharedPtr<Shared::Responder> responder,
SampleCount timestamp,
- ClientKey key);
+ const string& uri);
void post_process();
private:
- ClientKey _key;
+ string _uri;
};