- UID
- 2546
- 积分
- 159
- 帖子
- 30
- 主题
- 5
- 论坛币
- 868
- 威望
- 0
- EP值
- 134
- MP值
- 0
- 阅读权限
- 50
- 注册时间
- 2015-5-9
- 在线时间
- 52 小时
- 最后登录
- 2024-10-20
|
本帖最后由 Seekladoom 于 2022-4-5 23:48 编辑
PyonFX的字幕输出函数- def write_line(self, line: Line) -> Optional[TypeError]:
- """Appends a line to the output list (which is private) that later on will be written to the output file when calling save().
- Use it whenever you've prepared a line, it will not impact performance since you
- will not actually write anything until :func:`save` will be called.
- Parameters:
- line (:class:`Line`): A line object. If not valid, TypeError is raised.
- """
- if isinstance(line, Line):
- self.__output.append(
- "\n%s: %d,%s,%s,%s,%s,%04d,%04d,%04d,%s,%s"
- % (
- "Comment" if line.comment else "Dialogue",
- line.layer,
- Convert.time(max(0, int(line.start_time))),
- Convert.time(max(0, int(line.end_time))),
- line.style,
- line.actor,
- line.margin_l,
- line.margin_r,
- line.margin_v,
- line.effect,
- line.text,
- )
- )
- self.__plines += 1
- else:
- raise TypeError("Expected Line object, got %s." % type(line))
复制代码
TCAX的字幕输出函数- def ass_main(ASS_BUF, SubDlg = '', Event = '', Text = ''):
- if Event == '':
- ASS_BUF.append('{0}{1}{2}\r\n'.format(SubDlg, Event, Text))
- else:
- ASS_BUF.append('{0}{{{1}}}{2}\r\n'.format(SubDlg, Event, Text))
复制代码
|
|