5 // Created by TYPCN on 2015/6/7.
6 // Copyright (c) 2016 TYPCN. All rights reserved.
9 #ifndef bilibili_danmaku2ass_h
10 #define bilibili_danmaku2ass_h
15 void danmaku2ass(const char *infile
,const char *outfile
,int width
,int height
,const char *font
,float fontsize
,float alpha
,float duration_marquee
,float duration_still
);
19 #ifndef bilibili_danmaku2ass_hpp
20 #define bilibili_danmaku2ass_hpp
21 int GetCommentType(std::string headline
);
25 std::vector
<const char *> blockWords
;
26 std::vector
<int> disallowModes
;
31 const char *font
= "Heiti";
34 float duration_marquee
= 5;
35 float duration_still
= 5;
37 bool _convertBilibili();
39 void SetFile(const char *infile
,const char *outfile
){ in
= infile
; out
= outfile
; };
40 void SetRes(int w
,int h
){ width
= w
; height
= h
; };
41 void SetFont(const char *name
,float size
){ font
= name
; fontsize
= size
; };
42 void SetAlpha(float a
){ alpha
= a
; };
43 void SetDuration(float scroll
,float still
){ duration_marquee
= scroll
; duration_still
= still
; };
44 void SetBlockWord(const char *word
){ blockWords
.push_back(word
); };
45 void AddDisallowMode(int mode
){ disallowModes
.push_back(mode
); }; // 1 scroll 2 top 3 bottom
46 bool Convert(int type
);