Animated presentation code: began work on manual features
Started work on making the presentation manually controllable. This is what I've done so far:
- There's a control variable called
displayMode, which is set toDISP_KIOSKorDISP_MANUALon startup. - If it's set to DISP_MANUAL, the startup function calls
slides.setupManual()instead of callingslides.next()to start the animation. - The
HcmcSlideclass has a function which sets its position and size back to its original position and size (although it's now hidden, so it won't take up space). This ought to be called when the slideshow is running in manual mode, to enable moving back to previous states of the show, but it's not yet clear how we can call it; the slide object can't call it on itself, after hiding itself, because the hide takes time, and anevalwould be required to enable this call to be postponed until after the hide is complete, but the slide object itself doesn't have a variable reference to itself which it could use in theevalcall. This may be solved by adding a variable name (probably using the slide div'sid, which is guaranteed to be unique in a valid file).
I plan to handle all of the machinery inside the HcmcSlideList object. First of all, it will create manual controls for navigation, which will be added in fixed position at the bottom right, but only be visible on hover. Then I'll create another list class, which will keep a set of references, in correct timing order, to hide and show events (each item would contain the index of a slide in the slide array, and a flag to say whether it's a show or hide event). Then each event can be run in sequence when the Next button is pressed. To go backwards, each event can be replaced by its inverse (each hide becomes a show, and vice versa). I can even see how you could jump to a particular point in the presentation by first calling hide() on any showing elements, then working through the list and figuring out which items are actually showing at that point (have been shown and not yet hidden), then calling all of their show methods.
It would probably also make sense to have fastShow() and fastHide() methods on HcmcSlide, so that jumping around in the navigation wouldn't take a long time because all the show and hide transitions would need to run.
This is looking like a plan.