Closed kozinski closed 3 years ago
Why was this missing from servermode? Great find.
This patch introduces a code duplication for the value->rational aperture conversion. The other code is in pktriggercord-cli.c And the two methods are not exactly the same.
Can you merge the two, similarly to fa01735459cfc3bbfd2cb6f5dcf65b1a4499c3d7 ?
Sure, I split the aperture parsing function out into a separate function, the same way parse_shutter_speed currently works.
I think there's really no reason to handle f-numbers >= 11 specially, since the camera accepts them as rational numbers with a denom of 10, and having the nom always be the f-number 10 simplifies displaying the resultant value. I therefore removed this from your aperture parsing code, and the aperture is always stored as (f 10)/10. Let me know if there is some reason to put in the extra check for f-numbers >= 11 (although if so, it should probably be for >= 10, since 10 is a valid f-number when the camera is set to 1/3 stop adjustments).
Yes, the F>=11 check looks rather unnecessary, this patch was also working for my K-x. I like the simplification.
Thanks @kozinski, committed.
Servermode didn't previously support setting the camera's aperture; this change adds the set_aperture command to allow the aperture to be adjusted.
Tested on a Pentax K10D (connected to a Raspberry Pi 4B) and it seems to work as expected.