From e8291960bd4b221ff7e55aa55fd45aaeb3c8d37a Mon Sep 17 00:00:00 2001 From: louis Date: Sun, 12 Apr 2015 17:10:06 +0200 Subject: added possibility for blinking images, texts, rectangles, ellipses and slopes --- libtemplate/templatefunction.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'libtemplate/templatefunction.c') diff --git a/libtemplate/templatefunction.c b/libtemplate/templatefunction.c index 7b76539..c99fa37 100644 --- a/libtemplate/templatefunction.c +++ b/libtemplate/templatefunction.c @@ -143,6 +143,10 @@ void cTemplateFunction::SetParameters(vector > params) { p.first = ptDeterminateFont; } else if (!name.compare("direction")) { p.first = ptDirection; + } else if (!name.compare("animtype")) { + p.first = ptAnimType; + } else if (!name.compare("animfreq")) { + p.first = ptAnimFreq; } else { p.first = ptNone; } @@ -242,6 +246,7 @@ bool cTemplateFunction::CalculateParameters(void) { case ptScaleTvY: case ptScaleTvWidth: case ptScaleTvHeight: + case ptAnimFreq: SetNumericParameter(type, value); break; case ptAlign: @@ -287,6 +292,9 @@ bool cTemplateFunction::CalculateParameters(void) { case ptDirection: paramValid = SetDirection(value); break; + case ptAnimType: + paramValid = SetAnimType(value); + break; default: paramValid = true; break; @@ -736,6 +744,16 @@ bool cTemplateFunction::DoExecute(void) { return condParam->IsTrue(); } +bool cTemplateFunction::IsAnimated(void) { + map< eParamType, int >::iterator hit = numericParameters.find(ptAnimType); + if (hit == numericParameters.end()) + return false; + eAnimType type = (eAnimType)hit->second; + if (type > atNone) + return true; + return false; +} + /******************************************************************* * Private Functions *******************************************************************/ @@ -1125,6 +1143,16 @@ bool cTemplateFunction::SetDirection(string value) { return true; } +bool cTemplateFunction::SetAnimType(string value) { + int animType = atNone; + if (!value.compare("blink")) + animType = atBlink; + else if (!value.compare("animated")) + animType = atAnimated; + numericParameters.insert(pair(ptAnimType, animType)); + return true; +} + void cTemplateFunction::SetDebugGrid(string value) { int numGridsX = 0; int numGridsY = 0; @@ -1653,6 +1681,12 @@ string cTemplateFunction::GetParamName(eParamType pt) { case ptDirection: name = "Text Direction"; break; + case ptAnimType: + name = "Animation Type"; + break; + case ptAnimFreq: + name = "Animation Frequency"; + break; default: name = "Unknown"; break; -- cgit v1.2.3