[Scummvm-git-logs] scummvm master -> b2fdf3f31cb2be1dfdc2824758401027439526ef

elasota noreply at scummvm.org
Thu Jun 23 23:54:06 UTC 2022


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
cf21649a98 MTROPOLIS: Stub out MIDI single-note functionality
b2fdf3f31c MTROPOLIS: Identify some more in some more attributes


Commit: cf21649a9881ad031f73febab799a39f31972327
    https://github.com/scummvm/scummvm/commit/cf21649a9881ad031f73febab799a39f31972327
Author: elasota (ejlasota at gmail.com)
Date: 2022-06-23T19:50:18-04:00

Commit Message:
MTROPOLIS: Stub out MIDI single-note functionality

Changed paths:
    engines/mtropolis/plugin/standard.cpp
    engines/mtropolis/plugin/standard.h


diff --git a/engines/mtropolis/plugin/standard.cpp b/engines/mtropolis/plugin/standard.cpp
index a39b135bb65..7fe3ecca9a2 100644
--- a/engines/mtropolis/plugin/standard.cpp
+++ b/engines/mtropolis/plugin/standard.cpp
@@ -1042,12 +1042,18 @@ MiniscriptInstructionOutcome MidiModifier::writeRefAttribute(MiniscriptThread *t
 	} else if (attrib == "notevelocity") {
 		DynamicValueWriteFuncHelper<MidiModifier, &MidiModifier::scriptSetNoteVelocity>::create(this, result);
 		return kMiniscriptInstructionOutcomeContinue;
+	} else if (attrib == "noteduration") {
+		DynamicValueWriteFuncHelper<MidiModifier, &MidiModifier::scriptSetNoteDuration>::create(this, result);
+		return kMiniscriptInstructionOutcomeContinue;
 	} else if (attrib == "notenum") {
 		DynamicValueWriteFuncHelper<MidiModifier, &MidiModifier::scriptSetNoteNum>::create(this, result);
 		return kMiniscriptInstructionOutcomeContinue;
 	} else if (attrib == "loop") {
 		DynamicValueWriteFuncHelper<MidiModifier, &MidiModifier::scriptSetLoop>::create(this, result);
 		return kMiniscriptInstructionOutcomeContinue;
+	} else if (attrib == "playnote") {
+		DynamicValueWriteFuncHelper<MidiModifier, &MidiModifier::scriptSetPlayNote>::create(this, result);
+		return kMiniscriptInstructionOutcomeContinue;
 	}
 
 	return Modifier::writeRefAttribute(thread, result, attrib);
@@ -1122,6 +1128,25 @@ MiniscriptInstructionOutcome MidiModifier::scriptSetNoteVelocity(MiniscriptThrea
 	return kMiniscriptInstructionOutcomeContinue;
 }
 
+MiniscriptInstructionOutcome MidiModifier::scriptSetNoteDuration(MiniscriptThread *thread, const DynamicValue &value) {
+	double asDouble = 0.0;
+	if (value.getType() == DynamicValueTypes::kFloat) {
+		asDouble = value.getFloat();
+	} else {
+		DynamicValue converted;
+		if (!value.convertToType(DynamicValueTypes::kFloat, converted))
+			return kMiniscriptInstructionOutcomeFailed;
+		asDouble = converted.getFloat();	
+	}
+
+	if (_mode == kModeSingleNote) {
+		debug(2, "MIDI (%x '%s'): Changing note duration to %g", getStaticGUID(), getName().c_str(), asDouble);
+		_modeSpecific.singleNote.duration = asDouble;
+	}
+
+	return kMiniscriptInstructionOutcomeContinue;
+}
+
 MiniscriptInstructionOutcome MidiModifier::scriptSetNoteNum(MiniscriptThread *thread, const DynamicValue &value) {
 	int32 asInteger = 0;
 	if (!value.roundToInt(asInteger))
@@ -1159,6 +1184,11 @@ MiniscriptInstructionOutcome MidiModifier::scriptSetLoop(MiniscriptThread *threa
 	return kMiniscriptInstructionOutcomeContinue;
 }
 
+MiniscriptInstructionOutcome MidiModifier::scriptSetPlayNote(MiniscriptThread *thread, const DynamicValue &value) {
+	warning("MIDI PlayNote is not yet implemented!");
+	return kMiniscriptInstructionOutcomeContinue;
+}
+
 MiniscriptInstructionOutcome MidiModifier::scriptSetMuteTrack(MiniscriptThread *thread, size_t trackIndex, bool muted) {
 	if (trackIndex >= 16) {
 		thread->error("Invalid track index for mutetrack");
diff --git a/engines/mtropolis/plugin/standard.h b/engines/mtropolis/plugin/standard.h
index 00039be36aa..fc754fdd46a 100644
--- a/engines/mtropolis/plugin/standard.h
+++ b/engines/mtropolis/plugin/standard.h
@@ -239,8 +239,10 @@ private:
 
 	MiniscriptInstructionOutcome scriptSetVolume(MiniscriptThread *thread, const DynamicValue &value);
 	MiniscriptInstructionOutcome scriptSetNoteVelocity(MiniscriptThread *thread, const DynamicValue &value);
+	MiniscriptInstructionOutcome scriptSetNoteDuration(MiniscriptThread *thread, const DynamicValue &value);
 	MiniscriptInstructionOutcome scriptSetNoteNum(MiniscriptThread *thread, const DynamicValue &value);
 	MiniscriptInstructionOutcome scriptSetLoop(MiniscriptThread *thread, const DynamicValue &value);
+	MiniscriptInstructionOutcome scriptSetPlayNote(MiniscriptThread *thread, const DynamicValue &value);
 
 	MiniscriptInstructionOutcome scriptSetMuteTrack(MiniscriptThread *thread, size_t trackIndex, bool muted);
 


Commit: b2fdf3f31cb2be1dfdc2824758401027439526ef
    https://github.com/scummvm/scummvm/commit/b2fdf3f31cb2be1dfdc2824758401027439526ef
Author: elasota (ejlasota at gmail.com)
Date: 2022-06-23T19:50:18-04:00

Commit Message:
MTROPOLIS: Identify some more in some more attributes

Changed paths:
    engines/mtropolis/runtime.h


diff --git a/engines/mtropolis/runtime.h b/engines/mtropolis/runtime.h
index 15a69509abc..b30f74e16bb 100644
--- a/engines/mtropolis/runtime.h
+++ b/engines/mtropolis/runtime.h
@@ -194,9 +194,24 @@ enum AttributeID {
 	kAttribDirect = 56,
 	kAttribVisible = 58,
 	kAttribLayer = 24,
+	kAttribPaused = 25,
+	kAttribLoop = 57,
 	kAttribPosition = 1,
 	kAttribWidth = 2,
 	kAttribHeight = 3,
+	kAttribRate = 4,
+	kAttribRange = 5,
+	kAttribCel = 6,
+	kAttribLoopBackForth = 59,
+	kAttribPlayEveryFrame = 60,
+	kAttribTimeValue = 16,
+	kAttribTrackDisable = 51,
+	kAttribTrackEnable = 50,
+	kAttribVolume = 13,
+	kAttribBalance = 26,
+	kAttribText = 7,
+	kAttribMasterVolume = 18,
+	kAttribUserTimeout = 19,
 };
 
 } // End of namespace AttributeIDs




More information about the Scummvm-git-logs mailing list