changed git call from https to git readonly
[atutor.git] / mods / atutor_opencaps / opencaps / conversion_service / include / classes / ccformats / cc_DvdStl_format.php
1 <?php\r
2 /**\r
3  * DvdStl Class\r
4  */\r
5 class DvdStl extends CaptionFormat\r
6 {\r
7         /**\r
8          * Imports a caption string into a CaptionCollection \r
9          *\r
10          * @param String $theCCString the caption file as string\r
11          * @return CaptionCollection $myCcCollection A CaptionCollection Object\r
12          */\r
13         public function importCC($theCCString)\r
14         {\r
15                 \r
16         } // end importCC()\r
17         \r
18         /**\r
19          * Exports a CaptionCollection object into a string\r
20          *\r
21          * @param CaptionCollection $theCollection A CaptionCollection Object\r
22          * @return String $captionString The caption as a String\r
23          */\r
24         public function exportCC($theCollection)\r
25         {\r
26                 \r
27                 $ccExport = '';\r
28                 \r
29                 $myCollection = $theCollection->getCollection();\r
30                 \r
31                 foreach ($myCollection as $captionObj)\r
32                 {\r
33                         $fixCap = TxtFileTools::ccNewLineToBr($captionObj->getCaption(),' ');\r
34                         \r
35                         $ccExport .= $captionObj->getInTime().', '.$captionObj->getOutTime().", ".$fixCap."\n\n";\r
36                         \r
37                 } // end foreach\r
38                 \r
39                 return $ccExport;\r
40                 \r
41         } // end  exportCC()\r
42         \r
43         /**\r
44          * Verify if the caption file is a srt caption file \r
45         */\r
46         public function checkFormat($theCCString)\r
47         {\r
48                 \r
49         } // end checkFormat()\r
50         \r
51         /*\r
52          * Here functions to re-define\r
53          */\r
54         public function getName()\r
55         {\r
56                 return 'Spruce STL';\r
57         }\r
58         \r
59         public function getAbout()\r
60         {\r
61                 return 'Caption format used by DVD Studio and Avid in mac OS.\r
62                 Very popular.\r
63                 This format can be used to create DVD captions on Mac OS';\r
64         }\r
65         \r
66         public function getVersion()\r
67         {\r
68                 return '???';\r
69         }\r
70                 \r
71         public function getFileExtension()\r
72         {\r
73                 return 'stl';\r
74         }\r
75         \r
76         public function getIdPattern()\r
77         {\r
78                 //$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
79                 $idPattern = '/unknownZZZ/';\r
80                 //00:00:03:24 , 00:00:06:29 , Did you read the paper today?\r
81                 return $idPattern;\r
82         }\r
83 \r
84         public function allowsTextStyles()\r
85         {\r
86                 return '1';\r
87         }\r
88         \r
89         public function template()\r
90         {\r
91                 $ccTemplate = '//English subtitles\r
92 $FontName           = Arial\r
93 $FontSize           = 36\r
94 $HorzAlign          = Center\r
95 $VertAlign          = Bottom\r
96 $XOffset            = 0\r
97 $YOffset            = 0\r
98 $ColorIndex1        = 0\r
99 $ColorIndex2        = 2\r
100 $ColorIndex3        = 8\r
101 $ColorIndex4        = 3\r
102 $Contrast1          = 15\r
103 $Contrast2          = 0\r
104 $Contrast3          = 15\r
105 $Contrast4          = 0\r
106 $ForceDisplay       = FALSE\r
107 $FadeIn             = 3\r
108 $FadeOut            = 7\r
109 $TapeOffset         = FALSE\r
110 \r
111 00:00:03:24 , 00:00:06:29 , Did you read the paper today?\r
112 00:00:10:07 , 00:00:12:21 , No, did Edwards quote me right?\r
113 00:00:14:19 , 00:00:25:28 , Actually, ^IBrillstein^I said you were | unimaginably full of yourself\r
114 ';\r
115         }\r
116 \r
117 } // end Dvd Class\r
118 \r
119 ?>