summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2015-11-11 21:53:55 +0100
committerMarcus Meissner <marcus@jet.franken.de>2015-11-11 21:53:55 +0100
commit188a385005f86000fda0c36c0f075888b494f4d2 (patch)
treeacab08dc3f7762bb79a71640d82dc222a6b27654
parent7748d56c80799e7384b9d4995ccb5398c3d467c9 (diff)
downloadlibgphoto2-188a385005f86000fda0c36c0f075888b494f4d2.tar.gz
0xffffffff sony shutterspeed is likely bulb mode
-rw-r--r--camlibs/ptp2/config.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c
index b50d6cc70..bf5ac4b01 100644
--- a/camlibs/ptp2/config.c
+++ b/camlibs/ptp2/config.c
@@ -3535,12 +3535,16 @@ _get_Sony_ShutterSpeed(CONFIG_GET_ARGS) {
gp_widget_new (GP_WIDGET_RADIO, _(menu->label), widget);
gp_widget_set_name (*widget, menu->name);
- x = dpd->CurrentValue.u32>>16;
- y = dpd->CurrentValue.u32&0xffff;
- if (y == 1)
- sprintf (buf, "%d",x);
- else
- sprintf (buf, "%d/%d",x,y);
+ if (dpd->CurrentValue.u32 == 0xffffffff) {
+ strcpy(buf,_("Bulb"));
+ } else {
+ x = dpd->CurrentValue.u32>>16;
+ y = dpd->CurrentValue.u32&0xffff;
+ if (y == 1)
+ sprintf (buf, "%d",x);
+ else
+ sprintf (buf, "%d/%d",x,y);
+ }
gp_widget_set_value (*widget, buf);
return GP_OK;
}
@@ -3558,6 +3562,11 @@ _put_Sony_ShutterSpeed(CONFIG_PUT_ARGS) {
CR (gp_widget_get_value (widget, &val));
+ if (!strcmp(val,_("Bulb"))) {
+ propval->u32 = 0xffffffff;
+ return GP_OK;
+ }
+
x = dpd->CurrentValue.u32>>16;
y = dpd->CurrentValue.u32&0xffff;
old = ((float)x)/(float)y;