Can you fast forward a timeline?
Say you have a timeline with some long events and you want to make a button that skips the timeline to the next event and the timeline keeps going. I'm going to go try it out right now.
edit: ok here it is, mostly.
edit: ok here it is, mostly.
LONG TimingArray[] = {
10000,
10001,
10002,
10003
}
TIMELINE_CREATE(SHOW_TIMELINE,DayTimingArray,MAX_LENGTH_ARRAY(DayTimingArray),TIMELINE_RELATIVE,TIMELINE_REPEAT)
DEFINE_FUNCTION LONG get_absolute_time(LONG timeline_array[], INTEGER sequence)
{
LOCAL_VAR INTEGER I;
LOCAL_VAR LONG absolute_time
absolute_time = 0;
FOR(i=1;i<=sequence+1;i++)
{
absolute_time = absolute_time + timeline_array[i];
}
RETURN absolute_time;
}
TIMELINE_EVENT[SHOW_TIMELINE]
{
TIMELINE_SEQUENCE = TIMELINE.SEQUENCE
SEND_STRING 0, "'TIMELINE.SEQUENCE', ITOA(TIMELINE_SEQUENCE)"
}
CHANNEL_EVENT[dvTest, 1]
{
ON:
{
LONG XYZZ
XYZZ = get_absolute_time(DayTimingArray, TIMELINE_SEQUENCE);
SEND_STRING 0, "'TIMELINE.SEQUENCE', ITOA(TIMELINE_SEQUENCE)"
SEND_STRING 0, "'current timeline time: ',ITOA(TIMELINE_GET(SHOW_TIMELINE))"
TIMELINE_SET(SHOW_TIMELINE, XYZZ )
SEND_STRING 0, "'setting timeline to: ', ITOA(XYZZ)"
SEND_STRING 0, "'current timeline time: ',ITOA(TIMELINE_GET(SHOW_TIMELINE))"
}
}
0
Comments
The only hassle is using a relative timeline because the timeline still counts absolute, hence the function to add all the times in the array up to the current sequence id/index.
PS. isn't here already TIMELINE_RESET?
I think that's what I tried first. I hope I did and I didn't write all those loops for nothing.