Can you fast forward a timeline?
travis
Junior Member
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))"
}
}
Comments
-
The TIMELINE_SET function will set your timeline to any value you like. I mostly use it to reset the timeline to zero, but there is no reason you can't pass it one of your time values from the timer array to jump right to that sequence event.
-
DHawthorne wrote: »The TIMELINE_SET function will set your timeline to any value you like. I mostly use it to reset the timeline to zero, but there is no reason you can't pass it one of your time values from the timer array to jump right to that sequence event.
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? -
TIMELINE_KILL() and TIMELINE_CREATE() ?
-
to set the timeline to sequence 3 immediately:
TIMELINE_SET(MyTimelineID,MyTimingArray[3]-5) // I give a 5ms prerun
This should work to both on absolute and relative timeline. In the back, the timeline handler would take care to set the timer correct depending on the timeline type. -
Marc Scheibein wrote: »to set the timeline to sequence 3 immediately:
TIMELINE_SET(MyTimelineID,MyTimingArray[3]-5) // I give a 5ms prerun
This should work to both on absolute and relative timeline. In the back, the timeline handler would take care to set the timer correct depending on the timeline type.
I think that's what I tried first. I hope I did and I didn't write all those loops for nothing.
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums