MTROPOLIS: Fix some wrong IDs, debugging menu MIDI not working

This commit is contained in:
elasota 2022-05-07 15:01:01 -04:00 committed by Eugene Sandulenko
parent b64d73849d
commit 49f7dc0c2f
3 changed files with 18 additions and 8 deletions

View File

@ -570,6 +570,7 @@ VThreadState MidiModifier::consumeMessage(Runtime *runtime, const Common::Shared
if (_executeWhen.respondsTo(msg->getEvent())) {
if (_mode == kModeFile) {
if (_embeddedFile) {
debug(2, "MIDI (%p): Playing embedded file", this);
_plugIn->getMidi()->playFile(&_embeddedFile->contents[0], _embeddedFile->contents.size());
}
}
@ -619,8 +620,11 @@ MiniscriptInstructionOutcome MidiModifier::scriptSetVolume(MiniscriptThread *thr
_volume = asInteger;
if (_mode == kModeFile)
_plugIn->getMidi()->setVolume((_volume * 1306) >> 9); // 100 -> 255 range
if (_mode == kModeFile) {
const int normalizedVolume = (_volume * 1306) >> 9;
debug(2, "MIDI (%p): Changing volume to %i", this, normalizedVolume);
_plugIn->getMidi()->setVolume(normalizedVolume); // 100 -> 255 range
}
return kMiniscriptInstructionOutcomeContinue;
}
@ -635,8 +639,10 @@ MiniscriptInstructionOutcome MidiModifier::scriptSetNoteVelocity(MiniscriptThrea
else if (asInteger > 127)
asInteger = 127;
if (_mode == kModeSingleNote)
if (_mode == kModeSingleNote) {
debug(2, "MIDI (%p): Changing note velocity to %i", this, asInteger);
_modeSpecific.singleNote.velocity = asInteger;
}
return kMiniscriptInstructionOutcomeContinue;
}

View File

@ -1654,8 +1654,12 @@ void MessengerSendSpec::resolveDestination(Runtime *runtime, Modifier *sender, C
case kMessageDestModifiersParent:
resolveVariableObjectType(sender->getParent().lock().get(), outStructuralDest, outModifierDest);
break;
case kMessageDestChildren:
case kMessageDestElementsParent:
resolveHierarchyStructuralDestination(runtime, sender, outStructuralDest, outModifierDest, isElementFilter);
if (!outStructuralDest.expired())
outStructuralDest = outStructuralDest.lock()->getParent()->getSelfReference().staticCast<Structural>();
break;
case kMessageDestChildren:
case kMessageDestSubsection:
case kMessageDestSourcesParent:
case kMessageDestBehavior:

View File

@ -205,13 +205,13 @@ enum EventID {
kTransitionStarted = 503,
kTransitionEnded = 504,
kMouseUp = 301,
kMouseDown = 302,
kMouseDown = 301,
kMouseUp = 302,
kMouseOver = 303,
kMouseOutside = 304,
kMouseTrackedInside = 305,
kMouseTracking = 306,
kMouseTrackedOutside = 307,
kMouseTrackedOutside = 306,
kMouseTracking = 307,
kMouseUpInside = 309,
kMouseUpOutside = 310,