Create Timeline within a Timeline?
My first post here so please excuse me if I have trouble describing my issue!
I have a piece of code which runs a timer for 5 mins to show on a TP. I am using a repeating timeline for this with events dependant on the value of timeline.repetition. At the first event a timer appears and a second timeline is triggered to send IR commands to a DVD recorder for finalising a disc. The timer displays for the 5 minutes and then disappears. This is all working OK except that the second timeline only runs once, despite being set as a repeating timeline.
Is there any limitation regarding creating a repeating timeline within a timeline event?
Thanks for your help
I have a piece of code which runs a timer for 5 mins to show on a TP. I am using a repeating timeline for this with events dependant on the value of timeline.repetition. At the first event a timer appears and a second timeline is triggered to send IR commands to a DVD recorder for finalising a disc. The timer displays for the 5 minutes and then disappears. This is all working OK except that the second timeline only runs once, despite being set as a repeating timeline.
Is there any limitation regarding creating a repeating timeline within a timeline event?
Thanks for your help
0
Comments
There is no reason I am aware of that stops you do what you wish within a timeline_event.
define_variable integer finalise_ir_list[] = {21,23,23,21,21,21,21,24,21} long tl_Finalise_ir_time[] = { 2000 } integer finalise_ir_cmd define_function fnFinalise() { tlFinalise.nRunsFor = 3000 //set times for when the events are going to occur tlFinalise.nEvent1 = 3000 tlFinalise.nEvent2 = 1 tlFinalise.nCountdownTimer = tlFinalise.nRunsFor + 1 / timeline_create(tl_Finalise, tlconst_cntdwn_time, length_array(tlconst_cntdwn_time), timeline_absolute, timeline_repeat) } timeline_event[tl_Finalise] { slong slResult char sTimeRemaining[8] tlFinalise.nReps = timeline.repetition tlFinalise.nTime = timeline.time if(timeline.repetition == tlFinalise.nRunsFor) { timeline_kill(tl_Finalise) //kill the timeline } else { if(tlFinalise.nCountdownTimer > 0) { tlFinalise.nCountdownTimer-- } //this code provides a level on the panel to show progress... slResult = fn_ScaleRange(tlFinalise.nCountdownTimer, 0, tlFinalise.nRunsFor, 3000, 0) send_level dvCV7,15,slResult //nEvent1 if(tlFinalise.nEvent1) { if(tlFinalise.nCountdownTimer == tlFinalise.nEvent1) { send_command vdvCV7,"'@PPN-Finalise Timer'" finalise_ir_cmd = 0 timeline_create(tl_Finalise_ir,tl_finalise_ir_time,length_array(tl_finalise_ir_time),timeline_absolute,timeline_repeat) } } //nEvent2 if(tlFinalise.nEvent2) { if(tlFinalise.nCountdownTimer == tlFinalise.nEvent2) { send_command vdvCV7,"'@PPF-Finalise Timer'" send_command devFinalisingDVR,"'SP',eject" } } } } timeline_event[tl_Finalise_ir] { tlFinalise_ir.nReps = timeline.repetition tlFinalise_ir.nTime = timeline.time if(tlFinalise_ir.nReps < max_length_array (finalise_ir_list)) { finalise_ir_cmd ++ send_command devFinalisingDVR,"'SP',finalise_ir_list[finalise_ir_cmd]" } else { //timeline_kill (tl_finalise_ir) } }else { //timeline_kill (tl_finalise_ir) }under your tl_Finalise_ir event is being processed when your Max_Length_array is checked.Put some debug / send_string 0 messages in there and you'll be able to see where the code is taking you...
will look again later if I get a sec.
either
define_variable integer finalise_ir_list[9] = {21,23,23,21,21,21,21,24,21}or Set_Length_Array elsewhere in your code
hth