Ticket #10092: settings-mythfrontend-2012-03-09.diff
| File settings-mythfrontend-2012-03-09.diff, 230.7 KB (added by , 14 years ago) |
|---|
-
mythtv/programs/mythfrontend/audiogeneralsettings.cpp
diff --git a/mythtv/programs/mythfrontend/audiogeneralsettings.cpp b/mythtv/programs/mythfrontend/audiogeneralsettings.cpp index 1c8e2d5..ab57b8a 100644
a b extern "C" { 25 25 #include "libavformat/avformat.h" 26 26 } 27 27 28 29 class TriggeredItem : public TriggeredConfigurationGroup30 {31 public:32 TriggeredItem(Setting *checkbox, ConfigurationGroup *group) :33 TriggeredConfigurationGroup(false, false, false, false)34 {35 setTrigger(checkbox);36 37 addTarget("1", group);38 addTarget("0", new VerticalConfigurationGroup(true));39 }40 TriggeredItem(Setting *checkbox, Setting *setting) :41 TriggeredConfigurationGroup(false, false, false, false)42 {43 setTrigger(checkbox);44 45 addTarget("1", setting);46 addTarget("0", new VerticalConfigurationGroup(false, false));47 }48 };49 50 28 AudioDeviceComboBox::AudioDeviceComboBox(AudioConfigSettings *parent) : 51 HostComboBox ("AudioOutputDevice", true), m_parent(parent)29 HostComboBoxSetting("AudioOutputDevice", true), m_parent(parent) 52 30 { 53 31 setLabel(QObject::tr("Audio output device")); 54 32 #ifdef USING_ALSA … … AudioDeviceComboBox::AudioDeviceComboBox(AudioConfigSettings *parent) : 66 44 dflt); 67 45 addSelection(current, current, true); 68 46 69 connect(this, SIGNAL(valueChanged(const QString&)), 70 this, SLOT(AudioDescriptionHelp(const QString&))); 47 connect(this, SIGNAL(valueChanged(StandardSetting *)), 48 this, SLOT(AudioDescriptionHelp(StandardSetting *))); 49 } 50 51 void AudioDeviceComboBox::edit(MythScreenType * screen) 52 { 53 AudioRescan(); 54 HostComboBoxSetting::edit(screen); 71 55 } 72 56 73 57 void AudioDeviceComboBox::AudioRescan() … … void AudioDeviceComboBox::AudioRescan() 80 64 81 65 QString value = getValue(); 82 66 clearSelections(); 83 resetMaxCount(vect.size());84 67 85 68 bool found = false; 86 69 for (it = vect.begin(); it != vect.end(); ++it) … … void AudioDeviceComboBox::AudioRescan() 88 71 value == it->name ? (found = true) : false); 89 72 if (!found) 90 73 { 91 resetMaxCount(vect.size()+1);92 74 addSelection(value, value, true); 93 75 } 94 // For some reason, it adds an empty entry, remove it95 removeSelection(QString::null);96 76 } 97 77 98 void AudioDeviceComboBox::AudioDescriptionHelp( const QString &device)78 void AudioDeviceComboBox::AudioDescriptionHelp(StandardSetting * setting) 99 79 { 100 QString desc = m_parent->AudioDeviceMap().value( device).desc;80 QString desc = m_parent->AudioDeviceMap().value(setting->getValue()).desc; 101 81 setHelpText(desc); 102 82 } 103 83 104 AudioConfigSettings::AudioConfigSettings(ConfigurationWizard *parent) : 105 VerticalConfigurationGroup(false, true, false, false), 106 m_OutputDevice(NULL), m_MaxAudioChannels(NULL), 107 m_AudioUpmix(NULL), m_AudioUpmixType(NULL), 108 m_AC3PassThrough(NULL), m_DTSPassThrough(NULL), 109 m_EAC3PassThrough(NULL),m_TrueHDPassThrough(NULL), m_DTSHDPassThrough(NULL), 110 m_parent(parent) 84 85 AudioConfigSettings::AudioConfigSettings() : 86 GroupSetting() 111 87 { 112 88 setLabel(QObject::tr("Audio System")); 113 setUseLabel(false); 114 115 ConfigurationGroup *devicegroup = new HorizontalConfigurationGroup(false, 116 false); 117 devicegroup->addChild((m_OutputDevice = new AudioDeviceComboBox(this))); 118 // Rescan button 119 TransButtonSetting *rescan = new TransButtonSetting("rescan"); 120 rescan->setLabel(QObject::tr("Rescan")); 121 rescan->setHelpText(QObject::tr("Rescan for available audio devices. " 122 "Current entry will be checked and " 123 "capability entries populated.")); 124 devicegroup->addChild(rescan); 125 connect(rescan, SIGNAL(pressed()), this, SLOT(AudioRescan())); 126 addChild(devicegroup); 89 90 this->addChild((m_OutputDevice = new AudioDeviceComboBox(this))); 127 91 128 92 QString name = m_OutputDevice->getValue(); 129 93 AudioOutput::AudioDeviceConfig *adc = … … AudioConfigSettings::AudioConfigSettings(ConfigurationWizard *parent) : 139 103 140 104 delete adc; 141 105 142 ConfigurationGroup *maingroup = new VerticalConfigurationGroup(false,143 false);144 addChild(maingroup);145 106 146 m_triggerDigital = new TransCheckBoxSetting(); 147 m_AC3PassThrough = AC3PassThrough(); 148 m_DTSPassThrough = DTSPassThrough(); 149 m_EAC3PassThrough = EAC3PassThrough(); 150 m_TrueHDPassThrough = TrueHDPassThrough(); 151 m_DTSHDPassThrough = DTSHDPassThrough(); 107 // digital settings 108 m_triggerDigital = new GroupSetting(); 109 m_triggerDigital->setLabel(QObject::tr("Digital Audio Capabilities")); 110 m_triggerDigital->addChild(m_AC3PassThrough = AC3PassThrough()); 111 m_triggerDigital->addChild(m_DTSPassThrough = DTSPassThrough()); 112 m_triggerDigital->addChild(m_EAC3PassThrough = EAC3PassThrough()); 113 m_triggerDigital->addChild(m_TrueHDPassThrough = TrueHDPassThrough()); 114 m_triggerDigital->addChild(m_DTSHDPassThrough = DTSHDPassThrough()); 115 addChild(m_triggerDigital); 116 117 addChild((m_MaxAudioChannels = MaxAudioChannels())); 118 addChild((m_AudioUpmix = AudioUpmix())); 119 addChild((m_AudioUpmixType = AudioUpmixType())); 120 addChild(MythControlsVolume()); 121 152 122 153 m_cgsettings = new HorizontalConfigurationGroup(); 154 m_cgsettings->setLabel(QObject::tr("Digital Audio Capabilities")); 155 m_cgsettings->addChild(m_AC3PassThrough); 156 m_cgsettings->addChild(m_DTSPassThrough); 157 m_cgsettings->addChild(m_EAC3PassThrough); 158 m_cgsettings->addChild(m_TrueHDPassThrough); 159 m_cgsettings->addChild(m_DTSHDPassThrough); 123 //Advanced Settings 124 GroupSetting * advancedSettings = new GroupSetting(); 125 advancedSettings->setLabel(QObject::tr("Advanced Audio Settings")); 126 advancedSettings->setHelpText(QObject::tr("Enable extra audio settings. Under most " 127 "usage all options should be left alone")); 128 addChild(advancedSettings); 129 m_PassThroughOverride = PassThroughOverride(); 130 advancedSettings->addChild(m_PassThroughOverride); 131 m_PassThroughDeviceOverride = PassThroughOutputDevice(); 132 advancedSettings->addChild(m_PassThroughDeviceOverride); 133 connect(m_PassThroughOverride, SIGNAL(valueChanged(bool)), 134 m_PassThroughDeviceOverride, SLOT(setEnabled(bool))); 160 135 161 TriggeredItem *sub1 = new TriggeredItem(m_triggerDigital, m_cgsettings);162 136 163 maingroup->addChild(sub1); 137 StandardSetting *srcqualityoverride = SRCQualityOverride(); 138 srcqualityoverride->addTargetedChild("1",SRCQuality()); 164 139 165 maingroup->addChild((m_MaxAudioChannels = MaxAudioChannels())); 166 maingroup->addChild((m_AudioUpmix = AudioUpmix())); 167 maingroup->addChild((m_AudioUpmixType = AudioUpmixType())); 140 advancedSettings->addChild(Audio48kOverride()); 141 #if USING_ALSA 142 advancedSettings->addChild(SPDIFRateOverride()); 143 #endif 168 144 169 TransButtonSetting *test = new TransButtonSetting("test"); 170 test->setLabel(QObject::tr("Test")); 171 test->setHelpText(QObject::tr("Will play a test pattern on all configured " 172 "speakers")); 173 connect(test, SIGNAL(pressed()), this, SLOT(StartAudioTest())); 174 addChild(test); 145 advancedSettings->addChild(m_MPCM = MPCM()); 175 146 176 TransButtonSetting *advanced = new TransButtonSetting("advanced"); 177 advanced->setLabel(QObject::tr("Advanced Audio Settings")); 178 advanced->setHelpText(QObject::tr("Enable extra audio settings. Under most " 179 "usage all options should be left alone")); 180 connect(advanced, SIGNAL(pressed()), this, SLOT(AudioAdvanced())); 181 addChild(advanced); 147 addChild(m_audioTest = new AudioTest()); 182 148 183 149 // Set slots 184 connect(m_MaxAudioChannels, SIGNAL(valueChanged(const QString&)), 185 this, SLOT(UpdateVisibility(const QString&))); 186 connect(m_OutputDevice, SIGNAL(valueChanged(const QString&)), 187 this, SLOT(UpdateCapabilities(const QString&))); 188 connect(m_AC3PassThrough, SIGNAL(valueChanged(const QString&)), 189 this, SLOT(UpdateCapabilities(const QString&))); 190 connect(m_DTSPassThrough, SIGNAL(valueChanged(const QString&)), 191 this, SLOT(UpdateCapabilities(const QString&))); 192 connect(m_EAC3PassThrough, SIGNAL(valueChanged(const QString&)), 193 this, SLOT(UpdateCapabilities(const QString&))); 194 connect(m_TrueHDPassThrough, SIGNAL(valueChanged(const QString&)), 195 this, SLOT(UpdateCapabilities(const QString&))); 196 connect(m_DTSHDPassThrough, SIGNAL(valueChanged(const QString&)), 197 this, SLOT(UpdateCapabilities(const QString&))); 150 connect(m_MaxAudioChannels, SIGNAL(valueChanged(StandardSetting *)), 151 this, SLOT(UpdateVisibility(StandardSetting *))); 152 connect(m_OutputDevice, SIGNAL(valueChanged(StandardSetting *)), 153 this, SLOT(UpdateCapabilities(StandardSetting *))); 154 connect(m_AC3PassThrough, SIGNAL(valueChanged(StandardSetting *)), 155 this, SLOT(UpdateCapabilities(StandardSetting *))); 156 connect(m_DTSPassThrough, SIGNAL(valueChanged(StandardSetting *)), 157 this, SLOT(UpdateCapabilities(StandardSetting *))); 158 connect(m_EAC3PassThrough, SIGNAL(valueChanged(StandardSetting *)), 159 this, SLOT(UpdateCapabilities(StandardSetting *))); 160 connect(m_TrueHDPassThrough, SIGNAL(valueChanged(StandardSetting *)), 161 this, SLOT(UpdateCapabilities(StandardSetting *))); 162 connect(m_DTSHDPassThrough, SIGNAL(valueChanged(StandardSetting *)), 163 this, SLOT(UpdateCapabilities(StandardSetting *))); 164 //Slot for audio test 165 connect(m_OutputDevice,SIGNAL(valueChanged(StandardSetting *)), 166 this,SLOT(UpdateAudioTest())); 167 connect(m_MaxAudioChannels,SIGNAL(valueChanged(StandardSetting *)), 168 this,SLOT(UpdateAudioTest())); 169 170 198 171 AudioRescan(); 199 172 } 200 173 201 174 void AudioConfigSettings::AudioRescan() 202 175 { 176 177 LOG(VB_GENERAL, LOG_ERR, 178 QString("AudioConfigSettings::AudioRescan()")); 203 179 if (!slotlock.tryLock()) 204 180 return; 205 181 … … void AudioConfigSettings::AudioRescan() 237 213 { 238 214 QString msg =QObject::tr("Passthrough device is invalid or not useable." 239 215 " Check configuration in Advanced Settings:") + 240 gCoreContext->GetSetting("PassThruOutputDevice");216 m_PassThroughDeviceOverride->getValue(); 241 217 MythPopupBox::showOkPopup( 242 218 GetMythMainWindow(), QObject::tr("Warning"), msg); 243 219 LOG(VB_GENERAL, LOG_ERR, QString("Audio device %1 isn't usable") 244 220 .arg(name)); 245 221 } 246 222 slotlock.unlock(); 247 UpdateCapabilities( QString::null);223 UpdateCapabilities(NULL); 248 224 } 249 225 250 void AudioConfigSettings::UpdateVisibility( const QString &device)226 void AudioConfigSettings::UpdateVisibility(StandardSetting *) 251 227 { 252 228 if (!m_MaxAudioChannels && !m_AudioUpmix && !m_AudioUpmixType) 253 229 return; … … void AudioConfigSettings::UpdateVisibility(const QString &device) 258 234 } 259 235 260 236 AudioOutputSettings AudioConfigSettings::UpdateCapabilities( 261 const QString &device)237 StandardSetting *) 262 238 { 263 239 int max_speakers = 8; 264 240 int realmax_speakers = 8; … … AudioOutputSettings AudioConfigSettings::UpdateCapabilities( 290 266 } 291 267 else 292 268 { 293 bool bForceDigital = 294 gCoreContext->GetNumSetting("PassThruDeviceOverride", false);269 270 bool bForceDigital = m_PassThroughOverride->boolValue(); 295 271 296 272 settings = audiodevs.value(out).settings; 297 273 settingsdigital = bForceDigital ? 298 audiodevs.value( gCoreContext->GetSetting("PassThruOutputDevice"))274 audiodevs.value(m_PassThroughDeviceOverride->getValue()) 299 275 .settings : settings; 300 276 301 277 realmax_speakers = max_speakers = settings.BestSupportedChannels(); … … AudioOutputSettings AudioConfigSettings::UpdateCapabilities( 320 296 max_speakers = 6; 321 297 } 322 298 323 m_triggerDigital->set Value(invalid || settingsdigital.canFeature(299 m_triggerDigital->setEnabled(invalid || settingsdigital.canFeature( 324 300 FEATURE_AC3 | FEATURE_DTS | FEATURE_EAC3 | 325 301 FEATURE_TRUEHD | FEATURE_DTSHD)); 302 326 303 m_EAC3PassThrough->setEnabled(bEAC3); 327 304 m_TrueHDPassThrough->setEnabled(bTRUEHD); 328 305 m_DTSHDPassThrough->setEnabled(bDTSHD); … … AudioOutputSettings AudioConfigSettings::UpdateCapabilities( 335 312 cur_speakers = max_speakers; 336 313 } 337 314 338 // Remove everything and re-add available channels315 // Remove everything and re-add available channels 339 316 m_MaxAudioChannels->clearSelections(); 340 m_MaxAudioChannels->resetMaxCount(3);341 317 for (int i = 1; i <= max_speakers; i++) 342 318 { 343 319 if (invalid || settings.IsSupportedChannels(i)) … … AudioOutputSettings AudioConfigSettings::UpdateCapabilities( 362 338 i == cur_speakers); 363 339 } 364 340 } 341 342 setMPCMEnabled(settings.canPassthrough() >= 0); 365 343 // Return values is used by audio test 366 344 // where we mainly are interested by the number of channels 367 345 // if we support AC3 and/or LPCM … … AudioOutputSettings AudioConfigSettings::UpdateCapabilities( 373 351 return settings; 374 352 } 375 353 376 void AudioConfigSettings::AudioAdvanced() 377 { 378 QString out = m_OutputDevice->getValue(); 379 bool invalid = false; 380 AudioOutputSettings settings; 381 382 if (!audiodevs.contains(out)) 383 { 384 invalid = true; 385 } 386 else 387 { 388 settings = audiodevs.value(out).settings; 389 } 390 391 AudioAdvancedSettingsGroup audiosettings(invalid || 392 (settings.canPassthrough() >= 0)); 393 394 if (audiosettings.exec() == kDialogCodeAccepted) 395 { 396 AudioRescan(); 397 UpdateCapabilities(QString::null); 398 } 399 } 400 401 HostComboBox *AudioConfigSettings::MaxAudioChannels() 354 HostComboBoxSetting *AudioConfigSettings::MaxAudioChannels() 402 355 { 403 356 QString name = "MaxChannels"; 404 HostComboBox *gc = new HostComboBox(name, false);357 HostComboBoxSetting *gc = new HostComboBoxSetting(name, false); 405 358 gc->setLabel(QObject::tr("Speaker configuration")); 406 359 gc->addSelection(QObject::tr("Stereo"), "2", true); // default 407 360 gc->setHelpText(QObject::tr("Select the maximum number of audio " … … HostComboBox *AudioConfigSettings::MaxAudioChannels() 410 363 return gc; 411 364 } 412 365 413 HostCheckBox *AudioConfigSettings::AudioUpmix()366 HostCheckBoxSetting *AudioConfigSettings::AudioUpmix() 414 367 { 415 HostCheckBox *gc = new HostCheckBox("AudioDefaultUpmix");368 HostCheckBoxSetting *gc = new HostCheckBoxSetting("AudioDefaultUpmix"); 416 369 gc->setLabel(QObject::tr("Upconvert stereo to 5.1 surround")); 417 370 gc->setValue(true); 418 371 gc->setHelpText(QObject::tr("If enabled, MythTV will upconvert stereo " … … HostCheckBox *AudioConfigSettings::AudioUpmix() 421 374 return gc; 422 375 } 423 376 424 HostComboBox *AudioConfigSettings::AudioUpmixType()377 HostComboBoxSetting *AudioConfigSettings::AudioUpmixType() 425 378 { 426 HostComboBox *gc = new HostComboBox("AudioUpmixType",false);379 HostComboBoxSetting *gc = new HostComboBoxSetting("AudioUpmixType",false); 427 380 gc->setLabel(QObject::tr("Upmix Quality")); 428 381 gc->addSelection(QObject::tr("Good"), "1"); 429 382 gc->addSelection(QObject::tr("Best"), "2", true); // default … … HostComboBox *AudioConfigSettings::AudioUpmixType() 431 384 return gc; 432 385 } 433 386 434 HostCheckBox *AudioConfigSettings::AC3PassThrough()387 HostCheckBoxSetting *AudioConfigSettings::AC3PassThrough() 435 388 { 436 HostCheckBox *gc = new HostCheckBox("AC3PassThru");389 HostCheckBoxSetting *gc = new HostCheckBoxSetting("AC3PassThru"); 437 390 gc->setLabel(QObject::tr("Dolby Digital")); 438 391 gc->setValue(false); 439 392 gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder " … … HostCheckBox *AudioConfigSettings::AC3PassThrough() 442 395 return gc; 443 396 } 444 397 445 HostCheckBox *AudioConfigSettings::DTSPassThrough()398 HostCheckBoxSetting *AudioConfigSettings::DTSPassThrough() 446 399 { 447 HostCheckBox *gc = new HostCheckBox("DTSPassThru");400 HostCheckBoxSetting *gc = new HostCheckBoxSetting("DTSPassThru"); 448 401 gc->setLabel(QObject::tr("DTS")); 449 402 gc->setValue(false); 450 403 gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder " … … HostCheckBox *AudioConfigSettings::DTSPassThrough() 453 406 return gc; 454 407 } 455 408 456 HostCheckBox *AudioConfigSettings::EAC3PassThrough()409 HostCheckBoxSetting *AudioConfigSettings::EAC3PassThrough() 457 410 { 458 HostCheckBox *gc = new HostCheckBox("EAC3PassThru");411 HostCheckBoxSetting *gc = new HostCheckBoxSetting("EAC3PassThru"); 459 412 gc->setLabel(QObject::tr("E-AC-3")); 460 413 gc->setValue(false); 461 414 gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder " … … HostCheckBox *AudioConfigSettings::EAC3PassThrough() 463 416 return gc; 464 417 } 465 418 466 HostCheckBox *AudioConfigSettings::TrueHDPassThrough()419 HostCheckBoxSetting *AudioConfigSettings::TrueHDPassThrough() 467 420 { 468 HostCheckBox *gc = new HostCheckBox("TrueHDPassThru");421 HostCheckBoxSetting *gc = new HostCheckBoxSetting("TrueHDPassThru"); 469 422 gc->setLabel(QObject::tr("TrueHD")); 470 423 gc->setValue(false); 471 424 gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder " … … HostCheckBox *AudioConfigSettings::TrueHDPassThrough() 473 426 return gc; 474 427 } 475 428 476 HostCheckBox *AudioConfigSettings::DTSHDPassThrough()429 HostCheckBoxSetting *AudioConfigSettings::DTSHDPassThrough() 477 430 { 478 HostCheckBox *gc = new HostCheckBox("DTSHDPassThru");431 HostCheckBoxSetting *gc = new HostCheckBoxSetting("DTSHDPassThru"); 479 432 gc->setLabel(QObject::tr("DTS-HD")); 480 433 gc->setValue(false); 481 434 gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder " … … bool AudioConfigSettings::CheckPassthrough() 487 440 { 488 441 bool ok = true; 489 442 490 if ( gCoreContext->GetNumSetting("PassThruDeviceOverride", false))443 if (m_PassThroughOverride->boolValue()) 491 444 { 492 QString name = gCoreContext->GetSetting("PassThruOutputDevice");445 QString name = m_PassThroughDeviceOverride->getValue(); 493 446 AudioOutput::AudioDeviceConfig *adc = 494 447 AudioOutput::GetAudioDeviceConfig(name, name, true); 495 448 if (adc->settings.IsInvalid()) … … bool AudioConfigSettings::CheckPassthrough() 507 460 return ok; 508 461 } 509 462 510 void AudioConfigSettings::StartAudioTest() 463 static void fillSelectionsFromDir(HostComboBoxSetting *comboBox, const QDir& dir, bool absPath = true) 464 465 { 466 QFileInfoList il = dir.entryInfoList(); 467 468 for (QFileInfoList::Iterator it = il.begin(); 469 it != il.end(); 470 ++it ) 471 { 472 QFileInfo &fi = *it; 473 474 if (absPath) 475 comboBox->addSelection( fi.absoluteFilePath() ); 476 else 477 comboBox->addSelection( fi.fileName() ); 478 } 479 } 480 481 HostComboBoxSetting *AudioConfigSettings::MixerDevice() 482 { 483 HostComboBoxSetting *gc = new HostComboBoxSetting("MixerDevice", true); 484 gc->setLabel(QObject::tr("Mixer device")); 485 486 #ifdef USING_OSS 487 QDir dev("/dev", "mixer*", QDir::Name, QDir::System); 488 fillSelectionsFromDir(gc, dev); 489 490 dev.setPath("/dev/sound"); 491 if (dev.exists()) 492 { 493 fillSelectionsFromDir(gc, dev); 494 } 495 #endif 496 #ifdef USING_ALSA 497 gc->addSelection("ALSA:default", "ALSA:default"); 498 #endif 499 #ifdef USING_MINGW 500 gc->addSelection("DirectX:", "DirectX:"); 501 gc->addSelection("Windows:", "Windows:"); 502 #endif 503 #if !defined(USING_MINGW) 504 gc->addSelection("software", "software"); 505 gc->setHelpText(QObject::tr("Setting the mixer device to \"software\" " 506 "lets MythTV control the volume of all audio at the " 507 "expense of a slight quality loss.")); 508 #endif 509 510 return gc; 511 } 512 513 static const char* MixerControlControls[] = { "PCM", 514 "Master" }; 515 516 HostComboBoxSetting *AudioConfigSettings::MixerControl() 511 517 { 512 AudioOutputSettings settings = UpdateCapabilities(QString::null); 518 HostComboBoxSetting *gc = new HostComboBoxSetting("MixerControl", true); 519 gc->setLabel(QObject::tr("Mixer controls")); 520 for (unsigned int i = 0; i < sizeof(MixerControlControls) / sizeof(char*); 521 ++i) 522 { 523 gc->addSelection(QObject::tr(MixerControlControls[i]), 524 MixerControlControls[i]); 525 } 526 527 gc->setHelpText(QObject::tr("Changing the volume adjusts the selected mixer.")); 528 return gc; 529 } 530 531 532 //TODO was a slider 533 HostSpinBoxSetting *AudioConfigSettings::MixerVolume() 534 { 535 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MasterMixerVolume", 0, 100, 1); 536 gs->setLabel(QObject::tr("Master mixer volume")); 537 gs->setValue(70); 538 gs->setHelpText(QObject::tr("Initial volume for the Master mixer. " 539 "This affects all sound created by the audio device. " 540 "Note: Do not set this too low.")); 541 return gs; 542 } 543 544 //TODO was a slider 545 HostSpinBoxSetting *AudioConfigSettings::PCMVolume() 546 { 547 HostSpinBoxSetting *gs = new HostSpinBoxSetting("PCMMixerVolume", 0, 100, 1); 548 gs->setLabel(QObject::tr("PCM mixer volume")); 549 gs->setValue(70); 550 gs->setHelpText(QObject::tr("Initial volume for PCM output. Using the " 551 "volume keys in MythTV will adjust this parameter.")); 552 return gs; 553 } 554 555 556 HostCheckBoxSetting *AudioConfigSettings::MythControlsVolume() 557 { 558 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MythControlsVolume"); 559 gc->setLabel(QObject::tr("Use internal volume controls")); 560 gc->setValue(true); 561 gc->setHelpText(QObject::tr("If enabled, MythTV will control the PCM and " 562 "master mixer volume. Disable this option if you prefer " 563 "to control the volume externally (for example, using " 564 "your amplifier) or if you use an external mixer program.")); 565 566 gc->addTargetedChild("1",MixerDevice()); 567 gc->addTargetedChild("1",MixerControl()); 568 gc->addTargetedChild("1",MixerVolume()); 569 gc->addTargetedChild("1",PCMVolume()); 570 return gc; 571 } 572 573 void AudioConfigSettings::UpdateAudioTest() 574 { 575 576 LOG(VB_GENERAL, LOG_ERR, "AudioConfigSettings::UpdateAudioTest()"); 577 AudioOutputSettings settings = UpdateCapabilities(NULL); 513 578 514 579 QString out = m_OutputDevice->getValue(); 515 QString passthrough = 516 gCoreContext->GetNumSetting("PassThruDeviceOverride", false) ? 517 gCoreContext->GetSetting("PassThruOutputDevice") : QString::null; 580 QString passthrough = m_PassThroughOverride->boolValue() ? 581 m_PassThroughDeviceOverride->getValue(): QString::null; 518 582 int channels = m_MaxAudioChannels->getValue().toInt(); 519 QString errMsg;520 583 521 AudioTestGroup audiotest(out, passthrough, channels, settings);584 m_audioTest->UpdateCapabilities(out, passthrough, channels, settings); 522 585 523 audiotest.exec();524 586 } 525 587 526 588 AudioTestThread::AudioTestThread(QObject *parent, … … void AudioTestThread::run() 691 753 RunEpilog(); 692 754 } 693 755 694 AudioTest::AudioTest(QString main, QString passthrough, 695 int channels, AudioOutputSettings settings) 696 : VerticalConfigurationGroup(false, true, false, false), 697 m_frontleft(NULL), m_frontright(NULL), m_center(NULL), 698 m_surroundleft(NULL), m_surroundright(NULL), 699 m_rearleft(NULL), m_rearright(NULL), m_lfe(NULL), 700 m_main(main), m_passthrough(passthrough), m_settings(settings), 756 AudioTest::AudioTest() 757 : GroupSetting(), 758 m_at(NULL), 701 759 m_quality(false) 702 760 { 761 int channels=2; 762 763 703 764 m_channels = gCoreContext->GetNumSetting("TestingChannels", channels); 704 765 setLabel(QObject::tr("Audio Configuration Testing")); 766 setHelpText(QObject::tr("Will play a test pattern on all configured " 767 "speakers")); 705 768 706 m_at = new AudioTestThread(this, m_main, m_passthrough, m_channels, 707 m_settings, m_quality); 708 if (!m_at->result().isEmpty()) 709 { 710 QString msg = main + QObject::tr(" is invalid or not " 711 "useable."); 712 MythPopupBox::showOkPopup( 713 GetMythMainWindow(), QObject::tr("Warning"), msg); 714 return; 715 } 716 717 m_button = new TransButtonSetting("start"); 718 m_button->setLabel(QObject::tr("Test All")); 719 m_button->setHelpText(QObject::tr("Start all channels test")); 720 connect(m_button, SIGNAL(pressed(QString)), this, SLOT(toggle(QString))); 721 722 ConfigurationGroup *frontgroup = 723 new HorizontalConfigurationGroup(false, 724 false); 725 ConfigurationGroup *middlegroup = 726 new HorizontalConfigurationGroup(false, 727 false); 728 ConfigurationGroup *reargroup = 729 new HorizontalConfigurationGroup(false, 730 false); 731 m_frontleft = new TransButtonSetting("0"); 769 m_frontleft = new ButtonStandardSetting("0"); 732 770 m_frontleft->setLabel(QObject::tr("Front Left")); 771 addChild(m_frontleft); 733 772 connect(m_frontleft, 734 SIGNAL( pressed(QString)), this, SLOT(toggle(QString)));735 m_frontright = new TransButtonSetting(m_channels == 2 ? "1" : "2");773 SIGNAL(clicked()), this, SLOT(toggle())); 774 m_frontright = new ButtonStandardSetting(m_channels == 2 ? "1" : "2"); 736 775 m_frontright->setLabel(QObject::tr("Front Right")); 776 addChild(m_frontright); 737 777 connect(m_frontright, 738 SIGNAL(pressed(QString)), this, SLOT(toggle(QString))); 739 frontgroup->addChild(m_frontleft); 740 741 switch(m_channels) 742 { 743 case 8: 744 m_rearleft = new TransButtonSetting("5"); 745 m_rearleft->setLabel(QObject::tr("Rear Left")); 746 connect(m_rearleft, 747 SIGNAL(pressed(QString)), this, SLOT(toggle(QString))); 748 reargroup->addChild(m_rearleft); 749 750 case 7: 751 m_rearright = new TransButtonSetting("4"); 752 m_rearright->setLabel(QObject::tr(m_channels == 8 ? 753 "Rear Right" : "Rear Center")); 754 connect(m_rearright, 755 SIGNAL(pressed(QString)), this, SLOT(toggle(QString))); 756 757 reargroup->addChild(m_rearright); 758 759 case 6: 760 m_lfe = new TransButtonSetting(m_channels == 6 ? "5" : 761 m_channels == 7 ? "6" : "7"); 762 m_lfe->setLabel(QObject::tr("LFE")); 763 connect(m_lfe, 764 SIGNAL(pressed(QString)), this, SLOT(toggle(QString))); 765 766 case 5: 767 m_surroundleft = new TransButtonSetting(m_channels == 6 ? "4" : 768 m_channels == 7 ? "5" : "6"); 769 m_surroundleft->setLabel(QObject::tr("Surround Left")); 770 connect(m_surroundleft, 771 SIGNAL(pressed(QString)), this, SLOT(toggle(QString))); 772 m_surroundright = new TransButtonSetting("3"); 773 m_surroundright->setLabel(QObject::tr("Surround Right")); 774 connect(m_surroundright, 775 SIGNAL(pressed(QString)), this, SLOT(toggle(QString))); 776 m_center = new TransButtonSetting("1"); 777 m_center->setLabel(QObject::tr("Center")); 778 connect(m_center, 779 SIGNAL(pressed(QString)), this, SLOT(toggle(QString))); 780 frontgroup->addChild(m_center); 781 middlegroup->addChild(m_surroundleft); 782 if (m_lfe) 783 middlegroup->addChild(m_lfe); 784 middlegroup->addChild(m_surroundright); 785 786 case 2: 787 break; 788 } 789 frontgroup->addChild(m_frontright); 790 addChild(frontgroup); 791 addChild(middlegroup); 792 addChild(reargroup); 793 addChild(m_button); 794 795 m_hd = new TransCheckBoxSetting(); 778 SIGNAL(clicked()), this, SLOT(toggle())); 779 780 m_rearleft = new ButtonStandardSetting("5"); 781 m_rearleft->setLabel(QObject::tr("Rear Left")); 782 addChild(m_rearleft); 783 connect(m_rearleft, 784 SIGNAL(clicked()), this, SLOT(toggle())); 785 786 m_rearright = new ButtonStandardSetting("4"); 787 m_rearright->setLabel(QObject::tr("Rear Right")); 788 addChild(m_rearright); 789 connect(m_rearright, 790 SIGNAL(clicked()), this, SLOT(toggle())); 791 792 m_lfe = new ButtonStandardSetting(m_channels == 6 ? "5" : 793 m_channels == 7 ? "6" : "7"); 794 m_lfe->setLabel(QObject::tr("LFE")); 795 addChild(m_lfe); 796 connect(m_lfe, 797 SIGNAL(clicked()), this, SLOT(toggle())); 798 799 m_surroundleft = new ButtonStandardSetting(m_channels == 6 ? "4" : 800 m_channels == 7 ? "5" : "6"); 801 m_surroundleft->setLabel(QObject::tr("Surround Left")); 802 addChild(m_surroundleft); 803 connect(m_surroundleft, 804 SIGNAL(clicked()), this, SLOT(toggle())); 805 806 m_surroundright = new ButtonStandardSetting("3"); 807 m_surroundright->setLabel(QObject::tr("Surround Right")); 808 addChild(m_surroundright); 809 connect(m_surroundright, 810 SIGNAL(clicked()), this, SLOT(toggle())); 811 812 m_center = new ButtonStandardSetting("1"); 813 m_center->setLabel(QObject::tr("Center")); 814 addChild(m_center); 815 connect(m_center, 816 SIGNAL(clicked()), this, SLOT(toggle())); 817 818 m_startButton = new ButtonStandardSetting("start"); 819 m_startButton->setLabel(QObject::tr("Test All")); 820 m_startButton->setHelpText(QObject::tr("Start all channels test")); 821 addChild(m_startButton); 822 connect(m_startButton, SIGNAL(clicked()), this, SLOT(toggle())); 823 824 m_hd = new TransMythUICheckBoxSetting(); 796 825 m_hd->setLabel(QObject::tr("Use Highest Quality Mode")); 797 826 m_hd->setHelpText(QObject::tr("Use the highest audio quality settings " 798 827 "supported by your audio card. This will be " … … AudioTest::AudioTest(QString main, QString passthrough, 804 833 805 834 AudioTest::~AudioTest() 806 835 { 807 m_at->cancel(); 808 m_at->wait(); 809 delete m_at; 836 if (m_at) 837 { 838 m_at->cancel(); 839 m_at->wait(); 840 delete m_at; 841 } 842 } 843 844 845 void AudioTest::UpdateCapabilities(QString main, QString passthrough, 846 int channels, AudioOutputSettings settings) 847 { 848 m_rearleft->setEnabled(m_channels>=8); 849 m_rearright->setEnabled(m_channels>=7); 850 m_lfe->setEnabled(m_channels>=6); 851 m_surroundleft->setEnabled(m_channels>=5); 852 m_surroundright->setEnabled(m_channels>=5); 853 m_center->setEnabled(m_channels>=5); 810 854 } 811 855 812 void AudioTest::toggle( QString str)856 void AudioTest::toggle() 813 857 { 814 if ( str == "start")858 if (this->sender() == m_startButton) 815 859 { 816 if (m_at->isRunning()) 817 { 818 m_at->cancel(); 819 m_button->setLabel(QObject::tr("Test All")); 820 if (m_frontleft) 821 m_frontleft->setEnabled(true); 822 if (m_frontright) 823 m_frontright->setEnabled(true); 824 if (m_center) 825 m_center->setEnabled(true); 826 if (m_surroundleft) 827 m_surroundleft->setEnabled(true); 828 if (m_surroundright) 829 m_surroundright->setEnabled(true); 830 if (m_rearleft) 831 m_rearleft->setEnabled(true); 832 if (m_rearright) 833 m_rearright->setEnabled(true); 834 if (m_lfe) 835 m_lfe->setEnabled(true); 836 } 860 if (m_at != NULL && m_at->isRunning()) 861 cancelTest(); 837 862 else 838 863 { 864 prepareTest(); 865 LOG(VB_GENERAL, LOG_ERR, QString("AudioTest::toggle() Starting all")); 839 866 m_at->setChannel(-1); 840 867 m_at->start(); 841 m_ button->setLabel(QObject::tr("Stop"));868 m_startButton->setLabel(QObject::tr("Stop")); 842 869 } 843 870 return; 844 871 } 845 if (m_at ->isRunning())872 if (m_at != NULL && m_at->isRunning()) 846 873 { 874 LOG(VB_GENERAL, LOG_ERR, QString("AudioTest::toggle() Stopping")); 847 875 m_at->cancel(); 848 876 m_at->wait(); 849 877 } 850 878 851 int channel = str.toInt(); 879 prepareTest(); 880 881 int channel=1; 882 883 if (this->sender() == m_frontleft) 884 channel=0; 885 else if (this->sender() == m_frontright) 886 channel = (m_channels == 2) ? 1 : 2; 887 else if (this->sender() == m_rearleft) 888 channel=5; 889 else if (this->sender() == m_rearright) 890 channel=4; 891 else if (this->sender() == m_lfe) 892 channel=((m_channels == 6) ? 5 :((m_channels == 7) ? 6 : 7)); 893 else if (this->sender() == m_surroundleft) 894 channel=((m_channels == 6) ? 4 : ((m_channels == 7) ? 5 : 6)); 895 else if (this->sender() == m_surroundright) 896 channel=3; 897 else if (this->sender() == m_center) 898 channel=1; 899 900 /* int channel = str.toInt();*/ 852 901 m_at->setChannel(channel); 853 902 854 903 m_at->start(); 855 904 } 856 905 906 857 907 void AudioTest::togglequality() 858 908 { 859 if (m_at->isRunning()) 909 cancelTest(); 910 m_quality = m_hd->boolValue(); 911 } 912 913 914 void AudioTest::cancelTest() 915 { 916 if (m_at !=NULL && m_at->isRunning()) 860 917 { 861 toggle("start"); 918 LOG(VB_GENERAL, LOG_ERR, QString("AudioTest::toggle() Stopping all")); 919 m_at->cancel(); 920 m_startButton->setLabel(QObject::tr("Test All")); 862 921 } 922 } 863 923 864 m_quality = m_hd->boolValue(); 865 delete m_at; 924 void AudioTest::prepareTest() 925 { 926 cancelTest(); 927 if (m_at!=NULL) 928 { 929 m_at->cancel(); 930 m_at->wait(); 931 delete m_at; 932 } 866 933 m_at = new AudioTestThread(this, m_main, m_passthrough, m_channels, 867 934 m_settings, m_quality); 868 935 if (!m_at->result().isEmpty()) 869 936 { 870 QString msg = QObject::tr("Audio device is invalid or not useable."); 871 MythPopupBox::showOkPopup( 872 GetMythMainWindow(), QObject::tr("Warning"), msg); 937 938 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 939 940 MythConfirmationDialog *mcd = new MythConfirmationDialog(mainStack, 941 QObject::tr("Audio device is invalid or not useable."), false); 942 943 if (mcd->Create()) 944 mainStack->AddScreen(mcd); 873 945 } 874 946 } 875 947 … … bool AudioTest::event(QEvent *event) 939 1011 } 940 1012 941 1013 942 AudioTestGroup::AudioTestGroup(QString main, QString passthrough, 943 int channels, AudioOutputSettings settings) 1014 HostCheckBoxSetting *AudioConfigSettings::MPCM() 944 1015 { 945 addChild(new AudioTest(main, passthrough, channels, settings)); 946 } 947 948 HostCheckBox *AudioMixerSettings::MythControlsVolume() 949 { 950 HostCheckBox *gc = new HostCheckBox("MythControlsVolume"); 951 gc->setLabel(QObject::tr("Use internal volume controls")); 952 gc->setValue(true); 953 gc->setHelpText(QObject::tr("If enabled, MythTV will control the PCM and " 954 "master mixer volume. Disable this option if you prefer " 955 "to control the volume externally (for example, using " 956 "your amplifier) or if you use an external mixer program.")); 957 return gc; 958 } 959 960 HostComboBox *AudioMixerSettings::MixerDevice() 961 { 962 HostComboBox *gc = new HostComboBox("MixerDevice", true); 963 gc->setLabel(QObject::tr("Mixer device")); 964 965 #ifdef USING_OSS 966 QDir dev("/dev", "mixer*", QDir::Name, QDir::System); 967 gc->fillSelectionsFromDir(dev); 968 969 dev.setPath("/dev/sound"); 970 if (dev.exists()) 971 { 972 gc->fillSelectionsFromDir(dev); 973 } 974 #endif 975 #ifdef USING_ALSA 976 gc->addSelection("ALSA:default", "ALSA:default"); 977 #endif 978 #ifdef USING_MINGW 979 gc->addSelection("DirectX:", "DirectX:"); 980 gc->addSelection("Windows:", "Windows:"); 981 #endif 982 #if !defined(USING_MINGW) 983 gc->addSelection("software", "software"); 984 gc->setHelpText(QObject::tr("Setting the mixer device to \"software\" " 985 "lets MythTV control the volume of all audio at the " 986 "expense of a slight quality loss.")); 987 #endif 988 989 return gc; 990 } 991 992 const char* AudioMixerSettings::MixerControlControls[] = { "PCM", 993 "Master" }; 994 995 HostComboBox *AudioMixerSettings::MixerControl() 996 { 997 HostComboBox *gc = new HostComboBox("MixerControl", true); 998 gc->setLabel(QObject::tr("Mixer controls")); 999 for (unsigned int i = 0; i < sizeof(MixerControlControls) / sizeof(char*); 1000 ++i) 1001 { 1002 gc->addSelection(QObject::tr(MixerControlControls[i]), 1003 MixerControlControls[i]); 1004 } 1005 1006 gc->setHelpText(QObject::tr("Changing the volume adjusts the selected mixer.")); 1007 return gc; 1008 } 1009 1010 HostSlider *AudioMixerSettings::MixerVolume() 1011 { 1012 HostSlider *gs = new HostSlider("MasterMixerVolume", 0, 100, 1); 1013 gs->setLabel(QObject::tr("Master mixer volume")); 1014 gs->setValue(70); 1015 gs->setHelpText(QObject::tr("Initial volume for the Master mixer. " 1016 "This affects all sound created by the audio device. " 1017 "Note: Do not set this too low.")); 1018 return gs; 1019 } 1020 1021 HostSlider *AudioMixerSettings::PCMVolume() 1022 { 1023 HostSlider *gs = new HostSlider("PCMMixerVolume", 0, 100, 1); 1024 gs->setLabel(QObject::tr("PCM mixer volume")); 1025 gs->setValue(70); 1026 gs->setHelpText(QObject::tr("Initial volume for PCM output. Using the " 1027 "volume keys in MythTV will adjust this parameter.")); 1028 return gs; 1029 } 1030 1031 AudioMixerSettings::AudioMixerSettings() : 1032 TriggeredConfigurationGroup(false, true, false, false) 1033 { 1034 setLabel(QObject::tr("Audio Mixer")); 1035 setUseLabel(false); 1036 1037 Setting *volumeControl = MythControlsVolume(); 1038 addChild(volumeControl); 1039 1040 // Mixer settings 1041 ConfigurationGroup *settings = 1042 new VerticalConfigurationGroup(false, true, false, false); 1043 settings->addChild(MixerDevice()); 1044 settings->addChild(MixerControl()); 1045 settings->addChild(MixerVolume()); 1046 settings->addChild(PCMVolume()); 1047 1048 ConfigurationGroup *dummy = 1049 new VerticalConfigurationGroup(false, true, false, false); 1050 1051 // Show Mixer config only if internal volume controls enabled 1052 setTrigger(volumeControl); 1053 addTarget("0", dummy); 1054 addTarget("1", settings); 1055 } 1056 1057 AudioGeneralSettings::AudioGeneralSettings() 1058 { 1059 addChild(new AudioConfigSettings(this)); 1060 addChild(new AudioMixerSettings()); 1061 } 1062 1063 HostCheckBox *AudioAdvancedSettings::MPCM() 1064 { 1065 HostCheckBox *gc = new HostCheckBox("StereoPCM"); 1016 HostCheckBoxSetting *gc = new HostCheckBoxSetting("StereoPCM"); 1066 1017 gc->setLabel(QObject::tr("Stereo PCM Only")); 1067 1018 gc->setValue(false); 1068 1019 gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder " … … HostCheckBox *AudioAdvancedSettings::MPCM() 1072 1023 return gc; 1073 1024 } 1074 1025 1075 HostCheckBox *AudioAdvancedSettings::SRCQualityOverride()1026 HostCheckBoxSetting *AudioConfigSettings::SRCQualityOverride() 1076 1027 { 1077 HostCheckBox *gc = new HostCheckBox("SRCQualityOverride");1028 HostCheckBoxSetting *gc = new HostCheckBoxSetting("SRCQualityOverride"); 1078 1029 gc->setLabel(QObject::tr("Override SRC quality")); 1079 1030 gc->setValue(false); 1080 1031 gc->setHelpText(QObject::tr("Enable to override audio sample rate " … … HostCheckBox *AudioAdvancedSettings::SRCQualityOverride() 1082 1033 return gc; 1083 1034 } 1084 1035 1085 HostComboBox *AudioAdvancedSettings::SRCQuality()1036 HostComboBoxSetting *AudioConfigSettings::SRCQuality() 1086 1037 { 1087 HostComboBox *gc = new HostComboBox("SRCQuality", false);1038 HostComboBoxSetting *gc = new HostComboBoxSetting("SRCQuality", false); 1088 1039 gc->setLabel(QObject::tr("Sample rate conversion")); 1089 1040 gc->addSelection(QObject::tr("Disabled"), "-1"); 1090 1041 gc->addSelection(QObject::tr("Fastest"), "0"); … … HostComboBox *AudioAdvancedSettings::SRCQuality() 1097 1048 return gc; 1098 1049 } 1099 1050 1100 HostCheckBox *AudioAdvancedSettings::Audio48kOverride()1051 HostCheckBoxSetting *AudioConfigSettings::Audio48kOverride() 1101 1052 { 1102 HostCheckBox *gc = new HostCheckBox("Audio48kOverride");1053 HostCheckBoxSetting *gc = new HostCheckBoxSetting("Audio48kOverride"); 1103 1054 gc->setLabel(QObject::tr("Force audio device output to 48kHz")); 1104 1055 gc->setValue(false); 1105 1056 gc->setHelpText(QObject::tr("Force audio sample rate to 48kHz. " … … HostCheckBox *AudioAdvancedSettings::Audio48kOverride() 1108 1059 return gc; 1109 1060 } 1110 1061 1111 HostCheckBox *AudioAdvancedSettings::PassThroughOverride()1062 HostCheckBoxSetting *AudioConfigSettings::PassThroughOverride() 1112 1063 { 1113 HostCheckBox *gc = new HostCheckBox("PassThruDeviceOverride");1064 HostCheckBoxSetting *gc = new HostCheckBoxSetting("PassThruDeviceOverride"); 1114 1065 gc->setLabel(QObject::tr("Separate digital output device")); 1115 1066 gc->setValue(false); 1116 1067 gc->setHelpText(QObject::tr("Use a distinct digital output device from " … … HostCheckBox *AudioAdvancedSettings::PassThroughOverride() 1119 1070 return gc; 1120 1071 } 1121 1072 1122 HostComboBox *AudioAdvancedSettings::PassThroughOutputDevice()1073 HostComboBoxSetting *AudioConfigSettings::PassThroughOutputDevice() 1123 1074 { 1124 HostComboBox *gc = new HostComboBox("PassThruOutputDevice", true);1075 HostComboBoxSetting *gc = new HostComboBoxSetting("PassThruOutputDevice", true); 1125 1076 1126 1077 gc->setLabel(QObject::tr("Digital output device")); 1127 gc->addSelection(QObject::tr("Default"), "Default"); 1078 //TODO Is default not equivalent to PassThroughOverride off? if so PassThruDeviceOverride dsetting could be removed 1079 gc->addSelection(QObject::tr("Default"), "Default"); 1128 1080 #ifdef USING_MINGW 1129 1081 gc->addSelection("DirectX:Primary Sound Driver"); 1130 1082 #else … … HostComboBox *AudioAdvancedSettings::PassThroughOutputDevice() 1140 1092 return gc; 1141 1093 } 1142 1094 1143 HostCheckBox *AudioAdvancedSettings::SPDIFRateOverride()1095 HostCheckBoxSetting *AudioConfigSettings::SPDIFRateOverride() 1144 1096 { 1145 HostCheckBox *gc = new HostCheckBox("SPDIFRateOverride");1097 HostCheckBoxSetting *gc = new HostCheckBoxSetting("SPDIFRateOverride"); 1146 1098 gc->setLabel(QObject::tr("SPDIF 48kHz rate override")); 1147 1099 gc->setValue(false); 1148 1100 gc->setHelpText(QObject::tr("ALSA only. By default, let ALSA determine " … … HostCheckBox *AudioAdvancedSettings::SPDIFRateOverride() 1152 1104 return gc; 1153 1105 } 1154 1106 1155 HostCheckBox *AudioAdvancedSettings::HBRPassthrough()1107 HostCheckBoxSetting *AudioConfigSettings::HBRPassthrough() 1156 1108 { 1157 HostCheckBox *gc = new HostCheckBox("HBRPassthru");1109 HostCheckBoxSetting *gc = new HostCheckBoxSetting("HBRPassthru"); 1158 1110 gc->setLabel(QObject::tr("HBR passthrough support")); 1159 1111 gc->setValue(true); 1160 1112 gc->setHelpText(QObject::tr("HBR support is required for TrueHD and DTS-HD " … … HostCheckBox *AudioAdvancedSettings::HBRPassthrough() 1166 1118 return gc; 1167 1119 } 1168 1120 1169 AudioAdvancedSettings::AudioAdvancedSettings(bool mpcm) 1170 { 1171 ConfigurationGroup *settings3 = 1172 new HorizontalConfigurationGroup(false, false); 1173 1174 m_PassThroughOverride = PassThroughOverride(); 1175 TriggeredItem *sub3 = 1176 new TriggeredItem(m_PassThroughOverride, PassThroughOutputDevice()); 1177 settings3->addChild(m_PassThroughOverride); 1178 settings3->addChild(sub3); 1179 1180 ConfigurationGroup *settings4 = 1181 new HorizontalConfigurationGroup(false, false); 1182 Setting *srcqualityoverride = SRCQualityOverride(); 1183 TriggeredItem *sub4 = 1184 new TriggeredItem(srcqualityoverride, SRCQuality()); 1185 settings4->addChild(srcqualityoverride); 1186 settings4->addChild(sub4); 1187 1188 ConfigurationGroup *settings5 = 1189 new HorizontalConfigurationGroup(false, false); 1190 settings5->addChild(Audio48kOverride()); 1191 #if USING_ALSA 1192 settings5->addChild(SPDIFRateOverride()); 1193 #endif 1194 1195 ConfigurationGroup *settings6 = 1196 new HorizontalConfigurationGroup(false, false); 1197 settings6->addChild(HBRPassthrough()); 1198 1199 addChild(settings4); 1200 addChild(settings5); 1201 addChild(settings3); 1202 addChild(settings6); 1203 1204 if (mpcm) 1205 { 1206 ConfigurationGroup *settings7; 1207 settings7 = new HorizontalConfigurationGroup(false, false); 1208 settings7->addChild(MPCM()); 1209 addChild(settings7); 1210 } 1211 } 1212 1213 AudioAdvancedSettingsGroup::AudioAdvancedSettingsGroup(bool mpcm) 1121 void AudioConfigSettings::setMPCMEnabled(bool flag) 1214 1122 { 1215 addChild(new AudioAdvancedSettings(mpcm));1123 m_MPCM->setEnabled(flag); 1216 1124 } 1217 1125 // vim:set sw=4 ts=4 expandtab: -
mythtv/programs/mythfrontend/audiogeneralsettings.h
diff --git a/mythtv/programs/mythfrontend/audiogeneralsettings.h b/mythtv/programs/mythfrontend/audiogeneralsettings.h index fe31bd8..b9522e8 100644
a b 11 11 #include "mythuibutton.h" 12 12 #include "audiooutput.h" 13 13 #include "mythcontext.h" 14 #include "s ettings.h"14 #include "standardsettings.h" 15 15 #include "mthread.h" 16 16 17 17 class AudioDeviceComboBox; 18 class AudioAdvancedSettings; 19 class AudioTest; 18 20 19 class AudioConfigSettings : public VerticalConfigurationGroup21 class AudioConfigSettings : public GroupSetting 20 22 { 21 23 Q_OBJECT 22 24 23 25 public: 24 AudioConfigSettings( ConfigurationWizard *);26 AudioConfigSettings(); 25 27 26 28 typedef QMap<QString,AudioOutput::AudioDeviceConfig> ADCMap; 27 29 … … class AudioConfigSettings : public VerticalConfigurationGroup 29 31 AudioOutput::ADCVect &AudioDeviceVect(void) { return devices; }; 30 32 31 33 private slots: 32 void UpdateVisibility( const QString&);33 AudioOutputSettings UpdateCapabilities( const QString&);34 void UpdateVisibility(StandardSetting *); 35 AudioOutputSettings UpdateCapabilities(StandardSetting *); 34 36 void AudioRescan(); 35 void AudioAdvanced(); 36 void StartAudioTest(); 37 void UpdateAudioTest(); 37 38 38 39 private: 40 void setMPCMEnabled(bool flag); 41 39 42 AudioDeviceComboBox *OutputDevice(); 40 HostComboBox *MaxAudioChannels(); 41 HostCheckBox *AudioUpmix(); 42 HostComboBox *AudioUpmixType(); 43 HostCheckBox *AC3PassThrough(); 44 HostCheckBox *DTSPassThrough(); 45 HostCheckBox *EAC3PassThrough(); 46 HostCheckBox *TrueHDPassThrough(); 47 HostCheckBox *DTSHDPassThrough(); 48 bool CheckPassthrough(); 49 50 ConfigurationGroup *m_cgsettings; 43 HostComboBoxSetting *MaxAudioChannels(); 44 HostCheckBoxSetting *AudioUpmix(); 45 HostComboBoxSetting *AudioUpmixType(); 46 HostCheckBoxSetting *AC3PassThrough(); 47 HostCheckBoxSetting *DTSPassThrough(); 48 HostCheckBoxSetting *EAC3PassThrough(); 49 HostCheckBoxSetting *TrueHDPassThrough(); 50 HostCheckBoxSetting *DTSHDPassThrough(); 51 HostCheckBoxSetting *MythControlsVolume(); 52 HostComboBoxSetting *MixerDevice(); 53 HostComboBoxSetting *MixerControl(); 54 HostSpinBoxSetting *MixerVolume(); 55 HostSpinBoxSetting *PCMVolume(); 56 57 //advanced setting 58 HostCheckBoxSetting *MPCM(); 59 HostCheckBoxSetting *SRCQualityOverride(); 60 HostComboBoxSetting *SRCQuality(); 61 HostCheckBoxSetting *Audio48kOverride(); 62 HostCheckBoxSetting *PassThroughOverride(); 63 HostComboBoxSetting *PassThroughOutputDevice(); 64 HostCheckBoxSetting *SPDIFRateOverride(); 65 HostCheckBoxSetting *HBRPassthrough(); 66 67 bool CheckPassthrough(); 68 51 69 AudioDeviceComboBox *m_OutputDevice; 52 HostComboBox *m_MaxAudioChannels; 53 HostCheckBox *m_AudioUpmix; 54 HostComboBox *m_AudioUpmixType; 55 CheckBoxSetting *m_triggerDigital; 56 HostCheckBox *m_AC3PassThrough; 57 HostCheckBox *m_DTSPassThrough; 58 HostCheckBox *m_EAC3PassThrough; 59 HostCheckBox *m_TrueHDPassThrough; 60 HostCheckBox *m_DTSHDPassThrough; 70 HostComboBoxSetting *m_MaxAudioChannels; 71 HostCheckBoxSetting *m_AudioUpmix; 72 HostComboBoxSetting *m_AudioUpmixType; 73 74 // digital settings 75 GroupSetting *m_triggerDigital; 76 HostCheckBoxSetting *m_AC3PassThrough; 77 HostCheckBoxSetting *m_DTSPassThrough; 78 HostCheckBoxSetting *m_EAC3PassThrough; 79 HostCheckBoxSetting *m_TrueHDPassThrough; 80 HostCheckBoxSetting *m_DTSHDPassThrough; 81 //advanced setting 82 HostCheckBoxSetting *m_MPCM; 83 HostCheckBoxSetting *m_PassThroughOverride; 84 HostComboBoxSetting *m_PassThroughDeviceOverride; 85 86 AudioTest *m_audioTest; 87 61 88 ADCMap audiodevs; 62 89 AudioOutput::ADCVect devices; 63 90 QMutex slotlock; 64 ConfigurationWizard *m_parent; 91 65 92 }; 66 93 67 class AudioDeviceComboBox : public HostComboBox 94 class AudioDeviceComboBox : public HostComboBoxSetting 68 95 { 69 96 Q_OBJECT 70 97 public: 71 98 AudioDeviceComboBox(AudioConfigSettings*); 72 99 void AudioRescan(); 73 100 101 virtual void edit(MythScreenType * screen); 102 74 103 private slots: 75 void AudioDescriptionHelp( const QString&);104 void AudioDescriptionHelp(StandardSetting * setting); 76 105 77 106 private: 78 107 AudioConfigSettings *m_parent; 79 108 }; 80 81 class AudioMixerSettings : public TriggeredConfigurationGroup109 /* 110 class AudioMixerSettings : public GroupSetting 82 111 { 83 112 public: 84 113 AudioMixerSettings(); 85 114 private: 86 HostCheckBox *MythControlsVolume(); 87 HostComboBox *MixerDevice(); 88 HostComboBox *MixerControl(); 89 HostSlider *MixerVolume(); 90 HostSlider *PCMVolume(); 91 static const char *MixerControlControls[]; 92 }; 93 94 class AudioGeneralSettings : public ConfigurationWizard 95 { 96 public: 97 AudioGeneralSettings(); 98 }; 99 100 class AudioAdvancedSettings : public VerticalConfigurationGroup 101 { 102 public: 103 AudioAdvancedSettings(bool mpcm); 104 105 HostCheckBox *MPCM(); 106 HostCheckBox *SRCQualityOverride(); 107 HostComboBox *SRCQuality(); 108 HostCheckBox *Audio48kOverride(); 109 HostCheckBox *PassThroughOverride(); 110 HostComboBox *PassThroughOutputDevice(); 111 HostCheckBox *SPDIFRateOverride(); 112 HostCheckBox *HBRPassthrough(); 113 114 CheckBoxSetting *m_triggerMPCM; 115 HostCheckBox *m_MPCM; 116 HostCheckBox *m_PassThroughOverride; 117 }; 118 119 class AudioAdvancedSettingsGroup : public ConfigurationWizard 120 { 121 public: 122 AudioAdvancedSettingsGroup(bool mpcm); 123 }; 124 125 class AudioTestGroup : public ConfigurationWizard 126 { 127 public: 128 AudioTestGroup(QString main, QString passthrough, 129 int channels, AudioOutputSettings settings); 130 }; 115 HostCheckBoxSetting *MythControlsVolume(); 116 HostComboBoxSetting *MixerDevice(); 117 HostComboBoxSetting *MixerControl(); 118 HostSpinBoxSetting *MixerVolume(); 119 HostSpinBoxSetting *PCMVolume(); 120 static const char *MixerControlControls[]; 121 };*/ 131 122 132 123 class ChannelChangedEvent : public QEvent 133 124 { … … class AudioTestThread : public MThread 170 161 AudioFormat m_format; 171 162 }; 172 163 173 class AudioTest : public VerticalConfigurationGroup164 class AudioTest : public GroupSetting 174 165 { 175 166 Q_OBJECT 176 167 public: 177 AudioTest( QString main, QString passthrough,178 int channels, AudioOutputSettings settings );168 AudioTest(/*QString main, QString passthrough, 169 int channels, AudioOutputSettings settings*/); 179 170 ~AudioTest(); 171 // m_audioTest->UpdateCapabilities(out, passthrough, channels, settings); 172 void UpdateCapabilities(QString main, QString passthrough, 173 int channels, AudioOutputSettings settings); 180 174 bool event(QEvent *event); 181 175 182 176 private: 183 int m_channels;184 TransButtonSetting*m_frontleft;185 TransButtonSetting*m_frontright;186 TransButtonSetting*m_center;187 TransButtonSetting*m_surroundleft;188 TransButtonSetting*m_surroundright;189 TransButtonSetting*m_rearleft;190 TransButtonSetting*m_rearright;191 TransButtonSetting*m_lfe;192 AudioTestThread *m_at;193 TransButtonSetting *m_button;194 Trans CheckBoxSetting*m_hd;195 QString m_main;196 QString m_passthrough;197 AudioOutputSettings m_settings;198 bool m_quality;177 int m_channels; 178 ButtonStandardSetting *m_frontleft; 179 ButtonStandardSetting *m_frontright; 180 ButtonStandardSetting *m_center; 181 ButtonStandardSetting *m_surroundleft; 182 ButtonStandardSetting *m_surroundright; 183 ButtonStandardSetting *m_rearleft; 184 ButtonStandardSetting *m_rearright; 185 ButtonStandardSetting *m_lfe; 186 AudioTestThread *m_at; 187 ButtonStandardSetting *m_startButton; 188 TransMythUICheckBoxSetting *m_hd; 189 QString m_main; 190 QString m_passthrough; 191 AudioOutputSettings m_settings; 192 bool m_quality; 199 193 200 194 private slots: 201 void toggle( QString str);195 void toggle(); 202 196 void togglequality(void); 197 void cancelTest(); 198 void prepareTest(); 203 199 }; 204 200 #endif -
mythtv/programs/mythfrontend/globalsettings.cpp
diff --git a/mythtv/programs/mythfrontend/globalsettings.cpp b/mythtv/programs/mythfrontend/globalsettings.cpp index 2a5ae68..db80603 100644
a b 3 3 4 4 // Standard UNIX C headers 5 5 #include <unistd.h> 6 #include <cmath> 6 7 #include <fcntl.h> 7 8 #include <sys/types.h> 8 9 #include <sys/stat.h> … … 39 40 #include "mythdirs.h" 40 41 #include "mythuihelper.h" 41 42 42 static HostCheckBox *DecodeExtraAudio() 43 //Use for playBackGroup, to be remove at one point 44 #include "playgroup.h" 45 46 static HostCheckBoxSetting *DecodeExtraAudio() 43 47 { 44 HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");48 HostCheckBoxSetting *gc = new HostCheckBoxSetting("DecodeExtraAudio"); 45 49 gc->setLabel(QObject::tr("Extra audio buffering")); 46 50 gc->setValue(true); 47 51 gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing " … … static HostCheckBox *DecodeExtraAudio() 53 57 return gc; 54 58 } 55 59 56 static HostComboBox *PIPLocationComboBox()60 static HostComboBoxSetting *PIPLocationComboBox() 57 61 { 58 HostComboBox *gc = new HostComboBox("PIPLocation");62 HostComboBoxSetting *gc = new HostComboBoxSetting("PIPLocation"); 59 63 gc->setLabel(QObject::tr("PIP video location")); 60 64 for (uint loc = 0; loc < kPIP_END; ++loc) 61 65 gc->addSelection(toString((PIPLocation) loc), QString::number(loc)); … … static HostComboBox *PIPLocationComboBox() 63 67 return gc; 64 68 } 65 69 66 static HostComboBox *DisplayRecGroup()70 static HostComboBoxSetting *DisplayRecGroup() 67 71 { 68 HostComboBox *gc = new HostComboBox("DisplayRecGroup");72 HostComboBoxSetting *gc = new HostComboBoxSetting("DisplayRecGroup"); 69 73 gc->setLabel(QObject::tr("Default group filter to apply")); 70 74 71 75 gc->addSelection(QObject::tr("All Programs"), QString("All Programs")); … … static HostComboBox *DisplayRecGroup() 99 103 100 104 gc->setHelpText(QObject::tr("Default group filter to apply " 101 105 "on the View Recordings screen.")); 106 102 107 return gc; 103 108 } 104 109 105 static HostCheckBox *QueryInitialFilter()110 static HostCheckBoxSetting *QueryInitialFilter() 106 111 { 107 HostCheckBox *gc = new HostCheckBox("QueryInitialFilter");112 HostCheckBoxSetting *gc = new HostCheckBoxSetting("QueryInitialFilter"); 108 113 gc->setLabel(QObject::tr("Always prompt for initial group filter")); 109 114 gc->setValue(false); 110 115 gc->setHelpText(QObject::tr("If enabled, always prompt the user for the " … … static HostCheckBox *QueryInitialFilter() 113 118 return gc; 114 119 } 115 120 116 static HostCheckBox *RememberRecGroup()121 static HostCheckBoxSetting *RememberRecGroup() 117 122 { 118 HostCheckBox *gc = new HostCheckBox("RememberRecGroup");123 HostCheckBoxSetting *gc = new HostCheckBoxSetting("RememberRecGroup"); 119 124 gc->setLabel(QObject::tr("Save current group filter when changed")); 120 125 gc->setValue(true); 121 126 gc->setHelpText(QObject::tr("If enabled, remember the last selected filter " … … static HostCheckBox *RememberRecGroup() 124 129 return gc; 125 130 } 126 131 127 static HostCheckBox *UseGroupNameAsAllPrograms()132 static HostCheckBoxSetting *UseGroupNameAsAllPrograms() 128 133 { 129 HostCheckBox *gc = new HostCheckBox("DispRecGroupAsAllProg");134 HostCheckBoxSetting *gc = new HostCheckBoxSetting("DispRecGroupAsAllProg"); 130 135 gc->setLabel(QObject::tr("Show filter name instead of \"All Programs\"")); 131 136 gc->setValue(false); 132 137 gc->setHelpText(QObject::tr("If enabled, use the name of the display " … … static HostCheckBox *UseGroupNameAsAllPrograms() 135 140 return gc; 136 141 } 137 142 138 static HostCheckBox *PBBStartInTitle()143 static HostCheckBoxSetting *PBBStartInTitle() 139 144 { 140 HostCheckBox *gc = new HostCheckBox("PlaybackBoxStartInTitle");145 HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackBoxStartInTitle"); 141 146 gc->setLabel(QObject::tr("Start in group list")); 142 147 gc->setValue(true); 143 148 gc->setHelpText(QObject::tr("If enabled, the focus will " … … static HostCheckBox *PBBStartInTitle() 146 151 return gc; 147 152 } 148 153 149 static HostCheckBox *SmartForward()154 static HostCheckBoxSetting *SmartForward() 150 155 { 151 HostCheckBox *gc = new HostCheckBox("SmartForward");156 HostCheckBoxSetting *gc = new HostCheckBoxSetting("SmartForward"); 152 157 gc->setLabel(QObject::tr("Smart fast forwarding")); 153 158 gc->setValue(false); 154 159 gc->setHelpText(QObject::tr("If enabled, then immediately after " … … static HostCheckBox *SmartForward() 157 162 return gc; 158 163 } 159 164 160 static HostCheckBox *ExactSeeking()165 static HostCheckBoxSetting *ExactSeeking() 161 166 { 162 HostCheckBox *gc = new HostCheckBox("ExactSeeking");167 HostCheckBoxSetting *gc = new HostCheckBoxSetting("ExactSeeking"); 163 168 gc->setLabel(QObject::tr("Seek to exact frame")); 164 169 gc->setValue(false); 165 170 gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but " … … static HostCheckBox *ExactSeeking() 167 172 return gc; 168 173 } 169 174 170 static GlobalComboBox *CommercialSkipMethod()175 static GlobalComboBoxSetting *CommercialSkipMethod() 171 176 { 172 GlobalComboBox *bc = new GlobalComboBox("CommercialSkipMethod");177 GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("CommercialSkipMethod"); 173 178 bc->setLabel(QObject::tr("Commercial detection method")); 174 179 bc->setHelpText(QObject::tr( 175 180 "This determines the method used by MythTV to " … … static GlobalComboBox *CommercialSkipMethod() 182 187 return bc; 183 188 } 184 189 185 static GlobalCheckBox *CommFlagFast()190 static GlobalCheckBoxSetting *CommFlagFast() 186 191 { 187 GlobalCheckBox *gc = new GlobalCheckBox("CommFlagFast");192 GlobalCheckBoxSetting *gc = new GlobalCheckBoxSetting("CommFlagFast"); 188 193 gc->setLabel(QObject::tr("Enable experimental speedup of commercial detection")); 189 194 gc->setValue(false); 190 195 gc->setHelpText(QObject::tr("If enabled, experimental commercial detection " … … static GlobalCheckBox *CommFlagFast() 192 197 return gc; 193 198 } 194 199 195 static HostComboBox *AutoCommercialSkip()200 static HostComboBoxSetting *AutoCommercialSkip() 196 201 { 197 HostComboBox *gc = new HostComboBox("AutoCommercialSkip");202 HostComboBoxSetting *gc = new HostComboBoxSetting("AutoCommercialSkip"); 198 203 gc->setLabel(QObject::tr("Automatically skip commercials")); 199 204 gc->addSelection(QObject::tr("Off"), "0"); 200 205 gc->addSelection(QObject::tr("Notify, but do not skip"), "2"); … … static HostComboBox *AutoCommercialSkip() 206 211 return gc; 207 212 } 208 213 209 static GlobalCheckBox *AutoMetadataLookup()214 static GlobalCheckBoxSetting *AutoMetadataLookup() 210 215 { 211 GlobalCheckBox *bc = new GlobalCheckBox("AutoMetadataLookup");216 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoMetadataLookup"); 212 217 bc->setLabel(QObject::tr("Run metadata lookup")); 213 218 bc->setValue(true); 214 219 bc->setHelpText(QObject::tr("This is the default value used for the " … … static GlobalCheckBox *AutoMetadataLookup() 217 222 return bc; 218 223 } 219 224 220 static GlobalCheckBox *AutoCommercialFlag()225 static GlobalCheckBoxSetting *AutoCommercialFlag() 221 226 { 222 GlobalCheckBox *bc = new GlobalCheckBox("AutoCommercialFlag");227 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoCommercialFlag"); 223 228 bc->setLabel(QObject::tr("Run commercial detection")); 224 229 bc->setValue(true); 225 230 bc->setHelpText(QObject::tr("This is the default value used for the " … … static GlobalCheckBox *AutoCommercialFlag() 228 233 return bc; 229 234 } 230 235 231 static GlobalCheckBox *AutoTranscode()236 static GlobalCheckBoxSetting *AutoTranscode() 232 237 { 233 GlobalCheckBox *bc = new GlobalCheckBox("AutoTranscode");238 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoTranscode"); 234 239 bc->setLabel(QObject::tr("Run transcoder")); 235 240 bc->setValue(false); 236 241 bc->setHelpText(QObject::tr("This is the default value used for the " … … static GlobalCheckBox *AutoTranscode() 239 244 return bc; 240 245 } 241 246 242 static GlobalComboBox *DefaultTranscoder() 247 /*TODO This function is borrowed from RecordingProfile::fillSelections and sligthly modified 248 I will need to change the original to use a pure abstract class instead of SelectSetting 249 */ 250 static void RecordingProfile_fillSelections(MythUIComboBoxSetting *setting, int group, 251 bool foldautodetect) 252 { 253 if (!group) 254 { 255 for (uint i = 0; !availProfiles[i].isEmpty(); i++) 256 setting->addSelection(availProfiles[i], availProfiles[i]); 257 return; 258 } 259 260 MSqlQuery result(MSqlQuery::InitCon()); 261 result.prepare( 262 "SELECT name, id " 263 "FROM recordingprofiles " 264 "WHERE profilegroup = :GROUP " 265 "ORDER BY id"); 266 result.bindValue(":GROUP", group); 267 268 if (!result.exec()) 269 { 270 MythDB::DBError("RecordingProfile::fillSelections 1", result); 271 return; 272 } 273 else if (!result.next()) 274 { 275 return; 276 } 277 278 if (group == RecordingProfile::TranscoderGroup && foldautodetect) 279 { 280 QString id = QString::number(RecordingProfile::TranscoderAutodetect); 281 setting->addSelection(QObject::tr("Autodetect"), id); 282 } 283 284 do 285 { 286 QString name = result.value(0).toString(); 287 QString id = result.value(1).toString(); 288 289 if (group == RecordingProfile::TranscoderGroup) 290 { 291 if (name == "RTjpeg/MPEG4" || name == "MPEG2") 292 { 293 if (!foldautodetect) 294 { 295 setting->addSelection( 296 QObject::tr("Autodetect from %1").arg(name), id); 297 } 298 } 299 else 300 { 301 setting->addSelection(name, id); 302 } 303 continue; 304 } 305 306 setting->addSelection(name, id); 307 } 308 while (result.next()); 309 } 310 311 static GlobalComboBoxSetting *DefaultTranscoder() 243 312 { 244 GlobalComboBox *bc = new GlobalComboBox("DefaultTranscoder");313 GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("DefaultTranscoder"); 245 314 bc->setLabel(QObject::tr("Default transcoder")); 246 RecordingProfile ::fillSelections(bc, RecordingProfile::TranscoderGroup,315 RecordingProfile_fillSelections(bc, RecordingProfile::TranscoderGroup, 247 316 true); 317 248 318 bc->setHelpText(QObject::tr("This is the default value used for the " 249 319 "transcoder setting when a new scheduled " 250 320 "recording is created.")); 251 321 return bc; 252 322 } 253 323 254 static GlobalSpinBox *DeferAutoTranscodeDays()324 static GlobalSpinBoxSetting *DeferAutoTranscodeDays() 255 325 { 256 GlobalSpinBox *gs = new GlobalSpinBox("DeferAutoTranscodeDays", 0, 365, 1);326 GlobalSpinBoxSetting *gs = new GlobalSpinBoxSetting("DeferAutoTranscodeDays", 0, 365, 1); 257 327 gs->setLabel(QObject::tr("Deferral days for auto transcode jobs")); 258 328 gs->setHelpText(QObject::tr("If non-zero, automatic transcode jobs will " 259 329 "be scheduled to run this many days after a recording " … … static GlobalSpinBox *DeferAutoTranscodeDays() 262 332 return gs; 263 333 } 264 334 265 static GlobalCheckBox *AutoRunUserJob(uint job_num)335 static GlobalCheckBoxSetting *AutoRunUserJob(uint job_num) 266 336 { 267 337 QString dbStr = QString("AutoRunUserJob%1").arg(job_num); 268 338 QString label = QObject::tr("Run user job #%1") 269 339 .arg(job_num); 270 GlobalCheckBox *bc = new GlobalCheckBox(dbStr);340 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting(dbStr); 271 341 bc->setLabel(label); 272 342 bc->setValue(false); 273 343 bc->setHelpText(QObject::tr("This is the default value used for the " … … static GlobalCheckBox *AutoRunUserJob(uint job_num) 278 348 return bc; 279 349 } 280 350 281 static GlobalCheckBox *AggressiveCommDetect()351 static GlobalCheckBoxSetting *AggressiveCommDetect() 282 352 { 283 GlobalCheckBox *bc = new GlobalCheckBox("AggressiveCommDetect");353 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AggressiveCommDetect"); 284 354 bc->setLabel(QObject::tr("Strict commercial detection")); 285 355 bc->setValue(true); 286 356 bc->setHelpText(QObject::tr("Enable stricter commercial detection code. " … … static GlobalCheckBox *AggressiveCommDetect() 288 358 return bc; 289 359 } 290 360 291 static HostSpinBox *CommRewindAmount()361 static HostSpinBoxSetting *CommRewindAmount() 292 362 { 293 HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);363 HostSpinBoxSetting *gs = new HostSpinBoxSetting("CommRewindAmount", 0, 10, 1); 294 364 gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)")); 295 365 gs->setHelpText(QObject::tr("MythTV will automatically rewind " 296 366 "this many seconds after performing a commercial skip.")); … … static HostSpinBox *CommRewindAmount() 298 368 return gs; 299 369 } 300 370 301 static HostSpinBox *CommNotifyAmount()371 static HostSpinBoxSetting *CommNotifyAmount() 302 372 { 303 HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);373 HostSpinBoxSetting *gs = new HostSpinBoxSetting("CommNotifyAmount", 0, 10, 1); 304 374 gs->setLabel(QObject::tr("Commercial skip notify amount (secs)")); 305 375 gs->setHelpText(QObject::tr("MythTV will act like a commercial " 306 376 "begins this many seconds early. This can be useful " … … static HostSpinBox *CommNotifyAmount() 310 380 return gs; 311 381 } 312 382 313 static GlobalSpinBox *MaximumCommercialSkip()383 static GlobalSpinBoxSetting *MaximumCommercialSkip() 314 384 { 315 GlobalSpinBox *bs = new GlobalSpinBox("MaximumCommercialSkip", 0, 3600, 10);385 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("MaximumCommercialSkip", 0, 3600, 10); 316 386 bs->setLabel(QObject::tr("Maximum commercial skip (secs)")); 317 387 bs->setHelpText(QObject::tr("MythTV will discourage long manual commercial " 318 388 "skips. Skips which are longer than this will require the " … … static GlobalSpinBox *MaximumCommercialSkip() 322 392 return bs; 323 393 } 324 394 325 static GlobalSpinBox *MergeShortCommBreaks()395 static GlobalSpinBoxSetting *MergeShortCommBreaks() 326 396 { 327 GlobalSpinBox *bs = new GlobalSpinBox("MergeShortCommBreaks", 0, 3600, 5);397 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("MergeShortCommBreaks", 0, 3600, 5); 328 398 bs->setLabel(QObject::tr("Merge short commercial breaks (secs)")); 329 399 bs->setHelpText(QObject::tr("Treat consecutive commercial breaks shorter " 330 400 "than this as one break when skipping forward. Useful if " … … static GlobalSpinBox *MergeShortCommBreaks() 334 404 return bs; 335 405 } 336 406 337 static GlobalSpinBox *AutoExpireExtraSpace() 407 408 static GlobalSpinBoxSetting *AutoExpireExtraSpace() 338 409 { 339 GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireExtraSpace", 0, 200, 1);410 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AutoExpireExtraSpace", 0, 200, 1); 340 411 bs->setLabel(QObject::tr("Extra disk space (GB)")); 341 412 bs->setHelpText(QObject::tr("Extra disk space (in gigabytes) beyond what " 342 413 "MythTV requires that you want to keep free on the " … … static GlobalSpinBox *AutoExpireExtraSpace() 345 416 return bs; 346 417 }; 347 418 348 #if 0 349 static GlobalCheckBox *AutoExpireInsteadOfDelete() 350 { 351 GlobalCheckBox *cb = new GlobalCheckBox("AutoExpireInsteadOfDelete"); 352 cb->setLabel(QObject::tr("Auto-Expire instead of delete recording")); 353 cb->setValue(false); 354 cb->setHelpText(QObject::tr("If enabled, move deleted recordings to the " 355 "'Deleted' recgroup and turn on autoexpire " 356 "instead of deleting immediately.")); 357 return cb; 358 } 359 #endif 360 361 static GlobalSpinBox *DeletedMaxAge() 419 static GlobalSpinBoxSetting *DeletedMaxAge() 362 420 { 363 GlobalSpinBox *bs = new GlobalSpinBox("DeletedMaxAge", -1, 365, 1);421 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("DeletedMaxAge", 0, 365, 1); 364 422 bs->setLabel(QObject::tr("Time to retain deleted recordings (days)")); 365 423 bs->setHelpText(QObject::tr("Determines the maximum number of days before " 366 424 "undeleting a recording will become impossible. " … … static GlobalSpinBox *DeletedMaxAge() 374 432 return bs; 375 433 }; 376 434 377 static GlobalCheckBox *DeletedFifoOrder()435 static GlobalCheckBoxSetting *DeletedFifoOrder() 378 436 { 379 GlobalCheckBox *cb = new GlobalCheckBox("DeletedFifoOrder");437 GlobalCheckBoxSetting *cb = new GlobalCheckBoxSetting("DeletedFifoOrder"); 380 438 cb->setLabel(QObject::tr("Expire in deleted order")); 381 439 cb->setValue(false); 382 440 cb->setHelpText(QObject::tr( … … static GlobalCheckBox *DeletedFifoOrder() 386 444 }; 387 445 388 446 #if 0 389 class DeletedExpireOptions : public TriggeredConfigurationGroup 447 static GlobalCheckBoxSetting *AutoExpireInsteadOfDelete() 390 448 { 391 public: 392 DeletedExpireOptions() : 393 TriggeredConfigurationGroup(false, false, false, false) 394 { 395 setLabel(QObject::tr("DeletedExpireOptions")); 396 Setting* enabled = AutoExpireInsteadOfDelete(); 397 addChild(enabled); 398 setTrigger(enabled); 399 400 HorizontalConfigurationGroup* settings = 401 new HorizontalConfigurationGroup(false); 402 settings->addChild(DeletedFifoOrder()); 403 settings->addChild(DeletedMaxAge()); 404 addTarget("1", settings); 405 406 // show nothing if fillEnabled is off 407 addTarget("0", new HorizontalConfigurationGroup(true)); 408 }; 409 }; 449 GlobalCheckBoxSetting *cb = new GlobalCheckBoxSetting("AutoExpireInsteadOfDelete"); 450 cb->setLabel(QObject::tr("Auto-Expire instead of delete recording")); 451 cb->setValue(false); 452 cb->setHelpText(QObject::tr("If enabled, move deleted recordings to the " 453 "'Deleted' recgroup and turn on autoexpire " 454 "instead of deleting immediately.")); 455 456 cb->addTargetedChild("1",DeletedFifoOrder()); 457 cb->addTargetedChild("1",DeletedMaxAge()); 458 return cb; 459 } 460 410 461 #endif 411 462 412 static GlobalComboBox *AutoExpireMethod()463 static GlobalComboBoxSetting *AutoExpireMethod() 413 464 { 414 GlobalComboBox *bc = new GlobalComboBox("AutoExpireMethod");465 GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("AutoExpireMethod"); 415 466 bc->setLabel(QObject::tr("Auto-Expire method")); 416 467 bc->addSelection(QObject::tr("Oldest show first"), "1"); 417 468 bc->addSelection(QObject::tr("Lowest priority first"), "2"); … … static GlobalComboBox *AutoExpireMethod() 423 474 return bc; 424 475 } 425 476 426 static GlobalCheckBox *AutoExpireWatchedPriority()477 static GlobalCheckBoxSetting *AutoExpireWatchedPriority() 427 478 { 428 GlobalCheckBox *bc = new GlobalCheckBox("AutoExpireWatchedPriority");479 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoExpireWatchedPriority"); 429 480 bc->setLabel(QObject::tr("Watched before unwatched")); 430 481 bc->setValue(false); 431 482 bc->setHelpText(QObject::tr("If enabled, programs that have been marked as " … … static GlobalCheckBox *AutoExpireWatchedPriority() 434 485 return bc; 435 486 } 436 487 437 static GlobalSpinBox *AutoExpireDayPriority()488 static GlobalSpinBoxSetting *AutoExpireDayPriority() 438 489 { 439 GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireDayPriority", 1, 400, 1);490 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AutoExpireDayPriority", 1, 400, 1); 440 491 bs->setLabel(QObject::tr("Priority weight")); 441 492 bs->setHelpText(QObject::tr("The number of days bonus a program gets for " 442 493 "each priority point. This is only used when the Weighted " … … static GlobalSpinBox *AutoExpireDayPriority() 445 496 return bs; 446 497 }; 447 498 448 static GlobalCheckBox *AutoExpireDefault()499 static GlobalCheckBoxSetting *AutoExpireDefault() 449 500 { 450 GlobalCheckBox *bc = new GlobalCheckBox("AutoExpireDefault");501 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoExpireDefault"); 451 502 bc->setLabel(QObject::tr("Auto-Expire default")); 452 503 bc->setValue(true); 453 504 bc->setHelpText(QObject::tr("If enabled, any new recording schedules " … … static GlobalCheckBox *AutoExpireDefault() 456 507 return bc; 457 508 } 458 509 459 static GlobalSpinBox *AutoExpireLiveTVMaxAge()510 static GlobalSpinBoxSetting *AutoExpireLiveTVMaxAge() 460 511 { 461 GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireLiveTVMaxAge", 1, 365, 1);512 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AutoExpireLiveTVMaxAge", 1, 365, 1); 462 513 bs->setLabel(QObject::tr("Live TV max age (days)")); 463 514 bs->setHelpText(QObject::tr("Auto-Expire will force expiration of Live " 464 515 "TV recordings when they are this many days old. Live TV " 465 516 "recordings may also be expired early if necessary to " 466 517 "free up disk space.")); 467 bs->setValue( 1);518 bs->setValue((int)1); 468 519 return bs; 469 520 }; 470 521 … … static GlobalSpinBox *MinRecordDiskThreshold() 483 534 } 484 535 #endif 485 536 486 static GlobalCheckBox *RerecordWatched()537 static GlobalCheckBoxSetting *RerecordWatched() 487 538 { 488 GlobalCheckBox *bc = new GlobalCheckBox("RerecordWatched");539 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("RerecordWatched"); 489 540 bc->setLabel(QObject::tr("Re-record watched")); 490 541 bc->setValue(false); 491 542 bc->setHelpText(QObject::tr("If enabled, programs that have been marked as " … … static GlobalCheckBox *RerecordWatched() 494 545 return bc; 495 546 } 496 547 497 static GlobalSpinBox *RecordPreRoll()548 static GlobalSpinBoxSetting *RecordPreRoll() 498 549 { 499 GlobalSpinBox *bs = new GlobalSpinBox("RecordPreRoll", 0, 600, 60, true);550 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("RecordPreRoll", 0, 600, 60, true); 500 551 bs->setLabel(QObject::tr("Time to record before start of show " 501 552 "(secs)")); 502 553 bs->setHelpText(QObject::tr("This global setting allows the recorder " … … static GlobalSpinBox *RecordPreRoll() 507 558 return bs; 508 559 } 509 560 510 static GlobalSpinBox *RecordOverTime()561 static GlobalSpinBoxSetting *RecordOverTime() 511 562 { 512 GlobalSpinBox *bs = new GlobalSpinBox("RecordOverTime", 0, 1800, 60, true);563 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("RecordOverTime", 0, 1800, 60, true); 513 564 bs->setLabel(QObject::tr("Time to record past end of show (secs)")); 514 565 bs->setValue(0); 515 566 bs->setHelpText(QObject::tr("This global setting allows the recorder " … … static GlobalSpinBox *RecordOverTime() 519 570 return bs; 520 571 } 521 572 522 static GlobalComboBox *OverTimeCategory()573 static GlobalComboBoxSetting *OverTimeCategory() 523 574 { 524 GlobalComboBox *gc = new GlobalComboBox("OverTimeCategory");575 GlobalComboBoxSetting *gc = new GlobalComboBoxSetting("OverTimeCategory"); 525 576 gc->setLabel(QObject::tr("Category of shows to be extended")); 526 577 gc->setHelpText(QObject::tr("For a special category (e.g. " 527 578 "\"Sports event\"), request that shows be autoextended. " 528 579 "Only works if a show's category can be determined.")); 529 580 530 581 MSqlQuery query(MSqlQuery::InitCon()); 582 //TODO We should not have any SQL here 531 583 query.prepare("SELECT DISTINCT category FROM program GROUP BY category;"); 532 584 533 585 gc->addSelection("", ""); 586 534 587 if (query.exec()) 535 588 { 536 589 while (query.next()) … … static GlobalComboBox *OverTimeCategory() 544 597 return gc; 545 598 } 546 599 547 static GlobalSpinBox *CategoryOverTime()600 static GlobalSpinBoxSetting *CategoryOverTime() 548 601 { 549 GlobalSpinBox *bs = new GlobalSpinBox("CategoryOverTime",602 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("CategoryOverTime", 550 603 0, 180, 60, true); 551 604 bs->setLabel(QObject::tr("Record past end of show (mins)")); 552 605 bs->setValue(30); … … static GlobalSpinBox *CategoryOverTime() 557 610 return bs; 558 611 } 559 612 560 static VerticalConfigurationGroup*CategoryOverTimeSettings()613 static GroupSetting *CategoryOverTimeSettings() 561 614 { 562 VerticalConfigurationGroup *vcg = 563 new VerticalConfigurationGroup(false, false); 564 615 GroupSetting *vcg = new GroupSetting(); 565 616 vcg->setLabel(QObject::tr("Category record over-time")); 566 vcg->setUseLabel(true);567 617 vcg->addChild(OverTimeCategory()); 568 618 vcg->addChild(CategoryOverTime()); 569 619 return vcg; … … static QString pad(const QString &str, int len) 588 638 589 639 return tmp; 590 640 } 591 641 /* 592 642 PlaybackProfileItemConfig::PlaybackProfileItemConfig(ProfileItem &_item) : 593 643 item(_item) 594 644 { … … void PlaybackProfileConfig::swap(int i, int j) 1117 1167 labels[i]->setValue(label_j); 1118 1168 labels[j]->setValue(label_i); 1119 1169 } 1170 */ 1171 1172 static HostComboBoxSetting * CurrentPlaybackProfile() 1173 { 1174 HostComboBoxSetting *grouptrigger = new HostComboBoxSetting("DefaultVideoPlaybackProfile"); 1175 grouptrigger->setLabel(QObject::tr("Current Video Playback Profile")); 1176 1177 QString host = gCoreContext->GetHostName(); 1178 QStringList profiles = VideoDisplayProfile::GetProfiles(host); 1179 if (profiles.empty()) 1180 { 1181 VideoDisplayProfile::CreateProfiles(host); 1182 profiles = VideoDisplayProfile::GetProfiles(host); 1183 } 1184 if (profiles.empty()) 1185 return grouptrigger; 1186 1187 if (!profiles.contains("Normal") && 1188 !profiles.contains("High Quality") && 1189 !profiles.contains("Slim")) 1190 { 1191 VideoDisplayProfile::CreateNewProfiles(host); 1192 profiles = VideoDisplayProfile::GetProfiles(host); 1193 } 1194 1195 if (!profiles.contains("VDPAU Normal") && 1196 !profiles.contains("VDPAU High Quality") && 1197 !profiles.contains("VDPAU Slim")) 1198 { 1199 VideoDisplayProfile::CreateVDPAUProfiles(host); 1200 profiles = VideoDisplayProfile::GetProfiles(host); 1201 } 1202 1203 QString profile = VideoDisplayProfile::GetDefaultProfileName(host); 1204 if (!profiles.contains(profile)) 1205 { 1206 profile = (profiles.contains("Normal")) ? "Normal" : profiles[0]; 1207 VideoDisplayProfile::SetDefaultProfileName(profile, host); 1208 } 1209 1210 QStringList::const_iterator it; 1211 for (it = profiles.begin(); it != profiles.end(); ++it) 1212 grouptrigger->addSelection(ProgramInfo::i18n(*it), *it); 1213 return grouptrigger; 1214 } 1120 1215 1121 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) : 1216 /* 1217 PlaybackProfileConfigs::PlaybackProfileConfigs() : 1122 1218 TriggeredConfigurationGroup(false, true, true, true, 1123 1219 false, false, true, true), grouptrigger(NULL) 1124 1220 { 1125 setLabel(QObject::tr("Playback Profiles") + str);1221 setLabel(QObject::tr("Playback Profiles")); 1126 1222 1127 1223 QString host = gCoreContext->GetHostName(); 1128 1224 QStringList profiles = VideoDisplayProfile::GetProfiles(host); … … void PlaybackProfileConfigs::btnPress(QString cmd) 1256 1352 void PlaybackProfileConfigs::triggerChanged(const QString &trig) 1257 1353 { 1258 1354 TriggeredConfigurationGroup::triggerChanged(trig); 1259 } 1355 }*/ 1356 /* 1357 class PlaybackProfileConfigsButton : public StandardSetting, public TransientStorage 1358 { 1359 public: 1360 PlaybackProfileConfigsButton():StandardSetting(),TransientStorage() 1361 { 1362 setLabel() 1363 1364 }; 1260 1365 1261 static HostComboBox *PlayBoxOrdering() 1366 virtual void Load(void){StandardSetting::Load();}; 1367 virtual void Save(void){StandardSetting::Save();}; 1368 virtual bool edit(MythScreenType * screen); 1369 virtual void resultEdit(DialogCompletionEvent *dce, MythUIButtonListItem *item){}; 1370 virtual void applyChange(){}; 1371 };*/ 1372 1373 static HostComboBoxSetting *PlayBoxOrdering() 1262 1374 { 1263 1375 QString str[4] = 1264 1376 { … … static HostComboBox *PlayBoxOrdering() 1273 1385 "refers to sections (e.g. \"All Programs\") which list " 1274 1386 "multiple titles. Sections in parentheses are not affected."); 1275 1387 1276 HostComboBox *gc = new HostComboBox("PlayBoxOrdering");1388 HostComboBoxSetting *gc = new HostComboBoxSetting("PlayBoxOrdering"); 1277 1389 gc->setLabel(QObject::tr("Episode sort orderings")); 1278 1390 1279 1391 for (int i = 0; i < 4; ++i) … … static HostComboBox *PlayBoxOrdering() 1285 1397 return gc; 1286 1398 } 1287 1399 1288 static HostComboBox *PlayBoxEpisodeSort()1400 static HostComboBoxSetting *PlayBoxEpisodeSort() 1289 1401 { 1290 HostComboBox *gc = new HostComboBox("PlayBoxEpisodeSort");1402 HostComboBoxSetting *gc = new HostComboBoxSetting("PlayBoxEpisodeSort"); 1291 1403 gc->setLabel(QObject::tr("Sort episodes")); 1292 1404 gc->addSelection(QObject::tr("Record date"), "Date"); 1293 1405 gc->addSelection(QObject::tr("Season/Episode"), "Season"); … … static HostComboBox *PlayBoxEpisodeSort() 1297 1409 return gc; 1298 1410 } 1299 1411 1300 static HostSpinBox *FFRewReposTime()1412 static HostSpinBoxSetting *FFRewReposTime() 1301 1413 { 1302 HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);1414 HostSpinBoxSetting *gs = new HostSpinBoxSetting("FFRewReposTime", 0, 200, 5); 1303 1415 gs->setLabel(QObject::tr("Fast forward/rewind reposition amount")); 1304 1416 gs->setValue(100); 1305 1417 gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind " … … static HostSpinBox *FFRewReposTime() 1310 1422 return gs; 1311 1423 } 1312 1424 1313 static HostCheckBox *FFRewReverse()1425 static HostCheckBoxSetting *FFRewReverse() 1314 1426 { 1315 HostCheckBox *gc = new HostCheckBox("FFRewReverse");1427 HostCheckBoxSetting *gc = new HostCheckBoxSetting("FFRewReverse"); 1316 1428 gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind")); 1317 1429 gc->setValue(true); 1318 1430 gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key " … … static HostCheckBox *FFRewReverse() 1323 1435 return gc; 1324 1436 } 1325 1437 1326 static HostComboBox *MenuTheme()1438 static HostComboBoxSetting *MenuTheme() 1327 1439 { 1328 HostComboBox *gc = new HostComboBox("MenuTheme");1440 HostComboBoxSetting *gc = new HostComboBoxSetting("MenuTheme"); 1329 1441 gc->setLabel(QObject::tr("Menu theme")); 1330 1442 1331 1443 QList<ThemeInfo> themelist = GetMythUI()->GetThemes(THEME_MENU); … … static HostComboBox MUNUSED *DecodeVBIFormat() 1358 1470 return gc; 1359 1471 } 1360 1472 1361 static HostSpinBox *OSDCC708TextZoomPercentage(void)1473 static HostSpinBoxSetting *OSDCC708TextZoomPercentage(void) 1362 1474 { 1363 HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5);1475 HostSpinBoxSetting *gs = new HostSpinBoxSetting("OSDCC708TextZoom", 50, 200, 5); 1364 1476 gs->setLabel(QObject::tr("Subtitle text zoom percentage")); 1365 1477 gs->setValue(100); 1366 1478 gs->setHelpText(QObject::tr("Use this to enlarge or shrink text based subtitles.")); … … static HostSpinBox *OSDCC708TextZoomPercentage(void) 1368 1480 return gs; 1369 1481 } 1370 1482 1371 static HostComboBox *SubtitleFont()1483 static HostComboBoxSetting *SubtitleFont() 1372 1484 { 1373 HostComboBox *hcb = new HostComboBox("DefaultSubtitleFont");1485 HostComboBoxSetting *hcb = new HostComboBoxSetting("DefaultSubtitleFont"); 1374 1486 QFontDatabase db; 1375 1487 QStringList fonts = db.families(); 1376 1488 QStringList hide = db.families(QFontDatabase::Symbol); … … static HostComboBox *SubtitleFont() 1385 1497 return hcb; 1386 1498 } 1387 1499 1388 static HostComboBox *SubtitleCodec()1500 static HostComboBoxSetting *SubtitleCodec() 1389 1501 { 1390 HostComboBox *gc = new HostComboBox("SubtitleCodec");1502 HostComboBoxSetting *gc = new HostComboBoxSetting("SubtitleCodec"); 1391 1503 1392 1504 gc->setLabel(QObject::tr("Subtitle Codec")); 1393 1505 QList<QByteArray> list = QTextCodec::availableCodecs(); … … static HostComboBox *SubtitleCodec() 1400 1512 return gc; 1401 1513 } 1402 1514 1403 static HostComboBox *ChannelOrdering()1515 static HostComboBoxSetting *ChannelOrdering() 1404 1516 { 1405 HostComboBox *gc = new HostComboBox("ChannelOrdering");1517 HostComboBoxSetting *gc = new HostComboBoxSetting("ChannelOrdering"); 1406 1518 gc->setLabel(QObject::tr("Channel ordering")); 1407 1519 gc->addSelection(QObject::tr("channel number"), "channum"); 1408 1520 gc->addSelection(QObject::tr("callsign"), "callsign"); 1409 1521 return gc; 1410 1522 } 1411 1523 1412 static HostSpinBox *VertScanPercentage()1524 static HostSpinBoxSetting *VertScanPercentage() 1413 1525 { 1414 HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1); 1526 HostSpinBoxSetting *gs = new HostSpinBoxSetting("VertScanPercentage", -100, 100, 1); 1527 //TODO should this not be 0% -> 200% 1415 1528 gs->setLabel(QObject::tr("Vertical scaling")); 1416 1529 gs->setValue(0); 1417 1530 gs->setHelpText(QObject::tr( … … static HostSpinBox *VertScanPercentage() 1420 1533 return gs; 1421 1534 } 1422 1535 1423 static HostSpinBox *HorizScanPercentage()1536 static HostSpinBoxSetting *HorizScanPercentage() 1424 1537 { 1425 HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1); 1538 HostSpinBoxSetting *gs = new HostSpinBoxSetting("HorizScanPercentage", -100, 100, 1); 1539 //TODO should this not be 0% -> 200% 1426 1540 gs->setLabel(QObject::tr("Horizontal scaling")); 1427 1541 gs->setValue(0); 1428 1542 gs->setHelpText(QObject::tr( … … static HostSpinBox *HorizScanPercentage() 1431 1545 return gs; 1432 1546 }; 1433 1547 1434 static HostSpinBox *XScanDisplacement()1548 static HostSpinBoxSetting *XScanDisplacement() 1435 1549 { 1436 HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1);1550 HostSpinBoxSetting *gs = new HostSpinBoxSetting("XScanDisplacement", -50, 50, 1); 1437 1551 gs->setLabel(QObject::tr("Scan displacement (X)")); 1438 1552 gs->setValue(0); 1439 1553 gs->setHelpText(QObject::tr("Adjust this to move the image horizontally.")); 1440 1554 return gs; 1441 1555 } 1442 1556 1443 static HostSpinBox *YScanDisplacement()1557 static HostSpinBoxSetting *YScanDisplacement() 1444 1558 { 1445 HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1);1559 HostSpinBoxSetting *gs = new HostSpinBoxSetting("YScanDisplacement", -50, 50, 1); 1446 1560 gs->setLabel(QObject::tr("Scan displacement (Y)")); 1447 1561 gs->setValue(0); 1448 1562 gs->setHelpText(QObject::tr("Adjust this to move the image vertically.")); 1449 1563 return gs; 1450 1564 }; 1451 1565 1452 static HostCheckBox *CCBackground()1566 static HostCheckBoxSetting *CCBackground() 1453 1567 { 1454 HostCheckBox *gc = new HostCheckBox("CCBackground");1568 HostCheckBoxSetting *gc = new HostCheckBoxSetting("CCBackground"); 1455 1569 gc->setLabel(QObject::tr("Black background for closed captioning")); 1456 1570 gc->setValue(false); 1457 1571 gc->setHelpText(QObject::tr( … … static HostCheckBox *CCBackground() 1461 1575 return gc; 1462 1576 } 1463 1577 1464 static HostCheckBox *DefaultCCMode()1578 static HostCheckBoxSetting *DefaultCCMode() 1465 1579 { 1466 HostCheckBox *gc = new HostCheckBox("DefaultCCMode");1580 HostCheckBoxSetting *gc = new HostCheckBoxSetting("DefaultCCMode"); 1467 1581 gc->setLabel(QObject::tr("Always display closed captioning or subtitles")); 1468 1582 gc->setValue(false); 1469 1583 gc->setHelpText(QObject::tr( … … static HostCheckBox *DefaultCCMode() 1474 1588 return gc; 1475 1589 } 1476 1590 1477 static HostCheckBox *PreferCC708()1591 static HostCheckBoxSetting *PreferCC708() 1478 1592 { 1479 HostCheckBox *gc = new HostCheckBox("Prefer708Captions");1593 HostCheckBoxSetting *gc = new HostCheckBoxSetting("Prefer708Captions"); 1480 1594 gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions")); 1481 1595 gc->setValue(true); 1482 1596 gc->setHelpText( … … static HostCheckBox *PreferCC708() 1487 1601 return gc; 1488 1602 } 1489 1603 1490 static HostCheckBox *EnableMHEG()1604 static HostCheckBoxSetting *EnableMHEG() 1491 1605 { 1492 HostCheckBox *gc = new HostCheckBox("EnableMHEG");1606 HostCheckBoxSetting *gc = new HostCheckBoxSetting("EnableMHEG"); 1493 1607 gc->setLabel(QObject::tr("Enable interactive TV")); 1494 1608 gc->setValue(false); 1495 1609 gc->setHelpText(QObject::tr( … … static HostCheckBox *EnableMHEG() 1499 1613 return gc; 1500 1614 } 1501 1615 1502 static HostCheckBox *PersistentBrowseMode()1616 static HostCheckBoxSetting *PersistentBrowseMode() 1503 1617 { 1504 HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");1618 HostCheckBoxSetting *gc = new HostCheckBoxSetting("PersistentBrowseMode"); 1505 1619 gc->setLabel(QObject::tr("Always use browse mode in Live TV")); 1506 1620 gc->setValue(true); 1507 1621 gc->setHelpText( … … static HostCheckBox *PersistentBrowseMode() 1511 1625 return gc; 1512 1626 } 1513 1627 1514 static HostCheckBox *BrowseAllTuners()1628 static HostCheckBoxSetting *BrowseAllTuners() 1515 1629 { 1516 HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");1630 HostCheckBoxSetting *gc = new HostCheckBoxSetting("BrowseAllTuners"); 1517 1631 gc->setLabel(QObject::tr("Browse all channels")); 1518 1632 gc->setValue(false); 1519 1633 gc->setHelpText( … … static HostCheckBox *BrowseAllTuners() 1524 1638 return gc; 1525 1639 } 1526 1640 1527 static HostCheckBox *ClearSavedPosition()1641 static HostCheckBoxSetting *ClearSavedPosition() 1528 1642 { 1529 HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");1643 HostCheckBoxSetting *gc = new HostCheckBoxSetting("ClearSavedPosition"); 1530 1644 gc->setLabel(QObject::tr("Clear bookmark on playback")); 1531 1645 gc->setValue(true); 1532 1646 gc->setHelpText(QObject::tr("If enabled, automatically clear the " … … static HostCheckBox *ClearSavedPosition() 1536 1650 return gc; 1537 1651 } 1538 1652 1539 static HostCheckBox *AltClearSavedPosition()1653 static HostCheckBoxSetting *AltClearSavedPosition() 1540 1654 { 1541 HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");1655 HostCheckBoxSetting *gc = new HostCheckBoxSetting("AltClearSavedPosition"); 1542 1656 gc->setLabel(QObject::tr("Alternate clear and save bookmark")); 1543 1657 gc->setValue(true); 1544 1658 gc->setHelpText(QObject::tr("During playback the SELECT key " … … static HostCheckBox *AltClearSavedPosition() 1549 1663 return gc; 1550 1664 } 1551 1665 1552 static HostComboBox *PlaybackExitPrompt()1666 static HostComboBoxSetting *PlaybackExitPrompt() 1553 1667 { 1554 HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");1668 HostComboBoxSetting *gc = new HostComboBoxSetting("PlaybackExitPrompt"); 1555 1669 gc->setLabel(QObject::tr("Action on playback exit")); 1556 1670 gc->addSelection(QObject::tr("Just exit"), "0"); 1557 1671 gc->addSelection(QObject::tr("Save position and exit"), "2"); … … static HostComboBox *PlaybackExitPrompt() 1565 1679 return gc; 1566 1680 } 1567 1681 1568 static HostCheckBox *EndOfRecordingExitPrompt()1682 static HostCheckBoxSetting *EndOfRecordingExitPrompt() 1569 1683 { 1570 HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");1684 HostCheckBoxSetting *gc = new HostCheckBoxSetting("EndOfRecordingExitPrompt"); 1571 1685 gc->setLabel(QObject::tr("Prompt at end of recording")); 1572 1686 gc->setValue(false); 1573 1687 gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing " … … static HostCheckBox *EndOfRecordingExitPrompt() 1576 1690 return gc; 1577 1691 } 1578 1692 1579 static HostCheckBox *JumpToProgramOSD()1693 static HostCheckBoxSetting *JumpToProgramOSD() 1580 1694 { 1581 HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");1695 HostCheckBoxSetting *gc = new HostCheckBoxSetting("JumpToProgramOSD"); 1582 1696 gc->setLabel(QObject::tr("Jump to program OSD")); 1583 1697 gc->setValue(true); 1584 1698 gc->setHelpText(QObject::tr( … … static HostCheckBox *JumpToProgramOSD() 1590 1704 return gc; 1591 1705 } 1592 1706 1593 static HostCheckBox *ContinueEmbeddedTVPlay()1707 static HostCheckBoxSetting *ContinueEmbeddedTVPlay() 1594 1708 { 1595 HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");1709 HostCheckBoxSetting *gc = new HostCheckBoxSetting("ContinueEmbeddedTVPlay"); 1596 1710 gc->setLabel(QObject::tr("Continue playback when embedded")); 1597 1711 gc->setValue(false); 1598 1712 gc->setHelpText(QObject::tr( … … static HostCheckBox *ContinueEmbeddedTVPlay() 1603 1717 return gc; 1604 1718 } 1605 1719 1606 static HostCheckBox *AutomaticSetWatched()1720 static HostCheckBoxSetting *AutomaticSetWatched() 1607 1721 { 1608 HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");1722 HostCheckBoxSetting *gc = new HostCheckBoxSetting("AutomaticSetWatched"); 1609 1723 gc->setLabel(QObject::tr("Automatically mark a recording as watched")); 1610 1724 gc->setValue(false); 1611 1725 gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a " … … static HostCheckBox *AutomaticSetWatched() 1616 1730 return gc; 1617 1731 } 1618 1732 1619 static HostSpinBox *LiveTVIdleTimeout()1733 static HostSpinBoxSetting *LiveTVIdleTimeout() 1620 1734 { 1621 HostSpinBox *gs = new HostSpinBox("LiveTVIdleTimeout", 0, 3600, 1);1735 HostSpinBoxSetting *gs = new HostSpinBoxSetting("LiveTVIdleTimeout", 0, 3600, 1); 1622 1736 gs->setLabel(QObject::tr("Live TV idle timeout (mins)")); 1623 1737 gs->setValue(0); 1624 1738 gs->setHelpText(QObject::tr( … … static HostSpinBox *LiveTVIdleTimeout() 1653 1767 // return gc; 1654 1768 // } 1655 1769 1656 static HostCheckBox *UseVirtualKeyboard()1770 static HostCheckBoxSetting *UseVirtualKeyboard() 1657 1771 { 1658 HostCheckBox *gc = new HostCheckBox("UseVirtualKeyboard");1772 HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseVirtualKeyboard"); 1659 1773 gc->setLabel(QObject::tr("Use line edit virtual keyboards")); 1660 1774 gc->setValue(true); 1661 1775 gc->setHelpText(QObject::tr("If enabled, you can use a virtual keyboard " … … static HostCheckBox *UseVirtualKeyboard() 1664 1778 return gc; 1665 1779 } 1666 1780 1667 static HostComboBox *OverrideExitMenu()1781 static HostComboBoxSetting *OverrideExitMenu() 1668 1782 { 1669 HostComboBox *gc = new HostComboBox("OverrideExitMenu");1783 HostComboBoxSetting *gc = new HostComboBoxSetting("OverrideExitMenu"); 1670 1784 gc->setLabel(QObject::tr("Customize exit menu options")); 1671 1785 gc->addSelection(QObject::tr("Default"), "0"); 1672 1786 gc->addSelection(QObject::tr("Show quit"), "1"); … … static HostComboBox *OverrideExitMenu() 1681 1795 return gc; 1682 1796 } 1683 1797 1684 static Host LineEdit*RebootCommand()1798 static HostTextEditSetting *RebootCommand() 1685 1799 { 1686 Host LineEdit *ge = new HostLineEdit("RebootCommand");1800 HostTextEditSetting *ge = new HostTextEditSetting("RebootCommand"); 1687 1801 ge->setLabel(QObject::tr("Reboot command")); 1688 1802 ge->setValue(""); 1689 1803 ge->setHelpText(QObject::tr("Optional. Script to run if you select " … … static HostLineEdit *RebootCommand() 1693 1807 return ge; 1694 1808 } 1695 1809 1696 static Host LineEdit*HaltCommand()1810 static HostTextEditSetting *HaltCommand() 1697 1811 { 1698 Host LineEdit *ge = new HostLineEdit("HaltCommand");1812 HostTextEditSetting *ge = new HostTextEditSetting("HaltCommand"); 1699 1813 ge->setLabel(QObject::tr("Halt command")); 1700 1814 ge->setValue(""); 1701 1815 ge->setHelpText(QObject::tr("Optional. Script to run if you select " … … static HostLineEdit *HaltCommand() 1705 1819 return ge; 1706 1820 } 1707 1821 1708 static Host LineEdit*LircDaemonDevice()1822 static HostTextEditSetting *LircDaemonDevice() 1709 1823 { 1710 HostLineEdit *ge = new HostLineEdit("LircSocket"); 1824 // TODO Cannot use File browser as it can be address[:port] 1825 // HostFileBrowserSetting *ge = new HostFileBrowserSetting("LircSocket"); 1826 HostTextEditSetting *ge = new HostTextEditSetting("LircSocket"); 1711 1827 ge->setLabel(QObject::tr("LIRC daemon socket")); 1712 1828 1713 1829 /* lircd socket moved from /dev/ to /var/run/lirc/ in lirc 0.8.6 */ … … static HostLineEdit *LircDaemonDevice() 1722 1838 return ge; 1723 1839 } 1724 1840 1725 static Host LineEdit*ScreenShotPath()1841 static HostTextEditSetting *ScreenShotPath() 1726 1842 { 1727 Host LineEdit *ge = new HostLineEdit("ScreenShotPath");1843 HostTextEditSetting *ge = new HostTextEditSetting("ScreenShotPath"); 1728 1844 ge->setLabel(QObject::tr("Screen shot path")); 1729 1845 ge->setValue("/tmp/"); 1730 1846 ge->setHelpText(QObject::tr("Path to screenshot storage location. Should be writable by the frontend")); 1731 1847 return ge; 1732 1848 } 1733 1849 1734 static Host LineEdit*SetupPinCode()1850 static HostTextEditSetting *SetupPinCode() 1735 1851 { 1736 Host LineEdit *ge = new HostLineEdit("SetupPinCode");1852 HostTextEditSetting *ge = new HostTextEditSetting("SetupPinCode"); 1737 1853 ge->setLabel(QObject::tr("Setup PIN code")); 1738 1854 ge->setHelpText(QObject::tr("This PIN is used to control access to the " 1739 1855 "setup menus. If you want to use this feature, then " … … static HostLineEdit *SetupPinCode() 1742 1858 return ge; 1743 1859 } 1744 1860 1745 static HostCheckBox *SetupPinCodeRequired()1861 static HostCheckBoxSetting *SetupPinCodeRequired() 1746 1862 { 1747 HostCheckBox *gc = new HostCheckBox("SetupPinCodeRequired");1863 HostCheckBoxSetting *gc = new HostCheckBoxSetting("SetupPinCodeRequired"); 1748 1864 gc->setLabel(QObject::tr("Require setup PIN") + " "); 1749 1865 gc->setValue(false); 1750 1866 gc->setHelpText(QObject::tr("If enabled, you will not be able to return " … … static HostCheckBox *SetupPinCodeRequired() 1753 1869 return gc; 1754 1870 } 1755 1871 1756 static HostComboBox *XineramaScreen()1872 static HostComboBoxSetting *XineramaScreen() 1757 1873 { 1758 HostComboBox *gc = new HostComboBox("XineramaScreen", false);1874 HostComboBoxSetting *gc = new HostComboBoxSetting("XineramaScreen"); 1759 1875 int num = MythDisplay::GetNumberXineramaScreens(); 1760 1876 for (int i=0; i<num; ++i) 1761 1877 gc->addSelection(QString::number(i), QString::number(i)); … … static HostComboBox *XineramaScreen() 1768 1884 } 1769 1885 1770 1886 1771 static HostComboBox *XineramaMonitorAspectRatio()1887 static HostComboBoxSetting *XineramaMonitorAspectRatio() 1772 1888 { 1773 HostComboBox *gc = new HostComboBox("XineramaMonitorAspectRatio");1889 HostComboBoxSetting *gc = new HostComboBoxSetting("XineramaMonitorAspectRatio"); 1774 1890 gc->setLabel(QObject::tr("Monitor aspect ratio")); 1775 1891 gc->addSelection(QObject::tr("4:3"), "1.3333"); 1776 1892 gc->addSelection(QObject::tr("16:9"), "1.7777"); … … static HostComboBox *XineramaMonitorAspectRatio() 1781 1897 return gc; 1782 1898 } 1783 1899 1784 static HostComboBox *LetterboxingColour()1900 static HostComboBoxSetting *LetterboxingColour() 1785 1901 { 1786 HostComboBox *gc = new HostComboBox("LetterboxColour");1902 HostComboBoxSetting *gc = new HostComboBoxSetting("LetterboxColour"); 1787 1903 gc->setLabel(QObject::tr("Letterboxing color")); 1788 1904 for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m) 1789 1905 gc->addSelection(toString((LetterBoxColour)m), QString::number(m)); … … static HostComboBox *LetterboxingColour() 1796 1912 return gc; 1797 1913 } 1798 1914 1799 static HostComboBox *AspectOverride()1915 static HostComboBoxSetting *AspectOverride() 1800 1916 { 1801 HostComboBox *gc = new HostComboBox("AspectOverride");1917 HostComboBoxSetting *gc = new HostComboBoxSetting("AspectOverride"); 1802 1918 gc->setLabel(QObject::tr("Video aspect override")); 1803 1919 for (int m = kAspect_Off; m < kAspect_END; ++m) 1804 1920 gc->addSelection(toString((AspectOverrideMode)m), QString::number(m)); … … static HostComboBox *AspectOverride() 1809 1925 return gc; 1810 1926 } 1811 1927 1812 static HostComboBox *AdjustFill()1928 static HostComboBoxSetting *AdjustFill() 1813 1929 { 1814 HostComboBox *gc = new HostComboBox("AdjustFill");1930 HostComboBoxSetting *gc = new HostComboBoxSetting("AdjustFill"); 1815 1931 gc->setLabel(QObject::tr("Zoom")); 1816 1932 for (int m = kAdjustFill_Off; m < kAdjustFill_END; ++m) 1817 1933 gc->addSelection(toString((AdjustFillMode)m), QString::number(m)); … … static HostComboBox *AdjustFill() 1827 1943 1828 1944 // Theme settings 1829 1945 1830 static HostSpinBox *GuiWidth()1946 static HostSpinBoxSetting *GuiWidth() 1831 1947 { 1832 HostSpinBox *gs = new HostSpinBox("GuiWidth", 0, 1920, 8, true);1948 HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiWidth", 0, 1920, 8, true); 1833 1949 gs->setLabel(QObject::tr("GUI width (pixels)")); 1834 1950 gs->setValue(0); 1835 1951 gs->setHelpText(QObject::tr("The width of the GUI. Do not make the GUI " … … static HostSpinBox *GuiWidth() 1838 1954 return gs; 1839 1955 } 1840 1956 1841 static HostSpinBox *GuiHeight()1957 static HostSpinBoxSetting *GuiHeight() 1842 1958 { 1843 HostSpinBox *gs = new HostSpinBox("GuiHeight", 0, 1600, 8, true);1959 HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiHeight", 0, 1600, 8, true); 1844 1960 gs->setLabel(QObject::tr("GUI height (pixels)")); 1845 1961 gs->setValue(0); 1846 1962 gs->setHelpText(QObject::tr("The height of the GUI. Do not make the GUI " … … static HostSpinBox *GuiHeight() 1849 1965 return gs; 1850 1966 } 1851 1967 1852 static HostSpinBox *GuiOffsetX()1968 static HostSpinBoxSetting *GuiOffsetX() 1853 1969 { 1854 HostSpinBox *gs = new HostSpinBox("GuiOffsetX", -3840, 3840, 32, true);1970 HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiOffsetX", -3840, 3840, 32, true); 1855 1971 gs->setLabel(QObject::tr("GUI X offset")); 1856 1972 gs->setValue(0); 1857 1973 gs->setHelpText(QObject::tr("The horizontal offset where the GUI will be " … … static HostSpinBox *GuiOffsetX() 1859 1975 return gs; 1860 1976 } 1861 1977 1862 static HostSpinBox *GuiOffsetY()1978 static HostSpinBoxSetting *GuiOffsetY() 1863 1979 { 1864 HostSpinBox *gs = new HostSpinBox("GuiOffsetY", -1600, 1600, 8, true);1980 HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiOffsetY", -1600, 1600, 8, true); 1865 1981 gs->setLabel(QObject::tr("GUI Y offset")); 1866 1982 gs->setValue(0); 1867 1983 gs->setHelpText(QObject::tr("The vertical offset where the GUI will be " … … static HostSpinBox *DisplaySizeHeight() 1893 2009 } 1894 2010 #endif 1895 2011 1896 static HostCheckBox *GuiSizeForTV()2012 static HostCheckBoxSetting *GuiSizeForTV() 1897 2013 { 1898 HostCheckBox *gc = new HostCheckBox("GuiSizeForTV");2014 HostCheckBoxSetting *gc = new HostCheckBoxSetting("GuiSizeForTV"); 1899 2015 gc->setLabel(QObject::tr("Use GUI size for TV playback")); 1900 2016 gc->setValue(true); 1901 2017 gc->setHelpText(QObject::tr("If enabled, use the above size for TV, " … … static HostCheckBox *GuiSizeForTV() 1904 2020 } 1905 2021 1906 2022 #if defined(USING_XRANDR) || CONFIG_DARWIN 1907 static HostCheckBox *UseVideoModes()1908 {1909 HostCheckBox *gc = new HostCheckBox("UseVideoModes");1910 gc->setLabel(QObject::tr("Separate video modes for GUI and TV playback"));1911 gc->setValue(false);1912 gc->setHelpText(QObject::tr("Switch X Window video modes for TV. "1913 "Requires \"xrandr\" support."));1914 return gc;1915 }1916 2023 1917 static HostSpinBox *VidModeWidth(int idx)2024 static HostSpinBoxSetting *VidModeWidth(int idx) 1918 2025 { 1919 HostSpinBox *gs = new HostSpinBox(QString("VidModeWidth%1").arg(idx),2026 HostSpinBoxSetting *gs = new HostSpinBoxSetting(QString("VidModeWidth%1").arg(idx), 1920 2027 0, 1920, 16, true); 1921 2028 gs->setLabel((idx<1) ? QObject::tr("In X"): ""); 1922 gs->setLabelAboveWidget(idx<1);1923 2029 gs->setValue(0); 1924 2030 gs->setHelpText(QObject::tr("Horizontal resolution of video " 1925 2031 "which needs a special output resolution.")); 1926 2032 return gs; 1927 2033 } 1928 2034 1929 static HostSpinBox *VidModeHeight(int idx)2035 static HostSpinBoxSetting *VidModeHeight(int idx) 1930 2036 { 1931 HostSpinBox *gs = new HostSpinBox(QString("VidModeHeight%1").arg(idx),2037 HostSpinBoxSetting *gs = new HostSpinBoxSetting(QString("VidModeHeight%1").arg(idx), 1932 2038 0, 1080, 16, true); 1933 2039 gs->setLabel((idx<1) ? QObject::tr("In Y"): ""); 1934 gs->setLabelAboveWidget(idx<1);1935 2040 gs->setValue(0); 1936 2041 gs->setHelpText(QObject::tr("Vertical resolution of video " 1937 2042 "which needs a special output resolution.")); 1938 2043 return gs; 1939 2044 } 1940 2045 1941 static HostComboBox *GuiVidModeResolution()2046 static HostComboBoxSetting *GuiVidModeResolution() 1942 2047 { 1943 HostComboBox *gc = new HostComboBox("GuiVidModeResolution");2048 HostComboBoxSetting *gc = new HostComboBoxSetting("GuiVidModeResolution"); 1944 2049 gc->setLabel(QObject::tr("GUI")); 1945 gc->setLabelAboveWidget(true);1946 2050 gc->setHelpText(QObject::tr("Resolution of screen " 1947 2051 "when not watching a video.")); 1948 2052 … … static HostComboBox *GuiVidModeResolution() 1971 2075 return gc; 1972 2076 } 1973 2077 1974 static HostComboBox *TVVidModeResolution(int idx=-1)2078 static HostComboBoxSetting *TVVidModeResolution(int idx=-1) 1975 2079 { 1976 2080 QString dhelp = QObject::tr("Default screen resolution " 1977 2081 "when watching a video."); … … static HostComboBox *TVVidModeResolution(int idx=-1) 1980 2084 1981 2085 QString qstr = (idx<0) ? "TVVidModeResolution" : 1982 2086 QString("TVVidModeResolution%1").arg(idx); 1983 HostComboBox *gc = new HostComboBox(qstr);2087 HostComboBoxSetting *gc = new HostComboBoxSetting(qstr); 1984 2088 QString lstr = (idx<0) ? QObject::tr("Video output") : 1985 2089 ((idx<1) ? QObject::tr("Output") : ""); 1986 2090 QString hstr = (idx<0) ? dhelp : ohelp; 1987 2091 1988 2092 gc->setLabel(lstr); 1989 gc->setLabelAboveWidget(idx<1);1990 2093 gc->setHelpText(hstr); 1991 2094 1992 2095 const vector<DisplayResScreen> scr = GetVideoModes(); … … static HostComboBox *TVVidModeResolution(int idx=-1) 1998 2101 return gc; 1999 2102 } 2000 2103 2001 static HostRefreshRateComboBox *TVVidModeRefreshRate(int idx=-1) 2104 2105 void HostRefreshRateComboBoxSetting::ChangeResolution(StandardSetting * setting) 2106 { 2107 clearSelections(); 2108 QString resolution = setting->getValue(); 2109 2110 const vector<double> list = GetRefreshRates(resolution); 2111 addSelection(QObject::tr("Auto"), "0"); 2112 int hz50 = -1, hz60 = -1; 2113 for (uint i=0; i<list.size(); ++i) 2114 { 2115 QString sel = QString::number((double) list[i],'f', 3); 2116 addSelection(sel+" Hz", sel); 2117 hz50 = (fabs(50.0 - list[i]) < 0.01) ? i : hz50; 2118 hz60 = (fabs(60.0 - list[i]) < 0.01) ? i : hz60; 2119 } 2120 2121 setValue(0); 2122 if ("640x480" == resolution || "720x480" == resolution) 2123 setValue(hz60+1); 2124 if ("640x576" == resolution || "720x576" == resolution) 2125 setValue(hz50+1); 2126 2127 setEnabled(list.size()); 2128 } 2129 2130 const vector<double> HostRefreshRateComboBoxSetting::GetRefreshRates(const QString &res) 2131 { 2132 QStringList slist = res.split("x"); 2133 int w = 0, h = 0; 2134 bool ok0 = false, ok1 = false; 2135 if (2 == slist.size()) 2136 { 2137 w = slist[0].toInt(&ok0); 2138 h = slist[1].toInt(&ok1); 2139 } 2140 2141 DisplayRes *display_res = DisplayRes::GetDisplayRes(); 2142 if (display_res && ok0 && ok1) 2143 return display_res->GetRefreshRates(w, h); 2144 2145 vector<double> list; 2146 return list; 2147 } 2148 2149 2150 static HostRefreshRateComboBoxSetting *TVVidModeRefreshRate(int idx=-1) 2002 2151 { 2003 2152 QString dhelp = QObject::tr("Default refresh rate " 2004 2153 "when watching a video. " … … static HostRefreshRateComboBox *TVVidModeRefreshRate(int idx=-1) 2008 2157 "Leave at \"Auto\" to automatically use the best available"); 2009 2158 QString qstr = (idx<0) ? "TVVidModeRefreshRate" : 2010 2159 QString("TVVidModeRefreshRate%1").arg(idx); 2011 HostRefreshRateComboBox *gc = new HostRefreshRateComboBox(qstr);2160 HostRefreshRateComboBoxSetting *gc = new HostRefreshRateComboBoxSetting(qstr); 2012 2161 QString lstr = (idx<1) ? QObject::tr("Rate") : ""; 2013 2162 QString hstr = (idx<0) ? dhelp : ohelp; 2014 2163 2015 2164 gc->setLabel(lstr); 2016 gc->setLabelAboveWidget(idx<1);2017 2165 gc->setHelpText(hstr); 2018 2166 gc->setEnabled(false); 2019 2167 return gc; 2020 2168 } 2021 2169 2022 static HostComboBox *TVVidModeForceAspect(int idx=-1)2170 static HostComboBoxSetting *TVVidModeForceAspect(int idx=-1) 2023 2171 { 2024 2172 QString dhelp = QObject::tr("Aspect ratio when watching a video."); 2025 2173 QString ohelp = QObject::tr("Aspect ratio when watching a " … … static HostComboBox *TVVidModeForceAspect(int idx=-1) 2027 2175 2028 2176 QString qstr = (idx<0) ? "TVVidModeForceAspect" : 2029 2177 QString("TVVidModeForceAspect%1").arg(idx); 2030 HostComboBox *gc = new HostComboBox(qstr);2178 HostComboBoxSetting *gc = new HostComboBoxSetting(qstr); 2031 2179 gc->setLabel( (idx<1) ? QObject::tr("Aspect") : "" ); 2032 gc->setLabelAboveWidget(idx<1);2033 2180 2034 2181 QString hstr = (idx<0) ? dhelp : ohelp; 2035 2182 gc->setHelpText(hstr+" "+ … … static HostComboBox *TVVidModeForceAspect(int idx=-1) 2042 2189 return gc; 2043 2190 } 2044 2191 2192 2193 2194 class DefaultVideoMode : public GroupSetting 2195 { 2196 public: 2197 DefaultVideoMode():GroupSetting() 2198 { 2199 setLabel(QObject::tr("Video Mode Settings")); 2200 m_res = TVVidModeResolution(); 2201 m_rate = TVVidModeRefreshRate(); 2202 addChild(GuiVidModeResolution()); 2203 addChild(m_res); 2204 addChild(m_rate); 2205 addChild(TVVidModeForceAspect()); 2206 connect(m_res, SIGNAL(valueChanged(StandardSetting *)), 2207 m_rate, SLOT(ChangeResolution(StandardSetting *))); 2208 } 2209 private: 2210 HostComboBoxSetting *m_res; 2211 HostRefreshRateComboBoxSetting *m_rate; 2212 }; 2213 2214 2215 class OverrideVideoMode : public GroupSetting 2216 { 2217 public: 2218 OverrideVideoMode (int idx):GroupSetting() 2219 { 2220 setLabel(QObject::tr("Override video mode #%1").arg(idx)); 2221 // input side 2222 addChild(VidModeWidth(idx)); 2223 addChild(VidModeHeight(idx)); 2224 // output side 2225 addChild(m_res = TVVidModeResolution(idx)); 2226 addChild(m_rate = TVVidModeRefreshRate(idx)); 2227 addChild(TVVidModeForceAspect(idx)); 2228 connect(m_res, SIGNAL(valueChanged(StandardSetting *)), 2229 m_rate, SLOT(ChangeResolution(StandardSetting *))); 2230 } 2231 private: 2232 HostComboBoxSetting *m_res; 2233 HostRefreshRateComboBoxSetting *m_rate; 2234 }; 2235 2236 static HostCheckBoxSetting *UseVideoModes() // replace VideoModeSettings 2237 { 2238 HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseVideoModes"); 2239 gc->setLabel(QObject::tr("Separate video modes for GUI and TV playback")); 2240 gc->setValue(false); 2241 gc->setHelpText(QObject::tr("Switch X Window video modes for TV. " 2242 "Requires \"xrandr\" support.")); 2243 2244 gc->addTargetedChild("1",new DefaultVideoMode()); 2245 2246 for (int idx = 0; idx < 3; ++idx) 2247 { 2248 gc->addTargetedChild("1",new OverrideVideoMode(idx)); 2249 } 2250 return gc; 2251 } 2252 2253 /* 2045 2254 class VideoModeSettings : public TriggeredConfigurationGroup 2046 2255 { 2047 2256 public: … … class VideoModeSettings : public TriggeredConfigurationGroup 2058 2267 ConfigurationGroup* defaultsettings = 2059 2268 new HorizontalConfigurationGroup(false, false); 2060 2269 2061 HostComboBox *res = TVVidModeResolution();2270 HostComboBoxSetting *res = TVVidModeResolution(); 2062 2271 HostRefreshRateComboBox *rate = TVVidModeRefreshRate(); 2063 2272 defaultsettings->addChild(GuiVidModeResolution()); 2064 2273 defaultsettings->addChild(res); … … class VideoModeSettings : public TriggeredConfigurationGroup 2091 2300 addTarget("1", settings); 2092 2301 addTarget("0", new VerticalConfigurationGroup(true)); 2093 2302 } 2094 }; 2303 };*/ 2095 2304 #endif 2096 2305 2097 static HostCheckBox *HideMouseCursor()2306 static HostCheckBoxSetting *HideMouseCursor() 2098 2307 { 2099 HostCheckBox *gc = new HostCheckBox("HideMouseCursor");2308 HostCheckBoxSetting *gc = new HostCheckBoxSetting("HideMouseCursor"); 2100 2309 gc->setLabel(QObject::tr("Hide mouse cursor in MythTV")); 2101 2310 gc->setValue(false); 2102 2311 gc->setHelpText(QObject::tr("Toggles mouse cursor visibility for touchscreens. " … … static HostCheckBox *HideMouseCursor() 2106 2315 }; 2107 2316 2108 2317 2109 static HostCheckBox *RunInWindow()2318 static HostCheckBoxSetting *RunInWindow() 2110 2319 { 2111 HostCheckBox *gc = new HostCheckBox("RunFrontendInWindow");2320 HostCheckBoxSetting *gc = new HostCheckBoxSetting("RunFrontendInWindow"); 2112 2321 gc->setLabel(QObject::tr("Use window border")); 2113 2322 gc->setValue(false); 2114 2323 gc->setHelpText(QObject::tr("Toggles between windowed and " … … static HostCheckBox *RunInWindow() 2116 2325 return gc; 2117 2326 } 2118 2327 2119 static HostCheckBox *UseFixedWindowSize()2328 static HostCheckBoxSetting *UseFixedWindowSize() 2120 2329 { 2121 2330 { 2122 HostCheckBox *gc = new HostCheckBox("UseFixedWindowSize");2331 HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseFixedWindowSize"); 2123 2332 gc->setLabel(QObject::tr("Use fixed window size")); 2124 2333 gc->setValue(true); 2125 2334 gc->setHelpText(QObject::tr( … … static HostCheckBox *UseFixedWindowSize() 2129 2338 } 2130 2339 } 2131 2340 2132 static HostComboBox *MythDateFormatCB()2341 static HostComboBoxSetting *MythDateFormatCB() 2133 2342 { 2134 HostComboBox *gc = new HostComboBox("DateFormat");2343 HostComboBoxSetting *gc = new HostComboBoxSetting("DateFormat"); 2135 2344 gc->setLabel(QObject::tr("Date format")); 2136 2345 2137 2346 QDate sampdate = QDate::currentDate(); … … static HostComboBox *MythDateFormatCB() 2170 2379 return gc; 2171 2380 } 2172 2381 2173 static HostComboBox *MythShortDateFormat()2382 static HostComboBoxSetting *MythShortDateFormat() 2174 2383 { 2175 HostComboBox *gc = new HostComboBox("ShortDateFormat");2384 HostComboBoxSetting *gc = new HostComboBoxSetting("ShortDateFormat"); 2176 2385 gc->setLabel(QObject::tr("Short date format")); 2177 2386 2178 2387 QDate sampdate = QDate::currentDate(); … … static HostComboBox *MythShortDateFormat() 2209 2418 return gc; 2210 2419 } 2211 2420 2212 static HostComboBox *MythTimeFormat()2421 static HostComboBoxSetting *MythTimeFormat() 2213 2422 { 2214 HostComboBox *gc = new HostComboBox("TimeFormat");2423 HostComboBoxSetting *gc = new HostComboBoxSetting("TimeFormat"); 2215 2424 gc->setLabel(QObject::tr("Time format")); 2216 2425 2217 2426 QTime samptime = QTime::currentTime(); … … static HostComboBox *MythTimeFormat() 2229 2438 return gc; 2230 2439 } 2231 2440 2232 static HostComboBox *ChannelFormat()2441 static HostComboBoxSetting *ChannelFormat() 2233 2442 { 2234 HostComboBox *gc = new HostComboBox("ChannelFormat");2443 HostComboBoxSetting *gc = new HostComboBoxSetting("ChannelFormat"); 2235 2444 gc->setLabel(QObject::tr("Channel format")); 2236 2445 gc->addSelection(QObject::tr("number"), "<num>"); 2237 2446 gc->addSelection(QObject::tr("number callsign"), "<num> <sign>"); … … static HostComboBox *ChannelFormat() 2243 2452 return gc; 2244 2453 } 2245 2454 2246 static HostComboBox *LongChannelFormat()2455 static HostComboBoxSetting *LongChannelFormat() 2247 2456 { 2248 HostComboBox *gc = new HostComboBox("LongChannelFormat");2457 HostComboBoxSetting *gc = new HostComboBoxSetting("LongChannelFormat"); 2249 2458 gc->setLabel(QObject::tr("Long channel format")); 2250 2459 gc->addSelection(QObject::tr("number"), "<num>"); 2251 2460 gc->addSelection(QObject::tr("number callsign"), "<num> <sign>"); … … static HostComboBox *LongChannelFormat() 2257 2466 return gc; 2258 2467 } 2259 2468 2260 static GlobalCheckBox *LiveTVPriority()2469 static GlobalCheckBoxSetting *LiveTVPriority() 2261 2470 { 2262 GlobalCheckBox *bc = new GlobalCheckBox("LiveTVPriority");2471 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("LiveTVPriority"); 2263 2472 bc->setLabel(QObject::tr("Allow Live TV to move scheduled shows")); 2264 2473 bc->setValue(false); 2265 2474 bc->setHelpText(QObject::tr("If enabled, scheduled recordings will " … … static GlobalCheckBox *LiveTVPriority() 2268 2477 return bc; 2269 2478 } 2270 2479 2271 static HostCheckBox *ChannelGroupRememberLast()2272 {2273 HostCheckBox *gc = new HostCheckBox("ChannelGroupRememberLast");2274 gc->setLabel(QObject::tr("Remember last channel group"));2275 gc->setHelpText(QObject::tr("If enabled, the EPG will initially display "2276 "only the channels from the last channel group selected. Pressing "2277 "\"4\" will toggle channel group."));2278 gc->setValue(false);2279 return gc;2280 }2281 2480 2282 static HostComboBox *ChannelGroupDefault() 2481 2482 static HostComboBoxSetting *ChannelGroupDefault() 2283 2483 { 2284 HostComboBox *gc = new HostComboBox("ChannelGroupDefault");2484 HostComboBoxSetting *gc = new HostComboBoxSetting("ChannelGroupDefault"); 2285 2485 gc->setLabel(QObject::tr("Default channel group")); 2286 2486 2287 2487 ChannelGroupList changrplist; … … static HostComboBox *ChannelGroupDefault() 2301 2501 return gc; 2302 2502 } 2303 2503 2304 static HostCheckBox *BrowseChannelGroup() 2504 static HostCheckBoxSetting *ChannelGroupRememberLast() 2505 { 2506 HostCheckBoxSetting *gc = new HostCheckBoxSetting("ChannelGroupRememberLast"); 2507 gc->setLabel(QObject::tr("Remember last channel group")); 2508 gc->setHelpText(QObject::tr("If enabled, the EPG will initially display " 2509 "only the channels from the last channel group selected. Pressing " 2510 "\"4\" will toggle channel group.")); 2511 gc->setValue(false); 2512 gc->addTargetedChild("0", ChannelGroupDefault()); 2513 return gc; 2514 } 2515 2516 static HostCheckBoxSetting *BrowseChannelGroup() 2305 2517 { 2306 HostCheckBox *gc = new HostCheckBox("BrowseChannelGroup");2518 HostCheckBoxSetting *gc = new HostCheckBoxSetting("BrowseChannelGroup"); 2307 2519 gc->setLabel(QObject::tr("Browse/change channels from Channel Group")); 2308 2520 gc->setHelpText(QObject::tr("If enabled, Live TV will browse or change " 2309 2521 "channels from the selected channel group. The \"All " … … static HostCheckBox *BrowseChannelGroup() 2313 2525 return gc; 2314 2526 } 2315 2527 2316 // Channel Group Settings2317 class ChannelGroupSettings : public TriggeredConfigurationGroup2318 {2319 public:2320 ChannelGroupSettings() : TriggeredConfigurationGroup(false, true, false, false)2321 {2322 setLabel(QObject::tr("Remember last channel group"));2323 setUseLabel(false);2324 2325 Setting* RememberChanGrpEnabled = ChannelGroupRememberLast();2326 addChild(RememberChanGrpEnabled);2327 setTrigger(RememberChanGrpEnabled);2328 2329 ConfigurationGroup* settings = new VerticalConfigurationGroup(false,false);2330 settings->addChild(ChannelGroupDefault());2331 addTarget("0", settings);2332 2333 // show nothing if RememberChanGrpEnabled is on2334 addTarget("1", new VerticalConfigurationGroup(true,false));2335 };2336 };2337 2338 2528 // General RecPriorities settings 2339 2529 2340 static GlobalCheckBox *GRSchedMoveHigher()2530 static GlobalCheckBoxSetting *GRSchedMoveHigher() 2341 2531 { 2342 GlobalCheckBox *bc = new GlobalCheckBox("SchedMoveHigher");2532 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("SchedMoveHigher"); 2343 2533 bc->setLabel(QObject::tr("Reschedule higher priorities")); 2344 2534 bc->setHelpText(QObject::tr("Move higher priority programs to other " 2345 2535 "cards and showings when resolving conflicts. This " … … static GlobalCheckBox *GRSchedMoveHigher() 2350 2540 return bc; 2351 2541 } 2352 2542 2353 static GlobalComboBox *GRSchedOpenEnd()2543 static GlobalComboBoxSetting *GRSchedOpenEnd() 2354 2544 { 2355 GlobalComboBox *bc = new GlobalComboBox("SchedOpenEnd");2545 GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("SchedOpenEnd"); 2356 2546 bc->setLabel(QObject::tr("Avoid back to back recordings")); 2357 2547 bc->setHelpText(QObject::tr("Selects the situations where the scheduler " 2358 2548 "will avoid assigning shows to the same card if their " … … static GlobalComboBox *GRSchedOpenEnd() 2365 2555 return bc; 2366 2556 } 2367 2557 2368 static GlobalSpinBox *GRDefaultStartOffset()2558 static GlobalSpinBoxSetting *GRDefaultStartOffset() 2369 2559 { 2370 GlobalSpinBox *bs = new GlobalSpinBox("DefaultStartOffset",2560 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("DefaultStartOffset", 2371 2561 -10, 30, 5, true); 2372 2562 bs->setLabel(QObject::tr("Default 'Start Early' minutes for new " 2373 2563 "recording rules")); … … static GlobalSpinBox *GRDefaultStartOffset() 2380 2570 return bs; 2381 2571 } 2382 2572 2383 static GlobalSpinBox *GRDefaultEndOffset()2573 static GlobalSpinBoxSetting *GRDefaultEndOffset() 2384 2574 { 2385 GlobalSpinBox *bs = new GlobalSpinBox("DefaultEndOffset",2575 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("DefaultEndOffset", 2386 2576 -10, 30, 5, true); 2387 2577 bs->setLabel(QObject::tr("Default 'End Late' minutes for new " 2388 2578 "recording rules")); … … static GlobalSpinBox *GRDefaultEndOffset() 2395 2585 return bs; 2396 2586 } 2397 2587 2398 static GlobalSpinBox *GRPrefInputRecPriority()2588 static GlobalSpinBoxSetting *GRPrefInputRecPriority() 2399 2589 { 2400 GlobalSpinBox *bs = new GlobalSpinBox("PrefInputPriority", 1, 99, 1);2590 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("PrefInputPriority", 1, 99, 1); 2401 2591 bs->setLabel(QObject::tr("Preferred input priority")); 2402 2592 bs->setHelpText(QObject::tr("Additional priority when a showing " 2403 2593 "matches the preferred input selected in the 'Scheduling " … … static GlobalSpinBox *GRPrefInputRecPriority() 2406 2596 return bs; 2407 2597 } 2408 2598 2409 static GlobalSpinBox *GRHDTVRecPriority()2599 static GlobalSpinBoxSetting *GRHDTVRecPriority() 2410 2600 { 2411 GlobalSpinBox *bs = new GlobalSpinBox("HDTVRecPriority", -99, 99, 1);2601 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("HDTVRecPriority", -99, 99, 1); 2412 2602 bs->setLabel(QObject::tr("HDTV recording priority")); 2413 2603 bs->setHelpText(QObject::tr("Additional priority when a showing " 2414 2604 "is marked as an HDTV broadcast in the TV listings.")); … … static GlobalSpinBox *GRHDTVRecPriority() 2416 2606 return bs; 2417 2607 } 2418 2608 2419 static GlobalSpinBox *GRWSRecPriority()2609 static GlobalSpinBoxSetting *GRWSRecPriority() 2420 2610 { 2421 GlobalSpinBox *bs = new GlobalSpinBox("WSRecPriority", -99, 99, 1);2611 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("WSRecPriority", -99, 99, 1); 2422 2612 bs->setLabel(QObject::tr("Widescreen recording priority")); 2423 2613 bs->setHelpText(QObject::tr("Additional priority when a showing " 2424 2614 "is marked as widescreen in the TV listings.")); … … static GlobalSpinBox *GRWSRecPriority() 2426 2616 return bs; 2427 2617 } 2428 2618 2429 static GlobalSpinBox *GRAutoRecPriority()2619 static GlobalSpinBoxSetting *GRAutoRecPriority() 2430 2620 { 2431 GlobalSpinBox *bs = new GlobalSpinBox("AutoRecPriority", -99, 99, 1);2621 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AutoRecPriority", -99, 99, 1); 2432 2622 bs->setLabel(QObject::tr("Automatic priority range (+/-)")); 2433 2623 bs->setHelpText(QObject::tr("Up to this number of priority points may " 2434 2624 "be added for titles that are usually watched soon after " … … static GlobalSpinBox *GRAutoRecPriority() 2438 2628 return bs; 2439 2629 } 2440 2630 2441 static GlobalSpinBox *GRSignLangRecPriority()2631 static GlobalSpinBoxSetting *GRSignLangRecPriority() 2442 2632 { 2443 GlobalSpinBox *bs = new GlobalSpinBox("SignLangRecPriority",2633 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("SignLangRecPriority", 2444 2634 -99, 99, 1); 2445 2635 bs->setLabel(QObject::tr("Sign language recording priority")); 2446 2636 bs->setHelpText(QObject::tr("Additional priority when a showing " … … static GlobalSpinBox *GRSignLangRecPriority() 2449 2639 return bs; 2450 2640 } 2451 2641 2452 static GlobalSpinBox *GROnScrSubRecPriority()2642 static GlobalSpinBoxSetting *GROnScrSubRecPriority() 2453 2643 { 2454 GlobalSpinBox *bs = new GlobalSpinBox("OnScrSubRecPriority",2644 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("OnScrSubRecPriority", 2455 2645 -99, 99, 1); 2456 2646 bs->setLabel(QObject::tr("In-vision Subtitles Recording Priority")); 2457 2647 bs->setHelpText(QObject::tr("Additional priority when a showing " … … static GlobalSpinBox *GROnScrSubRecPriority() 2460 2650 return bs; 2461 2651 } 2462 2652 2463 static GlobalSpinBox *GRCCRecPriority()2653 static GlobalSpinBoxSetting *GRCCRecPriority() 2464 2654 { 2465 GlobalSpinBox *bs = new GlobalSpinBox("CCRecPriority",2655 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("CCRecPriority", 2466 2656 -99, 99, 1); 2467 2657 bs->setLabel(QObject::tr("Subtitles/CC recording priority")); 2468 2658 bs->setHelpText(QObject::tr("Additional priority when a showing " … … static GlobalSpinBox *GRCCRecPriority() 2472 2662 return bs; 2473 2663 } 2474 2664 2475 static GlobalSpinBox *GRHardHearRecPriority()2665 static GlobalSpinBoxSetting *GRHardHearRecPriority() 2476 2666 { 2477 GlobalSpinBox *bs = new GlobalSpinBox("HardHearRecPriority",2667 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("HardHearRecPriority", 2478 2668 -99, 99, 1); 2479 2669 bs->setLabel(QObject::tr("Hard of hearing priority")); 2480 2670 bs->setHelpText(QObject::tr("Additional priority when a showing " … … static GlobalSpinBox *GRHardHearRecPriority() 2484 2674 return bs; 2485 2675 } 2486 2676 2487 static GlobalSpinBox *GRAudioDescRecPriority()2677 static GlobalSpinBoxSetting *GRAudioDescRecPriority() 2488 2678 { 2489 GlobalSpinBox *bs = new GlobalSpinBox("AudioDescRecPriority",2679 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AudioDescRecPriority", 2490 2680 -99, 99, 1); 2491 2681 bs->setLabel(QObject::tr("Audio described priority")); 2492 2682 bs->setHelpText(QObject::tr("Additional priority when a showing " … … static GlobalSpinBox *GRAudioDescRecPriority() 2495 2685 return bs; 2496 2686 } 2497 2687 2498 static GlobalSpinBox *GRSingleRecordRecPriority()2688 static GlobalSpinBoxSetting *GRSingleRecordRecPriority() 2499 2689 { 2500 GlobalSpinBox *bs = new GlobalSpinBox("SingleRecordRecPriority",2690 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("SingleRecordRecPriority", 2501 2691 -99, 99, 1); 2502 2692 bs->setLabel(QObject::tr("Single recordings priority")); 2503 2693 bs->setHelpText(QObject::tr("Single recordings will receive this " … … static GlobalSpinBox *GRSingleRecordRecPriority() 2506 2696 return bs; 2507 2697 } 2508 2698 2509 static GlobalSpinBox *GRWeekslotRecordRecPriority()2699 static GlobalSpinBoxSetting *GRWeekslotRecordRecPriority() 2510 2700 { 2511 GlobalSpinBox *bs = new GlobalSpinBox("WeekslotRecordRecPriority",2701 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("WeekslotRecordRecPriority", 2512 2702 -99, 99, 1); 2513 2703 bs->setLabel(QObject::tr("Weekslot recordings priority")); 2514 2704 bs->setHelpText(QObject::tr("Weekslot recordings will receive this " … … static GlobalSpinBox *GRWeekslotRecordRecPriority() 2517 2707 return bs; 2518 2708 } 2519 2709 2520 static GlobalSpinBox *GRTimeslotRecordRecPriority()2710 static GlobalSpinBoxSetting *GRTimeslotRecordRecPriority() 2521 2711 { 2522 GlobalSpinBox *bs = new GlobalSpinBox("TimeslotRecordRecPriority",2712 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("TimeslotRecordRecPriority", 2523 2713 -99, 99, 1); 2524 2714 bs->setLabel(QObject::tr("Timeslot recordings priority")); 2525 2715 bs->setHelpText(QObject::tr("Timeslot recordings will receive this " … … static GlobalSpinBox *GRTimeslotRecordRecPriority() 2528 2718 return bs; 2529 2719 } 2530 2720 2531 static GlobalSpinBox *GRChannelRecordRecPriority()2721 static GlobalSpinBoxSetting *GRChannelRecordRecPriority() 2532 2722 { 2533 GlobalSpinBox *bs = new GlobalSpinBox("ChannelRecordRecPriority",2723 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("ChannelRecordRecPriority", 2534 2724 -99, 99, 1); 2535 2725 bs->setLabel(QObject::tr("Channel recordings priority")); 2536 2726 bs->setHelpText(QObject::tr("Channel recordings will receive this " … … static GlobalSpinBox *GRChannelRecordRecPriority() 2539 2729 return bs; 2540 2730 } 2541 2731 2542 static GlobalSpinBox *GRAllRecordRecPriority()2732 static GlobalSpinBoxSetting *GRAllRecordRecPriority() 2543 2733 { 2544 GlobalSpinBox *bs = new GlobalSpinBox("AllRecordRecPriority",2734 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AllRecordRecPriority", 2545 2735 -99, 99, 1); 2546 2736 bs->setLabel(QObject::tr("All recordings priority")); 2547 2737 bs->setHelpText(QObject::tr("The 'All' recording type will receive this " … … static GlobalSpinBox *GRAllRecordRecPriority() 2550 2740 return bs; 2551 2741 } 2552 2742 2553 static GlobalSpinBox *GRFindOneRecordRecPriority()2743 static GlobalSpinBoxSetting *GRFindOneRecordRecPriority() 2554 2744 { 2555 GlobalSpinBox *bs = new GlobalSpinBox("FindOneRecordRecPriority",2745 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("FindOneRecordRecPriority", 2556 2746 -99, 99, 1); 2557 2747 bs->setLabel(QObject::tr("Find one recordings priority")); 2558 2748 bs->setHelpText(QObject::tr("Find One, Find Weekly and Find Daily " … … static GlobalSpinBox *GRFindOneRecordRecPriority() 2562 2752 return bs; 2563 2753 } 2564 2754 2565 static GlobalSpinBox *GROverrideRecordRecPriority()2755 static GlobalSpinBoxSetting *GROverrideRecordRecPriority() 2566 2756 { 2567 GlobalSpinBox *bs = new GlobalSpinBox("OverrideRecordRecPriority",2757 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("OverrideRecordRecPriority", 2568 2758 -99, 99, 1); 2569 2759 bs->setLabel(QObject::tr("Override recordings priority")); 2570 2760 bs->setHelpText(QObject::tr("Override recordings will receive this " … … static GlobalSpinBox *GROverrideRecordRecPriority() 2573 2763 return bs; 2574 2764 } 2575 2765 2576 static Host LineEdit*DefaultTVChannel()2766 static HostTextEditSetting *DefaultTVChannel() 2577 2767 { 2578 Host LineEdit *ge = new HostLineEdit("DefaultTVChannel");2768 HostTextEditSetting *ge = new HostTextEditSetting("DefaultTVChannel"); 2579 2769 ge->setLabel(QObject::tr("Guide starts at channel")); 2580 2770 ge->setValue("3"); 2581 2771 ge->setHelpText(QObject::tr("The program guide starts on this channel if " … … static HostLineEdit *DefaultTVChannel() 2583 2773 return ge; 2584 2774 } 2585 2775 2586 static HostSpinBox *EPGRecThreshold()2776 static HostSpinBoxSetting *EPGRecThreshold() 2587 2777 { 2588 HostSpinBox *gs = new HostSpinBox("SelChangeRecThreshold", 1, 600, 1);2778 HostSpinBoxSetting *gs = new HostSpinBoxSetting("SelChangeRecThreshold", 1, 600, 1); 2589 2779 gs->setLabel(QObject::tr("Record threshold")); 2590 2780 gs->setValue(16); 2591 2781 gs->setHelpText(QObject::tr("Pressing SELECT on a show that is at least " … … static HostSpinBox *EPGRecThreshold() 2594 2784 return gs; 2595 2785 } 2596 2786 2597 static HostComboBox *MythLanguage()2787 static HostComboBoxSetting *MythLanguage() 2598 2788 { 2599 HostComboBox *gc = new HostComboBox("Language");2789 HostComboBoxSetting *gc = new HostComboBoxSetting("Language"); 2600 2790 gc->setLabel(QObject::tr("Language")); 2601 2791 2602 2792 QMap<QString, QString> langMap = MythTranslation::getLanguages(); … … static HostComboBox *MythLanguage() 2618 2808 return gc; 2619 2809 } 2620 2810 2621 static void ISO639_fill_selections( SelectSetting *widget, uint i)2811 static void ISO639_fill_selections(MythUIComboBoxSetting *comboBox, uint i) 2622 2812 { 2623 widget->clearSelections();2813 comboBox->clearSelections(); 2624 2814 QString q = QString("ISO639Language%1").arg(i); 2625 2815 QString lang = gCoreContext->GetSetting(q, "").toLower(); 2626 2816 … … static void ISO639_fill_selections(SelectSetting *widget, uint i) 2641 2831 desc = desc.left(idx); 2642 2832 2643 2833 const QString il = iso639_key_to_str3(it.key()); 2644 widget->addSelection(desc, il, il == lang);2834 comboBox->addSelection(desc, il, il == lang); 2645 2835 } 2646 2836 } 2647 2837 2648 static GlobalComboBox *ISO639PreferredLanguage(uint i)2838 static GlobalComboBoxSetting *ISO639PreferredLanguage(uint i) 2649 2839 { 2650 GlobalComboBox *gc = new GlobalComboBox(QString("ISO639Language%1").arg(i));2840 GlobalComboBoxSetting *gc = new GlobalComboBoxSetting(QString("ISO639Language%1").arg(i)); 2651 2841 gc->setLabel(QObject::tr("Guide language #%1").arg(i+1)); 2652 2842 // We should try to get language from "MythLanguage" 2653 2843 // then use code 2 to code 3 map in iso639.h … … static GlobalComboBox *ISO639PreferredLanguage(uint i) 2658 2848 return gc; 2659 2849 } 2660 2850 2661 static HostCheckBox *NetworkControlEnabled()2662 {2663 HostCheckBox *gc = new HostCheckBox("NetworkControlEnabled");2664 gc->setLabel(QObject::tr("Enable Network Remote Control interface"));2665 gc->setHelpText(QObject::tr("This enables support for controlling "2666 "mythfrontend over the network."));2667 gc->setValue(false);2668 return gc;2669 }2670 2851 2671 static HostSpinBox *NetworkControlPort()2852 static HostSpinBoxSetting *NetworkControlPort() 2672 2853 { 2673 HostSpinBox *gs = new HostSpinBox("NetworkControlPort", 1025, 65535, 1);2854 HostSpinBoxSetting *gs = new HostSpinBoxSetting("NetworkControlPort", 1025, 65535, 1); 2674 2855 gs->setLabel(QObject::tr("Network Remote Control port")); 2675 2856 gs->setValue(6546); 2676 2857 gs->setHelpText(QObject::tr("This specifies what port the network remote " … … static HostSpinBox *NetworkControlPort() 2678 2859 return gs; 2679 2860 } 2680 2861 2681 static Host LineEdit*UDPNotifyPort()2862 static HostTextEditSetting *UDPNotifyPort() 2682 2863 { 2683 Host LineEdit *ge = new HostLineEdit("UDPNotifyPort");2864 HostTextEditSetting *ge = new HostTextEditSetting("UDPNotifyPort"); 2684 2865 ge->setLabel(QObject::tr("UDP notify port")); 2685 2866 ge->setValue("6948"); 2686 2867 ge->setHelpText(QObject::tr("MythTV will listen for connections " … … static HostLineEdit *UDPNotifyPort() 2688 2869 return ge; 2689 2870 } 2690 2871 2691 static HostCheckBox *RealtimePriority() 2872 static HostCheckBoxSetting *NetworkControlEnabled() 2873 { 2874 HostCheckBoxSetting *gc = new HostCheckBoxSetting("NetworkControlEnabled"); 2875 gc->setLabel(QObject::tr("Enable Network Remote Control interface")); 2876 gc->setHelpText(QObject::tr("This enables support for controlling " 2877 "mythfrontend over the network.")); 2878 gc->setValue(false); 2879 2880 gc->addTargetedChild("1",NetworkControlPort()); 2881 gc->addTargetedChild("1",UDPNotifyPort()); 2882 return gc; 2883 } 2884 2885 static HostCheckBoxSetting *RealtimePriority() 2692 2886 { 2693 HostCheckBox *gc = new HostCheckBox("RealtimePriority");2887 HostCheckBoxSetting *gc = new HostCheckBoxSetting("RealtimePriority"); 2694 2888 gc->setLabel(QObject::tr("Enable realtime priority threads")); 2695 2889 gc->setHelpText(QObject::tr("When running mythfrontend with root " 2696 2890 "privileges, some threads can be given enhanced priority. " … … static HostCheckBox *RealtimePriority() 2700 2894 return gc; 2701 2895 } 2702 2896 2703 static HostCheckBox *EnableMediaMon() 2704 { 2705 HostCheckBox *gc = new HostCheckBox("MonitorDrives"); 2706 gc->setLabel(QObject::tr("Monitor CD/DVD") + 2707 QObject::tr(" (and other removable devices)")); 2708 gc->setHelpText(QObject::tr("This enables support for monitoring your " 2709 "CD/DVD drives for new disks and launching the proper " 2710 "plugin to handle them. Requires restart.")); 2711 gc->setValue(false); 2712 return gc; 2713 } 2714 2715 static HostLineEdit *IgnoreMedia() 2897 static HostTextEditSetting *IgnoreMedia() 2716 2898 { 2717 Host LineEdit *ge = new HostLineEdit("IgnoreDevices");2899 HostTextEditSetting *ge = new HostTextEditSetting("IgnoreDevices"); 2718 2900 ge->setLabel(QObject::tr("Ignore devices")); 2719 2901 ge->setValue(""); 2720 2902 ge->setHelpText(QObject::tr("If there are any devices that you do not want " … … static HostLineEdit *IgnoreMedia() 2724 2906 return ge; 2725 2907 } 2726 2908 2727 class MythMediaSettings : public TriggeredConfigurationGroup 2909 static HostCheckBoxSetting *EnableMediaMon() 2728 2910 { 2729 public: 2730 MythMediaSettings() : 2731 TriggeredConfigurationGroup(false, false, true, true) 2732 { 2733 setLabel(QObject::tr("MythMediaMonitor")); 2734 setUseLabel(false); 2735 2736 Setting* enabled = EnableMediaMon(); 2737 addChild(enabled); 2738 setTrigger(enabled); 2739 2740 ConfigurationGroup* settings = new VerticalConfigurationGroup(false); 2741 settings->addChild(IgnoreMedia()); 2742 addTarget("1", settings); 2743 2744 // show nothing if fillEnabled is off 2745 addTarget("0", new VerticalConfigurationGroup(true)); 2746 }; 2747 }; 2748 2911 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MonitorDrives"); 2912 gc->setLabel(QObject::tr("Media Monitor")); 2913 gc->setHelpText(QObject::tr("This enables support for monitoring " 2914 "your CD/DVD drives for new disks and launching " 2915 "the proper plugin to handle them. Requires restart.")); 2916 gc->setValue(false); 2917 gc->addTargetedChild("1", IgnoreMedia()); 2918 return gc; 2919 } 2749 2920 2750 static HostComboBox *DisplayGroupTitleSort()2921 static HostComboBoxSetting *DisplayGroupTitleSort() 2751 2922 { 2752 HostComboBox *gc = new HostComboBox("DisplayGroupTitleSort");2923 HostComboBoxSetting *gc = new HostComboBoxSetting("DisplayGroupTitleSort"); 2753 2924 gc->setLabel(QObject::tr("Sort titles")); 2754 2925 gc->addSelection(QObject::tr("Alphabetically"), 2755 2926 QString::number(PlaybackBox::TitleSortAlphabetical)); … … static HostComboBox *DisplayGroupTitleSort() 2760 2931 return gc; 2761 2932 } 2762 2933 2763 static HostCheckBox *PlaybackWatchList() 2764 { 2765 HostCheckBox *gc = new HostCheckBox("PlaybackWatchList"); 2766 gc->setLabel(QObject::tr("Include the 'Watch List' group")); 2767 gc->setValue(true); 2768 gc->setHelpText(QObject::tr("The 'Watch List' is an abbreviated list of " 2769 "recordings sorted to highlight series and " 2770 "shows that need attention in order to " 2771 "keep up to date.")); 2772 return gc; 2773 } 2774 2775 static HostCheckBox *PlaybackWLStart() 2934 static HostCheckBoxSetting *PlaybackWLStart() 2776 2935 { 2777 HostCheckBox *gc = new HostCheckBox("PlaybackWLStart");2936 HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackWLStart"); 2778 2937 gc->setLabel(QObject::tr("Start from the Watch List view")); 2779 2938 gc->setValue(false); 2780 2939 gc->setHelpText(QObject::tr("If enabled, the 'Watch List' will be the " … … static HostCheckBox *PlaybackWLStart() 2783 2942 return gc; 2784 2943 } 2785 2944 2786 static HostCheckBox *PlaybackWLAutoExpire()2945 static HostCheckBoxSetting *PlaybackWLAutoExpire() 2787 2946 { 2788 HostCheckBox *gc = new HostCheckBox("PlaybackWLAutoExpire");2947 HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackWLAutoExpire"); 2789 2948 gc->setLabel(QObject::tr("Exclude recordings not set for Auto-Expire")); 2790 2949 gc->setValue(false); 2791 2950 gc->setHelpText(QObject::tr("Set this if you turn off Auto-Expire only " … … static HostCheckBox *PlaybackWLAutoExpire() 2795 2954 return gc; 2796 2955 } 2797 2956 2798 static HostSpinBox *PlaybackWLMaxAge()2957 static HostSpinBoxSetting *PlaybackWLMaxAge() 2799 2958 { 2800 HostSpinBox *gs = new HostSpinBox("PlaybackWLMaxAge", 30, 180, 10);2959 HostSpinBoxSetting *gs = new HostSpinBoxSetting("PlaybackWLMaxAge", 30, 180, 10); 2801 2960 gs->setLabel(QObject::tr("Maximum days counted in the score")); 2802 2961 gs->setValue(60); 2803 2962 gs->setHelpText(QObject::tr("The 'Watch List' scores are based on 1 point " … … static HostSpinBox *PlaybackWLMaxAge() 2807 2966 return gs; 2808 2967 } 2809 2968 2810 static HostSpinBox *PlaybackWLBlackOut()2969 static HostSpinBoxSetting *PlaybackWLBlackOut() 2811 2970 { 2812 HostSpinBox *gs = new HostSpinBox("PlaybackWLBlackOut", 0, 5, 1);2971 HostSpinBoxSetting *gs = new HostSpinBoxSetting("PlaybackWLBlackOut", 0, 5, 1); 2813 2972 gs->setLabel(QObject::tr("Days to exclude weekly episodes after delete")); 2814 2973 gs->setValue(2); 2815 2974 gs->setHelpText(QObject::tr("When an episode is deleted or marked as " … … static HostSpinBox *PlaybackWLBlackOut() 2820 2979 return gs; 2821 2980 } 2822 2981 2823 class WatchListSettings : public TriggeredConfigurationGroup 2982 static HostCheckBoxSetting *PlaybackWatchList() 2824 2983 { 2825 public: 2826 WatchListSettings() : 2827 TriggeredConfigurationGroup(false, false, true, true) 2828 { 2829 2830 Setting* watchList = PlaybackWatchList(); 2831 addChild(watchList); 2832 setTrigger(watchList); 2833 2834 ConfigurationGroup* settings = new VerticalConfigurationGroup(false); 2835 settings->addChild(PlaybackWLStart()); 2836 settings->addChild(PlaybackWLAutoExpire()); 2837 settings->addChild(PlaybackWLMaxAge()); 2838 settings->addChild(PlaybackWLBlackOut()); 2839 addTarget("1", settings); 2840 2841 addTarget("0", new VerticalConfigurationGroup(true)); 2842 }; 2843 }; 2984 HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackWatchList"); 2985 gc->setLabel(QObject::tr("Include the 'Watch List' group")); 2986 gc->setValue(true); 2987 gc->setHelpText(QObject::tr("The 'Watch List' is an abbreviated list of " 2988 "recordings sorted to highlight series and " 2989 "shows that need attention in order to " 2990 "keep up to date.")); 2991 2992 gc->addTargetedChild("1", PlaybackWLStart()); 2993 gc->addTargetedChild("1", PlaybackWLAutoExpire()); 2994 gc->addTargetedChild("1", PlaybackWLMaxAge()); 2995 gc->addTargetedChild("1", PlaybackWLBlackOut()); 2996 return gc; 2997 } 2844 2998 2845 static HostCheckBox *LCDShowTime()2999 static HostCheckBoxSetting *LCDShowTime() 2846 3000 { 2847 HostCheckBox *gc = new HostCheckBox("LCDShowTime");3001 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowTime"); 2848 3002 gc->setLabel(QObject::tr("Display time")); 2849 3003 gc->setHelpText(QObject::tr("Display current time on idle LCD display. ")); 2850 3004 gc->setValue(true); 2851 3005 return gc; 2852 3006 } 2853 3007 2854 static HostCheckBox *LCDShowRecStatus()3008 static HostCheckBoxSetting *LCDShowRecStatus() 2855 3009 { 2856 HostCheckBox *gc = new HostCheckBox("LCDShowRecStatus");3010 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowRecStatus"); 2857 3011 gc->setLabel(QObject::tr("Display recording status")); 2858 3012 gc->setHelpText(QObject::tr("Display current recordings information on " 2859 3013 "LCD display.")); … … static HostCheckBox *LCDShowRecStatus() 2861 3015 return gc; 2862 3016 } 2863 3017 2864 static HostCheckBox *LCDShowMenu()3018 static HostCheckBoxSetting *LCDShowMenu() 2865 3019 { 2866 HostCheckBox *gc = new HostCheckBox("LCDShowMenu");3020 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowMenu"); 2867 3021 gc->setLabel(QObject::tr("Display menus")); 2868 3022 gc->setHelpText(QObject::tr("Display selected menu on LCD display. ")); 2869 3023 gc->setValue(true); 2870 3024 return gc; 2871 3025 } 2872 3026 2873 static HostSpinBox *LCDPopupTime()3027 static HostSpinBoxSetting *LCDPopupTime() 2874 3028 { 2875 HostSpinBox *gs = new HostSpinBox("LCDPopupTime", 1, 300, 1, true);3029 HostSpinBoxSetting *gs = new HostSpinBoxSetting("LCDPopupTime", 1, 300, 1, true); 2876 3030 gs->setLabel(QObject::tr("Menu pop-up time")); 2877 3031 gs->setHelpText(QObject::tr("How many seconds the menu will " 2878 3032 "remain visible after navigation.")); … … static HostSpinBox *LCDPopupTime() 2880 3034 return gs; 2881 3035 } 2882 3036 2883 static HostCheckBox *LCDShowMusic()3037 static HostCheckBoxSetting *LCDShowMusic() 2884 3038 { 2885 HostCheckBox *gc = new HostCheckBox("LCDShowMusic");3039 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowMusic"); 2886 3040 gc->setLabel(QObject::tr("Display music artist and title")); 2887 3041 gc->setHelpText(QObject::tr("Display playing artist and song title in " 2888 3042 "MythMusic on LCD display.")); … … static HostCheckBox *LCDShowMusic() 2890 3044 return gc; 2891 3045 } 2892 3046 2893 static HostComboBox *LCDShowMusicItems()3047 static HostComboBoxSetting *LCDShowMusicItems() 2894 3048 { 2895 HostComboBox *gc = new HostComboBox("LCDShowMusicItems");3049 HostComboBoxSetting *gc = new HostComboBoxSetting("LCDShowMusicItems"); 2896 3050 gc->setLabel(QObject::tr("Items")); 2897 3051 gc->addSelection(QObject::tr("Artist - Title"), "ArtistTitle"); 2898 3052 gc->addSelection(QObject::tr("Artist [Album] Title"), "ArtistAlbumTitle"); … … static HostComboBox *LCDShowMusicItems() 2900 3054 return gc; 2901 3055 } 2902 3056 2903 static HostCheckBox *LCDShowChannel()3057 static HostCheckBoxSetting *LCDShowChannel() 2904 3058 { 2905 HostCheckBox *gc = new HostCheckBox("LCDShowChannel");3059 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowChannel"); 2906 3060 gc->setLabel(QObject::tr("Display channel information")); 2907 3061 gc->setHelpText(QObject::tr("Display tuned channel information on LCD display.")); 2908 3062 gc->setValue(true); 2909 3063 return gc; 2910 3064 } 2911 3065 2912 static HostCheckBox *LCDShowVolume()3066 static HostCheckBoxSetting *LCDShowVolume() 2913 3067 { 2914 HostCheckBox *gc = new HostCheckBox("LCDShowVolume");3068 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowVolume"); 2915 3069 gc->setLabel(QObject::tr("Display volume information")); 2916 3070 gc->setHelpText(QObject::tr("Display volume level information " 2917 3071 "on LCD display.")); … … static HostCheckBox *LCDShowVolume() 2919 3073 return gc; 2920 3074 } 2921 3075 2922 static HostCheckBox *LCDShowGeneric()3076 static HostCheckBoxSetting *LCDShowGeneric() 2923 3077 { 2924 HostCheckBox *gc = new HostCheckBox("LCDShowGeneric");3078 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowGeneric"); 2925 3079 gc->setLabel(QObject::tr("Display generic information")); 2926 3080 gc->setHelpText(QObject::tr("Display generic information on LCD display.")); 2927 3081 gc->setValue(true); 2928 3082 return gc; 2929 3083 } 2930 3084 2931 static HostCheckBox *LCDBacklightOn()3085 static HostCheckBoxSetting *LCDBacklightOn() 2932 3086 { 2933 HostCheckBox *gc = new HostCheckBox("LCDBacklightOn");3087 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDBacklightOn"); 2934 3088 gc->setLabel(QObject::tr("Backlight always on")); 2935 3089 gc->setHelpText(QObject::tr("Turn on the backlight permanently " 2936 3090 "on the LCD display.")); … … static HostCheckBox *LCDBacklightOn() 2938 3092 return gc; 2939 3093 } 2940 3094 2941 static HostCheckBox *LCDHeartBeatOn()3095 static HostCheckBoxSetting *LCDHeartBeatOn() 2942 3096 { 2943 HostCheckBox *gc = new HostCheckBox("LCDHeartBeatOn");3097 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDHeartBeatOn"); 2944 3098 gc->setLabel(QObject::tr("Heartbeat always on")); 2945 3099 gc->setHelpText(QObject::tr("Turn on the LCD heartbeat.")); 2946 3100 gc->setValue(false); 2947 3101 return gc; 2948 3102 } 2949 3103 2950 static HostCheckBox *LCDBigClock()3104 static HostCheckBoxSetting *LCDBigClock() 2951 3105 { 2952 HostCheckBox *gc = new HostCheckBox("LCDBigClock");3106 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDBigClock"); 2953 3107 gc->setLabel(QObject::tr("Display large clock")); 2954 3108 gc->setHelpText(QObject::tr("On multiline displays try and display the time as large as possible.")); 2955 3109 gc->setValue(false); 2956 3110 return gc; 2957 3111 } 2958 3112 2959 static Host LineEdit*LCDKeyString()3113 static HostTextEditSetting *LCDKeyString() 2960 3114 { 2961 Host LineEdit *ge = new HostLineEdit("LCDKeyString");3115 HostTextEditSetting *ge = new HostTextEditSetting("LCDKeyString"); 2962 3116 ge->setLabel(QObject::tr("LCD key order")); 2963 3117 ge->setValue("ABCDEF"); 2964 3118 ge->setHelpText(QObject::tr("Enter the 6 Keypad Return Codes for your " … … static HostLineEdit *LCDKeyString() 2969 3123 return ge; 2970 3124 } 2971 3125 2972 static HostCheckBox *LCDEnable()3126 static HostCheckBoxSetting *LCDEnable() 2973 3127 { 2974 HostCheckBox *gc = new HostCheckBox("LCDEnable");3128 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDEnable"); 2975 3129 gc->setLabel(QObject::tr("Enable LCD device")); 2976 3130 gc->setHelpText(QObject::tr("Use an LCD display to view MythTV status " 2977 3131 "information.")); 2978 3132 gc->setValue(false); 3133 gc->addTargetedChild("1",LCDShowTime()); 3134 gc->addTargetedChild("1",LCDShowMenu()); 3135 gc->addTargetedChild("1",LCDShowMusic()); 3136 gc->addTargetedChild("1",LCDShowMusicItems()); 3137 gc->addTargetedChild("1",LCDShowChannel()); 3138 gc->addTargetedChild("1",LCDShowRecStatus()); 3139 gc->addTargetedChild("1",LCDShowVolume()); 3140 gc->addTargetedChild("1",LCDShowGeneric()); 3141 gc->addTargetedChild("1",LCDBacklightOn()); 3142 gc->addTargetedChild("1",LCDHeartBeatOn()); 3143 gc->addTargetedChild("1",LCDBigClock()); 3144 gc->addTargetedChild("1",LCDKeyString()); 3145 gc->addTargetedChild("1",LCDPopupTime()); 2979 3146 return gc; 2980 3147 } 2981 3148 2982 class LcdSettings : public TriggeredConfigurationGroup2983 {2984 public:2985 LcdSettings() : TriggeredConfigurationGroup(false, false, false, false,2986 false, false, false, false)2987 {2988 setLabel(QObject::tr("LCD device display"));2989 setUseLabel(false);2990 2991 Setting* lcd_enable = LCDEnable();2992 addChild(lcd_enable);2993 setTrigger(lcd_enable);2994 2995 ConfigurationGroup *settings =2996 new VerticalConfigurationGroup(false, true, false, false);2997 ConfigurationGroup *setHoriz =2998 new HorizontalConfigurationGroup(false, false, false, false);2999 3000 ConfigurationGroup* setLeft =3001 new VerticalConfigurationGroup(false, false, false, false);3002 ConfigurationGroup* setRight =3003 new VerticalConfigurationGroup(false, false, false, false);3004 3005 setLeft->addChild(LCDShowTime());3006 setLeft->addChild(LCDShowMenu());3007 setLeft->addChild(LCDShowMusic());3008 setLeft->addChild(LCDShowMusicItems());3009 setLeft->addChild(LCDShowChannel());3010 setLeft->addChild(LCDShowRecStatus());3011 setRight->addChild(LCDShowVolume());3012 setRight->addChild(LCDShowGeneric());3013 setRight->addChild(LCDBacklightOn());3014 setRight->addChild(LCDHeartBeatOn());3015 setRight->addChild(LCDBigClock());3016 setRight->addChild(LCDKeyString());3017 setHoriz->addChild(setLeft);3018 setHoriz->addChild(setRight);3019 settings->addChild(setHoriz);3020 settings->addChild(LCDPopupTime());3021 3022 addTarget("1", settings);3023 3024 addTarget("0", new VerticalConfigurationGroup(true));3025 };3026 };3027 3028 3149 3029 3150 #if CONFIG_DARWIN 3030 static HostCheckBox *MacGammaCorrect()3151 static HostCheckBoxSetting *MacGammaCorrect() 3031 3152 { 3032 HostCheckBox *gc = new HostCheckBox("MacGammaCorrect");3153 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacGammaCorrect"); 3033 3154 gc->setLabel(QObject::tr("Enable gamma correction for video")); 3034 3155 gc->setValue(false); 3035 3156 gc->setHelpText(QObject::tr("If enabled, QuickTime will correct the gamma " … … static HostCheckBox *MacGammaCorrect() 3038 3159 return gc; 3039 3160 } 3040 3161 3041 static HostCheckBox *MacScaleUp()3162 static HostCheckBoxSetting *MacScaleUp() 3042 3163 { 3043 HostCheckBox *gc = new HostCheckBox("MacScaleUp");3164 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacScaleUp"); 3044 3165 gc->setLabel(QObject::tr("Scale video as necessary")); 3045 3166 gc->setValue(true); 3046 3167 gc->setHelpText(QObject::tr("If enabled, video will be scaled to fit your " … … static HostCheckBox *MacScaleUp() 3049 3170 return gc; 3050 3171 } 3051 3172 3052 static HostSpinBox *MacFullSkip()3173 static HostSpinBoxSetting *MacFullSkip() 3053 3174 { 3054 HostSpinBox *gs = new HostSpinBox("MacFullSkip", 0, 30, 1, true);3175 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFullSkip", 0, 30, 1, true); 3055 3176 gs->setLabel(QObject::tr("Frames to skip in fullscreen mode")); 3056 3177 gs->setValue(0); 3057 3178 gs->setHelpText(QObject::tr("Video displayed in fullscreen or non-windowed " … … static HostSpinBox *MacFullSkip() 3062 3183 return gs; 3063 3184 } 3064 3185 3065 static HostCheckBox *MacMainEnabled()3066 {3067 HostCheckBox *gc = new HostCheckBox("MacMainEnabled");3068 gc->setLabel(QObject::tr("Video in main window"));3069 gc->setValue(true);3070 gc->setHelpText(QObject::tr("If enabled, video will be displayed in the "3071 "main GUI window. Disable this when you only want video "3072 "on the desktop or in a floating window. Only valid when "3073 "\"Use GUI size for TV playback\" and \"Run the "3074 "frontend in a window\" are checked."));3075 return gc;3076 }3077 3186 3078 static HostSpinBox *MacMainSkip() 3187 3188 static HostSpinBoxSetting *MacMainSkip() 3079 3189 { 3080 HostSpinBox *gs = new HostSpinBox("MacMainSkip", 0, 30, 1, true);3190 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainSkip", 0, 30, 1, true); 3081 3191 gs->setLabel(QObject::tr("Frames to skip")); 3082 3192 gs->setValue(0); 3083 3193 gs->setHelpText(QObject::tr("Video in the main window will skip this many " … … static HostSpinBox *MacMainSkip() 3086 3196 return gs; 3087 3197 } 3088 3198 3089 static HostSpinBox *MacMainOpacity()3199 static HostSpinBoxSetting *MacMainOpacity() 3090 3200 { 3091 HostSpinBox *gs = new HostSpinBox("MacMainOpacity", 0, 100, 5, false);3201 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainOpacity", 0, 100, 5, false); 3092 3202 gs->setLabel(QObject::tr("Opacity")); 3093 3203 gs->setValue(100); 3094 3204 gs->setHelpText(QObject::tr("The opacity of the main window. Set to " … … static HostSpinBox *MacMainOpacity() 3097 3207 return gs; 3098 3208 } 3099 3209 3100 class MacMainSettings : public TriggeredConfigurationGroup 3210 static HostCheckBoxSetting *MacMainEnabled() 3101 3211 { 3102 public: 3103 MacMainSettings() : TriggeredConfigurationGroup(false) 3104 { 3105 setLabel(QObject::tr("Video in main window")); 3106 setUseLabel(false); 3107 Setting *gc = MacMainEnabled(); 3108 addChild(gc); 3109 setTrigger(gc); 3110 3111 VerticalConfigurationGroup *opts = 3112 new VerticalConfigurationGroup(false, false); 3113 opts->addChild(MacMainSkip()); 3114 opts->addChild(MacMainOpacity()); 3115 3116 addTarget("1", opts); 3117 addTarget("0", new VerticalConfigurationGroup(false, false)); 3118 } 3119 }; 3212 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacMainEnabled"); 3213 gc->setLabel(QObject::tr("Video in main window")); 3214 gc->setValue(true); 3215 gc->setHelpText(QObject::tr("If enabled, video will be displayed in the " 3216 "main GUI window. Disable this when you only want video " 3217 "on the desktop or in a floating window. Only valid when " 3218 "\"Use GUI size for TV playback\" and \"Run the " 3219 "frontend in a window\" are checked.")); 3120 3220 3121 static HostCheckBox *MacFloatEnabled() 3122 { 3123 HostCheckBox *gc = new HostCheckBox("MacFloatEnabled"); 3124 gc->setLabel(QObject::tr("Video in floating window")); 3125 gc->setValue(false); 3126 gc->setHelpText(QObject::tr("If enabled, video will be displayed in a " 3127 "floating window. Only valid when \"Use GUI size for TV " 3128 "playback\" and \"Run the frontend in a window\" are " 3129 "checked.")); 3221 gc->addTargetedChild("1", MacMainSkip()); 3222 gc->addTargetedChild("1", MacMainOpacity()); 3130 3223 return gc; 3131 3224 } 3132 3225 3133 static HostSpinBox *MacFloatSkip()3226 static HostSpinBoxSetting *MacFloatSkip() 3134 3227 { 3135 HostSpinBox *gs = new HostSpinBox("MacFloatSkip", 0, 30, 1, true);3228 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatSkip", 0, 30, 1, true); 3136 3229 gs->setLabel(QObject::tr("Frames to skip")); 3137 3230 gs->setValue(0); 3138 3231 gs->setHelpText(QObject::tr("Video in the floating window will skip " … … static HostSpinBox *MacFloatSkip() 3141 3234 return gs; 3142 3235 } 3143 3236 3144 static HostSpinBox *MacFloatOpacity()3237 static HostSpinBoxSetting *MacFloatOpacity() 3145 3238 { 3146 HostSpinBox *gs = new HostSpinBox("MacFloatOpacity", 0, 100, 5, false);3239 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatOpacity", 0, 100, 5, false); 3147 3240 gs->setLabel(QObject::tr("Opacity")); 3148 3241 gs->setValue(100); 3149 3242 gs->setHelpText(QObject::tr("The opacity of the floating window. Set to " … … static HostSpinBox *MacFloatOpacity() 3152 3245 return gs; 3153 3246 } 3154 3247 3155 class MacFloatSettings : public TriggeredConfigurationGroup 3248 static HostCheckBoxSetting *MacFloatEnabled() 3156 3249 { 3157 public: 3158 MacFloatSettings() : TriggeredConfigurationGroup(false) 3159 { 3160 setLabel(QObject::tr("Video in floating window")); 3161 setUseLabel(false); 3162 Setting *gc = MacFloatEnabled(); 3163 addChild(gc); 3164 setTrigger(gc); 3250 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacFloatEnabled"); 3251 gc->setLabel(QObject::tr("Video in floating window")); 3252 gc->setValue(false); 3253 gc->setHelpText(QObject::tr("If enabled, video will be displayed in a " 3254 "floating window. Only valid when \"Use GUI size for TV " 3255 "playback\" and \"Run the frontend in a window\" are " 3256 "checked.")); 3165 3257 3166 VerticalConfigurationGroup *opts =3167 new VerticalConfigurationGroup(false, false);3168 opts->addChild(MacFloatSkip());3169 opts->addChild(MacFloatOpacity()); 3258 gc->addTargetedChild("1", MacFloatSkip()); 3259 gc->addTargetedChild("1", MacFloatOpacity()); 3260 return gc; 3261 } 3170 3262 3171 addTarget("1", opts); 3172 addTarget("0", new VerticalConfigurationGroup(false, false)); 3173 } 3174 }; 3263 static HostSpinBoxSetting *MacDockSkip() 3264 { 3265 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDockSkip", 0, 30, 1, true); 3266 gs->setLabel(QObject::tr("Frames to skip")); 3267 gs->setValue(3); 3268 gs->setHelpText(QObject::tr("Video in the dock icon will skip this many " 3269 "frames for each frame drawn. Set to 0 to show " 3270 "every frame.")); 3271 return gs; 3272 } 3175 3273 3176 static HostCheckBox *MacDockEnabled()3274 static HostCheckBoxSetting *MacDockEnabled() 3177 3275 { 3178 HostCheckBox *gc = new HostCheckBox("MacDockEnabled");3276 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDockEnabled"); 3179 3277 gc->setLabel(QObject::tr("Video in the dock")); 3180 3278 gc->setValue(true); 3181 3279 gc->setHelpText(QObject::tr("If enabled, video will be displayed in the " 3182 3280 "application's dock icon. Only valid when \"Use GUI size " 3183 3281 "for TV playback\" and \"Run the frontend in a window\" " 3184 3282 "are checked.")); 3283 gc->addTargetedChild("1", MacDockSkip()); 3284 3185 3285 return gc; 3186 3286 } 3187 3287 3188 static HostSpinBox *MacDockSkip()3288 static HostSpinBoxSetting *MacDesktopSkip() 3189 3289 { 3190 HostSpinBox *gs = new HostSpinBox("MacDockSkip", 0, 30, 1, true);3290 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDesktopSkip", 0, 30, 1, true); 3191 3291 gs->setLabel(QObject::tr("Frames to skip")); 3192 gs->setValue( 3);3193 gs->setHelpText(QObject::tr("Video in the dock iconwill skip this many "3292 gs->setValue(0); 3293 gs->setHelpText(QObject::tr("Video on the desktop will skip this many " 3194 3294 "frames for each frame drawn. Set to 0 to show " 3195 3295 "every frame.")); 3196 3296 return gs; 3197 3297 } 3198 3298 3199 class MacDockSettings : public TriggeredConfigurationGroup 3200 { 3201 public: 3202 MacDockSettings() : TriggeredConfigurationGroup(false) 3203 { 3204 setLabel(QObject::tr("Video in the dock")); 3205 setUseLabel(false); 3206 Setting *gc = MacDockEnabled(); 3207 addChild(gc); 3208 setTrigger(gc); 3209 3210 Setting *skip = MacDockSkip(); 3211 addTarget("1", skip); 3212 addTarget("0", new HorizontalConfigurationGroup(false, false)); 3213 } 3214 }; 3215 3216 static HostCheckBox *MacDesktopEnabled() 3299 static HostCheckBoxSetting *MacDesktopEnabled() 3217 3300 { 3218 HostCheckBox *gc = new HostCheckBox("MacDesktopEnabled");3301 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDesktopEnabled"); 3219 3302 gc->setLabel(QObject::tr("Video on the desktop")); 3220 3303 gc->setValue(false); 3221 3304 gc->setHelpText(QObject::tr("If enabled, video will be displayed on the " 3222 3305 "desktop, behind the Finder icons. Only valid when \"Use " 3223 3306 "GUI size for TV playback\" and \"Run the frontend in a " 3224 3307 "window\" are checked.")); 3308 3309 gc->addTarget("1", MacDesktopSkip()); 3310 3225 3311 return gc; 3226 3312 } 3227 3313 3228 static HostSpinBox *MacDesktopSkip() 3314 #endif 3315 3316 static HostCheckBoxSetting *WatchTVGuide() 3229 3317 { 3230 HostSpinBox *gs = new HostSpinBox("MacDesktopSkip", 0, 30, 1, true); 3231 gs->setLabel(QObject::tr("Frames to skip")); 3232 gs->setValue(0); 3233 gs->setHelpText(QObject::tr("Video on the desktop will skip this many " 3234 "frames for each frame drawn. Set to 0 to show " 3235 "every frame.")); 3236 return gs; 3318 HostCheckBoxSetting *gc = new HostCheckBoxSetting("WatchTVGuide"); 3319 gc->setLabel(QObject::tr("Show the program guide when starting Live TV")); 3320 gc->setHelpText(QObject::tr("This starts the program guide immediately " 3321 "upon starting to watch Live TV.")); 3322 gc->setValue(false); 3323 return gc; 3237 3324 } 3238 3325 3239 class MacDesktopSettings : public TriggeredConfigurationGroup 3326 3327 /* This code is a duplication the class DatabaseSettings. As it it also use bymythbackend I rewrote here for the time being */ 3328 3329 class DatabaseGroupSetting : public GroupSetting 3240 3330 { 3241 3331 public: 3242 MacDesktopSettings() : TriggeredConfigurationGroup(false)3332 DatabaseGroupSetting(const QString &DBhostOverride = QString::null):GroupSetting() 3243 3333 { 3244 setLabel(QObject::tr("Video on the desktop")); 3245 setUseLabel(false); 3246 Setting *gc = MacDesktopEnabled(); 3247 addChild(gc); 3248 setTrigger(gc); 3249 3250 Setting *skip = MacDesktopSkip(); 3251 addTarget("1", skip); 3252 addTarget("0", new HorizontalConfigurationGroup(false, false)); 3334 m_DBhostOverride = DBhostOverride; 3335 3336 setLabel(QObject::tr("Database Configuration")); 3337 3338 MSqlQuery query(MSqlQuery::InitCon()); 3339 if (query.isConnected()) 3340 setHelpText(QObject::tr("All database settings take effect when " 3341 "you restart this program.")); 3342 else 3343 setHelpText(QObject::tr("MythTV could not connect to the database. " 3344 "Please verify your database settings " 3345 "below.")); 3346 3347 dbHostName = new TransTextEditSetting(); 3348 dbHostName->setLabel(QObject::tr("Hostname")); 3349 dbHostName->setHelpText(QObject::tr("The host name or IP address of " 3350 "the machine hosting the database. " 3351 "This information is required.")); 3352 addChild(dbHostName); 3353 3354 dbHostPing = new TransMythUICheckBoxSetting(); 3355 dbHostPing->setLabel(QObject::tr("Ping test server?")); 3356 dbHostPing->setHelpText(QObject::tr("Test basic host connectivity using " 3357 "the ping command. Turn off if your " 3358 "host or network don't support ping " 3359 "(ICMP ECHO) packets")); 3360 addChild(dbHostPing); 3361 3362 dbPort = new TransTextEditSetting(); 3363 dbPort->setLabel(QObject::tr("Port")); 3364 dbPort->setHelpText(QObject::tr("The port number the database is running " 3365 "on. Leave blank if using the default " 3366 "port (3306).")); 3367 addChild(dbPort); 3368 3369 dbName = new TransTextEditSetting(); 3370 dbName->setLabel(QObject::tr("Database name")); 3371 dbName->setHelpText(QObject::tr("The name of the database. " 3372 "This information is required.")); 3373 addChild(dbName); 3374 3375 dbUserName = new TransTextEditSetting(); 3376 dbUserName->setLabel(QObject::tr("User")); 3377 dbUserName->setHelpText(QObject::tr("The user name to use while " 3378 "connecting to the database. " 3379 "This information is required.")); 3380 addChild(dbUserName); 3381 3382 dbPassword = new TransTextEditSetting(); 3383 dbPassword->setLabel(QObject::tr("Password")); 3384 dbPassword->setHelpText(QObject::tr("The password to use while " 3385 "connecting to the database. " 3386 "This information is required.")); 3387 addChild(dbPassword); 3388 3389 localEnabled = new TransMythUICheckBoxSetting(); 3390 localEnabled->setLabel(QObject::tr("Use custom identifier for frontend " 3391 "preferences")); 3392 localEnabled->setHelpText(QObject::tr("If this frontend's host name " 3393 "changes often, check this box " 3394 "and provide a network-unique " 3395 "name to identify it. " 3396 "If unchecked, the frontend " 3397 "machine's local host name will " 3398 "be used to save preferences in " 3399 "the database.")); 3400 addChild(localEnabled); 3401 3402 3403 localHostName = new TransTextEditSetting(); 3404 localHostName->setLabel(QObject::tr("Custom identifier")); 3405 localHostName->setHelpText(QObject::tr("An identifier to use while " 3406 "saving the settings for this " 3407 "frontend.")); 3408 localEnabled->addTargetedChild("1", localHostName); 3409 3410 3411 wolEnabled = new TransMythUICheckBoxSetting(); 3412 wolEnabled->setLabel(QObject::tr("Enable database server wakeup")); 3413 wolEnabled->setHelpText(QObject::tr("If enabled, the frontend will use " 3414 "database wakeup parameters to " 3415 "reconnect to the database server.")); 3416 addChild(wolEnabled); 3417 3418 wolReconnect = new TransMythUISpinBoxSetting(0, 60, 1, true); 3419 wolReconnect->setLabel(QObject::tr("Reconnect time")); 3420 wolReconnect->setHelpText(QObject::tr("The time in seconds to wait for " 3421 "the server to wake up.")); 3422 wolEnabled->addTargetedChild("1",wolReconnect); 3423 3424 3425 wolRetry = new TransMythUISpinBoxSetting(1, 10, 1, true); 3426 wolRetry->setLabel(QObject::tr("Retry attempts")); 3427 wolRetry->setHelpText(QObject::tr("The number of retries to wake the " 3428 "server before the frontend gives " 3429 "up.")); 3430 wolEnabled->addTargetedChild("1",wolRetry); 3431 3432 wolCommand = new TransTextEditSetting(); 3433 wolCommand->setLabel(QObject::tr("Wake command")); 3434 wolCommand->setHelpText(QObject::tr("The command executed on this " 3435 "frontend to wake up the database " 3436 "server (eg. sudo /etc/init.d/mysql " 3437 "restart).")); 3438 wolEnabled->addTargetedChild("1",wolCommand); 3253 3439 } 3440 3441 void Load(void) 3442 { 3443 LOG(VB_GENERAL, LOG_ERR, QString("DatabaseGroupSetting::Load()")); 3444 3445 DatabaseParams params = gContext->GetDatabaseParams(); 3446 3447 if (params.dbHostName.isEmpty() || 3448 params.dbUserName.isEmpty() || 3449 params.dbPassword.isEmpty() || 3450 params.dbName.isEmpty()) 3451 setHelpText(getHelpText() + "\n" + 3452 QObject::tr("Required fields are" 3453 " marked with an asterisk (*).")); 3454 3455 if (params.dbHostName.isEmpty()) 3456 { 3457 dbHostName->setLabel("* " + dbHostName->getLabel()); 3458 dbHostName->setValue(m_DBhostOverride); 3459 } 3460 else 3461 dbHostName->setValue(params.dbHostName); 3462 3463 dbHostPing->setValue(params.dbHostPing); 3464 3465 if (params.dbPort) 3466 dbPort->setValue(QString::number(params.dbPort)); 3467 3468 dbUserName->setValue(params.dbUserName); 3469 if (params.dbUserName.isEmpty()) 3470 dbUserName->setLabel("* " + dbUserName->getLabel()); 3471 dbPassword->setValue(params.dbPassword); 3472 if (params.dbPassword.isEmpty()) 3473 dbPassword->setLabel("* " + dbPassword->getLabel()); 3474 dbName->setValue(params.dbName); 3475 if (params.dbName.isEmpty()) 3476 dbName->setLabel("* " + dbName->getLabel()); 3477 3478 localEnabled->setValue(params.localEnabled); 3479 localHostName->setValue(params.localHostName); 3480 3481 wolEnabled->setValue(params.wolEnabled); 3482 wolReconnect->setValue(params.wolReconnect); 3483 wolRetry->setValue(params.wolRetry); 3484 wolCommand->setValue(params.wolCommand); 3485 //set all the children's m_haveChanged to false 3486 GroupSetting::Load(); 3487 }; 3488 void Save(void) 3489 { 3490 DatabaseParams params = gContext->GetDatabaseParams(); 3491 3492 params.dbHostName = dbHostName->getValue(); 3493 params.dbHostPing = dbHostPing->boolValue(); 3494 params.dbPort = dbPort->getValue().toInt(); 3495 params.dbUserName = dbUserName->getValue(); 3496 params.dbPassword = dbPassword->getValue(); 3497 params.dbName = dbName->getValue(); 3498 params.dbType = "QMYSQL"; 3499 3500 params.localEnabled = localEnabled->boolValue(); 3501 params.localHostName = localHostName->getValue(); 3502 3503 params.wolEnabled = wolEnabled->boolValue(); 3504 params.wolReconnect = wolReconnect->intValue(); 3505 params.wolRetry = wolRetry->intValue(); 3506 params.wolCommand = wolCommand->getValue(); 3507 3508 gContext->SaveDatabaseParams(params); 3509 //set all the children's m_haveChanged to false 3510 GroupSetting::Save(); 3511 }; 3512 3513 protected: 3514 TransTextEditSetting *dbHostName; 3515 TransMythUICheckBoxSetting *dbHostPing; 3516 TransTextEditSetting *dbPort; 3517 TransTextEditSetting *dbName; 3518 TransTextEditSetting *dbUserName; 3519 TransTextEditSetting *dbPassword; 3520 TransMythUICheckBoxSetting *localEnabled; 3521 TransTextEditSetting *localHostName; 3522 TransMythUICheckBoxSetting *wolEnabled; 3523 TransMythUISpinBoxSetting *wolReconnect; 3524 TransMythUISpinBoxSetting *wolRetry; 3525 TransTextEditSetting *wolCommand; 3526 3527 QString m_DBhostOverride; 3254 3528 }; 3255 #endif3256 3529 3257 static HostCheckBox *WatchTVGuide() 3530 /* end of duplicated code form DatabaseSettings */ 3531 3532 3533 class ShutDownRebootSetting : public GroupSetting 3258 3534 { 3259 HostCheckBox *gc = new HostCheckBox("WatchTVGuide"); 3260 gc->setLabel(QObject::tr("Show the program guide when starting Live TV")); 3261 gc->setHelpText(QObject::tr("This starts the program guide immediately " 3262 "upon starting to watch Live TV.")); 3263 gc->setValue(false); 3264 return gc; 3535 public: 3536 ShutDownRebootSetting(); 3537 private slots: 3538 void childChanged(StandardSetting *); 3539 private: 3540 StandardSetting * m_overrideExitMenu; 3541 StandardSetting * m_haltCommand; 3542 StandardSetting * m_rebootCommand; 3543 3544 }; 3545 3546 ShutDownRebootSetting::ShutDownRebootSetting() 3547 :GroupSetting() 3548 { 3549 setLabel(QObject::tr("Shutdown/Reboot Settings")); 3550 addChild(m_overrideExitMenu = OverrideExitMenu()); 3551 addChild(m_haltCommand = HaltCommand()); 3552 addChild(m_rebootCommand = RebootCommand()); 3553 connect(m_overrideExitMenu,SIGNAL(valueChanged(StandardSetting *)), 3554 this,SLOT(childChanged(StandardSetting *))); 3555 } 3556 3557 void ShutDownRebootSetting::childChanged(StandardSetting *) 3558 { 3559 switch (m_overrideExitMenu->getValue().toInt()) 3560 { 3561 case 2: 3562 case 4: 3563 m_haltCommand->setEnabled(true); 3564 m_rebootCommand->setEnabled(false); 3565 break; 3566 case 3: 3567 case 6: 3568 m_haltCommand->setEnabled(true); 3569 m_rebootCommand->setEnabled(true); 3570 break; 3571 case 5: 3572 m_haltCommand->setEnabled(false); 3573 m_rebootCommand->setEnabled(true); 3574 break; 3575 case 0: 3576 case 1: 3577 default: 3578 m_haltCommand->setEnabled(false); 3579 m_rebootCommand->setEnabled(false); 3580 break; 3581 } 3265 3582 } 3266 3583 3584 3267 3585 MainGeneralSettings::MainGeneralSettings() 3268 3586 { 3269 DatabaseSettings::addDatabaseSettings(this); 3587 //DatabaseSettings::addDatabaseSettings(this); 3588 setLabel(QObject::tr("Main Settings")); 3589 3590 addChild(new DatabaseGroupSetting()); 3270 3591 3271 VerticalConfigurationGroup *pin = 3272 new VerticalConfigurationGroup(false, true, false, false); 3592 GroupSetting *pin = new GroupSetting(); 3273 3593 pin->setLabel(QObject::tr("Settings Access")); 3274 3594 pin->addChild(SetupPinCodeRequired()); 3275 3595 pin->addChild(SetupPinCode()); 3276 3596 addChild(pin); 3277 3597 3278 VerticalConfigurationGroup *general = 3279 new VerticalConfigurationGroup(false, true, false, false); 3598 GroupSetting *general = new GroupSetting(); 3280 3599 general->setLabel(QObject::tr("General")); 3281 3600 general->addChild(UseVirtualKeyboard()); 3282 3601 general->addChild(ScreenShotPath()); 3283 3602 addChild(general); 3284 3603 3285 VerticalConfigurationGroup *media = 3286 new VerticalConfigurationGroup(false, true, false, false); 3287 media->setLabel(QObject::tr("Media Monitor")); 3288 MythMediaSettings *mediaMon = new MythMediaSettings(); 3289 media->addChild(mediaMon); 3290 addChild(media); 3291 3292 VerticalConfigurationGroup *shutdownSettings = 3293 new VerticalConfigurationGroup(true, true, false, false); 3294 shutdownSettings->setLabel(QObject::tr("Shutdown/Reboot Settings")); 3295 shutdownSettings->addChild(OverrideExitMenu()); 3296 shutdownSettings->addChild(HaltCommand()); 3297 shutdownSettings->addChild(RebootCommand()); 3298 addChild(shutdownSettings); 3299 3300 VerticalConfigurationGroup *remotecontrol = 3301 new VerticalConfigurationGroup(false, true, false, false); 3604 addChild(EnableMediaMon()); 3605 3606 addChild(new ShutDownRebootSetting()); 3607 3608 GroupSetting *remotecontrol = new GroupSetting(); 3302 3609 remotecontrol->setLabel(QObject::tr("Remote Control")); 3303 3610 remotecontrol->addChild(LircDaemonDevice()); 3304 3611 remotecontrol->addChild(NetworkControlEnabled()); 3305 remotecontrol->addChild(NetworkControlPort());3306 remotecontrol->addChild(UDPNotifyPort());3307 3612 addChild(remotecontrol); 3308 3613 } 3309 3614 3615 void MainGeneralSettings::applyChange() 3616 { 3617 QStringList strlist( QString("REFRESH_BACKEND") ); 3618 gCoreContext->SendReceiveStringList(strlist); 3619 } 3620 3621 3622 class PlayBackScaling : public GroupSetting 3623 { 3624 public: 3625 PlayBackScaling(); 3626 virtual void updateButton(MythUIButtonListItem *item); 3627 3628 private slots: 3629 virtual void childChanged(StandardSetting *); 3630 private: 3631 StandardSetting * m_VertScan; 3632 StandardSetting * m_HorizScan; 3633 StandardSetting * m_XScan; 3634 StandardSetting * m_YScan; 3635 }; 3636 3637 PlayBackScaling::PlayBackScaling() 3638 :GroupSetting() 3639 { 3640 setLabel(QObject::tr("Scaling")); 3641 addChild(m_VertScan = VertScanPercentage()); 3642 addChild(m_YScan = YScanDisplacement()); 3643 addChild(m_HorizScan = HorizScanPercentage()); 3644 addChild(m_XScan = XScanDisplacement()); 3645 connect(m_VertScan,SIGNAL(valueChanged(StandardSetting *)), 3646 this,SLOT(childChanged(StandardSetting *))); 3647 connect(m_YScan,SIGNAL(valueChanged(StandardSetting *)), 3648 this,SLOT(childChanged(StandardSetting *))); 3649 connect(m_HorizScan,SIGNAL(valueChanged(StandardSetting *)), 3650 this,SLOT(childChanged(StandardSetting *))); 3651 connect(m_XScan,SIGNAL(valueChanged(StandardSetting *)), 3652 this,SLOT(childChanged(StandardSetting *))); 3653 } 3654 3655 3656 void PlayBackScaling::updateButton(MythUIButtonListItem *item) 3657 { 3658 GroupSetting::updateButton(item); 3659 if ( m_VertScan->getValue()=="0" 3660 && m_HorizScan->getValue()=="0" 3661 && m_YScan->getValue()=="0" 3662 && m_XScan->getValue()=="0") 3663 item->SetText(QObject::tr("No scaling"),"value"); 3664 else 3665 item->SetText(QString("%1%x%2%+%3%+%4%") 3666 .arg(m_HorizScan->getValue()) 3667 .arg(m_VertScan->getValue()) 3668 .arg(m_XScan->getValue()) 3669 .arg(m_YScan->getValue()),"value"); 3670 } 3671 3672 void PlayBackScaling::childChanged(StandardSetting *) 3673 { 3674 emit ShouldRedraw(this); 3675 } 3676 3310 3677 PlaybackSettings::PlaybackSettings() 3311 3678 { 3312 uint i = 0, total = 8; 3313 #if CONFIG_DARWIN 3314 total += 2; 3315 #endif // USING_DARWIN 3679 setLabel(QObject::tr("Playback settings")); 3316 3680 3681 GroupSetting* general = new GroupSetting(); 3682 general->setLabel(QObject::tr("General Playback")); 3683 general->addChild(RealtimePriority()); 3684 general->addChild(DecodeExtraAudio()); 3685 general->addChild(JumpToProgramOSD()); 3686 general->addChild(ClearSavedPosition()); 3687 general->addChild(AltClearSavedPosition()); 3688 general->addChild(AutomaticSetWatched()); 3689 general->addChild(ContinueEmbeddedTVPlay()); 3690 general->addChild(LiveTVIdleTimeout()); 3317 3691 3318 VerticalConfigurationGroup* general1 = 3319 new VerticalConfigurationGroup(false); 3320 general1->setLabel(QObject::tr("General Playback") + 3321 QString(" (%1/%2)").arg(++i).arg(total)); 3692 general->addChild(new PlayBackScaling()); 3322 3693 3323 HorizontalConfigurationGroup *columns =3324 new HorizontalConfigurationGroup(false, false, true, true);3694 general->addChild(AspectOverride()); 3695 general->addChild(AdjustFill()); 3325 3696 3326 VerticalConfigurationGroup *column1 = 3327 new VerticalConfigurationGroup(false, false, true, true); 3328 column1->addChild(RealtimePriority()); 3329 column1->addChild(DecodeExtraAudio()); 3330 column1->addChild(JumpToProgramOSD()); 3331 columns->addChild(column1); 3697 general->addChild(LetterboxingColour()); 3698 general->addChild(PIPLocationComboBox()); 3699 general->addChild(PlaybackExitPrompt()); 3700 general->addChild(EndOfRecordingExitPrompt()); 3701 addChild(general); 3332 3702 3333 VerticalConfigurationGroup *column2 = 3334 new VerticalConfigurationGroup(false, false, true, true); 3335 column2->addChild(ClearSavedPosition()); 3336 column2->addChild(AltClearSavedPosition()); 3337 column2->addChild(AutomaticSetWatched()); 3338 column2->addChild(ContinueEmbeddedTVPlay()); 3339 columns->addChild(column2); 3340 3341 general1->addChild(columns); 3342 general1->addChild(LiveTVIdleTimeout()); 3343 addChild(general1); 3344 3345 VerticalConfigurationGroup* general2 = 3346 new VerticalConfigurationGroup(false); 3347 general2->setLabel(QObject::tr("General Playback") + 3348 QString(" (%1/%2)").arg(++i).arg(total)); 3349 3350 HorizontalConfigurationGroup* oscan = 3351 new HorizontalConfigurationGroup(false, false, true, true); 3352 VerticalConfigurationGroup *ocol1 = 3353 new VerticalConfigurationGroup(false, false, true, true); 3354 VerticalConfigurationGroup *ocol2 = 3355 new VerticalConfigurationGroup(false, false, true, true); 3356 ocol1->addChild(VertScanPercentage()); 3357 ocol1->addChild(YScanDisplacement()); 3358 ocol2->addChild(HorizScanPercentage()); 3359 ocol2->addChild(XScanDisplacement()); 3360 oscan->addChild(ocol1); 3361 oscan->addChild(ocol2); 3362 3363 HorizontalConfigurationGroup* aspect_fill = 3364 new HorizontalConfigurationGroup(false, false, true, true); 3365 aspect_fill->addChild(AspectOverride()); 3366 aspect_fill->addChild(AdjustFill()); 3367 3368 general2->addChild(oscan); 3369 general2->addChild(aspect_fill); 3370 general2->addChild(LetterboxingColour()); 3371 general2->addChild(PIPLocationComboBox()); 3372 general2->addChild(PlaybackExitPrompt()); 3373 general2->addChild(EndOfRecordingExitPrompt()); 3374 addChild(general2); 3703 addChild(CurrentPlaybackProfile()); 3375 3704 3376 QString tmp = QString(" (%1/%2)").arg(++i).arg(total);3377 addChild(new PlaybackProfileConfigs(tmp));3378 3705 3379 VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false); 3380 pbox->setLabel(QObject::tr("View Recordings") + 3381 QString(" (%1/%2)").arg(++i).arg(total)); 3706 GroupSetting* pbox = new GroupSetting(); 3707 pbox->setLabel(QObject::tr("View Recordings")); 3382 3708 pbox->addChild(PlayBoxOrdering()); 3383 3709 pbox->addChild(PlayBoxEpisodeSort()); 3384 3710 // Disabled until we re-enable live previews 3385 3711 // pbox->addChild(PlaybackPreview()); 3386 3712 // pbox->addChild(HWAccelPlaybackPreview()); 3387 3713 pbox->addChild(PBBStartInTitle()); 3388 addChild(pbox);3389 3714 3390 VerticalConfigurationGroup* pbox2 = new VerticalConfigurationGroup(false); 3391 pbox2->setLabel(QObject::tr("Recording Groups") +3392 QString(" (%1/%2)").arg(++i).arg(total));3715 3716 GroupSetting* pbox2 = new GroupSetting(); 3717 pbox2->setLabel(QObject::tr("Recording Groups")); 3393 3718 pbox2->addChild(DisplayRecGroup()); 3394 3719 pbox2->addChild(QueryInitialFilter()); 3395 3720 pbox2->addChild(RememberRecGroup()); 3396 3721 pbox2->addChild(UseGroupNameAsAllPrograms()); 3397 addChild(pbox2); 3398 3399 VerticalConfigurationGroup* pbox3 = new VerticalConfigurationGroup(false); 3400 pbox3->setLabel(QObject::tr("View Recordings") + 3401 QString(" (%1/%2)").arg(++i).arg(total)); 3402 pbox3->addChild(DisplayGroupTitleSort()); 3403 pbox3->addChild(new WatchListSettings()); 3404 addChild(pbox3); 3405 3406 VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false); 3407 seek->setLabel(QObject::tr("Seeking") + 3408 QString(" (%1/%2)").arg(++i).arg(total)); 3722 pbox->addChild(pbox2); 3723 3724 pbox->addChild(DisplayGroupTitleSort()); 3725 pbox->addChild(PlaybackWatchList()); 3726 addChild(pbox); 3727 3728 GroupSetting* seek = new GroupSetting(); 3729 seek->setLabel(QObject::tr("Seeking")); 3409 3730 seek->addChild(SmartForward()); 3410 3731 seek->addChild(FFRewReposTime()); 3411 3732 seek->addChild(FFRewReverse()); 3412 3733 seek->addChild(ExactSeeking()); 3413 3734 addChild(seek); 3414 3735 3415 VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false); 3416 comms->setLabel(QObject::tr("Commercial Skip") + 3417 QString(" (%1/%2)").arg(++i).arg(total)); 3736 3737 3738 GroupSetting* comms = new GroupSetting(); 3739 comms->setLabel(QObject::tr("Commercial Skip")); 3418 3740 comms->addChild(AutoCommercialSkip()); 3419 3741 comms->addChild(CommRewindAmount()); 3420 3742 comms->addChild(CommNotifyAmount()); 3743 //TODO mixing Host setting with Global setting, not very clear for the user 3421 3744 comms->addChild(MaximumCommercialSkip()); 3422 3745 comms->addChild(MergeShortCommBreaks()); 3423 3746 addChild(comms); 3424 3747 3425 3748 #if CONFIG_DARWIN 3426 VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false); 3427 mac1->setLabel(QObject::tr("Mac OS X Video Settings") + 3428 QString(" (%1/%2)").arg(++i).arg(total)); 3429 mac1->addChild(MacGammaCorrect()); 3430 mac1->addChild(MacScaleUp()); 3431 mac1->addChild(MacFullSkip()); 3432 addChild(mac1); 3433 3434 VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false); 3435 mac2->setLabel(QObject::tr("Mac OS X Video Settings") + 3436 QString(" (%1/%2)").arg(++i).arg(total)); 3437 mac2->addChild(new MacMainSettings()); 3438 mac2->addChild(new MacFloatSettings()); 3439 3440 HorizontalConfigurationGroup *row = 3441 new HorizontalConfigurationGroup(false, false, true, true); 3442 row->addChild(new MacDockSettings()); 3443 row->addChild(new MacDesktopSettings()); 3444 mac2->addChild(row); 3445 3446 addChild(mac2); 3749 GroupSetting* ma1 = new GroupSetting(false); 3750 mac->setLabel(QObject::tr("Mac OS X Video Settings")); 3751 mac->addChild(MacGammaCorrect()); 3752 mac->addChild(MacScaleUp()); 3753 mac->addChild(MacFullSkip()); 3754 3755 mac->addChild(MacMainEnabled()); 3756 mac->addChild(MacFloatEnabled()); 3757 mac->addChild(MacDockEnabled()); 3758 mac->addChild(MacDesktopEnabled()); 3759 mac->addChild(row); 3760 3761 addChild(mac); 3447 3762 #endif 3448 3763 } 3449 3764 3450 3765 OSDSettings::OSDSettings() 3451 3766 { 3452 VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false); 3453 osd->setLabel(QObject::tr("On-screen Display")); 3767 setLabel(QObject::tr("On-screen Display")); 3454 3768 3455 osd->addChild(EnableMHEG()); 3456 osd->addChild(PersistentBrowseMode()); 3457 osd->addChild(BrowseAllTuners()); 3458 osd->addChild(CCBackground()); 3459 osd->addChild(DefaultCCMode()); 3460 osd->addChild(PreferCC708()); 3461 osd->addChild(SubtitleFont()); 3462 osd->addChild(OSDCC708TextZoomPercentage()); 3463 osd->addChild(SubtitleCodec()); 3464 addChild(osd); 3769 addChild(EnableMHEG()); 3770 addChild(PersistentBrowseMode()); 3771 addChild(BrowseAllTuners()); 3772 addChild(CCBackground()); 3773 addChild(DefaultCCMode()); 3774 addChild(PreferCC708()); 3775 addChild(SubtitleFont()); 3776 addChild(OSDCC708TextZoomPercentage()); 3777 addChild(SubtitleCodec()); 3465 3778 3466 3779 //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false); 3467 3780 //cc->setLabel(QObject::tr("Closed Captions")); … … OSDSettings::OSDSettings() 3476 3789 3477 3790 GeneralSettings::GeneralSettings() 3478 3791 { 3479 VerticalConfigurationGroup* general = new VerticalConfigurationGroup(false); 3480 general->setLabel(QObject::tr("General (Basic)")); 3792 setLabel(QObject::tr("General")); 3793 GroupSetting* general = new GroupSetting(); 3794 general->setLabel(QObject::tr("Basic")); 3481 3795 general->addChild(ChannelOrdering()); 3482 3796 general->addChild(ChannelFormat()); 3483 3797 general->addChild(LongChannelFormat()); 3798 //LiveTVPriority (backend setting) should probably not be mixed with frontend settings 3484 3799 general->addChild(LiveTVPriority()); 3485 3800 addChild(general); 3486 3801 3487 VerticalConfigurationGroup* autoexp = new VerticalConfigurationGroup(false);3488 autoexp->setLabel(QObject::tr(" General (Auto-Expire)"));3802 GroupSetting* autoexp = new GroupSetting(); 3803 autoexp->setLabel(QObject::tr("Auto-Expire")); 3489 3804 autoexp->addChild(AutoExpireMethod()); 3490 3491 VerticalConfigurationGroup *expgrp0 = 3492 new VerticalConfigurationGroup(false, false, true, true); 3493 expgrp0->addChild(AutoExpireDefault()); 3494 expgrp0->addChild(RerecordWatched()); 3495 expgrp0->addChild(AutoExpireWatchedPriority()); 3496 3497 VerticalConfigurationGroup *expgrp1 = 3498 new VerticalConfigurationGroup(false, false, true, true); 3499 expgrp1->addChild(AutoExpireLiveTVMaxAge()); 3500 expgrp1->addChild(AutoExpireDayPriority()); 3501 expgrp1->addChild(AutoExpireExtraSpace()); 3502 3503 HorizontalConfigurationGroup *expgrp = 3504 new HorizontalConfigurationGroup(false, false, true, true); 3505 expgrp->addChild(expgrp0); 3506 expgrp->addChild(expgrp1); 3507 3508 autoexp->addChild(expgrp); 3509 // autoexp->addChild(new DeletedExpireOptions()); 3805 autoexp->addChild(AutoExpireDefault()); 3806 autoexp->addChild(RerecordWatched()); 3807 autoexp->addChild(AutoExpireWatchedPriority()); 3808 autoexp->addChild(AutoExpireLiveTVMaxAge()); 3809 autoexp->addChild(AutoExpireDayPriority()); 3810 autoexp->addChild(AutoExpireExtraSpace()); 3811 //autoexp->addChild(AutoExpireInsteadOfDelete()); 3510 3812 autoexp->addChild(DeletedFifoOrder()); 3511 3813 autoexp->addChild(DeletedMaxAge()); 3512 3513 3814 addChild(autoexp); 3514 3815 3515 VerticalConfigurationGroup* jobs = new VerticalConfigurationGroup(false);3516 jobs->setLabel(QObject::tr(" General (Jobs)"));3816 GroupSetting* jobs = new GroupSetting(); 3817 jobs->setLabel(QObject::tr("Jobs")); 3517 3818 jobs->addChild(CommercialSkipMethod()); 3518 3819 jobs->addChild(CommFlagFast()); 3519 3820 jobs->addChild(AggressiveCommDetect()); 3520 3821 jobs->addChild(DefaultTranscoder()); 3521 3822 jobs->addChild(DeferAutoTranscodeDays()); 3522 3823 3523 VerticalConfigurationGroup* autogrp0 = 3524 new VerticalConfigurationGroup(false, false, true, true); 3525 autogrp0->addChild(AutoMetadataLookup()); 3526 autogrp0->addChild(AutoCommercialFlag()); 3527 autogrp0->addChild(AutoTranscode()); 3528 3529 VerticalConfigurationGroup* autogrp1 = 3530 new VerticalConfigurationGroup(false, false, true, true); 3531 autogrp0->addChild(AutoRunUserJob(1)); 3532 autogrp1->addChild(AutoRunUserJob(2)); 3533 autogrp1->addChild(AutoRunUserJob(3)); 3534 autogrp1->addChild(AutoRunUserJob(4)); 3535 3536 HorizontalConfigurationGroup *autogrp = 3537 new HorizontalConfigurationGroup(true, true, false, true); 3824 GroupSetting *autogrp = new GroupSetting(); 3538 3825 autogrp->setLabel( 3539 3826 QObject::tr("Default Job Queue Settings for New Scheduled Recordings")); 3540 autogrp->addChild(autogrp0); 3541 autogrp->addChild(autogrp1); 3827 autogrp->addChild(AutoMetadataLookup()); 3828 autogrp->addChild(AutoCommercialFlag()); 3829 autogrp->addChild(AutoTranscode()); 3830 autogrp->addChild(AutoRunUserJob(1)); 3831 autogrp->addChild(AutoRunUserJob(2)); 3832 autogrp->addChild(AutoRunUserJob(3)); 3833 autogrp->addChild(AutoRunUserJob(4)); 3834 3542 3835 jobs->addChild(autogrp); 3543 3836 3544 3837 addChild(jobs); 3545 3838 3546 VerticalConfigurationGroup* general2 = new VerticalConfigurationGroup(false);3547 general2->setLabel(QObject::tr(" General (Advanced)"));3839 GroupSetting* general2 = new GroupSetting(); 3840 general2->setLabel(QObject::tr("Advanced")); 3548 3841 general2->addChild(RecordPreRoll()); 3549 3842 general2->addChild(RecordOverTime()); 3550 3843 general2->addChild(CategoryOverTimeSettings()); 3551 3844 addChild(general2); 3552 3845 3553 VerticalConfigurationGroup* changrp = new VerticalConfigurationGroup(false); 3554 changrp->setLabel(QObject::tr("General (Channel Groups)")); 3555 ChannelGroupSettings *changroupsettings = new ChannelGroupSettings(); 3556 changrp->addChild(changroupsettings); 3846 GroupSetting* changrp = new GroupSetting(); 3847 changrp->setLabel(QObject::tr("Channel Groups")); 3848 changrp->addChild(ChannelGroupRememberLast()); 3557 3849 changrp->addChild(BrowseChannelGroup()); 3558 3850 addChild(changrp); 3559 3851 } 3560 3852 3561 3853 EPGSettings::EPGSettings() 3562 3854 { 3563 VerticalConfigurationGroup* epg = new VerticalConfigurationGroup(false); 3564 epg->setLabel(QObject::tr("Program Guide") + " 1/1"); 3565 epg->addChild(WatchTVGuide()); 3566 epg->addChild(DefaultTVChannel()); 3567 epg->addChild(EPGRecThreshold()); 3568 addChild(epg); 3855 setLabel(QObject::tr("Program Guide")); 3856 addChild(WatchTVGuide()); 3857 addChild(DefaultTVChannel()); 3858 addChild(EPGRecThreshold()); 3569 3859 } 3570 3860 3571 3861 GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings() 3572 3862 { 3573 VerticalConfigurationGroup* sched = new VerticalConfigurationGroup(false);3863 GroupSetting* sched = new GroupSetting(); 3574 3864 sched->setLabel(QObject::tr("Scheduler Options")); 3575 3865 3576 3866 sched->addChild(GRSchedMoveHigher()); … … GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings() 3583 3873 sched->addChild(GRAutoRecPriority()); 3584 3874 addChild(sched); 3585 3875 3586 VerticalConfigurationGroup* access = new VerticalConfigurationGroup(false);3876 GroupSetting* access = new GroupSetting(); 3587 3877 access->setLabel(QObject::tr("Accessibility Options")); 3588 3878 3589 3879 access->addChild(GRSignLangRecPriority()); … … GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings() 3593 3883 access->addChild(GRAudioDescRecPriority()); 3594 3884 addChild(access); 3595 3885 3596 VerticalConfigurationGroup* rtype = new VerticalConfigurationGroup(false);3886 GroupSetting* rtype = new GroupSetting(); 3597 3887 rtype->setLabel(QObject::tr("Recording Type Priority Settings")); 3598 3888 3599 3889 rtype->addChild(GRSingleRecordRecPriority()); … … GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings() 3606 3896 addChild(rtype); 3607 3897 } 3608 3898 3899 3900 class GuiDimension : public GroupSetting 3901 { 3902 public: 3903 GuiDimension(); 3904 //virtual QString getValue(); 3905 virtual void updateButton(MythUIButtonListItem *item); 3906 3907 private slots: 3908 virtual void childChanged(StandardSetting *); 3909 private: 3910 StandardSetting * m_width; 3911 StandardSetting * m_height; 3912 StandardSetting * m_offsetX; 3913 StandardSetting * m_offsetY; 3914 }; 3915 3916 GuiDimension::GuiDimension() 3917 :GroupSetting() 3918 { 3919 setLabel(QObject::tr("Gui dimension")); 3920 addChild(m_width = GuiWidth()); 3921 addChild(m_height = GuiHeight()); 3922 addChild(m_offsetX = GuiOffsetX()); 3923 addChild(m_offsetY = GuiOffsetY()); 3924 connect(m_width, SIGNAL(valueChanged(StandardSetting *)), 3925 this, SLOT(childChanged(StandardSetting *))); 3926 connect(m_height, SIGNAL(valueChanged(StandardSetting *)), 3927 this, SLOT(childChanged(StandardSetting *))); 3928 connect(m_offsetX, SIGNAL(valueChanged(StandardSetting *)), 3929 this, SLOT(childChanged(StandardSetting *))); 3930 connect(m_offsetY, SIGNAL(valueChanged(StandardSetting *)), 3931 this, SLOT(childChanged(StandardSetting *))); 3932 } 3933 3934 void GuiDimension::updateButton(MythUIButtonListItem *item) 3935 { 3936 GroupSetting::updateButton(item); 3937 if (( m_width->getValue()=="0" 3938 || m_height->getValue()=="0") 3939 && m_offsetX->getValue()=="0" 3940 && m_offsetY->getValue()=="0") 3941 item->SetText(QObject::tr("Fullscreen"),"value"); 3942 else 3943 item->SetText(QString("%1x%2+%3+%4") 3944 .arg(m_width->getValue()) 3945 .arg(m_height->getValue()) 3946 .arg(m_offsetX->getValue()) 3947 .arg(m_offsetY->getValue()),"value"); 3948 } 3949 3950 3951 3952 void GuiDimension::childChanged(StandardSetting *) 3953 { 3954 emit ShouldRedraw(this); 3955 } 3956 3957 3958 3609 3959 AppearanceSettings::AppearanceSettings() 3610 3960 { 3611 VerticalConfigurationGroup* screen = new VerticalConfigurationGroup(false);3961 GroupSetting* screen = new GroupSetting(); 3612 3962 screen->setLabel(QObject::tr("Theme") + " / " + QObject::tr("Screen Settings")); 3963 addChild(screen); 3613 3964 3614 3965 screen->addChild(MenuTheme()); 3615 3966 … … AppearanceSettings::AppearanceSettings() 3622 3973 // screen->addChild(DisplaySizeHeight()); 3623 3974 // screen->addChild(DisplaySizeWidth()); 3624 3975 3625 VerticalConfigurationGroup *column1 = 3626 new VerticalConfigurationGroup(false, false, false, false); 3627 3628 column1->addChild(GuiWidth()); 3629 column1->addChild(GuiHeight()); 3630 column1->addChild(GuiOffsetX()); 3631 column1->addChild(GuiOffsetY()); 3632 3633 VerticalConfigurationGroup *column2 = 3634 new VerticalConfigurationGroup(false, false, false, false); 3635 3636 column2->addChild(GuiSizeForTV()); 3637 column2->addChild(HideMouseCursor()); 3638 column2->addChild(RunInWindow()); 3639 column2->addChild(UseFixedWindowSize()); 3640 3641 HorizontalConfigurationGroup *columns = 3642 new HorizontalConfigurationGroup(false, false, false, false); 3976 screen->addChild(new GuiDimension()); 3643 3977 3644 columns->addChild(column1); 3645 columns->addChild(column2); 3646 3647 screen->addChild(columns); 3648 3649 addChild(screen); 3978 screen->addChild(GuiSizeForTV()); 3979 screen->addChild(HideMouseCursor()); 3980 screen->addChild(RunInWindow()); 3981 screen->addChild(UseFixedWindowSize()); 3650 3982 3651 3983 #if defined(USING_XRANDR) || CONFIG_DARWIN 3652 3984 const vector<DisplayResScreen> scr = GetVideoModes(); 3653 3985 if (!scr.empty()) 3654 addChild( new VideoModeSettings());3986 addChild(UseVideoModes()); 3655 3987 #endif 3656 VerticalConfigurationGroup* dates = new VerticalConfigurationGroup(false);3988 GroupSetting* dates = new GroupSetting(); 3657 3989 dates->setLabel(QObject::tr("Localization")); 3658 3990 dates->addChild(MythLanguage()); 3659 3991 dates->addChild(ISO639PreferredLanguage(0)); … … AppearanceSettings::AppearanceSettings() 3663 3995 dates->addChild(MythTimeFormat()); 3664 3996 addChild(dates); 3665 3997 3666 addChild(new LcdSettings()); 3998 addChild(LCDEnable()); 3999 } 4000 4001 void AppearanceSettings::applyChange() 4002 { 4003 qApp->processEvents(); 4004 GetMythMainWindow()->JumpTo("Reload Theme"); 4005 } 4006 4007 /******************************************************************************* 4008 * PlayBack Groups * 4009 *******************************************************************************/ 4010 4011 4012 class PlayBackGroupSetting : public GroupSetting 4013 { 4014 public: 4015 PlayBackGroupSetting(const QString &label, const QString &name); 4016 virtual void updateButton(MythUIButtonListItem *item); 4017 virtual void Load(); 4018 virtual void Save(); 4019 virtual void Close(); 4020 private: 4021 TransTextEditSetting *m_groupName; 4022 TransTextEditSetting *m_titleMatch; 4023 TransMythUISpinBoxSetting *m_skipAhead; 4024 TransMythUISpinBoxSetting *m_skipBack; 4025 TransMythUISpinBoxSetting *m_jumpMinutes; 4026 TransMythUISpinBoxSetting *m_timeStrech; 4027 TransMythUICheckBoxSetting *m_markForDeletion; 4028 bool m_isNew; 4029 }; 4030 4031 //TODO allow to delete a group 4032 4033 void PlayBackGroupSetting::updateButton(MythUIButtonListItem *item) 4034 { 4035 item->setEnabled(isEnabled()); 4036 item->SetText(m_label); 4037 //item->SetText(m_settingValue,"value"); 4038 item->SetText(getHelpText(),"description"); 4039 item->setDrawArrow (haveSubSettings()); 4040 } 4041 4042 PlayBackGroupSetting::PlayBackGroupSetting(const QString &label, const QString &name) 4043 :GroupSetting(),m_isNew(true) 4044 { 4045 4046 setLabel(label); 4047 setValue(name); 4048 4049 m_groupName = new TransTextEditSetting(); 4050 m_groupName->setLabel(QObject::tr("Playback Group Name")); 4051 addChild(m_groupName); 4052 4053 m_titleMatch = new TransTextEditSetting(); 4054 m_titleMatch->setLabel(QObject::tr("Title match (regex)")); 4055 m_titleMatch->setHelpText(QObject::tr("Automatically set new recording rules to " 4056 "use this group if the title matches this " 4057 "regular expression. For example, " 4058 "\"(News|CNN)\" would match any title in " 4059 "which \"News\" or \"CNN\" appears.")); 4060 addChild(m_titleMatch); 4061 4062 m_skipAhead = new TransMythUISpinBoxSetting(0, 600, 5, true); 4063 m_skipAhead->addSelection(tr("Default"),"0",true); 4064 m_skipAhead->setLabel(QObject::tr("Skip ahead (seconds)")); 4065 m_skipAhead->setHelpText(QObject::tr("How many seconds to skip forward on a fast " 4066 "forward.")); 4067 addChild(m_skipAhead); 4068 4069 m_skipBack = new TransMythUISpinBoxSetting(0, 600, 5, true); 4070 m_skipBack->addSelection(tr("Default"),"0",true); 4071 m_skipBack->setLabel(QObject::tr("Skip back (seconds)")); 4072 m_skipBack->setHelpText(QObject::tr("How many seconds to skip backward on a " 4073 "rewind.")); 4074 addChild(m_skipBack); 4075 4076 m_jumpMinutes = new TransMythUISpinBoxSetting(0, 30, 10, true); 4077 m_jumpMinutes->addSelection(tr("Default"),"0",true); 4078 m_jumpMinutes->setLabel(QObject::tr("Jump amount (minutes)")); 4079 m_jumpMinutes->setHelpText(QObject::tr("How many minutes to jump forward or backward " 4080 "when the jump keys are pressed.")); 4081 addChild(m_jumpMinutes); 4082 4083 m_timeStrech = new TransMythUISpinBoxSetting(45, 200, 5, false); 4084 m_timeStrech->addSelection(tr("Default"),"0",true); 4085 m_timeStrech->setLabel(QObject::tr("Time stretch (speed x 100)")); 4086 m_timeStrech->setHelpText(QObject::tr("Initial playback speed with adjusted audio. " 4087 "Use 100 for normal speed, 50 for half speed " 4088 "and 200 for double speed.")); 4089 addChild(m_timeStrech); 4090 4091 m_markForDeletion = new TransMythUICheckBoxSetting(); 4092 m_markForDeletion->setLabel(QObject::tr("Mark for deletion")); 4093 m_markForDeletion->setEnabled(false); 4094 addChild(m_markForDeletion); 4095 } 4096 4097 4098 void PlayBackGroupSetting::Load() 4099 { 4100 LOG(VB_GENERAL, LOG_ERR, QString("PlayBackGroupSetting::Load(%1)").arg(getLabel())); 4101 if (getValue().isEmpty()) 4102 { 4103 GroupSetting::Load(); 4104 return; 4105 } 4106 MSqlQuery query(MSqlQuery::InitCon()); 4107 query.prepare("SELECT name, titlematch, skipahead, skipback, jump, timestretch FROM playgroup " 4108 "WHERE name = :NAME ;"); 4109 query.bindValue(":NAME", getValue()); 4110 if (!query.exec()) 4111 MythDB::DBError("PlayBackGroupSetting::Load()", query); 4112 else if (query.next()) 4113 { 4114 LOG(VB_GENERAL, LOG_ERR, QString("PlayBackGroupSetting::Load(%1) SUCCESS").arg(getLabel())); 4115 m_isNew=false; 4116 m_groupName->setValue(query.value(0).toString()); 4117 m_groupName->setEnabled(getValue()!="Default"); 4118 m_titleMatch->setValue(query.value(1).toString()); 4119 m_skipAhead->setValue(query.value(2).toInt()); 4120 m_skipBack->setValue(query.value(3).toInt()); 4121 m_jumpMinutes->setValue(query.value(4).toInt()); 4122 4123 if (query.value(5).toInt() < 45 || query.value(5).toInt() > 200) 4124 m_timeStrech->setValue(0); 4125 else 4126 m_timeStrech->setValue(query.value(4).toInt()); 4127 m_markForDeletion->setEnabled(getValue()!="Default"); 4128 //mark setting as not changed 4129 GroupSetting::Load(); 4130 4131 } 4132 } 4133 4134 void PlayBackGroupSetting::Close() 4135 { 4136 Save(); 4137 } 4138 4139 void PlayBackGroupSetting::Save() 4140 { 4141 LOG(VB_GENERAL, LOG_ERR, QString("PlayBackGroupSetting::Save(%1)").arg(getLabel())); 4142 MSqlQuery query(MSqlQuery::InitCon()); 4143 4144 if (m_isNew) 4145 { 4146 query.prepare("INSERT playgroup " 4147 "(name, titlematch, skipahead, skipback, jump, timestretch) " 4148 "VALUES " 4149 "(:NEWNAME, :TITLEMATCH, :SKIPAHEAD, :SKIPBACK, :JUMP, :TIMESTRETCH);"); 4150 4151 query.bindValue(":NEWNAME", m_groupName->getValue()); 4152 query.bindValue(":TITLEMATCH", m_titleMatch->getValue()); 4153 query.bindValue(":SKIPAHEAD", m_skipAhead->intValue()); 4154 query.bindValue(":SKIPBACK", m_skipBack->intValue()); 4155 query.bindValue(":JUMP", m_jumpMinutes->intValue()); 4156 query.bindValue(":TIMESTRETCH", m_timeStrech->intValue()); 4157 4158 if (!query.exec()) 4159 MythDB::DBError("PlayBackGroupSetting::Save", query); 4160 } 4161 else if (m_markForDeletion->boolValue()) 4162 { 4163 query.prepare("DELETE FROM playgroup " 4164 "WHERE name = :NAME ;"); 4165 query.bindValue(":NAME", getValue()); 4166 4167 if (!query.exec()) 4168 MythDB::DBError("PlayBackGroupSetting::Save", query); 4169 } 4170 else 4171 { 4172 query.prepare("UPDATE playgroup SET " 4173 "name = :NEWNAME, " 4174 "titlematch = :TITLEMATCH, " 4175 "skipahead = :SKIPAHEAD, " 4176 "skipback = :SKIPBACK, " 4177 "jump = :JUMP, " 4178 "timestretch = :TIMESTRETCH " 4179 "WHERE name = :NAME ;"); 4180 4181 query.bindValue(":NEWNAME", m_groupName->getValue()); 4182 query.bindValue(":TITLEMATCH", m_titleMatch->getValue()); 4183 query.bindValue(":SKIPAHEAD", m_skipAhead->intValue()); 4184 query.bindValue(":SKIPBACK", m_skipBack->intValue()); 4185 query.bindValue(":JUMP", m_jumpMinutes->intValue()); 4186 query.bindValue(":TIMESTRETCH", m_timeStrech->intValue()); 4187 query.bindValue(":NAME", getValue()); 4188 4189 if (!query.exec()) 4190 MythDB::DBError("PlayBackGroupSetting::Save", query); 4191 } 4192 4193 GroupSetting::Save(); 4194 } 4195 4196 4197 PlayBackGroupsSetting::PlayBackGroupsSetting(): 4198 GroupSetting() 4199 { 4200 setLabel(tr("Playback Groups")); 4201 } 4202 4203 4204 void PlayBackGroupsSetting::Open() 4205 { 4206 //TODO the play groups are loaded twice when the dialog is open for the first time 4207 Load(); 4208 } 4209 4210 4211 void PlayBackGroupsSetting::Load() 4212 { 4213 clearSettings(); 4214 addChild(new PlayBackGroupSetting(tr("Create new group"),"")); 4215 4216 addChild(new PlayBackGroupSetting(tr("Default"),"Default")); 4217 4218 QStringList names = PlayGroup::GetNames(); 4219 while (!names.isEmpty()) 4220 { 4221 addChild(new PlayBackGroupSetting(names.front(),names.front())); 4222 names.pop_front(); 4223 } 4224 4225 //Load all the groups 4226 GroupSetting::Load(); 4227 //TODO select the new one or the edited one 4228 emit settingsChanged(NULL); 4229 } 4230 4231 4232 /******************************************************************************* 4233 * Channel Groups * 4234 *******************************************************************************/ 4235 4236 class ChannelCheckBoxSetting : public TransMythUICheckBoxSetting 4237 { 4238 public: 4239 ChannelCheckBoxSetting(uint chanid, 4240 const QString &channum, const QString &name); 4241 uint getChannelId(){return m_channelId;}; 4242 private: 4243 uint m_channelId; 4244 4245 }; 4246 4247 ChannelCheckBoxSetting::ChannelCheckBoxSetting(uint chanid, 4248 const QString &channum, const QString &channame) 4249 :TransMythUICheckBoxSetting(), 4250 m_channelId(chanid) 4251 { 4252 setLabel(QString("%1 %2").arg(channum).arg(channame)); 4253 setHelpText(QObject::tr("Select/Unselect channels for this channel group")); 4254 } 4255 4256 4257 4258 ChannelGroupSetting::ChannelGroupSetting(const QString &groupName, int groupId = -1) 4259 :GroupSetting(), 4260 m_groupId(groupId), 4261 m_groupName(NULL), 4262 m_markForDeletion(NULL) 4263 { 4264 setLabel(groupName);//TODO this should be the translated name if Favorite 4265 setValue(groupName); 4266 m_groupName = new TransTextEditSetting(); 4267 m_groupName->setLabel(groupName); 4268 } 4269 4270 void ChannelGroupSetting::Open() 4271 { 4272 Load(); 4273 } 4274 4275 void ChannelGroupSetting::Close() 4276 { 4277 LOG(VB_GENERAL, LOG_ERR, QString("ChannelGroupSetting::Close() %1").arg(getLabel())); 4278 if (m_markForDeletion) 4279 LOG(VB_GENERAL, LOG_ERR, QString("m_markForDeletion => %1").arg(m_markForDeletion->boolValue())); 4280 //Change the name 4281 if (m_markForDeletion && m_markForDeletion->boolValue() && m_groupId>1) 4282 { 4283 MSqlQuery query(MSqlQuery::InitCon()); 4284 // Delete channels from this group 4285 query.prepare("DELETE FROM channelgroup WHERE grpid = :GRPID;"); 4286 query.bindValue(":GRPID", m_groupId); 4287 if (!query.exec()) 4288 MythDB::DBError("ChannelGroupSetting::Close", query); 4289 4290 // Now delete the group from channelgroupnames 4291 query.prepare("DELETE FROM channelgroupnames WHERE grpid = :GRPID;"); 4292 query.bindValue(":GRPID", m_groupId); 4293 if (!query.exec()) 4294 MythDB::DBError("ChannelGroupSetting::Close", query); 4295 return; 4296 } 4297 4298 if (m_groupName && m_groupName->haveChanged()) 4299 { 4300 if (m_groupId==-1)//create a new group 4301 { 4302 MSqlQuery query(MSqlQuery::InitCon()); 4303 QString qstr = "INSERT INTO channelgroupnames (name) VALUE (:NEWNAME);"; 4304 query.prepare(qstr); 4305 query.bindValue(":NEWNAME", m_groupName->getValue()); 4306 4307 if (!query.exec()) 4308 MythDB::DBError("ChannelGroupSetting::Close", query); 4309 else 4310 { 4311 //update m_groupId 4312 QString qstr = "SELECT grpid FROM channelgroupnames " 4313 "WHERE name = :NEWNAME;"; 4314 query.prepare(qstr); 4315 query.bindValue(":NEWNAME", m_groupName->getValue()); 4316 if (!query.exec()) 4317 MythDB::DBError("ChannelGroupSetting::Close", query); 4318 } 4319 } 4320 else 4321 { 4322 MSqlQuery query(MSqlQuery::InitCon()); 4323 QString qstr = "UPDATE channelgroupnames set name = :NEWNAME " 4324 " WHERE name = :OLDNAME ;"; 4325 query.prepare(qstr); 4326 query.bindValue(":NEWNAME", m_groupName->getValue()); 4327 query.bindValue(":OLDNAME", getValue()); 4328 4329 if (!query.exec()) 4330 MythDB::DBError("ChannelGroupSetting::Close", query); 4331 else 4332 m_groupId = query.value(0).toUInt(); 4333 } 4334 } 4335 if (m_groupId==-1) return; 4336 QList<StandardSetting *> *children = getSubSettings(); 4337 if (children==NULL) return; 4338 QList<StandardSetting *>::const_iterator i; 4339 for (i = children->constBegin(); i != children->constEnd(); ++i) 4340 { 4341 if ((*i)->haveChanged()) 4342 { 4343 if ((*i)==m_groupName) 4344 { 4345 LOG(VB_GENERAL, LOG_ERR, QString("ChannelGroupSetting::Close() change %1 to %2") 4346 .arg(getLabel()) 4347 .arg(m_groupName->getValue())); 4348 } 4349 else 4350 { 4351 ChannelCheckBoxSetting *channel = dynamic_cast<ChannelCheckBoxSetting *>(*i); 4352 if (channel) 4353 { 4354 if (channel->boolValue()) 4355 { 4356 LOG(VB_GENERAL, LOG_ERR, QString("ChannelGroupSetting::Close() add %1").arg(channel->getLabel())); 4357 ChannelGroup::AddChannel(channel->getChannelId(), m_groupId); 4358 } 4359 else 4360 { 4361 LOG(VB_GENERAL, LOG_ERR, QString("ChannelGroupSetting::Close() remove %1").arg(channel->getLabel())); 4362 ChannelGroup::DeleteChannel(channel->getChannelId(), m_groupId); 4363 } 4364 } 4365 } 4366 } 4367 } 4368 } 4369 4370 void ChannelGroupSetting::Load() 4371 { 4372 LOG(VB_GENERAL, LOG_ERR, QString("ChannelGroupSetting::Load() %1").arg(getLabel())); 4373 clearSettings(); 4374 //We can not rename the Favorite group 4375 //if (m_groupId!=1) 4376 //{ 4377 m_groupName = new TransTextEditSetting(); 4378 m_groupName->setLabel(tr("Group name")); 4379 if (m_groupId>-1) 4380 m_groupName->setValue(getLabel()); 4381 m_groupName->setEnabled(m_groupId!=1); 4382 addChild(m_groupName); 4383 //} 4384 4385 MSqlQuery query(MSqlQuery::InitCon()); 4386 4387 QString qstr = "SELECT channel.chanid, channum, name, grpid FROM channel " 4388 "LEFT JOIN channelgroup " 4389 "ON (channel.chanid = channelgroup.chanid AND grpid = :GRPID) ;"; 4390 4391 query.prepare(qstr); 4392 4393 query.bindValue(":GRPID", m_groupId); 4394 4395 if (!query.exec() || !query.isActive()) 4396 MythDB::DBError("ChannelGroupSetting::Load", query); 4397 else 4398 { 4399 while(query.next()) 4400 { 4401 ChannelCheckBoxSetting * channelCheckBox = 4402 new ChannelCheckBoxSetting( 4403 query.value(0).toUInt(), 4404 query.value(1).toString(), 4405 query.value(2).toString() 4406 ); 4407 channelCheckBox->setValue(!query.value(3).isNull()); 4408 addChild(channelCheckBox); 4409 } 4410 } 4411 4412 //can not delete new group or Favorite 4413 m_markForDeletion = new TransMythUICheckBoxSetting(); 4414 m_markForDeletion->setLabel(tr("Mark for deletion")); 4415 addChild(m_markForDeletion); 4416 m_markForDeletion->setEnabled(m_groupId>1); 4417 4418 GroupSetting::Load(); 4419 } 4420 4421 4422 ChannelGroupsSetting::ChannelGroupsSetting(): 4423 GroupSetting() 4424 { 4425 setLabel(tr("Channel Groups")); 4426 } 4427 4428 4429 void ChannelGroupsSetting::Open() 4430 { 4431 //TODO the play groups are loaded twice when the dialog is open for the first time 4432 Load(); 4433 } 4434 4435 4436 4437 void ChannelGroupsSetting::Load() 4438 { 4439 clearSettings(); 4440 addChild(new ChannelGroupSetting(tr("Create New Channel Group"))); 4441 addChild(new ChannelGroupSetting(tr("Favorites"), 1)); 4442 4443 4444 MSqlQuery query(MSqlQuery::InitCon()); 4445 4446 QString qstr = "SELECT grpid, name FROM channelgroupnames " 4447 " WHERE grpid <> 1 " 4448 " ORDER BY name ; "; 4449 4450 query.prepare(qstr); 4451 4452 if (!query.exec() || !query.isActive()) 4453 MythDB::DBError("ChannelGroupsSetting::Load", query); 4454 else 4455 { 4456 while(query.next()) 4457 { 4458 addChild(new ChannelGroupSetting(query.value(1).toString(), 4459 query.value(0).toUInt())); 4460 } 4461 } 4462 4463 //Load all the groups 4464 GroupSetting::Load(); 4465 //TODO select the new one or the edited one 4466 emit settingsChanged(NULL); 3667 4467 } 3668 4468 3669 4469 // vim:set sw=4 ts=4 expandtab: -
mythtv/programs/mythfrontend/globalsettings.h
diff --git a/mythtv/programs/mythfrontend/globalsettings.h b/mythtv/programs/mythfrontend/globalsettings.h index 93e774a..bc98f79 100644
a b 4 4 #include <QStringList> 5 5 #include <QObject> 6 6 7 #include "settings.h"8 7 #include "mythcontext.h" 9 8 #include "videodisplayprofile.h" 9 #include "standardsettings.h" 10 10 11 11 #include <QMutex> 12 12 13 13 class QFileInfo; 14 14 15 class PlaybackSettings : public ConfigurationWizard15 class PlaybackSettings : public GroupSetting //ConfigurationWizard 16 16 { 17 17 public: 18 18 PlaybackSettings(); 19 19 }; 20 20 21 class OSDSettings: virtual public ConfigurationWizard 21 //TODO check the purpose of virtual here 22 //class OSDSettings: virtual public ConfigurationWizard 23 class OSDSettings: public GroupSetting 22 24 { 23 25 public: 24 26 OSDSettings(); 25 27 }; 26 28 27 class GeneralSettings : public ConfigurationWizard29 class GeneralSettings : public GroupSetting 28 30 { 29 31 public: 30 32 GeneralSettings(); 31 33 }; 32 34 33 class EPGSettings : public ConfigurationWizard35 class EPGSettings : public GroupSetting 34 36 { 35 37 public: 36 38 EPGSettings(); 37 39 }; 38 40 39 class AppearanceSettings : public ConfigurationWizard41 class AppearanceSettings : public GroupSetting 40 42 { 41 43 public: 42 44 AppearanceSettings(); 45 virtual void applyChange(); 43 46 }; 44 47 45 class MainGeneralSettings : public ConfigurationWizard 48 class HostRefreshRateComboBoxSetting : public HostComboBoxSetting 49 { 50 Q_OBJECT 51 public: 52 HostRefreshRateComboBoxSetting(const QString &name) : 53 HostComboBoxSetting(name) { } 54 virtual ~HostRefreshRateComboBoxSetting() { ; } 55 56 public slots: 57 virtual void ChangeResolution(StandardSetting *); 58 59 private: 60 static const vector<double> GetRefreshRates(const QString &resolution); 61 }; 62 63 64 class MainGeneralSettings : public GroupSetting 46 65 { 47 66 public: 48 67 MainGeneralSettings(); 68 virtual void applyChange(); 49 69 }; 50 70 51 class GeneralRecPrioritiesSettings : public ConfigurationWizard71 class GeneralRecPrioritiesSettings : public GroupSetting 52 72 { 53 73 public: 54 74 GeneralRecPrioritiesSettings(); … … class XboxSettings : public ConfigurationWizard 59 79 public: 60 80 XboxSettings(); 61 81 }; 62 82 /* 63 83 class PlaybackProfileItemConfig : public QObject, public ConfigurationWizard 64 84 { 65 85 Q_OBJECT … … class PlaybackProfileConfig : public VerticalConfigurationGroup 128 148 vector<TransSpinBoxSetting*> priority; 129 149 }; 130 150 151 131 152 class PlaybackProfileConfigs : public TriggeredConfigurationGroup 132 153 { 133 154 Q_OBJECT … … class PlaybackProfileConfigs : public TriggeredConfigurationGroup 146 167 private: 147 168 QStringList profiles; 148 169 HostComboBox *grouptrigger; 170 };*/ 171 172 173 174 class PlayBackGroupsSetting : public GroupSetting 175 { 176 Q_OBJECT 177 public: 178 PlayBackGroupsSetting(); 179 virtual void Load(); 180 virtual void Open(); 181 public slots: 182 //void newPlayBackGroup(StandardSetting *); 183 //void editPlayBackGroup(StandardSetting *); 184 //void RefreshList(); 185 private: 186 ButtonStandardSetting *m_addGroupButton; 187 }; 188 189 class ChannelGroupSetting : public GroupSetting 190 { 191 public: 192 ChannelGroupSetting(const QString &groupName, int groupId); 193 virtual void Load(); 194 virtual void Open(); 195 virtual void Close(); 196 private: 197 int m_groupId; 198 TransTextEditSetting *m_groupName; 199 TransMythUICheckBoxSetting *m_markForDeletion; 200 149 201 }; 150 202 203 class ChannelGroupsSetting : public GroupSetting 204 { 205 public: 206 ChannelGroupsSetting(); 207 virtual void Load(); 208 virtual void Open(); 209 private: 210 ButtonStandardSetting *m_addGroupButton; 211 }; 212 213 214 151 215 #endif -
mythtv/programs/mythfrontend/main.cpp
diff --git a/mythtv/programs/mythfrontend/main.cpp b/mythtv/programs/mythfrontend/main.cpp index b396624..2f6d818 100644
a b 1 #include <unistd.h>2 1 #include <fcntl.h> 3 2 #include <signal.h> 4 3 #include <cerrno> … … using namespace std; 74 73 #include "themechooser.h" 75 74 #include "mythversion.h" 76 75 #include "taskqueue.h" 76 #include "standardsettings.h" 77 77 78 78 // Video 79 79 #include "cleanup.h" … … namespace 144 144 145 145 if (passwordValid) 146 146 { 147 VideoGeneralSettings settings; 148 settings.exec(); 147 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 148 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 149 150 if (ssd->Create()) 151 { 152 ssd->loadSettings(new VideoGeneralSettings()); 153 mainStack->AddScreen(ssd); 154 } 155 else 156 delete ssd; 149 157 } 150 158 else 151 159 { … … static void TVMenuCallback(void *data, QString &selection) 861 869 startPrevious(); 862 870 else if (sel == "settings appearance") 863 871 { 864 AppearanceSettings *settings = new AppearanceSettings(); 865 DialogCode res = settings->exec(); 866 delete settings; 872 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 873 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 867 874 868 if ( kDialogCodeRejected != res)875 if (ssd->Create()) 869 876 { 870 qApp->processEvents();871 GetMythMainWindow()->JumpTo("Reload Theme");877 ssd->loadSettings(new AppearanceSettings()); 878 mainStack->AddScreen(ssd); 872 879 } 880 else 881 delete ssd; 873 882 } 874 883 else if (sel == "settings themechooser") 875 884 { … … static void TVMenuCallback(void *data, QString &selection) 911 920 } 912 921 else if (sel == "settings playgroup") 913 922 { 914 PlayGroupEditor editor; 915 editor.exec(); 923 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 924 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "playbackgroupsetting"); 925 926 if (ssd->Create()) 927 { 928 ssd->loadSettings(new PlayBackGroupsSetting()); 929 mainStack->AddScreen(ssd); 930 } 931 else 932 delete ssd; 916 933 } 917 934 else if (sel == "settings general") 918 935 { 919 GeneralSettings settings; 920 settings.exec(); 936 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 937 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 938 939 if (ssd->Create()) 940 { 941 ssd->loadSettings(new GeneralSettings()); 942 mainStack->AddScreen(ssd); 943 } 944 else 945 delete ssd; 921 946 } 922 947 else if (sel == "settings audiogeneral") 923 948 { 924 AudioGeneralSettings audiosettings; 925 audiosettings.exec(); 949 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 950 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 951 952 if (ssd->Create()) 953 { 954 ssd->loadSettings(new AudioConfigSettings()); 955 mainStack->AddScreen(ssd); 956 } 957 else 958 delete ssd; 926 959 } 927 960 else if (sel == "settings maingeneral") 928 961 { 929 MainGeneralSettings mainsettings; 930 mainsettings.exec(); 931 QStringList strlist( QString("REFRESH_BACKEND") ); 932 gCoreContext->SendReceiveStringList(strlist); 962 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 963 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 964 965 if (ssd->Create()) 966 { 967 ssd->loadSettings(new MainGeneralSettings()); 968 mainStack->AddScreen(ssd); 969 } 970 else 971 delete ssd; 933 972 } 934 973 else if (sel == "settings playback") 935 974 { 936 PlaybackSettings settings; 937 settings.exec(); 975 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 976 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 977 978 if (ssd->Create()) 979 { 980 ssd->loadSettings(new PlaybackSettings()); 981 mainStack->AddScreen(ssd); 982 } 983 else 984 delete ssd; 938 985 } 939 986 else if (sel == "settings osd") 940 987 { 941 OSDSettings settings; 942 settings.exec(); 988 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 989 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 990 991 if (ssd->Create()) 992 { 993 ssd->loadSettings(new OSDSettings()); 994 mainStack->AddScreen(ssd); 995 } 996 else 997 delete ssd; 943 998 } 944 999 else if (sel == "settings epg") 945 1000 { 946 EPGSettings settings; 947 settings.exec(); 1001 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 1002 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 1003 1004 if (ssd->Create()) 1005 { 1006 ssd->loadSettings(new EPGSettings()); 1007 mainStack->AddScreen(ssd); 1008 } 1009 else 1010 delete ssd; 948 1011 } 949 1012 else if (sel == "settings channelgroups") 950 1013 { 951 ChannelGroupEditor editor; 952 editor.exec(); 1014 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 1015 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 1016 1017 if (ssd->Create()) 1018 { 1019 ssd->loadSettings(new ChannelGroupsSetting()); 1020 mainStack->AddScreen(ssd); 1021 } 1022 else 1023 delete ssd; 953 1024 } 954 1025 else if (sel == "settings generalrecpriorities") 955 1026 { 956 GeneralRecPrioritiesSettings settings; 957 settings.exec(); 1027 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 1028 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 1029 1030 if (ssd->Create()) 1031 { 1032 ssd->loadSettings(new GeneralRecPrioritiesSettings()); 1033 mainStack->AddScreen(ssd); 1034 } 1035 else 1036 delete ssd; 958 1037 } 959 1038 else if (sel == "settings channelrecpriorities") 960 1039 { … … static void WriteDefaults() 1109 1188 VideoGeneralSettings vgs; 1110 1189 vgs.Load(); 1111 1190 vgs.Save(); 1191 //TODo Playback group not loaded? 1192 //TODo Channel group not loaded? 1112 1193 } 1113 1194 1114 1195 static int internal_play_media(const QString &mrl, const QString &plot, -
mythtv/programs/mythfrontend/videoglobalsettings.cpp
diff --git a/mythtv/programs/mythfrontend/videoglobalsettings.cpp b/mythtv/programs/mythfrontend/videoglobalsettings.cpp index 0365bfc..efd595f 100644
a b 9 9 #include "videodlg.h" 10 10 #include "videoglobalsettings.h" 11 11 12 #include "mythlogging.h" 13 12 14 namespace 13 15 { 14 16 // General Settings 15 HostComboBox *VideoDefaultParentalLevel()17 HostComboBoxSetting *VideoDefaultParentalLevel() 16 18 { 17 HostComboBox *gc = new HostComboBox("VideoDefaultParentalLevel");19 HostComboBoxSetting *gc = new HostComboBoxSetting("VideoDefaultParentalLevel"); 18 20 gc->setLabel(QObject::tr("Starting Parental Level")); 19 21 gc->addSelection(QObject::tr("4 - Highest"), 20 22 QString::number(ParentalLevel::plHigh)); … … const char *password_clue = 33 35 QT_TRANSLATE_NOOP("QObject", "Setting this value to all numbers will make your life " 34 36 "much easier."); 35 37 36 Host LineEdit*VideoAdminPassword()38 HostTextEditSetting *VideoAdminPassword() 37 39 { 38 Host LineEdit *gc = new HostLineEdit("VideoAdminPassword");40 HostTextEditSetting *gc = new HostTextEditSetting("VideoAdminPassword"); 39 41 gc->setLabel(QObject::tr("Parental Level 4 PIN")); 40 42 gc->setHelpText(QString("%1 %2") 41 43 .arg(QObject::tr("This PIN is used to enter Parental Control " … … HostLineEdit *VideoAdminPassword() 44 46 return gc; 45 47 } 46 48 47 Host LineEdit*VideoAdminPasswordThree()49 HostTextEditSetting *VideoAdminPasswordThree() 48 50 { 49 Host LineEdit *gc = new HostLineEdit("VideoAdminPasswordThree");51 HostTextEditSetting *gc = new HostTextEditSetting("VideoAdminPasswordThree"); 50 52 gc->setLabel(QObject::tr("Parental Level 3 PIN")); 51 53 gc->setHelpText(QString("%1 %2") 52 54 .arg(QObject::tr("This PIN is used to enter Parental Control Level 3.")) … … HostLineEdit *VideoAdminPasswordThree() 54 56 return gc; 55 57 } 56 58 57 Host LineEdit*VideoAdminPasswordTwo()59 HostTextEditSetting *VideoAdminPasswordTwo() 58 60 { 59 Host LineEdit *gc = new HostLineEdit("VideoAdminPasswordTwo");61 HostTextEditSetting *gc = new HostTextEditSetting("VideoAdminPasswordTwo"); 60 62 gc->setLabel(QObject::tr("Parental Level 2 PIN")); 61 63 gc->setHelpText(QString("%1 %2") 62 64 .arg(QObject::tr("This PIN is used to enter Parental Control Level 2.")) … … HostLineEdit *VideoAdminPasswordTwo() 64 66 return gc; 65 67 } 66 68 67 HostCheckBox *VideoAggressivePC()69 HostCheckBoxSetting *VideoAggressivePC() 68 70 { 69 HostCheckBox *gc = new HostCheckBox("VideoAggressivePC");71 HostCheckBoxSetting *gc = new HostCheckBoxSetting("VideoAggressivePC"); 70 72 gc->setLabel(QObject::tr("Aggressive Parental Control")); 71 73 gc->setValue(false); 72 74 gc->setHelpText(QObject::tr("If set, you will not be able to return " … … HostCheckBox *VideoAggressivePC() 76 78 return gc; 77 79 } 78 80 79 HostLineEdit *VideoStartupDirectory() 81 //TODO use MythUIFileBrowser but we need to be able to have more than one directory 82 HostTextEditSetting *VideoStartupDirectory() 80 83 { 81 Host LineEdit *gc = new HostLineEdit("VideoStartupDir");84 HostTextEditSetting *gc = new HostTextEditSetting("VideoStartupDir"); 82 85 gc->setLabel(QObject::tr("Directories that hold videos")); 83 86 gc->setValue(DEFAULT_VIDEOSTARTUP_DIR); 84 87 gc->setHelpText(QObject::tr("Multiple directories can be separated by ':'. " … … HostLineEdit *VideoStartupDirectory() 87 90 return gc; 88 91 } 89 92 90 Host LineEdit*VideoArtworkDirectory()93 HostFileBrowserSetting *VideoArtworkDirectory() 91 94 { 92 Host LineEdit *gc = new HostLineEdit("VideoArtworkDir");95 HostFileBrowserSetting *gc = new HostFileBrowserSetting("VideoArtworkDir"); 93 96 gc->setLabel(QObject::tr("Directory that holds movie posters")); 94 97 gc->setValue(GetConfDir() + "/Video/Artwork"); 95 98 gc->setHelpText(QObject::tr("This directory must exist, and the user " 96 99 "running the frontend needs to have read/write permission " 97 100 "to the directory.")); 101 gc->SetTypeFilter(QDir::AllDirs | QDir::Hidden); 98 102 return gc; 99 103 } 100 104 101 Host LineEdit*VideoScreenshotDirectory()105 HostFileBrowserSetting *VideoScreenshotDirectory() 102 106 { 103 Host LineEdit *gc = new HostLineEdit("mythvideo.screenshotDir");107 HostFileBrowserSetting *gc = new HostFileBrowserSetting("mythvideo.screenshotDir"); 104 108 gc->setLabel(QObject::tr("Directory that holds movie screenshots")); 105 109 gc->setValue(GetConfDir() + "/Video/Screenshots"); 106 110 gc->setHelpText(QObject::tr("This directory must exist, and the user " 107 111 "running the frontend needs to have read/write permission " 108 112 "to the directory.")); 113 gc->SetTypeFilter(QDir::AllDirs | QDir::Hidden); 109 114 return gc; 110 115 } 111 116 112 Host LineEdit*VideoBannerDirectory()117 HostFileBrowserSetting *VideoBannerDirectory() 113 118 { 114 Host LineEdit *gc = new HostLineEdit("mythvideo.bannerDir");119 HostFileBrowserSetting *gc = new HostFileBrowserSetting("mythvideo.bannerDir"); 115 120 gc->setLabel(QObject::tr("Directory that holds movie/TV Banners")); 116 121 gc->setValue(GetConfDir() + "/Video/Banners"); 117 122 gc->setHelpText(QObject::tr("This directory must exist, and the user " 118 123 "running the frontend needs to have read/write permission " 119 124 "to the directory.")); 125 gc->SetTypeFilter(QDir::AllDirs | QDir::Hidden); 120 126 return gc; 121 127 } 122 128 123 Host LineEdit*VideoFanartDirectory()129 HostFileBrowserSetting *VideoFanartDirectory() 124 130 { 125 Host LineEdit *gc = new HostLineEdit("mythvideo.fanartDir");131 HostFileBrowserSetting *gc = new HostFileBrowserSetting("mythvideo.fanartDir"); 126 132 gc->setLabel(QObject::tr("Directory that holds movie fanart")); 127 133 gc->setValue(GetConfDir() + "/Video/Fanart"); 128 134 gc->setHelpText(QObject::tr("This directory must exist, and the user " 129 135 "running the frontend needs to have read/write permission " 130 136 "to the directory.")); 137 gc->SetTypeFilter(QDir::AllDirs | QDir::Hidden); 131 138 return gc; 132 139 } 133 140 134 Host LineEdit*TrailerDirectory()141 HostFileBrowserSetting *TrailerDirectory() 135 142 { 136 Host LineEdit *gc = new HostLineEdit("mythvideo.TrailersDir");143 HostFileBrowserSetting *gc = new HostFileBrowserSetting("mythvideo.TrailersDir"); 137 144 gc->setLabel(QObject::tr("Directory that holds movie trailers")); 138 145 gc->setValue(GetConfDir() + "/Video/Trailers"); 139 146 gc->setHelpText(QObject::tr("This directory must exist, and the user " 140 147 "running the frontend needs to have read/write permission " 141 148 "to the directory.")); 149 gc->SetTypeFilter(QDir::AllDirs | QDir::Hidden); 142 150 return gc; 143 151 } 144 152 … … HostLineEdit *TrailerDirectory() 148 156 149 157 // General Settings 150 158 151 HostComboBox *SetOnInsertDVD()159 HostComboBoxSetting *SetOnInsertDVD() 152 160 { 153 HostComboBox *gc = new HostComboBox("DVDOnInsertDVD");161 HostComboBoxSetting *gc = new HostComboBoxSetting("DVDOnInsertDVD"); 154 162 gc->setLabel(QObject::tr("On DVD insertion")); 155 163 gc->addSelection(QObject::tr("Display mythdvd menu"),"1"); 156 164 gc->addSelection(QObject::tr("Do nothing"),"0"); … … HostComboBox *SetOnInsertDVD() 160 168 return gc; 161 169 } 162 170 163 HostCheckBox *VideoTreeRemember()171 HostCheckBoxSetting *VideoTreeRemember() 164 172 { 165 HostCheckBox *gc = new HostCheckBox("mythvideo.VideoTreeRemember");173 HostCheckBoxSetting *gc = new HostCheckBoxSetting("mythvideo.VideoTreeRemember"); 166 174 gc->setLabel(QObject::tr("Video Tree remembers last selected position")); 167 175 gc->setValue(false); 168 176 gc->setHelpText(QObject::tr("If set, the current position in the Video " … … HostCheckBox *VideoTreeRemember() 170 178 return gc; 171 179 } 172 180 173 struct ConfigPage174 {175 typedef std::vector<ConfigurationGroup *> PageList;176 177 protected:178 ConfigPage(PageList &pl) : m_pl(pl)179 {180 }181 182 void Add(ConfigurationGroup *page)183 {184 m_pl.push_back(page);185 }186 181 187 private:188 ConfigPage(const ConfigPage &);189 ConfigPage &operator=(const ConfigPage &);190 182 191 private:192 PageList &m_pl;193 };194 183 195 struct VConfigPage : public ConfigPage 184 HostCheckBoxSetting *RatingsToPL() 196 185 { 197 VConfigPage(PageList &pl, bool luselabel = true, bool luseframe = true, 198 bool lzeroMargin = false, bool lzeroSpace = false) : 199 ConfigPage(pl) 200 { 201 m_vc_page = new VerticalConfigurationGroup(luselabel, luseframe, 202 lzeroMargin, lzeroSpace); 203 Add(m_vc_page); 204 } 205 206 VerticalConfigurationGroup *operator->() 186 HostCheckBoxSetting *r2pl = 187 new HostCheckBoxSetting("mythvideo.ParentalLevelFromRating"); 188 r2pl->setLabel(QObject::tr("Enable automatic Parental Level from " 189 "rating")); 190 r2pl->setValue(false); 191 r2pl->setHelpText(QObject::tr("If enabled, searches will automatically " 192 "set the Parental Level to the one " 193 "matching the rating below.")); 194 195 typedef std::map<ParentalLevel::Level, QString> r2pl_map; 196 r2pl_map r2pl_defaults; 197 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plLowest, 198 QObject::tr("G", "PL 1 default search string."))); 199 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plLow, 200 QObject::tr("PG", "PL 2 default search string."))); 201 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plMedium, 202 QObject::tr("PG-13", "PL3 default search string."))); 203 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plHigh, 204 QObject::tr("R:NC-17", "PL4 default search string."))); 205 206 for (ParentalLevel pl(ParentalLevel::plLowest); 207 pl.GetLevel() <= ParentalLevel::plHigh && pl.good(); ++pl) 207 208 { 208 return m_vc_page; 209 } 210 211 private: 212 VerticalConfigurationGroup *m_vc_page; 213 }; 214 215 class RatingsToPL : public TriggeredConfigurationGroup 216 { 217 public: 218 RatingsToPL() : TriggeredConfigurationGroup(false) 219 { 220 HostCheckBox *r2pl = 221 new HostCheckBox("mythvideo.ParentalLevelFromRating"); 222 r2pl->setLabel(QObject::tr("Enable automatic Parental Level from " 223 "rating")); 224 r2pl->setValue(false); 225 r2pl->setHelpText(QObject::tr("If enabled, searches will automatically " 226 "set the Parental Level to the one " 227 "matching the rating below.")); 228 addChild(r2pl); 229 setTrigger(r2pl); 230 231 typedef std::map<ParentalLevel::Level, QString> r2pl_map; 232 r2pl_map r2pl_defaults; 233 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plLowest, 234 tr("G", "PL 1 default search string."))); 235 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plLow, 236 tr("PG", "PL 2 default search string."))); 237 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plMedium, 238 tr("PG-13", "PL3 default search string."))); 239 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plHigh, 240 tr("R:NC-17", "PL4 default search string."))); 241 242 VerticalConfigurationGroup *vcg = new VerticalConfigurationGroup(true); 243 244 for (ParentalLevel pl(ParentalLevel::plLowest); 245 pl.GetLevel() <= ParentalLevel::plHigh && pl.good(); ++pl) 209 HostTextEditSetting *hle = new HostTextEditSetting(QString("mythvideo.AutoR2PL%1") 210 .arg(pl.GetLevel())); 211 hle->setLabel(QObject::tr("Level %1").arg(pl.GetLevel())); 212 hle->setHelpText(QObject::tr("Ratings containing these strings " 213 "(separated by :) will be assigned " 214 "to Parental Level %1.") 215 .arg(pl.GetLevel())); 216 217 r2pl_map::const_iterator def_setting = 218 r2pl_defaults.find(pl.GetLevel()); 219 if (def_setting != r2pl_defaults.end()) 246 220 { 247 HostLineEdit *hle = new HostLineEdit(QString("mythvideo.AutoR2PL%1") 248 .arg(pl.GetLevel())); 249 hle->setLabel(QObject::tr("Level %1").arg(pl.GetLevel())); 250 hle->setHelpText(QObject::tr("Ratings containing these strings " 251 "(separated by :) will be assigned " 252 "to Parental Level %1.") 253 .arg(pl.GetLevel())); 254 255 r2pl_map::const_iterator def_setting = 256 r2pl_defaults.find(pl.GetLevel()); 257 if (def_setting != r2pl_defaults.end()) 258 { 259 hle->setValue(def_setting->second); 260 } 261 262 vcg->addChild(hle); 221 hle->setValue(def_setting->second); 263 222 } 264 223 265 addTarget("0", new VerticalConfigurationGroup(true)); 266 addTarget("1", vcg); 224 r2pl->addTargetedChild("1", hle); 267 225 } 268 };269 226 270 } // namespace 227 return r2pl; 228 } 229 230 } 271 231 272 232 VideoGeneralSettings::VideoGeneralSettings() 233 :GroupSetting() 273 234 { 274 ConfigPage::PageList pages; 275 276 VConfigPage page1(pages, false); 277 page1->addChild(VideoStartupDirectory()); 278 page1->addChild(TrailerDirectory()); 279 page1->addChild(VideoArtworkDirectory()); 280 page1->addChild(VideoScreenshotDirectory()); 281 page1->addChild(VideoBannerDirectory()); 282 page1->addChild(VideoFanartDirectory()); 283 284 VConfigPage page2(pages, false); 285 page2->addChild(SetOnInsertDVD()); 286 page2->addChild(VideoTreeRemember()); 287 288 // page 3 289 VerticalConfigurationGroup *pctrl = 290 new VerticalConfigurationGroup(true, false); 235 setLabel(QObject::tr("General settings")); 236 237 addChild(VideoStartupDirectory()); 238 addChild(TrailerDirectory()); 239 addChild(VideoArtworkDirectory()); 240 addChild(VideoScreenshotDirectory()); 241 addChild(VideoBannerDirectory()); 242 addChild(VideoFanartDirectory()); 243 244 addChild(SetOnInsertDVD()); 245 addChild(VideoTreeRemember()); 246 247 GroupSetting *pctrl = 248 new GroupSetting(); 291 249 pctrl->setLabel(QObject::tr("Parental Control Settings")); 250 292 251 pctrl->addChild(VideoDefaultParentalLevel()); 293 252 pctrl->addChild(VideoAdminPassword()); 294 253 pctrl->addChild(VideoAdminPasswordThree()); 295 254 pctrl->addChild(VideoAdminPasswordTwo()); 296 255 pctrl->addChild(VideoAggressivePC()); 297 VConfigPage page3(pages, false);298 page3->addChild(pctrl);299 256 300 VConfigPage page4(pages, false); 301 page4->addChild(new RatingsToPL()); 257 addChild(pctrl); 258 259 addChild(RatingsToPL()); 302 260 303 int page_num = 1;304 for (ConfigPage::PageList::const_iterator p = pages.begin();305 p != pages.end(); ++p, ++page_num)306 {307 (*p)->setLabel(QObject::tr("General Settings (%1/%2)").arg(page_num)308 .arg(pages.size()));309 addChild(*p);310 }311 261 } 262 -
mythtv/programs/mythfrontend/videoglobalsettings.h
diff --git a/mythtv/programs/mythfrontend/videoglobalsettings.h b/mythtv/programs/mythfrontend/videoglobalsettings.h index 9f621e6..de155db 100644
a b 3 3 4 4 #include "settings.h" 5 5 6 class VideoGeneralSettings : public ConfigurationWizard 6 #include "standardsettings.h" 7 8 class VideoGeneralSettings : public GroupSetting 7 9 { 8 10 public: 9 11 VideoGeneralSettings();
