-
Notifications
You must be signed in to change notification settings - Fork 1
/
cut_assistant.dpr
144 lines (126 loc) · 4.64 KB
/
cut_assistant.dpr
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
program cut_assistant;
{$I Information.inc}
uses
{$IFDEF DEBUG}
FastMM4,
{$ENDIF}
Winapi.Windows,
System.Classes,
System.SysUtils,
Vcl.Forms,
PBOnceOnly in 'lib\PBOnceOnly.pas',
ExceptDlg in 'ExceptDlg.pas' {ExceptionDialog},
Main in 'Main.pas' {FMain},
Settings_dialog in 'Settings_dialog.pas' {FSettings},
UMemoDialog in 'UMemoDialog.pas' {frmMemoDialog},
ManageFilters in 'ManageFilters.pas' {FManageFilters},
Frames in 'Frames.pas' {FFrames},
CutlistRate_dialog in 'CutlistRate_dialog.pas' {FCutlistRate},
ResultingTimes in 'ResultingTimes.pas' {FResultingTimes},
CutlistSearchResults in 'CutlistSearchResults.pas' {FCutlistSearchResults},
CutlistInfo_dialog in 'CutlistInfo_dialog.pas' {FCutlistInfo},
UploadList in 'UploadList.pas' {Form1},
Utils in 'Utils.pas',
Movie in 'Movie.pas',
CodecSettings in 'CodecSettings.pas',
UCutlist in 'UCutlist.pas',
UCutApplicationBase in 'UCutApplicationBase.pas' {frmCutApplicationBase: TFrame},
UCutApplicationMP4Box in 'UCutApplicationMP4Box.pas' {frmCutApplicationMP4Box: TFrame},
UfrmCutting in 'UfrmCutting.pas' {frmCutting},
UCutApplicationAsfbin in 'UCutApplicationAsfbin.pas' {frmCutApplicationAsfbin: TFrame},
UCutApplicationAviDemux in 'UCutApplicationAviDemux.pas' {frmCutApplicationAviDemux: TFrame},
UFilterBank in 'UFilterBank.pas',
UCutApplicationVirtualDub in 'UCutApplicationVirtualDub.pas' {frmCutApplicationVirtualDub: TFrame},
trackBarEx in 'VCL\TrackBarEx\trackBarEx.pas',
Unit_DSTrackBarEx in 'VCL\DSTrackBarEx\Unit_DSTrackBarEx.pas',
DateTools in 'DateTools.pas',
ULogging in 'ULogging.pas' {FLogging},
UDSAStorage in 'UDSAStorage.pas',
UAbout in 'UAbout.pas' {AboutBox},
CAResources in 'CAResources.pas',
uFreeLocalizer in 'KDL\uFreeLocalizer.pas',
uStringUtils in 'KDL\uStringUtils.pas',
ReplaceFrame in 'ReplaceFrame.pas' {ReplaceFrame: TFrame},
ReplaceList in 'ReplaceList.pas',
DSPack,
Vcl.Themes,
Vcl.Styles;
{$R *.res}
{$SetPEFlags IMAGE_FILE_RELOCS_STRIPPED}
{$WEAKLINKRTTI ON}
{$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])}
procedure CheckLocalizer;
begin
{$IFDEF DEBUG}
if FreeLocalizer.Errors <> '' then
begin
ErrMsg(FreeLocalizer.Errors);
FreeLocalizer.ClearErrors;
end;
{$ENDIF}
end;
const
ProcessName = '{B3FD8E3A-7C76-404D-81D3-201CC4A4522B}';
var
iParam: Integer;
FileList: TStringList;
MessageList: TStringList;
MessageListStream: TFileStream;
begin
MessageList := TStringList.Create;
try
if AlreadyRunning(ProcessName, TApplication, TFMain) then
Exit;
Application.Initialize;
if (Settings.UsedStyle = '') or not Settings.RememberLastStyle then
Settings.UsedStyle := TStyleManager.ActiveStyle.Name
else
if Settings.UsedStyle <> TStyleManager.ActiveStyle.Name then
if not TStyleManager.TrySetStyle(Settings.UsedStyle) then
Settings.UsedStyle := TStyleManager.ActiveStyle.Name;
Application.Title := 'Cut Assistant';
CheckLocalizer;
Application.CreateForm(TFMain, FMain);
Application.CreateForm(TFSettings, FSettings);
Application.CreateForm(TfrmMemoDialog, frmMemoDialog);
Application.CreateForm(TFManageFilters, FManageFilters);
Application.CreateForm(TFFrames, FFrames);
Application.CreateForm(TFCutlistRate, FCutlistRate);
Application.CreateForm(TFResultingTimes, FResultingTimes);
Application.CreateForm(TFCutlistSearchResults, FCutlistSearchResults);
Application.CreateForm(TFCutlistInfo, FCutlistInfo);
Application.CreateForm(TFUploadList, FUploadList);
Application.CreateForm(TfrmCutting, frmCutting);
Application.CreateForm(TFLogging, FLogging);
Application.CreateForm(TAboutBox, AboutBox);
FFrames.MainForm := FMain;
if Settings.UseVMR then
FMain.VideoWindow.Mode := vmVMR;
CheckLocalizer;
FileList := TStringList.Create;
try
for iParam := 1 to ParamCount do
FileList.Add(ParamStr(iParam));
FMain.ProcessFileList(FileList, true);
finally
FileList.Free;
if BatchMode or exit_after_commandline then
Application.Terminate
else
Application.Run;
end;
finally
CheckLocalizer;
if MessageList.Count > 0 then
begin
MessageListStream := TFileStream.Create(ChangeFileExt(Application.ExeName, '.log'), fmCreate OR fmOpenReadWrite, fmShareDenyWrite);
try
MessageListStream.Seek(0, soFromEnd);
MessageList.SaveToStream(MessageListStream);
finally
MessageListStream.Free;
end;
end;
MessageList.Free;
end;
end.