Closed mathieucarbou closed 7 years ago
@rsjaffe :I don't really understand the issue and especially what is this Camera Raw Setting. It is like the user ran into a sort of asynchronous issue I guess ?
Basically, setting point curve is done by setting some values to ToneCurvePV2012 with these function.
I could see 2 issues here:
The call to CU.fChangePanel('tonePanel')
: This was necessary to switch to the tonePanel
, but now, with the reveal being optional (MIDI2LR option), perhaps we should fix that ?
ApplySettings
is async. I first tried to make this call non async but it didn't work. I am wondering if calling asynchronously LrApplication.activeCatalog():getTargetPhoto():applyDevelopSettings(settings)
is right because it goes to the LR queue I think and does not get executed immediately so if MIDI2LR received just after another command, perhaps this second command gets executed before it ?
I see 2 solutions for point 2:
Introducing a queuing system in MIDI2LR to enqueue all incoming commands so that we wait for async tasks to finish before dequeuing next task (this one is not the only one).
Try to find a way to make this settings apply synchronously ? I didn't find one but you probably know LR API better than me ;-)
local function UpdatePointCurve(settings)
return function()
CU.fChangePanel('tonePanel')
CU.ApplySettings(settings)
end
end
local function ApplySettings(settings)
if LrApplication.activeCatalog():getTargetPhoto() == nil then return end
LrTasks.startAsyncTask ( function ()
LrApplication.activeCatalog():withWriteAccessDo(
'MIDI2LR: Apply settings',
function() LrApplication.activeCatalog():getTargetPhoto():applyDevelopSettings(settings) end,
{ timeout = 4,
callback = function()
LrDialogs.showError(LOC("$$$/AgCustomMetadataRegistry/UpdateCatalog/Error=The catalog could not be updated with additional module metadata.")..' ApplySettings')
end,
asynchronous = true
}
)
end
)
end
update: also, i am not able to reproduce with TouchOSC. Even with my 5-years old laptop that is slow with LR. I disabled the pickup mode: could he perhaps try that ?
Closing in favor of #333 (more general task) : there's a non acceptable workaround right now, i.e. by slowing down the sequence of clicks from the user, moving tracking delay (and perhaps also pickup mode ?)
Report from: https://groups.google.com/forum/#!topic/midi2lr/jo00fYFRnVY
I just programmed some switches of my BCF2000 to perform linear/medium/high contrast from the "tone curve” menu (1.5.0.2). It works, but from time to time other operations are performed, like Camera Raw Settings (whatever that is). Usually, but not always the sequence is for example (1) medium Contrast, (2) any other push button operation, (3) medium contrast again. For (3) the "Camera Raw Setting" function is executed. Pushing "Medium Contrast" again now does the right operation and everything starts over again.
Unfortunately that also happens, if I step on to work on the next image. All other functions seem to be o.k. I programmed button 9-11 on the 2 switch rows, toggle is OFF.