--- dvinfo.cpp.orig 2008-04-20 13:43:11.496194994 +0800 +++ dvinfo.cpp 2008-04-20 13:53:14.000000000 +0800 @@ -17,6 +17,7 @@ AVSValue size; AVSValue text_color; AVSValue halo_color; + AVSValue align; char rec_format[255]; char tc_format[255]; char fix_format[255]; @@ -36,7 +37,7 @@ public: DVInfo( PClip _child1, const char _filename[], const char _output[], - const AVSValue _x, const AVSValue _y, const AVSValue _font, const AVSValue _size, const AVSValue _text_color, const AVSValue _halo_color, + const AVSValue _x, const AVSValue _y, const AVSValue _font, const AVSValue _size, const AVSValue _text_color, const AVSValue _halo_color, const AVSValue _align, const char _rec_format[], const char _tc_format[], const bool _show_error, const float _threshold, const int _autoframes, const char _fix_format[], IScriptEnvironment* env): GenericVideoFilter(_child1) @@ -49,6 +50,7 @@ size = _size; text_color = _text_color; halo_color = _halo_color; + align = _align; strcpy(rec_format, _rec_format); strcpy(tc_format, _tc_format); strcpy(fix_format, _fix_format); @@ -74,14 +76,14 @@ PVideoFrame __stdcall DVInfo::GetFrame(int n, IScriptEnvironment* env) { PClip resultClip; - AVSValue args[8]; + AVSValue args[9]; char rec_time[255]; char tc_time[255]; char current_frame[255]; char dvinfotext[255]; - const char* arg_names[11] = { 0, 0, "x", "y", "font", "size", "text_color", "halo_color"}; + const char* arg_names[11] = { 0, 0, "x", "y", "font", "size", "text_color", "halo_color", "align"}; recDate.tm_sec=0; recDate.tm_min=0; @@ -179,8 +181,9 @@ args[5] = size; args[6] = text_color; args[7] = halo_color; + args[8] = align; - resultClip = (env->Invoke("Subtitle",AVSValue(args,8), arg_names )).AsClip(); + resultClip = (env->Invoke("Subtitle",AVSValue(args,9), arg_names )).AsClip(); PVideoFrame src1 = resultClip->GetFrame(n, env); // PVideoFrame src1 = env->NewVideoFrame(vi); @@ -190,17 +193,17 @@ AVSValue __cdecl Create_DVInfo(AVSValue args, void* user_data, IScriptEnvironment* env) { return new DVInfo(args[0].AsClip(), args[1].AsString(""), args[2].AsString("rec_time"), - args[3], args[4], args[5], args[6], args[7], args[8], - args[9].AsString("%Y-%m-%d %H:%M:%S"), args[10].AsString("%H:%M:%S-%d"), - args[11].AsBool(true), args[12].AsFloat(0.0), args[13].AsInt(25), - args[14].AsString(""), + args[3], args[4], args[5], args[6], args[7], args[8], args[9], + args[10].AsString("%Y-%m-%d %H:%M:%S"), args[11].AsString("%H:%M:%S-%d"), + args[12].AsBool(true), args[13].AsFloat(0.0), args[14].AsInt(25), + args[15].AsString(""), env); } extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit2(IScriptEnvironment* env) { env->AddFunction("DVInfo","c[filename]s[output]s" - "[x]i[y]i[font]s[size]i[text_color]i[halo_color]i" + "[x]i[y]i[font]s[size]i[text_color]i[halo_color]i[align]i" "[rec_format]s[tc_format]s[show_error]b" "[threshold]f[autoframes]i[fix_format]s", Create_DVInfo,0); @@ -209,8 +212,8 @@ // 0:Clip // 1,2:string "Filename", string "output", -// 3,4,5,6,7,8:int x, int y, string "font", int "size", int "text_color", int "halo_color" -// 9,10,11:string "rec_format", string "tc_format", bool "show error" -// 12,13: int threshold, int autoframes -// 14: string "fix_format" +// 3,4,5,6,7,8,9:int x, int y, string "font", int "size", int "text_color", int "halo_color", int "align" +// 10,11,12:string "rec_format", string "tc_format", bool "show error" +// 13,14: int threshold, int autoframes +// 15: string "fix_format" // Variables: current_frame, tc_time, rec_time \ No newline at end of file