+++ /dev/null
-<?php\r
-/**\r
- * This class represents a sinlge caption and all the allowed features (time, text styles, etc.) \r
- */\r
-\r
-class Caption\r
-{\r
- public $inTime;\r
- public $outTime;\r
- public $caption;\r
- public $textStyles = array(); // \r
- \r
- /**\r
- * Class Constructor: \r
- * @param String $theInTime\r
- * @param String $theOutTime\r
- * @param String $theCaption\r
- * @param Array $theTextStyles as a reference\r
- * @return void\r
- */\r
- function __construct($theInTime, $theOutTime, $theCaption,$theTextStyles)\r
- {\r
- $this->inTime = $theInTime;\r
- $this->outTime = $theOutTime;\r
- $this->caption = $theCaption;\r
- $this->textStyles= $theTextStyles;\r
- } // __construct() end\r
-\r
- // SET Functions\r
- \r
- /**\r
- * Sets value of caption IN time\r
- * @param String $theInTime\r
- * @return void \r
- */\r
- public function setInTime($theInTime)\r
- {\r
- $this->inTime = $theInTime;\r
- }\r
- \r
- /**\r
- * Sets value of caption OUT time\r
- * @param String $theOutTime\r
- * @return void \r
- */\r
- public function setOutTime($theOutTime)\r
- {\r
- $this->outTime = $theOutTime;\r
- } \r
-\r
- /**\r
- * Sets value of a caption (multiple lines allowed)\r
- * @param String $theCaption\r
- * @return void \r
- */\r
- public function setCaption($theCaption)\r
- {\r
- $this->caption = $theCaption;\r
- } \r
-\r
- /**\r
- * Sets value of Caption text style attribute\r
- * @param String $theAtt Attribute name\r
- * @param String $theValue Attribute Value \r
- */\r
- public function setTextAtribute($theAtt,$theValue)\r
- {\r
- $this->textStyles[$theAtt]=$theValue;\r
- }\r
-\r
- // GET Functions\r
- \r
- /**\r
- * Gets value of Caption IN Time\r
- * @return String inTime Caption \r
- */\r
- public function getInTime()\r
- {\r
- return $this->inTime;\r
- }\r
- \r
- /**\r
- * Gets value of Caption OUT Time\r
- * @return String outTime Caption \r
- */ \r
- public function getOutTime()\r
- {\r
- return $this->outTime;\r
- }\r
- \r
-\r
- /**\r
- * Gets value of Caption text\r
- * @return String inTime Caption text \r
- */\r
- public function getCaption()\r
- {\r
- return $this->caption;\r
- }\r
- \r
- /**\r
- * Gets text style array\r
- * @return Array $theTextStyles Txt Styles Array \r
- */ \r
- public function getTextStyles()\r
- {\r
- return $this->textStyles; \r
- }\r
-\r
-\r
- /**\r
- * Gets value of Caption text style attribute\r
- * @param String $theAtt Attribute name\r
- * @return String $Value Attribute Value \r
- */ \r
- public function getTextAtribute($theAtt)\r
- {\r
- return $this->textStyles[$theAtt];\r
- }\r
-\r
- /**\r
- * Print all values of the Caption as a String\r
- */ \r
- public function toString()\r
- {\r
- echo "<br/><b>In Time: </b>". $this->getInTime()."";\r
- echo "<br/><b>Out Time: </b>". $this->getOutTime()."";\r
- echo "<br/><b>Caption: </b>". $this->getCaption()."";\r
- \r
- if (count($this->textStyles!=0))\r
- {\r
- if (count($this->textStyles)==0)\r
- {\r
- //echo '<br/>----(NO text styles found)';\r
- } else {\r
- \r
- echo '<br/><b>------[Caption] Styles: </b>';\r
- \r
- // Display all text attributes in the caption\r
- foreach ($this->textStyles as $styleName=>$styleValue)\r
- {\r
- echo '<br/> -----'.$styleName.' = '.$styleValue;\r
- } // foreach end\r
- }// end if\r
- \r
- } //if end\r
- \r
- }// toString() end \r
- \r
- // return this caption object\r
- public function getThisCaption()\r
- {\r
- return $this;\r
- }\r
-} // end class Caption\r
-?>
\ No newline at end of file