Skip to main content
Skip table of contents

(v13) Timeline examples

This page applies to Harlequin v13.1r0 and later; both Harlequin Core and Harlequin MultiRIP

Consider a printer that can take a font cartridge which contains fonts the printer can use. As far as the printer is concerned, before the cartridge is plugged-in the cartridge does not exist, When it is plugged-in it has a finite lifetime; from the time it is plugged-in to the time it is removed. Once the cartridge is in the printer, the printer might start using some of the fonts. So consider what would happen when the printer is halfway through a job which is using fonts from the cartridge and you try to eject the cartridge using the eject button.

When you plug-in the font cartridge you create a timeline of type “font cartridge” and instantly anything in the system that is interested in font cartridges gets an event and is told that the font cartridge is plugged-in. Any timeline can have a context associated with it. So in this case it could be the information required to access the font cartridge.

When the eject button is pressed the skin could attempt to end the font cartridge timeline. An event is issued, but if the printer is still using one of the fonts it can object to the timeline ending and the cartridge being ejected. At that point, the responsibility for that entity, in this case the font cartridge, passes to whatever objected (the printer).

So the objector (the printer) now owns it and the core can continue to use the fonts. At the end of the job, when the fonts are no longer needed, an event is issued stating that the fonts are no longer required, and at that point, if nothing else objects, the timeline for the font cartridge would actually end.

When a timeline is actually ending a different event is issued, the “ended” event (TL_STATE_ENDED). In this particular scenario the skin would have a handler for the “ended” event for the font cartridge and would then physically eject it. As far as the skin is concerned the action of ejecting is to end the timeline. The code to actually eject it is in the default handler for the “ended” event for that timeline.

Timelines automatically provide functionality that something else can object to the cartridge being ejected, can manage the lifetime of the timeline and then can finally cause it to be ejected when it is finished with. This process applies to anything that can be represented with a timeline.

A further example is of a print head containing ink cartridges. These would have some concept of progress because if you represented an ink cartridge with a timeline you could represent how much ink is left in the cartridge by progress along the ink cartridge timeline. You might also want to have some kind of control over the removal of a particular ink cartridge. Also, if the whole print head is removable then the concept of a hierarchy; with a print head parent timeline of which the ink cartridge timelines are children. This would mean all interested parties are automatically informed if he ink cartridges are being removed by the fact that you have removed the print head.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.