diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2019-07-07 20:34:13 +0200 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2019-07-07 20:34:13 +0200 |
commit | 12f2ae7f489db4db799c0fd454480732918e5047 (patch) | |
tree | d2d9abd4167c7e7e911b691cc827be84634267c7 /camlibs/lumix | |
parent | 2b22ebfe43e8aac831773c759f291753065433a8 (diff) | |
download | libgphoto2-12f2ae7f489db4db799c0fd454480732918e5047.tar.gz |
able to set/get devicename (that uses the camera)
comments about startup
Diffstat (limited to 'camlibs/lumix')
-rw-r--r-- | camlibs/lumix/lumix.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/camlibs/lumix/lumix.c b/camlibs/lumix/lumix.c index 06ae2ec86..7f16d8f0b 100644 --- a/camlibs/lumix/lumix.c +++ b/camlibs/lumix/lumix.c @@ -547,6 +547,11 @@ Get_LiveViewSize(Camera *camera) { } static char* +Get_DeviceName(Camera *camera) { + return generic_setting_getter(camera,"device_name"); +} + +static char* Get_FocusMode(Camera *camera) { return generic_setting_getter(camera,"focusmode"); } @@ -1190,6 +1195,11 @@ camera_config_get (Camera *camera, CameraWidget **window, GPContext *context) gp_widget_set_value (widget, Get_LiveViewSize(camera)); gp_widget_append (section, widget); + gp_widget_new (GP_WIDGET_TEXT, _("Device Name"), &widget); + gp_widget_set_name (widget, "devicename"); + gp_widget_set_value (widget, Get_DeviceName(camera)); + gp_widget_append (section, widget); + gp_widget_new (GP_WIDGET_TEXT, _("Focus Mode"), &widget); gp_widget_set_name (widget, "focusmode"); gp_widget_set_value (widget, Get_FocusMode(camera)); @@ -1320,6 +1330,14 @@ camera_config_set (Camera *camera, CameraWidget *window, GPContext *context) sprintf(buf,"cam.cgi?mode=setsetting&type=liveviewsize&value=%s", val); loadCmd(camera,buf); } + if ((GP_OK == gp_widget_get_child_by_name(window, "devicename", &widget)) && gp_widget_changed (widget)) { + char buf[50]; + + if (GP_OK != (ret = gp_widget_get_value (widget, &val))) + return ret; + sprintf(buf,"cam.cgi?mode=setsetting&type=device_name&value=%s", val); + loadCmd(camera,buf); + } return GP_OK; } @@ -1840,6 +1858,13 @@ camera_init (Camera *camera, GPContext *context) } gp_filesystem_set_funcs (camera->fs, &fsfuncs, camera); +/* + startup code might need: + + loadCmd(camera,"cam.cgi?mode=accctrl&type=req_acc&value=4D454930-0100-1000-8001-020D0090325B&value2=GT-I9300"); + loadCmd(camera,"cam.cgi?mode=setsetting&type=device_name&value=GT-I9300"); +*/ + if (switchToRecMode (camera) != NULL) { int numpix; |