src/js/model.js
branchnew-model
changeset 902 14022f1d49ab
parent 900 7673d645a8e0
child 903 d9da52e20f7f
equal deleted inserted replaced
900:7673d645a8e0 902:14022f1d49ab
   497     return new IriSP.Model.Time(this.end.milliseconds - this.begin.milliseconds)
   497     return new IriSP.Model.Time(this.end.milliseconds - this.begin.milliseconds)
   498 }
   498 }
   499 
   499 
   500 /* */
   500 /* */
   501 
   501 
   502 IriSP.Model.MashedAnnotation = function(_annotation, _offset) {
   502 IriSP.Model.MashedAnnotation = function(_mashup, _annotation) {
   503     IriSP.Model.Element.call(this, IriSP.Model.getUID(), _annotation.source);
   503     IriSP.Model.Element.call(this, _mashup.namespacedId.name + "_" + _annotation.namespacedId.name, _annotation.source);
   504     this.elementType = 'mashedAnnotation';
   504     this.elementType = 'mashedAnnotation';
   505     this.annotation = _annotation;
   505     this.annotation = _annotation;
   506     this.begin = new IriSP.Model.Time(_offset);
   506     this.begin = new IriSP.Model.Time(_mashup.duration);
   507     this.end = new IriSP.Model.Time(_offset + _annotation.getDuration());
   507     this.end = new IriSP.Model.Time(_mashup.duration + _annotation.getDuration());
   508     this.title = this.annotation.title;
   508     this.title = this.annotation.title;
   509     this.description = this.annotation.description;
   509     this.description = this.annotation.description;
   510     this.color = this.annotation.color;
   510     this.color = this.annotation.color;
   511 }
   511 }
   512 
   512 
   539 }
   539 }
   540 
   540 
   541 IriSP.Model.Mashup.prototype = new IriSP.Model.Element();
   541 IriSP.Model.Mashup.prototype = new IriSP.Model.Element();
   542 
   542 
   543 IriSP.Model.Mashup.prototype.addSegment = function(_annotation) {
   543 IriSP.Model.Mashup.prototype.addSegment = function(_annotation) {
   544     var _mashedAnnotation = new IriSP.Model.MashedAnnotation(_annotation, this.duration);
   544     var _mashedAnnotation = new IriSP.Model.MashedAnnotation(this, _annotation);
   545     this.duration.setMilliseconds(_mashedAnnotation.end);
   545     this.duration.setMilliseconds(_mashedAnnotation.end);
   546     this.segments.push(_mashedAnnotation);
   546     this.segments.push(_mashedAnnotation);
   547     this.medias.push(_annotation.getMedia());
   547     this.medias.push(_annotation.getMedia());
   548 }
   548 }
   549 
   549