jdxi_editor.utils.macos_activity
macOS: tell the system that the app is doing latency-critical work.
macOS throttles the timers of an app it thinks is idle (App Nap, timer coalescing): a timed wait ends late, by tens of milliseconds — notes of a MIDI file or a pattern off their beat, a reading’s timeouts reached early. While playing, the editor holds an NSProcessInfo activity “user initiated, latency critical”, as audio and MIDI applications do; Windows has timeBeginPeriod for the same purpose. Elsewhere, and if anything goes wrong, nothing happens.
Done through the Objective-C runtime with ctypes (no PyObjC needed). objc_msgSend is called with the exact prototype of each method: on Apple silicon it must not be called as a variadic function.
Attributes
Functions
|
|
|
objc_msgSend with this prototype: (receiver, selector, *argtypes) -> restype. |
|
|
|
Start the activity; its token (to give to end()), or None if not on macOS or not possible. |
|
End the activity begun with begin(). |
Module Contents
- jdxi_editor.utils.macos_activity._send(restype, *argtypes)[source]
objc_msgSend with this prototype: (receiver, selector, *argtypes) -> restype.