03-22-2019, 01:18 AM | #1 |
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
ReaScript: MIDIEditor_GetMode fails on macOS (FIXED)
On WindowsOS and Linux, MIDIEditor_GetMode is useful for testing whether a MIDI editor window still exists. If it doesn't, the function returns -1.
On macOS, the function fails if the editor has been closed, and raises an error. |
03-28-2019, 07:54 PM | #2 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,117
|
Fixing (though the behavior in this scenario on Windows is also hit or a miss)
|
03-29-2019, 06:23 AM | #3 |
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
I think it is important to have functions such as MIDIEditor_GetMode and ValidatePtr2 with type "Window*" that can *reliably and quickly* check whether a window still exists, since, on macOS and Linux, WDL/swell functions as well as native API functions such as DockIsChildOfDock may crash REAPER dramatically if the HWND argument refers to a window that doesn't exist any more.
|
03-29-2019, 08:19 AM | #4 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,117
|
MIDIEditor_GetMode() handling this gracefully is straightforward. DockIsChildOfDock() however is a bit tricky, ugh. Hmmmm
|
Thread Tools | |
Display Modes | |
|
|