00001
00002
00003
00004
00005 #include <unistd.h>
00006
00007
00008 #include <mythtv/mythcontext.h>
00009
00010
00011 #include "archivesettings.h"
00012
00013
00014 static HostLineEdit *MythArchiveTempDir()
00015 {
00016 HostLineEdit *gc = new HostLineEdit("MythArchiveTempDir");
00017 gc->setLabel(QObject::tr("Myth Archive Temp Directory"));
00018 gc->setValue("");
00019 gc->setHelpText(QObject::tr("Location where MythArchive should create its "
00020 "temporory work files. LOTS of free space required here."));
00021 return gc;
00022 };
00023
00024 static HostLineEdit *MythArchiveShareDir()
00025 {
00026 HostLineEdit *gc = new HostLineEdit("MythArchiveShareDir");
00027 gc->setLabel(QObject::tr("Myth Archive Share Directory"));
00028 gc->setValue(gContext->GetShareDir() + "mytharchive/");
00029 gc->setHelpText(QObject::tr("Location where MythArchive stores its scripts, "
00030 "intro movies and theme files"));
00031 return gc;
00032 };
00033
00034 static HostComboBox *PALNTSC()
00035 {
00036 HostComboBox *gc = new HostComboBox("MythArchiveVideoFormat");
00037 gc->setLabel(QObject::tr("Video format"));
00038 gc->addSelection("PAL");
00039 gc->addSelection("NTSC");
00040 gc->setHelpText(QObject::tr("Video format for DVD recordings, PAL or NTSC."));
00041 return gc;
00042 };
00043
00044 static HostLineEdit *MythArchiveFileFilter()
00045 {
00046 HostLineEdit *gc = new HostLineEdit("MythArchiveFileFilter");
00047 gc->setLabel(QObject::tr("File Selector Filter"));
00048 gc->setValue("*.mpg *.mov *.avi *.mpeg *.nuv");
00049 gc->setHelpText(QObject::tr("The file name filter to use in the file selector."));
00050 return gc;
00051 };
00052
00053 static HostLineEdit *MythArchiveDVDLocation()
00054 {
00055 HostLineEdit *gc = new HostLineEdit("MythArchiveDVDLocation");
00056 gc->setLabel(QObject::tr("Location of DVD"));
00057 gc->setValue("/dev/dvd");
00058 gc->setHelpText(QObject::tr("Which DVD drive to use when burning discs."));
00059 return gc;
00060 };
00061
00062 static HostSpinBox *MythArchiveDriveSpeed()
00063 {
00064 HostSpinBox *gc = new HostSpinBox("MythArchiveDriveSpeed", 0, 48, 1);
00065 gc->setLabel(QObject::tr("DVD Drive Write Speed"));
00066 gc->setValue(0);
00067 gc->setHelpText(QObject::tr("This is the write speed to use when burning a DVD. "
00068 "Set to 0 to allow growisofs to choose the fastest available speed."));
00069 return gc;
00070 };
00071
00072 static HostLineEdit *MythArchiveDVDPlayerCmd()
00073 {
00074 HostLineEdit *gc = new HostLineEdit("MythArchiveDVDPlayerCmd");
00075 gc->setLabel(QObject::tr("Command to play DVD"));
00076 gc->setValue("Internal");
00077 gc->setHelpText(QObject::tr("Command to run when test playing a created DVD. "
00078 "'Internal' will use the internal MythTV player. %f will be replaced with "
00079 "the path to the created DVD structure eg. 'xine -pfhq --no-splash dvd:/%f'."));
00080 return gc;
00081 };
00082
00083 static HostCheckBox *MythArchiveEncodeToAc3()
00084 {
00085 HostCheckBox *gc = new HostCheckBox("MythArchiveEncodeToAc3");
00086 gc->setLabel(QObject::tr("Always Encode to AC3"));
00087 gc->setValue(false);
00088 gc->setHelpText(QObject::tr("If set audio tracks will always be "
00089 "re-encoded to AC3 for better compatibility with DVD players in "
00090 "NTSC countries."));
00091 return gc;
00092 };
00093
00094 static HostCheckBox *MythArchiveCopyRemoteFiles()
00095 {
00096 HostCheckBox *gc = new HostCheckBox("MythArchiveCopyRemoteFiles");
00097 gc->setLabel(QObject::tr("Copy remote files"));
00098 gc->setValue(false);
00099 gc->setHelpText(QObject::tr("If set files on remote filesystems "
00100 "will be copied over to the local filesystem before processing. "
00101 "Speeds processing and reduces bandwidth on the network"));
00102 return gc;
00103 };
00104
00105 static HostCheckBox *MythArchiveAlwaysUseMythTranscode()
00106 {
00107 HostCheckBox *gc = new HostCheckBox("MythArchiveAlwaysUseMythTranscode");
00108 gc->setLabel(QObject::tr("Always Use Mythtranscode"));
00109 gc->setValue(true);
00110 gc->setHelpText(QObject::tr("If set mpeg2 files will always be passed"
00111 " though mythtranscode to clean up any errors. May help to fix"
00112 " some audio problems. Ignored if 'Use ProjectX' is set."));
00113 return gc;
00114 };
00115
00116 static HostCheckBox *MythArchiveUseProjectX()
00117 {
00118 HostCheckBox *gc = new HostCheckBox("MythArchiveUseProjectX");
00119 gc->setLabel(QObject::tr("Use ProjectX"));
00120 gc->setValue(false);
00121 gc->setHelpText(QObject::tr("If set ProjectX will be used to cut"
00122 " commercials and split mpeg2 files instead of mythtranscode"
00123 " and mythreplex."));
00124 return gc;
00125 };
00126
00127 static HostCheckBox *MythArchiveUseFIFO()
00128 {
00129 HostCheckBox *gc = new HostCheckBox("MythArchiveUseFIFO");
00130 gc->setLabel(QObject::tr("Use FIFOs"));
00131 gc->setValue(true);
00132 gc->setHelpText(QObject::tr("The script will use FIFOs to pass the output"
00133 " of mplex into dvdauthor rather than creating intermediate files."
00134 " Saves time and disk space during multiplex operations but not "
00135 " supported on Windows platform"));
00136 return gc;
00137 };
00138
00139 static HostCheckBox *MythArchiveAddSubtitles()
00140 {
00141 HostCheckBox *gc = new HostCheckBox("MythArchiveAddSubtitles");
00142 gc->setLabel(QObject::tr("Add Subtitles"));
00143 gc->setValue(false);
00144 gc->setHelpText(QObject::tr("If available this option will add subtitles "
00145 "to the final DVD. Requires 'Use ProjectX' to be on."));
00146 return gc;
00147 };
00148
00149 static HostComboBox *MainMenuAspectRatio()
00150 {
00151 HostComboBox *gc = new HostComboBox("MythArchiveMainMenuAR");
00152 gc->setLabel(QObject::tr("Main Menu Aspect Ratio"));
00153 gc->addSelection("4:3");
00154 gc->addSelection("16:9");
00155 gc->setValue(1);
00156 gc->setHelpText(QObject::tr("Aspect ratio to use when creating the main menu."));
00157 return gc;
00158 };
00159
00160 static HostComboBox *ChapterMenuAspectRatio()
00161 {
00162 HostComboBox *gc = new HostComboBox("MythArchiveChapterMenuAR");
00163 gc->setLabel(QObject::tr("Chapter Menu Aspect Ratio"));
00164 gc->addSelection("4:3");
00165 gc->addSelection("16:9");
00166 gc->addSelection("Video");
00167 gc->setValue(2);
00168 gc->setHelpText(QObject::tr("Aspect ratio to use when creating the chapter menu. "
00169 "Video means use the same aspect ratio as the associated video."));
00170 return gc;
00171 };
00172
00173 static HostComboBox *MythArchiveDateFormat()
00174 {
00175 HostComboBox *gc = new HostComboBox("MythArchiveDateFormat");
00176 gc->setLabel(QObject::tr("Date format"));
00177
00178 QDate sampdate = QDate::currentDate();
00179 QString sampleStr =
00180 QObject::tr("Samples are shown using today's date.");
00181
00182 if (sampdate.month() == sampdate.day())
00183 {
00184 sampdate = sampdate.addDays(1);
00185 sampleStr =
00186 QObject::tr("Samples are shown using tomorrow's date.");
00187 }
00188
00189 gc->addSelection(sampdate.toString("ddd MMM d"), "%a %b %d");
00190 gc->addSelection(sampdate.toString("ddd MMMM d"), "%a %B %d");
00191 gc->addSelection(sampdate.toString("MMM d"), "%b %d");
00192 gc->addSelection(sampdate.toString("MM/dd"), "%m/%d");
00193 gc->addSelection(sampdate.toString("MM.dd"), "%m.%d");
00194 gc->addSelection(sampdate.toString("ddd d MMM"), "%a %d %b");
00195 gc->addSelection(sampdate.toString("M/d/yyyy"), "%m/%d/%Y");
00196 gc->addSelection(sampdate.toString("dd.MM.yyyy"), "%d.%m.%Y");
00197 gc->addSelection(sampdate.toString("yyyy-MM-dd"), "%Y-%m-%d");
00198 gc->addSelection(sampdate.toString("ddd MMM d yyyy"), "%a %b %d %Y");
00199 gc->addSelection(sampdate.toString("ddd yyyy-MM-dd"), "%a %Y-%m-%d");
00200 gc->addSelection(sampdate.toString("ddd dd MMM yyyy"), "%a %d %b %Y");
00201 gc->setHelpText(QObject::tr("Your preferred date format to use on DVD menus.") + " " +
00202 sampleStr);
00203 return gc;
00204 }
00205
00206 static HostComboBox *MythArchiveTimeFormat()
00207 {
00208 HostComboBox *gc = new HostComboBox("MythArchiveTimeFormat");
00209 gc->setLabel(QObject::tr("Time format"));
00210
00211 QTime samptime = QTime::currentTime();
00212
00213 gc->addSelection(samptime.toString("hh:mm AP"), "%I:%M %p");
00214 gc->addSelection(samptime.toString("hh:mm"), "%H:%M");
00215 gc->setHelpText(QObject::tr("Your preferred time format to display on DVD menus. "
00216 "You must choose a format with \"AM\" or \"PM\" in it, otherwise your "
00217 "time display will be 24-hour or \"military\" time."));
00218 return gc;
00219 }
00220
00221 static HostComboBox *MythArchiveDefaultEncProfile()
00222 {
00223 HostComboBox *gc = new HostComboBox("MythArchiveDefaultEncProfile");
00224 gc->setLabel(QObject::tr("Default Encoder Profile"));
00225
00226 gc->addSelection("HQ", "HQ");
00227 gc->addSelection("SP", "SP");
00228 gc->addSelection("LP", "LP");
00229 gc->addSelection("EP", "EP");
00230 gc->setValue(1);
00231 gc->setHelpText(QObject::tr("Default encoding profile to use if a file "
00232 "needs re-encoding."));
00233 return gc;
00234 }
00235
00236 static HostLineEdit *MythArchiveFfmpegCmd()
00237 {
00238 HostLineEdit *gc = new HostLineEdit("MythArchiveFfmpegCmd");
00239 gc->setLabel(QObject::tr("ffmpeg Command"));
00240 gc->setValue("ffmpeg");
00241 gc->setHelpText(QObject::tr("Command to run ffmpeg."));
00242 return gc;
00243 };
00244
00245 static HostLineEdit *MythArchiveMplexCmd()
00246 {
00247 HostLineEdit *gc = new HostLineEdit("MythArchiveMplexCmd");
00248 gc->setLabel(QObject::tr("mplex Command"));
00249 gc->setValue("mplex");
00250 gc->setHelpText(QObject::tr("Command to run mplex"));
00251 return gc;
00252 };
00253
00254 static HostLineEdit *MythArchiveDvdauthorCmd()
00255 {
00256 HostLineEdit *gc = new HostLineEdit("MythArchiveDvdauthorCmd");
00257 gc->setLabel(QObject::tr("dvdauthor command"));
00258 gc->setValue("dvdauthor");
00259 gc->setHelpText(QObject::tr("Command to run dvdauthor."));
00260 return gc;
00261 };
00262
00263 static HostLineEdit *MythArchiveMkisofsCmd()
00264 {
00265 HostLineEdit *gc = new HostLineEdit("MythArchiveMkisofsCmd");
00266 gc->setLabel(QObject::tr("mkisofs command"));
00267 gc->setValue("mkisofs");
00268 gc->setHelpText(QObject::tr("Command to run mkisofs. (Used to create ISO images)"));
00269 return gc;
00270 };
00271
00272 static HostLineEdit *MythArchiveGrowisofsCmd()
00273 {
00274 HostLineEdit *gc = new HostLineEdit("MythArchiveGrowisofsCmd");
00275 gc->setLabel(QObject::tr("growisofs command"));
00276 gc->setValue("growisofs");
00277 gc->setHelpText(QObject::tr("Command to run growisofs. (Used to burn DVD's)"));
00278 return gc;
00279 };
00280
00281 static HostLineEdit *MythArchiveTcrequantCmd()
00282 {
00283 HostLineEdit *gc = new HostLineEdit("MythArchiveTcrequantCmd");
00284 gc->setLabel(QObject::tr("tcrequant command"));
00285 gc->setValue("tcrequant");
00286 gc->setHelpText(QObject::tr("Command to run tcrequant (Part of transcode package). Optional - leave blank if you don't have the transcode package installed."));
00287 return gc;
00288 };
00289
00290 static HostLineEdit *MythArchiveJpeg2yuvCmd()
00291 {
00292 HostLineEdit *gc = new HostLineEdit("MythArchiveJpeg2yuvCmd");
00293 gc->setLabel(QObject::tr("jpeg2yuv command"));
00294 gc->setValue("jpeg2yuv");
00295 gc->setHelpText(QObject::tr("Command to run jpeg2yuv. Part of mjpegtools package"));
00296 return gc;
00297 };
00298
00299 static HostLineEdit *MythArchiveSpumuxCmd()
00300 {
00301 HostLineEdit *gc = new HostLineEdit("MythArchiveSpumuxCmd");
00302 gc->setLabel(QObject::tr("spumux command"));
00303 gc->setValue("spumux");
00304 gc->setHelpText(QObject::tr("Command to run spumux. Part of dvdauthor package"));
00305 return gc;
00306 };
00307
00308 static HostLineEdit *MythArchiveMpeg2encCmd()
00309 {
00310 HostLineEdit *gc = new HostLineEdit("MythArchiveMpeg2encCmd");
00311 gc->setLabel(QObject::tr("mpeg2enc command"));
00312 gc->setValue("mpeg2enc");
00313 gc->setHelpText(QObject::tr("Command to run mpeg2enc. Part of mjpegtools package"));
00314 return gc;
00315 };
00316
00317 static HostLineEdit *MythArchiveProjectXCmd()
00318 {
00319 HostLineEdit *gc = new HostLineEdit("MythArchiveProjectXCmd");
00320 gc->setLabel(QObject::tr("projectx command"));
00321 gc->setValue("projectx");
00322 gc->setHelpText(QObject::tr("Command to run ProjectX. Will be used to cut "
00323 "commercials and split mpegs files instead of mythtranscode and mythreplex."));
00324 return gc;
00325 };
00326
00327 ArchiveSettings::ArchiveSettings()
00328 {
00329 VerticalConfigurationGroup* vcg1 = new VerticalConfigurationGroup(false);
00330 vcg1->setLabel(QObject::tr("MythArchive Settings"));
00331 vcg1->addChild(MythArchiveTempDir());
00332 vcg1->addChild(MythArchiveShareDir());
00333 vcg1->addChild(PALNTSC());
00334 vcg1->addChild(MythArchiveFileFilter());
00335 vcg1->addChild(MythArchiveDVDLocation());
00336 vcg1->addChild(MythArchiveDriveSpeed());
00337 vcg1->addChild(MythArchiveDVDPlayerCmd());
00338 addChild(vcg1);
00339
00340 VerticalConfigurationGroup* vcg2 = new VerticalConfigurationGroup(false);
00341 vcg2->setLabel(QObject::tr("MythArchive Settings (2)"));
00342 vcg2->addChild(MythArchiveEncodeToAc3());
00343 vcg2->addChild(MythArchiveCopyRemoteFiles());
00344 vcg2->addChild(MythArchiveAlwaysUseMythTranscode());
00345 vcg2->addChild(MythArchiveUseProjectX());
00346 vcg2->addChild(MythArchiveAddSubtitles());
00347 vcg2->addChild(MythArchiveUseFIFO());
00348 vcg2->addChild(MythArchiveDefaultEncProfile());
00349 addChild(vcg2);
00350
00351 VerticalConfigurationGroup* vcg3 = new VerticalConfigurationGroup(false);
00352 vcg3->setLabel(QObject::tr("DVD Menu Settings"));
00353 vcg3->addChild(MainMenuAspectRatio());
00354 vcg3->addChild(ChapterMenuAspectRatio());
00355 vcg3->addChild(MythArchiveDateFormat());
00356 vcg3->addChild(MythArchiveTimeFormat());
00357 addChild(vcg3);
00358
00359 VerticalConfigurationGroup* vcg4 = new VerticalConfigurationGroup(false);
00360 vcg4->setLabel(QObject::tr("MythArchive External Commands (1)"));
00361 vcg4->addChild(MythArchiveFfmpegCmd());
00362 vcg4->addChild(MythArchiveMplexCmd());
00363 vcg4->addChild(MythArchiveDvdauthorCmd());
00364 vcg4->addChild(MythArchiveSpumuxCmd());
00365 vcg4->addChild(MythArchiveMpeg2encCmd());
00366 addChild(vcg4);
00367
00368 VerticalConfigurationGroup* vcg5 = new VerticalConfigurationGroup(false);
00369 vcg5->setLabel(QObject::tr("MythArchive External Commands (2)"));
00370 vcg5->addChild(MythArchiveMkisofsCmd());
00371 vcg5->addChild(MythArchiveGrowisofsCmd());
00372 vcg5->addChild(MythArchiveTcrequantCmd());
00373 vcg5->addChild(MythArchiveJpeg2yuvCmd());
00374 vcg5->addChild(MythArchiveProjectXCmd());
00375 addChild(vcg5);
00376 }