mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-21 09:37:50 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -0,0 +1,68 @@
|
||||
package org.osmf.captioning.model
|
||||
{
|
||||
import flash.errors.IllegalOperationError;
|
||||
import org.osmf.metadata.TimelineMarker;
|
||||
import org.osmf.utils.OSMFStrings;
|
||||
|
||||
public class Caption extends TimelineMarker
|
||||
{
|
||||
|
||||
private var _id:uint;
|
||||
|
||||
private var _captionText:String;
|
||||
|
||||
private var _formats:Vector.<CaptionFormat>;
|
||||
|
||||
public function Caption(id:uint, start:Number, end:Number, captionText:String)
|
||||
{
|
||||
var duration:Number = end > 0 ? end - start : NaN;
|
||||
super(start,duration);
|
||||
this._id = id;
|
||||
this._captionText = captionText;
|
||||
}
|
||||
|
||||
public function addCaptionFormat(value:CaptionFormat) : void
|
||||
{
|
||||
if(this._formats == null)
|
||||
{
|
||||
this._formats = new Vector.<CaptionFormat>();
|
||||
}
|
||||
this._formats.push(value);
|
||||
}
|
||||
|
||||
public function get numCaptionFormats() : int
|
||||
{
|
||||
var num:int = 0;
|
||||
if(this._formats != null)
|
||||
{
|
||||
num = int(this._formats.length);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public function getCaptionFormatAt(index:int) : CaptionFormat
|
||||
{
|
||||
if(this._formats == null || index >= this._formats.length || index < 0)
|
||||
{
|
||||
throw new IllegalOperationError(OSMFStrings.getString(OSMFStrings.INVALID_PARAM));
|
||||
}
|
||||
return this._formats[index];
|
||||
}
|
||||
|
||||
public function get text() : String
|
||||
{
|
||||
return this._captionText;
|
||||
}
|
||||
|
||||
public function get clearText() : String
|
||||
{
|
||||
var clrTxt:String = "";
|
||||
if(this._captionText != null && this._captionText.length > 0)
|
||||
{
|
||||
clrTxt = this._captionText.replace(/<(.|\n)*?>/g,"");
|
||||
}
|
||||
return clrTxt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package org.osmf.captioning.model
|
||||
{
|
||||
public class CaptionFormat
|
||||
{
|
||||
|
||||
public static const UNDEFINED_INDEX:int = -1;
|
||||
|
||||
private static const MISSING_STYLE_ERROR_MSG:String = "CaptionStyle is required for CaptionFormat objects";
|
||||
|
||||
private var _startIndex:int;
|
||||
|
||||
private var _endIndex:int;
|
||||
|
||||
private var _style:CaptionStyle;
|
||||
|
||||
public function CaptionFormat(style:CaptionStyle, start:int = -1, end:int = -1)
|
||||
{
|
||||
super();
|
||||
if(style == null)
|
||||
{
|
||||
throw new ArgumentError(MISSING_STYLE_ERROR_MSG);
|
||||
}
|
||||
this._startIndex = start;
|
||||
this._endIndex = end;
|
||||
this._style = style;
|
||||
}
|
||||
|
||||
public function get startIndex() : int
|
||||
{
|
||||
return this._startIndex;
|
||||
}
|
||||
|
||||
public function get endIndex() : int
|
||||
{
|
||||
return this._endIndex;
|
||||
}
|
||||
|
||||
public function get style() : CaptionStyle
|
||||
{
|
||||
return this._style;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
package org.osmf.captioning.model
|
||||
{
|
||||
public class CaptionStyle
|
||||
{
|
||||
|
||||
private var _id:String;
|
||||
|
||||
private var _backgroundColor:Object;
|
||||
|
||||
private var _backgroundColorAlpha:Object;
|
||||
|
||||
private var _textColor:Object;
|
||||
|
||||
private var _textColorAlpha:Object;
|
||||
|
||||
private var _fontFamily:String;
|
||||
|
||||
private var _fontSize:int;
|
||||
|
||||
private var _fontStyle:String;
|
||||
|
||||
private var _fontWeight:String;
|
||||
|
||||
private var _textAlign:String;
|
||||
|
||||
private var _wrapOption:Boolean;
|
||||
|
||||
public function CaptionStyle(id:String)
|
||||
{
|
||||
super();
|
||||
this._id = id;
|
||||
}
|
||||
|
||||
public function get id() : String
|
||||
{
|
||||
return this._id;
|
||||
}
|
||||
|
||||
public function get backgroundColor() : Object
|
||||
{
|
||||
return this._backgroundColor;
|
||||
}
|
||||
|
||||
public function set backgroundColor(value:Object) : void
|
||||
{
|
||||
this._backgroundColor = value;
|
||||
}
|
||||
|
||||
public function get backgroundColorAlpha() : Object
|
||||
{
|
||||
return this._backgroundColorAlpha;
|
||||
}
|
||||
|
||||
public function set backgroundColorAlpha(value:Object) : void
|
||||
{
|
||||
this._backgroundColorAlpha = value;
|
||||
}
|
||||
|
||||
public function get textColor() : Object
|
||||
{
|
||||
return this._textColor;
|
||||
}
|
||||
|
||||
public function set textColor(value:Object) : void
|
||||
{
|
||||
this._textColor = value;
|
||||
}
|
||||
|
||||
public function get textColorAlpha() : Object
|
||||
{
|
||||
return this._textColorAlpha;
|
||||
}
|
||||
|
||||
public function set textColorAlpha(value:Object) : void
|
||||
{
|
||||
this._textColorAlpha = value;
|
||||
}
|
||||
|
||||
public function get fontFamily() : String
|
||||
{
|
||||
return this._fontFamily;
|
||||
}
|
||||
|
||||
public function set fontFamily(value:String) : void
|
||||
{
|
||||
this._fontFamily = value;
|
||||
}
|
||||
|
||||
public function get fontSize() : int
|
||||
{
|
||||
return this._fontSize;
|
||||
}
|
||||
|
||||
public function set fontSize(value:int) : void
|
||||
{
|
||||
this._fontSize = value;
|
||||
}
|
||||
|
||||
public function get fontStyle() : String
|
||||
{
|
||||
return this._fontStyle;
|
||||
}
|
||||
|
||||
public function set fontStyle(value:String) : void
|
||||
{
|
||||
this._fontStyle = value;
|
||||
}
|
||||
|
||||
public function get fontWeight() : String
|
||||
{
|
||||
return this._fontWeight;
|
||||
}
|
||||
|
||||
public function set fontWeight(value:String) : void
|
||||
{
|
||||
this._fontWeight = value;
|
||||
}
|
||||
|
||||
public function get textAlign() : String
|
||||
{
|
||||
return this._textAlign;
|
||||
}
|
||||
|
||||
public function set textAlign(value:String) : void
|
||||
{
|
||||
this._textAlign = value;
|
||||
}
|
||||
|
||||
public function get wrapOption() : Boolean
|
||||
{
|
||||
return this._wrapOption;
|
||||
}
|
||||
|
||||
public function set wrapOption(value:Boolean) : void
|
||||
{
|
||||
this._wrapOption = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
package org.osmf.captioning.model
|
||||
{
|
||||
import flash.errors.IllegalOperationError;
|
||||
import org.osmf.utils.OSMFStrings;
|
||||
|
||||
public class CaptioningDocument
|
||||
{
|
||||
|
||||
private var _title:String;
|
||||
|
||||
private var _desc:String;
|
||||
|
||||
private var _copyright:String;
|
||||
|
||||
private var _captions:Vector.<Caption>;
|
||||
|
||||
private var _styles:Vector.<CaptionStyle>;
|
||||
|
||||
public function CaptioningDocument()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get title() : String
|
||||
{
|
||||
return this._title;
|
||||
}
|
||||
|
||||
public function set title(value:String) : void
|
||||
{
|
||||
this._title = value;
|
||||
}
|
||||
|
||||
public function get description() : String
|
||||
{
|
||||
return this._desc;
|
||||
}
|
||||
|
||||
public function set description(value:String) : void
|
||||
{
|
||||
this._desc = value;
|
||||
}
|
||||
|
||||
public function get copyright() : String
|
||||
{
|
||||
return this._copyright;
|
||||
}
|
||||
|
||||
public function set copyright(value:String) : void
|
||||
{
|
||||
this._copyright = value;
|
||||
}
|
||||
|
||||
public function addStyle(style:CaptionStyle) : void
|
||||
{
|
||||
if(this._styles == null)
|
||||
{
|
||||
this._styles = new Vector.<CaptionStyle>();
|
||||
}
|
||||
this._styles.push(style);
|
||||
}
|
||||
|
||||
public function get numStyles() : int
|
||||
{
|
||||
var num:int = 0;
|
||||
if(this._styles != null)
|
||||
{
|
||||
num = int(this._styles.length);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public function getStyleAt(index:int) : CaptionStyle
|
||||
{
|
||||
if(this._styles == null || index >= this._styles.length)
|
||||
{
|
||||
throw new IllegalOperationError(OSMFStrings.getString(OSMFStrings.INVALID_PARAM));
|
||||
}
|
||||
return this._styles[index];
|
||||
}
|
||||
|
||||
public function addCaption(caption:Caption) : void
|
||||
{
|
||||
if(this._captions == null)
|
||||
{
|
||||
this._captions = new Vector.<Caption>();
|
||||
}
|
||||
this._captions.push(caption);
|
||||
}
|
||||
|
||||
public function get numCaptions() : int
|
||||
{
|
||||
var num:int = 0;
|
||||
if(this._captions != null)
|
||||
{
|
||||
num = int(this._captions.length);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public function getCaptionAt(index:int) : Caption
|
||||
{
|
||||
if(this._captions == null || index >= this._captions.length)
|
||||
{
|
||||
throw new IllegalOperationError(OSMFStrings.getString(OSMFStrings.INVALID_PARAM));
|
||||
}
|
||||
return this._captions[index];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user