-
Notifications
You must be signed in to change notification settings - Fork 5
/
AssClass.hpp
44 lines (35 loc) · 1.03 KB
/
AssClass.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// AssClass.h
// danmaku2ass_native
//
// Created by TYPCN on 2015/4/8.
//
//
#ifndef __danmaku2ass_native__AssClass__
#define __danmaku2ass_native__AssClass__
#include <stdio.h>
#include <fstream>
#include <vector>
#include <map>
class Ass{
private:
std::ofstream out;
std::map <float, std::pair<int, std::string>> comment_map;
int round_int( double r );
char style_name[10];
inline std::string TS2t(double timestamp);
inline void stripStr(std::string in);
inline size_t Utf8StringSize(const std::string& str);
int duration_marquee;
int duration_still;
int VideoWidth;
int VideoHeight;
int FontSize;
public:
void init(const char *filename);
void SetDuration(int dm,int ds);
void WriteHead(int width,int height,const char *font,float fontsize,float alpha);
void AppendComment(float appear_time,int comment_mode,int font_color,const char *content);
void WriteToDisk(std::vector<int> disallowModes);
};
#endif /* defined(__danmaku2ass_native__AssClass__) */