-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi again!

Hey, I really didn't expect it, but I got the whole thing to work :-)

I think the trick was that you have to query the setting once before you
set it. At least it works this way ;-)

The patch is attached for everyone to test out. (Perhaps i'll also put
it somewhere on my website or the capture-maintainers (?) could have a
look at it.)

It also contains a quick-and-dirty hack to query settings from the
camera. You can get the current values of settings by just writing the
name of the setting (and no value for it).

And last but not least: The powershot G7 seems to have some additional
zoom, so I updated the list of allowed zoom values.

Another bug I think I'm about to fix in the near future is that capture
sometimes times out when using long shutter speeds. Has anyone had a
look at this yet?

Best regards,
Christian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGBelt2AXM+youhOQRAjtEAJ0bJarYqvzAPltpnFZ3EobPj/EDIgCg4Mk/
K9aNBD6U6Q5LGBfMbr5uyHg=
=+IPC
-----END PGP SIGNATURE-----
Index: commands.c
===================================================================
RCS file: /cvsroot/capture/capture/commands.c,v
retrieving revision 1.11
diff -r1.11 commands.c
201a202,203
>       uint16_t value;
>       PTPDevicePropDesc dpd;
202a205,214
> 
>       memset(&dpd, 0, sizeof(dpd));
> 
>       if (getarg(args, NULL) == NULL) {
>           RUN_N_CHK(ptp_getdevicepropdesc(&settings.params, cmd->ptpcode, &dpd));
>           msg_cmd_error(cmd->command , "Current value: \"%s\".",
>                   get_name_from_code(cmd->params, *(uint16_t*)dpd.CurrentValue));
>           ptp_free_devicepropdesc(&dpd);
>           return 0;
>       }
205d216
< 
210a222
>       value = prop;
212c224,236
<       RUN_N_CHK( set_prop16(&settings, cmd->ptpcode, prop) );
---
>       /* the next two lines are needed to set the value */
>       RUN_N_CHK(ptp_getdevicepropdesc(&settings.params,cmd->ptpcode,&dpd));
>       ptp_free_devicepropdesc(&dpd);
> 
>       RUN_N_CHK(ptp_setdevicepropvalue(&settings.params, cmd->ptpcode, &value, dpd.DataType));
>       RUN_N_CHK(ptp_getdevicepropdesc(&settings.params, cmd->ptpcode, &dpd));
>       if (value != *(uint16_t*)dpd.CurrentValue) {
>             msg_cmd_error(cmd->command, "Set to \"%s\".",
>                     get_name_from_code(cmd->params, *(uint16_t*)dpd.CurrentValue));
>       } else {
>             msg_cmd_ok(cmd->command);
>       }
>       ptp_free_devicepropdesc(&dpd);
214d237
<       msg_cmd_ok(cmd->command);
221a245
>       PTPDevicePropDesc dpd;
222a247,256
> 
>       memset(&dpd, 0, sizeof(dpd));
> 
>       if (getarg(args, NULL) == NULL) {
>           RUN_N_CHK(ptp_getdevicepropdesc(&settings.params, cmd->ptpcode, &dpd));
>           msg_cmd_error(cmd->command , "Current value: \"%s\".",
>                   get_name_from_code(cmd->params, *(uint8_t*)dpd.CurrentValue));
>           ptp_free_devicepropdesc(&dpd);
>           return 0;
>       }
Index: properties.c
===================================================================
RCS file: /cvsroot/capture/capture/properties.c,v
retrieving revision 1.7
diff -r1.7 properties.c
150,153c150,158
<       { 7, "1.3"},
<       { 8, "1.6"},
<       { 9, "2.0"},
<       { 10, "2.5"},
---
>       { 7, "7"},
>       { 8, "8"},
>       { 9, "9"},
>       { 10, "10"},
>       { 11, "11"},
>       { 12, "12"},
>       { 13, "13"},
>       { 14, "14"},
>       { 15, "15"},
345a351,362
> char *get_name_from_code(allowed_t *all, int code)
> {
>       while ( all && all->string )
>       {
> 	    if (all->code == code)
>                return all->string;
> 
> 	    all++;
>       }
>       return "Unknown";
> }
> 
Index: properties.h
===================================================================
RCS file: /cvsroot/capture/capture/properties.h,v
retrieving revision 1.5
diff -r1.5 properties.h
53a54
> char *get_name_from_code(allowed_t *prop, int code);
Index: server.c
===================================================================
RCS file: /cvsroot/capture/capture/server.c,v
retrieving revision 1.4
diff -r1.4 server.c
175c175
<       *n = p-s;
---
>       if (n != NULL) *n = p-s;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Capture-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/capture-devel

Reply via email to