AUv3: Subclass of AUViewController receives NSWindow.didUpdateNotification while NSWindow.willCloseNotification is not received.
| Originator: | volodymyr.gorlov | ||
| Number: | rdar://33202311 | Date Originated: | July 9 2017 |
| Status: | Open | Resolved: | |
| Product: | macOS + SDK | Product Version: | |
| Classification: | Reproducible: |
Summary: I created sample AudioUnit v3 with UI for macOS. This AudioUnit has DSP processing part and visualisation part (i.e. Level meter). CVDisplayLink and MTKView used to represent signal level on AudioUnit UI. I need to know when AUv3 host closes or hides the AudioUnit UI. This will help me to suspend calculation of signal level when it is not needed (i.e. when AudioUnit UI is closed, miniaturized or overlapped by other window). So, I subscribed for notifications: NSWindow.willCloseNotification, NSWindow.willMoveNotification, NSWindow.willMiniaturizeNotification, NSWindow.didUpdateNotification. As result sample AudioUnit UI receives NSWindow.didUpdateNotification while other notifications not received. My question: How to know in AudioUnit v3 (which "lives" out of the process) that Host Application did close/open, hide/unhide, miniaturize/deminiaturize window which contains "embedded" AudioUnit User interface. Thanks! Steps to Reproduce: 1. Download example project from git repository (https://github.com/vgorloff/Radar33202311). 2. Launch "AttenuatorAU" schema and select "GarageBand.app" as a AUv3 Host application. 3. Load "AttenuatorAU" plugin: "AudioUnits -> WaveLabsUA -> Attenuator" 4. Open plugin UI. 5. Move plugin UI. Close plugin UI. Expected Results: Xcode Debug Area console shows print statements: [EDITED] ===> NSWindow.didUpdateNotification [EDITED] ~~~> NSWindowDelegate.windowDidUpdate [EDITED] ===> NSWindow.willMoveNotification [EDITED] ~~~> NSWindowDelegate.windowWillMove [EDITED] ===> NSWindow.willCloseNotification [EDITED] ~~~> NSWindowDelegate.windowWillClose Observed Results: Xcode Debug Area console shows print statements: [EDITED] ===> NSWindow.didUpdateNotification [EDITED] ~~~> NSWindowDelegate.windowDidUpdate Xcode Debug Area console NOT shows print statements: [EDITED] ===> NSWindow.willMoveNotification [EDITED] ~~~> NSWindowDelegate.windowWillMove [EDITED] ===> NSWindow.willCloseNotification [EDITED] ~~~> NSWindowDelegate.windowWillClose Version: macOS: 10.12.5 (16F73) Xcode 9 beta 1: Version 9.0 beta (9M136h) GarageBand: 10.2.0 (4769.13)
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!