summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2013-01-09 20:04:22 +0000
committerMarcus Meissner <marcus@jet.franken.de>2013-01-09 20:04:22 +0000
commit75fb88d5de44babca30c870998ea6c998877fcf1 (patch)
treef1522b2d9f0f74a9409170dfd9b3945f4f49620f
parent4d3129c1c74e3c2c0b39f152810383e5186b1166 (diff)
downloadlibgphoto2-75fb88d5de44babca30c870998ea6c998877fcf1.tar.gz
use a -3 to 3 range
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14175 67ed7778-7388-44ab-90cf-0a291f65f57c
-rw-r--r--examples/focus.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/examples/focus.c b/examples/focus.c
index 8268ccd98..077b7deeb 100644
--- a/examples/focus.c
+++ b/examples/focus.c
@@ -77,7 +77,7 @@ out:
/* Manual focusing a camera...
- * xx is -2 / -1 / 0 / 1 / 2
+ * xx is -3 / -2 / -1 / 0 / 1 / 2 / 3
*/
int
camera_manual_focus (Camera *camera, int xx, GPContext *context) {
@@ -114,7 +114,7 @@ camera_manual_focus (Camera *camera, int xx, GPContext *context) {
goto out;
}
if (choices == 7) { /* see what Canon has in EOS_MFDrive */
- ret = gp_widget_get_choice (child, xx+3, (const char**)&mval);
+ ret = gp_widget_get_choice (child, xx+4, (const char**)&mval);
if (ret < GP_OK) {
fprintf (stderr, "could not get widget choice %d: %d\n", xx+2, ret);
goto out;
@@ -136,14 +136,17 @@ camera_manual_focus (Camera *camera, int xx, GPContext *context) {
}
switch (xx) { /* Range is on Nikon from -32768 <-> 32768 */
- case -2: rval = -1024;break;
- case -1: rval = -256;break;
- case 0: rval = 0; break;
- case 1: rval = 256;break;
- case 2: rval = 1024;break;
+ case -3: rval = -1024;break;
+ case -2: rval = -512;break;
+ case -1: rval = -128;break;
+ case 0: rval = 0;break;
+ case 1: rval = 128;break;
+ case 2: rval = 512;break;
+ case 3: rval = 1024;break;
default: rval = xx; break; /* hack */
}
+
fprintf(stderr,"manual focus %d -> %f\n", xx, rval);
ret = gp_widget_set_value (child, &rval);