mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 00:56:33 +01:00
Rework previous commit to avoid extra property lookup (fwiw).
This commit is contained in:
parent
2d8b7c352b
commit
63935a86a4
1 changed files with 4 additions and 3 deletions
|
|
@ -1236,14 +1236,15 @@ MidiModel::PatchChangePtr
|
||||||
MidiModel::PatchChangeDiffCommand::unmarshal_patch_change (XMLNode* n)
|
MidiModel::PatchChangeDiffCommand::unmarshal_patch_change (XMLNode* n)
|
||||||
{
|
{
|
||||||
XMLProperty* prop;
|
XMLProperty* prop;
|
||||||
|
XMLProperty* prop_id;
|
||||||
Evoral::event_id_t id = 0;
|
Evoral::event_id_t id = 0;
|
||||||
Evoral::Beats time = Evoral::Beats();
|
Evoral::Beats time = Evoral::Beats();
|
||||||
int channel = 0;
|
int channel = 0;
|
||||||
int program = 0;
|
int program = 0;
|
||||||
int bank = 0;
|
int bank = 0;
|
||||||
|
|
||||||
if ((prop = n->property ("id")) != 0) {
|
if ((prop_id = n->property ("id")) != 0) {
|
||||||
istringstream s (prop->value());
|
istringstream s (prop_id->value());
|
||||||
s >> id;
|
s >> id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1268,7 +1269,7 @@ MidiModel::PatchChangeDiffCommand::unmarshal_patch_change (XMLNode* n)
|
||||||
}
|
}
|
||||||
|
|
||||||
PatchChangePtr p (new Evoral::PatchChange<TimeType> (time, channel, program, bank));
|
PatchChangePtr p (new Evoral::PatchChange<TimeType> (time, channel, program, bank));
|
||||||
assert(n->property ("id"));
|
assert(prop_id);
|
||||||
p->set_id (id);
|
p->set_id (id);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue