summaryrefslogtreecommitdiff
path: root/camlibs/jamcam
diff options
context:
space:
mode:
authorChris Pinkham <cpinkham@infi.net>2001-11-05 17:12:17 +0000
committerChris Pinkham <cpinkham@infi.net>2001-11-05 17:12:17 +0000
commitc8eaf782598a3e4a4262ecf457fc2f52a7b02717 (patch)
tree341e0355d9a2aa22583b90bad453e85abc4b8272 /camlibs/jamcam
parent0b31ba02c1a3ffd75c8a1fae19b0d9c06c358fee (diff)
downloadlibgphoto2-c8eaf782598a3e4a4262ecf457fc2f52a7b02717.tar.gz
2001-11-05 Chris Pinkham <cpinkham@infi.net>
* camlibs/panasonic/coolshot/coolshot.c camlibs/panasonic/coolshot/library.c camlibs/jamcam/jamcam.c camlibs/jamcam/library.c: added support for gp_camera_progress(). Fixed bug in jamcam driver jamcam_file_count() routine. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2916 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/jamcam')
-rw-r--r--camlibs/jamcam/jamcam.c2
-rw-r--r--camlibs/jamcam/library.c12
2 files changed, 12 insertions, 2 deletions
diff --git a/camlibs/jamcam/jamcam.c b/camlibs/jamcam/jamcam.c
index be8d32beb..378627c12 100644
--- a/camlibs/jamcam/jamcam.c
+++ b/camlibs/jamcam/jamcam.c
@@ -179,6 +179,8 @@ static int get_file_func (CameraFilesystem *fs, const char *folder,
CHECK (n = gp_filesystem_number (camera->fs, folder, filename));
+ gp_camera_progress( camera, 0 );
+
switch (type) {
case GP_FILE_TYPE_PREVIEW:
CHECK (jamcam_request_thumbnail (camera, raw, &size, n));
diff --git a/camlibs/jamcam/library.c b/camlibs/jamcam/library.c
index 387d90881..df1265a29 100644
--- a/camlibs/jamcam/library.c
+++ b/camlibs/jamcam/library.c
@@ -77,8 +77,8 @@ int jamcam_file_count (Camera *camera) {
strcpy( buf, "KB00" );
buf[4] = ( position ) & 0xff;
buf[5] = ( position >> 8 ) & 0xff;
- buf[5] = ( position >> 16 ) & 0xff;
- buf[5] = ( position >> 24 ) & 0xff;
+ buf[6] = ( position >> 16 ) & 0xff;
+ buf[7] = ( position >> 24 ) & 0xff;
jamcam_write_packet( camera, buf, 8 );
jamcam_read_packet( camera, reply, 16 );
@@ -214,6 +214,12 @@ int jamcam_fetch_memory( Camera *camera, char *data, int start, int length ) {
bytes_left -= bytes_to_read;
bytes_read += bytes_to_read;
+
+ /* hate this hardcoded, but don't want to update here */
+ /* when downloading parts of a thumbnail */
+ if ( length > 1000 ) {
+ gp_camera_progress( camera, 100 * bytes_read / length );
+ }
}
gp_debug_printf (GP_DEBUG_LOW, "jamcam", "* jamcam_fetch_memory OK");
@@ -268,6 +274,8 @@ int jamcam_request_thumbnail( Camera *camera, char *buf, int *len, int number )
jamcam_fetch_memory( camera, line, position,
jamcam_files[number].width );
+ gp_camera_progress( camera, 100 * y / 60 );
+
if ( jamcam_files[number].width == 600 ) {
for( x = 22; x < 578 ; x += 7 ) {
*(ptr++) = line[x];