示例#1
0
 public GPhotoCameraFile(string dir, string name)
 {
     directory = dir;
     filename = name;
     normal = null;
     preview = null;
 }
示例#2
0
    public void SaveFile(int index, string filename)
    {
        if (filename == null)
            return;

        //check if the directory exists
        if (!Directory.Exists (Path.GetDirectoryName (filename)))
            throw new Exception (String.Format ("Directory \"{0}\"does not exist", filename)); //FIXME
        //gp_file_new_from_fd is broken on the directory driver
        //but using gp_file_new_from_fd doesn't move the files to memory
        if (camera_abilities.PortType != PortType.Disk) {
            GPhotoCameraFile selected_file = (GPhotoCameraFile) files [index];
            using (var f = new CameraFile (Syscall.open (filename, OpenFlags.O_CREAT|OpenFlags.O_RDWR, FilePermissions.DEFFILEMODE))) {
                camera.GetFile (selected_file.Directory, selected_file.FileName, CameraFileType.Normal, f, context);
            }
            return;
        }

        using (CameraFile camfile = GetFile (index)) {
            if (camfile == null)
                throw new Exception ("Unable to claim file"); //FIXME
            camfile.Save (filename);
        }
    }
示例#3
0
文件: Camera.cs 项目: iainlane/f-spot
 public void PutFile(string folder, CameraFile file, Context context)
 {
     Error.CheckError (gp_camera_folder_put_file(this.Handle, folder, file.Handle, context.Handle));
 }
示例#4
0
文件: Camera.cs 项目: iainlane/f-spot
 public void CapturePreview(CameraFile dest, Context context)
 {
     Error.CheckError (gp_camera_capture_preview (this.Handle, dest.Handle, context.Handle));
 }
示例#5
0
文件: Camera.cs 项目: iainlane/f-spot
 public void GetFile(string folder, string name, CameraFileType type, CameraFile camera_file, Context context)
 {
     Error.CheckError (gp_camera_file_get(this.Handle, folder, name, type, camera_file.Handle, context.Handle));
 }