40 #include "ling_class/EST_item_content_aux.h"
41 #include "ling_class/EST_item_aux.h"
42 #include "ling_class/EST_Item_Content.h"
43 #include "EST_String.h"
44 #include "EST_error.h"
46 #include "../base_class/EST_get_function_template.h"
50 defineGetFunction(EST_Item_Content, f.val,
float, getFloatI)
51 defineGetFunction(EST_Item_Content, f.val,
int, getIntegerI)
55 EST_Val getVal(const EST_Item_Content &f,
56 const EST_String name,
60 if (f.relations.length() == 0)
61 return getValI(f, name, def, s);
65 p = f.relations.head();
66 EST_Item *i = item(f.relations.list(p).v);
67 return getVal(*i, name, def, s);
72 EST_String getString(
const EST_Item_Content &f,
73 const EST_String name,
74 const EST_String &def,
77 if (f.relations.
length() == 0)
78 return getStringI(f, name, def, s);
82 p = f.relations.
head();
84 return getString(*i, name, def, s);
88 int getInteger(
const EST_Item_Content &f,
89 const EST_String name,
93 if (f.relations.
length() == 0)
94 return getIntegerI(f, name, def, s);
98 p = f.relations.
head();
100 return getInteger(*i, name, def, s);
104 float getFloat(
const EST_Item_Content &f,
105 const EST_String name,
109 if (f.relations.
length() == 0)
110 return getFloatI(f, name, def, s);
114 p = f.relations.
head();
116 return getFloat(*i, name, def, s);
121 float start(
const EST_Item_Content &item_content)
123 if (item_content.relations.
length() == 0)
126 EST_feat_status status=efs_ok;
128 v = getFloat(item_content,
"start", -1.0, status);
135 p = item_content.relations.
head();
141 float mid(
const EST_Item_Content &item_content)
143 if (item_content.relations.
length() == 0)
146 EST_feat_status status=efs_ok;
148 v = getFloat(item_content,
"mid", -1.0, status);
151 v = (start(item_content)+end(item_content))/2.0;
158 p = item_content.relations.
head();
164 float time(
const EST_Item_Content &item_content)
166 if (item_content.relations.
length() == 0)
169 EST_feat_status status=efs_ok;
171 v = getFloat(item_content,
"time", -1.0, status);
174 v = mid(item_content);
181 p = item_content.relations.
head();
187 float end(
const EST_Item_Content &item_content)
189 if (item_content.relations.
length() == 0)
192 EST_feat_status status=efs_ok;
194 v = getFloat(item_content,
"end", -1.0, status);
201 p = item_content.relations.
head();