00001 #include <gtk/gtk.h>
00002 #include "vapiOptions.h"
00003 #include "vapiOperation.h"
00004 #include "vapiOperationList.h"
00005
00006 #define NumberOfTimerOperations 1
00007
00008
00009
00010
00011 void vapiTimerWait (vImages * Images, vOptions * Options,
00012 vMacroResult * PreviousResult);
00013
00014
00015 vEffect *
00016 vapiTimerOperations ()
00017 {
00018 vEffect *Operation[NumberOfTimerOperations];
00019
00020 Operation[0] = vapiOperationInit ("Espera", "Timer", &vapiTimerWait);
00021 vapiOperationSettingsSetOperationBriefDescription (Operation[0],
00022 "Espera durante o tempo definido");
00023 vapiOperationSettingsSetOperationLongDescription (Operation[0],
00024 "Esta operação faz com que a aplicação fique em espera durante um determinado tempo.");
00025 vapiOperationSettingsSetFloat (Operation[0], "Tempo de Espera",
00026 "Define o tempo que se deseja que se espere.",
00027 0.001, (24.0 * 3600.0), 1.0, 0.001,
00028 vSpin);
00029
00030 vapiOperationListAddOperation (Operation, NumberOfTimerOperations);
00031
00032 }
00033
00034 void
00035 vapiTimerWait (vImages * Images, vOptions * Options,
00036 vMacroResult * PreviousResult)
00037 {
00038 int microseconds;
00039 double result;
00040 if (vapiOptionsGetFloats (Options, 0) < 0)
00041 {
00042 return;
00043 }
00044 result = (vapiOptionsGetFloats (Options, 0) * 1000.0 * 1000.0);
00045 microseconds = (gulong) result;
00046 g_usleep (microseconds);
00047 }