-
Notifications
You must be signed in to change notification settings - Fork 0
/
TsBufferExtractor.Setup.cs
229 lines (207 loc) · 7.64 KB
/
TsBufferExtractor.Setup.cs
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
using System;
using System.Windows.Forms;
using TvDatabase;
using TvLibrary.Log;
namespace SetupTv.Sections
{
public partial class TsBufferExtractorSetup : SetupTv.SectionSettings
{
private RadioButton radioButton1;
private RadioButton radioButton2;
private RadioButton radioButton3;
private GroupBox groupBox1;
private GroupBox groupBox2;
private RadioButton radioButtonBufferAndRec;
private RadioButton radioButtonBoth;
private RadioButton radioButtonMerged;
String tsBufferExtractorSetup;
String TsBufferExtractorFileSetup;
#region constructors
public TsBufferExtractorSetup()
{
InitializeComponent();
}
#endregion
public override void LoadSettings()
{
var layer = new TvBusinessLayer();
tsBufferExtractorSetup = layer.GetSetting("TsBufferExtractorSetup", "A").Value;
switch (tsBufferExtractorSetup)
{
case "A":
radioButton1.Checked = true;
break;
case "B":
radioButton2.Checked = true;
break;
case "C":
radioButton3.Checked = true;
break;
}
TsBufferExtractorFileSetup = layer.GetSetting("TsBufferExtractorFileSetup", "A").Value;
switch (TsBufferExtractorFileSetup)
{
case "A":
radioButtonBufferAndRec.Checked = true;
break;
case "B":
radioButtonMerged.Checked = true;
break;
case "C":
radioButtonBoth.Checked = true;
break;
}
}
public override void SaveSettings()
{
var layer = new TvBusinessLayer();
Setting setting = layer.GetSetting("TsBufferExtractorSetup");
if (radioButton1.Checked)
setting.Value = "A";
if (radioButton2.Checked)
setting.Value = "B";
if (radioButton3.Checked)
setting.Value = "C";
setting.Persist();
setting = layer.GetSetting("TsBufferExtractorFileSetup");
if (radioButtonBufferAndRec.Checked)
setting.Value = "A";
if (radioButtonMerged.Checked)
setting.Value = "B";
if (radioButtonBoth.Checked)
setting.Value = "C";
setting.Persist();
}
public override void OnSectionDeActivated()
{
Log.Info("TsBufferExtractor: Configuration deactivated");
SaveSettings();
base.OnSectionDeActivated();
}
public override void OnSectionActivated()
{
Log.Info("TsBufferExtractor: Configuration activated");
LoadSettings();
base.OnSectionActivated();
}
private void InitializeComponent()
{
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton3 = new System.Windows.Forms.RadioButton();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.radioButtonBufferAndRec = new System.Windows.Forms.RadioButton();
this.radioButtonBoth = new System.Windows.Forms.RadioButton();
this.radioButtonMerged = new System.Windows.Forms.RadioButton();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(18, 19);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(293, 17);
this.radioButton1.TabIndex = 0;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "from the beginning of the current program if it is available.";
this.radioButton1.UseVisualStyleBackColor = true;
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(18, 42);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(420, 17);
this.radioButton2.TabIndex = 1;
this.radioButton2.TabStop = true;
this.radioButton2.Text = "from the last channel change if the beginning of the current program is not avail" +
"able.";
this.radioButton2.UseVisualStyleBackColor = true;
//
// radioButton3
//
this.radioButton3.AutoSize = true;
this.radioButton3.Location = new System.Drawing.Point(18, 65);
this.radioButton3.Name = "radioButton3";
this.radioButton3.Size = new System.Drawing.Size(168, 17);
this.radioButton3.TabIndex = 2;
this.radioButton3.TabStop = true;
this.radioButton3.Text = "from the last channel change. ";
this.radioButton3.UseVisualStyleBackColor = true;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.radioButton1);
this.groupBox1.Controls.Add(this.radioButton3);
this.groupBox1.Controls.Add(this.radioButton2);
this.groupBox1.Location = new System.Drawing.Point(15, 39);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(441, 99);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Save the buffer";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.radioButtonBufferAndRec);
this.groupBox2.Controls.Add(this.radioButtonBoth);
this.groupBox2.Controls.Add(this.radioButtonMerged);
this.groupBox2.Location = new System.Drawing.Point(17, 148);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(441, 99);
this.groupBox2.TabIndex = 4;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Keep";
//
// radioButtonBufferAndRec
//
this.radioButtonBufferAndRec.AutoSize = true;
this.radioButtonBufferAndRec.Checked = true;
this.radioButtonBufferAndRec.Location = new System.Drawing.Point(18, 19);
this.radioButtonBufferAndRec.Name = "radioButtonBufferAndRec";
this.radioButtonBufferAndRec.Size = new System.Drawing.Size(205, 17);
this.radioButtonBufferAndRec.TabIndex = 0;
this.radioButtonBufferAndRec.TabStop = true;
this.radioButtonBufferAndRec.Text = "the saved buffer and the recorded file.";
this.radioButtonBufferAndRec.UseVisualStyleBackColor = true;
//
// radioButtonBoth
//
this.radioButtonBoth.AutoSize = true;
this.radioButtonBoth.Location = new System.Drawing.Point(18, 65);
this.radioButtonBoth.Name = "radioButtonBoth";
this.radioButtonBoth.Size = new System.Drawing.Size(76, 17);
this.radioButtonBoth.TabIndex = 2;
this.radioButtonBoth.TabStop = true;
this.radioButtonBoth.Text = "all of them.";
this.radioButtonBoth.UseVisualStyleBackColor = true;
//
// radioButtonMerged
//
this.radioButtonMerged.AutoSize = true;
this.radioButtonMerged.Location = new System.Drawing.Point(18, 42);
this.radioButtonMerged.Name = "radioButtonMerged";
this.radioButtonMerged.Size = new System.Drawing.Size(119, 17);
this.radioButtonMerged.TabIndex = 1;
this.radioButtonMerged.TabStop = true;
this.radioButtonMerged.Text = "only the merged file.";
this.radioButtonMerged.UseVisualStyleBackColor = true;
//
// TsBufferExtractorSetup
//
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Name = "TsBufferExtractorSetup";
this.Size = new System.Drawing.Size(475, 305);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
}
}
}