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