The various EventList/EventArray methods for getting data based on time (e.g. getValueAt(), getEventIndexBefore(), getEventIndexNear(), getRangeIndices(), etc.) use times in microseconds, not the most scripter-friendly units. Suggestion: also use datetime.datetime and datetime.timedelta objects. It's pretty easy to convert these into recording-relative time in microseconds. "Overload" those methods to accept those additional data types, or implement comparable methods that do.
timedelta would just get converted to microseconds (d.total_seconds() * 10**6). datetime would subtract the session start time (converting from UTC as necessary), and then use the resulting timedelta.
The various
EventList
/EventArray
methods for getting data based on time (e.g.getValueAt()
,getEventIndexBefore()
,getEventIndexNear()
,getRangeIndices()
, etc.) use times in microseconds, not the most scripter-friendly units. Suggestion: also usedatetime.datetime
anddatetime.timedelta
objects. It's pretty easy to convert these into recording-relative time in microseconds. "Overload" those methods to accept those additional data types, or implement comparable methods that do.timedelta
would just get converted to microseconds (d.total_seconds() * 10**6
).datetime
would subtract the session start time (converting from UTC as necessary), and then use the resultingtimedelta
.