Closed swingingtom closed 11 months ago
Check the forLabel factory function: https://github.com/dimensional-de/napi-canon-cameras/blob/0663e4c02f9fb070bb5638f3b8f573fb5eed416c/tests/common/ShutterSpeed.test.ts#L45
Apparently you cannot just pass the class but rather it should be the actual value/number. This should be the expected behavior anyway if we're looking into Option.IDs enum, which its key correspond to a value.
To update a shutter speed, you can either (a) pass the hex (which can be found in the SDK document, e.g. shutter speed at page 114), (b) pass the decimal value of the hex (so 0x10 -> 16, any other examples for shutter speed already mapped by the repo contributor here), or (c) use ShutterSpeed.value
property (so it'll be ShutterSpeed.forLabel('1/1000').value
).
Here's an example for the (c) option:
camera.setProperties({
[CameraProperty.ID.Tv]: ShutterSpeed.forLabel('1/1000').value,
});
Hi ! First many thanks for this library 👍 Very useful. And this issue is not an issue with the implementation of the library.
Example I found didn't really showed how to use shutterSpeed properties. At end of day, I succeed to get it work
0x10
value has been found from@dimensional/napi-canon-cameras/src/library/shutter-speed.cc
https://github.com/dimensional-de/napi-canon-cameras/blob/de572fe31d027f2a386bd4af70e042b8ae5caa56/src/library/shutter-speed.cc#L18Before finding this solution, I've tried many other ways. Usually resulting in :
So Im wondering, how would you use the
ShutterSpeed
class make to code more readable than0x10
?Thanks!