Wait for UI to update after LrSelection.nextPhoto()
Goal: Have my plugin wait for the UI to fully catch up after calling LrSelection.nextPhoto() in the Develop Module before making another call to LrSelection.nextPhoto().
The last UI element to update seems to be the Auto button in the basic panel. That happens much faster for some raw file types than it does for others (horribly slow for Fuji XT-3 raw types). I want to wait for that to happen before taking other actions, like moving to the next photo again.
I have done my best to search through the latest SDK documentation and this forum but haven't yet found a way to accomplish my goal. Here are some of the things I have tried:
- Incrementing Exposure by 1 and waiting for getDevelopSettings() to reflect the update before doing anything else. The expsoure increment seems to work just fine, gets applied to all of the photos as I go throug them one by one, but does not give sufficient time for the UI to update before moving on to the next photo.
- Registered an addAdjustmentChangeObserver and wait for all of the adjustments to change before moving to the next photo. In testing this it seemed there were almost always 6 adjustmentChange events with every nextPhoto() call, but not always. Even after waiting for there to be no more adjustmentChange events for 100ms this didn't allow for the UI to update (Auto button lit).
- Registered the undocumented addActivePhotoChangeObserver, which does reliably say that the active photo changed once per nextPhoto() call, but the event happens much faster than the UI updating.
- Make an external call out to openCV to watch the area where the Auto button is and watch for it to go unlit, then lit.
Number 4 works perfectly, but it is both extremely brittle and would reqauire openCV be installed on any computer that uses my plugin. Is there a better way to know that the UI has fully updated after calling LrSelection.nextPhoto(). I would be fine with polling some table for a value that would tell me it is done, but I can't figure out what I would poll.
