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