00001 #include <cstdio>
00002
00003 #include "backendsettings.h"
00004 #include "frequencies.h"
00005 #include "libmyth/mythcontext.h"
00006 #include "libmyth/settings.h"
00007 #include "channelsettings.h"
00008 #include <unistd.h>
00009
00010
00011 static HostLineEdit *LocalServerIP()
00012 {
00013 HostLineEdit *gc = new HostLineEdit("BackendServerIP");
00014 gc->setLabel(QObject::tr("IP address"));
00015 gc->setValue("127.0.0.1");
00016 gc->setHelpText(QObject::tr("Enter the IP address of this machine. "
00017 "Use an externally accessible address (ie, not "
00018 "127.0.0.1) if you are going to be running a frontend "
00019 "on a different machine than this one."));
00020 return gc;
00021 };
00022
00023 static HostLineEdit *LocalServerPort()
00024 {
00025 HostLineEdit *gc = new HostLineEdit("BackendServerPort");
00026 gc->setLabel(QObject::tr("Port"));
00027 gc->setValue("6543");
00028 gc->setHelpText(QObject::tr("Unless you've got good reason to, don't "
00029 "change this."));
00030 return gc;
00031 };
00032
00033 static HostLineEdit *LocalStatusPort()
00034 {
00035 HostLineEdit *gc = new HostLineEdit("BackendStatusPort");
00036 gc->setLabel(QObject::tr("Status Port"));
00037 gc->setValue("6544");
00038 gc->setHelpText(QObject::tr("Port which the server will listen to for "
00039 "HTTP requests. Currently, it shows a little status "
00040 "information."));
00041 return gc;
00042 };
00043
00044 static GlobalLineEdit *MasterServerIP()
00045 {
00046 GlobalLineEdit *gc = new GlobalLineEdit("MasterServerIP");
00047 gc->setLabel(QObject::tr("IP address"));
00048 gc->setValue("127.0.0.1");
00049 gc->setHelpText(QObject::tr("The IP address of the master backend "
00050 "server. All frontend and non-master backend machines "
00051 "will connect to this server. If you only have one "
00052 "backend, this should be the same IP address as "
00053 "above."));
00054 return gc;
00055 };
00056
00057 static GlobalLineEdit *MasterServerPort()
00058 {
00059 GlobalLineEdit *gc = new GlobalLineEdit("MasterServerPort");
00060 gc->setLabel(QObject::tr("Port"));
00061 gc->setValue("6543");
00062 gc->setHelpText(QObject::tr("Unless you've got good reason to, "
00063 "don't change this."));
00064 return gc;
00065 };
00066
00067 static HostLineEdit *LocalSecurityPin()
00068 {
00069 HostLineEdit *gc = new HostLineEdit("SecurityPin");
00070 gc->setLabel(QObject::tr("Security Pin (Required)"));
00071 gc->setValue("");
00072 gc->setHelpText(QObject::tr("Pin code required for a frontend to connect "
00073 "to the backend. Blank prevents all "
00074 "connections, 0000 allows any client to "
00075 "connect."));
00076 return gc;
00077 };
00078
00079 static GlobalComboBox *TVFormat()
00080 {
00081 GlobalComboBox *gc = new GlobalComboBox("TVFormat");
00082 gc->setLabel(QObject::tr("TV format"));
00083
00084 QStringList list = ChannelTVFormat::GetFormats();
00085 for (uint i = 0; i < list.size(); i++)
00086 gc->addSelection(list[i]);
00087
00088 gc->setHelpText(QObject::tr("The TV standard to use for viewing TV."));
00089 return gc;
00090 };
00091
00092 static GlobalComboBox *VbiFormat()
00093 {
00094 GlobalComboBox *gc = new GlobalComboBox("VbiFormat");
00095 gc->setLabel(QObject::tr("VBI format"));
00096 gc->addSelection("None");
00097 gc->addSelection("PAL Teletext");
00098 gc->addSelection("NTSC Closed Caption");
00099 gc->setHelpText(QObject::tr("VBI stands for Vertical Blanking Interrupt. "
00100 "VBI is used to carry Teletext and Closed Captioning "
00101 "data."));
00102 return gc;
00103 };
00104
00105 static GlobalComboBox *FreqTable()
00106 {
00107 GlobalComboBox *gc = new GlobalComboBox("FreqTable");
00108 gc->setLabel(QObject::tr("Channel frequency table"));
00109
00110 for (uint i = 0; chanlists[i].name; i++)
00111 gc->addSelection(chanlists[i].name);
00112
00113 gc->setHelpText(QObject::tr("Select the appropriate frequency table for "
00114 "your system. If you have an antenna, use a \"-bcast\" "
00115 "frequency."));
00116 return gc;
00117 };
00118
00119 static GlobalCheckBox *SaveTranscoding()
00120 {
00121 GlobalCheckBox *gc = new GlobalCheckBox("SaveTranscoding");
00122 gc->setLabel(QObject::tr("Save original files after transcoding (globally)"));
00123 gc->setValue(false);
00124 gc->setHelpText(QObject::tr("When set and the transcoder is active, the "
00125 "original files will be renamed to .old once the "
00126 "transcoding is complete."));
00127 return gc;
00128 };
00129
00130 static HostCheckBox *TruncateDeletes()
00131 {
00132 HostCheckBox *hc = new HostCheckBox("TruncateDeletesSlowly");
00133 hc->setLabel(QObject::tr("Delete files slowly"));
00134 hc->setValue(false);
00135 hc->setHelpText(QObject::tr("Some filesystems use a lot of resources when "
00136 "deleting large recording files. This option makes Myth "
00137 "delete the file slowly on this backend to lessen the "
00138 "impact."));
00139 return hc;
00140 };
00141
00142 static GlobalCheckBox *DeletesFollowLinks()
00143 {
00144 GlobalCheckBox *gc = new GlobalCheckBox("DeletesFollowLinks");
00145 gc->setLabel(QObject::tr("Follow symbolic links when deleting files"));
00146 gc->setValue(false);
00147 gc->setHelpText(QObject::tr("This will cause Myth to follow symlinks "
00148 "when recordings and related files are deleted, instead "
00149 "of deleting the symlink and leaving the actual file."));
00150 return gc;
00151 };
00152
00153 static GlobalSpinBox *HDRingbufferSize()
00154 {
00155 GlobalSpinBox *bs = new GlobalSpinBox(
00156 "HDRingbufferSize", 25*188, 512*188, 25*188);
00157 bs->setLabel(QObject::tr("HD Ringbuffer size (KB)"));
00158 bs->setHelpText(QObject::tr("The HD device ringbuffer allows the "
00159 "backend to weather moments of stress. "
00160 "The larger the ringbuffer, the longer "
00161 "the moments of stress can be. However, "
00162 "setting the size too large can cause "
00163 "swapping, which is detrimental."));
00164 bs->setValue(50*188);
00165 return bs;
00166 }
00167
00168 static HostCheckBox *DisableFirewireReset()
00169 {
00170 HostCheckBox *hc = new HostCheckBox("DisableFirewireReset");
00171 hc->setLabel(QObject::tr("Disable Firewire Reset"));
00172 hc->setHelpText(
00173 QObject::tr(
00174 "By default MythTV will reset the firewire bus when a "
00175 "firewire recorder stops responding to commands. But "
00176 "if this causes problems you can disable this here for "
00177 "Linux firewire recorders."));
00178 hc->setValue(false);
00179 return hc;
00180 }
00181
00182 static HostLineEdit *MiscStatusScript()
00183 {
00184 HostLineEdit *he = new HostLineEdit("MiscStatusScript");
00185 he->setLabel(QObject::tr("Miscellaneous Status Application"));
00186 he->setValue("");
00187 he->setHelpText(QObject::tr("External application or script that outputs "
00188 "extra information for inclusion in the "
00189 "backend status page. See "
00190 "contrib/misc_status_info/README"));
00191 return he;
00192 }
00193
00194 static void init_time_offsets(GlobalComboBox *gc)
00195 {
00196 gc->addSelection("None");
00197 gc->addSelection("Auto");
00198 gc->addSelection("+0030");
00199 gc->addSelection("+0100");
00200 gc->addSelection("+0130");
00201 gc->addSelection("+0200");
00202 gc->addSelection("+0230");
00203 gc->addSelection("+0300");
00204 gc->addSelection("+0330");
00205 gc->addSelection("+0400");
00206 gc->addSelection("+0430");
00207 gc->addSelection("+0500");
00208 gc->addSelection("+0530");
00209 gc->addSelection("+0600");
00210 gc->addSelection("+0630");
00211 gc->addSelection("+0700");
00212 gc->addSelection("+0730");
00213 gc->addSelection("+0800");
00214 gc->addSelection("+0830");
00215 gc->addSelection("+0900");
00216 gc->addSelection("+0930");
00217 gc->addSelection("+1000");
00218 gc->addSelection("+1030");
00219 gc->addSelection("+1100");
00220 gc->addSelection("+1130");
00221 gc->addSelection("+1200");
00222 gc->addSelection("-1100");
00223 gc->addSelection("-1030");
00224 gc->addSelection("-1000");
00225 gc->addSelection("-0930");
00226 gc->addSelection("-0900");
00227 gc->addSelection("-0830");
00228 gc->addSelection("-0800");
00229 gc->addSelection("-0730");
00230 gc->addSelection("-0700");
00231 gc->addSelection("-0630");
00232 gc->addSelection("-0600");
00233 gc->addSelection("-0530");
00234 gc->addSelection("-0500");
00235 gc->addSelection("-0430");
00236 gc->addSelection("-0400");
00237 gc->addSelection("-0330");
00238 gc->addSelection("-0300");
00239 gc->addSelection("-0230");
00240 gc->addSelection("-0200");
00241 gc->addSelection("-0130");
00242 gc->addSelection("-0100");
00243 gc->addSelection("-0030");
00244 }
00245
00246 static GlobalComboBox *TimeOffset()
00247 {
00248 GlobalComboBox *gc = new GlobalComboBox("TimeOffset");
00249 gc->setLabel(QObject::tr("Your Local Timezone (for XMLTV)"));
00250 init_time_offsets(gc);
00251 QString helptext = QObject::tr(
00252 "Used if the XMLTV data comes from a different timezone than your "
00253 "own. This adjust the times in the XMLTV EPG data to compensate. "
00254 "'Auto' converts the XMLTV time to local time using your "
00255 "computer's timezone. "
00256 "'None' ignores the XMLTV timezone, interpreting times as local.");
00257 gc->setHelpText(helptext);
00258 return gc;
00259 };
00260
00261 #if 0
00262 static GlobalComboBox *EITTimeOffset()
00263 {
00264 GlobalComboBox *gc = new GlobalComboBox("EITTimeOffset");
00265 gc->setLabel(QObject::tr("Time offset for EIT listings"));
00266 init_time_offsets(gc);
00267 gc->setValue(1);
00268 QString helptext = QObject::tr(
00269 "Adjust the relative timezone of the EIT EPG data. "
00270 "'Auto' converts the EIT time to local time using your "
00271 "computer's timezone. "
00272 "'None' ignores the EIT timezone, interpreting times as local.");
00273 gc->setHelpText(helptext);
00274 return gc;
00275 };
00276 #endif
00277
00278 static GlobalSpinBox *EITTransportTimeout()
00279 {
00280 GlobalSpinBox *gc = new GlobalSpinBox("EITTransportTimeout", 1, 15, 1);
00281 gc->setLabel(QObject::tr("EIT Transport Timeout (mins)"));
00282 gc->setValue(5);
00283 QString helpText = QObject::tr(
00284 "Maximum time to spend waiting for listings data on one DTV channel "
00285 "before checking for new listings data on the next channel.");
00286 gc->setHelpText(helpText);
00287 return gc;
00288 }
00289
00290 static GlobalCheckBox *MasterBackendOverride()
00291 {
00292 GlobalCheckBox *gc = new GlobalCheckBox("MasterBackendOverride");
00293 gc->setLabel(QObject::tr("Master Backend Override"));
00294 gc->setValue(true);
00295 gc->setHelpText(QObject::tr("If enabled, the master backend will stream and"
00296 " delete files if it finds them in the video directory. "
00297 "Useful if you are using a central storage location, like "
00298 "a NFS share, and your slave backend isn't running."));
00299 return gc;
00300 };
00301
00302 static GlobalCheckBox *EITIgnoresSource()
00303 {
00304 GlobalCheckBox *gc = new GlobalCheckBox("EITIgnoresSource");
00305 gc->setLabel(QObject::tr("Cross Source EIT"));
00306 gc->setValue(false);
00307 QString help = QObject::tr(
00308 "If enabled, listings data collected on one Video Source will be "
00309 "applied to the first matching DVB channel on any Video Source. "
00310 "This is sometimes useful for DVB-S, but may insert bogus "
00311 "data into any ATSC listings stored in the same database.");
00312 gc->setHelpText(help);
00313 return gc;
00314 };
00315
00316 static GlobalSpinBox *EITCrawIdleStart()
00317 {
00318 GlobalSpinBox *gc = new GlobalSpinBox("EITCrawIdleStart", 30, 7200, 30);
00319 gc->setLabel(QObject::tr("Backend Idle Before EIT Crawl (seconds)"));
00320 gc->setValue(60);
00321 QString help = QObject::tr(
00322 "The minimum number of seconds after a recorder becomes idle "
00323 "to wait before MythTV begins collecting EIT listings data.");
00324 gc->setHelpText(help);
00325 return gc;
00326 }
00327
00328 static GlobalSpinBox *WOLbackendReconnectWaitTime()
00329 {
00330 GlobalSpinBox *gc = new GlobalSpinBox("WOLbackendReconnectWaitTime", 0, 1200, 5);
00331 gc->setLabel(QObject::tr("Delay between wake attempts (secs)"));
00332 gc->setValue(0);
00333 gc->setHelpText(QObject::tr("Length of time the frontend waits between "
00334 "tries to wake up the master backend. This should be the "
00335 "time your masterbackend needs to startup. Set 0 to "
00336 "disable."));
00337 return gc;
00338 };
00339
00340 static GlobalSpinBox *WOLbackendConnectRetry()
00341 {
00342 GlobalSpinBox *gc = new GlobalSpinBox("WOLbackendConnectRetry", 1, 60, 1);
00343 gc->setLabel(QObject::tr("Wake Attempts"));
00344 gc->setHelpText(QObject::tr("Number of times the frontend will try to wake "
00345 "up the master backend."));
00346 gc->setValue(5);
00347 return gc;
00348 };
00349
00350 static GlobalLineEdit *WOLbackendCommand()
00351 {
00352 GlobalLineEdit *gc = new GlobalLineEdit("WOLbackendCommand");
00353 gc->setLabel(QObject::tr("Wake Command"));
00354 gc->setValue("");
00355 gc->setHelpText(QObject::tr("The command used to wake up your master "
00356 "backend server\n(eg. sudo /etc/init.d/mythtv-backend restart)."));
00357 return gc;
00358 };
00359
00360 static GlobalLineEdit *WOLslaveBackendsCommand()
00361 {
00362 GlobalLineEdit *gc = new GlobalLineEdit("WOLslaveBackendsCommand");
00363 gc->setLabel(QObject::tr("Wake command"));
00364 gc->setValue("");
00365 gc->setHelpText(QObject::tr("The command used to wakeup your slave "
00366 "backends. Leave empty to disable."));
00367 return gc;
00368 };
00369
00370 static GlobalSpinBox *idleTimeoutSecs()
00371 {
00372 GlobalSpinBox *gc = new GlobalSpinBox("idleTimeoutSecs", 0, 1200, 5);
00373 gc->setLabel(QObject::tr("Idle shutdown timeout (secs)"));
00374 gc->setValue(0);
00375 gc->setHelpText(QObject::tr("The amount of time the master backend idles "
00376 "before it shuts down all backends. Set to 0 to disable "
00377 "auto shutdown."));
00378 return gc;
00379 };
00380
00381 static GlobalSpinBox *idleWaitForRecordingTime()
00382 {
00383 GlobalSpinBox *gc = new GlobalSpinBox("idleWaitForRecordingTime", 0, 120, 1);
00384 gc->setLabel(QObject::tr("Max. wait for recording (min)"));
00385 gc->setValue(15);
00386 gc->setHelpText(QObject::tr("The amount of time the master backend waits "
00387 "for a recording. If it's idle but a recording starts "
00388 "within this time period, the backends won't shut down."));
00389 return gc;
00390 };
00391
00392 static GlobalSpinBox *StartupSecsBeforeRecording()
00393 {
00394 GlobalSpinBox *gc = new GlobalSpinBox("StartupSecsBeforeRecording", 0, 1200, 5);
00395 gc->setLabel(QObject::tr("Startup before rec. (secs)"));
00396 gc->setValue(120);
00397 gc->setHelpText(QObject::tr("The amount of time the master backend will be "
00398 "woken up before a recording starts."));
00399 return gc;
00400 };
00401
00402 static GlobalLineEdit *WakeupTimeFormat()
00403 {
00404 GlobalLineEdit *gc = new GlobalLineEdit("WakeupTimeFormat");
00405 gc->setLabel(QObject::tr("Wakeup time format"));
00406 gc->setValue("hh:mm yyyy-MM-dd");
00407 gc->setHelpText(QObject::tr("The format of the time string passed to the "
00408 "\'setWakeuptime Command\' as $time. See "
00409 "QT::QDateTime.toString() for details. Set to 'time_t' for "
00410 "seconds since epoch."));
00411 return gc;
00412 };
00413
00414 static GlobalLineEdit *SetWakeuptimeCommand()
00415 {
00416 GlobalLineEdit *gc = new GlobalLineEdit("SetWakeuptimeCommand");
00417 gc->setLabel(QObject::tr("Command to set Wakeup Time"));
00418 gc->setValue("");
00419 gc->setHelpText(QObject::tr("The command used to set the wakeup time (passed as "
00420 "$time) for the Master Backend"));
00421 return gc;
00422 };
00423
00424 static GlobalLineEdit *ServerHaltCommand()
00425 {
00426 GlobalLineEdit *gc = new GlobalLineEdit("ServerHaltCommand");
00427 gc->setLabel(QObject::tr("Server halt command"));
00428 gc->setValue("sudo /sbin/halt -p");
00429 gc->setHelpText(QObject::tr("The command used to halt the backends."));
00430 return gc;
00431 };
00432
00433 static GlobalLineEdit *preSDWUCheckCommand()
00434 {
00435 GlobalLineEdit *gc = new GlobalLineEdit("preSDWUCheckCommand");
00436 gc->setLabel(QObject::tr("Pre Shutdown check-command"));
00437 gc->setValue("");
00438 gc->setHelpText(QObject::tr("A command executed before the backend would "
00439 "shutdown. The return value determines if "
00440 "the backend can shutdown. 0 - yes, "
00441 "1 - restart idleing, "
00442 "2 - reset the backend to wait for a frontend."));
00443 return gc;
00444 };
00445
00446 static GlobalCheckBox *blockSDWUwithoutClient()
00447 {
00448 GlobalCheckBox *gc = new GlobalCheckBox("blockSDWUwithoutClient");
00449 gc->setLabel(QObject::tr("Block shutdown before client connected"));
00450 gc->setValue(true);
00451 gc->setHelpText(QObject::tr("If set, the automatic shutdown routine will "
00452 "be disabled until a client connects."));
00453 return gc;
00454 };
00455
00456 static GlobalLineEdit *startupCommand()
00457 {
00458 GlobalLineEdit *gc = new GlobalLineEdit("startupCommand");
00459 gc->setLabel(QObject::tr("Startup command"));
00460 gc->setValue("");
00461 gc->setHelpText(QObject::tr("This command is executed right after starting "
00462 "the BE. As a parameter \'$status\' is replaced by either "
00463 "\'auto\' if the machine was started automatically or "
00464 "\'user\' if a user switched it on."));
00465 return gc;
00466 };
00467
00468 static HostSpinBox *JobQueueMaxSimultaneousJobs()
00469 {
00470 HostSpinBox *gc = new HostSpinBox("JobQueueMaxSimultaneousJobs", 1, 10, 1);
00471 gc->setLabel(QObject::tr("Maximum simultaneous jobs on this backend"));
00472 gc->setHelpText(QObject::tr("The Job Queue will be limited to running "
00473 "this many simultaneous jobs on this backend."));
00474 gc->setValue(1);
00475 return gc;
00476 };
00477
00478 static HostSpinBox *JobQueueCheckFrequency()
00479 {
00480 HostSpinBox *gc = new HostSpinBox("JobQueueCheckFrequency", 5, 300, 5);
00481 gc->setLabel(QObject::tr("Job Queue Check frequency (in seconds)"));
00482 gc->setHelpText(QObject::tr("When looking for new jobs to process, the "
00483 "Job Queue will wait this long between checks."));
00484 gc->setValue(60);
00485 return gc;
00486 };
00487
00488 static HostComboBox *JobQueueCPU()
00489 {
00490 HostComboBox *gc = new HostComboBox("JobQueueCPU");
00491 gc->setLabel(QObject::tr("CPU Usage"));
00492 gc->addSelection(QObject::tr("Low"), "0");
00493 gc->addSelection(QObject::tr("Medium"), "1");
00494 gc->addSelection(QObject::tr("High"), "2");
00495 gc->setHelpText(QObject::tr("This setting controls approximately how "
00496 "much CPU jobs in the queue may consume. "
00497 "On 'High', all available CPU time may be used "
00498 "which could cause problems on slower systems." ));
00499 return gc;
00500 };
00501
00502 static HostTimeBox *JobQueueWindowStart()
00503 {
00504 HostTimeBox *gc = new HostTimeBox("JobQueueWindowStart", "00:00");
00505 gc->setLabel(QObject::tr("Job Queue Start Time"));
00506 gc->setHelpText(QObject::tr("This setting controls the start of the "
00507 "Job Queue time window which determines when new jobs will "
00508 "be started."));
00509 return gc;
00510 };
00511
00512 static HostTimeBox *JobQueueWindowEnd()
00513 {
00514 HostTimeBox *gc = new HostTimeBox("JobQueueWindowEnd", "23:59");
00515 gc->setLabel(QObject::tr("Job Queue End Time"));
00516 gc->setHelpText(QObject::tr("This setting controls the end of the "
00517 "Job Queue time window which determines when new jobs will "
00518 "be started."));
00519 return gc;
00520 };
00521
00522 static GlobalCheckBox *JobsRunOnRecordHost()
00523 {
00524 GlobalCheckBox *gc = new GlobalCheckBox("JobsRunOnRecordHost");
00525 gc->setLabel(QObject::tr("Run Jobs only on original recording backend"));
00526 gc->setValue(false);
00527 gc->setHelpText(QObject::tr("If set, jobs in the queue will be required "
00528 "to run on the backend that made the "
00529 "original recording."));
00530 return gc;
00531 };
00532
00533 static GlobalCheckBox *AutoTranscodeBeforeAutoCommflag()
00534 {
00535 GlobalCheckBox *gc = new GlobalCheckBox("AutoTranscodeBeforeAutoCommflag");
00536 gc->setLabel(QObject::tr("Run Transcode Jobs before Auto-Commercial Flagging"));
00537 gc->setValue(false);
00538 gc->setHelpText(QObject::tr("If set, if both auto-transcode and "
00539 "auto commercial flagging are turned ON for a "
00540 "recording, transcoding will run first, "
00541 "otherwise, commercial flagging runs first."));
00542 return gc;
00543 };
00544
00545 static GlobalCheckBox *AutoCommflagWhileRecording()
00546 {
00547 GlobalCheckBox *gc = new GlobalCheckBox("AutoCommflagWhileRecording");
00548 gc->setLabel(QObject::tr("Start Auto-Commercial Flagging jobs when the "
00549 "recording starts"));
00550 gc->setValue(false);
00551 gc->setHelpText(QObject::tr("If set and Auto Commercial Flagging is ON for "
00552 "a recording, the flagging job will be started "
00553 "as soon as the recording starts. NOT "
00554 "recommended on underpowered systems."));
00555 return gc;
00556 };
00557
00558 static GlobalLineEdit *UserJob(uint job_num)
00559 {
00560 GlobalLineEdit *gc = new GlobalLineEdit(QString("UserJob%1").arg(job_num));
00561 gc->setLabel(QObject::tr("User Job #%1 Command").arg(job_num));
00562 gc->setValue("");
00563 gc->setHelpText(QObject::tr("The command to run whenever this User Job "
00564 "number is scheduled."));
00565 return gc;
00566 };
00567
00568 static GlobalLineEdit *UserJobDesc(uint job_num)
00569 {
00570 GlobalLineEdit *gc = new GlobalLineEdit(QString("UserJobDesc%1")
00571 .arg(job_num));
00572 gc->setLabel(QObject::tr("User Job #%1 Description").arg(job_num));
00573 gc->setValue(QObject::tr("User Job #%1").arg(job_num));
00574 gc->setHelpText(QObject::tr("The Description for this User Job."));
00575 return gc;
00576 };
00577
00578 static HostCheckBox *JobAllowCommFlag()
00579 {
00580 HostCheckBox *gc = new HostCheckBox("JobAllowCommFlag");
00581 gc->setLabel(QObject::tr("Allow Commercial Detection jobs"));
00582 gc->setValue(true);
00583 gc->setHelpText(QObject::tr("Allow jobs of this type to run on this "
00584 "backend."));
00585 return gc;
00586 };
00587
00588 static HostCheckBox *JobAllowTranscode()
00589 {
00590 HostCheckBox *gc = new HostCheckBox("JobAllowTranscode");
00591 gc->setLabel(QObject::tr("Allow Transcoding jobs"));
00592 gc->setValue(true);
00593 gc->setHelpText(QObject::tr("Allow jobs of this type to run on this "
00594 "backend."));
00595 return gc;
00596 };
00597
00598 static GlobalLineEdit *JobQueueTranscodeCommand()
00599 {
00600 GlobalLineEdit *gc = new GlobalLineEdit("JobQueueTranscodeCommand");
00601 gc->setLabel(QObject::tr("Transcoder command"));
00602 gc->setValue("mythtranscode");
00603 gc->setHelpText(QObject::tr("The program used to transcode recordings. "
00604 "The default is 'mythtranscode' if this setting is empty."));
00605 return gc;
00606 };
00607
00608 static GlobalLineEdit *JobQueueCommFlagCommand()
00609 {
00610 GlobalLineEdit *gc = new GlobalLineEdit("JobQueueCommFlagCommand");
00611 gc->setLabel(QObject::tr("Commercial Flagger command"));
00612 gc->setValue("mythcommflag");
00613 gc->setHelpText(QObject::tr("The program used to detect commercials in a "
00614 "recording. The default is 'mythcommflag' "
00615 "if this setting is empty."));
00616 return gc;
00617 };
00618
00619 static HostCheckBox *JobAllowUserJob(uint job_num)
00620 {
00621 QString dbStr = QString("JobAllowUserJob%1").arg(job_num);
00622 QString desc = gContext->GetSetting(QString("UserJobDesc%1").arg(job_num));
00623 QString label = QObject::tr("Allow %1 jobs").arg(desc);
00624
00625 HostCheckBox *bc = new HostCheckBox(dbStr);
00626 bc->setLabel(label);
00627 bc->setValue(false);
00628
00629
00630
00631
00632
00633
00634
00635 bc->setHelpText(QObject::tr("Allow jobs of this type to run on this "
00636 "backend."));
00637 return bc;
00638 }
00639
00640
00641 BackendSettings::BackendSettings() {
00642 VerticalConfigurationGroup* server = new VerticalConfigurationGroup(false);
00643 server->setLabel(QObject::tr("Host Address Backend Setup"));
00644 VerticalConfigurationGroup* localServer = new VerticalConfigurationGroup();
00645 localServer->setLabel(QObject::tr("Local Backend" + QString(" (") + gContext->GetHostName() + QString(")")));
00646 HorizontalConfigurationGroup* localIP =
00647 new HorizontalConfigurationGroup(false, false, true, true);
00648 localIP->addChild(LocalServerIP());
00649 localServer->addChild(localIP);
00650 HorizontalConfigurationGroup* localPorts =
00651 new HorizontalConfigurationGroup(false, false, true, true);
00652 localPorts->addChild(LocalServerPort());
00653 localPorts->addChild(LocalStatusPort());
00654 localServer->addChild(localPorts);
00655 HorizontalConfigurationGroup* localPin =
00656 new HorizontalConfigurationGroup(false, false, true, true);
00657 localPin->addChild(LocalSecurityPin());
00658 localServer->addChild(localPin);
00659 VerticalConfigurationGroup* masterServer = new VerticalConfigurationGroup();
00660 masterServer->setLabel(QObject::tr("Master Backend"));
00661 masterServer->addChild(MasterServerIP());
00662 masterServer->addChild(MasterServerPort());
00663 server->addChild(localServer);
00664 server->addChild(masterServer);
00665 addChild(server);
00666
00667 VerticalConfigurationGroup* locale = new VerticalConfigurationGroup(false);
00668 locale->setLabel(QObject::tr("Locale Settings"));
00669 locale->addChild(TVFormat());
00670 locale->addChild(VbiFormat());
00671 locale->addChild(FreqTable());
00672 locale->addChild(TimeOffset());
00673 addChild(locale);
00674
00675 VerticalConfigurationGroup* group2 = new VerticalConfigurationGroup(false);
00676 group2->setLabel(QObject::tr("Miscellaneous Settings"));
00677 VerticalConfigurationGroup* fm = new VerticalConfigurationGroup();
00678 fm->setLabel(QObject::tr("File Management Settings"));
00679 fm->addChild(MasterBackendOverride());
00680 HorizontalConfigurationGroup *fmh1 =
00681 new HorizontalConfigurationGroup(false, false, true, true);
00682 fmh1->addChild(DeletesFollowLinks());
00683 fmh1->addChild(TruncateDeletes());
00684 fm->addChild(fmh1);
00685 fm->addChild(HDRingbufferSize());
00686 group2->addChild(fm);
00687 group2->addChild(MiscStatusScript());
00688 group2->addChild(DisableFirewireReset());
00689 addChild(group2);
00690
00691 VerticalConfigurationGroup* group2a1 = new VerticalConfigurationGroup(false);
00692 group2a1->setLabel(QObject::tr("EIT Scanner Options"));
00693
00694 group2a1->addChild(EITTransportTimeout());
00695 group2a1->addChild(EITIgnoresSource());
00696 group2a1->addChild(EITCrawIdleStart());
00697 addChild(group2a1);
00698
00699 VerticalConfigurationGroup* group3 = new VerticalConfigurationGroup(false);
00700 group3->setLabel(QObject::tr("Shutdown/Wakeup Options"));
00701 group3->addChild(startupCommand());
00702 group3->addChild(blockSDWUwithoutClient());
00703 group3->addChild(idleTimeoutSecs());
00704 group3->addChild(idleWaitForRecordingTime());
00705 group3->addChild(StartupSecsBeforeRecording());
00706 group3->addChild(WakeupTimeFormat());
00707 group3->addChild(SetWakeuptimeCommand());
00708 group3->addChild(ServerHaltCommand());
00709 group3->addChild(preSDWUCheckCommand());
00710 addChild(group3);
00711
00712 VerticalConfigurationGroup* group4 = new VerticalConfigurationGroup(false);
00713 group4->setLabel(QObject::tr("Backend Wakeup settings"));
00714
00715 VerticalConfigurationGroup* backend = new VerticalConfigurationGroup();
00716 backend->setLabel(QObject::tr("Master Backend"));
00717 backend->addChild(WOLbackendReconnectWaitTime());
00718 backend->addChild(WOLbackendConnectRetry());
00719 backend->addChild(WOLbackendCommand());
00720 group4->addChild(backend);
00721
00722 VerticalConfigurationGroup* slaveBackend = new VerticalConfigurationGroup();
00723 slaveBackend->setLabel(QObject::tr("Slave Backends"));
00724 slaveBackend->addChild(WOLslaveBackendsCommand());
00725 group4->addChild(slaveBackend);
00726 addChild(group4);
00727
00728 VerticalConfigurationGroup* group5 = new VerticalConfigurationGroup(false);
00729 group5->setLabel(QObject::tr("Job Queue (Backend-Specific)"));
00730 group5->addChild(JobQueueMaxSimultaneousJobs());
00731 group5->addChild(JobQueueCheckFrequency());
00732
00733 HorizontalConfigurationGroup* group5a =
00734 new HorizontalConfigurationGroup(false, false);
00735 VerticalConfigurationGroup* group5a1 =
00736 new VerticalConfigurationGroup(false, false);
00737 group5a1->addChild(JobQueueWindowStart());
00738 group5a1->addChild(JobQueueWindowEnd());
00739 group5a1->addChild(JobQueueCPU());
00740 group5a1->addChild(JobAllowCommFlag());
00741 group5a1->addChild(JobAllowTranscode());
00742 group5a->addChild(group5a1);
00743
00744 VerticalConfigurationGroup* group5a2 =
00745 new VerticalConfigurationGroup(false, false);
00746 group5a2->addChild(JobAllowUserJob(1));
00747 group5a2->addChild(JobAllowUserJob(2));
00748 group5a2->addChild(JobAllowUserJob(3));
00749 group5a2->addChild(JobAllowUserJob(4));
00750 group5a->addChild(group5a2);
00751 group5->addChild(group5a);
00752 addChild(group5);
00753
00754 VerticalConfigurationGroup* group6 = new VerticalConfigurationGroup(false);
00755 group6->setLabel(QObject::tr("Job Queue (Global)"));
00756 group6->addChild(JobsRunOnRecordHost());
00757 group6->addChild(AutoCommflagWhileRecording());
00758 group6->addChild(JobQueueCommFlagCommand());
00759 group6->addChild(JobQueueTranscodeCommand());
00760 group6->addChild(AutoTranscodeBeforeAutoCommflag());
00761 group6->addChild(SaveTranscoding());
00762 addChild(group6);
00763
00764 VerticalConfigurationGroup* group7 = new VerticalConfigurationGroup(false);
00765 group7->setLabel(QObject::tr("Job Queue (Job Commands)"));
00766 group7->addChild(UserJobDesc(1));
00767 group7->addChild(UserJob(1));
00768 group7->addChild(UserJobDesc(2));
00769 group7->addChild(UserJob(2));
00770 group7->addChild(UserJobDesc(3));
00771 group7->addChild(UserJob(3));
00772 group7->addChild(UserJobDesc(4));
00773 group7->addChild(UserJob(4));
00774 addChild(group7);
00775 }