summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-11-15 03:17:26 +0000
committerDavid Robillard <d@drobilla.net>2009-11-15 03:17:26 +0000
commit597fa9212f27d2448c0cdd20fbf616928c662cc1 (patch)
treed761421a2a7eaa55761ebdf48b794ccf6489cb95
parent6ae2018e81e7e81e4906e62dc6224ad34298d9c2 (diff)
downloadingen-597fa9212f27d2448c0cdd20fbf616928c662cc1.tar.gz
ingen-597fa9212f27d2448c0cdd20fbf616928c662cc1.tar.bz2
ingen-597fa9212f27d2448c0cdd20fbf616928c662cc1.zip
Better Parse plugin, working Print plugin.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2262 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/common/interface/DataType.hpp10
-rw-r--r--src/engine/Buffer.cpp2
-rw-r--r--src/engine/ConnectionImpl.cpp2
-rw-r--r--src/engine/LV2Info.cpp4
-rw-r--r--src/engine/LV2Info.hpp2
-rw-r--r--src/engine/LV2Node.cpp4
-rw-r--r--src/engine/MessageContext.cpp4
-rw-r--r--src/engine/ObjectBuffer.cpp2
-rw-r--r--src/engine/PortImpl.cpp2
-rw-r--r--src/engine/events/RequestMetadata.cpp2
-rw-r--r--src/gui/Configuration.cpp2
-rw-r--r--src/gui/ControlPanel.cpp2
-rw-r--r--src/gui/PortMenu.cpp2
-rw-r--r--src/shared/LV2Object.cpp3
-rw-r--r--src/shared/ResourceImpl.cpp4
15 files changed, 25 insertions, 22 deletions
diff --git a/src/common/interface/DataType.hpp b/src/common/interface/DataType.hpp
index 15cdc591..dc2726df 100644
--- a/src/common/interface/DataType.hpp
+++ b/src/common/interface/DataType.hpp
@@ -43,7 +43,7 @@ public:
//MIDI = 4,
//OSC = 5,
//STRING = 6,
- OBJECT = 7
+ VALUE = 7
};
DataType(const Raul::URI& uri)
@@ -55,8 +55,8 @@ public:
_symbol = CONTROL;
} else if (uri.str() == type_uri(EVENTS)) {
_symbol = EVENTS;
- } else if (uri.str() == type_uri(OBJECT)) {
- _symbol = OBJECT;
+ } else if (uri.str() == type_uri(VALUE)) {
+ _symbol = VALUE;
}
}
@@ -75,7 +75,7 @@ public:
inline bool is_audio() { return _symbol == AUDIO; }
inline bool is_control() { return _symbol == CONTROL; }
inline bool is_events() { return _symbol == EVENTS; }
- inline bool is_object() { return _symbol == OBJECT; }
+ inline bool is_value() { return _symbol == VALUE; }
private:
@@ -87,7 +87,7 @@ private:
case 4: return "lv2ev:EventPort"; // MIDI (no longer used)
case 5: return "lv2ev:EventPort"; // OSC (no longer used)
case 6: return "sp:StringPort"; // String Port (no longer used)
- case 7: return "obj:ObjectPort";
+ case 7: return "obj:ValuePort";
default: return "";
}
}
diff --git a/src/engine/Buffer.cpp b/src/engine/Buffer.cpp
index 65e46736..07498b36 100644
--- a/src/engine/Buffer.cpp
+++ b/src/engine/Buffer.cpp
@@ -32,7 +32,7 @@ Buffer::create(DataType type, size_t size)
return new AudioBuffer(size);
else if (type.is_events())
return new EventBuffer(size);
- else if (type.is_object())
+ else if (type.is_value())
return new ObjectBuffer(size);
else
throw;
diff --git a/src/engine/ConnectionImpl.cpp b/src/engine/ConnectionImpl.cpp
index f33c612b..6c7a63f0 100644
--- a/src/engine/ConnectionImpl.cpp
+++ b/src/engine/ConnectionImpl.cpp
@@ -79,7 +79,7 @@ ConnectionImpl::set_mode()
if (_mode == MIX && type() == DataType::EVENTS)
_mode = COPY;
- if (type() == DataType::OBJECT)
+ if (type() == DataType::VALUE)
_mode = DIRECT;
}
diff --git a/src/engine/LV2Info.cpp b/src/engine/LV2Info.cpp
index e94deaad..99c2ff85 100644
--- a/src/engine/LV2Info.cpp
+++ b/src/engine/LV2Info.cpp
@@ -37,7 +37,7 @@ LV2Info::LV2Info(Ingen::Shared::World* world)
, control_class(slv2_value_new_uri(world->slv2_world, SLV2_PORT_CLASS_CONTROL))
, audio_class(slv2_value_new_uri(world->slv2_world, SLV2_PORT_CLASS_AUDIO))
, event_class(slv2_value_new_uri(world->slv2_world, SLV2_PORT_CLASS_EVENT))
- , object_port_class(slv2_value_new_uri(world->slv2_world, LV2_OBJECT_URI "#ObjectPort"))
+ , value_port_class(slv2_value_new_uri(world->slv2_world, LV2_OBJECT_URI "#ValuePort"))
, _world(world)
{
assert(world);
@@ -57,7 +57,7 @@ LV2Info::~LV2Info()
slv2_value_free(control_class);
slv2_value_free(audio_class);
slv2_value_free(event_class);
- slv2_value_free(object_port_class);
+ slv2_value_free(value_port_class);
}
} // namespace Ingen
diff --git a/src/engine/LV2Info.hpp b/src/engine/LV2Info.hpp
index 8d4478aa..76dfefa7 100644
--- a/src/engine/LV2Info.hpp
+++ b/src/engine/LV2Info.hpp
@@ -50,7 +50,7 @@ public:
SLV2Value control_class;
SLV2Value audio_class;
SLV2Value event_class;
- SLV2Value object_port_class;
+ SLV2Value value_port_class;
Ingen::Shared::World& world() { return *_world; }
SLV2World lv2_world() { return _world->slv2_world; }
diff --git a/src/engine/LV2Node.cpp b/src/engine/LV2Node.cpp
index c12171e9..1515344a 100644
--- a/src/engine/LV2Node.cpp
+++ b/src/engine/LV2Node.cpp
@@ -217,8 +217,8 @@ LV2Node::instantiate()
} else if (slv2_port_is_a(plug, id, info->event_class)) {
data_type = DataType::EVENTS;
port_buffer_size = _buffer_size;
- } else if (slv2_port_is_a(plug, id, info->object_port_class)) {
- data_type = DataType::OBJECT;
+ } else if (slv2_port_is_a(plug, id, info->value_port_class)) {
+ data_type = DataType::VALUE;
port_buffer_size = 0;
// Get default value, and its length
diff --git a/src/engine/MessageContext.cpp b/src/engine/MessageContext.cpp
index c0f4d3a6..ba03088d 100644
--- a/src/engine/MessageContext.cpp
+++ b/src/engine/MessageContext.cpp
@@ -37,7 +37,7 @@ MessageContext::run(NodeImpl* node)
void* valid_ports = node->valid_ports();
PatchImpl* patch = node->parent_patch();
- cout << "MESSAGE RUN " << node->path() << " {" << endl;
+ //cout << "MESSAGE RUN " << node->path() << " {" << endl;
for (uint32_t i = 0; i < node->num_ports(); ++i) {
PortImpl* p = node->port_impl(i);
if (p->is_output() && p->context() == Context::MESSAGE &&
@@ -52,7 +52,7 @@ MessageContext::run(NodeImpl* node)
}
}
}
- cout << "}" << endl;
+ //cout << "}" << endl;
node->reset_valid_ports();
}
diff --git a/src/engine/ObjectBuffer.cpp b/src/engine/ObjectBuffer.cpp
index 0f40ea9a..a26eaea5 100644
--- a/src/engine/ObjectBuffer.cpp
+++ b/src/engine/ObjectBuffer.cpp
@@ -38,7 +38,7 @@ using namespace Shared;
* \a capacity is in bytes.
*/
ObjectBuffer::ObjectBuffer(size_t capacity)
- : Buffer(DataType(DataType::OBJECT), capacity)
+ : Buffer(DataType(DataType::VALUE), capacity)
{
capacity = std::max(capacity, (size_t)32);
cerr << "Creating Object Buffer " << _buf << " capacity = " << capacity << endl;
diff --git a/src/engine/PortImpl.cpp b/src/engine/PortImpl.cpp
index 20d0b682..ecb0d20b 100644
--- a/src/engine/PortImpl.cpp
+++ b/src/engine/PortImpl.cpp
@@ -194,7 +194,7 @@ PortImpl::broadcast_value(Context& context, bool force)
context.event_sink().write(sizeof(ev), &ev);
}
break;
- case DataType::OBJECT:
+ case DataType::VALUE:
LV2Object::to_atom(context.engine().world(), ((ObjectBuffer*)buffer(0))->data(), val);
break;
}
diff --git a/src/engine/events/RequestMetadata.cpp b/src/engine/events/RequestMetadata.cpp
index 06069f74..e6ba7f5d 100644
--- a/src/engine/events/RequestMetadata.cpp
+++ b/src/engine/events/RequestMetadata.cpp
@@ -96,7 +96,7 @@ RequestMetadata::execute(ProcessContext& context)
if (port) {
if (port->type() == DataType::CONTROL || port->type() == DataType::AUDIO)
_value = ((AudioBuffer*)port->buffer(0))->value_at(0); // TODO: offset
- else if (port->type() == DataType::OBJECT)
+ else if (port->type() == DataType::VALUE)
LV2Object::to_atom(context.engine().world(),
((ObjectBuffer*)port->buffer(0))->data(), _value);
} else {
diff --git a/src/gui/Configuration.cpp b/src/gui/Configuration.cpp
index 58a2abc5..2169093e 100644
--- a/src/gui/Configuration.cpp
+++ b/src/gui/Configuration.cpp
@@ -94,7 +94,7 @@ Configuration::get_port_color(const PortModel* p)
return _event_port_color;
/*} else if (p->type().is_osc()) {
return _osc_port_color;
- */} else if (p->type().is_object()) {
+ */} else if (p->type().is_value()) {
return _object_port_color;
}
diff --git a/src/gui/ControlPanel.cpp b/src/gui/ControlPanel.cpp
index 95cd6e02..fdfba8b7 100644
--- a/src/gui/ControlPanel.cpp
+++ b/src/gui/ControlPanel.cpp
@@ -120,7 +120,7 @@ ControlPanel::add_port(SharedPtr<PortModel> pm)
Glib::RefPtr<Gnome::Glade::Xml> xml = GladeFactory::new_glade_reference("toggle_control");
xml->get_widget_derived("toggle_control", tc);
control = tc;
- } else if (pm->type().is_object()) {
+ } else if (pm->type().is_value()) {
StringControl* sc;
Glib::RefPtr<Gnome::Glade::Xml> xml = GladeFactory::new_glade_reference("string_control");
xml->get_widget_derived("string_control", sc);
diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp
index 8a98b281..647dac8b 100644
--- a/src/gui/PortMenu.cpp
+++ b/src/gui/PortMenu.cpp
@@ -48,7 +48,7 @@ PortMenu::init(SharedPtr<PortModel> port, bool patch_port)
_destroy_menuitem->hide();
}
- if (port->type() == DataType::EVENTS || port->type() == DataType::OBJECT)
+ if (port->type() == DataType::EVENTS || port->type() == DataType::VALUE)
_polyphonic_menuitem->hide();
_enable_signal = true;
diff --git a/src/shared/LV2Object.cpp b/src/shared/LV2Object.cpp
index 3442c004..54c81429 100644
--- a/src/shared/LV2Object.cpp
+++ b/src/shared/LV2Object.cpp
@@ -39,6 +39,9 @@ to_atom(World* world, LV2_Object* object, Raul::Atom& atom)
if (object->type == map->object_class_string) {
atom = Raul::Atom((char*)(object + 1));
return true;
+ } else if (object->type == map->object_class_bool) {
+ atom = Raul::Atom((bool)(int32_t*)(object + 1));
+ return true;
} else if (object->type == map->object_class_int32) {
atom = Raul::Atom((int32_t*)(object + 1));
return true;
diff --git a/src/shared/ResourceImpl.cpp b/src/shared/ResourceImpl.cpp
index 6d028a13..0d773be4 100644
--- a/src/shared/ResourceImpl.cpp
+++ b/src/shared/ResourceImpl.cpp
@@ -112,8 +112,8 @@ ResourceImpl::type(
} else if (!strcmp(atom.get_uri(), "lv2ev:EventPort")) {
data_type = DataType::EVENTS;
port = true;
- } else if (!strcmp(atom.get_uri(), "obj:ObjectPort")) {
- data_type = DataType::OBJECT;
+ } else if (!strcmp(atom.get_uri(), "obj:ValuePort")) {
+ data_type = DataType::VALUE;
port = true;
}
}