@@ -33,10 +33,10 @@ BOOL initialize(FILTER* fp)
33
33
// ---------------------------------------------------------------------
34
34
BOOL exit (FILTER* fp)
35
35
{
36
- fp->exfunc ->ini_save_int (fp, " x1" , g_curve_value.control_point [0 ].x );
37
- fp->exfunc ->ini_save_int (fp, " y1" , g_curve_value.control_point [0 ].y );
38
- fp->exfunc ->ini_save_int (fp, " x2" , g_curve_value.control_point [1 ].x );
39
- fp->exfunc ->ini_save_int (fp, " y2" , g_curve_value.control_point [1 ].y );
36
+ fp->exfunc ->ini_save_int (fp, " x1" , g_curve_value.ctpt [0 ].x );
37
+ fp->exfunc ->ini_save_int (fp, " y1" , g_curve_value.ctpt [0 ].y );
38
+ fp->exfunc ->ini_save_int (fp, " x2" , g_curve_value.ctpt [1 ].x );
39
+ fp->exfunc ->ini_save_int (fp, " y2" , g_curve_value.ctpt [1 ].y );
40
40
fp->exfunc ->ini_save_int (fp, " separator" , g_config.separator );
41
41
fp->exfunc ->ini_save_int (fp, " mode" , g_config.mode );
42
42
fp->exfunc ->ini_save_int (fp, " align_mode" , g_config.align_mode );
@@ -51,6 +51,37 @@ BOOL exit(FILTER* fp)
51
51
}
52
52
53
53
54
+
55
+ // ---------------------------------------------------------------------
56
+ // プロジェクトファイル読み込み時に実行される関数
57
+ // ---------------------------------------------------------------------
58
+ BOOL on_project_load (FILTER* fp, void * editp, void * data, int size)
59
+ {
60
+ if (data) {
61
+ memcpy (g_curve_id, data, size);
62
+ }
63
+ return TRUE ;
64
+ }
65
+
66
+
67
+
68
+ // ---------------------------------------------------------------------
69
+ // プロジェクトファイル保存時に実行される関数
70
+ // ---------------------------------------------------------------------
71
+ BOOL on_project_save (FILTER* fp, void * editp, void * data, int * size)
72
+ {
73
+ int size_curve_id = sizeof (ce::Points_ID) * CE_POINT_MAX * CE_CURVE_MAX;
74
+ if (!data) {
75
+ *size = sizeof (g_curve_id);
76
+ }
77
+ else {
78
+ memcpy (data, g_curve_id, sizeof (g_curve_id));
79
+ }
80
+ return TRUE ;
81
+ }
82
+
83
+
84
+
54
85
// ---------------------------------------------------------------------
55
86
// aviutl.iniから設定を読み込み
56
87
// ---------------------------------------------------------------------
@@ -61,10 +92,10 @@ void ini_load_configs(FILTER* fp)
61
92
g_config.alert = fp->exfunc ->ini_load_int (fp, " show_alerts" , 1 );
62
93
g_config.auto_copy = fp->exfunc ->ini_load_int (fp, " auto_copy" , 0 );
63
94
g_config.id_current = fp->exfunc ->ini_load_int (fp, " id" , 0 );
64
- g_curve_value.control_point [0 ].x = fp->exfunc ->ini_load_int (fp, " x1" , 400 );
65
- g_curve_value.control_point [0 ].y = fp->exfunc ->ini_load_int (fp, " y1" , 400 );
66
- g_curve_value.control_point [1 ].x = fp->exfunc ->ini_load_int (fp, " x2" , 600 );
67
- g_curve_value.control_point [1 ].y = fp->exfunc ->ini_load_int (fp, " y2" , 600 );
95
+ g_curve_value.ctpt [0 ].x = fp->exfunc ->ini_load_int (fp, " x1" , 400 );
96
+ g_curve_value.ctpt [0 ].y = fp->exfunc ->ini_load_int (fp, " y1" , 400 );
97
+ g_curve_value.ctpt [1 ].x = fp->exfunc ->ini_load_int (fp, " x2" , 600 );
98
+ g_curve_value.ctpt [1 ].y = fp->exfunc ->ini_load_int (fp, " y2" , 600 );
68
99
g_config.separator = fp->exfunc ->ini_load_int (fp, " separator" , 200 );
69
100
g_config.mode = fp->exfunc ->ini_load_int (fp, " mode" , 0 );
70
101
g_config.align_mode = fp->exfunc ->ini_load_int (fp, " align_mode" , 1 );
@@ -136,16 +167,16 @@ void read_value(int value)
136
167
UINT usint;
137
168
if (value < 0 ) usint = value + 2147483647 ;
138
169
else usint = (UINT)value + (UINT)2147483647 ;
139
- g_curve_value.control_point [1 ].y = usint / 6600047 ;
140
- g_curve_value.control_point [1 ].x = (usint - g_curve_value.control_point [1 ].y * 6600047 ) / 65347 ;
141
- g_curve_value.control_point [0 ].y = (usint - (g_curve_value.control_point [1 ].y * 6600047 + g_curve_value.control_point [1 ].x * 65347 )) / 101 ;
142
- g_curve_value.control_point [0 ].x = (usint - (g_curve_value.control_point [1 ].y * 6600047 + g_curve_value.control_point [1 ].x * 65347 )) % 101 ;
143
- g_curve_value.control_point [0 ].x *= CE_GR_RES / 100 ;
144
- g_curve_value.control_point [0 ].y *= CE_GR_RES / 100 ;
145
- g_curve_value.control_point [1 ].x *= CE_GR_RES / 100 ;
146
- g_curve_value.control_point [1 ].y *= CE_GR_RES / 100 ;
147
- g_curve_value.control_point [0 ].y -= 273 ;
148
- g_curve_value.control_point [0 ].y -= 273 ;
170
+ g_curve_value.ctpt [1 ].y = usint / 6600047 ;
171
+ g_curve_value.ctpt [1 ].x = (usint - g_curve_value.ctpt [1 ].y * 6600047 ) / 65347 ;
172
+ g_curve_value.ctpt [0 ].y = (usint - (g_curve_value.ctpt [1 ].y * 6600047 + g_curve_value.ctpt [1 ].x * 65347 )) / 101 ;
173
+ g_curve_value.ctpt [0 ].x = (usint - (g_curve_value.ctpt [1 ].y * 6600047 + g_curve_value.ctpt [1 ].x * 65347 )) % 101 ;
174
+ g_curve_value.ctpt [0 ].x *= CE_GR_RES / 100 ;
175
+ g_curve_value.ctpt [0 ].y *= CE_GR_RES / 100 ;
176
+ g_curve_value.ctpt [1 ].x *= CE_GR_RES / 100 ;
177
+ g_curve_value.ctpt [1 ].y *= CE_GR_RES / 100 ;
178
+ g_curve_value.ctpt [0 ].y -= 273 ;
179
+ g_curve_value.ctpt [0 ].y -= 273 ;
149
180
}
150
181
151
182
@@ -179,12 +210,12 @@ std::string create_value_4d()
179
210
FLOAT ptx, pty;
180
211
std::string strx, stry, strResult;
181
212
for (int i = 0 ; i < 2 ; i++) {
182
- ptx = std::round (g_curve_value.control_point [i].x * 100 / (double )CE_GR_RES) * 0.01 ;
183
- pty = std::round (g_curve_value.control_point [i].y * 100 / (double )CE_GR_RES) * 0.01 ;
213
+ ptx = std::round (g_curve_value.ctpt [i].x * 100 / (double )CE_GR_RES) * 0.01 ;
214
+ pty = std::round (g_curve_value.ctpt [i].y * 100 / (double )CE_GR_RES) * 0.01 ;
184
215
strx = std::to_string (ptx);
185
216
stry = std::to_string (pty);
186
217
strx.erase (4 );
187
- if (g_curve_value.control_point [i].y < 0 ) stry.erase (5 );
218
+ if (g_curve_value.ctpt [i].y < 0 ) stry.erase (5 );
188
219
else stry.erase (4 );
189
220
strResult += strx + " , " + stry + " , " ;
190
221
}
@@ -200,10 +231,10 @@ int create_value_1d()
200
231
{
201
232
int result;
202
233
int x1, y1, x2, y2;
203
- x1 = (int )std::round (g_curve_value.control_point [0 ].x * 100 / (double )CE_GR_RES);
204
- y1 = (int )std::round (g_curve_value.control_point [0 ].y * 100 / (double )CE_GR_RES);
205
- x2 = (int )std::round (g_curve_value.control_point [1 ].x * 100 / (double )CE_GR_RES);
206
- y2 = (int )std::round (g_curve_value.control_point [1 ].y * 100 / (double )CE_GR_RES);
234
+ x1 = (int )std::round (g_curve_value.ctpt [0 ].x * 100 / (double )CE_GR_RES);
235
+ y1 = (int )std::round (g_curve_value.ctpt [0 ].y * 100 / (double )CE_GR_RES);
236
+ x2 = (int )std::round (g_curve_value.ctpt [1 ].x * 100 / (double )CE_GR_RES);
237
+ y2 = (int )std::round (g_curve_value.ctpt [1 ].y * 100 / (double )CE_GR_RES);
207
238
// Limit Values
208
239
if (y1 < -273 || 373 < y1 || y2 < -273 || 373 < y2) {
209
240
return CE_OUTOFRANGE;
0 commit comments