removed mods directory from the ATutor codebase
[atutor.git] / mods / atutor_opencaps / opencaps / conversion_service / include / classes / ccformats / cc_Sami_format.php
diff --git a/mods/atutor_opencaps/opencaps/conversion_service/include/classes/ccformats/cc_Sami_format.php b/mods/atutor_opencaps/opencaps/conversion_service/include/classes/ccformats/cc_Sami_format.php
deleted file mode 100755 (executable)
index b363a48..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-<?php\r
-/**\r
- * Sami Class\r
- */\r
-class Sami extends CaptionFormat\r
-{\r
-       private $textStyles = array();\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
-               $ccTarget = '';\r
-               \r
-       } // end importCC()\r
-       \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
-               // start SAMI Caption\r
-               $samiCaption = "";\r
-       \r
-               // add header\r
-               $samiCaption .= $this->getSamiHeader();\r
-               \r
-               // Caption counter\r
-               $capCount = 0;\r
-\r
-               // Building Sami caption \r
-               $fileContent = '';\r
-               foreach ($myCollection as $captionObj)\r
-               {\r
-       \r
-                       $capCount++;\r
-\r
-                       // convert to qt to Sami time format\r
-                       $samiTimeIn = TimeUtil::timeQtToSami($captionObj->getInTime());\r
-                       $samiTimeOut = TimeUtil::timeQtToSami($captionObj->getOutTime());\r
-                       \r
-                       $captionStyles = $captionObj->getTextStyles();\r
-                       \r
-                       $fixCap = TxtFileTools::ccNewLineToBr($captionObj->getCaption(),' <br/>');\r
-                       \r
-                       // ading caption to String \r
-                               //$samiCaption .= "". $this->getSamiCaption($samiTime,$fixCap,"QT");\r
-                       \r
-                       // new adding empty caption when time out\r
-                       $samiCaption .= "". $this->getSamiCaption($samiTimeIn,$samiTimeOut,$fixCap,$captionObj->getTextStyles());\r
-        \r
-               } // end for each caption \r
-\r
-               //  close SAMi file\r
-               $samiCaption .= $this->getSamiClose();\r
-               \r
-               $samiCaption .= "";\r
-               \r
-               $ccExport = $samiCaption;\r
-                               \r
-               return $ccExport;\r
-               \r
-       } // end  exportCC()\r
-       \r
-       /**\r
-        * Verify if the caption file is a SAMI 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 'SAMI';\r
-       }\r
-       \r
-       public function getAbout()\r
-       {\r
-               return 'This caption format can be played by Windows Media Player on Windows OS. ';\r
-       }\r
-       \r
-       public function getVersion()\r
-       {\r
-               return '1.0';\r
-       }\r
-               \r
-       public function getFileExtension()\r
-       {\r
-               return 'smi';\r
-       }\r
-       \r
-       public function getIdPattern()\r
-       {\r
-               $idPattern = '/(<SAMI>)/';\r
-               \r
-               return $idPattern;\r
-       }\r
-\r
-       public function allowsTextStyles()\r
-       {\r
-               return '1';\r
-       }\r
-       \r
-       public function template()\r
-       {\r
-               $ccTemplate = '';\r
-               \r
-               return $ccTemplate;\r
-       }\r
-\r
-\r
-/*////////////////////////////////////////////////////////\r
-        Functions for SAMI conversion\r
-//////////////////////////////////////////////////////*/\r
-\r
-/**\r
- * creates a SAMI Caption \r
- * @return String $samiCaption A SAMI formatted caption \r
- * @param int $capInTime Caption start time in miliseconds 1 sec = 1000\r
- * @param int $capOutTime Caption end time in miliseconds 1 sec = 1000\r
- * @param String $caption caption, with all styles\r
- * @param Array $txtStyles Array with text styles in the caption \r
- */\r
-private function getSamiCaption($capInTime,$capOutTime,$caption,$txtStyles)\r
-{\r
-       $samiCaption = "";\r
-       $captionReFormated = "";\r
-                \r
-       // Find if text alignment in $txtStyles array\r
-       if (isset($txtStyles['text-align']))\r
-       {\r
-               if ($txtStyles['text-align']=='right')\r
-               {\r
-                       $caption = '<table align=right><span style="color:#00FFFF">'.$caption.'</span></table>';\r
-               }\r
-               else if ($txtStyles['text-align']=='left')\r
-               {\r
-                       $caption = '<table align=left><span style="color:#FCCA03">'.$caption.'</span></table>';\r
-               }\r
-               else if ($txtStyles['text-align']=='center')\r
-               {\r
-                       $caption = '<table align=center>'.$caption.'</table>';\r
-               }\r
-       }\r
-                \r
-                \r
-    // Create SAMI Caption\r
-       $samiCaption = '\r
-        <SYNC start='.$capInTime.'><P>'.$caption.'</P></SYNC>';\r
-                \r
-        // add an empty caption when caption finishes if caption's lenght is more than x sec\r
-        // prevents caption for displaying it if next caption is to ahead  //// still working\r
-               $captionLenght = $capOutTime-$capInTime; \r
-        if ($captionLenght>2000)\r
-        {\r
-       $samiCaption .= '\r
-        <SYNC start='.$capOutTime.'><P>&nbsp;</P></SYNC>';\r
-        }\r
-        \r
-        return $samiCaption;\r
-        \r
-} // end getSamiCaption\r
-\r
-\r
-// SAMI Header \r
-private function getSamiHeader()\r
-{\r
-// common vars\r
-$textFont = "Arial";\r
-$textFontWeight = "normal";\r
-$textSize = "18";\r
-$textJustify = "center";\r
-\r
-// unique vars for SAMI\r
-$capTitle = 'This is a sample SAMI 1.0 caption';\r
-$textHtmlColor = "#FFFFFF";\r
-$bgHtmlColor = "#000000";\r
-$capLangName = "English";\r
-$capLangCode= "EN-US-CC";\r
-\r
-$capSAMI_header = '<SAMI>\r
-<HEAD>\r
-<TITLE>'.$capTitle.'</TITLE>\r
-<STYLE TYPE="text/css">\r
-<!--\r
-P { margin:  2px 20% 0px 20%; font-size:'.$textSize.'; font-family: '.$textFont.'; font-weight: '.$textFontWeight.'; color: '.$textHtmlColor.'; background-color: '.$bgHtmlColor.'; text-align: '.$textJustify.'; }\r
-.ENUSCC { name: '.$capLangName.'; lang: '.$capLangCode.'; }\r
-.txtRight { font-size:'.$textSize.'; font-family: '.$textFont.'; font-weight: '.$textFontWeight.'; color: #00FFFF; background-color: '.$bgHtmlColor.'; text-align: right; } \r
-.txtLeft { font-size:'.$textSize.'; font-family: '.$textFont.'; font-weight: '.$textFontWeight.'; color: #FCCA03; background-color: '.$bgHtmlColor.'; text-align: left; } \r
--->\r
-</STYLE>\r
-</HEAD>\r
-<BODY>';\r
-    return $capSAMI_header;\r
-} // end getSamiHeader()\r
-\r
-\r
-// SAMI Close\r
-private function getSamiClose()\r
-{\r
-$capSAMI_close = '\r
-</BODY>\r
-</SAMI>';\r
-    return $capSAMI_close;\r
-}\r
-\r
-       \r
-       \r
-} // end CCsami Class\r
-?>
\ No newline at end of file