5 class RealText extends CaptionFormat
\r
7 private $textStyles = array();
\r
10 * Imports a caption string into a CaptionCollection
\r
12 * @param String $theCCString the caption file as string
\r
13 * @return CaptionCollection $myCcCollection A CaptionCollection Object
\r
15 public function importCC($theCCString)
\r
21 * Exports a CaptionCollection object into a string
\r
23 * @param CaptionCollection $theCollection A CaptionCollection Object
\r
24 * @return String $captionString The caption as a String
\r
26 public function exportCC($theCollection)
\r
31 $myCollection = $theCollection->getCollection();
\r
33 foreach ($myCollection as $captionObj)
\r
41 * Verify if the caption file is a srt caption file
\r
43 public function checkFormat($theCCString)
\r
46 } // end checkFormat()
\r
49 * Here functions to re-define
\r
51 public function getName()
\r
56 public function getAbout()
\r
58 return 'This Caption format can be played by Real Player.';
\r
61 public function getVersion()
\r
66 public function getFileExtension()
\r
71 public function getIdPattern()
\r
74 $idPattern .= '/'; // open regex
\r
75 $idPattern .= '('; // start class pattern
\r
76 $idPattern .= '\<Time begin="';
\r
77 $idPattern .= '[0-9]{1}:[0-9]{2}:[0-9]{2}.[0-9]{1}"'; // 1 digit at the begining and 1 at the end
\r
78 $idPattern .= '|'; // or
\r
79 $idPattern .= '\<Time begin="';
\r
80 $idPattern .= '[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{1}"'; // 2 digit at the begining and 1 at the end
\r
81 $idPattern .= '|'; // or
\r
82 $idPattern .= '\<Time begin="';
\r
83 $idPattern .= '[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{2}"'; // 2 digit at the begining and 2 at the end
\r
84 $idPattern .= ')'; // end class pattern
\r
85 $idPattern .= '/'; // close regex
\r
90 public function allowsTextStyles()
\r
94 public function template()
\r
97 <window bgcolor="000000" wordwrap="true" duration="00:00:02.00">
\r
98 <font size="+1" face="Arial" color="#FFFFFF">
\r
100 <time begin="00:00:00.00"/><clear/>
\r
101 First caption here.
\r
102 <time begin="00:00:01.00"/><clear/>
\r
103 Final caption here.
\r
104 <time begin="00:00:02.00"/><clear/>
\r
111 <Time begin="01:99:99.01"/><clear/>
\r
112 First caption here.
\r
113 <Time begin="02:99:99.02"/><clear/>
\r
114 Final caption here.
\r
115 <Time begin="03:99:99.03"/><clear/>
\r
118 return $ccTemplate;
\r