MythTV  0.27pre
 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  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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
310 {
312  vcg1->setLabel(QObject::tr("MythArchive Settings"));
313  vcg1->addChild(MythArchiveTempDir());
314  vcg1->addChild(MythArchiveShareDir());
315  vcg1->addChild(PALNTSC());
320  addChild(vcg1);
321 
323  vcg2->setLabel(QObject::tr("MythArchive Settings (2)"));
328  vcg2->addChild(MythArchiveUseFIFO());
330  addChild(vcg2);
331 
333  vcg3->setLabel(QObject::tr("DVD Menu Settings"));
334  vcg3->addChild(MainMenuAspectRatio());
338  addChild(vcg3);
339 
341  vcg4->setLabel(QObject::tr("MythArchive External Commands (1)"));
342  vcg4->addChild(MythArchiveMplexCmd());
346  addChild(vcg4);
347 
349  vcg5->setLabel(QObject::tr("MythArchive External Commands (2)"));
355  addChild(vcg5);
356 }