Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kdmapi.h DriverSettingsCase broken, causes DriverSettings to always return FALSE without changing settings. #274

Open
LaxLacks opened this issue Apr 3, 2024 · 0 comments

Comments

@LaxLacks
Copy link

LaxLacks commented Apr 3, 2024

Finding it impossible to unlock 128 MIDI channels with 14.8.2 via the DriverSettings API call.

Issue 1, the inline if at the top is intended to include multiple lines and requires a code block. It will always return FALSE here before even checking cbValue

Issue 2, Mode is always changed to OM_SET and requires == in place of =

Here's a fixed version:

diff --git a/OmniMIDI/kdmapi.h b/OmniMIDI/kdmapi.h
index 54637901..bdeaf0ce 100644
--- a/OmniMIDI/kdmapi.h
+++ b/OmniMIDI/kdmapi.h
@@ -7,10 +7,10 @@ Thank you Kode54 for allowing me to fork your awesome driver.
 
 #define DriverSettingsCase(Setting, Mode, Type, SettingStruct, Value, cbValue) \
 	case Setting: \
-		if (!SettingsManagedByClient) PrintMessageToDebugLog(#Setting, "Please send OM_MANAGE first!!!"); return FALSE; \
+		if (!SettingsManagedByClient) { PrintMessageToDebugLog(#Setting, "Please send OM_MANAGE first!!!"); return FALSE; } \
 		if (cbValue != sizeof(Type)) return FALSE; \
-		if (Mode = OM_SET) SettingStruct = *(Type*)Value; \
-		else if (Mode = OM_GET) *(Type*)Value = SettingStruct; \
+		if (Mode == OM_SET) SettingStruct = *(Type*)Value; \
+		else if (Mode == OM_GET) *(Type*)Value = SettingStruct; \
 		else return FALSE; \
 		break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant