Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Cleaned up the code a bit.

SequencerItem::show now gets the position in the sequence.
  • Loading branch information...
commit e117144a3943948e450b243c0bef28f96d60f87a 1 parent 677515d
Mr.doob authored

Showing 1 changed file with 15 additions and 15 deletions. Show diff stats Hide diff stats

  1. +15 15 src/Sequencer.js
30 src/Sequencer.js
@@ -35,8 +35,6 @@ var Sequencer = function () {
35 35
36 36 this.update = function ( time ) {
37 37
38   - var item;
39   -
40 38 if ( time < _time ) {
41 39
42 40 this.clear();
@@ -45,20 +43,20 @@ var Sequencer = function () {
45 43
46 44 while ( _items[ _nextItem ] ) {
47 45
48   - item = _items[ _nextItem ];
  46 + _item = _items[ _nextItem ];
49 47
50   - if ( item.__start_time > time ) {
  48 + if ( _item.__start_time > time ) {
51 49
52 50 break;
53 51
54 52 }
55 53
56   - if ( !item.__active && item.__end_time > time ) {
  54 + if ( !_item.__active && _item.__end_time > time ) {
57 55
58   - item.show();
59   - item.__active = true;
  56 + _item.show( ( time - _item.__start_time ) / _item.__duration );
  57 + _item.__active = true;
60 58
61   - _itemsActive.push( item );
  59 + _itemsActive.push( _item );
62 60
63 61 _layersNeedSorting = true;
64 62
@@ -70,20 +68,20 @@ var Sequencer = function () {
70 68
71 69 while ( _itemsToRemove[ _nextItemToRemove ] ) {
72 70
73   - item = _itemsToRemove[ _nextItemToRemove ];
  71 + _item = _itemsToRemove[ _nextItemToRemove ];
74 72
75   - if ( item.__end_time > time ) {
  73 + if ( _item.__end_time > time ) {
76 74
77 75 break;
78 76
79 77 }
80 78
81   - if ( item.__active ) {
  79 + if ( _item.__active ) {
82 80
83   - item.hide();
84   - item.__active = false;
  81 + _item.hide();
  82 + _item.__active = false;
85 83
86   - var i = _itemsActive.indexOf( item );
  84 + var i = _itemsActive.indexOf( _item );
87 85
88 86 if ( i !== -1 ) {
89 87
@@ -117,6 +115,8 @@ var Sequencer = function () {
117 115
118 116 this.clear = function () {
119 117
  118 + console.log("called");
  119 +
120 120 _nextItem = 0;
121 121 _nextItemToRemove = 0;
122 122
@@ -139,7 +139,7 @@ SequencerItem.prototype = {
139 139
140 140 init: function () {},
141 141 load: function () {},
142   - show: function () {},
  142 + show: function ( f ) {},
143 143 hide: function () {},
144 144 update: function ( f ) {}
145 145

0 comments on commit e117144

Please sign in to comment.
Something went wrong with that request. Please try again.