Commit to allow move (broken revision)

git-svn-id: http://svn.drobilla.net/lad@55 a436a847-0d15-0410-975c-d299462d15a1
This commit is contained in:
dave 2006-06-18 18:14:26 +00:00
parent a5ba15b148
commit 181fbd7379
1 changed files with 10 additions and 10 deletions

View File

@ -38,9 +38,6 @@ DSSIPlugin::DSSIPlugin(const string& name, size_t poly, Patch* parent, DSSI_Desc
_alsa_events(new snd_seq_event_t[_buffer_size]),
_alsa_encoder(NULL)
{
if (has_midi_input())
_num_ports = descriptor->LADSPA_Plugin->PortCount + 1;
snd_midi_event_new(3, &_alsa_encoder);
}
@ -62,16 +59,19 @@ DSSIPlugin::~DSSIPlugin()
bool
DSSIPlugin::instantiate()
{
if (!LADSPAPlugin::instantiate())
return false;
assert(!_ports);
if (has_midi_input()) {
assert(_num_ports == _descriptor->PortCount + 1);
assert(_ports->size() == _descriptor->PortCount + 1);
_midi_in_port = new InputPort<MidiMessage>(this, "MIDI In", _num_ports-1, 1, DataType::MIDI, _buffer_size);
_ports->at(_num_ports-1) = _midi_in_port;
_ports = new Array<Port*>(_descriptor->PortCount + 1);
_midi_in_port = new InputPort<MidiMessage>(this, "MIDI In", _ports->size()-1, 1, DataType::MIDI, _buffer_size);
_ports->at(_ports->size()-1) = _midi_in_port;
}
// LADSPAPlugin::instantiate checks if _ports is already allocated
if (!LADSPAPlugin::instantiate()) {
delete _ports;
return false;
}
return true;
}