00001 #include <cstdio>
00002
00003 #include "backendsettings.h"
00004 #include "frequencies.h"
00005 #include "mythcorecontext.h"
00006 #include "settings.h"
00007 #include "channelsettings.h"
00008 #include "serverpool.h"
00009 #include <unistd.h>
00010
00011
00012 static HostLineEdit *LocalServerIP()
00013 {
00014 HostLineEdit *gc = new HostLineEdit("BackendServerIP");
00015 gc->setLabel(QObject::tr("IP address"));
00016 gc->setValue("127.0.0.1");
00017 gc->setHelpText(QObject::tr("Enter the IP address of this machine. "
00018 "Use an externally accessible address (ie, not "
00019 "127.0.0.1) if you are going to be running a frontend "
00020 "on a different machine than this one. Note, in IPv6 "
00021 "setups, this is still required for certain extras "
00022 "such as UPnP."));
00023 return gc;
00024 };
00025
00026 static HostLineEdit *LocalServerIP6()
00027 {
00028 HostLineEdit *gc = new HostLineEdit("BackendServerIP6");
00029 gc->setLabel(QObject::tr("IPv6 address"));
00030 gc->setValue("::1");
00031 gc->setHelpText(QObject::tr("Enter the IPv6 address of this machine. "
00032 "Use an externally accessible address (ie, not "
00033 "::1) if you are going to be running a frontend "
00034 "on a different machine than this one."));
00035 #if defined(QT_NO_IPV6)
00036 gc->setEnabled(false);
00037 #else
00038 if (ServerPool::DefaultListenIPv6().isEmpty())
00039 gc->setEnabled(false);
00040 #endif
00041 return gc;
00042 }
00043
00044 static HostLineEdit *LocalServerPort()
00045 {
00046 HostLineEdit *gc = new HostLineEdit("BackendServerPort");
00047 gc->setLabel(QObject::tr("Port"));
00048 gc->setValue("6543");
00049 gc->setHelpText(QObject::tr("Unless you've got good reason, don't "
00050 "change this."));
00051 return gc;
00052 };
00053
00054 static HostLineEdit *LocalStatusPort()
00055 {
00056 HostLineEdit *gc = new HostLineEdit("BackendStatusPort");
00057 gc->setLabel(QObject::tr("Status port"));
00058 gc->setValue("6544");
00059 gc->setHelpText(QObject::tr("Port on which the server will listen for "
00060 "HTTP requests, including backend status and MythXML "
00061 "requests."));
00062 return gc;
00063 };
00064
00065 static GlobalLineEdit *MasterServerIP()
00066 {
00067 GlobalLineEdit *gc = new GlobalLineEdit("MasterServerIP");
00068 gc->setLabel(QObject::tr("IP address"));
00069 gc->setValue("127.0.0.1");
00070 gc->setHelpText(QObject::tr("The IP address of the master backend "
00071 "server. All frontend and non-master backend machines "
00072 "will connect to this server. If you only have one "
00073 "backend, this should be the same IP address as "
00074 "above."));
00075 return gc;
00076 };
00077
00078 static GlobalLineEdit *MasterServerPort()
00079 {
00080 GlobalLineEdit *gc = new GlobalLineEdit("MasterServerPort");
00081 gc->setLabel(QObject::tr("Port"));
00082 gc->setValue("6543");
00083 gc->setHelpText(QObject::tr("Unless you've got good reason, "
00084 "don't change this."));
00085 return gc;
00086 };
00087
00088 static HostLineEdit *LocalSecurityPin()
00089 {
00090 HostLineEdit *gc = new HostLineEdit("SecurityPin");
00091 gc->setLabel(QObject::tr("Security PIN (required)"));
00092 gc->setValue("");
00093 gc->setHelpText(QObject::tr("PIN code required for a frontend to connect "
00094 "to the backend. Blank prevents all "
00095 "connections; 0000 allows any client to "
00096 "connect."));
00097 return gc;
00098 };
00099
00100 static GlobalComboBox *TVFormat()
00101 {
00102 GlobalComboBox *gc = new GlobalComboBox("TVFormat");
00103 gc->setLabel(QObject::tr("TV format"));
00104
00105 QStringList list = ChannelTVFormat::GetFormats();
00106 for (int i = 0; i < list.size(); i++)
00107 gc->addSelection(list[i]);
00108
00109 gc->setHelpText(QObject::tr("The TV standard to use for viewing TV."));
00110 return gc;
00111 };
00112
00113 static GlobalComboBox *VbiFormat()
00114 {
00115 GlobalComboBox *gc = new GlobalComboBox("VbiFormat");
00116 gc->setLabel(QObject::tr("VBI format"));
00117 gc->addSelection("None");
00118 gc->addSelection("PAL teletext");
00119 gc->addSelection("NTSC closed caption");
00120 gc->setHelpText(QObject::tr("The VBI (Vertical Blanking Interval) is "
00121 "used to carry Teletext or Closed Captioning "
00122 "data."));
00123 return gc;
00124 };
00125
00126 static GlobalComboBox *FreqTable()
00127 {
00128 GlobalComboBox *gc = new GlobalComboBox("FreqTable");
00129 gc->setLabel(QObject::tr("Channel frequency table"));
00130
00131 for (uint i = 0; chanlists[i].name; i++)
00132 gc->addSelection(chanlists[i].name);
00133
00134 gc->setHelpText(QObject::tr("Select the appropriate frequency table for "
00135 "your system. If you have an antenna, use a \"-bcast\" "
00136 "frequency."));
00137 return gc;
00138 };
00139
00140 static GlobalCheckBox *SaveTranscoding()
00141 {
00142 GlobalCheckBox *gc = new GlobalCheckBox("SaveTranscoding");
00143 gc->setLabel(QObject::tr("Save original files after transcoding (globally)"));
00144 gc->setValue(false);
00145 gc->setHelpText(QObject::tr("If enabled and the transcoder is active, the "
00146 "original files will be renamed to .old once the "
00147 "transcoding is complete."));
00148 return gc;
00149 };
00150
00151 static HostCheckBox *TruncateDeletes()
00152 {
00153 HostCheckBox *hc = new HostCheckBox("TruncateDeletesSlowly");
00154 hc->setLabel(QObject::tr("Delete files slowly"));
00155 hc->setValue(false);
00156 hc->setHelpText(QObject::tr("Some filesystems use a lot of resources when "
00157 "deleting large files. If enabled, this option makes "
00158 "MythTV delete files slowly on this backend to lessen the "
00159 "impact."));
00160 return hc;
00161 };
00162
00163 static GlobalCheckBox *DeletesFollowLinks()
00164 {
00165 GlobalCheckBox *gc = new GlobalCheckBox("DeletesFollowLinks");
00166 gc->setLabel(QObject::tr("Follow symbolic links when deleting files"));
00167 gc->setValue(false);
00168 gc->setHelpText(QObject::tr("If enabled, MythTV will follow symlinks "
00169 "when recordings and related files are deleted, instead "
00170 "of deleting the symlink and leaving the actual file."));
00171 return gc;
00172 };
00173
00174 static GlobalSpinBox *HDRingbufferSize()
00175 {
00176 GlobalSpinBox *bs = new GlobalSpinBox(
00177 "HDRingbufferSize", 25*188, 512*188, 25*188);
00178 bs->setLabel(QObject::tr("HD ringbuffer size (kB)"));
00179 bs->setHelpText(QObject::tr("The HD device ringbuffer allows the "
00180 "backend to weather moments of stress. "
00181 "The larger the ringbuffer (in kilobytes), the longer "
00182 "the moments of stress can be. However, "
00183 "setting the size too large can cause "
00184 "swapping, which is detrimental."));
00185 bs->setValue(50*188);
00186 return bs;
00187 }
00188
00189 static GlobalComboBox *StorageScheduler()
00190 {
00191 GlobalComboBox *gc = new GlobalComboBox("StorageScheduler");
00192 gc->setLabel(QObject::tr("Storage Group disk scheduler"));
00193 gc->addSelection(QObject::tr("Balanced free space"), "BalancedFreeSpace");
00194 gc->addSelection(QObject::tr("Balanced percent free space"), "BalancedPercFreeSpace");
00195 gc->addSelection(QObject::tr("Balanced disk I/O"), "BalancedDiskIO");
00196 gc->addSelection(QObject::tr("Combination"), "Combination");
00197 gc->setValue("BalancedFreeSpace");
00198 gc->setHelpText(QObject::tr("This setting controls how the Storage Group "
00199 "scheduling code will balance new recordings across "
00200 "directories. 'Balanced Free Space' is the recommended "
00201 "method for most users." ));
00202 return gc;
00203 };
00204
00205 static GlobalCheckBox *DisableAutomaticBackup()
00206 {
00207 GlobalCheckBox *gc = new GlobalCheckBox("DisableAutomaticBackup");
00208 gc->setLabel(QObject::tr("Disable automatic database backup"));
00209 gc->setValue(false);
00210 gc->setHelpText(QObject::tr("If enabled, MythTV will not backup the "
00211 "database before upgrades. You should "
00212 "therefore have your own database backup "
00213 "strategy in place."));
00214 return gc;
00215 };
00216
00217 static HostCheckBox *DisableFirewireReset()
00218 {
00219 HostCheckBox *hc = new HostCheckBox("DisableFirewireReset");
00220 hc->setLabel(QObject::tr("Disable FireWire reset"));
00221 hc->setHelpText(
00222 QObject::tr(
00223 "By default, MythTV resets the FireWire bus when a "
00224 "FireWire recorder stops responding to commands. If "
00225 "this causes problems, you can disable this behavior "
00226 "here."));
00227 hc->setValue(false);
00228 return hc;
00229 }
00230
00231 static HostLineEdit *MiscStatusScript()
00232 {
00233 HostLineEdit *he = new HostLineEdit("MiscStatusScript");
00234 he->setLabel(QObject::tr("Miscellaneous status application"));
00235 he->setValue("");
00236 he->setHelpText(QObject::tr("External application or script that outputs "
00237 "extra information for inclusion in the "
00238 "backend status page. See http://www.mythtv."
00239 "org/wiki/Miscellaneous_Status_Information"));
00240 return he;
00241 }
00242
00243 static void init_time_offsets(GlobalComboBox *gc)
00244 {
00245 gc->addSelection("None");
00246 gc->addSelection("Auto");
00247 gc->addSelection("+0030");
00248 gc->addSelection("+0100");
00249 gc->addSelection("+0130");
00250 gc->addSelection("+0200");
00251 gc->addSelection("+0230");
00252 gc->addSelection("+0300");
00253 gc->addSelection("+0330");
00254 gc->addSelection("+0400");
00255 gc->addSelection("+0430");
00256 gc->addSelection("+0500");
00257 gc->addSelection("+0530");
00258 gc->addSelection("+0600");
00259 gc->addSelection("+0630");
00260 gc->addSelection("+0700");
00261 gc->addSelection("+0730");
00262 gc->addSelection("+0800");
00263 gc->addSelection("+0830");
00264 gc->addSelection("+0900");
00265 gc->addSelection("+0930");
00266 gc->addSelection("+1000");
00267 gc->addSelection("+1030");
00268 gc->addSelection("+1100");
00269 gc->addSelection("+1130");
00270 gc->addSelection("+1200");
00271 gc->addSelection("-1100");
00272 gc->addSelection("-1030");
00273 gc->addSelection("-1000");
00274 gc->addSelection("-0930");
00275 gc->addSelection("-0900");
00276 gc->addSelection("-0830");
00277 gc->addSelection("-0800");
00278 gc->addSelection("-0730");
00279 gc->addSelection("-0700");
00280 gc->addSelection("-0630");
00281 gc->addSelection("-0600");
00282 gc->addSelection("-0530");
00283 gc->addSelection("-0500");
00284 gc->addSelection("-0430");
00285 gc->addSelection("-0400");
00286 gc->addSelection("-0330");
00287 gc->addSelection("-0300");
00288 gc->addSelection("-0230");
00289 gc->addSelection("-0200");
00290 gc->addSelection("-0130");
00291 gc->addSelection("-0100");
00292 gc->addSelection("-0030");
00293 }
00294
00295 static GlobalComboBox *TimeOffset()
00296 {
00297 GlobalComboBox *gc = new GlobalComboBox("TimeOffset");
00298 gc->setLabel(QObject::tr("Your local time zone (for XMLTV)"));
00299 init_time_offsets(gc);
00300 QString helptext = QObject::tr(
00301 "Used if the XMLTV data comes from a different time zone than your "
00302 "own and modifies the date and time before insertion into the "
00303 "database. 'Auto' converts the XMLTV time to local time using your "
00304 "computer's time zone. "
00305 "'None' ignores the XMLTV time zone, interpreting times as local.");
00306 gc->setHelpText(helptext);
00307 return gc;
00308 };
00309
00310 #if 0
00311 static GlobalComboBox *EITTimeOffset()
00312 {
00313 GlobalComboBox *gc = new GlobalComboBox("EITTimeOffset");
00314 gc->setLabel(QObject::tr("Time offset for EIT listings"));
00315 init_time_offsets(gc);
00316 gc->setValue(1);
00317 QString helptext = QObject::tr(
00318 "Adjust the relative time zone of the EIT EPG data. "
00319 "'Auto' converts the EIT time to local time using your "
00320 "computer's time zone. "
00321 "'None' ignores the EIT time zone, interpreting times as local.");
00322 gc->setHelpText(helptext);
00323 return gc;
00324 };
00325 #endif
00326
00327 static GlobalSpinBox *EITTransportTimeout()
00328 {
00329 GlobalSpinBox *gc = new GlobalSpinBox("EITTransportTimeout", 1, 15, 1);
00330 gc->setLabel(QObject::tr("EIT transport timeout (mins)"));
00331 gc->setValue(5);
00332 QString helpText = QObject::tr(
00333 "Maximum time to spend waiting (in minutes) for listings data "
00334 "on one digital TV channel before checking for new listings data "
00335 "on the next channel.");
00336 gc->setHelpText(helpText);
00337 return gc;
00338 }
00339
00340 static GlobalCheckBox *MasterBackendOverride()
00341 {
00342 GlobalCheckBox *gc = new GlobalCheckBox("MasterBackendOverride");
00343 gc->setLabel(QObject::tr("Master backend override"));
00344 gc->setValue(true);
00345 gc->setHelpText(QObject::tr("If enabled, the master backend will stream and"
00346 " delete files if it finds them in a storage directory. "
00347 "Useful if you are using a central storage location, like "
00348 "a NFS share, and your slave backend isn't running."));
00349 return gc;
00350 };
00351
00352 static GlobalSpinBox *EITCrawIdleStart()
00353 {
00354 GlobalSpinBox *gc = new GlobalSpinBox("EITCrawIdleStart", 30, 7200, 30);
00355 gc->setLabel(QObject::tr("Backend idle before EIT crawl (secs)"));
00356 gc->setValue(60);
00357 QString help = QObject::tr(
00358 "The minimum number of seconds after a recorder becomes idle "
00359 "to wait before MythTV begins collecting EIT listings data.");
00360 gc->setHelpText(help);
00361 return gc;
00362 }
00363
00364 static GlobalSpinBox *WOLbackendReconnectWaitTime()
00365 {
00366 GlobalSpinBox *gc = new GlobalSpinBox("WOLbackendReconnectWaitTime", 0, 1200, 5);
00367 gc->setLabel(QObject::tr("Delay between wake attempts (secs)"));
00368 gc->setValue(0);
00369 gc->setHelpText(QObject::tr("Length of time the frontend waits between "
00370 "tries to wake up the master backend. This should be the "
00371 "time your master backend needs to startup. Set to 0 to "
00372 "disable."));
00373 return gc;
00374 };
00375
00376 static GlobalSpinBox *WOLbackendConnectRetry()
00377 {
00378 GlobalSpinBox *gc = new GlobalSpinBox("WOLbackendConnectRetry", 1, 60, 1);
00379 gc->setLabel(QObject::tr("Wake attempts"));
00380 gc->setHelpText(QObject::tr("Number of times the frontend will try to wake "
00381 "up the master backend."));
00382 gc->setValue(5);
00383 return gc;
00384 };
00385
00386 static GlobalLineEdit *WOLbackendCommand()
00387 {
00388 GlobalLineEdit *gc = new GlobalLineEdit("WOLbackendCommand");
00389 gc->setLabel(QObject::tr("Wake command"));
00390 gc->setValue("");
00391 gc->setHelpText(QObject::tr("The command used to wake up your master "
00392 "backend server (e.g. sudo /etc/init.d/mythtv-backend restart)."));
00393 return gc;
00394 };
00395
00396 static HostLineEdit *SleepCommand()
00397 {
00398 HostLineEdit *gc = new HostLineEdit("SleepCommand");
00399 gc->setLabel(QObject::tr("Sleep command"));
00400 gc->setValue("");
00401 gc->setHelpText(QObject::tr("The command used to put this slave to sleep. "
00402 "If set, the master backend will use this command to put "
00403 "this slave to sleep when it is not needed for recording."));
00404 return gc;
00405 };
00406
00407 static HostLineEdit *WakeUpCommand()
00408 {
00409 HostLineEdit *gc = new HostLineEdit("WakeUpCommand");
00410 gc->setLabel(QObject::tr("Wake command"));
00411 gc->setValue("");
00412 gc->setHelpText(QObject::tr("The command used to wake up this slave "
00413 "from sleep. This setting is not used on the master "
00414 "backend."));
00415 return gc;
00416 };
00417
00418 static GlobalLineEdit *BackendStopCommand()
00419 {
00420 GlobalLineEdit *gc = new GlobalLineEdit("BackendStopCommand");
00421 gc->setLabel(QObject::tr("Backend stop command"));
00422 gc->setValue("killall mythbackend");
00423 gc->setHelpText(QObject::tr("The command used to stop the backend"
00424 " when running on the master backend server "
00425 "(e.g. sudo /etc/init.d/mythtv-backend stop)"));
00426 return gc;
00427 };
00428
00429 static GlobalLineEdit *BackendStartCommand()
00430 {
00431 GlobalLineEdit *gc = new GlobalLineEdit("BackendStartCommand");
00432 gc->setLabel(QObject::tr("Backend start command"));
00433 gc->setValue("mythbackend");
00434 gc->setHelpText(QObject::tr("The command used to start the backend"
00435 " when running on the master backend server "
00436 "(e.g. sudo /etc/init.d/mythtv-backend start)."));
00437 return gc;
00438 };
00439
00440 static GlobalSpinBox *idleTimeoutSecs()
00441 {
00442 GlobalSpinBox *gc = new GlobalSpinBox("idleTimeoutSecs", 0, 1200, 5);
00443 gc->setLabel(QObject::tr("Idle shutdown timeout (secs)"));
00444 gc->setValue(0);
00445 gc->setHelpText(QObject::tr("The number of seconds the master backend "
00446 "idles before it shuts down all other backends. Set to 0 to "
00447 "disable automatic shutdown."));
00448 return gc;
00449 };
00450
00451 static GlobalSpinBox *idleWaitForRecordingTime()
00452 {
00453 GlobalSpinBox *gc = new GlobalSpinBox("idleWaitForRecordingTime", 0, 300, 1);
00454 gc->setLabel(QObject::tr("Maximum wait for recording (mins)"));
00455 gc->setValue(15);
00456 gc->setHelpText(QObject::tr("The number of minutes the master backend "
00457 "waits for a recording. If the backend is idle but a "
00458 "recording starts within this time period, it won't "
00459 "shut down."));
00460 return gc;
00461 };
00462
00463 static GlobalSpinBox *StartupSecsBeforeRecording()
00464 {
00465 GlobalSpinBox *gc = new GlobalSpinBox("StartupSecsBeforeRecording", 0, 1200, 5);
00466 gc->setLabel(QObject::tr("Startup before recording (secs)"));
00467 gc->setValue(120);
00468 gc->setHelpText(QObject::tr("The number of seconds the master backend "
00469 "will be woken up before a recording starts."));
00470 return gc;
00471 };
00472
00473 static GlobalLineEdit *WakeupTimeFormat()
00474 {
00475 GlobalLineEdit *gc = new GlobalLineEdit("WakeupTimeFormat");
00476 gc->setLabel(QObject::tr("Wakeup time format"));
00477 gc->setValue("hh:mm yyyy-MM-dd");
00478 gc->setHelpText(QObject::tr("The format of the time string passed to the "
00479 "'Command to set wakeup time' as $time. See "
00480 "QT::QDateTime.toString() for details. Set to 'time_t' for "
00481 "seconds since epoch."));
00482 return gc;
00483 };
00484
00485 static GlobalLineEdit *SetWakeuptimeCommand()
00486 {
00487 GlobalLineEdit *gc = new GlobalLineEdit("SetWakeuptimeCommand");
00488 gc->setLabel(QObject::tr("Command to set wakeup time"));
00489 gc->setValue("");
00490 gc->setHelpText(QObject::tr("The command used to set the wakeup time "
00491 "(passed as $time) for the Master Backend"));
00492 return gc;
00493 };
00494
00495 static GlobalLineEdit *ServerHaltCommand()
00496 {
00497 GlobalLineEdit *gc = new GlobalLineEdit("ServerHaltCommand");
00498 gc->setLabel(QObject::tr("Server halt command"));
00499 gc->setValue("sudo /sbin/halt -p");
00500 gc->setHelpText(QObject::tr("The command used to halt the backends."));
00501 return gc;
00502 };
00503
00504 static GlobalLineEdit *preSDWUCheckCommand()
00505 {
00506 GlobalLineEdit *gc = new GlobalLineEdit("preSDWUCheckCommand");
00507 gc->setLabel(QObject::tr("Pre-shutdown-check command"));
00508 gc->setValue("");
00509 gc->setHelpText(QObject::tr("A command executed before the backend would "
00510 "shutdown. The return value determines if "
00511 "the backend can shutdown. 0 - yes, "
00512 "1 - restart idling, "
00513 "2 - reset the backend to wait for a frontend."));
00514 return gc;
00515 };
00516
00517 static GlobalCheckBox *blockSDWUwithoutClient()
00518 {
00519 GlobalCheckBox *gc = new GlobalCheckBox("blockSDWUwithoutClient");
00520 gc->setLabel(QObject::tr("Block shutdown before client connected"));
00521 gc->setValue(true);
00522 gc->setHelpText(QObject::tr("If enabled, the automatic shutdown routine will "
00523 "be disabled until a client connects."));
00524 return gc;
00525 };
00526
00527 static GlobalLineEdit *startupCommand()
00528 {
00529 GlobalLineEdit *gc = new GlobalLineEdit("startupCommand");
00530 gc->setLabel(QObject::tr("Startup command"));
00531 gc->setValue("");
00532 gc->setHelpText(QObject::tr("This command is executed right after starting "
00533 "the BE. As a parameter '$status' is replaced by either "
00534 "'auto' if the machine was started automatically or "
00535 "'user' if a user switched it on."));
00536 return gc;
00537 };
00538
00539 static HostSpinBox *JobQueueMaxSimultaneousJobs()
00540 {
00541 HostSpinBox *gc = new HostSpinBox("JobQueueMaxSimultaneousJobs", 1, 10, 1);
00542 gc->setLabel(QObject::tr("Maximum simultaneous jobs on this backend"));
00543 gc->setHelpText(QObject::tr("The Job Queue will be limited to running "
00544 "this many simultaneous jobs on this backend."));
00545 gc->setValue(1);
00546 return gc;
00547 };
00548
00549 static HostSpinBox *JobQueueCheckFrequency()
00550 {
00551 HostSpinBox *gc = new HostSpinBox("JobQueueCheckFrequency", 5, 300, 5);
00552 gc->setLabel(QObject::tr("Job Queue check frequency (secs)"));
00553 gc->setHelpText(QObject::tr("When looking for new jobs to process, the "
00554 "Job Queue will wait this many seconds between checks."));
00555 gc->setValue(60);
00556 return gc;
00557 };
00558
00559 static HostComboBox *JobQueueCPU()
00560 {
00561 HostComboBox *gc = new HostComboBox("JobQueueCPU");
00562 gc->setLabel(QObject::tr("CPU usage"));
00563 gc->addSelection(QObject::tr("Low"), "0");
00564 gc->addSelection(QObject::tr("Medium"), "1");
00565 gc->addSelection(QObject::tr("High"), "2");
00566 gc->setHelpText(QObject::tr("This setting controls approximately how "
00567 "much CPU jobs in the queue may consume. "
00568 "On 'High', all available CPU time may be used, "
00569 "which could cause problems on slower systems." ));
00570 return gc;
00571 };
00572
00573 static HostTimeBox *JobQueueWindowStart()
00574 {
00575 HostTimeBox *gc = new HostTimeBox("JobQueueWindowStart", "00:00");
00576 gc->setLabel(QObject::tr("Job Queue start time"));
00577 gc->setHelpText(QObject::tr("This setting controls the start of the "
00578 "Job Queue time window, which determines when new jobs "
00579 "will be started."));
00580 return gc;
00581 };
00582
00583 static HostTimeBox *JobQueueWindowEnd()
00584 {
00585 HostTimeBox *gc = new HostTimeBox("JobQueueWindowEnd", "23:59");
00586 gc->setLabel(QObject::tr("Job Queue end time"));
00587 gc->setHelpText(QObject::tr("This setting controls the end of the "
00588 "Job Queue time window, which determines when new jobs "
00589 "will be started."));
00590 return gc;
00591 };
00592
00593 static GlobalCheckBox *JobsRunOnRecordHost()
00594 {
00595 GlobalCheckBox *gc = new GlobalCheckBox("JobsRunOnRecordHost");
00596 gc->setLabel(QObject::tr("Run jobs only on original recording backend"));
00597 gc->setValue(false);
00598 gc->setHelpText(QObject::tr("If enabled, jobs in the queue will be required "
00599 "to run on the backend that made the "
00600 "original recording."));
00601 return gc;
00602 };
00603
00604 static GlobalCheckBox *AutoTranscodeBeforeAutoCommflag()
00605 {
00606 GlobalCheckBox *gc = new GlobalCheckBox("AutoTranscodeBeforeAutoCommflag");
00607 gc->setLabel(QObject::tr("Run transcode jobs before auto commercial "
00608 "detection"));
00609 gc->setValue(false);
00610 gc->setHelpText(QObject::tr("If enabled, and if both auto-transcode and "
00611 "commercial detection are turned ON for a "
00612 "recording, transcoding will run first; "
00613 "otherwise, commercial detection runs first."));
00614 return gc;
00615 };
00616
00617 static GlobalCheckBox *AutoCommflagWhileRecording()
00618 {
00619 GlobalCheckBox *gc = new GlobalCheckBox("AutoCommflagWhileRecording");
00620 gc->setLabel(QObject::tr("Start auto-commercial-detection jobs when the "
00621 "recording starts"));
00622 gc->setValue(false);
00623 gc->setHelpText(QObject::tr("If enabled, and Auto Commercial Detection is "
00624 "ON for a recording, the flagging job will be "
00625 "started as soon as the recording starts. NOT "
00626 "recommended on underpowered systems."));
00627 return gc;
00628 };
00629
00630 static GlobalLineEdit *UserJob(uint job_num)
00631 {
00632 GlobalLineEdit *gc = new GlobalLineEdit(QString("UserJob%1").arg(job_num));
00633 gc->setLabel(QObject::tr("User Job #%1 command").arg(job_num));
00634 gc->setValue("");
00635 gc->setHelpText(QObject::tr("The command to run whenever this User Job "
00636 "number is scheduled."));
00637 return gc;
00638 };
00639
00640 static GlobalLineEdit *UserJobDesc(uint job_num)
00641 {
00642 GlobalLineEdit *gc = new GlobalLineEdit(QString("UserJobDesc%1")
00643 .arg(job_num));
00644 gc->setLabel(QObject::tr("User Job #%1 description").arg(job_num));
00645 gc->setValue(QObject::tr("User Job #%1").arg(job_num));
00646 gc->setHelpText(QObject::tr("The description for this User Job."));
00647 return gc;
00648 };
00649
00650 static HostCheckBox *JobAllowMetadata()
00651 {
00652 HostCheckBox *gc = new HostCheckBox("JobAllowMetadata");
00653 gc->setLabel(QObject::tr("Allow metadata lookup jobs"));
00654 gc->setValue(true);
00655 gc->setHelpText(QObject::tr("If enabled, allow jobs of this type to "
00656 "run on this backend."));
00657 return gc;
00658 };
00659
00660 static HostCheckBox *JobAllowCommFlag()
00661 {
00662 HostCheckBox *gc = new HostCheckBox("JobAllowCommFlag");
00663 gc->setLabel(QObject::tr("Allow commercial-detection jobs"));
00664 gc->setValue(true);
00665 gc->setHelpText(QObject::tr("If enabled, allow jobs of this type to "
00666 "run on this backend."));
00667 return gc;
00668 };
00669
00670 static HostCheckBox *JobAllowTranscode()
00671 {
00672 HostCheckBox *gc = new HostCheckBox("JobAllowTranscode");
00673 gc->setLabel(QObject::tr("Allow transcoding jobs"));
00674 gc->setValue(true);
00675 gc->setHelpText(QObject::tr("If enabled, allow jobs of this type to "
00676 "run on this backend."));
00677 return gc;
00678 };
00679
00680 static GlobalLineEdit *JobQueueTranscodeCommand()
00681 {
00682 GlobalLineEdit *gc = new GlobalLineEdit("JobQueueTranscodeCommand");
00683 gc->setLabel(QObject::tr("Transcoder command"));
00684 gc->setValue("mythtranscode");
00685 gc->setHelpText(QObject::tr("The program used to transcode recordings. "
00686 "The default is 'mythtranscode' if this setting is empty."));
00687 return gc;
00688 };
00689
00690 static GlobalLineEdit *JobQueueCommFlagCommand()
00691 {
00692 GlobalLineEdit *gc = new GlobalLineEdit("JobQueueCommFlagCommand");
00693 gc->setLabel(QObject::tr("Commercial-detection command"));
00694 gc->setValue("mythcommflag");
00695 gc->setHelpText(QObject::tr("The program used to detect commercials in a "
00696 "recording. The default is 'mythcommflag' "
00697 "if this setting is empty."));
00698 return gc;
00699 };
00700
00701 static HostCheckBox *JobAllowUserJob(uint job_num)
00702 {
00703 QString dbStr = QString("JobAllowUserJob%1").arg(job_num);
00704 QString desc = gCoreContext->GetSetting(QString("UserJobDesc%1").arg(job_num));
00705 QString label = QObject::tr("Allow %1 jobs").arg(desc);
00706
00707 HostCheckBox *bc = new HostCheckBox(dbStr);
00708 bc->setLabel(label);
00709 bc->setValue(false);
00710
00711
00712
00713
00714
00715
00716
00717 bc->setHelpText(QObject::tr("If enabled, allow jobs of this type to "
00718 "run on this backend."));
00719 return bc;
00720 }
00721
00722 #if 0
00723 static GlobalCheckBox *UPNPShowRecordingUnderVideos()
00724 {
00725 GlobalCheckBox *gc = new GlobalCheckBox("UPnP/RecordingsUnderVideos");
00726 gc->setLabel(QObject::tr("Include recordings in video list"));
00727 gc->setValue(false);
00728 gc->setHelpText(QObject::tr("If enabled, the master backend will include"
00729 " the list of recorded shows in the list of videos. "
00730 " This is mainly to accommodate UPnP players which do not"
00731 " allow more than 1 video section." ));
00732 return gc;
00733 };
00734 #endif
00735
00736 static GlobalComboBox *UPNPWmpSource()
00737 {
00738 GlobalComboBox *gc = new GlobalComboBox("UPnP/WMPSource");
00739 gc->setLabel(QObject::tr("Video content to show a WMP client"));
00740 gc->addSelection(QObject::tr("Recordings"),"0");
00741 gc->addSelection(QObject::tr("Videos"),"1");
00742 gc->setValue("0");
00743 gc->setHelpText(QObject::tr("Which tree to show a Windows Media Player "
00744 "client when it requests a list of videos."));
00745 return gc;
00746 };
00747
00748 static GlobalCheckBox *MythFillEnabled()
00749 {
00750 GlobalCheckBox *bc = new GlobalCheckBox("MythFillEnabled");
00751 bc->setLabel(QObject::tr("Automatically update program listings"));
00752 bc->setValue(true);
00753 bc->setHelpText(QObject::tr("If enabled, the guide data program "
00754 "will be run automatically."));
00755 return bc;
00756 }
00757
00758 static GlobalSpinBox *MythFillMinHour()
00759 {
00760 GlobalSpinBox *bs = new GlobalSpinBox("MythFillMinHour", 0, 23, 1);
00761 bs->setLabel(QObject::tr("Guide data program execution start"));
00762 bs->setValue(0);
00763 bs->setHelpText(QObject::tr("This setting and the following one define a "
00764 "time period when the guide data program is allowed "
00765 "to run. For example, setting start to 11 and "
00766 "end to 13 would mean that the program would only "
00767 "run between 11:00 AM and 1:59 PM."));
00768 return bs;
00769 }
00770
00771 static GlobalSpinBox *MythFillMaxHour()
00772 {
00773 GlobalSpinBox *bs = new GlobalSpinBox("MythFillMaxHour", 0, 23, 1);
00774 bs->setLabel(QObject::tr("Guide data program execution end"));
00775 bs->setValue(23);
00776 bs->setHelpText(QObject::tr("This setting and the preceding one define a "
00777 "time period when the guide data program is allowed "
00778 "to run. For example, setting start to 11 and "
00779 "end to 13 would mean that the program would only "
00780 "run between 11:00 AM and 1:59 PM."));
00781 return bs;
00782 }
00783
00784 static GlobalCheckBox *MythFillGrabberSuggestsTime()
00785 {
00786 GlobalCheckBox *bc = new GlobalCheckBox("MythFillGrabberSuggestsTime");
00787 bc->setLabel(QObject::tr("Run guide data program at time suggested by the "
00788 "grabber."));
00789 bc->setValue(true);
00790 bc->setHelpText(QObject::tr("If enabled, allow a DataDirect guide data "
00791 "provider to specify the next download time in order "
00792 "to distribute load on their servers. Guide data program "
00793 "execution start/end times are also ignored."));
00794 return bc;
00795 }
00796
00797 static GlobalLineEdit *MythFillDatabasePath()
00798 {
00799 GlobalLineEdit *be = new GlobalLineEdit("MythFillDatabasePath");
00800 be->setLabel(QObject::tr("Guide data program"));
00801 be->setValue("mythfilldatabase");
00802 be->setHelpText(QObject::tr(
00803 "Use 'mythfilldatabase' or the name of a custom "
00804 "script that will populate the program guide info "
00805 "for all your video sources."));
00806 return be;
00807 }
00808
00809 static GlobalLineEdit *MythFillDatabaseArgs()
00810 {
00811 GlobalLineEdit *be = new GlobalLineEdit("MythFillDatabaseArgs");
00812 be->setLabel(QObject::tr("Guide data arguments"));
00813 be->setValue("");
00814 be->setHelpText(QObject::tr("Any arguments you want passed to the "
00815 "guide data program."));
00816 return be;
00817 }
00818
00819 class MythFillSettings : public TriggeredConfigurationGroup
00820 {
00821 public:
00822 MythFillSettings() :
00823 TriggeredConfigurationGroup(false, true, false, false)
00824 {
00825 setLabel(QObject::tr("Program Schedule Downloading Options"));
00826 setUseLabel(false);
00827
00828 Setting* fillEnabled = MythFillEnabled();
00829 addChild(fillEnabled);
00830 setTrigger(fillEnabled);
00831
00832 ConfigurationGroup* settings = new VerticalConfigurationGroup(false);
00833 settings->addChild(MythFillDatabasePath());
00834 settings->addChild(MythFillDatabaseArgs());
00835 settings->addChild(MythFillMinHour());
00836 settings->addChild(MythFillMaxHour());
00837 settings->addChild(MythFillGrabberSuggestsTime());
00838 addTarget("1", settings);
00839
00840
00841 addTarget("0", new VerticalConfigurationGroup(true));
00842 };
00843 };
00844
00845 BackendSettings::BackendSettings() {
00846 VerticalConfigurationGroup* server = new VerticalConfigurationGroup(false);
00847 server->setLabel(QObject::tr("Host Address Backend Setup"));
00848 VerticalConfigurationGroup* localServer = new VerticalConfigurationGroup();
00849 localServer->setLabel(QObject::tr("Local Backend") + " (" +
00850 gCoreContext->GetHostName() + ")");
00851 HorizontalConfigurationGroup* localIP =
00852 new HorizontalConfigurationGroup(false, false, true, true);
00853 localIP->addChild(LocalServerIP());
00854 localServer->addChild(localIP);
00855 HorizontalConfigurationGroup* localIP6 =
00856 new HorizontalConfigurationGroup(false, false, true, true);
00857 localIP6->addChild(LocalServerIP6());
00858 localServer->addChild(localIP6);
00859 HorizontalConfigurationGroup* localPorts =
00860 new HorizontalConfigurationGroup(false, false, true, true);
00861 localPorts->addChild(LocalServerPort());
00862 localPorts->addChild(LocalStatusPort());
00863 localServer->addChild(localPorts);
00864 HorizontalConfigurationGroup* localPin =
00865 new HorizontalConfigurationGroup(false, false, true, true);
00866 localPin->addChild(LocalSecurityPin());
00867 localServer->addChild(localPin);
00868 VerticalConfigurationGroup* masterServer = new VerticalConfigurationGroup();
00869 masterServer->setLabel(QObject::tr("Master Backend"));
00870 HorizontalConfigurationGroup* master =
00871 new HorizontalConfigurationGroup(false, false, true, true);
00872 master->addChild(MasterServerIP());
00873 master->addChild(MasterServerPort());
00874 masterServer->addChild(master);
00875 server->addChild(localServer);
00876 server->addChild(masterServer);
00877 addChild(server);
00878
00879 VerticalConfigurationGroup* locale = new VerticalConfigurationGroup(false);
00880 locale->setLabel(QObject::tr("Locale Settings"));
00881 locale->addChild(TVFormat());
00882 locale->addChild(VbiFormat());
00883 locale->addChild(FreqTable());
00884 locale->addChild(TimeOffset());
00885 addChild(locale);
00886
00887 VerticalConfigurationGroup* group2 = new VerticalConfigurationGroup(false);
00888 group2->setLabel(QObject::tr("Miscellaneous Settings"));
00889
00890 VerticalConfigurationGroup* fm = new VerticalConfigurationGroup();
00891 fm->setLabel(QObject::tr("File Management Settings"));
00892 fm->addChild(MasterBackendOverride());
00893 HorizontalConfigurationGroup *fmh1 =
00894 new HorizontalConfigurationGroup(false, false, true, true);
00895 fmh1->addChild(DeletesFollowLinks());
00896 fmh1->addChild(TruncateDeletes());
00897 fm->addChild(fmh1);
00898 fm->addChild(HDRingbufferSize());
00899 fm->addChild(StorageScheduler());
00900 group2->addChild(fm);
00901 VerticalConfigurationGroup* upnp = new VerticalConfigurationGroup();
00902 upnp->setLabel(QObject::tr("UPnP Server Settings"));
00903
00904 upnp->addChild(UPNPWmpSource());
00905 group2->addChild(upnp);
00906 group2->addChild(MiscStatusScript());
00907 group2->addChild(DisableAutomaticBackup());
00908 group2->addChild(DisableFirewireReset());
00909 addChild(group2);
00910
00911 VerticalConfigurationGroup* group2a1 = new VerticalConfigurationGroup(false);
00912 group2a1->setLabel(QObject::tr("EIT Scanner Options"));
00913
00914 group2a1->addChild(EITTransportTimeout());
00915 group2a1->addChild(EITCrawIdleStart());
00916 addChild(group2a1);
00917
00918 VerticalConfigurationGroup* group3 = new VerticalConfigurationGroup(false);
00919 group3->setLabel(QObject::tr("Shutdown/Wakeup Options"));
00920 group3->addChild(startupCommand());
00921 group3->addChild(blockSDWUwithoutClient());
00922 group3->addChild(idleTimeoutSecs());
00923 group3->addChild(idleWaitForRecordingTime());
00924 group3->addChild(StartupSecsBeforeRecording());
00925 group3->addChild(WakeupTimeFormat());
00926 group3->addChild(SetWakeuptimeCommand());
00927 group3->addChild(ServerHaltCommand());
00928 group3->addChild(preSDWUCheckCommand());
00929 addChild(group3);
00930
00931 VerticalConfigurationGroup* group4 = new VerticalConfigurationGroup(false);
00932 group4->setLabel(QObject::tr("Backend Wakeup settings"));
00933
00934 VerticalConfigurationGroup* backend = new VerticalConfigurationGroup();
00935 backend->setLabel(QObject::tr("Master Backend"));
00936 backend->addChild(WOLbackendReconnectWaitTime());
00937 backend->addChild(WOLbackendConnectRetry());
00938 backend->addChild(WOLbackendCommand());
00939 group4->addChild(backend);
00940
00941 VerticalConfigurationGroup* slaveBackend = new VerticalConfigurationGroup();
00942 slaveBackend->setLabel(QObject::tr("Slave Backends"));
00943 slaveBackend->addChild(SleepCommand());
00944 slaveBackend->addChild(WakeUpCommand());
00945 group4->addChild(slaveBackend);
00946 addChild(group4);
00947
00948 VerticalConfigurationGroup* backendControl = new VerticalConfigurationGroup();
00949 backendControl->setLabel(QObject::tr("Backend Control"));
00950 backendControl->addChild(BackendStopCommand());
00951 backendControl->addChild(BackendStartCommand());
00952 addChild(backendControl);
00953
00954 VerticalConfigurationGroup* group5 = new VerticalConfigurationGroup(false);
00955 group5->setLabel(QObject::tr("Job Queue (Backend-Specific)"));
00956 group5->addChild(JobQueueMaxSimultaneousJobs());
00957 group5->addChild(JobQueueCheckFrequency());
00958
00959 HorizontalConfigurationGroup* group5a =
00960 new HorizontalConfigurationGroup(false, false);
00961 VerticalConfigurationGroup* group5a1 =
00962 new VerticalConfigurationGroup(false, false);
00963 group5a1->addChild(JobQueueWindowStart());
00964 group5a1->addChild(JobQueueWindowEnd());
00965 group5a1->addChild(JobQueueCPU());
00966 group5a1->addChild(JobAllowMetadata());
00967 group5a1->addChild(JobAllowCommFlag());
00968 group5a1->addChild(JobAllowTranscode());
00969 group5a->addChild(group5a1);
00970
00971 VerticalConfigurationGroup* group5a2 =
00972 new VerticalConfigurationGroup(false, false);
00973 group5a2->addChild(JobAllowUserJob(1));
00974 group5a2->addChild(JobAllowUserJob(2));
00975 group5a2->addChild(JobAllowUserJob(3));
00976 group5a2->addChild(JobAllowUserJob(4));
00977 group5a->addChild(group5a2);
00978 group5->addChild(group5a);
00979 addChild(group5);
00980
00981 VerticalConfigurationGroup* group6 = new VerticalConfigurationGroup(false);
00982 group6->setLabel(QObject::tr("Job Queue (Global)"));
00983 group6->addChild(JobsRunOnRecordHost());
00984 group6->addChild(AutoCommflagWhileRecording());
00985 group6->addChild(JobQueueCommFlagCommand());
00986 group6->addChild(JobQueueTranscodeCommand());
00987 group6->addChild(AutoTranscodeBeforeAutoCommflag());
00988 group6->addChild(SaveTranscoding());
00989 addChild(group6);
00990
00991 VerticalConfigurationGroup* group7 = new VerticalConfigurationGroup(false);
00992 group7->setLabel(QObject::tr("Job Queue (Job Commands)"));
00993 group7->addChild(UserJobDesc(1));
00994 group7->addChild(UserJob(1));
00995 group7->addChild(UserJobDesc(2));
00996 group7->addChild(UserJob(2));
00997 group7->addChild(UserJobDesc(3));
00998 group7->addChild(UserJob(3));
00999 group7->addChild(UserJobDesc(4));
01000 group7->addChild(UserJob(4));
01001 addChild(group7);
01002
01003 MythFillSettings *mythfill = new MythFillSettings();
01004 addChild(mythfill);
01005
01006 }