Ticket #8088: 8088_playgroups_v21.patch
File 8088_playgroups_v21.patch, 114.2 KB (added by , 13 years ago) |
---|
-
mythtv/libs/libmyth/libmyth.pro
diff --git a/mythtv/libs/libmyth/libmyth.pro b/mythtv/libs/libmyth/libmyth.pro index 2178699..e8d35ba 100644
a b SOURCES += programtypes.cpp recordingtypes.cpp 65 65 SOURCES += mythrssmanager.cpp netgrabbermanager.cpp 66 66 SOURCES += rssparse.cpp netutils.cpp 67 67 68 HEADERS += playsettings.h 69 SOURCES += playsettings.cpp 70 68 71 # remove when everything is switched to mythui 69 72 SOURCES += virtualkeyboard_qt.cpp 70 73 -
mythtv/libs/libmyth/mythconfiggroups.cpp
diff --git a/mythtv/libs/libmyth/mythconfiggroups.cpp b/mythtv/libs/libmyth/mythconfiggroups.cpp index 28933af..7e61bcb 100644
a b void TriggeredConfigurationGroup::addTarget(QString triggerValue, 476 476 Configurable *target) 477 477 { 478 478 VerifyLayout(); 479 bool isDuplicate = triggerMap.values().contains(target); 479 480 triggerMap[triggerValue] = target; 480 481 481 482 if (!configStack) … … void TriggeredConfigurationGroup::addTarget(QString triggerValue, 485 486 configStack->setSaveAll(isSaveAll); 486 487 } 487 488 488 configStack->addChild(target); 489 // Don't add a target as a child if it has already been added, 490 // otherwise something goes wrong with signals in the child. 491 if (!isDuplicate) 492 configStack->addChild(target); 489 493 } 490 494 491 495 Setting *TriggeredConfigurationGroup::byName(const QString &settingName) -
mythtv/libs/libmyth/mythwidgets.cpp
diff --git a/mythtv/libs/libmyth/mythwidgets.cpp b/mythtv/libs/libmyth/mythwidgets.cpp index 48168b3..5d1078a 100644
a b void MythCheckBox::keyPressEvent(QKeyEvent* e) 223 223 else if (action == "DOWN") 224 224 focusNextPrevChild(true); 225 225 else if (action == "LEFT" || action == "RIGHT" || action == "SELECT") 226 toggle(); 226 { 227 if (isTristate()) 228 { 229 Qt::CheckState newState = 230 (Qt::CheckState)(((int)checkState() + 1) % 3); 231 setCheckState(newState); 232 } 233 else 234 toggle(); 235 } 227 236 else 228 237 handled = false; 229 238 } -
mythtv/libs/libmyth/mythwidgets.h
diff --git a/mythtv/libs/libmyth/mythwidgets.h b/mythtv/libs/libmyth/mythwidgets.h index 91f2fa7..8cb4dd0 100644
a b class MPUBLIC MythCheckBox: public QCheckBox 329 329 Q_OBJECT 330 330 331 331 public: 332 MythCheckBox(QWidget *parent = 0, const char *name = "MythCheckBox") 333 : QCheckBox(parent) { setObjectName(name); }; 332 MythCheckBox(QWidget *parent = 0, const char *name = "MythCheckBox", 333 bool isTristate = false) : QCheckBox(parent) 334 { 335 setObjectName(name); 336 setTristate(isTristate); 337 } 334 338 MythCheckBox(const QString &text, 335 QWidget *parent = 0, const char *name = "MythCheckBox") 336 : QCheckBox(text, parent) { setObjectName(name); }; 339 QWidget *parent = 0, const char *name = "MythCheckBox", 340 bool isTristate = false) : QCheckBox(text, parent) 341 { 342 setObjectName(name); 343 setTristate(isTristate); 344 } 337 345 338 346 void setHelpText(const QString&); 339 347 -
mythtv/libs/libmyth/settings.cpp
diff --git a/mythtv/libs/libmyth/settings.cpp b/mythtv/libs/libmyth/settings.cpp index b955a9b..5b253b2 100644
a b int SelectSetting::getValueIndex(QString value) 235 235 return -1; 236 236 } 237 237 238 QString SelectSetting::GetValueLabel(const QString &value) 239 { 240 selectionList::const_iterator iterValues = values.begin(); 241 selectionList::const_iterator iterLabels = labels.begin(); 242 for (; iterValues != values.end() && iterLabels != labels.end(); 243 ++iterValues, ++iterLabels) 244 { 245 if (*iterValues == value) 246 return *iterLabels; 247 } 248 249 return "???"; 250 } 251 238 252 bool SelectSetting::ReplaceLabel(const QString &new_label, const QString &value) 239 253 { 240 254 int i = getValueIndex(value); … … QWidget* LineEditSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 299 313 QLabel *label = new QLabel(); 300 314 label->setText(getLabel() + ": "); 301 315 layout->addWidget(label); 316 labelWidget = label; 302 317 } 303 318 304 319 bxwidget = widget; … … QWidget* LineEditSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 327 342 328 343 widget->setLayout(layout); 329 344 345 setValue(getValue()); 346 330 347 return widget; 331 348 } 332 349 … … void LineEditSetting::widgetInvalid(QObject *obj) 336 353 { 337 354 bxwidget = NULL; 338 355 edit = NULL; 356 labelWidget = NULL; 339 357 } 340 358 } 341 359 … … void LineEditSetting::setHelpText(const QString &str) 373 391 Setting::setHelpText(str); 374 392 } 375 393 394 static void adjustFont(QWidget *widget, bool isDefault) 395 { 396 if (widget) 397 { 398 QFont f = widget->font(); 399 f.setWeight(isDefault ? QFont::Light : QFont::Bold); 400 widget->setFont(f); 401 } 402 } 403 404 void LineEditSetting::setValue(const QString &newValue) 405 { 406 if (adjustOnBlank) 407 { 408 adjustFont(labelWidget, newValue.isEmpty()); 409 adjustFont(edit, newValue.isEmpty()); 410 } 411 Setting::setValue(newValue); 412 } 413 376 414 void BoundedIntegerSetting::setValue(int newValue) 377 415 { 378 416 newValue = std::max(std::min(newValue, max), min); … … QWidget* SliderSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 439 477 440 478 SpinBoxSetting::SpinBoxSetting( 441 479 Storage *_storage, int _min, int _max, int _step, 442 bool _allow_single_step, QString _special_value_text) : 480 bool _allow_single_step, QString _special_value_text, 481 bool change_style_on_special) : 443 482 BoundedIntegerSetting(_storage, _min, _max, _step), 444 483 spinbox(NULL), relayEnabled(true), 445 sstep(_allow_single_step), svtext("") 484 sstep(_allow_single_step), svtext(""), labelWidget(NULL), 485 changeOnSpecial(change_style_on_special) 446 486 { 447 487 if (!_special_value_text.isEmpty()) 448 488 svtext = _special_value_text; … … QWidget* SpinBoxSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 476 516 QLabel *label = new QLabel(); 477 517 label->setText(getLabel() + ": "); 478 518 layout->addWidget(label); 519 labelWidget = label; 479 520 } 480 521 481 522 bxwidget = widget; … … QWidget* SpinBoxSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 506 547 507 548 widget->setLayout(layout); 508 549 550 setValue(intValue()); 551 509 552 return widget; 510 553 } 511 554 … … void SpinBoxSetting::widgetInvalid(QObject *obj) 515 558 { 516 559 bxwidget = NULL; 517 560 spinbox = NULL; 561 labelWidget = NULL; 518 562 } 519 563 } 520 564 521 565 void SpinBoxSetting::setValue(int newValue) 522 566 { 523 567 newValue = std::max(std::min(newValue, max), min); 568 if (changeOnSpecial) 569 { 570 adjustFont(labelWidget, (newValue == min)); 571 adjustFont(spinbox, (newValue == min)); 572 } 524 573 if (spinbox && (spinbox->value() != newValue)) 525 574 { 526 575 //int old = intValue(); … … QWidget* ComboBoxSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 631 680 QLabel *label = new QLabel(); 632 681 label->setText(getLabel() + ": "); 633 682 layout->addWidget(label); 683 labelWidget = label; 634 684 } 635 685 636 686 bxwidget = widget; … … QWidget* ComboBoxSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 659 709 cbwidget, SLOT(clear())); 660 710 661 711 if (rw) 712 { 662 713 connect(cbwidget, SIGNAL(editTextChanged(const QString &)), 663 714 this, SLOT(editTextChanged(const QString &))); 715 connect(cbwidget, SIGNAL(editTextChanged(const QString &)), 716 this, SLOT(changeLabel(const QString &))); 717 } 664 718 665 719 if (cg) 666 720 connect(cbwidget, SIGNAL(changeHelpText(QString)), cg, … … QWidget* ComboBoxSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 673 727 674 728 widget->setLayout(layout); 675 729 730 setValue(current); 731 676 732 return widget; 677 733 } 678 734 … … void ComboBoxSetting::widgetInvalid(QObject *obj) 682 738 { 683 739 bxwidget = NULL; 684 740 cbwidget = NULL; 741 labelWidget = NULL; 685 742 } 686 743 } 687 744 … … void ComboBoxSetting::setValue(QString newValue) 717 774 718 775 if (rw) 719 776 { 777 changeLabel(newValue); 720 778 Setting::setValue(newValue); 721 779 if (cbwidget) 722 780 cbwidget->setCurrentIndex(current); … … void ComboBoxSetting::setValue(int which) 727 785 { 728 786 if (cbwidget) 729 787 cbwidget->setCurrentIndex(which); 788 changeLabel(labels[which]); 730 789 SelectSetting::setValue(which); 731 790 } 732 791 733 void ComboBoxSetting::addSelection( 734 const QString &label, QString value, bool select) 792 void ComboBoxSetting::changeLabel(const QString &newLabel) 793 { 794 if (changeOnSpecial) 795 { 796 adjustFont(labelWidget, specialLabel == newLabel); 797 adjustFont(cbwidget, specialLabel == newLabel); 798 } 799 } 800 801 void ComboBoxSetting::addSelection(const QString &label, QString value, 802 bool select, bool special_formatting) 735 803 { 736 804 if ((findSelection(label, value) < 0) && cbwidget) 737 805 { … … void ComboBoxSetting::addSelection( 739 807 cbwidget->insertItem(label); 740 808 } 741 809 810 if (special_formatting) 811 { 812 changeOnSpecial = true; 813 specialLabel = label; 814 } 815 742 816 SelectSetting::addSelection(label, value, select); 743 817 744 818 if (cbwidget && isSet) … … void CheckBoxSetting::setHelpText(const QString &str) 955 1029 BooleanSetting::setHelpText(str); 956 1030 } 957 1031 1032 QWidget* TristateCheckBoxSetting::configWidget(ConfigurationGroup *cg, 1033 QWidget* parent, 1034 const char* widgetName) { 1035 widget = new MythCheckBox(parent, widgetName, true); 1036 connect(widget, SIGNAL(destroyed(QObject*)), 1037 this, SLOT(widgetDeleted(QObject*))); 1038 1039 widget->setHelpText(getHelpText()); 1040 widget->setText(getLabel()); 1041 widget->setCheckState(tristateValue()); 1042 setValue(tristateValue()); 1043 1044 connect(widget, SIGNAL(stateChanged(int)), 1045 this, SLOT(setValue(int))); 1046 connect(this, SIGNAL(valueChanged(int)), 1047 this, SLOT(relayValueChanged(int))); 1048 1049 if (cg) 1050 connect(widget, SIGNAL(changeHelpText(QString)), cg, 1051 SIGNAL(changeHelpText(QString))); 1052 1053 return widget; 1054 } 1055 1056 void TristateCheckBoxSetting::widgetInvalid(QObject *obj) 1057 { 1058 widget = (widget == obj) ? NULL : widget; 1059 } 1060 1061 void TristateCheckBoxSetting::setEnabled(bool fEnabled) 1062 { 1063 TristateSetting::setEnabled(fEnabled); 1064 if (widget) 1065 widget->setEnabled(fEnabled); 1066 } 1067 1068 void TristateCheckBoxSetting::setHelpText(const QString &str) 1069 { 1070 if (widget) 1071 widget->setHelpText(str); 1072 TristateSetting::setHelpText(str); 1073 } 1074 1075 const char *TristateSetting::kPartiallyCheckedString = "default"; 1076 1077 void TristateCheckBoxSetting::setValue(int check) 1078 { 1079 adjustFont(widget, (check != Qt::Checked && check != Qt::Unchecked)); 1080 TristateSetting::setValue(check); 1081 emit valueChanged(check); 1082 } 1083 1084 void TristateSetting::setValue(int check) 1085 { 1086 if (check == Qt::Checked) 1087 Setting::setValue("1"); 1088 else if (check == Qt::Unchecked) 1089 Setting::setValue("0"); 1090 else 1091 Setting::setValue(kPartiallyCheckedString); 1092 emit valueChanged(check); 1093 } 1094 958 1095 void AutoIncrementDBSetting::Save(QString table) 959 1096 { 960 1097 if (intValue() == 0) … … void ImageSelectSetting::addImageSelection(const QString& label, 1142 1279 addSelection(label, value, select); 1143 1280 } 1144 1281 1282 void ImageSelectSetting::addDefaultSelection(const QString label, 1283 const QString value, 1284 const QString defaultValue, 1285 bool select) 1286 { 1287 for (unsigned i=0; i<values.size(); i++) 1288 { 1289 if (values[i] == defaultValue) 1290 { 1291 changeOnSpecial = true; 1292 specialLabel = label; 1293 images.push_back(new QImage(*images[i])); 1294 addSelection(label, value, select); 1295 return; 1296 } 1297 } 1298 } 1299 1145 1300 ImageSelectSetting::~ImageSelectSetting() 1146 1301 { 1147 1302 Teardown(); … … void ImageSelectSetting::Teardown(void) 1164 1319 bxwidget = NULL; 1165 1320 imagelabel = NULL; 1166 1321 combo = NULL; 1322 labelWidget = NULL; 1167 1323 } 1168 1324 1169 1325 void ImageSelectSetting::imageSet(int num) … … QWidget* ImageSelectSetting::configWidget(ConfigurationGroup *cg, 1211 1367 QLabel *label = new QLabel(); 1212 1368 label->setText(getLabel() + ":"); 1213 1369 layout->addWidget(label); 1370 labelWidget = label; 1214 1371 } 1215 1372 1216 1373 combo = new MythComboBox(false); … … QWidget* ImageSelectSetting::configWidget(ConfigurationGroup *cg, 1257 1414 connect(combo, SIGNAL(highlighted(int)), this, SLOT(imageSet(int))); 1258 1415 connect(combo, SIGNAL(activated(int)), this, SLOT(setValue(int))); 1259 1416 connect(combo, SIGNAL(activated(int)), this, SLOT(imageSet(int))); 1417 connect(combo, SIGNAL(highlighted(const QString &)), 1418 this, SLOT(changeLabel(const QString &))); 1419 connect(combo, SIGNAL(activated(const QString &)), 1420 this, SLOT(changeLabel(const QString &))); 1260 1421 1261 1422 connect(this, SIGNAL(selectionsCleared()), 1262 1423 combo, SLOT(clear())); … … QWidget* ImageSelectSetting::configWidget(ConfigurationGroup *cg, 1267 1428 1268 1429 bxwidget->setLayout(layout); 1269 1430 1431 changeLabel(GetLabel(current)); 1432 1270 1433 return bxwidget; 1271 1434 } 1272 1435 1436 void ImageSelectSetting::changeLabel(const QString &newLabel) 1437 { 1438 if (changeOnSpecial) 1439 { 1440 adjustFont(labelWidget, specialLabel == newLabel); 1441 adjustFont(combo, specialLabel == newLabel); 1442 } 1443 } 1444 1273 1445 void ImageSelectSetting::widgetInvalid(QObject *obj) 1274 1446 { 1275 1447 if (bxwidget == obj) -
mythtv/libs/libmyth/settings.h
diff --git a/mythtv/libs/libmyth/settings.h b/mythtv/libs/libmyth/settings.h index 9e8335e..202975e 100644
a b class MPUBLIC LabelSetting : public Setting 134 134 135 135 class MPUBLIC LineEditSetting : public Setting 136 136 { 137 Q_OBJECT 138 137 139 protected: 138 LineEditSetting(Storage *_storage, bool readwrite = true) : 140 LineEditSetting(Storage *_storage, bool readwrite = true, 141 bool adjust_on_blank = false) : 139 142 Setting(_storage), bxwidget(NULL), edit(NULL), 140 rw(readwrite), password_echo(false) { } 143 rw(readwrite), password_echo(false), 144 adjustOnBlank(adjust_on_blank), labelWidget(NULL) { } 141 145 142 146 public: 143 147 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, … … class MPUBLIC LineEditSetting : public Setting 159 163 160 164 virtual void setHelpText(const QString &str); 161 165 166 public slots: 167 virtual void setValue(const QString &newValue); 168 162 169 private: 163 170 QWidget *bxwidget; 164 171 MythLineEdit *edit; 165 172 bool rw; 166 173 bool password_echo; 174 bool adjustOnBlank; 175 QWidget *labelWidget; 167 176 }; 168 177 169 178 // TODO: set things up so that setting the value as a string emits … … class MPUBLIC SpinBoxSetting: public BoundedIntegerSetting 219 228 public: 220 229 SpinBoxSetting(Storage *_storage, int min, int max, int step, 221 230 bool allow_single_step = false, 222 QString special_value_text = ""); 231 QString special_value_text = "", 232 bool change_style_on_special = false); 223 233 224 234 virtual QWidget *configWidget(ConfigurationGroup *cg, QWidget *parent, 225 235 const char *widgetName = 0); … … class MPUBLIC SpinBoxSetting: public BoundedIntegerSetting 248 258 bool relayEnabled; 249 259 bool sstep; 250 260 QString svtext; 261 QLabel *labelWidget; 262 bool changeOnSpecial; 251 263 }; 252 264 253 265 class MPUBLIC SelectSetting : public Setting … … class MPUBLIC SelectSetting : public Setting 277 289 { return (i < labels.size()) ? labels[i] : QString::null; } 278 290 virtual QString GetValue(uint i) const 279 291 { return (i < values.size()) ? values[i] : QString::null; } 292 virtual QString GetValueLabel(const QString &value); 280 293 281 294 signals: 282 295 void selectionAdded(const QString& label, QString value); … … class MPUBLIC ComboBoxSetting: public SelectSetting { 318 331 protected: 319 332 ComboBoxSetting(Storage *_storage, bool _rw = false, int _step = 1) : 320 333 SelectSetting(_storage), rw(_rw), 321 bxwidget(NULL), cbwidget(NULL), step(_step) { } 334 bxwidget(NULL), cbwidget(NULL), changeOnSpecial(false), 335 specialLabel(""), labelWidget(NULL), step(_step) { } 322 336 323 337 public: 324 338 virtual void setValue(QString newValue); … … public: 340 354 public slots: 341 355 void addSelection(const QString &label, 342 356 QString value = QString::null, 343 bool select = false); 357 bool select = false, 358 bool special_formatting = false); 344 359 bool removeSelection(const QString &label, 345 360 QString value = QString::null); 361 virtual void changeLabel(const QString &newValue); 346 362 void editTextChanged(const QString &newText); 347 363 348 364 private: 349 365 bool rw; 350 366 QWidget *bxwidget; 351 367 MythComboBox *cbwidget; 368 bool changeOnSpecial; 369 QString specialLabel; 370 QLabel *labelWidget; 352 371 353 372 protected: 354 373 int step; … … public: 417 436 ImageSelectSetting(Storage *_storage) : 418 437 SelectSetting(_storage), 419 438 bxwidget(NULL), imagelabel(NULL), combo(NULL), 420 m_hmult(1.0f), m_wmult(1.0f) { } 439 m_hmult(1.0f), m_wmult(1.0f), 440 changeOnSpecial(false), specialLabel(""), labelWidget(NULL) { } 421 441 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 422 442 const char* widgetName = 0); 423 443 virtual void widgetInvalid(QObject *obj); … … public: 428 448 QImage* image, 429 449 QString value=QString::null, 430 450 bool select=false); 451 virtual void addDefaultSelection(const QString label, 452 const QString value, 453 const QString defaultValue, 454 bool select); 431 455 432 456 protected slots: 433 457 void imageSet(int); 458 void changeLabel(const QString &newLabel); 434 459 435 460 protected: 436 461 void Teardown(void); … … protected: 442 467 QLabel *imagelabel; 443 468 MythComboBox *combo; 444 469 float m_hmult, m_wmult; 470 bool changeOnSpecial; 471 QString specialLabel; 472 QLabel *labelWidget; 445 473 }; 446 474 447 475 class MPUBLIC BooleanSetting : public Setting … … protected: 484 512 MythCheckBox *widget; 485 513 }; 486 514 515 class MPUBLIC TristateSetting : public BooleanSetting 516 { 517 Q_OBJECT 518 519 public: 520 TristateSetting(Storage *_storage) : BooleanSetting(_storage) {} 521 522 Qt::CheckState tristateValue(void) const { 523 if (getValue() == "0") 524 return Qt::Unchecked; 525 if (getValue() == "1") 526 return Qt::Checked; 527 return Qt::PartiallyChecked; 528 } 529 530 static const char *kPartiallyCheckedString; 531 532 public slots: 533 virtual void setValue(/*Qt::CheckState*/int check); 534 535 signals: 536 void valueChanged(int); 537 }; 538 539 class MPUBLIC TristateCheckBoxSetting: public TristateSetting { 540 Q_OBJECT 541 542 public: 543 TristateCheckBoxSetting(Storage *_storage) : 544 TristateSetting(_storage), widget(NULL) { } 545 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 546 const char* widgetName = 0); 547 virtual void widgetInvalid(QObject*); 548 549 virtual void setEnabled(bool b); 550 551 virtual void setHelpText(const QString &str); 552 553 554 public slots: 555 virtual void setValue(/*Qt::CheckState*/int check); 556 virtual void relayValueChanged(int state) { 557 if (widget) 558 widget->setCheckState((Qt::CheckState)state); 559 } 560 561 protected: 562 MythCheckBox *widget; 563 }; 564 487 565 class MPUBLIC PathSetting : public ComboBoxSetting 488 566 { 489 567 public: -
mythtv/libs/libmythtv/DetectLetterbox.cpp
diff --git a/mythtv/libs/libmythtv/DetectLetterbox.cpp b/mythtv/libs/libmythtv/DetectLetterbox.cpp index 57e659a..2bc92ea 100644
a b 5 5 #include "mythplayer.h" 6 6 #include "videoouttypes.h" 7 7 #include "mythcorecontext.h" 8 #include "playsettings.h" 8 9 9 10 DetectLetterbox::DetectLetterbox(MythPlayer* const player) 10 11 { 11 int dbAdjustFill = gCoreContext->GetNumSetting("AdjustFill", 0);12 int dbAdjustFill = player->GetPlaySettings()->GetNumSetting("AdjustFill", 0); 12 13 isDetectLetterbox = dbAdjustFill >= kAdjustFill_AutoDetect_DefaultOff; 13 14 firstFrameChecked = 0; 14 15 detectLetterboxDefaultMode = (AdjustFillMode) max((int) kAdjustFill_Off, … … DetectLetterbox::DetectLetterbox(MythPlayer* const player) 18 19 detectLetterboxPossibleFullFrame = -1; 19 20 detectLetterboxConsecutiveCounter = 0; 20 21 detectLetterboxDetectedMode = player->GetAdjustFill(); 21 detectLetterboxLimit = gCoreContext->GetNumSetting("DetectLeterboxLimit", 75); 22 detectLetterboxLimit = 23 player->GetPlaySettings()->GetNumSetting("DetectLeterboxLimit", 75); 22 24 m_player = player; 23 25 } 24 26 -
mythtv/libs/libmythtv/avformatdecoder.cpp
diff --git a/mythtv/libs/libmythtv/avformatdecoder.cpp b/mythtv/libs/libmythtv/avformatdecoder.cpp index 6a7252c..1a08078 100644
a b using namespace std; 35 35 #include "bdringbuffer.h" 36 36 #include "videodisplayprofile.h" 37 37 #include "mythuihelper.h" 38 #include "playsettings.h" 38 39 39 40 #include "lcddevice.h" 40 41 … … AvFormatDecoder::AvFormatDecoder(MythPlayer *parent, 284 285 285 286 cc608_build_parity_table(cc608_parity_table); 286 287 287 if ( gCoreContext->GetNumSetting("CCBackground", 0))288 if (GetPlayer()->GetPlaySettings()->GetNumSetting("CCBackground", 0)) 288 289 CC708Window::forceWhiteOnBlackText = true; 289 290 290 291 no_dts_hack = false; … … void AvFormatDecoder::InitVideoCodec(AVStream *stream, AVCodecContext *enc, 1181 1182 if (selectedStream) 1182 1183 { 1183 1184 directrendering = true; 1184 if (! gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&1185 if (!GetPlayer()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) && 1185 1186 !CODEC_IS_HWACCEL(codec, enc)) 1186 1187 { 1187 1188 SetLowBuffers(false); … … int AvFormatDecoder::ScanStreams(bool novideo) 1686 1687 1687 1688 if (!is_db_ignored) 1688 1689 { 1689 VideoDisplayProfile vdp ;1690 VideoDisplayProfile vdp(GetPlayer()->GetPlaySettings()); 1690 1691 vdp.SetInput(QSize(width, height)); 1691 1692 dec = vdp.GetDecoder(); 1692 1693 thread_count = vdp.GetMaxCPUs(); … … int AvFormatDecoder::ScanStreams(bool novideo) 1714 1715 MythCodecID vdpau_mcid; 1715 1716 vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec( 1716 1717 width, height, 1717 mpeg_version(enc->codec_id), no_hardware_decoders); 1718 mpeg_version(enc->codec_id), no_hardware_decoders, 1719 GetPlayer()->GetPlaySettings()); 1718 1720 1719 1721 if (vdpau_mcid >= video_codec_id) 1720 1722 { -
mythtv/libs/libmythtv/dbcheck.cpp
diff --git a/mythtv/libs/libmythtv/dbcheck.cpp b/mythtv/libs/libmythtv/dbcheck.cpp index f9abdce..ff35dca 100644
a b NULL 3558 3558 3559 3559 VideoDisplayProfile::CreateNewProfiles(host); 3560 3560 profiles = VideoDisplayProfile::GetProfiles(host); 3561 QString profile = VideoDisplayProfile::GetDefaultProfileName(host); 3561 QString profile = 3562 VideoDisplayProfile::GetDefaultProfileName(host, NULL); 3562 3563 3563 3564 if (profiles.contains("Normal") && 3564 3565 (profile=="CPU++" || profile=="CPU+" || profile=="CPU--")) … … tmp.constData(), 5994 5995 " jump int(11) NOT NULL default '0'," 5995 5996 " PRIMARY KEY (`name`)" 5996 5997 ");", 5998 "CREATE TABLE playgroupsettings (" 5999 " playgroupname varchar(64) NOT NULL," 6000 " `value` varchar(128) NOT NULL," 6001 " `data` text," 6002 " overridden tinyint(1) NOT NULL," 6003 " PRIMARY KEY (playgroupname, `value`)" 6004 ");", 5997 6005 "CREATE TABLE powerpriority (" 5998 6006 " priorityname varchar(64) collate utf8_bin NOT NULL," 5999 6007 " recpriority int(10) NOT NULL default '0'," -
mythtv/libs/libmythtv/mythplayer.cpp
diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp index 198e1fa..faf4986 100644
a b using namespace std; 60 60 #include "mythpainter.h" 61 61 #include "mythimage.h" 62 62 #include "mythuiimage.h" 63 #include "playsettings.h" 63 64 64 65 extern "C" { 65 66 #include "vbitext/vbi.h" … … MythPlayer::MythPlayer(bool muted) 249 250 output_jmeter(NULL) 250 251 { 251 252 playerThread = QThread::currentThread(); 252 // Playback (output) zoom control253 detect_letter_box = new DetectLetterbox(this);254 255 vbimode = VBIMode::Parse(gCoreContext->GetSetting("VbiFormat"));256 decode_extra_audio = gCoreContext->GetNumSetting("DecodeExtraAudio", 0);257 itvEnabled = gCoreContext->GetNumSetting("EnableMHEG", 0);258 db_prefer708 = gCoreContext->GetNumSetting("Prefer708Captions", 1);259 253 260 254 bzero(&tc_lastval, sizeof(tc_lastval)); 261 255 bzero(&tc_wrap, sizeof(tc_wrap)); … … bool MythPlayer::InitVideo(void) 495 489 if (using_null_videoout && decoder) 496 490 { 497 491 MythCodecID codec = decoder->GetVideoCodecID(); 498 videoOutput = new VideoOutputNull( );492 videoOutput = new VideoOutputNull(GetPlaySettings()); 499 493 if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(), 500 494 video_aspect, 0, 0, 0, 0, 0, codec, 0)) 501 495 { … … bool MythPlayer::InitVideo(void) 545 539 pipState, 546 540 video_disp_dim, video_aspect, 547 541 widget->winId(), display_rect, (video_frame_rate * play_speed), 548 0 /*embedid*/ );542 0 /*embedid*/, GetPlaySettings()); 549 543 } 550 544 551 545 if (videoOutput) … … void MythPlayer::ReinitOSD(void) 636 630 637 631 void MythPlayer::ReinitVideo(void) 638 632 { 639 if (!videoOutput->IsPreferredRenderer(video_disp_dim ))633 if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings())) 640 634 { 641 635 VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer.")); 642 636 SetErrored(QObject::tr("Need to switch video renderer.")); … … void MythPlayer::VideoStart(void) 2039 2033 } 2040 2034 #endif // USING_MHEG 2041 2035 2042 SetCaptionsEnabled(gCoreContext->GetNumSetting("DefaultCCMode"), false); 2036 SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0), 2037 false); 2043 2038 osdLock.unlock(); 2044 2039 } 2045 2040 … … void MythPlayer::VideoStart(void) 2086 2081 m_double_process = videoOutput->IsExtraProcessingRequired(); 2087 2082 2088 2083 videosync = VideoSync::BestMethod( 2089 videoOutput, fr_int, rf_int, m_double_framerate); 2084 videoOutput, GetPlaySettings(), 2085 fr_int, rf_int, m_double_framerate); 2090 2086 2091 2087 // Make sure video sync can do it 2092 2088 if (videosync != NULL && m_double_framerate) … … void MythPlayer::InitialSeek(void) 2469 2465 if (bookmarkseek > 30) 2470 2466 { 2471 2467 DoFastForward(bookmarkseek, true, false); 2472 if ( gCoreContext->GetNumSetting("ClearSavedPosition", 1) &&2468 if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) && 2473 2469 !player_ctx->IsPIP()) 2474 2470 { 2475 2471 ClearBookmark(false); … … void MythPlayer::EventLoop(void) 2697 2693 { 2698 2694 if (jumpto == totalFrames) 2699 2695 { 2700 if (!( gCoreContext->GetNumSetting("EndOfRecordingExitPrompt") == 12696 if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1 2701 2697 && !player_ctx->IsPIP() && 2702 2698 player_ctx->GetState() == kState_WatchingPreRecorded)) 2703 2699 { … … PIPLocation MythPlayer::GetNextPIPLocation(void) const 2980 2976 return kPIP_END; 2981 2977 2982 2978 if (pip_players.isEmpty()) 2983 return (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft); 2979 return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation", 2980 kPIPTopLeft); 2984 2981 2985 2982 // order of preference, could be stored in db if we want it configurable 2986 2983 PIPLocation ols[] = … … void MythPlayer::SetPlayerInfo(TV *tv, QWidget *widget, 3488 3485 exactseeks = frame_exact_seek; 3489 3486 player_ctx = ctx; 3490 3487 livetv = ctx->tvchain; 3488 3489 vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", "")); 3490 3491 // Playback (output) zoom control 3492 detect_letter_box = new DetectLetterbox(this); 3493 3494 decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0); 3495 itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0); 3496 db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1); 3491 3497 } 3492 3498 3493 3499 bool MythPlayer::EnableEdit(void) -
mythtv/libs/libmythtv/mythplayer.h
diff --git a/mythtv/libs/libmythtv/mythplayer.h b/mythtv/libs/libmythtv/mythplayer.h index b776296..90f8417 100644
a b class MPUBLIC MythPlayer 186 186 QString GetXDS(const QString &key) const; 187 187 PIPLocation GetNextPIPLocation(void) const; 188 188 189 PlaySettings *GetPlaySettings(void) const { 190 return player_ctx ? player_ctx->settings : NULL; 191 } 192 189 193 // Bool Gets 190 194 bool GetRawAudioState(void) const; 191 195 bool GetLimitKeyRepeat(void) const { return limitKeyRepeat; } -
mythtv/libs/libmythtv/playercontext.cpp
diff --git a/mythtv/libs/libmythtv/playercontext.cpp b/mythtv/libs/libmythtv/playercontext.cpp index 6c9111b..eadae1b 100644
a b 16 16 #include "storagegroup.h" 17 17 #include "mythcorecontext.h" 18 18 #include "videometadatautil.h" 19 #include "DetectLetterbox.h" 20 #include "playsettings.h" 19 21 20 22 #define LOC QString("playCtx: ") 21 23 #define LOC_ERR QString("playCtx, Error: ") … … bool PlayerContext::CreatePlayer(TV *tv, QWidget *widget, 405 407 WId embedwinid, const QRect *embedbounds, 406 408 bool muted) 407 409 { 408 int exact_seeking = gCoreContext->GetNumSetting("ExactSeeking", 0);410 int exact_seeking = settings->GetNumSetting("ExactSeeking", 0); 409 411 410 412 if (HasPlayer()) 411 413 { … … bool PlayerContext::CreatePlayer(TV *tv, QWidget *widget, 448 450 { 449 451 QString subfn = buffer->GetSubtitleFilename(); 450 452 if (!subfn.isEmpty() && player->GetSubReader()) 451 player->GetSubReader()->LoadExternalSubtitles(subfn );453 player->GetSubReader()->LoadExternalSubtitles(subfn, settings); 452 454 } 453 455 454 456 if ((embedwinid > 0) && embedbounds) … … void PlayerContext::SetRingBuffer(RingBuffer *buf) 915 917 /** 916 918 * \brief assign programinfo to the context 917 919 */ 918 void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 920 void PlayerContext::SetPlayingInfo(const ProgramInfo *info, 921 PlaySettings *_settings) 919 922 { 920 923 bool ignoreDB = gCoreContext->IsDatabaseIgnored(); 921 924 … … void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 927 930 playingInfo->MarkAsInUse(false, recUsage); 928 931 delete playingInfo; 929 932 playingInfo = NULL; 933 // XXX delete settings? 930 934 } 931 935 932 936 if (info) … … void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 935 939 if (!ignoreDB) 936 940 playingInfo->MarkAsInUse(true, recUsage); 937 941 playingLen = playingInfo->GetSecondsInRecording(); 942 settings = (_settings ? _settings : 943 new PlaySettings(playingInfo->GetPlaybackGroup())); 938 944 } 939 945 } 940 946 -
mythtv/libs/libmythtv/playercontext.h
diff --git a/mythtv/libs/libmythtv/playercontext.h b/mythtv/libs/libmythtv/playercontext.h index 97faf89..c0abcb1 100644
a b class ProgramInfo; 28 28 class LiveTVChain; 29 29 class MythDialog; 30 30 class QPainter; 31 class PlaySettings; 31 32 32 33 struct osdInfo 33 34 { … … class MPUBLIC PlayerContext 115 116 void SetRecorder(RemoteEncoder *rec); 116 117 void SetTVChain(LiveTVChain *chain); 117 118 void SetRingBuffer(RingBuffer *buf); 118 void SetPlayingInfo(const ProgramInfo *info );119 void SetPlayingInfo(const ProgramInfo *info, PlaySettings *settings=NULL); 119 120 void SetPlayGroup(const QString &group); 120 121 void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state); 121 122 void SetPIPLocation(int loc) { pipLocation = loc; } … … class MPUBLIC PlayerContext 173 174 LiveTVChain *tvchain; 174 175 RingBuffer *buffer; 175 176 ProgramInfo *playingInfo; ///< Currently playing info 177 PlaySettings *settings; // corresponding to playingInfo 176 178 long long playingLen; ///< Initial CalculateLength() 177 179 AVSpecialDecode specialDecode; 178 180 bool nohardwaredecoders; // < Disable use of VDPAU decoding -
mythtv/libs/libmythtv/playgroup.cpp
diff --git a/mythtv/libs/libmythtv/playgroup.cpp b/mythtv/libs/libmythtv/playgroup.cpp index 1480874..4817f67 100644
a b 2 2 #include "playgroup.h" 3 3 #include "programinfo.h" 4 4 #include "mythwidgets.h" 5 #include "playsettings.h" 5 6 6 7 class PlayGroupConfig: public ConfigurationWizard 7 8 { … … int PlayGroup::GetSetting(const QString &name, const QString &field, 220 221 return res; 221 222 } 222 223 223 PlayGroupEditor::PlayGroupEditor(void) : 224 listbox(new ListBoxSetting(this)), lastValue("Default") 224 PlayGroupEditor::PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize) : 225 listbox(new ListBoxSetting(this)), lastValue("Default"), 226 getSettings(funcArray), getSettingsSize(funcArraySize) 225 227 { 226 228 listbox->setLabel(tr("Playback Groups")); 227 229 addChild(listbox); … … void PlayGroupEditor::open(QString name) 252 254 } 253 255 254 256 PlayGroupConfig group(name); 257 PlaySettings *psettings = new PlaySettings(name); 258 for (int i=0; i<getSettingsSize; i++) 259 getSettings[i](psettings, &group); 255 260 if (group.exec() == QDialog::Accepted || !created) 256 261 lastValue = name; 257 262 else … … void PlayGroupEditor::doDelete(void) 286 291 query.bindValue(":NAME", name); 287 292 if (!query.exec()) 288 293 MythDB::DBError("PlayGroupEditor::doDelete", query); 294 PlaySettings::deleteGroup(name); 289 295 290 296 int lastIndex = listbox->getValueIndex(name); 291 297 lastValue = ""; -
mythtv/libs/libmythtv/playgroup.h
diff --git a/mythtv/libs/libmythtv/playgroup.h b/mythtv/libs/libmythtv/playgroup.h index d6fc29f..8a5c6cb 100644
a b 6 6 #include "settings.h" 7 7 8 8 class ProgramInfo; 9 class PlaySettings; 9 10 10 11 class MPUBLIC PlayGroup 11 12 { … … class MPUBLIC PlayGroupEditor : public QObject, public ConfigurationDialog 22 23 Q_OBJECT 23 24 24 25 public: 25 PlayGroupEditor(void); 26 typedef ConfigurationWizard *(*SettingsLookup)(PlaySettings *settings, 27 ConfigurationWizard *base); 28 PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize); 26 29 virtual DialogCode exec(void); 27 30 virtual void Load(void); 28 31 virtual void Save(void) { } … … class MPUBLIC PlayGroupEditor : public QObject, public ConfigurationDialog 37 40 protected: 38 41 ListBoxSetting *listbox; 39 42 QString lastValue; 43 SettingsLookup *getSettings; 44 int getSettingsSize; 40 45 }; 41 46 42 47 #endif -
mythtv/libs/libmythtv/subtitlereader.cpp
diff --git a/mythtv/libs/libmythtv/subtitlereader.cpp b/mythtv/libs/libmythtv/subtitlereader.cpp index a6eb2e4..736f341 100644
a b void SubtitleReader::FreeAVSubtitle(const AVSubtitle &subtitle) 65 65 av_free(subtitle.rects); 66 66 } 67 67 68 bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName) 68 bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName, 69 PlaySettings *settings) 69 70 { 70 71 m_TextSubtitles.Clear(); 71 return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles); 72 return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles, 73 settings); 72 74 } 73 75 74 76 bool SubtitleReader::HasTextSubtitles(void) -
mythtv/libs/libmythtv/subtitlereader.h
diff --git a/mythtv/libs/libmythtv/subtitlereader.h b/mythtv/libs/libmythtv/subtitlereader.h index cc6591e..13dbe83 100644
a b class SubtitleReader 44 44 45 45 TextSubtitles* GetTextSubtitles(void) { return &m_TextSubtitles; } 46 46 bool HasTextSubtitles(void); 47 bool LoadExternalSubtitles(const QString &videoFile );47 bool LoadExternalSubtitles(const QString &videoFile, PlaySettings *settings); 48 48 49 49 QStringList GetRawTextSubtitles(uint64_t &duration); 50 50 void AddRawTextSubtitle(QStringList list, uint64_t duration); -
mythtv/libs/libmythtv/subtitlescreen.cpp
diff --git a/mythtv/libs/libmythtv/subtitlescreen.cpp b/mythtv/libs/libmythtv/subtitlescreen.cpp index c09f965..f282b2a 100644
a b 7 7 #include "mythuiimage.h" 8 8 #include "mythpainter.h" 9 9 #include "subtitlescreen.h" 10 #include "playsettings.h" 10 11 11 12 #define LOC QString("Subtitles: ") 12 13 #define LOC_WARN QString("Subtitles Warning: ") … … bool SubtitleScreen::Create(void) 68 69 VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-608 reader."); 69 70 if (!m_708reader) 70 71 VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-708 reader."); 71 m_useBackground = (bool) gCoreContext->GetNumSetting("CCBackground", 0);72 m_textFontZoom = gCoreContext->GetNumSetting("OSDCC708TextZoom", 100);72 m_useBackground = (bool)m_player->GetPlaySettings()->GetNumSetting("CCBackground", 0); 73 m_textFontZoom = m_player->GetPlaySettings()->GetNumSetting("OSDCC708TextZoom", 100); 73 74 return true; 74 75 } 75 76 -
mythtv/libs/libmythtv/textsubtitleparser.cpp
diff --git a/mythtv/libs/libmythtv/textsubtitleparser.cpp b/mythtv/libs/libmythtv/textsubtitleparser.cpp index b15c4d5..09cb3b1 100644
a b using std::lower_bound; 21 21 #include "ringbuffer.h" 22 22 #include "textsubtitleparser.h" 23 23 #include "xine_demux_sputext.h" 24 #include "playsettings.h" 24 25 25 26 static bool operator<(const text_subtitle_t& left, 26 27 const text_subtitle_t& right) … … void TextSubtitles::Clear(void) 116 117 m_lock.unlock(); 117 118 } 118 119 119 bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target) 120 bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target, 121 PlaySettings *settings) 120 122 { 121 123 demux_sputext_t sub_data; 122 124 sub_data.rbuffer = RingBuffer::Create(fileName, 0, false); … … bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target) 134 136 target.SetFrameBasedTiming(!sub_data.uses_time); 135 137 136 138 QTextCodec *textCodec = NULL; 137 QString codec = gCoreContext->GetSetting("SubtitleCodec", "");139 QString codec = settings->GetSetting("SubtitleCodec", ""); 138 140 if (!codec.isEmpty()) 139 141 textCodec = QTextCodec::codecForName(codec.toLatin1()); 140 142 if (!textCodec) -
mythtv/libs/libmythtv/textsubtitleparser.h
diff --git a/mythtv/libs/libmythtv/textsubtitleparser.h b/mythtv/libs/libmythtv/textsubtitleparser.h index 5589984..d7e9d0d 100644
a b using namespace std; 17 17 // Qt headers 18 18 #include <QStringList> 19 19 20 class PlaySettings; 21 20 22 class text_subtitle_t 21 23 { 22 24 public: … … class TextSubtitles 79 81 class TextSubtitleParser 80 82 { 81 83 public: 82 static bool LoadSubtitles(QString fileName, TextSubtitles &target); 84 static bool LoadSubtitles(QString fileName, TextSubtitles &target, 85 PlaySettings *settings); 83 86 }; 84 87 85 88 #endif -
mythtv/libs/libmythtv/tv_play.cpp
diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp index d7a381c..d4ac611 100644
a b using namespace std; 58 58 #include "videometadatautil.h" 59 59 #include "mythdirs.h" 60 60 #include "tvbrowsehelper.h" 61 #include "playsettings.h" 61 62 62 63 #if ! HAVE_ROUND 63 64 #define round(x) ((int) ((x) + 0.5)) … … bool TV::StartTV(ProgramInfo *tvrec, uint flags) 208 209 bool startInGuide = flags & kStartTVInGuide; 209 210 bool inPlaylist = flags & kStartTVInPlayList; 210 211 bool initByNetworkCommand = flags & kStartTVByNetworkCommand; 211 TV *tv = new TV();212 212 bool quitAll = false; 213 213 bool showDialogs = true; 214 214 bool playCompleted = false; … … bool TV::StartTV(ProgramInfo *tvrec, uint flags) 222 222 curProgram->SetIgnoreBookmark(flags & kStartTVIgnoreBookmark); 223 223 } 224 224 225 PlaySettings settings(curProgram ? curProgram->GetPlaybackGroup() : "Default"); 226 TV *tv = new TV(&settings); 227 225 228 // Initialize TV 226 229 if (!tv->Init()) 227 230 { … … bool TV::StartTV(ProgramInfo *tvrec, uint flags) 252 255 if (curProgram) 253 256 { 254 257 VERBOSE(VB_PLAYBACK, LOC + "tv->Playback() -- begin"); 255 if (!tv->Playback(*curProgram ))258 if (!tv->Playback(*curProgram, &settings)) 256 259 { 257 260 quitAll = true; 258 261 } … … void TV::ResetKeys(void) 838 841 /** \fn TV::TV(void) 839 842 * \sa Init(void) 840 843 */ 841 TV::TV( void)844 TV::TV(PlaySettings *settings) 842 845 : // Configuration variables from database 843 846 baseFilters(""), 844 847 db_channel_format("<num> <sign>"), … … TV::TV(void) 936 939 playerActive = 0; 937 940 playerLock.unlock(); 938 941 939 InitFromDB( );942 InitFromDB(settings); 940 943 941 944 VERBOSE(VB_PLAYBACK, LOC + "ctor -- end"); 942 945 } 943 946 944 void TV::InitFromDB( void)947 void TV::InitFromDB(PlaySettings *settings) 945 948 { 946 949 QMap<QString,QString> kv; 947 950 kv["LiveTVIdleTimeout"] = "0"; … … void TV::InitFromDB(void) 988 991 kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]); 989 992 990 993 MythDB::getMythDB()->GetSettings(kv); 994 settings->AddToMap(kv); 991 995 992 996 QString db_time_format; 993 997 QString db_short_date_format; … … void TV::HandleOSDAskAllow(PlayerContext *ctx, QString action) 1742 1746 askAllowLock.unlock(); 1743 1747 } 1744 1748 1745 int TV::Playback(const ProgramInfo &rcinfo )1749 int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings) 1746 1750 { 1747 1751 wantsToQuit = false; 1748 1752 jumpToProgram = false; … … int TV::Playback(const ProgramInfo &rcinfo) 1756 1760 return 0; 1757 1761 } 1758 1762 1759 mctx->SetPlayingInfo(&rcinfo );1763 mctx->SetPlayingInfo(&rcinfo, settings); 1760 1764 mctx->SetInitialTVState(false); 1761 1765 ScheduleStateChange(mctx); 1762 1766 … … int TV::PlayFromRecorder(int recordernum) 1839 1843 1840 1844 if (fileexists) 1841 1845 { 1842 Playback(pginfo); 1846 PlaySettings settings("Default"); 1847 Playback(pginfo, &settings); 1843 1848 retval = 1; 1844 1849 } 1845 1850 … … void TV::HandleStateChange(PlayerContext *mctx, PlayerContext *ctx) 2224 2229 QString msg = tr("%1 Settings") 2225 2230 .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup())); 2226 2231 ctx->UnlockPlayingInfo(__FILE__, __LINE__); 2227 if (count > 0) 2232 if (count > 0 && 2233 ctx->playingInfo->GetPlaybackGroup() != "Default" && 2234 ctx->playingInfo->GetPlaybackGroup() != "Videos") 2228 2235 SetOSDMessage(ctx, msg); 2229 2236 ITVRestart(ctx, false); 2230 2237 } -
mythtv/libs/libmythtv/tv_play.h
diff --git a/mythtv/libs/libmythtv/tv_play.h b/mythtv/libs/libmythtv/tv_play.h index 9207280..a2b2ad7 100644
a b class OSDListTreeItemEnteredEvent; 60 60 class OSDListTreeItemSelectedEvent; 61 61 class TVBrowseHelper; 62 62 struct osdInfo; 63 class PlaySettings; 63 64 64 65 typedef QMap<QString,InfoMap> DDValueMap; 65 66 typedef QMap<QString,DDValueMap> DDKeyMap; … … class MPUBLIC TV : public QObject 182 183 unsigned long seconds; 183 184 }; 184 185 185 TV( void);186 TV(PlaySettings *settings); 186 187 ~TV(); 187 188 188 void InitFromDB( void);189 void InitFromDB(PlaySettings *settings); 189 190 bool Init(bool createWindow = true); 190 191 191 192 // User input processing commands … … class MPUBLIC TV : public QObject 209 210 210 211 // Recording commands 211 212 int PlayFromRecorder(int recordernum); 212 int Playback(const ProgramInfo &rcinfo );213 int Playback(const ProgramInfo &rcinfo, PlaySettings *settings); 213 214 214 215 // Commands used by frontend playback box 215 216 QString GetRecordingGroup(int player_idx) const; -
mythtv/libs/libmythtv/videodisplayprofile.cpp
diff --git a/mythtv/libs/libmythtv/videodisplayprofile.cpp b/mythtv/libs/libmythtv/videodisplayprofile.cpp index 8999558..6f3c707 100644
a b using namespace std; 8 8 #include "mythverbose.h" 9 9 #include "videooutbase.h" 10 10 #include "avformatdecoder.h" 11 #include "playsettings.h" 11 12 12 13 bool ProfileItem::IsMatch(const QSize &size, float rate) const 13 14 { … … priority_map_t VideoDisplayProfile::safe_renderer_priority; 212 213 pref_map_t VideoDisplayProfile::dec_name; 213 214 safe_list_t VideoDisplayProfile::safe_decoders; 214 215 215 VideoDisplayProfile::VideoDisplayProfile( )216 VideoDisplayProfile::VideoDisplayProfile(PlaySettings *settings) 216 217 : lock(QMutex::Recursive), last_size(0,0), last_rate(0.0f), 217 218 last_video_renderer(QString::null) 218 219 { … … VideoDisplayProfile::VideoDisplayProfile() 220 221 init_statics(); 221 222 222 223 QString hostname = gCoreContext->GetHostName(); 223 QString cur_profile = GetDefaultProfileName(hostname );224 QString cur_profile = GetDefaultProfileName(hostname, settings); 224 225 uint groupid = GetProfileGroupID(cur_profile, hostname); 225 226 226 227 item_list_t items = LoadDB(groupid); … … QStringList VideoDisplayProfile::GetProfiles(const QString &hostname) 754 755 return list; 755 756 } 756 757 757 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname) 758 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname, 759 PlaySettings *settings) 758 760 { 759 761 QString tmp = 762 settings ? settings->GetSetting("DefaultVideoPlaybackProfile", "") : 760 763 gCoreContext->GetSettingOnHost("DefaultVideoPlaybackProfile", hostname); 761 764 762 765 QStringList profiles = GetProfiles(hostname); -
mythtv/libs/libmythtv/videodisplayprofile.h
diff --git a/mythtv/libs/libmythtv/videodisplayprofile.h b/mythtv/libs/libmythtv/videodisplayprofile.h index a3b4ced..66ce548 100644
a b using namespace std; 13 13 14 14 #include "mythcontext.h" 15 15 16 class PlaySettings; 17 16 18 typedef QMap<QString,QString> pref_map_t; 17 19 typedef QMap<QString,QStringList> safe_map_t; 18 20 typedef QStringList safe_list_t; … … typedef vector<ProfileItem> item_list_t; 80 82 class MPUBLIC VideoDisplayProfile 81 83 { 82 84 public: 83 VideoDisplayProfile( );85 VideoDisplayProfile(PlaySettings *settings); 84 86 ~VideoDisplayProfile(); 85 87 86 88 void SetInput(const QSize &size); … … class MPUBLIC VideoDisplayProfile 124 126 static QString GetDecoderName(const QString &decoder); 125 127 static QString GetDecoderHelp(QString decoder = QString::null); 126 128 127 static QString GetDefaultProfileName(const QString &hostname); 129 static QString GetDefaultProfileName(const QString &hostname, 130 PlaySettings *settings); 128 131 static void SetDefaultProfileName(const QString &profilename, 129 132 const QString &hostname); 130 133 static uint GetProfileGroupID(const QString &profilename, -
mythtv/libs/libmythtv/videoout_d3d.cpp
diff --git a/mythtv/libs/libmythtv/videoout_d3d.cpp b/mythtv/libs/libmythtv/videoout_d3d.cpp index badf6af..0cbadb4 100644
a b void VideoOutputD3D::GetRenderOptions(render_opts &opts, 50 50 opts.priorities->insert("direct3d", 55); 51 51 } 52 52 53 VideoOutputD3D::VideoOutputD3D( void)54 : VideoOutput( ),m_lock(QMutex::Recursive),53 VideoOutputD3D::VideoOutputD3D(PlaySettigns *settings) 54 : VideoOutput(settings), m_lock(QMutex::Recursive), 55 55 m_hWnd(NULL), m_render(NULL), 56 56 m_video(NULL), 57 57 m_render_valid(false), m_render_reset(false), m_pip_active(NULL), -
mythtv/libs/libmythtv/videoout_d3d.h
diff --git a/mythtv/libs/libmythtv/videoout_d3d.h b/mythtv/libs/libmythtv/videoout_d3d.h index 7731c3b..1fa7641 100644
a b class VideoOutputD3D : public VideoOutput 12 12 { 13 13 public: 14 14 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 15 VideoOutputD3D( );15 VideoOutputD3D(PlaySettings *settings); 16 16 ~VideoOutputD3D(); 17 17 18 18 bool Init(int width, int height, float aspect, WId winid, -
mythtv/libs/libmythtv/videoout_directfb.cpp
diff --git a/mythtv/libs/libmythtv/videoout_directfb.cpp b/mythtv/libs/libmythtv/videoout_directfb.cpp index 417b1c8..a3bdd6b 100644
a b void VideoOutputDirectfb::GetRenderOptions(render_opts &opts, 275 275 opts.priorities->insert("directfb", 60); 276 276 } 277 277 278 VideoOutputDirectfb::VideoOutputDirectfb( )279 : VideoOutput( ), XJ_started(false), widget(NULL),278 VideoOutputDirectfb::VideoOutputDirectfb(PlaySettings *settings) 279 : VideoOutput(settings), XJ_started(false), widget(NULL), 280 280 data(new DirectfbData()) 281 281 { 282 282 init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0); -
mythtv/libs/libmythtv/videoout_directfb.h
diff --git a/mythtv/libs/libmythtv/videoout_directfb.h b/mythtv/libs/libmythtv/videoout_directfb.h index 20d42d8..9d2439e 100644
a b class VideoOutputDirectfb: public VideoOutput 12 12 { 13 13 public: 14 14 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 15 VideoOutputDirectfb( );15 VideoOutputDirectfb(PlaySettings *settings); 16 16 ~VideoOutputDirectfb(); 17 17 18 18 bool Init(int width, int height, float aspect, WId winid, -
mythtv/libs/libmythtv/videoout_null.cpp
diff --git a/mythtv/libs/libmythtv/videoout_null.cpp b/mythtv/libs/libmythtv/videoout_null.cpp index cd2b170..c927c2a 100644
a b void VideoOutputNull::GetRenderOptions(render_opts &opts, 28 28 opts.priorities->insert("null", 10); 29 29 } 30 30 31 VideoOutputNull::VideoOutputNull( ) :32 VideoOutput( ), global_lock(QMutex::Recursive)31 VideoOutputNull::VideoOutputNull(PlaySettings *settings) : 32 VideoOutput(settings), global_lock(QMutex::Recursive) 33 33 { 34 34 VERBOSE(VB_PLAYBACK, "VideoOutputNull()"); 35 35 memset(&av_pause_frame, 0, sizeof(av_pause_frame)); -
mythtv/libs/libmythtv/videoout_null.h
diff --git a/mythtv/libs/libmythtv/videoout_null.h b/mythtv/libs/libmythtv/videoout_null.h index 8fff602..30c2ea6 100644
a b class VideoOutputNull : public VideoOutput 9 9 { 10 10 public: 11 11 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 12 VideoOutputNull( );12 VideoOutputNull(PlaySettings *settings); 13 13 ~VideoOutputNull(); 14 14 15 15 bool Init(int width, int height, float aspect, WId winid, -
mythtv/libs/libmythtv/videoout_opengl.cpp
diff --git a/mythtv/libs/libmythtv/videoout_opengl.cpp b/mythtv/libs/libmythtv/videoout_opengl.cpp index 208137e..8aaa4d9 100644
a b void VideoOutputOpenGL::GetRenderOptions(render_opts &opts, 37 37 opts.priorities->insert("opengl", 65); 38 38 } 39 39 40 VideoOutputOpenGL::VideoOutputOpenGL( )41 : VideoOutput( ),40 VideoOutputOpenGL::VideoOutputOpenGL(PlaySettings *settings) 41 : VideoOutput(settings), 42 42 gl_context_lock(QMutex::Recursive), 43 43 gl_context(NULL), gl_videochain(NULL), gl_pipchain_active(NULL), 44 44 gl_parent_win(0), gl_embed_win(0), gl_painter(NULL) -
mythtv/libs/libmythtv/videoout_opengl.h
diff --git a/mythtv/libs/libmythtv/videoout_opengl.h b/mythtv/libs/libmythtv/videoout_opengl.h index e728da7..a9ef03c 100644
a b class VideoOutputOpenGL : public VideoOutput 10 10 { 11 11 public: 12 12 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 13 VideoOutputOpenGL( );13 VideoOutputOpenGL(PlaySettings *settings); 14 14 virtual ~VideoOutputOpenGL(); 15 15 16 16 virtual bool Init(int width, int height, float aspect, WId winid, -
mythtv/libs/libmythtv/videoout_quartz.cpp
diff --git a/mythtv/libs/libmythtv/videoout_quartz.cpp b/mythtv/libs/libmythtv/videoout_quartz.cpp index f380da0..8be3831 100644
a b using namespace std; 62 62 #include "mythverbose.h" 63 63 #include "videodisplayprofile.h" 64 64 65 class PlaySettings; 66 65 67 #define LOC QString("VideoOutputQuartz::") 66 68 #define LOC_ERR QString("VideoOutputQuartz Error: ") 67 69 … … void VideoOutputQuartz::GetRenderOptions(render_opts &opts, 1103 1105 /** \class VideoOutputQuartz 1104 1106 * \brief Implementation of Quartz (Mac OS X windowing system) video output 1105 1107 */ 1106 VideoOutputQuartz::VideoOutputQuartz( ) :1107 VideoOutput( ), Started(false), data(new QuartzData())1108 VideoOutputQuartz::VideoOutputQuartz(PlaySettings *settings) : 1109 VideoOutput(settings), Started(false), data(new QuartzData()) 1108 1110 { 1109 1111 init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0); 1110 1112 } … … QStringList VideoOutputQuartz::GetAllowedRenderers( 1754 1756 MythCodecID VideoOutputQuartz::GetBestSupportedCodec( 1755 1757 uint width, uint height, 1756 1758 uint osd_width, uint osd_height, 1757 uint stream_type, uint fourcc )1759 uint stream_type, uint fourcc, PlaySettings *settings) 1758 1760 { 1759 1761 (void) osd_width; 1760 1762 (void) osd_height; 1761 1763 1762 VideoDisplayProfile vdp ;1764 VideoDisplayProfile vdp(settings); 1763 1765 vdp.SetInput(QSize(width, height)); 1764 1766 QString dec = vdp.GetDecoder(); 1765 1767 if (dec == "ffmpeg") -
mythtv/libs/libmythtv/videoout_quartz.h
diff --git a/mythtv/libs/libmythtv/videoout_quartz.h b/mythtv/libs/libmythtv/videoout_quartz.h index a5a3bf2..da66ac8 100644
a b 2 2 #define VIDEOOUT_QUARTZ_H_ 3 3 4 4 struct QuartzData; 5 class PlaySettings; 5 6 6 7 #include "videooutbase.h" 7 8 … … class VideoOutputQuartz : public VideoOutput 9 10 { 10 11 public: 11 12 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 12 VideoOutputQuartz( );13 VideoOutputQuartz(PlaySettings *settings); 13 14 ~VideoOutputQuartz(); 14 15 15 16 bool Init(int width, int height, float aspect, WId winid, … … class VideoOutputQuartz : public VideoOutput 52 53 static MythCodecID GetBestSupportedCodec( 53 54 uint width, uint height, 54 55 uint osd_width, uint osd_height, 55 uint stream_type, uint fourcc );56 uint stream_type, uint fourcc, PlaySettings *settings); 56 57 virtual bool NeedExtraAudioDecode(void) const 57 58 { return !codec_is_std(video_codec_id); } 58 59 -
mythtv/libs/libmythtv/videoout_vdpau.cpp
diff --git a/mythtv/libs/libmythtv/videoout_vdpau.cpp b/mythtv/libs/libmythtv/videoout_vdpau.cpp index 0317b38..dbdd2be 100644
a b void VideoOutputVDPAU::GetRenderOptions(render_opts &opts) 47 47 opts.deints->insert("vdpau", deints); 48 48 } 49 49 50 VideoOutputVDPAU::VideoOutputVDPAU( )51 : m_win(0),m_render(NULL),50 VideoOutputVDPAU::VideoOutputVDPAU(PlaySettings *settings) 51 : VideoOutput(settings), m_win(0), m_render(NULL), 52 52 m_buffer_size(NUM_VDPAU_BUFFERS), m_pause_surface(0), 53 53 m_need_deintrefs(false), m_video_mixer(0), m_mixer_features(kVDPFeatNone), 54 54 m_checked_surface_ownership(false), … … QStringList VideoOutputVDPAU::GetAllowedRenderers( 848 848 849 849 MythCodecID VideoOutputVDPAU::GetBestSupportedCodec( 850 850 uint width, uint height, 851 uint stream_type, bool no_acceleration )851 uint stream_type, bool no_acceleration, PlaySettings *settings) 852 852 { 853 853 bool use_cpu = no_acceleration; 854 VideoDisplayProfile vdp ;854 VideoDisplayProfile vdp(settings); 855 855 vdp.SetInput(QSize(width, height)); 856 856 QString dec = vdp.GetDecoder(); 857 857 -
mythtv/libs/libmythtv/videoout_vdpau.h
diff --git a/mythtv/libs/libmythtv/videoout_vdpau.h b/mythtv/libs/libmythtv/videoout_vdpau.h index 7107745..b5f9aa9 100644
a b class VideoOutputVDPAU : public VideoOutput 20 20 { 21 21 public: 22 22 static void GetRenderOptions(render_opts &opts); 23 VideoOutputVDPAU( );23 VideoOutputVDPAU(PlaySettings *settings); 24 24 ~VideoOutputVDPAU(); 25 25 bool Init(int width, int height, float aspect, WId winid, 26 26 int winx, int winy, int winw, int winh, … … class VideoOutputVDPAU : public VideoOutput 54 54 const QSize &video_dim); 55 55 static MythCodecID GetBestSupportedCodec(uint width, uint height, 56 56 uint stream_type, 57 bool no_acceleration); 57 bool no_acceleration, 58 PlaySettings *settings); 58 59 virtual bool IsPIPSupported(void) const { return true; } 59 60 virtual bool IsPBPSupported(void) const { return false; } 60 61 virtual bool NeedExtraAudioDecode(void) const -
mythtv/libs/libmythtv/videoout_xv.cpp
diff --git a/mythtv/libs/libmythtv/videoout_xv.cpp b/mythtv/libs/libmythtv/videoout_xv.cpp index ec9c215..e44aabd 100644
a b void VideoOutputXv::GetRenderOptions(render_opts &opts, 136 136 * \see VideoOutput, VideoBuffers 137 137 * 138 138 */ 139 VideoOutputXv::VideoOutputXv( )140 : VideoOutput( ),139 VideoOutputXv::VideoOutputXv(PlaySettings *settings) 140 : VideoOutput(settings), 141 141 video_output_subtype(XVUnknown), 142 142 global_lock(QMutex::Recursive), 143 143 … … void VideoOutputXv::UngrabXvPort(MythXDisplay *disp, int port) 357 357 * \return port number if it succeeds, else -1. 358 358 */ 359 359 int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root, 360 PlaySettings *settings, 360 361 MythCodecID mcodecid, 361 362 uint width, uint height, 362 363 bool &xvsetdefaults, … … int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root, 381 382 } 382 383 383 384 // figure out if we want chromakeying.. 384 VideoDisplayProfile vdp ;385 VideoDisplayProfile vdp(settings); 385 386 vdp.SetInput(QSize(width, height)); 386 387 if (vdp.GetOSDRenderer() == "chromakey") 387 388 { … … bool VideoOutputXv::InitXVideo() 600 601 disp->StartLog(); 601 602 QString adaptor_name = QString::null; 602 603 const QSize video_dim = window.GetVideoDim(); 603 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), kCodec_MPEG2,604 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, kCodec_MPEG2, 604 605 video_dim.width(), video_dim.height(), 605 606 xv_set_defaults, &adaptor_name); 606 607 if (xv_port == -1) -
mythtv/libs/libmythtv/videoout_xv.h
diff --git a/mythtv/libs/libmythtv/videoout_xv.h b/mythtv/libs/libmythtv/videoout_xv.h index c42665b..78e5f66 100644
a b class VideoOutputXv : public VideoOutput 30 30 friend class ChromaKeyOSD; 31 31 public: 32 32 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 33 VideoOutputXv( );33 VideoOutputXv(PlaySettings *settings); 34 34 ~VideoOutputXv(); 35 35 36 36 bool Init(int width, int height, float aspect, WId winid, … … class VideoOutputXv : public VideoOutput 83 83 static MythCodecID GetBestSupportedCodec(uint stream_type); 84 84 85 85 static int GrabSuitableXvPort(MythXDisplay* disp, Window root, 86 PlaySettings *settings, 86 87 MythCodecID type, 87 88 uint width, uint height, 88 89 bool &xvsetdefaults, -
mythtv/libs/libmythtv/videooutbase.cpp
diff --git a/mythtv/libs/libmythtv/videooutbase.cpp b/mythtv/libs/libmythtv/videooutbase.cpp index 4119fb5..507999e 100644
a b 7 7 #include "mythplayer.h" 8 8 #include "videodisplayprofile.h" 9 9 #include "decoderbase.h" 10 #include "playsettings.h" 10 11 11 12 #include "mythcorecontext.h" 12 13 #include "mythverbose.h" … … VideoOutput *VideoOutput::Create( 109 110 PIPState pipState, 110 111 const QSize &video_dim, float video_aspect, 111 112 WId win_id, const QRect &display_rect, 112 float video_prate, WId embed_id) 113 float video_prate, WId embed_id, 114 PlaySettings *settings) 113 115 { 114 116 (void) codec_priv; 115 117 … … VideoOutput *VideoOutput::Create( 154 156 QString renderer = QString::null; 155 157 if (renderers.size() > 0) 156 158 { 157 VideoDisplayProfile vprof ;159 VideoDisplayProfile vprof(settings); 158 160 vprof.SetInput(video_dim); 159 161 160 162 QString tmp = vprof.GetVideoRenderer(); … … VideoOutput *VideoOutput::Create( 182 184 183 185 #ifdef USING_DIRECTFB 184 186 if (renderer == "directfb") 185 vo = new VideoOutputDirectfb( );187 vo = new VideoOutputDirectfb(settings); 186 188 #endif // USING_DIRECTFB 187 189 188 190 #ifdef USING_MINGW 189 191 if (renderer == "direct3d") 190 vo = new VideoOutputD3D( );192 vo = new VideoOutputD3D(settings); 191 193 #endif // USING_MINGW 192 194 193 195 #ifdef USING_QUARTZ_VIDEO 194 196 if (osxlist.contains(renderer)) 195 vo = new VideoOutputQuartz( );197 vo = new VideoOutputQuartz(settings); 196 198 #endif // Q_OS_MACX 197 199 198 200 #ifdef USING_OPENGL_VIDEO 199 201 if (renderer == "opengl") 200 vo = new VideoOutputOpenGL( );202 vo = new VideoOutputOpenGL(settings); 201 203 #endif // USING_OPENGL_VIDEO 202 204 203 205 #ifdef USING_VDPAU 204 206 if (renderer == "vdpau") 205 vo = new VideoOutputVDPAU( );207 vo = new VideoOutputVDPAU(settings); 206 208 #endif // USING_VDPAU 207 209 208 210 #ifdef USING_XV 209 211 if (xvlist.contains(renderer)) 210 vo = new VideoOutputXv( );212 vo = new VideoOutputXv(settings); 211 213 #endif // USING_XV 212 214 213 215 if (vo) … … VideoOutput *VideoOutput::Create( 305 307 * \brief This constructor for VideoOutput must be followed by an 306 308 * Init(int,int,float,WId,int,int,int,int,WId) call. 307 309 */ 308 VideoOutput::VideoOutput( ) :310 VideoOutput::VideoOutput(PlaySettings *_settings) : 309 311 // DB Settings 312 window(_settings), 310 313 db_display_dim(0,0), 311 314 db_aspectoverride(kAspect_Off), db_adjustfill(kAdjustFill_Off), 312 315 db_letterbox_colour(kLetterBoxColour_Black), … … VideoOutput::VideoOutput() : 343 346 monitor_sz(640,480), monitor_dim(400,300), 344 347 345 348 // OSD 346 osd_painter(NULL), osd_image(NULL) 349 osd_painter(NULL), osd_image(NULL), 350 settings(_settings) 347 351 348 352 { 349 353 bzero(&pip_tmp_image, sizeof(pip_tmp_image)); 350 db_display_dim = QSize( gCoreContext->GetNumSetting("DisplaySizeWidth", 0),351 gCoreContext->GetNumSetting("DisplaySizeHeight", 0));354 db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth", 0), 355 settings->GetNumSetting("DisplaySizeHeight", 0)); 352 356 353 357 db_aspectoverride = (AspectOverrideMode) 354 gCoreContext->GetNumSetting("AspectOverride", 0);358 settings->GetNumSetting("AspectOverride", 0); 355 359 db_adjustfill = (AdjustFillMode) 356 gCoreContext->GetNumSetting("AdjustFill", 0);360 settings->GetNumSetting("AdjustFill", 0); 357 361 db_letterbox_colour = (LetterBoxColour) 358 gCoreContext->GetNumSetting("LetterboxColour", 0);362 settings->GetNumSetting("LetterboxColour", 0); 359 363 360 364 if (!gCoreContext->IsDatabaseIgnored()) 361 db_vdisp_profile = new VideoDisplayProfile( );365 db_vdisp_profile = new VideoDisplayProfile(settings); 362 366 } 363 367 364 368 /** … … QString VideoOutput::GetFilters(void) const 434 438 return QString::null; 435 439 } 436 440 437 bool VideoOutput::IsPreferredRenderer(QSize video_size )441 bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings) 438 442 { 439 443 if (!db_vdisp_profile || (video_size == window.GetVideoDispDim())) 440 444 return true; 441 445 442 VideoDisplayProfile vdisp ;446 VideoDisplayProfile vdisp(settings); 443 447 vdisp.SetInput(video_size); 444 448 QString new_rend = vdisp.GetVideoRenderer(); 445 449 if (new_rend.isEmpty()) -
mythtv/libs/libmythtv/videooutbase.h
diff --git a/mythtv/libs/libmythtv/videooutbase.h b/mythtv/libs/libmythtv/videooutbase.h index 91de709..659b528 100644
a b class OSD; 34 34 class FilterChain; 35 35 class FilterManager; 36 36 class OpenGLContextGLX; 37 class PlaySettings; 37 38 38 39 typedef QMap<MythPlayer*,PIPLocation> PIPMap; 39 40 … … class VideoOutput 54 55 PIPState pipState, 55 56 const QSize &video_dim, float video_aspect, 56 57 WId win_id, const QRect &display_rect, 57 float video_prate, WId embed_id); 58 float video_prate, WId embed_id, 59 PlaySettings *settings); 58 60 59 VideoOutput( );61 VideoOutput(PlaySettings *settings); 60 62 virtual ~VideoOutput(); 61 63 62 64 virtual bool Init(int width, int height, float aspect, … … class VideoOutput 64 66 int winh, MythCodecID codec_id, WId embedid = 0); 65 67 virtual void InitOSD(OSD *osd); 66 68 virtual void SetVideoFrameRate(float); 67 virtual bool IsPreferredRenderer(QSize video_size );69 virtual bool IsPreferredRenderer(QSize video_size, PlaySettings *settings); 68 70 virtual bool SetDeinterlacingEnabled(bool); 69 71 virtual bool SetupDeinterlace(bool i, const QString& ovrf=""); 70 72 virtual void FallbackDeint(void); … … class VideoOutput 331 333 // OSD painter and surface 332 334 MythYUVAPainter *osd_painter; 333 335 MythImage *osd_image; 336 337 PlaySettings *settings; 334 338 }; 335 339 336 340 #endif -
mythtv/libs/libmythtv/videooutwindow.cpp
diff --git a/mythtv/libs/libmythtv/videooutwindow.cpp b/mythtv/libs/libmythtv/videooutwindow.cpp index d103cac..a27d59f 100644
a b 29 29 30 30 #include "videooutwindow.h" 31 31 #include "osd.h" 32 #include "playsettings.h" 32 33 #include "mythplayer.h" 33 34 #include "videodisplayprofile.h" 34 35 #include "decoderbase.h" … … const float VideoOutWindow::kManualZoomMinHorizontalZoom = 0.5f; 53 54 const float VideoOutWindow::kManualZoomMinVerticalZoom = 0.5f; 54 55 const int VideoOutWindow::kManualZoomMaxMove = 50; 55 56 56 VideoOutWindow::VideoOutWindow( ) :57 VideoOutWindow::VideoOutWindow(PlaySettings *_settings) : 57 58 // DB settings 58 59 db_move(0, 0), db_scale_horiz(0.0f), db_scale_vert(0.0f), 59 60 db_pip_size(26), … … VideoOutWindow::VideoOutWindow() : 85 86 86 87 // Various state variables 87 88 embedding(false), needrepaint(false), 88 allowpreviewepg(true), pip_state(kPIPOff) 89 allowpreviewepg(true), pip_state(kPIPOff), 90 91 settings(_settings) 89 92 { 90 93 db_pip_size = gCoreContext->GetNumSetting("PIPSize", 26); 91 94 92 db_move = QPoint( gCoreContext->GetNumSetting("xScanDisplacement", 0),93 gCoreContext->GetNumSetting("yScanDisplacement", 0));95 db_move = QPoint(settings->GetNumSetting("xScanDisplacement", 0), 96 settings->GetNumSetting("yScanDisplacement", 0)); 94 97 db_use_gui_size = gCoreContext->GetNumSetting("GuiSizeForTV", 0); 95 98 96 99 QDesktopWidget *desktop = NULL; … … void VideoOutWindow::SetVideoScalingAllowed(bool change) 615 618 if (change) 616 619 { 617 620 db_scale_vert = 618 gCoreContext->GetNumSetting("VertScanPercentage", 0) * 0.01f;621 settings->GetNumSetting("VertScanPercentage", 0) * 0.01f; 619 622 db_scale_horiz = 620 gCoreContext->GetNumSetting("HorizScanPercentage", 0) * 0.01f;623 settings->GetNumSetting("HorizScanPercentage", 0) * 0.01f; 621 624 db_scaling_allowed = true; 622 625 } 623 626 else -
mythtv/libs/libmythtv/videooutwindow.h
diff --git a/mythtv/libs/libmythtv/videooutwindow.h b/mythtv/libs/libmythtv/videooutwindow.h index 37f4502..c381b8e 100644
a b 16 16 #include "videoouttypes.h" 17 17 18 18 class MythPlayer; 19 class PlaySettings; 19 20 20 21 class VideoOutWindow 21 22 { 22 23 public: 23 VideoOutWindow( );24 VideoOutWindow(PlaySettings *settings); 24 25 25 26 bool Init(const QSize &new_video_dim, float aspect, 26 27 const QRect &new_display_visible_rect, … … class VideoOutWindow 164 165 bool allowpreviewepg; 165 166 PIPState pip_state; 166 167 168 PlaySettings *settings; 169 167 170 // Constants 168 171 static const float kManualZoomMaxHorizontalZoom; 169 172 static const float kManualZoomMaxVerticalZoom; -
mythtv/libs/libmythtv/vsync.cpp
diff --git a/mythtv/libs/libmythtv/vsync.cpp b/mythtv/libs/libmythtv/vsync.cpp index 1f08fc5..8257809 100644
a b 34 34 35 35 #include "mythcontext.h" 36 36 #include "mythmainwindow.h" 37 #include "playsettings.h" 37 38 38 39 #ifdef USING_XV 39 40 #include "videoout_xv.h" … … int VideoSync::m_forceskip = 0; 78 79 * \brief Returns the most sophisticated video sync method available. 79 80 */ 80 81 VideoSync *VideoSync::BestMethod(VideoOutput *video_output, 82 PlaySettings *settings, 81 83 uint frame_interval, uint refresh_interval, 82 84 bool halve_frame_interval) 83 85 { … … VideoSync *VideoSync::BestMethod(VideoOutput *video_output, 103 105 TESTVIDEOSYNC(DRMVideoSync); 104 106 #ifdef USING_OPENGL_VSYNC 105 107 /* 106 if ( gCoreContext->GetNumSetting("UseOpenGLVSync", 1) &&108 if (settings->GetNumSetting("UseOpenGLVSync", 1) && 107 109 (getenv("NO_OPENGL_VSYNC") == NULL)) 108 110 { 109 111 TESTVIDEOSYNC(OpenGLVideoSync); -
mythtv/libs/libmythtv/vsync.h
diff --git a/mythtv/libs/libmythtv/vsync.h b/mythtv/libs/libmythtv/vsync.h index 156cdad..d1867c7 100644
a b class VideoSync 89 89 90 90 // documented in vsync.cpp 91 91 static VideoSync *BestMethod(VideoOutput*, 92 PlaySettings *settings, 92 93 uint frame_interval, uint refresh_interval, 93 94 bool interlaced); 94 95 protected: -
mythtv/programs/mythavtest/main.cpp
diff --git a/mythtv/programs/mythavtest/main.cpp b/mythtv/programs/mythavtest/main.cpp index efa01df..e0c47ec 100644
a b using namespace std; 18 18 #include "mythdbcon.h" 19 19 #include "compat.h" 20 20 #include "dbcheck.h" 21 #include "playsettings.h" 21 22 22 23 // libmythui 23 24 #include "mythuihelper.h" … … int main(int argc, char *argv[]) 188 189 189 190 GetMythUI()->LoadQtConfig(); 190 191 191 #if defined(Q_OS_MACX)192 // Mac OS X doesn't define the AudioOutputDevice setting193 #else194 QString auddevice = gCoreContext->GetSetting("AudioOutputDevice");195 if (auddevice.isEmpty())196 {197 VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "198 "to run 'mythfrontend', not 'mythtv'.");199 return TV_EXIT_NO_AUDIO;200 }201 #endif202 203 192 MythMainWindow *mainWindow = GetMythMainWindow(); 204 193 mainWindow->Init(); 205 194 … … int main(int argc, char *argv[]) 212 201 return GENERIC_EXIT_DB_OUTOFDATE; 213 202 } 214 203 215 TV *tv = new TV(); 204 QString playgroup(""); 205 if (!filename.isEmpty()) 206 { 207 ProgramInfo pg(filename); 208 playgroup = pg.GetPlaybackGroup(); 209 } 210 PlaySettings settings(playgroup); 211 212 #if defined(Q_OS_MACX) 213 // Mac OS X doesn't define the AudioOutputDevice setting 214 #else 215 QString auddevice = settings.GetSetting("AudioOutputDevice", ""); 216 if (auddevice.isEmpty()) 217 { 218 VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need " 219 "to run 'mythfrontend', not 'mythtv'."); 220 return TV_EXIT_NO_AUDIO; 221 } 222 #endif 223 224 TV *tv = new TV(&settings); 216 225 if (!tv->Init()) 217 226 { 218 227 VERBOSE(VB_IMPORTANT, "Fatal Error: Could not initialize TV class."); -
mythtv/programs/mythfrontend/globalsettings.cpp
diff --git a/mythtv/programs/mythfrontend/globalsettings.cpp b/mythtv/programs/mythfrontend/globalsettings.cpp index 47f96af..a3c30eb 100644
a b 38 38 #include "mythconfig.h" 39 39 #include "mythdirs.h" 40 40 #include "mythuihelper.h" 41 #include "playsettings.h" 42 43 #define CREATE_CHECKBOX_SETTING(var, name, settings) \ 44 BooleanSetting *var; \ 45 if ((settings)) \ 46 var = new PlaySettingsCheckBox((name), (settings)); \ 47 else \ 48 var = new HostCheckBox((name)) 49 50 #define CREATE_COMBOBOX_SETTING(var, name, settings) \ 51 ComboBoxSetting *var; \ 52 if ((settings)) \ 53 var = new PlaySettingsComboBox((name), (settings)); \ 54 else \ 55 var = new HostComboBox((name)) 56 57 #define CREATE_COMBOBOX1_SETTING(var, name, settings, arg1) \ 58 ComboBoxSetting *var; \ 59 if ((settings)) \ 60 var = new PlaySettingsComboBox((name), (settings), (arg1)); \ 61 else \ 62 var = new HostComboBox((name), (arg1)) 63 64 #define CREATE_SPINBOX_SETTING(var, name, settings, arg1, arg2, arg3, arg4) \ 65 SpinBoxSetting *var; \ 66 if ((settings)) \ 67 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3), (arg4)); \ 68 else \ 69 var = new HostSpinBox((name), (arg1), (arg2), (arg3), (arg4)) 70 71 #define CREATE_LINEEDIT_SETTING(var, name, settings) \ 72 LineEditSetting *var; \ 73 if ((settings)) \ 74 var = new PlaySettingsLineEdit((name), (settings), ""); \ 75 else \ 76 var = new HostLineEdit((name)) 77 78 // For PlaySettings, use a SpinBox instead of a Slider so that a 79 // default value can be easily used. 80 #define CREATE_SLIDER_SETTING(var, name, settings, arg1, arg2, arg3) \ 81 BoundedIntegerSetting *var; \ 82 if ((settings)) \ 83 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3)); \ 84 else \ 85 var = new HostSlider((name), (arg1), (arg2), (arg3)) 86 87 #define CREATE_IMAGESELECT_SETTING(var, name, settings) \ 88 ImageSelectSetting *var; \ 89 if ((settings)) \ 90 var = new PlaySettingsImageSelect((name), (settings)); \ 91 else \ 92 var = new HostImageSelect((name)) 93 94 static Setting *wrap(Setting *obj, PlaySettings *settings, 95 bool twoLineLabel=false) 96 { 97 if (!settings) 98 return obj; 99 100 // Get the setting name 101 PlaySettingsCombinedStorage *storage = 102 dynamic_cast<PlaySettingsCombinedStorage *>(obj); 103 const QString &name = storage->getName(); 104 105 // Get the default value and label. The label is different 106 // from the value for most object types. 107 QString defaultValue = settings->GetSetting(name, "", true); 108 QString defaultLabel(defaultValue); 109 if (dynamic_cast<BooleanSetting *>(obj)) 110 defaultLabel = (defaultValue == "0" || defaultValue.isEmpty() ? 111 QObject::tr("disabled") : QObject::tr("enabled")); 112 if (dynamic_cast<SpinBoxSetting *>(obj) && defaultValue.isEmpty()) 113 defaultLabel = "0"; 114 ComboBoxSetting *cb = dynamic_cast<ComboBoxSetting *>(obj); 115 if (cb) 116 { 117 defaultLabel = cb->GetValueLabel(defaultValue); 118 // Add the default selection to a ComboBox 119 cb->addSelection(QString("(") + QObject::tr("default") + ")", 120 storage->getDefault(), 121 !settings->IsOverridden(name), 122 true); 123 } 124 ImageSelectSetting *is = dynamic_cast<ImageSelectSetting *>(obj); 125 if (is) 126 { 127 defaultLabel = is->GetValueLabel(defaultValue); 128 // Add the default selection to a ImageSelect 129 is->addDefaultSelection(QString("(") + QObject::tr("default") + ")", 130 storage->getDefault(), 131 defaultValue, 132 !settings->IsOverridden(name)); 133 } 134 135 // Change the help text to include the default and its source. 136 QString helpPrefix; 137 if (dynamic_cast<LineEditSetting *>(obj)) 138 helpPrefix = QObject::tr("Leave blank to keep default value"); 139 else 140 helpPrefix = QObject::tr("Override default value"); 141 helpPrefix += " (" + defaultLabel + ") "; 142 QString inheritsFrom = settings->InheritsFrom(name); 143 if (inheritsFrom.isNull()) 144 helpPrefix += QObject::tr("from global settings"); 145 else 146 helpPrefix += QObject::tr("from group") + " " + inheritsFrom; 147 helpPrefix += ". " + obj->getHelpText(); 148 obj->setHelpText(helpPrefix); 149 150 // Change the label to include the default. 151 obj->setLabel(obj->getLabel() + (twoLineLabel ? "\n" : "") + 152 " (" + defaultLabel + ")"); 153 154 return obj; 155 } 41 156 42 157 class TriggeredItem : public TriggeredConfigurationGroup 43 158 { … … static HostSlider *PCMVolume() 589 704 return gs; 590 705 } 591 706 592 static HostCheckBox *DecodeExtraAudio()707 static Setting *DecodeExtraAudio(PlaySettings *settings) 593 708 { 594 HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");709 CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings); 595 710 gc->setLabel(QObject::tr("Extra audio buffering")); 596 711 gc->setValue(true); 597 712 gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing " … … static HostCheckBox *DecodeExtraAudio() 600 715 "effect on framegrabbers (MPEG-4/RTJPEG). MythTV will " 601 716 "keep extra audio data in its internal buffers to " 602 717 "workaround this bug.")); 603 return gc;718 return wrap(gc, settings); 604 719 } 605 720 606 static HostComboBox *PIPLocationComboBox()721 static Setting *PIPLocationComboBox(PlaySettings *settings) 607 722 { 608 HostComboBox *gc = new HostComboBox("PIPLocation");723 CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings); 609 724 gc->setLabel(QObject::tr("PIP video location")); 610 725 for (uint loc = 0; loc < kPIP_END; ++loc) 611 726 gc->addSelection(toString((PIPLocation) loc), QString::number(loc)); 612 727 gc->setHelpText(QObject::tr("Location of PIP Video window.")); 613 return gc;728 return wrap(gc, settings); 614 729 } 615 730 616 731 static HostComboBox *DisplayRecGroup() … … static HostCheckBox *PBBStartInTitle() 696 811 return gc; 697 812 } 698 813 699 static HostCheckBox *SmartForward()814 static Setting *SmartForward(PlaySettings *settings) 700 815 { 701 HostCheckBox *gc = new HostCheckBox("SmartForward");816 CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings); 702 817 gc->setLabel(QObject::tr("Smart fast forwarding")); 703 818 gc->setValue(false); 704 819 gc->setHelpText(QObject::tr("If enabled, then immediately after " 705 820 "rewinding, only skip forward the same amount as " 706 821 "skipping backwards.")); 707 return gc;822 return wrap(gc, settings); 708 823 } 709 824 710 static HostCheckBox *ExactSeeking()825 static Setting *ExactSeeking(PlaySettings *settings) 711 826 { 712 HostCheckBox *gc = new HostCheckBox("ExactSeeking");827 CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings); 713 828 gc->setLabel(QObject::tr("Seek to exact frame")); 714 829 gc->setValue(false); 715 830 gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but " 716 831 "slower.")); 717 return gc;832 return wrap(gc, settings); 718 833 } 719 834 720 835 static GlobalComboBox *CommercialSkipMethod() … … static GlobalCheckBox *CommFlagFast() 742 857 return gc; 743 858 } 744 859 745 static HostComboBox *AutoCommercialSkip()860 static Setting *AutoCommercialSkip(PlaySettings *settings) 746 861 { 747 HostComboBox *gc = new HostComboBox("AutoCommercialSkip");862 CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings); 748 863 gc->setLabel(QObject::tr("Automatically skip commercials")); 749 864 gc->addSelection(QObject::tr("Off"), "0"); 750 865 gc->addSelection(QObject::tr("Notify, but do not skip"), "2"); … … static HostComboBox *AutoCommercialSkip() 753 868 "have been flagged during automatic commercial detection " 754 869 "or by the mythcommflag program, or just notify that a " 755 870 "commercial has been detected.")); 756 return gc;871 return wrap(gc, settings); 757 872 } 758 873 759 874 static GlobalCheckBox *AutoCommercialFlag() … … static GlobalCheckBox *AggressiveCommDetect() 827 942 return bc; 828 943 } 829 944 830 static HostSpinBox *CommRewindAmount()945 static Setting *CommRewindAmount(PlaySettings *settings) 831 946 { 832 HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);947 CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false); 833 948 gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)")); 834 949 gs->setHelpText(QObject::tr("MythTV will automatically rewind " 835 950 "this many seconds after performing a commercial skip.")); 836 951 gs->setValue(0); 837 return gs;952 return wrap(gs, settings); 838 953 } 839 954 840 static HostSpinBox *CommNotifyAmount()955 static Setting *CommNotifyAmount(PlaySettings *settings) 841 956 { 842 HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);957 CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false); 843 958 gs->setLabel(QObject::tr("Commercial skip notify amount (secs)")); 844 959 gs->setHelpText(QObject::tr("MythTV will act like a commercial " 845 960 "begins this many seconds early. This can be useful " 846 961 "when commercial notification is used in place of " 847 962 "automatic skipping.")); 848 963 gs->setValue(0); 849 return gs;964 return wrap(gs, settings); 850 965 } 851 966 852 967 static GlobalSpinBox *MaximumCommercialSkip() … … void PlaybackProfileConfig::swap(int i, int j) 1648 1763 labels[j]->setValue(label_i); 1649 1764 } 1650 1765 1651 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) : 1766 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str, 1767 PlaySettings *settings) : 1652 1768 TriggeredConfigurationGroup(false, true, true, true, 1653 1769 false, false, true, true), grouptrigger(NULL) 1654 1770 { 1655 1771 setLabel(QObject::tr("Playback Profiles") + str); 1772 if (settings) 1773 setLabel(QObject::tr("Playback group settings for ") + 1774 settings->mGroupName + " - " + 1775 getLabel()); 1656 1776 1657 1777 QString host = gCoreContext->GetHostName(); 1658 1778 QStringList profiles = VideoDisplayProfile::GetProfiles(host); … … PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) : 1680 1800 profiles = VideoDisplayProfile::GetProfiles(host); 1681 1801 } 1682 1802 1683 QString profile = VideoDisplayProfile::GetDefaultProfileName(host );1803 QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings); 1684 1804 if (!profiles.contains(profile)) 1685 1805 { 1686 1806 profile = (profiles.contains("Normal")) ? "Normal" : profiles[0]; 1687 1807 VideoDisplayProfile::SetDefaultProfileName(profile, host); 1688 1808 } 1689 1809 1690 grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile"); 1810 CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings); 1811 grouptrigger = gs; 1691 1812 grouptrigger->setLabel(QObject::tr("Current Video Playback Profile")); 1692 1813 QStringList::const_iterator it; 1693 1814 for (it = profiles.begin(); it != profiles.end(); ++it) 1694 1815 grouptrigger->addSelection(ProgramInfo::i18n(*it), *it); 1816 if (settings) 1817 { 1818 addChild(wrap(grouptrigger, settings)); 1819 return; 1820 } 1695 1821 1696 1822 HorizontalConfigurationGroup *grp = 1697 1823 new HorizontalConfigurationGroup(false, false, true, true); … … static HostComboBox *PlayBoxEpisodeSort() 1824 1950 return gc; 1825 1951 } 1826 1952 1827 static HostSpinBox *FFRewReposTime()1953 static Setting *FFRewReposTime(PlaySettings *settings) 1828 1954 { 1829 HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);1955 CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false); 1830 1956 gs->setLabel(QObject::tr("Fast forward/rewind reposition amount")); 1831 1957 gs->setValue(100); 1832 1958 gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind " … … static HostSpinBox *FFRewReposTime() 1834 1960 "resuming normal playback. This " 1835 1961 "compensates for the reaction time between seeing " 1836 1962 "where to resume playback and actually exiting seeking.")); 1837 return gs;1963 return wrap(gs, settings); 1838 1964 } 1839 1965 1840 static HostCheckBox *FFRewReverse()1966 static Setting *FFRewReverse(PlaySettings *settings) 1841 1967 { 1842 HostCheckBox *gc = new HostCheckBox("FFRewReverse");1968 CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings); 1843 1969 gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind")); 1844 1970 gc->setValue(true); 1845 1971 gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key " … … static HostCheckBox *FFRewReverse() 1847 1973 "vice versa. If disabled, it will decrease the " 1848 1974 "current speed or switch to play mode if " 1849 1975 "the speed can't be decreased further.")); 1850 return gc;1976 return wrap(gc, settings); 1851 1977 } 1852 1978 1853 1979 static HostComboBox *MenuTheme() … … static HostComboBox __attribute__ ((unused)) *DecodeVBIFormat() 1884 2010 return gc; 1885 2011 } 1886 2012 1887 static HostSpinBox *OSDCC708TextZoomPercentage(void)2013 static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings) 1888 2014 { 1889 HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5); 2015 CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings, 2016 50, 200, 5, false); 1890 2017 gs->setLabel(QObject::tr("Subtitle text zoom percentage")); 1891 2018 gs->setValue(100); 1892 2019 gs->setHelpText(QObject::tr("Use this to enlarge or shrink text based subtitles.")); 1893 2020 1894 return gs;2021 return wrap(gs, settings); 1895 2022 } 1896 2023 1897 2024 static HostComboBox *SubtitleFont() … … static HostComboBox *SubtitleFont() 1911 2038 return hcb; 1912 2039 } 1913 2040 1914 static HostComboBox *SubtitleCodec()2041 static Setting *SubtitleCodec(PlaySettings *settings) 1915 2042 { 1916 HostComboBox *gc = new HostComboBox("SubtitleCodec");2043 CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings); 1917 2044 1918 2045 gc->setLabel(QObject::tr("Subtitle Codec")); 1919 2046 QList<QByteArray> list = QTextCodec::availableCodecs(); … … static HostComboBox *SubtitleCodec() 1923 2050 gc->addSelection(val, val, val.toLower() == "utf-8"); 1924 2051 } 1925 2052 1926 return gc;2053 return wrap(gc, settings); 1927 2054 } 1928 2055 1929 2056 static HostComboBox *ChannelOrdering() … … static HostComboBox *ChannelOrdering() 1935 2062 return gc; 1936 2063 } 1937 2064 1938 static HostSpinBox *VertScanPercentage()2065 static Setting *VertScanPercentage(PlaySettings *settings) 1939 2066 { 1940 HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1); 2067 CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings, 2068 -100, 100, 1, false); 1941 2069 gs->setLabel(QObject::tr("Vertical scaling")); 1942 2070 gs->setValue(0); 1943 2071 gs->setHelpText(QObject::tr( 1944 2072 "Adjust this if the image does not fill your " 1945 2073 "screen vertically. Range -100% to 100%")); 1946 return gs;2074 return wrap(gs, settings); 1947 2075 } 1948 2076 1949 static HostSpinBox *HorizScanPercentage()2077 static Setting *HorizScanPercentage(PlaySettings *settings) 1950 2078 { 1951 HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1); 2079 CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings, 2080 -100, 100, 1, false); 1952 2081 gs->setLabel(QObject::tr("Horizontal scaling")); 1953 2082 gs->setValue(0); 1954 2083 gs->setHelpText(QObject::tr( 1955 2084 "Adjust this if the image does not fill your " 1956 2085 "screen horizontally. Range -100% to 100%")); 1957 return gs;2086 return wrap(gs, settings); 1958 2087 }; 1959 2088 1960 static HostSpinBox *XScanDisplacement()2089 static Setting *XScanDisplacement(PlaySettings *settings) 1961 2090 { 1962 HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1); 2091 CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings, 2092 -50, 50, 1, false); 1963 2093 gs->setLabel(QObject::tr("Scan displacement (X)")); 1964 2094 gs->setValue(0); 1965 2095 gs->setHelpText(QObject::tr("Adjust this to move the image horizontally.")); 1966 return gs;2096 return wrap(gs, settings); 1967 2097 } 1968 2098 1969 static HostSpinBox *YScanDisplacement()2099 static Setting *YScanDisplacement(PlaySettings *settings) 1970 2100 { 1971 HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1); 2101 CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings, 2102 -50, 50, 1, false); 1972 2103 gs->setLabel(QObject::tr("Scan displacement (Y)")); 1973 2104 gs->setValue(0); 1974 2105 gs->setHelpText(QObject::tr("Adjust this to move the image vertically.")); 1975 return gs;2106 return wrap(gs, settings); 1976 2107 }; 1977 2108 1978 static HostCheckBox *CCBackground()2109 static Setting *CCBackground(PlaySettings *settings) 1979 2110 { 1980 HostCheckBox *gc = new HostCheckBox("CCBackground");2111 CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings); 1981 2112 gc->setLabel(QObject::tr("Black background for closed captioning")); 1982 2113 gc->setValue(false); 1983 2114 gc->setHelpText(QObject::tr( 1984 2115 "If enabled, captions will be displayed " 1985 2116 "as white text over a black background " 1986 2117 "for better contrast.")); 1987 return gc;2118 return wrap(gc, settings); 1988 2119 } 1989 2120 1990 static HostCheckBox *DefaultCCMode()2121 static Setting *DefaultCCMode(PlaySettings *settings) 1991 2122 { 1992 HostCheckBox *gc = new HostCheckBox("DefaultCCMode");2123 CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings); 1993 2124 gc->setLabel(QObject::tr("Always display closed captioning or subtitles")); 1994 2125 gc->setValue(false); 1995 2126 gc->setHelpText(QObject::tr( … … static HostCheckBox *DefaultCCMode() 1997 2128 "when playing back recordings or watching " 1998 2129 "Live TV. Closed Captioning can be turned on or off " 1999 2130 "by pressing \"T\" during playback.")); 2000 return gc;2131 return wrap(gc, settings); 2001 2132 } 2002 2133 2003 static HostCheckBox *PreferCC708()2134 static Setting *PreferCC708(PlaySettings *settings) 2004 2135 { 2005 HostCheckBox *gc = new HostCheckBox("Prefer708Captions");2136 CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings); 2006 2137 gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions")); 2007 2138 gc->setValue(true); 2008 2139 gc->setHelpText( … … static HostCheckBox *PreferCC708() 2010 2141 "If enabled, the newer EIA-708 captions will be preferred over " 2011 2142 "the older EIA-608 captions in ATSC streams.")); 2012 2143 2013 return gc;2144 return wrap(gc, settings); 2014 2145 } 2015 2146 2016 static HostCheckBox *EnableMHEG()2147 static Setting *EnableMHEG(PlaySettings *settings) 2017 2148 { 2018 HostCheckBox *gc = new HostCheckBox("EnableMHEG");2149 CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings); 2019 2150 gc->setLabel(QObject::tr("Enable interactive TV")); 2020 2151 gc->setValue(false); 2021 2152 gc->setHelpText(QObject::tr( 2022 2153 "If enabled, interactive TV applications (MHEG) will " 2023 2154 "be activated. This is used for teletext and logos for " 2024 2155 "radio and channels that are currently off-air.")); 2025 return gc;2156 return wrap(gc, settings); 2026 2157 } 2027 2158 2028 static HostCheckBox *PersistentBrowseMode()2159 static Setting *PersistentBrowseMode(PlaySettings *settings) 2029 2160 { 2030 HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");2161 CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings); 2031 2162 gc->setLabel(QObject::tr("Always use browse mode in Live TV")); 2032 2163 gc->setValue(true); 2033 2164 gc->setHelpText( 2034 2165 QObject::tr( 2035 2166 "If enabled, browse mode will automatically be activated " 2036 2167 "whenever you use channel up/down while watching Live TV.")); 2037 return gc;2168 return wrap(gc, settings); 2038 2169 } 2039 2170 2040 static HostCheckBox *BrowseAllTuners()2171 static Setting *BrowseAllTuners(PlaySettings *settings) 2041 2172 { 2042 HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");2173 CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings); 2043 2174 gc->setLabel(QObject::tr("Browse all channels")); 2044 2175 gc->setValue(false); 2045 2176 gc->setHelpText( … … static HostCheckBox *BrowseAllTuners() 2047 2178 "If enabled, browse mode will shows channels on all " 2048 2179 "available recording devices, instead of showing " 2049 2180 "channels on just the current recorder.")); 2050 return gc;2181 return wrap(gc, settings); 2051 2182 } 2052 2183 2053 static HostCheckBox *ClearSavedPosition()2184 static Setting *ClearSavedPosition(PlaySettings *settings) 2054 2185 { 2055 HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");2186 CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings); 2056 2187 gc->setLabel(QObject::tr("Clear bookmark on playback")); 2057 2188 gc->setValue(true); 2058 2189 gc->setHelpText(QObject::tr("If enabled, automatically clear the " 2059 2190 "bookmark on a recording when the recording is played " 2060 2191 "back. If disabled, you can mark the beginning with " 2061 2192 "rewind then save position.")); 2062 return gc;2193 return wrap(gc, settings); 2063 2194 } 2064 2195 2065 static HostCheckBox *AltClearSavedPosition()2196 static Setting *AltClearSavedPosition(PlaySettings *settings) 2066 2197 { 2067 HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");2198 CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings); 2068 2199 gc->setLabel(QObject::tr("Alternate clear and save bookmark")); 2069 2200 gc->setValue(true); 2070 2201 gc->setHelpText(QObject::tr("During playback the SELECT key " … … static HostCheckBox *AltClearSavedPosition() 2072 2203 "Saved\" and \"Bookmark Cleared\". If disabled, the " 2073 2204 "SELECT key will save the current position for each " 2074 2205 "keypress.")); 2075 return gc;2206 return wrap(gc, settings); 2076 2207 } 2077 2208 2078 2209 // This currently does not work 2079 2210 /* 2080 static HostLineEdit *UDPNotifyPort()2211 static Setting *UDPNotifyPort(PlaySettings *settings) 2081 2212 { 2082 HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");2213 CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings); 2083 2214 ge->setLabel(QObject::tr("UDP notify port")); 2084 2215 ge->setValue("6948"); 2085 2216 ge->setHelpText(QObject::tr("During playback, MythTV will listen for " 2086 2217 "connections from the \"mythtvosd\" or \"mythudprelay\" " 2087 2218 "programs on this port. For additional information, see " 2088 2219 "http://www.mythtv.org/wiki/MythNotify .")); 2089 return ge;2220 return wrap(ge, settings); 2090 2221 } 2091 2222 */ 2092 2223 2093 static HostComboBox *PlaybackExitPrompt()2224 static Setting *PlaybackExitPrompt(PlaySettings *settings) 2094 2225 { 2095 HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");2226 CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings); 2096 2227 gc->setLabel(QObject::tr("Action on playback exit")); 2097 2228 gc->addSelection(QObject::tr("Just exit"), "0"); 2098 2229 gc->addSelection(QObject::tr("Save position and exit"), "2"); … … static HostComboBox *PlaybackExitPrompt() 2103 2234 "when you exit playback mode. The options available will " 2104 2235 "allow you to save your position, delete the " 2105 2236 "recording, or continue watching.")); 2106 return gc;2237 return wrap(gc, settings); 2107 2238 } 2108 2239 2109 static HostCheckBox *EndOfRecordingExitPrompt()2240 static Setting *EndOfRecordingExitPrompt(PlaySettings *settings) 2110 2241 { 2111 HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");2242 CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings); 2112 2243 gc->setLabel(QObject::tr("Prompt at end of recording")); 2113 2244 gc->setValue(false); 2114 2245 gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing " 2115 2246 "you to delete the recording when it has finished " 2116 2247 "playing.")); 2117 return gc;2248 return wrap(gc, settings); 2118 2249 } 2119 2250 2120 static HostCheckBox *JumpToProgramOSD()2251 static Setting *JumpToProgramOSD(PlaySettings *settings) 2121 2252 { 2122 HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");2253 CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings); 2123 2254 gc->setLabel(QObject::tr("Jump to program OSD")); 2124 2255 gc->setValue(true); 2125 2256 gc->setHelpText(QObject::tr( … … static HostCheckBox *JumpToProgramOSD() 2128 2259 "'Watch Recording' screen when 'Jump to Program' " 2129 2260 "is activated. If enabled, the recordings are shown " 2130 2261 "in the OSD")); 2131 return gc;2262 return wrap(gc, settings); 2132 2263 } 2133 2264 2134 static HostCheckBox *ContinueEmbeddedTVPlay()2265 static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings) 2135 2266 { 2136 HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");2267 CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings); 2137 2268 gc->setLabel(QObject::tr("Continue playback when embedded")); 2138 2269 gc->setValue(false); 2139 2270 gc->setHelpText(QObject::tr( … … static HostCheckBox *ContinueEmbeddedTVPlay() 2141 2272 "is embedded in the upcoming program list or recorded " 2142 2273 "list. The default is to pause the recorded show when " 2143 2274 "embedded.")); 2144 return gc;2275 return wrap(gc, settings); 2145 2276 } 2146 2277 2147 static HostCheckBox *AutomaticSetWatched()2278 static Setting *AutomaticSetWatched(PlaySettings *settings) 2148 2279 { 2149 HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");2280 CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings); 2150 2281 gc->setLabel(QObject::tr("Automatically mark a recording as watched")); 2151 2282 gc->setValue(false); 2152 2283 gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a " … … static HostCheckBox *AutomaticSetWatched() 2154 2285 "detection is not foolproof, so do not enable this " 2155 2286 "setting if you don't want an unwatched recording marked " 2156 2287 "as watched.")); 2157 return gc;2288 return wrap(gc, settings); 2158 2289 } 2159 2290 2160 2291 static HostSpinBox *LiveTVIdleTimeout() … … static HostComboBox *XineramaMonitorAspectRatio() 2344 2475 return gc; 2345 2476 } 2346 2477 2347 static HostComboBox *LetterboxingColour()2478 static Setting *LetterboxingColour(PlaySettings *settings) 2348 2479 { 2349 HostComboBox *gc = new HostComboBox("LetterboxColour");2480 CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings); 2350 2481 gc->setLabel(QObject::tr("Letterboxing color")); 2351 2482 for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m) 2352 2483 gc->addSelection(toString((LetterBoxColour)m), QString::number(m)); … … static HostComboBox *LetterboxingColour() 2356 2487 "letterboxing, but those with plasma screens may prefer gray " 2357 2488 "to minimize burn-in.") + " " + 2358 2489 QObject::tr("Currently only works with XVideo video renderer.")); 2359 return gc;2490 return wrap(gc, settings); 2360 2491 } 2361 2492 2362 static HostComboBox *AspectOverride()2493 static Setting *AspectOverride(PlaySettings *settings) 2363 2494 { 2364 HostComboBox *gc = new HostComboBox("AspectOverride");2495 CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings); 2365 2496 gc->setLabel(QObject::tr("Video aspect override")); 2366 2497 for (int m = kAspect_Off; m < kAspect_END; ++m) 2367 2498 gc->addSelection(toString((AspectOverrideMode)m), QString::number(m)); … … static HostComboBox *AspectOverride() 2369 2500 "When enabled, these will override the aspect " 2370 2501 "ratio specified by any broadcaster for all " 2371 2502 "video streams.")); 2372 return gc;2503 return wrap(gc, settings); 2373 2504 } 2374 2505 2375 static HostComboBox *AdjustFill()2506 static Setting *AdjustFill(PlaySettings *settings) 2376 2507 { 2377 HostComboBox *gc = new HostComboBox("AdjustFill");2508 CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings); 2378 2509 gc->setLabel(QObject::tr("Zoom")); 2379 2510 gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff), 2380 2511 QString::number(kAdjustFill_AutoDetect_DefaultOff)); … … static HostComboBox *AdjustFill() 2385 2516 gc->setHelpText(QObject::tr( 2386 2517 "When enabled, these will apply a predefined " 2387 2518 "zoom to all video playback in MythTV.")); 2388 return gc;2519 return wrap(gc, settings); 2389 2520 } 2390 2521 2391 2522 // Theme settings … … static HostSpinBox *NetworkControlPort() 3310 3441 return gs; 3311 3442 } 3312 3443 3313 static HostCheckBox *RealtimePriority()3444 static Setting *RealtimePriority(PlaySettings *settings) 3314 3445 { 3315 HostCheckBox *gc = new HostCheckBox("RealtimePriority");3446 CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings); 3316 3447 gc->setLabel(QObject::tr("Enable realtime priority threads")); 3317 3448 gc->setHelpText(QObject::tr("When running mythfrontend with root " 3318 3449 "privileges, some threads can be given enhanced priority. " 3319 3450 "Disable this if mythfrontend freezes during video " 3320 3451 "playback.")); 3321 3452 gc->setValue(true); 3322 return gc;3453 return wrap(gc, settings, false); 3323 3454 } 3324 3455 3325 3456 static HostCheckBox *EnableMediaMon() … … class WatchListSettings : public TriggeredConfigurationGroup 3476 3607 3477 3608 #ifdef USING_OPENGL_VSYNC 3478 3609 /* 3479 static HostCheckBox *UseOpenGLVSync()3610 static Setting *UseOpenGLVSync(PlaySettings *settings) 3480 3611 { 3481 HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");3612 CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings); 3482 3613 gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing")); 3483 3614 gc->setValue(false); 3484 3615 gc->setHelpText(QObject::tr( 3485 3616 "If supported by your hardware/drivers, " 3486 3617 "MythTV will use OpenGL vertical syncing for " 3487 3618 "video timing, reducing frame jitter.")); 3488 return gc;3619 return wrap(gc, settings); 3489 3620 } 3490 3621 */ 3491 3622 #endif … … static HostCheckBox *WatchTVGuide() 3912 4043 return gc; 3913 4044 } 3914 4045 3915 MainGeneralSettings::MainGeneralSettings() 4046 MainGeneralSettings::MainGeneralSettings(PlaySettings *settings, 4047 ConfigurationWizard *base) 3916 4048 { 4049 if (!settings) 4050 { 3917 4051 DatabaseSettings::addDatabaseSettings(this); 3918 4052 3919 4053 VerticalConfigurationGroup *pin = … … MainGeneralSettings::MainGeneralSettings() 3965 4099 remotecontrol->addChild(NetworkControlEnabled()); 3966 4100 remotecontrol->addChild(NetworkControlPort()); 3967 4101 addChild(remotecontrol); 4102 } 3968 4103 } 3969 4104 3970 PlaybackSettings::PlaybackSettings() 4105 PlaybackSettings::PlaybackSettings(PlaySettings *settings, 4106 ConfigurationWizard *base) 3971 4107 { 3972 4108 uint i = 0, total = 8; 3973 4109 #if CONFIG_DARWIN 3974 4110 total += 2; 3975 4111 #endif // USING_DARWIN 4112 if (settings) 4113 total -= 3; 3976 4114 3977 4115 3978 4116 VerticalConfigurationGroup* general1 = 3979 4117 new VerticalConfigurationGroup(false); 3980 4118 general1->setLabel(QObject::tr("General Playback") + 3981 4119 QString(" (%1/%2)").arg(++i).arg(total)); 4120 if (settings) 4121 general1->setLabel(QObject::tr("Playback group settings for ") + 4122 settings->mGroupName + " - " + 4123 general1->getLabel()); 3982 4124 3983 4125 HorizontalConfigurationGroup *columns = 3984 4126 new HorizontalConfigurationGroup(false, false, true, true); 3985 4127 3986 4128 VerticalConfigurationGroup *column1 = 3987 4129 new VerticalConfigurationGroup(false, false, true, true); 3988 column1->addChild(RealtimePriority()); 3989 column1->addChild(DecodeExtraAudio()); 3990 column1->addChild(JumpToProgramOSD()); 4130 if (!settings) 4131 column1->addChild(RealtimePriority(settings)); 4132 column1->addChild(DecodeExtraAudio(settings)); 4133 column1->addChild(JumpToProgramOSD(settings)); 3991 4134 columns->addChild(column1); 3992 4135 3993 4136 VerticalConfigurationGroup *column2 = 3994 4137 new VerticalConfigurationGroup(false, false, true, true); 3995 column2->addChild(ClearSavedPosition( ));3996 column2->addChild(AltClearSavedPosition( ));3997 column2->addChild(AutomaticSetWatched( ));3998 column2->addChild(ContinueEmbeddedTVPlay( ));4138 column2->addChild(ClearSavedPosition(settings)); 4139 column2->addChild(AltClearSavedPosition(settings)); 4140 column2->addChild(AutomaticSetWatched(settings)); 4141 column2->addChild(ContinueEmbeddedTVPlay(settings)); 3999 4142 columns->addChild(column2); 4000 4143 4001 4144 general1->addChild(columns); 4002 general1->addChild(LiveTVIdleTimeout()); 4145 if (!settings) 4146 general1->addChild(LiveTVIdleTimeout()); 4003 4147 #ifdef USING_OPENGL_VSYNC 4004 //general1->addChild(UseOpenGLVSync( ));4148 //general1->addChild(UseOpenGLVSync(settings)); 4005 4149 #endif // USING_OPENGL_VSYNC 4006 addChild(general1); 4150 if (base) 4151 base->addChild(general1); 4152 else 4153 addChild(general1); 4007 4154 4008 4155 VerticalConfigurationGroup* general2 = 4009 4156 new VerticalConfigurationGroup(false); 4010 4157 general2->setLabel(QObject::tr("General Playback") + 4011 4158 QString(" (%1/%2)").arg(++i).arg(total)); 4159 if (settings) 4160 general2->setLabel(QObject::tr("Playback group settings for ") + 4161 settings->mGroupName + " - " + 4162 general2->getLabel()); 4012 4163 4013 4164 HorizontalConfigurationGroup* oscan = 4014 4165 new HorizontalConfigurationGroup(false, false, true, true); … … PlaybackSettings::PlaybackSettings() 4016 4167 new VerticalConfigurationGroup(false, false, true, true); 4017 4168 VerticalConfigurationGroup *ocol2 = 4018 4169 new VerticalConfigurationGroup(false, false, true, true); 4019 ocol1->addChild(VertScanPercentage( ));4020 ocol1->addChild(YScanDisplacement( ));4021 ocol2->addChild(HorizScanPercentage( ));4022 ocol2->addChild(XScanDisplacement( ));4170 ocol1->addChild(VertScanPercentage(settings)); 4171 ocol1->addChild(YScanDisplacement(settings)); 4172 ocol2->addChild(HorizScanPercentage(settings)); 4173 ocol2->addChild(XScanDisplacement(settings)); 4023 4174 oscan->addChild(ocol1); 4024 4175 oscan->addChild(ocol2); 4025 4176 4026 4177 HorizontalConfigurationGroup* aspect_fill = 4027 4178 new HorizontalConfigurationGroup(false, false, true, true); 4028 aspect_fill->addChild(AspectOverride( ));4029 aspect_fill->addChild(AdjustFill( ));4179 aspect_fill->addChild(AspectOverride(settings)); 4180 aspect_fill->addChild(AdjustFill(settings)); 4030 4181 4031 4182 general2->addChild(oscan); 4032 4183 general2->addChild(aspect_fill); 4033 general2->addChild(LetterboxingColour()); 4034 general2->addChild(PIPLocationComboBox()); 4035 general2->addChild(PlaybackExitPrompt()); 4036 general2->addChild(EndOfRecordingExitPrompt()); 4037 addChild(general2); 4184 general2->addChild(LetterboxingColour(settings)); 4185 general2->addChild(PIPLocationComboBox(settings)); 4186 general2->addChild(PlaybackExitPrompt(settings)); 4187 general2->addChild(EndOfRecordingExitPrompt(settings)); 4188 if (base) 4189 base->addChild(general2); 4190 else 4191 addChild(general2); 4038 4192 4039 4193 QString tmp = QString(" (%1/%2)").arg(++i).arg(total); 4040 addChild(new PlaybackProfileConfigs(tmp)); 4194 if (base) 4195 base->addChild(new PlaybackProfileConfigs(tmp, settings)); 4196 else 4197 addChild(new PlaybackProfileConfigs(tmp, settings)); 4041 4198 4199 if (!settings) 4200 { 4042 4201 VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false); 4043 4202 pbox->setLabel(QObject::tr("View Recordings") + 4044 4203 QString(" (%1/%2)").arg(++i).arg(total)); … … PlaybackSettings::PlaybackSettings() 4065 4224 pbox3->addChild(DisplayGroupTitleSort()); 4066 4225 pbox3->addChild(new WatchListSettings()); 4067 4226 addChild(pbox3); 4227 } 4068 4228 4069 4229 VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false); 4070 4230 seek->setLabel(QObject::tr("Seeking") + 4071 4231 QString(" (%1/%2)").arg(++i).arg(total)); 4072 seek->addChild(SmartForward()); 4073 seek->addChild(FFRewReposTime()); 4074 seek->addChild(FFRewReverse()); 4075 seek->addChild(ExactSeeking()); 4076 addChild(seek); 4232 if (settings) 4233 seek->setLabel(QObject::tr("Playback group settings for ") + 4234 settings->mGroupName + " - " + 4235 seek->getLabel()); 4236 seek->addChild(SmartForward(settings)); 4237 seek->addChild(FFRewReposTime(settings)); 4238 seek->addChild(FFRewReverse(settings)); 4239 seek->addChild(ExactSeeking(settings)); 4240 if (base) 4241 base->addChild(seek); 4242 else 4243 addChild(seek); 4077 4244 4078 4245 VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false); 4079 4246 comms->setLabel(QObject::tr("Commercial Skip") + 4080 4247 QString(" (%1/%2)").arg(++i).arg(total)); 4081 comms->addChild(AutoCommercialSkip()); 4082 comms->addChild(CommRewindAmount()); 4083 comms->addChild(CommNotifyAmount()); 4248 if (settings) 4249 comms->setLabel(QObject::tr("Playback group settings for ") + 4250 settings->mGroupName + " - " + 4251 comms->getLabel()); 4252 comms->addChild(AutoCommercialSkip(settings)); 4253 comms->addChild(CommRewindAmount(settings)); 4254 comms->addChild(CommNotifyAmount(settings)); 4255 if (!settings) // these are global settings, not host-specific 4256 { 4084 4257 comms->addChild(MaximumCommercialSkip()); 4085 4258 comms->addChild(MergeShortCommBreaks()); 4086 addChild(comms); 4259 } 4260 if (base) 4261 base->addChild(comms); 4262 else 4263 addChild(comms); 4087 4264 4088 4265 #if CONFIG_DARWIN 4089 4266 VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false); 4090 4267 mac1->setLabel(QObject::tr("Mac OS X Video Settings") + 4091 4268 QString(" (%1/%2)").arg(++i).arg(total)); 4269 if (settings) 4270 mac1->setLabel(QObject::tr("Playback group settings for ") + 4271 settings->mGroupName + " - " + 4272 mac1->getLabel()); 4273 if (!settings) 4274 { 4092 4275 mac1->addChild(MacGammaCorrect()); 4093 4276 mac1->addChild(MacScaleUp()); 4094 4277 mac1->addChild(MacFullSkip()); 4095 addChild(mac1); 4278 } 4279 if (base) 4280 base->addChild(mac1); 4281 else 4282 addChild(mac1); 4096 4283 4097 4284 VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false); 4098 4285 mac2->setLabel(QObject::tr("Mac OS X Video Settings") + 4099 4286 QString(" (%1/%2)").arg(++i).arg(total)); 4287 if (settings) 4288 mac2->setLabel(QObject::tr("Playback group settings for ") + 4289 settings->mGroupName + " - " + 4290 mac2->getLabel()); 4291 if (!setings) 4292 { 4100 4293 mac2->addChild(new MacMainSettings()); 4101 4294 mac2->addChild(new MacFloatSettings()); 4102 4295 … … PlaybackSettings::PlaybackSettings() 4110 4303 #endif 4111 4304 } 4112 4305 4113 OSDSettings::OSDSettings() 4306 OSDSettings::OSDSettings(PlaySettings *settings, 4307 ConfigurationWizard *base) 4114 4308 { 4115 4309 VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false); 4116 4310 osd->setLabel(QObject::tr("On-screen Display")); 4311 if (settings) 4312 osd->setLabel(QObject::tr("Playback group settings for ") + 4313 settings->mGroupName + " - " + 4314 osd->getLabel()); 4117 4315 4118 osd->addChild(EnableMHEG()); 4119 osd->addChild(PersistentBrowseMode()); 4120 osd->addChild(BrowseAllTuners()); 4121 osd->addChild(CCBackground()); 4122 osd->addChild(DefaultCCMode()); 4123 osd->addChild(PreferCC708()); 4316 if (!settings) 4317 { 4318 osd->addChild(EnableMHEG(settings)); 4319 osd->addChild(PersistentBrowseMode(settings)); 4320 osd->addChild(BrowseAllTuners(settings)); 4321 } 4322 osd->addChild(CCBackground(settings)); 4323 osd->addChild(DefaultCCMode(settings)); 4324 osd->addChild(PreferCC708(settings)); 4325 if (!settings) 4124 4326 osd->addChild(SubtitleFont()); 4125 osd->addChild(OSDCC708TextZoomPercentage()); 4126 osd->addChild(SubtitleCodec()); 4127 //osd->addChild(UDPNotifyPort()); 4128 addChild(osd); 4327 osd->addChild(OSDCC708TextZoomPercentage(settings)); 4328 osd->addChild(SubtitleCodec(settings)); 4329 //osd->addChild(UDPNotifyPort(settings)); 4330 if (base) 4331 base->addChild(osd); 4332 else 4333 addChild(osd); 4129 4334 4130 4335 //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false); 4131 4336 //cc->setLabel(QObject::tr("Closed Captions")); -
mythtv/programs/mythfrontend/globalsettings.h
diff --git a/mythtv/programs/mythfrontend/globalsettings.h b/mythtv/programs/mythfrontend/globalsettings.h index 7c9b4d5..f9197a5 100644
a b 13 13 14 14 class QFileInfo; 15 15 class AudioDeviceComboBox; 16 class PlaySettings; 16 17 17 18 class AudioConfigSettings : public VerticalConfigurationGroup 18 19 { … … class ThemeSelector : public HostImageSelect 89 90 class PlaybackSettings : public ConfigurationWizard 90 91 { 91 92 public: 92 PlaybackSettings(); 93 PlaybackSettings(PlaySettings *settings=NULL, 94 ConfigurationWizard *base=NULL); 93 95 }; 94 96 95 97 class OSDSettings: virtual public ConfigurationWizard 96 98 { 97 99 public: 98 OSDSettings(); 100 OSDSettings(PlaySettings *settings=NULL, 101 ConfigurationWizard *base=NULL); 99 102 }; 100 103 101 104 class GeneralSettings : public ConfigurationWizard … … class AppearanceSettings : public ConfigurationWizard 119 122 class MainGeneralSettings : public ConfigurationWizard 120 123 { 121 124 public: 122 MainGeneralSettings(); 125 MainGeneralSettings(PlaySettings *settings=NULL, 126 ConfigurationWizard *base=NULL); 123 127 }; 124 128 125 129 class GeneralRecPrioritiesSettings : public ConfigurationWizard … … class PlaybackProfileConfigs : public TriggeredConfigurationGroup 207 211 Q_OBJECT 208 212 209 213 public: 210 PlaybackProfileConfigs(const QString &str );214 PlaybackProfileConfigs(const QString &str, PlaySettings *settings); 211 215 virtual ~PlaybackProfileConfigs(); 212 216 213 217 private: … … class PlaybackProfileConfigs : public TriggeredConfigurationGroup 219 223 220 224 private: 221 225 QStringList profiles; 222 HostComboBox*grouptrigger;226 ComboBoxSetting *grouptrigger; 223 227 }; 224 228 225 229 #endif -
mythtv/programs/mythfrontend/main.cpp
diff --git a/mythtv/programs/mythfrontend/main.cpp b/mythtv/programs/mythfrontend/main.cpp index 7b42569..4658195 100644
a b using namespace std; 36 36 #include "globalsettings.h" 37 37 #include "profilegroup.h" 38 38 #include "playgroup.h" 39 #include "playsettings.h" 39 40 #include "networkcontrol.h" 40 41 #include "dvdringbuffer.h" 41 42 #include "scheduledrecording.h" … … static void showStatus(void) 480 481 delete statusbox; 481 482 } 482 483 484 ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 485 { 486 return new PlaybackSettings(settings, base); 487 } 488 489 ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 490 { 491 return new OSDSettings(settings, base); 492 } 493 494 ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 495 { 496 return new MainGeneralSettings(settings, base); 497 } 498 499 static PlayGroupEditor::SettingsLookup pbgroupSetup[] = { 500 createPlaybackSettingsForPlaybackGroup, 501 createOSDSettingsForPlaybackGroup, 502 createMainGeneralSettingsForPlaybackGroup 503 }; 504 483 505 static void TVMenuCallback(void *data, QString &selection) 484 506 { 485 507 (void)data; … … static void TVMenuCallback(void *data, QString &selection) 578 600 } 579 601 else if (sel == "settings playgroup") 580 602 { 581 PlayGroupEditor editor; 603 PlayGroupEditor editor(pbgroupSetup, 604 sizeof(pbgroupSetup)/sizeof(*pbgroupSetup)); 582 605 editor.exec(); 583 606 } 584 607 else if (sel == "settings general") … … static int internal_play_media(const QString &mrl, const QString &plot, 770 793 } 771 794 } 772 795 delete tmprbuf; 796 pginfo->SetPlaybackGroup("Videos"); 773 797 } 774 798 else if (pginfo->IsVideo()) 799 { 775 800 pos = pginfo->QueryBookmark(); 801 pginfo->SetPlaybackGroup("Videos"); 802 } 776 803 777 804 if (pos > 0) 778 805 {