5 class SubViewer extends CaptionFormat
\r
8 * Imports a caption string into a CaptionCollection
\r
10 * @param String $theCCString the caption file as string
\r
11 * @return CaptionCollection $myCcCollection A CaptionCollection Object
\r
13 public function importCC($theCCString)
\r
19 * Exports a CaptionCollection object into a string
\r
21 * @param CaptionCollection $theCollection A CaptionCollection Object
\r
22 * @return String $captionString The caption as a String
\r
24 public function exportCC($theCollection)
\r
29 $myCollection = $theCollection->getCollection();
\r
31 foreach ($myCollection as $captionObj)
\r
34 $ccExport.= chr(10).$captionObj->getInTime();
\r
39 $ccExport.= $captionObj->getOutTime();
\r
41 // fix caption to subViewer v. 1
\r
42 $fixCaption = str_replace(chr(10),'',$captionObj->getCaption());
\r
43 $fixCaption = str_replace('<BR/>','',$fixCaption);
\r
46 $ccExport.= chr(10).$fixCaption.chr(10);
\r
55 * Verify if the caption file is a srt caption file
\r
57 public function checkFormat($theCCString)
\r
60 } // end checkFormat()
\r
63 * Here functions to re-define
\r
65 public function getName()
\r
67 return 'SubViewer - Sub';
\r
70 public function getAbout()
\r
75 public function getVersion()
\r
80 public function getFileExtension()
\r
85 public function getIdPattern()
\r
87 $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
92 public function allowsTextStyles()
\r
97 public function template()
\r
100 00:04:35.03,00:04:38.82
\r
101 Hello guys... please seat down...
\r
103 00:05:00.19,00:05:03.47
\r
104 M. Franklin,[br]are you crazy?
\r
108 caption 1 - using Bold style?
\r
113 return $ccTemplate;
\r
116 } // end SubViewer Class
\r