Beispiel #1
0
static int
file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list,
                void *data, GPContext *context)
{
	Camera *camera = data; 
	int i,n;
	GP_DEBUG ("List files in %s\n", folder);
	if (0==strcmp(folder, "/")) {
		for (i=0, n=0; i<camera->pl->nb_entries; i++) {
			if (!sq_is_clip(camera->pl, i)) n++;
		}
		gp_list_populate(list, "pict%03i.ppm", n);
	} else {
		char format[16];
		n = atoi(folder+1+4);	/* '/' + 'clip' */
		snprintf(format, sizeof(format), "%03i_%%03i.ppm", n);
		for (i=0; i<camera->pl->nb_entries && n>0; i++) {
			if (sq_is_clip(camera->pl, i)) n--;
		}
		i--;
		if (!sq_is_clip(camera->pl, i))
			return GP_ERROR_DIRECTORY_NOT_FOUND;
		gp_list_populate(list, format,
				    sq_get_num_frames(camera->pl, i));
	}
	return GP_OK;
}
Beispiel #2
0
static int
file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list,
		void *data, GPContext *context)
{
	Camera *camera = data;
	int i;
	unsigned int n;
	const char *name;

	/*
	 * Count the pictures on the camera. If we don't have any, we
	 * are done.
	 */
	CR (fuji_pic_count (camera, &n, context));
	if (!n)
		return (GP_OK);

	/*
	 * Try to get the name of the first file. If we can't, just come
	 * up with some dummy names.
	 */
	if (fuji_pic_name (camera, 1, &name, context) < 0) {
		CR (gp_list_populate (list, "DSCF%04i.JPG", n));
		return (GP_OK);
	}
	CR (gp_list_append (list, name, NULL));

	/* Get the names of the remaining files. */
	for (i = 2; i <= n; i++) {
		CR (fuji_pic_name (camera, i, &name, context));
		CR (gp_list_append (list, name, NULL));
	}

	return (GP_OK);
}
Beispiel #3
0
static int
file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list,
                void *data, GPContext *context) {
	Camera *camera = data;

	return gp_list_populate (list, "ez200_pic%03i.jpg", ez200_get_num_pics (camera->pl->info));
}
Beispiel #4
0
static int file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list, void *data, GPContext *context) {

	Camera *camera = data;
	int count;

	/* We only support root folder */
	if (strcmp (folder, "/"))
	{
		gp_context_error (context, _("Only root folder is supported - "
			"you requested a file listing for folder '%s'."), folder);
		return (GP_ERROR_DIRECTORY_NOT_FOUND);
	}

	count = mesa_get_image_count (camera->port);
	if (count < 0)
	{
		gp_context_error (context, _("Problem getting number of images"));
		return (count);
	}

	/*
	 * Create pseudo file names for each picture in the camera, including
	 * the temporary picture in RAM, which, unfortunately, might not always
	 * be available.
	 *
	 * We don't add anything to the filesystem here - the filesystem does
	 * that for us.
	 */
	CHECK (gp_filesystem_append (fs, "/", RAM_IMAGE_TEMPLATE, context));
	return (gp_list_populate (list, IMAGE_NAME_TEMPLATE, count));
}
Beispiel #5
0
static int
file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list,
                void *data, GPContext *context)
{
        Camera *camera = data; 
	int n;
	n = camera->pl->nb_entries;
    	gp_list_populate (list, "jl_%03i.ppm", n);
    	return GP_OK;
}
Beispiel #6
0
static int
file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list,
                void *data, GPContext *context)
{
        Camera *camera = data;
	int n;
	GP_DEBUG ("List files in %s\n", folder);
    	n = camera->pl->num_pics;	
	gp_list_populate(list, "cs%03i.jpeg", n);
	return GP_OK;
}
Beispiel #7
0
static int
file_list_func(CameraFilesystem *fs, const char *folder, CameraList *list,
                void *data, GPContext *context)
{
	Camera *camera = data;
	int n;
	if(!camera->pl->init_done)
		digi_init (camera->port, camera->pl);
	GP_DEBUG ("List files in %s\n", folder);
	n = camera->pl->nb_entries;
	gp_list_populate(list, "pict%03i.ppm", n);
	return GP_OK;
}
Beispiel #8
0
static int
file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list,
		void *data, GPContext *context)
{
	Camera *camera = data;
	int count, result;

	result =  mdc800_number_of_pictures (camera, &count);
	if (result != GP_OK)
		return result;
	gp_list_populate(list, "image%02i.jpg", count);
	return (GP_OK);
}
Beispiel #9
0
static int file_list_func (CameraFilesystem *fs, const char *folder,
			   CameraList *list, void *data, GPContext *context)
{
	Camera *camera = data;
	int count;

	GP_DEBUG ("* file_list_func");
	GP_DEBUG ("*** folder: %s", folder);

	CHECK (count = jamcam_file_count (camera));
	CHECK (gp_list_populate (list, "pic_%04i.ppm", count));

	return (GP_OK);
}
Beispiel #10
0
static int file_list_func (CameraFilesystem *fs, const char *folder, 
			   CameraList *list, void *data, GPContext *context) 
{
	Camera *camera = data;
	int count, result;

	result = stv0680_file_count(camera->port, &count);
	if (result != GP_OK)
		return result;

	gp_list_populate(list, "image%03i.pnm", count);

	return (GP_OK);
}
Beispiel #11
0
static int
folder_list_func (CameraFilesystem *fs, const char *folder, CameraList *list,
		void *data, GPContext *context)
{
	Camera *camera = data;
	int i,n;
	GP_DEBUG ("List folders in %s\n", folder);
	if (0==strcmp(folder, "/")) {
		for (i=0, n=0; i<camera->pl->nb_entries; i++) {
			if (sq_is_clip(camera->pl, i)) n++;
		}
		gp_list_populate (list, "clip%03i", n);

	}
	return GP_OK;
}
Beispiel #12
0
static int file_list_func (CameraFilesystem *fs, const char *folder, 
			   CameraList *list, void *data, GPContext *context) 
{
	Camera *camera = data;
	int ret;

	if ( dimagev_get_camera_status(camera->pl) < GP_OK ) {
		GP_DEBUG( "camera_file_list::unable to get camera status");
		return GP_ERROR_IO;
	}

	if ((ret = gp_list_populate(list, DIMAGEV_FILENAME_FMT, camera->pl->status->number_images)) < GP_OK ) {
		GP_DEBUG( "camera_file_list::unable to populate list");
		return ret;
	}
		
	return GP_OK;
}
Beispiel #13
0
static int file_list_func (CameraFilesystem *fs, const char *folder,
			   CameraList *list, void *data, GPContext *context)
{
    Camera *camera = data;
    int count, result;


    result = stv0674_file_count(camera->port, &count);
    if (result < GP_OK)
    {
	GP_DEBUG("file count returnd %d\n",result);
	return result;
    }

    GP_DEBUG("count is %x\n",count);

    gp_list_populate(list, "image%03i.jpg", count);

    return (GP_OK);
}
Beispiel #14
0
/*
 * Create the image list
 */
static int
file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list,
		void *data, GPContext *context)
{
	Camera *camera = data;
	unsigned char	cmd[2], buf[INFO_BUFFER];
	int	num, ret;

	GP_DEBUG ("*** ENTER: file_list_func ***");

	cmd[0] = ESC;
	cmd[1] = GETCAMINFO;
	ret = gp_port_write (camera->port, (char*)cmd, sizeof(cmd));
	if (ret<GP_OK)
		return ret;
	ret = gp_port_read (camera->port, (char*)buf, INFO_BUFFER);
	if (ret<GP_OK)
		return ret;
	num = (buf[TAKEN_IMAGE_PTR] << 8) | (buf[TAKEN_IMAGE_PTR+1]);
	gp_list_populate (list, FILENAME, num);
	return GP_OK;
}