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

path through ignored event to output device #3

Merged
merged 1 commit into from
Oct 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 16 additions & 2 deletions Midi.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ Global midiLabelCallbacks := True
; Enable or disable lazy midi in event debugging via tooltips
Global midiEventTooltips := False

; Enable or disable path through event that not handled to output device
Global midiEventPassThrough := False

; Midi class interface
Class Midi
Expand Down Expand Up @@ -820,18 +822,30 @@ __MidiInCallback( wParam, lParam, msg )

; Iterate over all the label callbacks we built during this event and jump
; to them now (if they exist elsewhere in the code)
eventHandled := False

If ( midiLabelCallbacks )
{
For labelIndex, labelName In labelCallbacks
{
If IsLabel( labelName )
If IsLabel( labelName ){
eventHandled := True
Gosub %labelName%
}
}
}
}

; Call debugging if enabled
__MidiEventDebug( midiEvent )

; pass through to midi out
if ( midiEventPassThrough && ! eventHandled && __midiOutOpenHandlesCount > 0 )
{
for deviceId, hndl In __midiOutOpenHandles
{
midiOutResult := DllCall( "winmm.dll\midiOutShortMsg", UINT, hndl, UINT, rawBytes )
}
}
}


Expand Down