changed git call from https to git readonly
[atutor.git] / mods / atutor_opencaps / opencaps / conversion_service / include / classes / ccformats / cc_RealText_format.php
1 <?php\r
2 /**\r
3  * RealText Class\r
4  */\r
5 class RealText extends CaptionFormat\r
6 {\r
7         private $textStyles = array();\r
8         \r
9         /**\r
10          * Imports a caption string into a CaptionCollection \r
11          *\r
12          * @param String $theCCString the caption file as string\r
13          * @return CaptionCollection $myCcCollection A CaptionCollection Object\r
14          */\r
15         public function importCC($theCCString)\r
16         {\r
17                 \r
18         } // end importCC()\r
19         \r
20         /**\r
21          * Exports a CaptionCollection object into a string\r
22          *\r
23          * @param CaptionCollection $theCollection A CaptionCollection Object\r
24          * @return String $captionString The caption as a String\r
25          */\r
26         public function exportCC($theCollection)\r
27         {\r
28                 \r
29                 $ccExport = '';\r
30                 \r
31                 $myCollection = $theCollection->getCollection();\r
32                 \r
33                 foreach ($myCollection as $captionObj)\r
34                 {\r
35                         \r
36                 } // end foreach\r
37                 \r
38         } // end  exportCC()\r
39         \r
40         /**\r
41          * Verify if the caption file is a srt caption file \r
42         */\r
43         public function checkFormat($theCCString)\r
44         {\r
45                 \r
46         } // end checkFormat()\r
47 \r
48         /*\r
49          * Here functions to re-define\r
50          */\r
51         public function getName()\r
52         {\r
53                 return 'Real Time';\r
54         }\r
55         \r
56         public function getAbout()\r
57         {\r
58                 return 'This Caption format can be played by Real Player.';\r
59         }\r
60         \r
61         public function getVersion()\r
62         {\r
63                 return '???';\r
64         }\r
65                 \r
66         public function getFileExtension()\r
67         {\r
68                 return 'rt';\r
69         }\r
70         \r
71         public function getIdPattern()\r
72         {\r
73                 $idPattern = '';\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
86                 \r
87                 return $idPattern;\r
88         }\r
89         \r
90         public function allowsTextStyles()\r
91         {\r
92                 return '1';\r
93         }       \r
94         public function template()\r
95         {\r
96                 $ccTemplate = '\r
97 <window bgcolor="000000" wordwrap="true" duration="00:00:02.00">\r
98 <font size="+1" face="Arial" color="#FFFFFF">\r
99 <center>\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
105 </center>\r
106 </font>\r
107 </window> \r
108 \r
109 .... or ..... \r
110 \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
116 ';\r
117                 \r
118                 return $ccTemplate;\r
119         }\r
120         \r
121 } // end Class\r
122 ?>