2009-07-28 Axel Waggershauser <awagger@web.de>
* canon.c,canon.h,library.c,usb.c: Unified all configuration names and values. Added /actions and /status sub configuration for actions and read-only variables. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12292 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2009-07-28 Axel Waggershauser <awagger@web.de>
|
||||
|
||||
* canon.c,canon.h,library.c,usb.c: Unified all configuration
|
||||
names and values. Added /actions and /status sub configuration
|
||||
for actions and read-only variables.
|
||||
|
||||
2008-07-10 Marcus Meissner <marcus@jet.franken.de>
|
||||
|
||||
* canon.c: Also handle IXUS 500 in the ptp2 driver only.
|
||||
|
||||
@@ -1784,7 +1784,7 @@ canon_int_get_release_params (Camera *camera, GPContext *context)
|
||||
|
||||
|
||||
camera->pl->secondary_image = 0;
|
||||
/* Based on the resolution settings in the release params,
|
||||
/* Based on the image format settings in the release params,
|
||||
determine whether we expect one or two images to be returned
|
||||
by the camera.
|
||||
I am not sure if this will work correctly for non-EOS 5D
|
||||
@@ -1796,7 +1796,7 @@ canon_int_get_release_params (Camera *camera, GPContext *context)
|
||||
only save the primary image to disk.
|
||||
Thanks - <paul@booyaka.com>
|
||||
*/
|
||||
if (camera->pl->release_params[RESOLUTION_2_INDEX] & 0xf0)
|
||||
if (camera->pl->release_params[IMAGE_FORMAT_2_INDEX] & 0xf0)
|
||||
camera->pl->secondary_image = 1;
|
||||
|
||||
return GP_OK;
|
||||
@@ -2022,27 +2022,27 @@ canon_int_set_zoom (Camera *camera, canonZoomLevel zoom_level,
|
||||
|
||||
|
||||
/**
|
||||
* canon_int_set_resolution
|
||||
* canon_int_set_image_format
|
||||
* @camera: camera to work with
|
||||
* @res_byte1: byte 1 of the 3-byte resolution code
|
||||
* @res_byte2: byte 2 of the 3-byte resolution code
|
||||
* @res_byte3: byte 3 of the 3-byte resolution code
|
||||
*
|
||||
* @res_byte1: byte 1 of the 3-byte image format code
|
||||
* @res_byte2: byte 2 of the 3-byte image format code
|
||||
* @res_byte3: byte 3 of the 3-byte image format code
|
||||
*
|
||||
* @context: context for error reporting
|
||||
*
|
||||
* Sets the camera's output image resolution. Only tested for EOS 5D via USB.
|
||||
* Sets the camera's output image format. Only tested for EOS 5D via USB.
|
||||
*
|
||||
* Returns: gphoto2 error code
|
||||
*
|
||||
*/
|
||||
int
|
||||
canon_int_set_resolution (Camera *camera, unsigned char res_byte1,
|
||||
canon_int_set_image_format (Camera *camera, unsigned char res_byte1,
|
||||
unsigned char res_byte2, unsigned char res_byte3,
|
||||
GPContext *context)
|
||||
{
|
||||
int status;
|
||||
|
||||
GP_DEBUG ("canon_int_set_resolution() called");
|
||||
GP_DEBUG ("canon_int_set_image_format() called");
|
||||
|
||||
/* Get the current camera settings */
|
||||
|
||||
@@ -2051,14 +2051,14 @@ canon_int_set_resolution (Camera *camera, unsigned char res_byte1,
|
||||
if (status < 0)
|
||||
return status;
|
||||
|
||||
/* Modify the resolution */
|
||||
/* Modify the image format */
|
||||
|
||||
camera->pl->release_params[RESOLUTION_1_INDEX] = res_byte1;
|
||||
camera->pl->release_params[RESOLUTION_2_INDEX] = res_byte2;
|
||||
camera->pl->release_params[RESOLUTION_3_INDEX] = res_byte3;
|
||||
camera->pl->release_params[IMAGE_FORMAT_1_INDEX] = res_byte1;
|
||||
camera->pl->release_params[IMAGE_FORMAT_2_INDEX] = res_byte2;
|
||||
camera->pl->release_params[IMAGE_FORMAT_3_INDEX] = res_byte3;
|
||||
|
||||
|
||||
/* Upload the resolution to the camera */
|
||||
/* Upload the image_format to the camera */
|
||||
status = canon_int_set_release_params (camera, context);
|
||||
|
||||
if (status < 0)
|
||||
@@ -2078,21 +2078,21 @@ canon_int_set_resolution (Camera *camera, unsigned char res_byte1,
|
||||
if (status < 0)
|
||||
return status;
|
||||
|
||||
if (camera->pl->release_params[RESOLUTION_1_INDEX] != res_byte1 ||
|
||||
camera->pl->release_params[RESOLUTION_2_INDEX] != res_byte2 ||
|
||||
camera->pl->release_params[RESOLUTION_3_INDEX] != res_byte3) {
|
||||
GP_DEBUG ("canon_int_set_resolution: Could not set resolution "
|
||||
if (camera->pl->release_params[IMAGE_FORMAT_1_INDEX] != res_byte1 ||
|
||||
camera->pl->release_params[IMAGE_FORMAT_2_INDEX] != res_byte2 ||
|
||||
camera->pl->release_params[IMAGE_FORMAT_3_INDEX] != res_byte3) {
|
||||
GP_DEBUG ("canon_int_set_image_format: Could not set image format "
|
||||
"to 0x%02x 0x%02x 0x%02x (camera returned 0x%02x 0x%02x 0x%02x)",
|
||||
res_byte1, res_byte2, res_byte3,
|
||||
camera->pl->release_params[RESOLUTION_1_INDEX],
|
||||
camera->pl->release_params[RESOLUTION_2_INDEX],
|
||||
camera->pl->release_params[RESOLUTION_3_INDEX]);
|
||||
return GP_ERROR_CORRUPTED_DATA;
|
||||
camera->pl->release_params[IMAGE_FORMAT_1_INDEX],
|
||||
camera->pl->release_params[IMAGE_FORMAT_2_INDEX],
|
||||
camera->pl->release_params[IMAGE_FORMAT_3_INDEX]);
|
||||
return GP_ERROR_CORRUPTED_DATA;
|
||||
} else {
|
||||
GP_DEBUG ("canon_int_set_resolution: resolution change verified");
|
||||
GP_DEBUG ("canon_int_set_image_format: image_format change verified");
|
||||
}
|
||||
|
||||
GP_DEBUG ("canon_int_set_resolution() finished successfully");
|
||||
GP_DEBUG ("canon_int_set_image_format() finished successfully");
|
||||
|
||||
return GP_OK;
|
||||
}
|
||||
@@ -2339,7 +2339,7 @@ static int
|
||||
canon_int_set_release_params (Camera *camera, GPContext *context)
|
||||
{
|
||||
unsigned char payload[0x4c];
|
||||
unsigned char *msg, *trash_handle;
|
||||
unsigned char *msg = NULL, *trash_handle;
|
||||
unsigned int len, payloadlen, trash_int;
|
||||
int status;
|
||||
|
||||
|
||||
@@ -318,24 +318,24 @@ struct canonShutterSpeedStateStruct {
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
RESOLUTION_RAW = 0,
|
||||
RESOLUTION_RAW_AND_LARGE_FINE_JPEG,
|
||||
RESOLUTION_RAW_AND_LARGE_NORMAL_JPEG,
|
||||
RESOLUTION_RAW_AND_MEDIUM_FINE_JPEG,
|
||||
RESOLUTION_RAW_AND_MEDIUM_NORMAL_JPEG,
|
||||
RESOLUTION_RAW_AND_SMALL_FINE_JPEG,
|
||||
RESOLUTION_RAW_AND_SMALL_NORMAL_JPEG,
|
||||
RESOLUTION_LARGE_FINE_JPEG,
|
||||
RESOLUTION_LARGE_NORMAL_JPEG,
|
||||
RESOLUTION_MEDIUM_FINE_JPEG,
|
||||
RESOLUTION_MEDIUM_NORMAL_JPEG,
|
||||
RESOLUTION_SMALL_FINE_JPEG,
|
||||
RESOLUTION_SMALL_NORMAL_JPEG
|
||||
} canonResolutionState;
|
||||
IMAGE_FORMAT_RAW = 0,
|
||||
IMAGE_FORMAT_RAW_AND_LARGE_FINE_JPEG,
|
||||
IMAGE_FORMAT_RAW_AND_LARGE_NORMAL_JPEG,
|
||||
IMAGE_FORMAT_RAW_AND_MEDIUM_FINE_JPEG,
|
||||
IMAGE_FORMAT_RAW_AND_MEDIUM_NORMAL_JPEG,
|
||||
IMAGE_FORMAT_RAW_AND_SMALL_FINE_JPEG,
|
||||
IMAGE_FORMAT_RAW_AND_SMALL_NORMAL_JPEG,
|
||||
IMAGE_FORMAT_LARGE_FINE_JPEG,
|
||||
IMAGE_FORMAT_LARGE_NORMAL_JPEG,
|
||||
IMAGE_FORMAT_MEDIUM_FINE_JPEG,
|
||||
IMAGE_FORMAT_MEDIUM_NORMAL_JPEG,
|
||||
IMAGE_FORMAT_SMALL_FINE_JPEG,
|
||||
IMAGE_FORMAT_SMALL_NORMAL_JPEG
|
||||
} canonImageFormatState;
|
||||
|
||||
|
||||
struct canonResolutionStateStruct {
|
||||
canonResolutionState value;
|
||||
struct canonImageFormatStateStruct {
|
||||
canonImageFormatState value;
|
||||
char *label;
|
||||
unsigned char res_byte1;
|
||||
unsigned char res_byte2;
|
||||
@@ -418,9 +418,9 @@ struct canonExposureBiasStateStruct {
|
||||
#define RELEASE_PARAMS_LEN 0x2f
|
||||
|
||||
/* These indexes are byte offsets into the release parameter data */
|
||||
#define RESOLUTION_1_INDEX 0x01
|
||||
#define RESOLUTION_2_INDEX 0x02
|
||||
#define RESOLUTION_3_INDEX 0x03
|
||||
#define IMAGE_FORMAT_1_INDEX 0x01
|
||||
#define IMAGE_FORMAT_2_INDEX 0x02
|
||||
#define IMAGE_FORMAT_3_INDEX 0x03
|
||||
#define SELF_TIMER_1_INDEX 0x04 /* Currently not used */
|
||||
#define SELF_TIMER_2_INDEX 0x05 /* Currently not used */
|
||||
#define FLASH_INDEX 0x06
|
||||
@@ -704,7 +704,7 @@ int canon_int_set_iso(Camera *camera, canonIsoState iso, GPContext *context);
|
||||
int canon_int_set_aperture(Camera *camera, canonApertureState aperture, GPContext *context);
|
||||
int canon_int_set_exposurebias(Camera *camera, unsigned char expbias, GPContext *context);
|
||||
int canon_int_set_focus_mode (Camera *camera, canonFocusModeState focus_mode, GPContext *context);
|
||||
int canon_int_set_resolution (Camera *camera, unsigned char res_byte1, unsigned char res_byte2, unsigned char res_byte3, GPContext *context);
|
||||
int canon_int_set_image_format (Camera *camera, unsigned char res_byte1, unsigned char res_byte2, unsigned char res_byte3, GPContext *context);
|
||||
int canon_serial_off(Camera *camera);
|
||||
int canon_int_get_time(Camera *camera, time_t *camera_time, GPContext *context);
|
||||
int canon_int_set_time(Camera *camera, time_t date, GPContext *context);
|
||||
|
||||
@@ -93,27 +93,27 @@ extern long int timezone;
|
||||
#endif
|
||||
|
||||
static const struct canonCaptureSizeClassStruct captureSizeArray[] = {
|
||||
{CAPTURE_COMPATIBILITY, N_("Compatibility mode")},
|
||||
{CAPTURE_COMPATIBILITY, N_("Compatibility Mode")},
|
||||
{CAPTURE_THUMB, N_("Thumbnail")},
|
||||
{CAPTURE_FULL_IMAGE, N_("Full Image")},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
static const struct canonIsoStateStruct isoStateArray[] = {
|
||||
{ISO_100, "ISO 100"},
|
||||
{ISO_125, "ISO 125"},
|
||||
{ISO_160, "ISO 160"},
|
||||
{ISO_200, "ISO 200"},
|
||||
{ISO_250, "ISO 250"},
|
||||
{ISO_320, "ISO 320"},
|
||||
{ISO_400, "ISO 400"},
|
||||
{ISO_500, "ISO 500"},
|
||||
{ISO_640, "ISO 640"},
|
||||
{ISO_800, "ISO 800"},
|
||||
{ISO_1000, "ISO 1000"},
|
||||
{ISO_1250, "ISO 1250"},
|
||||
{ISO_1600, "ISO 1600"},
|
||||
{ISO_3200, "ISO 3200"},
|
||||
{ISO_100, "100"},
|
||||
{ISO_125, "125"},
|
||||
{ISO_160, "160"},
|
||||
{ISO_200, "200"},
|
||||
{ISO_250, "250"},
|
||||
{ISO_320, "320"},
|
||||
{ISO_400, "400"},
|
||||
{ISO_500, "500"},
|
||||
{ISO_640, "640"},
|
||||
{ISO_800, "800"},
|
||||
{ISO_1000, "1000"},
|
||||
{ISO_1250, "1250"},
|
||||
{ISO_1600, "1600"},
|
||||
{ISO_3200, "3200"},
|
||||
{0, NULL},
|
||||
};
|
||||
|
||||
@@ -135,11 +135,11 @@ static const struct canonShutterSpeedStateStruct shutterSpeedStateArray[] = {
|
||||
{SHUTTER_SPEED_1_6_SEC,"1.6"},
|
||||
{SHUTTER_SPEED_1_3_SEC,"1.3"},
|
||||
{SHUTTER_SPEED_1_SEC,"1"},
|
||||
{SHUTTER_SPEED_0_8_SEC,"8/10"},
|
||||
{SHUTTER_SPEED_0_6_SEC,"6/10"},
|
||||
{SHUTTER_SPEED_0_5_SEC,"1/2"},
|
||||
{SHUTTER_SPEED_0_4_SEC,"4/10"},
|
||||
{SHUTTER_SPEED_0_3_SEC,"3/10"},
|
||||
{SHUTTER_SPEED_0_8_SEC,"0.8"},
|
||||
{SHUTTER_SPEED_0_6_SEC,"0.6"},
|
||||
{SHUTTER_SPEED_0_5_SEC,"0.5"},
|
||||
{SHUTTER_SPEED_0_4_SEC,"0.4"},
|
||||
{SHUTTER_SPEED_0_3_SEC,"0.3"},
|
||||
{SHUTTER_SPEED_1_4,"1/4"},
|
||||
{SHUTTER_SPEED_1_5,"1/5"},
|
||||
{SHUTTER_SPEED_1_6,"1/6"},
|
||||
@@ -178,34 +178,34 @@ static const struct canonShutterSpeedStateStruct shutterSpeedStateArray[] = {
|
||||
};
|
||||
|
||||
static const struct canonApertureStateStruct apertureStateArray[] = {
|
||||
{APERTURE_F1_4, "f1.4"},
|
||||
{APERTURE_F1_6, "f1.6"},
|
||||
{APERTURE_F1_8, "f1.8"},
|
||||
{APERTURE_F2_0, "f2.0"},
|
||||
{APERTURE_F2_2, "f2.2"},
|
||||
{APERTURE_F2_5, "f2.5"},
|
||||
{APERTURE_F2_8, "f2.8"},
|
||||
{APERTURE_F3_2, "f3.2"},
|
||||
{APERTURE_F3_5, "f3.5"},
|
||||
{APERTURE_F4_0, "f4.0"},
|
||||
{APERTURE_F4_5, "f4.5"},
|
||||
{APERTURE_F5_0, "f5.0"},
|
||||
{APERTURE_F5_6, "f5.6"},
|
||||
{APERTURE_F6_3, "f6.3"},
|
||||
{APERTURE_F7_1, "f7.1"},
|
||||
{APERTURE_F8, "f8"},
|
||||
{APERTURE_F9, "f9"},
|
||||
{APERTURE_F10, "f10"},
|
||||
{APERTURE_F11, "f11"},
|
||||
{APERTURE_F13, "f13"},
|
||||
{APERTURE_F14, "f14"},
|
||||
{APERTURE_F16, "f16"},
|
||||
{APERTURE_F18, "f18"},
|
||||
{APERTURE_F20, "f20"},
|
||||
{APERTURE_F22, "f22"},
|
||||
{APERTURE_F25, "f25"},
|
||||
{APERTURE_F29, "f29"},
|
||||
{APERTURE_F32, "f32"},
|
||||
{APERTURE_F1_4, "1.4"},
|
||||
{APERTURE_F1_6, "1.6"},
|
||||
{APERTURE_F1_8, "1.8"},
|
||||
{APERTURE_F2_0, "2.0"},
|
||||
{APERTURE_F2_2, "2.2"},
|
||||
{APERTURE_F2_5, "2.5"},
|
||||
{APERTURE_F2_8, "2.8"},
|
||||
{APERTURE_F3_2, "3.2"},
|
||||
{APERTURE_F3_5, "3.5"},
|
||||
{APERTURE_F4_0, "4.0"},
|
||||
{APERTURE_F4_5, "4.5"},
|
||||
{APERTURE_F5_0, "5.0"},
|
||||
{APERTURE_F5_6, "5.6"},
|
||||
{APERTURE_F6_3, "6.3"},
|
||||
{APERTURE_F7_1, "7.1"},
|
||||
{APERTURE_F8, "8"},
|
||||
{APERTURE_F9, "9"},
|
||||
{APERTURE_F10, "10"},
|
||||
{APERTURE_F11, "11"},
|
||||
{APERTURE_F13, "13"},
|
||||
{APERTURE_F14, "14"},
|
||||
{APERTURE_F16, "16"},
|
||||
{APERTURE_F18, "18"},
|
||||
{APERTURE_F20, "20"},
|
||||
{APERTURE_F22, "22"},
|
||||
{APERTURE_F25, "25"},
|
||||
{APERTURE_F29, "29"},
|
||||
{APERTURE_F32, "32"},
|
||||
{0, NULL},
|
||||
};
|
||||
|
||||
@@ -266,32 +266,32 @@ static const struct canonExposureBiasStateStruct exposureBiasStateArray[] = {
|
||||
};
|
||||
|
||||
|
||||
static const struct canonResolutionStateStruct resolutionStateArray[] = {
|
||||
{RESOLUTION_RAW, N_("RAW"),
|
||||
static const struct canonImageFormatStateStruct imageFormatStateArray[] = {
|
||||
{IMAGE_FORMAT_RAW, N_("RAW"),
|
||||
0x04, 0x02, 0x00},
|
||||
{RESOLUTION_SMALL_NORMAL_JPEG, N_("Small Normal JPEG"),
|
||||
{IMAGE_FORMAT_SMALL_NORMAL_JPEG, N_("Small Normal JPEG"),
|
||||
0x02, 0x01, 0x02},
|
||||
{RESOLUTION_SMALL_FINE_JPEG, N_("Small Fine JPEG"),
|
||||
{IMAGE_FORMAT_SMALL_FINE_JPEG, N_("Small Fine JPEG"),
|
||||
0x03, 0x01, 0x02},
|
||||
{RESOLUTION_MEDIUM_NORMAL_JPEG, N_("Medium Normal JPEG"),
|
||||
{IMAGE_FORMAT_MEDIUM_NORMAL_JPEG, N_("Medium Normal JPEG"),
|
||||
0x02, 0x01, 0x01},
|
||||
{RESOLUTION_MEDIUM_FINE_JPEG, N_("Medium Fine JPEG"),
|
||||
{IMAGE_FORMAT_MEDIUM_FINE_JPEG, N_("Medium Fine JPEG"),
|
||||
0x03, 0x01, 0x01},
|
||||
{RESOLUTION_LARGE_NORMAL_JPEG, N_("Large Normal JPEG"),
|
||||
{IMAGE_FORMAT_LARGE_NORMAL_JPEG, N_("Large Normal JPEG"),
|
||||
0x02, 0x01, 0x00},
|
||||
{RESOLUTION_LARGE_FINE_JPEG, N_("Large Fine JPEG"),
|
||||
{IMAGE_FORMAT_LARGE_FINE_JPEG, N_("Large Fine JPEG"),
|
||||
0x03, 0x01, 0x00},
|
||||
{RESOLUTION_RAW_AND_SMALL_NORMAL_JPEG, N_("RAW + Small Normal JPEG"),
|
||||
{IMAGE_FORMAT_RAW_AND_SMALL_NORMAL_JPEG, N_("RAW + Small Normal JPEG"),
|
||||
0x24, 0x12, 0x20},
|
||||
{RESOLUTION_RAW_AND_SMALL_FINE_JPEG, N_("RAW + Small Fine JPEG"),
|
||||
{IMAGE_FORMAT_RAW_AND_SMALL_FINE_JPEG, N_("RAW + Small Fine JPEG"),
|
||||
0x34, 0x12, 0x20},
|
||||
{RESOLUTION_RAW_AND_MEDIUM_NORMAL_JPEG, N_("RAW + Medium Normal JPEG"),
|
||||
{IMAGE_FORMAT_RAW_AND_MEDIUM_NORMAL_JPEG, N_("RAW + Medium Normal JPEG"),
|
||||
0x24, 0x12, 0x10},
|
||||
{RESOLUTION_RAW_AND_MEDIUM_FINE_JPEG, N_("RAW + Medium Fine JPEG"),
|
||||
{IMAGE_FORMAT_RAW_AND_MEDIUM_FINE_JPEG, N_("RAW + Medium Fine JPEG"),
|
||||
0x34, 0x12, 0x10},
|
||||
{RESOLUTION_RAW_AND_LARGE_NORMAL_JPEG, N_("RAW + Large Normal JPEG"),
|
||||
{IMAGE_FORMAT_RAW_AND_LARGE_NORMAL_JPEG, N_("RAW + Large Normal JPEG"),
|
||||
0x24, 0x12, 0x00},
|
||||
{RESOLUTION_RAW_AND_LARGE_FINE_JPEG, N_("RAW + Large Fine JPEG"),
|
||||
{IMAGE_FORMAT_RAW_AND_LARGE_FINE_JPEG, N_("RAW + Large Fine JPEG"),
|
||||
0x34, 0x12, 0x00},
|
||||
{0, NULL, 0, 0, 0},
|
||||
};
|
||||
@@ -1544,22 +1544,17 @@ camera_get_config (Camera *camera, CameraWidget **window, GPContext *context)
|
||||
gp_widget_new (GP_WIDGET_WINDOW, _("Camera and Driver Configuration"), window);
|
||||
gp_widget_set_name (*window, "main");
|
||||
|
||||
gp_widget_new (GP_WIDGET_SECTION, _("Camera"), §ion);
|
||||
gp_widget_set_name (section, "camera");
|
||||
gp_widget_new (GP_WIDGET_SECTION, _("Camera Settings"), §ion);
|
||||
gp_widget_set_name (section, "settings");
|
||||
gp_widget_append (*window, section);
|
||||
|
||||
gp_widget_new (GP_WIDGET_TEXT, _("Camera Model (readonly)"), &t);
|
||||
gp_widget_set_name (t, "model");
|
||||
gp_widget_set_value (t, camera->pl->ident);
|
||||
gp_widget_append (section, t);
|
||||
|
||||
gp_widget_new (GP_WIDGET_TEXT, _("Owner name"), &t);
|
||||
gp_widget_set_name (t, "owner");
|
||||
gp_widget_new (GP_WIDGET_TEXT, _("Owner Name"), &t);
|
||||
gp_widget_set_name (t, "ownername");
|
||||
gp_widget_set_value (t, camera->pl->owner);
|
||||
gp_widget_append (section, t);
|
||||
|
||||
/* Capture size class */
|
||||
gp_widget_new (GP_WIDGET_MENU, _("Capture size class"), &t);
|
||||
gp_widget_new (GP_WIDGET_MENU, _("Capture Size Class"), &t);
|
||||
gp_widget_set_name (t, "capturesizeclass");
|
||||
|
||||
/* Map it to the list of choices */
|
||||
@@ -1576,7 +1571,7 @@ camera_get_config (Camera *camera, CameraWidget **window, GPContext *context)
|
||||
|
||||
/* Set to "Compatibility mode" if not currently set */
|
||||
if (menuval == -1)
|
||||
gp_widget_set_value (t, _("Compatibility mode"));
|
||||
gp_widget_set_value (t, _("Compatibility Mode"));
|
||||
|
||||
gp_widget_append (section, t);
|
||||
|
||||
@@ -1591,10 +1586,10 @@ camera_get_config (Camera *camera, CameraWidget **window, GPContext *context)
|
||||
}
|
||||
|
||||
/* ISO speed */
|
||||
gp_widget_new (GP_WIDGET_MENU, _("ISO speed"), &t);
|
||||
gp_widget_new (GP_WIDGET_MENU, _("ISO Speed"), &t);
|
||||
gp_widget_set_name (t, "iso");
|
||||
|
||||
/* Get the camera's current ISO speed setting */
|
||||
/* Get the camera's current ISO Speed setting */
|
||||
iso = -1;
|
||||
if (camera->pl->cached_ready == 1) {
|
||||
res = canon_int_get_release_params(camera, context);
|
||||
@@ -1625,7 +1620,7 @@ camera_get_config (Camera *camera, CameraWidget **window, GPContext *context)
|
||||
|
||||
|
||||
/* Shutter speed */
|
||||
gp_widget_new (GP_WIDGET_MENU, _("Shutter speed"), &t);
|
||||
gp_widget_new (GP_WIDGET_MENU, _("Shutter Speed"), &t);
|
||||
gp_widget_set_name (t, "shutterspeed");
|
||||
|
||||
/* Get the camera's current shutter speed setting */
|
||||
@@ -1712,11 +1707,11 @@ camera_get_config (Camera *camera, CameraWidget **window, GPContext *context)
|
||||
|
||||
gp_widget_append (section, t);
|
||||
|
||||
/* Exposure Bias */
|
||||
gp_widget_new (GP_WIDGET_MENU, _("Exposure Bias"), &t);
|
||||
gp_widget_set_name (t, "exposurebias");
|
||||
/* Exposure Compensation */
|
||||
gp_widget_new (GP_WIDGET_MENU, _("Exposure Compensation"), &t);
|
||||
gp_widget_set_name (t, "exposurecompensation");
|
||||
|
||||
/* Get the camera's current exposure bias setting */
|
||||
/* Get the camera's current exposure compensation setting */
|
||||
expbias = -1;
|
||||
if (camera->pl->cached_ready == 1) {
|
||||
res = canon_int_get_release_params(camera, context);
|
||||
@@ -1745,36 +1740,36 @@ camera_get_config (Camera *camera, CameraWidget **window, GPContext *context)
|
||||
gp_widget_append (section, t);
|
||||
|
||||
|
||||
/* Resolution */
|
||||
gp_widget_new (GP_WIDGET_MENU, _("Resolution"), &t);
|
||||
gp_widget_set_name (t, "resolution");
|
||||
/* Image Format */
|
||||
gp_widget_new (GP_WIDGET_MENU, _("Image Format"), &t);
|
||||
gp_widget_set_name (t, "imageformat");
|
||||
|
||||
/* Get the camera's current resolution setting */
|
||||
/* Get the camera's current image format setting */
|
||||
res_byte1 = res_byte2 = res_byte3 = -1;
|
||||
if (camera->pl->cached_ready == 1) {
|
||||
res = canon_int_get_release_params (camera, context);
|
||||
if (res == GP_OK) {
|
||||
res_byte1 = camera->pl->release_params[RESOLUTION_1_INDEX];
|
||||
res_byte2 = camera->pl->release_params[RESOLUTION_2_INDEX];
|
||||
res_byte3 = camera->pl->release_params[RESOLUTION_3_INDEX];
|
||||
res_byte1 = camera->pl->release_params[IMAGE_FORMAT_1_INDEX];
|
||||
res_byte2 = camera->pl->release_params[IMAGE_FORMAT_2_INDEX];
|
||||
res_byte3 = camera->pl->release_params[IMAGE_FORMAT_3_INDEX];
|
||||
}
|
||||
}
|
||||
|
||||
/* Map it to the list of choices */
|
||||
i = 0;
|
||||
menuval = -1;
|
||||
while (resolutionStateArray[i].label) {
|
||||
gp_widget_add_choice (t, _(resolutionStateArray[i].label));
|
||||
if (res_byte1 == resolutionStateArray[i].res_byte1 &&
|
||||
res_byte2 == resolutionStateArray[i].res_byte2 &&
|
||||
res_byte3 == resolutionStateArray[i].res_byte3) {
|
||||
gp_widget_set_value (t, _(resolutionStateArray[i].label));
|
||||
while (imageFormatStateArray[i].label) {
|
||||
gp_widget_add_choice (t, _(imageFormatStateArray[i].label));
|
||||
if (res_byte1 == imageFormatStateArray[i].res_byte1 &&
|
||||
res_byte2 == imageFormatStateArray[i].res_byte2 &&
|
||||
res_byte3 == imageFormatStateArray[i].res_byte3) {
|
||||
gp_widget_set_value (t, _(imageFormatStateArray[i].label));
|
||||
menuval = i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Set an unknown resolution value if the
|
||||
/* Set an unknown imageFormat value if the
|
||||
* camera is set to something weird */
|
||||
if (menuval == -1) {
|
||||
gp_widget_add_choice (t, _("Unknown"));
|
||||
@@ -1784,8 +1779,8 @@ camera_get_config (Camera *camera, CameraWidget **window, GPContext *context)
|
||||
gp_widget_append (section, t);
|
||||
|
||||
|
||||
/* Focus mode */
|
||||
gp_widget_new (GP_WIDGET_MENU, _("Focus mode"), &t);
|
||||
/* Focus Mode */
|
||||
gp_widget_new (GP_WIDGET_MENU, _("Focus Mode"), &t);
|
||||
gp_widget_set_name (t, "focusmode");
|
||||
|
||||
/* Get the camera's current focus mode setting */
|
||||
@@ -1818,8 +1813,8 @@ camera_get_config (Camera *camera, CameraWidget **window, GPContext *context)
|
||||
gp_widget_append (section, t);
|
||||
|
||||
|
||||
/* Flash mode */
|
||||
gp_widget_new (GP_WIDGET_MENU, _("Flash mode"), &t);
|
||||
/* Flash Mode */
|
||||
gp_widget_new (GP_WIDGET_MENU, _("Flash Mode"), &t);
|
||||
gp_widget_set_name (t, "flashmode");
|
||||
|
||||
/* Get the camera's current flash mode setting */
|
||||
@@ -1888,7 +1883,29 @@ camera_get_config (Camera *camera, CameraWidget **window, GPContext *context)
|
||||
|
||||
/************************ end release params ************************/
|
||||
|
||||
gp_widget_new (GP_WIDGET_TEXT, _("Date and Time (readonly)"), &t);
|
||||
/* *** Actions */
|
||||
|
||||
gp_widget_new (GP_WIDGET_SECTION, _("Camera Actions"), §ion);
|
||||
gp_widget_set_name (section, "actions");
|
||||
gp_widget_append (*window, section);
|
||||
|
||||
gp_widget_new (GP_WIDGET_TOGGLE, _("Synchronize camera date and time with PC"), &t);
|
||||
gp_widget_set_name (t, "syncdatetime");
|
||||
gp_widget_append (section, t);
|
||||
|
||||
|
||||
/* *** Status */
|
||||
|
||||
gp_widget_new (GP_WIDGET_SECTION, _("Camera Status Information"), §ion);
|
||||
gp_widget_set_name (section, "status");
|
||||
gp_widget_append (*window, section);
|
||||
|
||||
gp_widget_new (GP_WIDGET_TEXT, _("Camera Model"), &t);
|
||||
gp_widget_set_name (t, "model");
|
||||
gp_widget_set_value (t, camera->pl->ident);
|
||||
gp_widget_append (section, t);
|
||||
|
||||
gp_widget_new (GP_WIDGET_TEXT, _("Date and Time"), &t);
|
||||
gp_widget_set_name (t, "datetime");
|
||||
if (camera->pl->cached_ready == 1) {
|
||||
res = canon_int_get_time (camera, &camtime, context);
|
||||
@@ -1904,11 +1921,7 @@ camera_get_config (Camera *camera, CameraWidget **window, GPContext *context)
|
||||
}
|
||||
gp_widget_append (section, t);
|
||||
|
||||
gp_widget_new (GP_WIDGET_TOGGLE, _("Set camera date to PC date"), &t);
|
||||
gp_widget_set_name (t, "setcameratime");
|
||||
gp_widget_append (section, t);
|
||||
|
||||
gp_widget_new (GP_WIDGET_TEXT, _("Firmware revision (readonly)"), &t);
|
||||
gp_widget_new (GP_WIDGET_TEXT, _("Firmware Version"), &t);
|
||||
gp_widget_set_name (t, "firmwareversion");
|
||||
sprintf (firm, "%i.%i.%i.%i", camera->pl->firmwrev[3], camera->pl->firmwrev[2],
|
||||
camera->pl->firmwrev[1], camera->pl->firmwrev[0]);
|
||||
@@ -1933,11 +1946,14 @@ camera_get_config (Camera *camera, CameraWidget **window, GPContext *context)
|
||||
power_str[sizeof (power_str) - 1] = 0;
|
||||
}
|
||||
|
||||
gp_widget_new (GP_WIDGET_TEXT, _("Power (readonly)"), &t);
|
||||
gp_widget_new (GP_WIDGET_TEXT, _("Power"), &t);
|
||||
gp_widget_set_name (t, "power");
|
||||
gp_widget_set_value (t, power_str);
|
||||
gp_widget_append (section, t);
|
||||
|
||||
|
||||
/* *** Driver */
|
||||
|
||||
gp_widget_new (GP_WIDGET_SECTION, _("Driver"), §ion);
|
||||
gp_widget_set_name (t, "driver");
|
||||
gp_widget_append (*window, section);
|
||||
@@ -1970,7 +1986,7 @@ camera_set_config (Camera *camera, CameraWidget *window, GPContext *context)
|
||||
|
||||
GP_DEBUG ("camera_set_config()");
|
||||
|
||||
gp_widget_get_child_by_label (window, _("Owner name"), &w);
|
||||
gp_widget_get_child_by_label (window, _("Owner Name"), &w);
|
||||
if (gp_widget_changed (w)) {
|
||||
gp_widget_get_value (w, &wvalue);
|
||||
if (!check_readiness (camera, context)) {
|
||||
@@ -1983,7 +1999,7 @@ camera_set_config (Camera *camera, CameraWidget *window, GPContext *context)
|
||||
}
|
||||
}
|
||||
|
||||
gp_widget_get_child_by_label (window, _("Capture size class"), &w);
|
||||
gp_widget_get_child_by_label (window, _("Capture Size Class"), &w);
|
||||
if (gp_widget_changed (w)) {
|
||||
gp_widget_get_value (w, &wvalue);
|
||||
|
||||
@@ -2009,7 +2025,7 @@ camera_set_config (Camera *camera, CameraWidget *window, GPContext *context)
|
||||
return -1;
|
||||
}
|
||||
|
||||
gp_widget_get_child_by_label (window, _("ISO speed"), &w);
|
||||
gp_widget_get_child_by_label (window, _("ISO Speed"), &w);
|
||||
if (gp_widget_changed (w)) {
|
||||
gp_widget_get_value (w, &wvalue);
|
||||
if (!check_readiness (camera, context)) {
|
||||
@@ -2037,7 +2053,7 @@ camera_set_config (Camera *camera, CameraWidget *window, GPContext *context)
|
||||
}
|
||||
}
|
||||
|
||||
gp_widget_get_child_by_label (window, _("Shutter speed"), &w);
|
||||
gp_widget_get_child_by_label (window, _("Shutter Speed"), &w);
|
||||
if (gp_widget_changed (w)) {
|
||||
gp_widget_get_value (w, &wvalue);
|
||||
if (!check_readiness (camera, context)) {
|
||||
@@ -2092,7 +2108,7 @@ camera_set_config (Camera *camera, CameraWidget *window, GPContext *context)
|
||||
}
|
||||
}
|
||||
}
|
||||
gp_widget_get_child_by_label (window, _("Exposure Bias"), &w);
|
||||
gp_widget_get_child_by_label (window, _("Exposure Compensation"), &w);
|
||||
if (gp_widget_changed (w)) {
|
||||
unsigned char expbias;
|
||||
gp_widget_get_value (w, &wvalue);
|
||||
@@ -2111,17 +2127,17 @@ camera_set_config (Camera *camera, CameraWidget *window, GPContext *context)
|
||||
}
|
||||
|
||||
if (!exposureBiasStateArray[i].label) {
|
||||
gp_context_status (context, _("Invalid exposure bias setting"));
|
||||
gp_context_status (context, _("Invalid exposure compensation setting"));
|
||||
} else {
|
||||
if (canon_int_set_exposurebias (camera, expbias, context) == GP_OK)
|
||||
gp_context_status (context, _("Exposure bias changed"));
|
||||
gp_context_status (context, _("Exposure compensation changed"));
|
||||
else
|
||||
gp_context_status (context, _("Could not change exposure bias"));
|
||||
gp_context_status (context, _("Could not change exposure compensation"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gp_widget_get_child_by_label (window, _("Resolution"), &w);
|
||||
gp_widget_get_child_by_label (window, _("Image Format"), &w);
|
||||
if (gp_widget_changed (w)) {
|
||||
gp_widget_get_value (w, &wvalue);
|
||||
if (!check_readiness (camera, context)) {
|
||||
@@ -2130,26 +2146,26 @@ camera_set_config (Camera *camera, CameraWidget *window, GPContext *context)
|
||||
|
||||
/* Map the menu option setting to the camera binary value */
|
||||
i = 0;
|
||||
while (resolutionStateArray[i].label) {
|
||||
if (strcmp (resolutionStateArray[i].label, wvalue) == 0)
|
||||
while (imageFormatStateArray[i].label) {
|
||||
if (strcmp (imageFormatStateArray[i].label, wvalue) == 0)
|
||||
break;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!resolutionStateArray[i].label) {
|
||||
gp_context_status (context, _("Invalid resolution setting"));
|
||||
if (!imageFormatStateArray[i].label) {
|
||||
gp_context_status (context, _("Invalid image format setting"));
|
||||
} else {
|
||||
if (canon_int_set_resolution (camera, resolutionStateArray[i].res_byte1, resolutionStateArray[i].res_byte2,
|
||||
resolutionStateArray[i].res_byte3, context) == GP_OK)
|
||||
gp_context_status (context, _("Resolution changed"));
|
||||
if (canon_int_set_image_format (camera, imageFormatStateArray[i].res_byte1, imageFormatStateArray[i].res_byte2,
|
||||
imageFormatStateArray[i].res_byte3, context) == GP_OK)
|
||||
gp_context_status (context, _("Image format changed"));
|
||||
else
|
||||
gp_context_status (context, _("Could not change resolution"));
|
||||
gp_context_status (context, _("Could not change image format"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gp_widget_get_child_by_label (window, _("Focus mode"), &w);
|
||||
gp_widget_get_child_by_label (window, _("Focus Mode"), &w);
|
||||
if (gp_widget_changed (w)) {
|
||||
gp_widget_get_value (w, &wvalue);
|
||||
if (!check_readiness (camera, context)) {
|
||||
@@ -2266,7 +2282,7 @@ camera_set_config (Camera *camera, CameraWidget *window, GPContext *context)
|
||||
}
|
||||
|
||||
/* Flash mode */
|
||||
gp_widget_get_child_by_label (window, _("Flash mode"), &w);
|
||||
gp_widget_get_child_by_label (window, _("Flash Mode"), &w);
|
||||
if (gp_widget_changed (w)) {
|
||||
gp_widget_get_value (w, &wvalue);
|
||||
if (!check_readiness (camera, context)) {
|
||||
@@ -2295,7 +2311,7 @@ camera_set_config (Camera *camera, CameraWidget *window, GPContext *context)
|
||||
}
|
||||
|
||||
|
||||
gp_widget_get_child_by_label (window, _("Set camera date to PC date"), &w);
|
||||
gp_widget_get_child_by_label (window, _("Synchronize camera date and time with PC"), &w);
|
||||
if (gp_widget_changed (w)) {
|
||||
gp_widget_get_value (w, &wvalue);
|
||||
if (!check_readiness (camera, context)) {
|
||||
|
||||
@@ -1984,7 +1984,7 @@ canon_usb_get_captured_image (Camera *camera, const int key, unsigned char **dat
|
||||
* camera. This function must be called soon after an image capture,
|
||||
* and needs the image key returned by canon_usb_capture_dialogue().
|
||||
* This function is only used for "secondary images," e.g., the JPEGs
|
||||
* downloaded when the camera's capture resolution mode is set to "RAW + JPEG"
|
||||
* downloaded when the camera's capture image format mode is set to "RAW + JPEG"
|
||||
*
|
||||
* Returns: gphoto2 error code, length in @length, and image data in @data.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user