1 |
wakaba |
1.1 |
function JSATimeline () { |
2 |
|
|
this.currentTime = 0; |
3 |
|
|
} // JSATimeline |
4 |
|
|
|
5 |
|
|
// Force the "current time" property of the timeline object being /t/. |
6 |
|
|
JSATimeline.prototype.setCurrentTime = function (t) { |
7 |
|
|
this.currentTime = t; |
8 |
|
|
}; // setCurrentTime |
9 |
|
|
|
10 |
|
|
function JSAEvent (time) { |
11 |
|
|
this,time = time; |
12 |
|
|
} // JSAEvent |
13 |
|
|
|
14 |
|
|
function JSAEventSet () { |
15 |
|
|
this.events = []; |
16 |
|
|
} // JSAEventSet |
17 |
|
|
|
18 |
|
|
JSAEventSet.prototype.addEvent = function (e) { |
19 |
|
|
if (e.eventSet) { |
20 |
|
|
throw new JSAEventException ("RegisteredEvent"); |
21 |
|
|
} |
22 |
|
|
|
23 |
|
|
this.events.push (e); |
24 |
|
|
this.events = this.events.sort (function (a, b) { return a.time < b.time }); |
25 |
|
|
}; // addEvent |
26 |
|
|
|
27 |
|
|
function JSAEventException (s) { |
28 |
|
|
this.type = s; |
29 |
|
|
} // JSAEventException |
30 |
|
|
|
31 |
|
|
JSAEventException.prototype.toString = function () { |
32 |
|
|
return "JSAEventException: " + this.type; |
33 |
|
|
}; // toString |