Captioning\File::changeFPS PHP Method

changeFPS() public method

Converts timecodes based on the specified FPS ratio
public changeFPS ( float $_old_fps, float $_new_fps ) : File
$_old_fps float
$_new_fps float
return File
    public function changeFPS($_old_fps, $_new_fps)
    {
        $cuesCount = $this->getCuesCount();
        for ($i = 0; $i < $cuesCount; $i++) {
            $cue = $this->getCue($i);
            $old_start = $cue->getStart();
            $old_stop = $cue->getStop();
            $new_start = $old_start * ($_new_fps / $_old_fps);
            $new_stop = $old_stop * ($_new_fps / $_old_fps);
            $cue->setStart($new_start);
            $cue->setStop($new_stop);
        }
        return $this;
    }