summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-24 04:47:33 +0000
committerDavid Robillard <d@drobilla.net>2014-01-24 04:47:33 +0000
commit2c03f2abd3d3d98a81020438ca805acded39dbab (patch)
tree92abb5ae29cbc25a0655e7aa5b6a8c07bbff6756 /src/server
parentd970641441746aacfc645176b71d7ba71af0463a (diff)
downloadingen-2c03f2abd3d3d98a81020438ca805acded39dbab.tar.gz
ingen-2c03f2abd3d3d98a81020438ca805acded39dbab.tar.bz2
ingen-2c03f2abd3d3d98a81020438ca805acded39dbab.zip
Remove redundant and unnecessary properties from saved graphs and protocol.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5321 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server')
-rw-r--r--src/server/DuplexPort.cpp12
-rw-r--r--src/server/InputPort.cpp6
-rw-r--r--src/server/LV2Block.cpp2
-rw-r--r--src/server/PortImpl.cpp9
-rw-r--r--src/server/events/Delta.cpp12
5 files changed, 24 insertions, 17 deletions
diff --git a/src/server/DuplexPort.cpp b/src/server/DuplexPort.cpp
index 438d315c..256d45b1 100644
--- a/src/server/DuplexPort.cpp
+++ b/src/server/DuplexPort.cpp
@@ -42,8 +42,16 @@ DuplexPort::DuplexPort(BufferFactory& bufs,
, OutputPort(bufs, parent, symbol, index, poly, type, buffer_type, value, buffer_size)
, _is_output(is_output)
{
- set_property(bufs.uris().ingen_polyphonic,
- bufs.forge().make(polyphonic));
+ if (polyphonic) {
+ set_property(bufs.uris().ingen_polyphonic, bufs.forge().make(true));
+ }
+
+ // Set default control range
+ if (!is_output && (type == PortType::CONTROL || type == PortType::CV)) {
+ set_property(bufs.uris().lv2_minimum, bufs.forge().make(0.0f));
+ set_property(bufs.uris().lv2_maximum, bufs.forge().make(1.0f));
+ }
+
}
DuplexPort::~DuplexPort()
diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp
index f1be3b8f..cdf70575 100644
--- a/src/server/InputPort.cpp
+++ b/src/server/InputPort.cpp
@@ -53,12 +53,6 @@ InputPort::InputPort(BufferFactory& bufs,
if (parent->graph_type() != Node::GraphType::GRAPH) {
add_property(uris.rdf_type, uris.lv2_InputPort);
}
-
- // Set default control range
- if (type == PortType::CONTROL || type == PortType::CV) {
- set_property(uris.lv2_minimum, bufs.forge().make(0.0f));
- set_property(uris.lv2_maximum, bufs.forge().make(1.0f));
- }
}
bool
diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp
index 0525a2db..5e97bfe5 100644
--- a/src/server/LV2Block.cpp
+++ b/src/server/LV2Block.cpp
@@ -366,11 +366,9 @@ LV2Block::instantiate(BufferFactory& bufs)
|| port_type == PortType::CV)) {
port->set_value(val);
if (!isnan(min_values[j])) {
- port->set_property(uris.lv2_minimum, forge.make(min_values[j]));
port->set_minimum(forge.make(min_values[j]));
}
if (!isnan(max_values[j])) {
- port->set_property(uris.lv2_maximum, forge.make(max_values[j]));
port->set_maximum(forge.make(max_values[j]));
}
}
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp
index e4b3ad4d..aed67ec3 100644
--- a/src/server/PortImpl.cpp
+++ b/src/server/PortImpl.cpp
@@ -82,15 +82,14 @@ PortImpl::PortImpl(BufferFactory& bufs,
set_type(type, buffer_type);
- add_property(uris.rdf_type, bufs.forge().alloc_uri(type.uri()));
set_property(uris.lv2_index, bufs.forge().make((int32_t)index));
if ((type == PortType::CONTROL || type == PortType::CV) && value.is_valid()) {
set_property(uris.ingen_value, value);
}
- if (type == PortType::ATOM) {
- add_property(uris.atom_bufferType,
- bufs.forge().make_urid(buffer_type));
- }
+ // if (type == PortType::ATOM) {
+ // set_property(uris.atom_bufferType,
+ // bufs.forge().make_urid(buffer_type));
+ // }
}
PortImpl::~PortImpl()
diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp
index 072d0ba3..0c134ede 100644
--- a/src/server/events/Delta.cpp
+++ b/src/server/events/Delta.cpp
@@ -148,9 +148,10 @@ Delta::pre_process()
NodeImpl* obj = dynamic_cast<NodeImpl*>(_object);
+ // Remove any properties removed in delta
for (const auto& r : _remove) {
- const Raul::URI& key = r.first;
- const Atom& value = r.second;
+ const Raul::URI& key = r.first;
+ const Atom& value = r.second;
if (key == uris.midi_binding && value == uris.patch_wildcard) {
PortImpl* port = dynamic_cast<PortImpl*>(_object);
if (port)
@@ -161,6 +162,13 @@ Delta::pre_process()
}
}
+ // Remove all added properties if this is a put
+ if (_create && _object) {
+ for (const auto& p : _properties) {
+ _object->remove_property(p.first, p.second);
+ }
+ }
+
for (const auto& p : _properties) {
const Raul::URI& key = p.first;
const Resource::Property& value = p.second;