MythTV
0.27pre
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Groups
Pages
mythplugins
mytharchive
mytharchive
archivesettings.cpp
Go to the documentation of this file.
1
/*
2
archivesettings.cpp
3
*/
4
5
#include <unistd.h>
6
7
// myth
8
#include <
mythcontext.h
>
9
#include <
mythdirs.h
>
10
#include <
mythdate.h
>
11
12
// mytharchive
13
#include "
archivesettings.h
"
14
15
16
static
HostLineEdit
*
MythArchiveTempDir
()
17
{
18
HostLineEdit
*gc =
new
HostLineEdit
(
"MythArchiveTempDir"
);
19
gc->
setLabel
(QObject::tr(
"MythArchive Temp Directory"
));
20
gc->
setValue
(
""
);
21
gc->
setHelpText
(QObject::tr(
"Location where MythArchive should create its "
22
"temporary work files. LOTS of free space required here."
));
23
return
gc;
24
};
25
26
static
HostLineEdit
*
MythArchiveShareDir
()
27
{
28
HostLineEdit
*gc =
new
HostLineEdit
(
"MythArchiveShareDir"
);
29
gc->
setLabel
(QObject::tr(
"MythArchive Share Directory"
));
30
gc->
setValue
(
GetShareDir
() +
"mytharchive/"
);
31
gc->
setHelpText
(QObject::tr(
"Location where MythArchive stores its scripts, "
32
"intro movies and theme files"
));
33
return
gc;
34
};
35
36
static
HostComboBox
*
PALNTSC
()
37
{
38
HostComboBox
*gc =
new
HostComboBox
(
"MythArchiveVideoFormat"
);
39
gc->
setLabel
(QObject::tr(
"Video format"
));
40
gc->
addSelection
(
"PAL"
);
41
gc->
addSelection
(
"NTSC"
);
42
gc->
setHelpText
(QObject::tr(
"Video format for DVD recordings, PAL or NTSC."
));
43
return
gc;
44
};
45
46
static
HostLineEdit
*
MythArchiveFileFilter
()
47
{
48
HostLineEdit
*gc =
new
HostLineEdit
(
"MythArchiveFileFilter"
);
49
gc->
setLabel
(QObject::tr(
"File Selector Filter"
));
50
gc->
setValue
(
"*.mpg *.mov *.avi *.mpeg *.nuv"
);
51
gc->
setHelpText
(QObject::tr(
"The file name filter to use in the file selector."
));
52
return
gc;
53
};
54
55
static
HostLineEdit
*
MythArchiveDVDLocation
()
56
{
57
HostLineEdit
*gc =
new
HostLineEdit
(
"MythArchiveDVDLocation"
);
58
gc->
setLabel
(QObject::tr(
"Location of DVD"
));
59
gc->
setValue
(
"/dev/dvd"
);
60
gc->
setHelpText
(QObject::tr(
"Which DVD drive to use when burning discs."
));
61
return
gc;
62
};
63
64
static
HostSpinBox
*
MythArchiveDriveSpeed
()
65
{
66
HostSpinBox
*gc =
new
HostSpinBox
(
"MythArchiveDriveSpeed"
, 0, 48, 1);
67
gc->
setLabel
(QObject::tr(
"DVD Drive Write Speed"
));
68
gc->
setValue
(0);
69
gc->
setHelpText
(QObject::tr(
"This is the write speed to use when burning a DVD. "
70
"Set to 0 to allow growisofs to choose the fastest available speed."
));
71
return
gc;
72
};
73
74
static
HostLineEdit
*
MythArchiveDVDPlayerCmd
()
75
{
76
HostLineEdit
*gc =
new
HostLineEdit
(
"MythArchiveDVDPlayerCmd"
);
77
gc->
setLabel
(QObject::tr(
"Command to play DVD"
));
78
gc->
setValue
(
"Internal"
);
79
gc->
setHelpText
(QObject::tr(
"Command to run when test playing a created DVD. "
80
"'Internal' will use the internal MythTV player. %f will be replaced with "
81
"the path to the created DVD structure eg. 'xine -pfhq --no-splash dvd:/%f'."
));
82
return
gc;
83
};
84
85
static
HostCheckBox
*
MythArchiveCopyRemoteFiles
()
86
{
87
HostCheckBox
*gc =
new
HostCheckBox
(
"MythArchiveCopyRemoteFiles"
);
88
gc->
setLabel
(QObject::tr(
"Copy remote files"
));
89
gc->
setValue
(
false
);
90
gc->
setHelpText
(QObject::tr(
"If set files on remote filesystems "
91
"will be copied over to the local filesystem before processing. "
92
"Speeds processing and reduces bandwidth on the network"
));
93
return
gc;
94
};
95
96
static
HostCheckBox
*
MythArchiveAlwaysUseMythTranscode
()
97
{
98
HostCheckBox
*gc =
new
HostCheckBox
(
"MythArchiveAlwaysUseMythTranscode"
);
99
gc->
setLabel
(QObject::tr(
"Always Use Mythtranscode"
));
100
gc->
setValue
(
true
);
101
gc->
setHelpText
(QObject::tr(
"If set mpeg2 files will always be passed"
102
" though mythtranscode to clean up any errors. May help to fix"
103
" some audio problems. Ignored if 'Use ProjectX' is set."
));
104
return
gc;
105
};
106
107
static
HostCheckBox
*
MythArchiveUseProjectX
()
108
{
109
HostCheckBox
*gc =
new
HostCheckBox
(
"MythArchiveUseProjectX"
);
110
gc->
setLabel
(QObject::tr(
"Use ProjectX"
));
111
gc->
setValue
(
false
);
112
gc->
setHelpText
(QObject::tr(
"If set ProjectX will be used to cut"
113
" commercials and split mpeg2 files instead of mythtranscode"
114
" and mythreplex."
));
115
return
gc;
116
};
117
118
static
HostCheckBox
*
MythArchiveUseFIFO
()
119
{
120
HostCheckBox
*gc =
new
HostCheckBox
(
"MythArchiveUseFIFO"
);
121
gc->
setLabel
(QObject::tr(
"Use FIFOs"
));
122
gc->
setValue
(
true
);
123
gc->
setHelpText
(QObject::tr(
"The script will use FIFOs to pass the output"
124
" of mplex into dvdauthor rather than creating intermediate files."
125
" Saves time and disk space during multiplex operations but not "
126
" supported on Windows platform"
));
127
return
gc;
128
};
129
130
static
HostCheckBox
*
MythArchiveAddSubtitles
()
131
{
132
HostCheckBox
*gc =
new
HostCheckBox
(
"MythArchiveAddSubtitles"
);
133
gc->
setLabel
(QObject::tr(
"Add Subtitles"
));
134
gc->
setValue
(
false
);
135
gc->
setHelpText
(QObject::tr(
"If available this option will add subtitles "
136
"to the final DVD. Requires 'Use ProjectX' to be on."
));
137
return
gc;
138
};
139
140
static
HostComboBox
*
MainMenuAspectRatio
()
141
{
142
HostComboBox
*gc =
new
HostComboBox
(
"MythArchiveMainMenuAR"
);
143
gc->
setLabel
(QObject::tr(
"Main Menu Aspect Ratio"
));
144
gc->
addSelection
(
"4:3"
);
145
gc->
addSelection
(
"16:9"
);
146
gc->
setValue
(1);
147
gc->
setHelpText
(QObject::tr(
"Aspect ratio to use when creating the main menu."
));
148
return
gc;
149
};
150
151
static
HostComboBox
*
ChapterMenuAspectRatio
()
152
{
153
HostComboBox
*gc =
new
HostComboBox
(
"MythArchiveChapterMenuAR"
);
154
gc->
setLabel
(QObject::tr(
"Chapter Menu Aspect Ratio"
));
155
gc->
addSelection
(
"4:3"
);
156
gc->
addSelection
(
"16:9"
);
157
gc->
addSelection
(
"Video"
);
158
gc->
setValue
(2);
159
gc->
setHelpText
(QObject::tr(
"Aspect ratio to use when creating the chapter menu. "
160
"Video means use the same aspect ratio as the associated video."
));
161
return
gc;
162
};
163
164
static
HostComboBox
*
MythArchiveDateFormat
()
165
{
166
HostComboBox
*gc =
new
HostComboBox
(
"MythArchiveDateFormat"
);
167
gc->
setLabel
(QObject::tr(
"Date format"
));
168
169
QDate sampdate =
MythDate::current
().toLocalTime().date();
170
QString sampleStr =
171
QObject::tr(
"Samples are shown using today's date."
);
172
173
if
(sampdate.month() == sampdate.day())
174
{
175
sampdate = sampdate.addDays(1);
176
sampleStr =
177
QObject::tr(
"Samples are shown using tomorrow's date."
);
178
}
179
180
gc->
addSelection
(sampdate.toString(
"ddd MMM d"
),
"%a %b %d"
);
181
gc->
addSelection
(sampdate.toString(
"ddd MMMM d"
),
"%a %B %d"
);
182
gc->
addSelection
(sampdate.toString(
"MMM d"
),
"%b %d"
);
183
gc->
addSelection
(sampdate.toString(
"MM/dd"
),
"%m/%d"
);
184
gc->
addSelection
(sampdate.toString(
"MM.dd"
),
"%m.%d"
);
185
gc->
addSelection
(sampdate.toString(
"ddd d MMM"
),
"%a %d %b"
);
186
gc->
addSelection
(sampdate.toString(
"M/d/yyyy"
),
"%m/%d/%Y"
);
187
gc->
addSelection
(sampdate.toString(
"dd.MM.yyyy"
),
"%d.%m.%Y"
);
188
gc->
addSelection
(sampdate.toString(
"yyyy-MM-dd"
),
"%Y-%m-%d"
);
189
gc->
addSelection
(sampdate.toString(
"ddd MMM d yyyy"
),
"%a %b %d %Y"
);
190
gc->
addSelection
(sampdate.toString(
"ddd yyyy-MM-dd"
),
"%a %Y-%m-%d"
);
191
gc->
addSelection
(sampdate.toString(
"ddd dd MMM yyyy"
),
"%a %d %b %Y"
);
192
gc->
setHelpText
(QObject::tr(
"Your preferred date format to use on DVD menus."
) +
" "
+
193
sampleStr);
194
return
gc;
195
}
196
197
static
HostComboBox
*
MythArchiveTimeFormat
()
198
{
199
HostComboBox
*gc =
new
HostComboBox
(
"MythArchiveTimeFormat"
);
200
gc->
setLabel
(QObject::tr(
"Time format"
));
201
202
QTime samptime = QTime::currentTime();
203
204
gc->
addSelection
(samptime.toString(
"hh:mm AP"
),
"%I:%M %p"
);
205
gc->
addSelection
(samptime.toString(
"hh:mm"
),
"%H:%M"
);
206
gc->
setHelpText
(QObject::tr(
"Your preferred time format to display on DVD menus. "
207
"You must choose a format with \"AM\" or \"PM\" in it, otherwise your "
208
"time display will be 24-hour or \"military\" time."
));
209
return
gc;
210
}
211
212
static
HostComboBox
*
MythArchiveDefaultEncProfile
()
213
{
214
HostComboBox
*gc =
new
HostComboBox
(
"MythArchiveDefaultEncProfile"
);
215
gc->
setLabel
(QObject::tr(
"Default Encoder Profile"
));
216
217
gc->
addSelection
(
"HQ"
,
"HQ"
);
218
gc->
addSelection
(
"SP"
,
"SP"
);
219
gc->
addSelection
(
"LP"
,
"LP"
);
220
gc->
addSelection
(
"EP"
,
"EP"
);
221
gc->
setValue
(1);
222
gc->
setHelpText
(QObject::tr(
"Default encoding profile to use if a file "
223
"needs re-encoding."
));
224
return
gc;
225
}
226
227
static
HostLineEdit
*
MythArchiveMplexCmd
()
228
{
229
HostLineEdit
*gc =
new
HostLineEdit
(
"MythArchiveMplexCmd"
);
230
gc->
setLabel
(QObject::tr(
"mplex Command"
));
231
gc->
setValue
(
"mplex"
);
232
gc->
setHelpText
(QObject::tr(
"Command to run mplex"
));
233
return
gc;
234
};
235
236
static
HostLineEdit
*
MythArchiveDvdauthorCmd
()
237
{
238
HostLineEdit
*gc =
new
HostLineEdit
(
"MythArchiveDvdauthorCmd"
);
239
gc->
setLabel
(QObject::tr(
"dvdauthor command"
));
240
gc->
setValue
(
"dvdauthor"
);
241
gc->
setHelpText
(QObject::tr(
"Command to run dvdauthor."
));
242
return
gc;
243
};
244
245
static
HostLineEdit
*
MythArchiveMkisofsCmd
()
246
{
247
HostLineEdit
*gc =
new
HostLineEdit
(
"MythArchiveMkisofsCmd"
);
248
gc->
setLabel
(QObject::tr(
"mkisofs command"
));
249
gc->
setValue
(
"mkisofs"
);
250
gc->
setHelpText
(QObject::tr(
"Command to run mkisofs. (Used to create ISO images)"
));
251
return
gc;
252
};
253
254
static
HostLineEdit
*
MythArchiveGrowisofsCmd
()
255
{
256
HostLineEdit
*gc =
new
HostLineEdit
(
"MythArchiveGrowisofsCmd"
);
257
gc->
setLabel
(QObject::tr(
"growisofs command"
));
258
gc->
setValue
(
"growisofs"
);
259
gc->
setHelpText
(QObject::tr(
"Command to run growisofs. (Used to burn DVD's)"
));
260
return
gc;
261
};
262
263
static
HostLineEdit
*
MythArchiveM2VRequantiserCmd
()
264
{
265
HostLineEdit
*gc =
new
HostLineEdit
(
"MythArchiveM2VRequantiserCmd"
);
266
gc->
setLabel
(QObject::tr(
"M2VRequantiser command"
));
267
gc->
setValue
(
"M2VRequantiser"
);
268
gc->
setHelpText
(QObject::tr(
"Command to run M2VRequantiser. Optional - leave blank if you don't have M2VRequantiser installed."
));
269
return
gc;
270
};
271
272
static
HostLineEdit
*
MythArchiveJpeg2yuvCmd
()
273
{
274
HostLineEdit
*gc =
new
HostLineEdit
(
"MythArchiveJpeg2yuvCmd"
);
275
gc->
setLabel
(QObject::tr(
"jpeg2yuv command"
));
276
gc->
setValue
(
"jpeg2yuv"
);
277
gc->
setHelpText
(QObject::tr(
"Command to run jpeg2yuv. Part of mjpegtools package"
));
278
return
gc;
279
};
280
281
static
HostLineEdit
*
MythArchiveSpumuxCmd
()
282
{
283
HostLineEdit
*gc =
new
HostLineEdit
(
"MythArchiveSpumuxCmd"
);
284
gc->
setLabel
(QObject::tr(
"spumux command"
));
285
gc->
setValue
(
"spumux"
);
286
gc->
setHelpText
(QObject::tr(
"Command to run spumux. Part of dvdauthor package"
));
287
return
gc;
288
};
289
290
static
HostLineEdit
*
MythArchiveMpeg2encCmd
()
291
{
292
HostLineEdit
*gc =
new
HostLineEdit
(
"MythArchiveMpeg2encCmd"
);
293
gc->
setLabel
(QObject::tr(
"mpeg2enc command"
));
294
gc->
setValue
(
"mpeg2enc"
);
295
gc->
setHelpText
(QObject::tr(
"Command to run mpeg2enc. Part of mjpegtools package"
));
296
return
gc;
297
};
298
299
static
HostLineEdit
*
MythArchiveProjectXCmd
()
300
{
301
HostLineEdit
*gc =
new
HostLineEdit
(
"MythArchiveProjectXCmd"
);
302
gc->
setLabel
(QObject::tr(
"projectx command"
));
303
gc->
setValue
(
"projectx"
);
304
gc->
setHelpText
(QObject::tr(
"Command to run ProjectX. Will be used to cut "
305
"commercials and split mpegs files instead of mythtranscode and mythreplex."
));
306
return
gc;
307
};
308
309
ArchiveSettings::ArchiveSettings
()
310
{
311
VerticalConfigurationGroup
* vcg1 =
new
VerticalConfigurationGroup
(
false
);
312
vcg1->
setLabel
(QObject::tr(
"MythArchive Settings"
));
313
vcg1->
addChild
(
MythArchiveTempDir
());
314
vcg1->
addChild
(
MythArchiveShareDir
());
315
vcg1->
addChild
(
PALNTSC
());
316
vcg1->
addChild
(
MythArchiveFileFilter
());
317
vcg1->
addChild
(
MythArchiveDVDLocation
());
318
vcg1->
addChild
(
MythArchiveDriveSpeed
());
319
vcg1->
addChild
(
MythArchiveDVDPlayerCmd
());
320
addChild
(vcg1);
321
322
VerticalConfigurationGroup
* vcg2 =
new
VerticalConfigurationGroup
(
false
);
323
vcg2->
setLabel
(QObject::tr(
"MythArchive Settings (2)"
));
324
vcg2->
addChild
(
MythArchiveCopyRemoteFiles
());
325
vcg2->
addChild
(
MythArchiveAlwaysUseMythTranscode
());
326
vcg2->
addChild
(
MythArchiveUseProjectX
());
327
vcg2->
addChild
(
MythArchiveAddSubtitles
());
328
vcg2->
addChild
(
MythArchiveUseFIFO
());
329
vcg2->
addChild
(
MythArchiveDefaultEncProfile
());
330
addChild
(vcg2);
331
332
VerticalConfigurationGroup
* vcg3 =
new
VerticalConfigurationGroup
(
false
);
333
vcg3->
setLabel
(QObject::tr(
"DVD Menu Settings"
));
334
vcg3->
addChild
(
MainMenuAspectRatio
());
335
vcg3->
addChild
(
ChapterMenuAspectRatio
());
336
vcg3->
addChild
(
MythArchiveDateFormat
());
337
vcg3->
addChild
(
MythArchiveTimeFormat
());
338
addChild
(vcg3);
339
340
VerticalConfigurationGroup
* vcg4 =
new
VerticalConfigurationGroup
(
false
);
341
vcg4->
setLabel
(QObject::tr(
"MythArchive External Commands (1)"
));
342
vcg4->
addChild
(
MythArchiveMplexCmd
());
343
vcg4->
addChild
(
MythArchiveDvdauthorCmd
());
344
vcg4->
addChild
(
MythArchiveSpumuxCmd
());
345
vcg4->
addChild
(
MythArchiveMpeg2encCmd
());
346
addChild
(vcg4);
347
348
VerticalConfigurationGroup
* vcg5 =
new
VerticalConfigurationGroup
(
false
);
349
vcg5->
setLabel
(QObject::tr(
"MythArchive External Commands (2)"
));
350
vcg5->
addChild
(
MythArchiveMkisofsCmd
());
351
vcg5->
addChild
(
MythArchiveGrowisofsCmd
());
352
vcg5->
addChild
(
MythArchiveM2VRequantiserCmd
());
353
vcg5->
addChild
(
MythArchiveJpeg2yuvCmd
());
354
vcg5->
addChild
(
MythArchiveProjectXCmd
());
355
addChild
(vcg5);
356
}
Generated on Wed Jun 19 2013 19:02:25 for MythTV by
1.8.1.2