forked from abc874/ca2018
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CutlistInfo_dialog.pas
116 lines (98 loc) · 2.83 KB
/
CutlistInfo_dialog.pas
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
unit CutlistInfo_dialog;
{$I Information.inc}
// basic review and reformatting: done
interface
uses
// Delphi
System.Classes, Vcl.ExtCtrls, Vcl.Forms, Vcl.StdCtrls, Vcl.Controls,
// Jedi
JvExStdCtrls, JvCheckBox;
const
movie_file_extensions: array[0..7] of string = ('.avi', '.mpg', '.mpeg', '.wmv', '.asf', '.mp2', '.mp4', '.mg4');
type
TFCutlistInfo = class(TForm)
lblInfoCaption: TLabel;
rgRatingByAuthor: TRadioGroup;
grpDetails: TGroupBox;
edtOtherErrorDescription: TEdit;
edtActualContent: TEdit;
cmdCancel: TButton;
cmdOk: TButton;
edtUserComment: TEdit;
lblComment: TLabel;
lblAuthor: TEdit;
pnlAuthor: TPanel;
lblSuggestedFilename: TLabel;
edtMovieName: TEdit;
cmdMovieNameCopy: TButton;
lblFrameRate: TLabel;
cbEPGError: TJvCheckBox;
cbMissingBeginning: TJvCheckBox;
cbMissingEnding: TJvCheckBox;
cbMissingVideo: TJvCheckBox;
cbMissingAudio: TJvCheckBox;
cbOtherError: TJvCheckBox;
cbFramesPresent: TJvCheckBox;
grpServerRating: TGroupBox;
lblRatingOnServer: TLabel;
lblRatingCountOnServer: TLabel;
lblDownloadTime: TLabel;
edtRatingOnServer: TEdit;
edtRatingCountOnServer: TEdit;
edtDownloadTime: TEdit;
lblRatingSent: TLabel;
edtRatingSent: TEdit;
procedure FormShow(Sender: TObject);
procedure cbEPGErrorClick(Sender: TObject);
procedure cbOtherErrorClick(Sender: TObject);
procedure EnableOK(Sender: TObject);
procedure cmdMovieNameCopyClick(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
original_movie_filename: string;
end;
var
FCutlistInfo: TFCutlistInfo;
implementation
{$R *.dfm}
uses
// Delphi
System.SysUtils, System.StrUtils;
procedure TFCutlistInfo.FormShow(Sender: TObject);
begin
cbFramesPresent.Left := rgRatingByAuthor.BoundsRect.Right - cbFramesPresent.Width;
CBEPGErrorClick(Sender);
CBOtherErrorClick(Sender);
cmdOk.Enabled := False;
end;
procedure TFCutlistInfo.cbEPGErrorClick(Sender: TObject);
begin
edtActualContent.Enabled := CBEPGError.Checked;
EnableOK(Sender);
end;
procedure TFCutlistInfo.cbOtherErrorClick(Sender: TObject);
begin
edtOtherErrorDescription.Enabled := CBOtherError.Checked;
EnableOK(Sender);
end;
procedure TFCutlistInfo.EnableOK(Sender: TObject);
begin
cmdOk.Enabled := RGRatingByAuthor.ItemIndex >= 0;
end;
procedure TFCutlistInfo.cmdMovieNameCopyClick(Sender: TObject);
var
s, e: string;
begin
s := ExtractFileName(original_movie_filename);
e := ExtractFileExt(s);
while AnsiMatchText(e, movie_file_extensions) do
begin
s := ChangeFileExt(s, '');
e := ExtractFileExt(s);
end;
s := AnsiReplaceText(s, '_', ' ');
edtMovieName.Text := s;
end;
end.