private Camera(CameraAbilities abilities, PortInfo port, Context context) { string[] parts = port.Path.Substring(4).Split(','); this.abilities = new Abilities(abilities); this.baseAbilities = abilities; this.context = context; this.musicPath = ""; this.photosPath = ""; this.playlistPath = ""; this.port = port; this.usbBusNumber = int.Parse(parts[0]); this.usbDeviceNumber = int.Parse(parts[1]); }
public CameraText GetSummary (Context context) { CameraText summary; Error.CheckError (Camera.gp_camera_get_summary(this.Handle, out summary, context.Handle)); return summary; }
public void SetFileInfo (string folder, string name, CameraFileInfo fileinfo, Context context) { unsafe { Error.CheckError (gp_camera_file_set_info(this.Handle, folder, name, fileinfo, context.Handle)); } }
public void DeleteFile (string folder, string name, Context context) { unsafe { Error.CheckError (gp_camera_file_delete(this.Handle, folder, name, context.Handle)); } }
public void RemoveDirectory (string folder, string name, Context context) { Error.CheckError (gp_camera_folder_remove_dir(this.Handle, folder, name, context.Handle)); }
public void PutFile (string folder, CameraFile file, Context context) { Error.CheckError (gp_camera_folder_put_file(this.Handle, folder, file.Handle, context.Handle)); }
public CameraFile CapturePreview (Context context) { CameraFile file = new CameraFile(); Error.CheckError (gp_camera_capture_preview (this.Handle, file.Handle, context.Handle)); return file; }
public void Exit (Context context) { Error.CheckError (gp_camera_init (this.Handle, context.Handle)); }
public CameraList ListFolders (string folder, Context context) { ErrorCode result; CameraList list = new CameraList(); unsafe { result = gp_filesystem_list_folders (this.Handle, folder, list.Handle, context.Handle); } if (Error.IsError(result)) throw Error.ErrorException(result); return list; }
public void Load (Context context) { unsafe { ErrorCode result = gp_abilities_list_load (this.Handle, context.Handle); if (Error.IsError (result)) throw Error.ErrorException(result); } }
public void Detect (PortInfoList info_list, CameraList l, Context context) { Error.CheckError (gp_abilities_list_detect (this.handle, info_list.Handle, l.Handle, context.Handle)); }
/// <summary> /// Initialises to the specified device on the specified port /// </summary> /// <param name="context"></param> /// <param name="abilities">The abilities which represent the device to be connected to</param> /// <param name="portInfo">The port which the device is connected on</param> public void Init(Context context, CameraAbilities abilities, PortInfo portInfo) { SetPortInfo(portInfo); SetAbilities(abilities); Init(context); }
public CameraStorageInformation[] GetStorageInformation(Context context) { int num = 0; IntPtr p = new IntPtr(); Error.CheckError(gp_camera_get_storageinfo (this.Handle, ref p, ref num, context.Handle)); CameraStorageInformation[] info_structs = new CameraStorageInformation[num]; for (int i = 0; i < num; i++) { IntPtr ptrStruct = new IntPtr(p.ToInt64() + Marshal.SizeOf(typeof(CameraStorageInformation)) * i); info_structs[i] = (CameraStorageInformation)Marshal.PtrToStructure(ptrStruct, typeof(CameraStorageInformation) ); } // Free the unmanaged array Marshal.FreeHGlobal(p); return info_structs; }
public void Load(Context context) { Error.CheckError(gp_abilities_list_load (this.Handle, context.Handle)); }
public int Count (string folder, Context context) { ErrorCode result; unsafe { result = gp_filesystem_count (this.Handle, folder, context.Handle); } if (Error.IsError(result)) throw Error.ErrorException(result); return (int)result; }
public CameraFile GetFile (string folder, string filename, CameraFileType type, Context context) { ErrorCode result; CameraFile file = new CameraFile(); unsafe { result = gp_filesystem_get_file (this.Handle, folder, filename, type, file.Handle, context.Handle); } if (Error.IsError(result)) throw Error.ErrorException(result); return file; }
public CameraFilePath Capture (CameraCaptureType type, Context context) { CameraFilePath path; Error.CheckError (gp_camera_capture (this.Handle, type, out path, context.Handle)); return path; }
public void PutFile (string folder, CameraFile file, Context context) { ErrorCode result; unsafe { result = gp_filesystem_put_file (this.Handle, folder, file.Handle, context.Handle); } if (Error.IsError(result)) throw Error.ErrorException(result); }
public CameraList ListFolders (string folder, Context context) { CameraList file_list = new CameraList(); Error.CheckError (gp_camera_folder_list_folders (this.Handle, folder, file_list.Handle, context.Handle)); return file_list; }
public void DeleteAll (string folder, Context context) { ErrorCode result; unsafe { result = gp_filesystem_delete_all (this.Handle, folder, context.Handle); } if (Error.IsError(result)) throw Error.ErrorException(result); }
public void DeleteAll (string folder, Context context) { Error.CheckError (gp_camera_folder_delete_all (this.Handle, folder, context.Handle)); }
public void RemoveDirectory (string folder, string name, Context context) { ErrorCode result; unsafe { result = gp_filesystem_remove_dir (this.Handle, folder, name, context.Handle); } if (Error.IsError(result)) throw Error.ErrorException(result); }
public CameraFile GetFile (string folder, string name, CameraFileType type, Context context) { CameraFile file = new CameraFile(); Error.CheckError (gp_camera_file_get(this.Handle, folder, name, type, file.Handle, context.Handle)); return file; }
public CameraFileInfo GetInfo (string folder, string filename, Context context) { ErrorCode result; CameraFileInfo fileinfo = new CameraFileInfo(); unsafe { result = gp_filesystem_get_info (this.Handle, folder, filename, out fileinfo, context.Handle); } if (Error.IsError(result)) throw Error.ErrorException(result); return fileinfo; }
public CameraFileInfo GetFileInfo (string folder, string name, Context context) { CameraFileInfo fileinfo; unsafe { Error.CheckError (gp_camera_file_get_info(this.Handle, folder, name, out fileinfo, context.Handle)); } return fileinfo; }
public void SetInfo (string folder, string filename, CameraFileInfo fileinfo, Context context) { ErrorCode result; unsafe { result = gp_filesystem_set_info (this.Handle, folder, filename, fileinfo, context.Handle); } if (Error.IsError(result)) throw Error.ErrorException(result); }
public CameraText GetManual (Context context) { CameraText manual; unsafe { Error.CheckError (gp_camera_get_manual(this.Handle, out manual, context.Handle)); } return manual; }
public int GetNumber (string folder, string filename, Context context) { ErrorCode result; unsafe { result = gp_filesystem_number (this.Handle, folder, filename, context.Handle); } if (Error.IsError(result)) throw Error.ErrorException(result); return (int)result; }
public CameraText GetAbout (Context context) { CameraText about; Error.CheckError (gp_camera_get_about(this.Handle, out about, context.Handle)); return about; }
public string GetName (string folder, int number, Context context) { ErrorCode result; string name; unsafe { result = gp_filesystem_name (this.Handle, folder, number, out name, context.Handle); } if (Error.IsError(result)) throw Error.ErrorException(result); return name; }