+++ /dev/null
-<?php\r
-/**\r
- * SubViewer Class\r
- */\r
-class SubViewer extends CaptionFormat\r
-{\r
- /**\r
- * Imports a caption string into a CaptionCollection \r
- *\r
- * @param String $theCCString the caption file as string\r
- * @return CaptionCollection $myCcCollection A CaptionCollection Object\r
- */\r
- public function importCC($theCCString)\r
- {\r
- \r
- } // end importCC()\r
- \r
- /**\r
- * Exports a CaptionCollection object into a string\r
- *\r
- * @param CaptionCollection $theCollection A CaptionCollection Object\r
- * @return String $captionString The caption as a String\r
- */\r
- public function exportCC($theCollection)\r
- {\r
- \r
- $ccExport = '';\r
- \r
- $myCollection = $theCollection->getCollection();\r
-\r
- foreach ($myCollection as $captionObj)\r
- {\r
- // add in time\r
- $ccExport.= chr(10).$captionObj->getInTime();\r
- \r
- $ccExport.= ',';\r
- \r
- // add out time\r
- $ccExport.= $captionObj->getOutTime();\r
- \r
- // fix caption to subViewer v. 1\r
- $fixCaption = str_replace(chr(10),'',$captionObj->getCaption());\r
- $fixCaption = str_replace('<BR/>','',$fixCaption);\r
- \r
- // add caption\r
- $ccExport.= chr(10).$fixCaption.chr(10);\r
-\r
- } // end foreach\r
- \r
- return $ccExport;\r
- \r
- } // end exportCC()\r
- \r
- /**\r
- * Verify if the caption file is a srt caption file \r
- */\r
- public function checkFormat($theCCString)\r
- {\r
- \r
- } // end checkFormat()\r
-\r
- /*\r
- * Here functions to re-define\r
- */\r
- public function getName()\r
- {\r
- return 'SubViewer - Sub';\r
- }\r
- \r
- public function getAbout()\r
- {\r
- return '????';\r
- }\r
- \r
- public function getVersion()\r
- {\r
- return '???';\r
- }\r
- \r
- public function getFileExtension()\r
- {\r
- return 'sub';\r
- }\r
- \r
- public function getIdPattern()\r
- {\r
- $idPattern = '/([0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{2})(,)([0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{2})/';\r
-\r
- return $idPattern;\r
- }\r
- \r
- public function allowsTextStyles()\r
- {\r
- return '0';\r
- }\r
- \r
- public function template()\r
- {\r
- $ccTemplate = '\r
-00:04:35.03,00:04:38.82\r
-Hello guys... please seat down...\r
-\r
-00:05:00.19,00:05:03.47\r
-M. Franklin,[br]are you crazy?\r
-\r
-????\r
-[00:00:00]\r
-caption 1 - using Bold style?\r
-[00:00:02]\r
-\r
-';\r
- \r
- return $ccTemplate;\r
- }\r
- \r
-} // end SubViewer Class\r
-?>
\ No newline at end of file