diff options
author | David Robillard <d@drobilla.net> | 2007-06-15 04:45:00 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-06-15 04:45:00 +0000 |
commit | 4f3671892be72cdd39b1a9e76f7cd4d9962f40c0 (patch) | |
tree | 47ec93a208d8f31cbe5cf0666e163c5fc1ce1e60 | |
parent | 10ff780087c9dc4e0e9777181ba6b6aca472ae61 (diff) | |
download | ingen-4f3671892be72cdd39b1a9e76f7cd4d9962f40c0.tar.gz ingen-4f3671892be72cdd39b1a9e76f7cd4d9962f40c0.tar.bz2 ingen-4f3671892be72cdd39b1a9e76f7cd4d9962f40c0.zip |
Just use automake instead of automake-1.9, etc.
Set default value for LV2 plugin controls.
Set GUI control range to always include value.
git-svn-id: http://svn.drobilla.net/lad/ingen@538 a436a847-0d15-0410-975c-d299462d15a1
-rwxr-xr-x | autogen.sh | 4 | ||||
-rw-r--r-- | src/libs/engine/LV2Node.cpp | 35 | ||||
-rw-r--r-- | src/libs/engine/ObjectSender.cpp | 5 | ||||
-rw-r--r-- | src/libs/gui/ControlGroups.cpp | 6 |
4 files changed, 24 insertions, 26 deletions
@@ -2,8 +2,8 @@ echo 'Generating necessary files...' libtoolize --copy --force -aclocal-1.9 +aclocal autoheader -Wall -automake-1.9 --gnu --add-missing +automake --gnu --add-missing autoconf diff --git a/src/libs/engine/LV2Node.cpp b/src/libs/engine/LV2Node.cpp index f45af62c..4aef8d69 100644 --- a/src/libs/engine/LV2Node.cpp +++ b/src/libs/engine/LV2Node.cpp @@ -100,30 +100,21 @@ LV2Node::instantiate() else port_buffer_size = 1; - if (port_class == SLV2_CONTROL_INPUT || port_class == SLV2_AUDIO_INPUT) { + if (port_class == SLV2_CONTROL_INPUT || port_class == SLV2_AUDIO_INPUT) port = new InputPort(this, port_name, j, _poly, DataType::FLOAT, port_buffer_size); - _ports->at(j) = port; - } else if (port_class == SLV2_CONTROL_OUTPUT || port_class == SLV2_AUDIO_OUTPUT) { + else if (port_class == SLV2_CONTROL_OUTPUT || port_class == SLV2_AUDIO_OUTPUT) port = new OutputPort(this, port_name, j, _poly, DataType::FLOAT, port_buffer_size); - _ports->at(j) = port; - } else if (port_class == SLV2_MIDI_INPUT) { + else if (port_class == SLV2_MIDI_INPUT) port = new InputPort(this, port_name, j, _poly, DataType::MIDI, port_buffer_size); - _ports->at(j) = port; - } else if (port_class == SLV2_MIDI_OUTPUT) { + else if (port_class == SLV2_MIDI_OUTPUT) port = new OutputPort(this, port_name, j, _poly, DataType::MIDI, port_buffer_size); - _ports->at(j) = port; - } - - assert(_ports->at(j) != NULL); - //PortInfo* pi = port->port_info(); - //get_port_vals(j, pi); + assert(port); + + if (port_class == SLV2_CONTROL_INPUT) + ((AudioBuffer*)port->buffer(0))->set(slv2_port_get_default_value(_lv2_plugin, id), 0); - // Set default control val - /*if (pi->is_control()) - ((TypedPort<Sample>*)port)->set_value(pi->default_val(), 0); - else - ((TypedPort<Sample>*)port)->set_value(0.0f, 0);*/ + _ports->at(j) = port; } return true; } @@ -148,9 +139,11 @@ LV2Node::activate() Port* const port = _ports->at(j); set_port_buffer(i, j, port->buffer(i)); if (port->type() == DataType::FLOAT && port->buffer_size() == 1) { - cerr << "FIXME: LV2 default value\n"; - ((AudioBuffer*)port->buffer(i))->set(0.0f, 0); // FIXME - } else if (port->type() == DataType::FLOAT && port->buffer_size() > 1) { + ((AudioBuffer*)port->buffer(i))->set( + slv2_port_get_default_value(_lv2_plugin, + slv2_plugin_get_port_by_index(_lv2_plugin, j)), + 0); + } else if (port->type() == DataType::FLOAT) { ((AudioBuffer*)port->buffer(i))->set(0.0f, 0); } } diff --git a/src/libs/engine/ObjectSender.cpp b/src/libs/engine/ObjectSender.cpp index 50e47c48..db573afc 100644 --- a/src/libs/engine/ObjectSender.cpp +++ b/src/libs/engine/ObjectSender.cpp @@ -146,10 +146,9 @@ ObjectSender::send_port(ClientInterface* client, const Port* port) // Send control value if (port->type() == DataType::FLOAT && port->buffer_size() == 1) { - Sample default_value = dynamic_cast<const AudioBuffer*>( - port->buffer(0))->value_at(0); + const Sample value = dynamic_cast<const AudioBuffer*>(port->buffer(0))->value_at(0); //cerr << port->path() << " sending default value " << default_value << endl; - client->control_change(port->path(), default_value); + client->control_change(port->path(), value); } // Send metadata diff --git a/src/libs/gui/ControlGroups.cpp b/src/libs/gui/ControlGroups.cpp index 7af9011b..4de4e0c6 100644 --- a/src/libs/gui/ControlGroups.cpp +++ b/src/libs/gui/ControlGroups.cpp @@ -129,6 +129,12 @@ SliderControlGroup::init(ControlPanel* panel, SharedPtr<PortModel> pm) pm->path().name().c_str())); } + if (min > pm->value()) + min = pm->value(); + + if (max < pm->value()) + max = pm->value(); + if (max <= min) max = min + 1.0f; |