public function __construct($_filename = null, $_encoding = null, $_useIconv = false) { $this->headers = array('Title' => '<untitled>', 'Original Script' => '<unknown>', 'Original Translation' => null, 'Original Editing' => null, 'Original Timing' => null, 'Synch Point' => null, 'Script Updated By' => null, 'Update Details' => null, 'ScriptType' => 'v4.00+', 'Collisions' => 'Normal', 'PlayResX' => 384, 'PlayResY' => 288, 'PlayDepth' => 0, 'Timer' => '100.0', 'WrapStyle' => 0); $this->styleVersion = 'v4+'; $this->styles = array('Name' => 'Default', 'Fontname' => 'Arial', 'Fontsize' => 20, 'PrimaryColour' => '&H00FFFFFF', 'SecondaryColour' => '&H00000000', 'OutlineColour' => '&H00000000', 'BackColour' => '&H00000000', 'Bold' => 0, 'Italic' => 0, 'Underline' => 0, 'StrikeOut' => 0, 'ScaleX' => 100, 'ScaleY' => 100, 'Spacing' => 0, 'Angle' => 0, 'BorderStyle' => 1, 'Outline' => 2, 'Shadow' => 0, 'Alignment' => 2, 'MarginL' => 15, 'MarginR' => 15, 'MarginV' => 15, 'Encoding' => 0); $this->events = array('Layer', 'Start', 'End', 'Style', 'Name', 'MarginL', 'MarginR', 'MarginV', 'Effect', 'Text'); $this->comments = array(); parent::__construct($_filename, $_encoding, $_useIconv); }
public static function defaultConverter(FileInterface $_file, $_convertTo) { $subtitleClass = __NAMESPACE__ . '\\Format\\' . ucfirst($_convertTo) . 'File'; if (!class_exists($subtitleClass)) { throw new \InvalidArgumentException(sprintf('Unable to convert to "%s", this format does not exists.', $_convertTo)); } $newSub = new $subtitleClass(); $cueClass = File::getExpectedCueClass($newSub); foreach ($_file->getCues() as $cue) { $newSub->addCue($cue->getText(), $cueClass::ms2tc($cue->getStartMS()), $cueClass::ms2tc($cue->getStopMS())); } return $newSub; }
public function __construct($_filename = null, $_encoding = null, $_useIconv = false, $_requireStrictFileFormat = true) { $this->options = $this->defaultOptions; $this->options['_requireStrictFileFormat'] = $_requireStrictFileFormat; parent::__construct($_filename, $_encoding, $_useIconv); }
public function __construct($_filename = null, $_encoding = null, $_useIconv = false) { parent::__construct($_filename, $_encoding, $_useIconv); $this->options = $this->defaultOptions; }
public function addCue($_mixed, $_start = null, $_stop = null) { if (get_class($_mixed) === self::getExpectedCueClass($this)) { if (null !== $_mixed->getStyle() && !isset($this->styles[$_mixed->getStyle()])) { throw new \InvalidArgumentException(sprintf('Invalid cue style "%s"', $_mixed->getStyle())); } if (null !== $_mixed->getRegion() && !isset($this->regions[$_mixed->getRegion()])) { throw new \InvalidArgumentException(sprintf('Invalid cue region "%s"', $_mixed->getRegion())); } } return parent::addCue($_mixed, $_start, $_stop); }