MythTV master
archivesettings.cpp
Go to the documentation of this file.
1/*
2 archivesettings.cpp
3*/
4
5#include <unistd.h>
6
7// myth
10
11// mytharchive
12#include "archivesettings.h"
13
14
16{
17 auto *gc = new HostFileBrowserSetting("MythArchiveTempDir");
18
19 gc->setLabel(ArchiveSettings::tr("MythArchive Temp Directory"));
20 gc->setValue("");
21
22 gc->setHelpText(ArchiveSettings::tr("Location where MythArchive should "
23 "create its temporary work files. "
24 "LOTS of free space required here."));
25 gc->SetTypeFilter(QDir::AllDirs | QDir::Hidden);
26
27 return gc;
28};
29
31{
32 auto *gc = new HostFileBrowserSetting("MythArchiveShareDir");
33
34 gc->setLabel(ArchiveSettings::tr("MythArchive Share Directory"));
35 gc->setValue(GetShareDir() + "mytharchive/");
36
37 gc->setHelpText(ArchiveSettings::tr("Location where MythArchive stores its "
38 "scripts, intro movies and theme "
39 "files"));
40 gc->SetTypeFilter(QDir::AllDirs | QDir::Hidden);
41
42 return gc;
43};
44
46{
47 auto *gc = new HostComboBoxSetting("MythArchiveVideoFormat");
48
49 gc->setLabel(ArchiveSettings::tr("Video format"));
50
51 gc->addSelection("PAL");
52 gc->addSelection("NTSC");
53
54 gc->setHelpText(ArchiveSettings::tr("Video format for DVD recordings, PAL "
55 "or NTSC."));
56 return gc;
57};
58
60{
61 auto *gc = new HostTextEditSetting("MythArchiveFileFilter");
62
63 gc->setLabel(ArchiveSettings::tr("File Selector Filter"));
64 gc->setValue("*.mpg *.mov *.avi *.mpeg *.nuv");
65
66 gc->setHelpText(ArchiveSettings::tr("The file name filter to use in the "
67 "file selector."));
68 return gc;
69};
70
72{
73 auto *gc = new HostFileBrowserSetting("MythArchiveDVDLocation");
74
75 gc->setLabel(ArchiveSettings::tr("Location of DVD"));
76 gc->setValue("/dev/dvd");
77
78 gc->setHelpText(ArchiveSettings::tr("Which DVD drive to use when burning "
79 "discs."));
80 gc->SetTypeFilter(QDir::AllDirs | QDir::Files | QDir::System | QDir::Hidden);
81 return gc;
82};
83
85{
86 auto *gc = new HostSpinBoxSetting("MythArchiveDriveSpeed", 0, 48, 1);
87
88 gc->setLabel(ArchiveSettings::tr("DVD Drive Write Speed"));
89 gc->setValue(0);
90
91 gc->setHelpText(ArchiveSettings::tr("This is the write speed to use when "
92 "burning a DVD. Set to 0 to allow "
93 "growisofs to choose the fastest "
94 "available speed."));
95 return gc;
96};
97
99{
100 auto *gc = new HostTextEditSetting("MythArchiveDVDPlayerCmd");
101
102 gc->setLabel(ArchiveSettings::tr("Command to play DVD"));
103 gc->setValue("Internal");
104
105 gc->setHelpText(ArchiveSettings::tr("Command to run when test playing a "
106 "created DVD. 'Internal' will use the "
107 "internal MythTV player. %f will be "
108 "replaced with the path to the created "
109 "DVD structure eg. 'xine -pfhq "
110 "--no-splash dvd:/%f'."));
111 return gc;
112};
113
115{
116 auto *gc = new HostCheckBoxSetting("MythArchiveCopyRemoteFiles");
117
118 gc->setLabel(ArchiveSettings::tr("Copy remote files"));
119 gc->setValue(false);
120
121 gc->setHelpText(ArchiveSettings::tr("If set files on remote filesystems "
122 "will be copied over to the local "
123 "filesystem before processing. Speeds "
124 "processing and reduces bandwidth on "
125 "the network"));
126 return gc;
127};
128
130{
131 auto *gc = new HostCheckBoxSetting("MythArchiveAlwaysUseMythTranscode");
132
133 gc->setLabel(ArchiveSettings::tr("Always Use Mythtranscode"));
134 gc->setValue(true);
135
136 gc->setHelpText(ArchiveSettings::tr("If set mpeg2 files will always be "
137 "passed though mythtranscode to clean "
138 "up any errors. May help to fix some "
139 "audio problems. Ignored if 'Use "
140 "ProjectX' is set."));
141 return gc;
142};
143
145{
146 auto *gc = new HostCheckBoxSetting("MythArchiveUseProjectX");
147
148 gc->setLabel(ArchiveSettings::tr("Use ProjectX"));
149 gc->setValue(false);
150
151 gc->setHelpText(ArchiveSettings::tr("If set ProjectX will be used to cut "
152 "commercials and split mpeg2 files "
153 "instead of mythtranscode and "
154 "mythreplex."));
155 return gc;
156};
157
159{
160 auto *gc = new HostCheckBoxSetting("MythArchiveUseFIFO");
161
162 gc->setLabel(ArchiveSettings::tr("Use FIFOs"));
163 gc->setValue(true);
164
165 gc->setHelpText(ArchiveSettings::tr("The script will use FIFOs to pass the "
166 "output of mplex into dvdauthor rather "
167 "than creating intermediate files. "
168 "Saves time and disk space during "
169 "multiplex operations but not "
170 "supported on Windows platform"));
171 return gc;
172};
173
175{
176 auto *gc = new HostCheckBoxSetting("MythArchiveAddSubtitles");
177
178 gc->setLabel(ArchiveSettings::tr("Add Subtitles"));
179 gc->setValue(false);
180
181 gc->setHelpText(ArchiveSettings::tr("If available this option will add "
182 "subtitles to the final DVD. Requires "
183 "'Use ProjectX' to be on."));
184 return gc;
185};
186
188{
189 auto *gc = new HostComboBoxSetting("MythArchiveMainMenuAR");
190
191 gc->setLabel(ArchiveSettings::tr("Main Menu Aspect Ratio"));
192
193 gc->addSelection(ArchiveSettings::tr("4:3", "Aspect ratio"), "4:3");
194 gc->addSelection(ArchiveSettings::tr("16:9", "Aspect ratio"), "16:9");
195
196 gc->setValue(1);
197
198 gc->setHelpText(ArchiveSettings::tr("Aspect ratio to use when creating the "
199 "main menu."));
200 return gc;
201};
202
204{
205 auto *gc = new HostComboBoxSetting("MythArchiveChapterMenuAR");
206
207 gc->setLabel(ArchiveSettings::tr("Chapter Menu Aspect Ratio"));
208
209 gc->addSelection(ArchiveSettings::tr("4:3", "Aspect ratio"), "4:3");
210 gc->addSelection(ArchiveSettings::tr("16:9", "Aspect ratio"), "16:9");
211 gc->addSelection(ArchiveSettings::tr("Video"), "Video");
212
213 gc->setValue(2);
214
215 //: %1 is the translation of the "Video" combo box choice
216 gc->setHelpText(ArchiveSettings::tr("Aspect ratio to use when creating the "
217 "chapter menu. '%1' means use the "
218 "same aspect ratio as the associated "
219 "video.")
220 .arg(ArchiveSettings::tr("Video")));
221 return gc;
222};
223
225{
226 auto *gc = new HostComboBoxSetting("MythArchiveDateFormat");
227 gc->setLabel(ArchiveSettings::tr("Date format"));
228
229 QDate sampdate = MythDate::current().toLocalTime().date();
230 QString sampleStr = ArchiveSettings::tr("Samples are shown using today's "
231 "date.");
232
233 if (sampdate.month() == sampdate.day())
234 {
235 sampdate = sampdate.addDays(1);
236 sampleStr = ArchiveSettings::tr("Samples are shown using tomorrow's "
237 "date.");
238 }
239
240 gc->addSelection(sampdate.toString("ddd MMM d"), "%a %b %d");
241 gc->addSelection(sampdate.toString("ddd MMMM d"), "%a %B %d");
242 gc->addSelection(sampdate.toString("MMM d"), "%b %d");
243 gc->addSelection(sampdate.toString("MM/dd"), "%m/%d");
244 gc->addSelection(sampdate.toString("MM.dd"), "%m.%d");
245 gc->addSelection(sampdate.toString("ddd d MMM"), "%a %d %b");
246 gc->addSelection(sampdate.toString("M/d/yyyy"), "%m/%d/%Y");
247 gc->addSelection(sampdate.toString("dd.MM.yyyy"), "%d.%m.%Y");
248 gc->addSelection(sampdate.toString("yyyy-MM-dd"), "%Y-%m-%d");
249 gc->addSelection(sampdate.toString("ddd MMM d yyyy"), "%a %b %d %Y");
250 gc->addSelection(sampdate.toString("ddd yyyy-MM-dd"), "%a %Y-%m-%d");
251 gc->addSelection(sampdate.toString("ddd dd MMM yyyy"), "%a %d %b %Y");
252
253 //: %1 gives additional info on the date used
254 gc->setHelpText(ArchiveSettings::tr("Your preferred date format to use on "
255 "DVD menus. %1")
256 .arg(sampleStr));
257 return gc;
258}
259
261{
262 auto *gc = new HostComboBoxSetting("MythArchiveTimeFormat");
263 gc->setLabel(ArchiveSettings::tr("Time format"));
264
265 QTime samptime = QTime::currentTime();
266
267 gc->addSelection(samptime.toString("hh:mm AP"), "%I:%M %p");
268 gc->addSelection(samptime.toString("hh:mm"), "%H:%M");
269
270 gc->setHelpText(ArchiveSettings::tr("Your preferred time format to display "
271 "on DVD menus. You must choose a "
272 "format with \"AM\" or \"PM\" in it, "
273 "otherwise your time display will be "
274 "24-hour or \"military\" time."));
275 return gc;
276}
277
279{
280 auto *gc = new HostComboBoxSetting("MythArchiveDefaultEncProfile");
281 gc->setLabel(ArchiveSettings::tr("Default Encoder Profile"));
282
283 gc->addSelection(ArchiveSettings::tr("HQ", "Encoder profile"), "HQ");
284 gc->addSelection(ArchiveSettings::tr("SP", "Encoder profile"), "SP");
285 gc->addSelection(ArchiveSettings::tr("LP", "Encoder profile"), "LP");
286 gc->addSelection(ArchiveSettings::tr("EP", "Encoder profile"), "EP");
287
288 gc->setValue(1);
289
290 gc->setHelpText(ArchiveSettings::tr("Default encoding profile to use if a "
291 "file needs re-encoding."));
292 return gc;
293}
294
296{
297 auto *gc = new HostTextEditSetting("MythArchiveMplexCmd");
298
299 gc->setLabel(ArchiveSettings::tr("mplex Command"));
300
301 gc->setValue("mplex");
302
303 gc->setHelpText(ArchiveSettings::tr("Command to run mplex"));
304
305 return gc;
306};
307
309{
310 auto *gc = new HostTextEditSetting("MythArchiveDvdauthorCmd");
311
312 gc->setLabel(ArchiveSettings::tr("dvdauthor command"));
313
314 gc->setValue("dvdauthor");
315
316 gc->setHelpText(ArchiveSettings::tr("Command to run dvdauthor."));
317
318 return gc;
319};
320
322{
323 auto *gc = new HostTextEditSetting("MythArchiveMkisofsCmd");
324
325 gc->setLabel(ArchiveSettings::tr("mkisofs command"));
326
327 gc->setValue("mkisofs");
328
329 gc->setHelpText(ArchiveSettings::tr("Command to run mkisofs. (Used to "
330 "create ISO images)"));
331 return gc;
332};
333
335{
336 auto *gc = new HostTextEditSetting("MythArchiveGrowisofsCmd");
337
338 gc->setLabel(ArchiveSettings::tr("growisofs command"));
339
340 gc->setValue("growisofs");
341
342 gc->setHelpText(ArchiveSettings::tr("Command to run growisofs. (Used to "
343 "burn DVDs)"));
344 return gc;
345};
346
348{
349 auto *gc = new HostTextEditSetting("MythArchiveM2VRequantiserCmd");
350
351 gc->setLabel(ArchiveSettings::tr("M2VRequantiser command"));
352
353 gc->setValue("M2VRequantiser");
354
355 gc->setHelpText(ArchiveSettings::tr("Command to run M2VRequantiser. "
356 "Optional - leave blank if you don't "
357 "have M2VRequantiser installed."));
358 return gc;
359};
360
362{
363 auto *gc = new HostTextEditSetting("MythArchiveJpeg2yuvCmd");
364
365 gc->setLabel(ArchiveSettings::tr("jpeg2yuv command"));
366
367 gc->setValue("jpeg2yuv");
368
369 gc->setHelpText(ArchiveSettings::tr("Command to run jpeg2yuv. Part of "
370 "mjpegtools package"));
371 return gc;
372};
373
375{
376 auto *gc = new HostTextEditSetting("MythArchiveSpumuxCmd");
377
378 gc->setLabel(ArchiveSettings::tr("spumux command"));
379
380 gc->setValue("spumux");
381
382 gc->setHelpText(ArchiveSettings::tr("Command to run spumux. Part of "
383 "dvdauthor package"));
384 return gc;
385};
386
388{
389 auto *gc = new HostTextEditSetting("MythArchiveMpeg2encCmd");
390
391 gc->setLabel(ArchiveSettings::tr("mpeg2enc command"));
392
393 gc->setValue("mpeg2enc");
394
395 gc->setHelpText(ArchiveSettings::tr("Command to run mpeg2enc. Part of "
396 "mjpegtools package"));
397 return gc;
398};
399
401{
402 auto *gc = new HostTextEditSetting("MythArchiveProjectXCmd");
403
404 gc->setLabel(ArchiveSettings::tr("projectx command"));
405
406 gc->setValue("projectx");
407
408 gc->setHelpText(ArchiveSettings::tr("Command to run ProjectX. Will be used "
409 "to cut commercials and split mpegs "
410 "files instead of mythtranscode and "
411 "mythreplex."));
412 return gc;
413};
414
416{
417 setLabel(ArchiveSettings::tr("MythArchive Settings"));
420 addChild(PALNTSC());
431
432 auto* DVDSettings = new GroupSetting();
433 DVDSettings->setLabel(ArchiveSettings::tr("DVD Menu Settings"));
434 DVDSettings->addChild(MainMenuAspectRatio());
435 DVDSettings->addChild(ChapterMenuAspectRatio());
436 DVDSettings->addChild(MythArchiveDateFormat());
437 DVDSettings->addChild(MythArchiveTimeFormat());
438 addChild(DVDSettings);
439
440 auto* externalCmdSettings = new GroupSetting();
441 externalCmdSettings->setLabel(ArchiveSettings::tr("MythArchive External Commands"));
442 externalCmdSettings->addChild(MythArchiveMplexCmd());
443 externalCmdSettings->addChild(MythArchiveDvdauthorCmd());
444 externalCmdSettings->addChild(MythArchiveSpumuxCmd());
445 externalCmdSettings->addChild(MythArchiveMpeg2encCmd());
446 externalCmdSettings->addChild(MythArchiveMkisofsCmd());
447 externalCmdSettings->addChild(MythArchiveGrowisofsCmd());
448 externalCmdSettings->addChild(MythArchiveM2VRequantiserCmd());
449 externalCmdSettings->addChild(MythArchiveJpeg2yuvCmd());
450 externalCmdSettings->addChild(MythArchiveProjectXCmd());
451 addChild(externalCmdSettings);
452}
static HostTextEditSetting * MythArchiveM2VRequantiserCmd()
static HostTextEditSetting * MythArchiveFileFilter()
static HostTextEditSetting * MythArchiveDvdauthorCmd()
static HostCheckBoxSetting * MythArchiveAlwaysUseMythTranscode()
static HostTextEditSetting * MythArchiveSpumuxCmd()
static HostCheckBoxSetting * MythArchiveCopyRemoteFiles()
static HostTextEditSetting * MythArchiveMplexCmd()
static HostFileBrowserSetting * MythArchiveTempDir()
static HostComboBoxSetting * MythArchiveDefaultEncProfile()
static HostCheckBoxSetting * MythArchiveUseFIFO()
static HostTextEditSetting * MythArchiveMkisofsCmd()
static HostComboBoxSetting * ChapterMenuAspectRatio()
static HostTextEditSetting * MythArchiveJpeg2yuvCmd()
static HostComboBoxSetting * MythArchiveTimeFormat()
static HostComboBoxSetting * PALNTSC()
static HostCheckBoxSetting * MythArchiveAddSubtitles()
static HostTextEditSetting * MythArchiveMpeg2encCmd()
static HostComboBoxSetting * MainMenuAspectRatio()
static HostTextEditSetting * MythArchiveDVDPlayerCmd()
static HostFileBrowserSetting * MythArchiveShareDir()
static HostTextEditSetting * MythArchiveGrowisofsCmd()
static HostTextEditSetting * MythArchiveProjectXCmd()
static HostComboBoxSetting * MythArchiveDateFormat()
static HostFileBrowserSetting * MythArchiveDVDLocation()
static HostSpinBoxSetting * MythArchiveDriveSpeed()
static HostCheckBoxSetting * MythArchiveUseProjectX()
GroupSetting()=default
virtual void addChild(StandardSetting *child)
virtual void setLabel(QString str)
QString GetShareDir(void)
Definition: mythdirs.cpp:261
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:15