summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-02-02 16:58:42 +0000
committerDavid Robillard <d@drobilla.net>2013-02-02 16:58:42 +0000
commit3265e8f01cd4e878661973730349a5ed44329713 (patch)
tree9e62a609edeba00bba462efc242952af7476b41d /src/server
parent05d020a36581fdc9c5038339e52208f7d9f3e60e (diff)
downloadingen-3265e8f01cd4e878661973730349a5ed44329713.tar.gz
ingen-3265e8f01cd4e878661973730349a5ed44329713.tar.bz2
ingen-3265e8f01cd4e878661973730349a5ed44329713.zip
More generic Atom class.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5024 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server')
-rw-r--r--src/server/ControlBindings.cpp8
-rw-r--r--src/server/Engine.cpp2
-rw-r--r--src/server/JackDriver.cpp6
-rw-r--r--src/server/LV2Block.cpp2
-rw-r--r--src/server/PortImpl.cpp6
-rw-r--r--src/server/events/CreateBlock.cpp4
-rw-r--r--src/server/events/CreateGraph.cpp2
-rw-r--r--src/server/events/CreatePort.cpp8
-rw-r--r--src/server/events/Delta.cpp20
-rw-r--r--src/server/events/Disconnect.cpp2
-rw-r--r--src/server/events/SetPortValue.cpp4
-rw-r--r--src/server/ingen_jack.cpp4
12 files changed, 34 insertions, 34 deletions
diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp
index 634c568a..12a895f7 100644
--- a/src/server/ControlBindings.cpp
+++ b/src/server/ControlBindings.cpp
@@ -194,8 +194,8 @@ ControlBindings::learn(PortImpl* port)
static void
get_range(ProcessContext& context, const PortImpl* port, float* min, float* max)
{
- *min = port->minimum().get_float();
- *max = port->maximum().get_float();
+ *min = port->minimum().get<float>();
+ *max = port->maximum().get<float>();
if (port->is_sample_rate()) {
*min *= context.engine().driver()->sample_rate();
*max *= context.engine().driver()->sample_rate();
@@ -246,7 +246,7 @@ ControlBindings::port_value_to_control(ProcessContext& context,
float min, max;
get_range(context, port, &min, &max);
- const float value = value_atom.get_float();
+ const float value = value_atom.get<float>();
float normal = (value - min) / (max - min);
if (normal < 0.0f) {
@@ -318,7 +318,7 @@ ControlBindings::set_port_value(ProcessContext& context,
assert(port_value.type() == port->bufs().forge().Float);
port->set_value(port_value); // FIXME: not thread safe
- port->set_control_value(context, context.start(), port_value.get_float());
+ port->set_control_value(context, context.start(), port_value.get<float>());
URIs& uris = context.engine().world()->uris();
context.notify(uris.ingen_value, context.start(), port,
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp
index 165f6412..1af7be1b 100644
--- a/src/server/Engine.cpp
+++ b/src/server/Engine.cpp
@@ -118,7 +118,7 @@ Engine::store() const
size_t
Engine::event_queue_size() const
{
- return world()->conf().option("queue-size").get_int32();
+ return world()->conf().option("queue-size").get<int32_t>();
}
void
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index 20abb787..6a7d7ae9 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -152,8 +152,8 @@ JackDriver::activate()
}
if (!_client)
- attach(world->conf().option("jack-server").get_string(),
- world->conf().option("jack-name").get_string(), NULL);
+ attach(world->conf().option("jack-server").ptr<char>(),
+ world->conf().option("jack-name").ptr<char>(), NULL);
jack_set_process_callback(_client, process_cb, this);
@@ -164,7 +164,7 @@ JackDriver::activate()
exit(EXIT_FAILURE);
} else {
_engine.log().info(Raul::fmt("Activated Jack client `%1%'\n") %
- world->conf().option("jack-name").get_string());
+ world->conf().option("jack-name").ptr<char>());
}
}
diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp
index 1d05137b..fba06b19 100644
--- a/src/server/LV2Block.cpp
+++ b/src/server/LV2Block.cpp
@@ -107,7 +107,7 @@ LV2Block::make_instance(URIs& uris,
if (buffer) {
if (port->is_a(PortType::CV) || port->is_a(PortType::CONTROL)) {
- buffer->set_block(port->value().get_float(), 0, buffer->nframes());
+ buffer->set_block(port->value().get<float>(), 0, buffer->nframes());
} else {
buffer->clear();
}
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp
index 59d28f15..01280e73 100644
--- a/src/server/PortImpl.cpp
+++ b/src/server/PortImpl.cpp
@@ -319,7 +319,7 @@ PortImpl::apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly)
_prepared_set_states = NULL;
if (is_a(PortType::CONTROL) || is_a(PortType::CV)) {
- set_control_value(context, context.start(), _value.get_float());
+ set_control_value(context, context.start(), _value.get<float>());
}
assert(_buffers->size() >= poly);
@@ -365,10 +365,10 @@ PortImpl::clear_buffers()
case PortType::CV:
for (uint32_t v = 0; v < _poly; ++v) {
Buffer* buf = buffer(v).get();
- buf->set_block(_value.get_float(), 0, buf->nframes());
+ buf->set_block(_value.get<float>(), 0, buf->nframes());
SetState& state = _set_states->at(v);
state.state = SetState::State::SET;
- state.value = _value.get_float();
+ state.value = _value.get<float>();
state.time = 0;
}
break;
diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp
index 63b05b58..8caa3bf6 100644
--- a/src/server/events/CreateBlock.cpp
+++ b/src/server/events/CreateBlock.cpp
@@ -65,7 +65,7 @@ CreateBlock::pre_process()
std::string plugin_uri_str;
const iterator t = _properties.find(uris.ingen_prototype);
if (t != _properties.end() && t->second.type() == uris.forge.URI) {
- plugin_uri_str = t->second.get_uri();
+ plugin_uri_str = t->second.ptr<char>();
} else {
return Event::pre_process_done(Status::BAD_REQUEST);
}
@@ -90,7 +90,7 @@ CreateBlock::pre_process()
const bool polyphonic = (
p != _properties.end() &&
p->second.type() == _engine.world()->forge().Bool &&
- p->second.get_bool());
+ p->second.get<int32_t>());
if (!(_block = plugin->instantiate(*_engine.buffer_factory(),
Raul::Symbol(_path.symbol()),
diff --git a/src/server/events/CreateGraph.cpp b/src/server/events/CreateGraph.cpp
index 8ab05a2e..0355b0bb 100644
--- a/src/server/events/CreateGraph.cpp
+++ b/src/server/events/CreateGraph.cpp
@@ -64,7 +64,7 @@ CreateGraph::pre_process()
uint32_t int_poly = 1;
iterator p = _properties.find(uris.ingen_polyphony);
if (p != _properties.end() && p->second.type() == uris.forge.Int) {
- int_poly = p->second.get_int32();
+ int_poly = p->second.get<int32_t>();
}
if (int_poly < 1 || int_poly > 128) {
diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp
index 2e3e4d42..4687e44e 100644
--- a/src/server/events/CreatePort.cpp
+++ b/src/server/events/CreatePort.cpp
@@ -77,7 +77,7 @@ CreatePort::CreatePort(Engine& engine,
const Range buffer_types = properties.equal_range(uris.atom_bufferType);
for (Iterator i = buffer_types.first; i != buffer_types.second; ++i) {
if (i->second.type() == _engine.world()->forge().URI) {
- _buf_type = _engine.world()->uri_map().map_uri(i->second.get_uri());
+ _buf_type = _engine.world()->uri_map().map_uri(i->second.ptr<char>());
}
}
}
@@ -123,14 +123,14 @@ CreatePort::pre_process()
std::make_pair(uris.lv2_index,
_engine.world()->forge().make(old_n_ports)));
} else if (index_i->second.type() != uris.forge.Int ||
- index_i->second.get_int32() != old_n_ports) {
+ index_i->second.get<int32_t>() != old_n_ports) {
return Event::pre_process_done(Status::BAD_INDEX, _path);
}
const PropIter poly_i = _properties.find(uris.ingen_polyphonic);
const bool polyphonic = (poly_i != _properties.end() &&
poly_i->second.type() == uris.forge.Bool &&
- poly_i->second.get_bool());
+ poly_i->second.get<int32_t>());
if (!(_graph_port = _graph->create_port(
*_engine.buffer_factory(), Raul::Symbol(_path.symbol()),
@@ -155,7 +155,7 @@ CreatePort::pre_process()
_ports_array = new Raul::Array<PortImpl*>(old_n_ports + 1, NULL);
_update = _graph_port->properties();
- assert(_graph_port->index() == (uint32_t)index_i->second.get_int32());
+ assert(_graph_port->index() == (uint32_t)index_i->second.get<int32_t>());
assert(_graph->num_ports_non_rt() == (uint32_t)old_n_ports + 1);
assert(_graph_port->index() == (uint32_t)old_n_ports);
assert(_ports_array->size() == _graph->num_ports_non_rt());
diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp
index 2b851b16..28eccc71 100644
--- a/src/server/events/Delta.cpp
+++ b/src/server/events/Delta.cpp
@@ -207,19 +207,19 @@ Delta::pre_process()
if (value.type() == uris.forge.Bool) {
op = SpecialType::ENABLE;
// FIXME: defer this until all other metadata has been processed
- if (value.get_bool() && !_graph->enabled())
+ if (value.get<int32_t>() && !_graph->enabled())
_compiled_graph = _graph->compile();
} else {
_status = Status::BAD_VALUE_TYPE;
}
} else if (key == uris.ingen_polyphony) {
if (value.type() == uris.forge.Int) {
- if (value.get_int32() < 1 || value.get_int32() > 128) {
+ if (value.get<int32_t>() < 1 || value.get<int32_t>() > 128) {
_status = Status::INVALID_POLY;
} else {
op = SpecialType::POLYPHONY;
_graph->prepare_internal_poly(
- *_engine.buffer_factory(), value.get_int32());
+ *_engine.buffer_factory(), value.get<int32_t>());
}
} else {
_status = Status::BAD_VALUE_TYPE;
@@ -233,8 +233,8 @@ Delta::pre_process()
obj->set_property(key, value, value.context());
BlockImpl* block = dynamic_cast<BlockImpl*>(obj);
if (block)
- block->set_polyphonic(value.get_bool());
- if (value.get_bool()) {
+ block->set_polyphonic(value.get<int32_t>());
+ if (value.get<int32_t>()) {
obj->prepare_poly(*_engine.buffer_factory(), parent->internal_poly());
} else {
obj->prepare_poly(*_engine.buffer_factory(), 1);
@@ -248,7 +248,7 @@ Delta::pre_process()
}
} else if (is_client && key == uris.ingen_broadcast) {
_engine.broadcaster()->set_broadcast(
- _request_client->uri(), value.get_bool());
+ _request_client->uri(), value.get<int32_t>());
}
if (_status != Status::NOT_PREPARED) {
@@ -293,11 +293,11 @@ Delta::execute(ProcessContext& context)
switch (*t) {
case SpecialType::ENABLE_BROADCAST:
if (port) {
- port->enable_monitoring(value.get_bool());
+ port->enable_monitoring(value.get<int32_t>());
}
break;
case SpecialType::ENABLE:
- if (value.get_bool()) {
+ if (value.get<int32_t>()) {
if (_compiled_graph) {
_graph->set_compiled_graph(_compiled_graph);
}
@@ -308,7 +308,7 @@ Delta::execute(ProcessContext& context)
break;
case SpecialType::POLYPHONIC: {
GraphImpl* parent = reinterpret_cast<GraphImpl*>(object->parent());
- if (value.get_bool()) {
+ if (value.get<int32_t>()) {
object->apply_poly(
context, *_engine.maid(), parent->internal_poly_process());
} else {
@@ -319,7 +319,7 @@ Delta::execute(ProcessContext& context)
if (!_graph->apply_internal_poly(context,
*_engine.buffer_factory(),
*_engine.maid(),
- value.get_int32())) {
+ value.get<int32_t>())) {
_status = Status::INTERNAL_ERROR;
}
break;
diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp
index a7f31316..8f1c5032 100644
--- a/src/server/events/Disconnect.cpp
+++ b/src/server/events/Disconnect.cpp
@@ -97,7 +97,7 @@ Disconnect::Impl::Impl(Engine& e,
const bool is_control = _dst_input_port->is_a(PortType::CONTROL) ||
_dst_input_port->is_a(PortType::CV);
- const float value = is_control ? _dst_input_port->value().get_float() : 0;
+ const float value = is_control ? _dst_input_port->value().get<float>() : 0;
for (uint32_t i = 0; i < _buffers->size(); ++i) {
if (is_control) {
Buffer* buf = _buffers->at(i).get();
diff --git a/src/server/events/SetPortValue.cpp b/src/server/events/SetPortValue.cpp
index edef9e8c..0d68b1af 100644
--- a/src/server/events/SetPortValue.cpp
+++ b/src/server/events/SetPortValue.cpp
@@ -90,7 +90,7 @@ SetPortValue::apply(Context& context)
if (buf->type() == uris.atom_Sound || buf->type() == uris.atom_Float) {
if (_value.type() == uris.forge.Float) {
- _port->set_control_value(context, _time, _value.get_float());
+ _port->set_control_value(context, _time, _value.get<float>());
} else {
_status = Status::TYPE_MISMATCH;
}
@@ -105,7 +105,7 @@ SetPortValue::apply(Context& context)
_status = Status::NO_SPACE;
}
} else if (buf->type() == uris.atom_URID) {
- ((LV2_Atom_URID*)buf->atom())->body = _value.get_int32();
+ ((LV2_Atom_URID*)buf->atom())->body = _value.get<int32_t>();
} else {
_status = Status::BAD_VALUE_TYPE;
}
diff --git a/src/server/ingen_jack.cpp b/src/server/ingen_jack.cpp
index 9ebb0481..07b80876 100644
--- a/src/server/ingen_jack.cpp
+++ b/src/server/ingen_jack.cpp
@@ -39,9 +39,9 @@ struct IngenJackModule : public Ingen::Module {
Server::JackDriver* driver = new Server::JackDriver(
*(Server::Engine*)world->engine().get());
const Raul::Atom& s = world->conf().option("jack-server");
- const std::string server_name = s.is_valid() ? s.get_string() : "";
+ const std::string server_name = s.is_valid() ? s.ptr<char>() : "";
driver->attach(server_name,
- world->conf().option("jack-name").get_string(),
+ world->conf().option("jack-name").ptr<char>(),
NULL);
((Server::Engine*)world->engine().get())->set_driver(
SPtr<Server::Driver>(driver));