Example #1
0
/*
 * Gives Information about the current camera status.
 */
char* mdc800_summary()
{
	char line[50];
	
	if (!mdc800_camera_open)
	{
		printAPIError ("(mdc800_summary) camera is not open !\n");
		return 0;
	}
	
	strcpy (mdc800_summary_output,"Summary for Mustek MDC800:\n");
	
	if (!mdc800_getSystemStatus ())
	{
		strcat (mdc800_summary_output,"no status reported.");
		mdc800_close ();
		return mdc800_summary_output;
	}
	
	if (mdc800_isCFCardPresent ())
		sprintf (line,"Compact Flash Card detected\n");
	else
		sprintf (line,"no Compact Flash Card detected\n");
	strcat (mdc800_summary_output,line);

	if (mdc800_getMode () == 0)
		sprintf (line, "Current Mode: Camera Mode\n");
	else
		sprintf (line, "Current Mode: Playback Mode\n");
	strcat (mdc800_summary_output,line);


	sprintf (line,mdc800_getFlashLightString (mdc800_getFlashLightStatus ()));
	strcat (line,"\n");
	strcat (mdc800_summary_output,line);
	
	
	if (mdc800_isBatteryOk ())
		sprintf (line, "Batteries are ok.");
	else
		sprintf (line, "Batteries are low.");
	strcat (mdc800_summary_output,line);
	
		
	return mdc800_summary_output;
}
Example #2
0
static int
camera_summary (Camera *camera, CameraText *summary, GPContext *ctx)
{
	char mdc800_summary_output[500];
	char line[50];
	/*
	 * Fill out the summary with some information about the current
	 * state of the camera (like pictures taken, etc.).
	 */
	strcpy (mdc800_summary_output,_("Summary for Mustek MDC800:\n"));
	if (GP_OK!=mdc800_getSystemStatus (camera))
	{
		strcat(mdc800_summary_output,_("no status reported."));
		strcpy(summary->text, mdc800_summary_output);
		return GP_OK;
	}

	if (mdc800_isCFCardPresent (camera))
		strcpy (line,_("Compact Flash Card detected\n"));
	else
		strcpy (line,_("No Compact Flash Card detected\n"));
	strcat(mdc800_summary_output,line);

	if (mdc800_getMode (camera) == 0)
		strcpy (line, _("Current Mode: Camera Mode\n"));
	else
		strcpy (line, _("Current Mode: Playback Mode\n"));
	strcat (mdc800_summary_output,line);

	strcpy (line,mdc800_getFlashLightString (mdc800_getFlashLightStatus (camera)));
	strcat (line,"\n");
	strcat (mdc800_summary_output,line);


	if (mdc800_isBatteryOk (camera))
		strcpy (line, _("Batteries are ok."));
	else
		strcpy (line, _("Batteries are low."));
	strcat (mdc800_summary_output,line);
	strcpy(summary->text,mdc800_summary_output);
	return GP_OK;
}