Ejemplo n.º 1
0
 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]);
 }
Ejemplo n.º 2
0
 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]);
 }
Ejemplo n.º 3
0
		public CameraText GetSummary (Context context)
		{
			CameraText summary;

			Error.CheckError (Camera.gp_camera_get_summary(this.Handle, out summary, context.Handle));

			return summary;
		}
Ejemplo n.º 4
0
		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));
			}
		}
Ejemplo n.º 5
0
		public void DeleteFile (string folder, string name, Context context)
		{
			unsafe
			{
				Error.CheckError (gp_camera_file_delete(this.Handle, folder, name, context.Handle));
			}
		}
Ejemplo n.º 6
0
		public void RemoveDirectory (string folder, string name, Context context)
		{
			Error.CheckError (gp_camera_folder_remove_dir(this.Handle, folder, name, context.Handle));
		}
Ejemplo n.º 7
0
		public void PutFile (string folder, CameraFile file, Context context)
		{
			Error.CheckError (gp_camera_folder_put_file(this.Handle, folder, file.Handle, context.Handle));
		}
Ejemplo n.º 8
0
		public CameraFile CapturePreview (Context context)
		{
			CameraFile file = new CameraFile();
			
			Error.CheckError (gp_camera_capture_preview (this.Handle, file.Handle, context.Handle));

			return file;
		}
Ejemplo n.º 9
0
		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));
		}
Ejemplo n.º 13
0
 /// <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);
 }
Ejemplo n.º 14
0
        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;
        }
Ejemplo n.º 15
0
 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;
		}
Ejemplo n.º 18
0
		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);
		}
Ejemplo n.º 20
0
		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);
		}
Ejemplo n.º 22
0
		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);
		}
Ejemplo n.º 24
0
		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;
		}
Ejemplo n.º 26
0
		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);
		}
Ejemplo n.º 28
0
		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;
		}
Ejemplo n.º 30
0
		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;
		}