Ticket #8088: 8088_playgroups_v23.patch
File 8088_playgroups_v23.patch, 114.0 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 9e64548..d5c3a07 100644
a b SOURCES += programtypes.cpp recordingtypes.cpp 66 66 SOURCES += mythrssmanager.cpp netgrabbermanager.cpp 67 67 SOURCES += rssparse.cpp netutils.cpp 68 68 69 HEADERS += playsettings.h 70 SOURCES += playsettings.cpp 71 69 72 # remove when everything is switched to mythui 70 73 SOURCES += virtualkeyboard_qt.cpp 71 74 -
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 46c7bd0..2875601 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 10c9939..47fdcec 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 98f7514..804d9dc 100644
a b using namespace std; 36 36 #include "bdringbuffer.h" 37 37 #include "videodisplayprofile.h" 38 38 #include "mythuihelper.h" 39 #include "playsettings.h" 39 40 40 41 #include "lcddevice.h" 41 42 … … AvFormatDecoder::AvFormatDecoder(MythPlayer *parent, 280 281 281 282 cc608_build_parity_table(cc608_parity_table); 282 283 283 if ( gCoreContext->GetNumSetting("CCBackground", 0))284 if (GetPlayer()->GetPlaySettings()->GetNumSetting("CCBackground", 0)) 284 285 CC708Window::forceWhiteOnBlackText = true; 285 286 286 287 no_dts_hack = false; … … void AvFormatDecoder::InitVideoCodec(AVStream *stream, AVCodecContext *enc, 1193 1194 if (selectedStream) 1194 1195 { 1195 1196 directrendering = true; 1196 if (! gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&1197 if (!GetPlayer()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) && 1197 1198 !CODEC_IS_HWACCEL(codec, enc)) 1198 1199 { 1199 1200 SetLowBuffers(false); … … int AvFormatDecoder::ScanStreams(bool novideo) 1698 1699 1699 1700 if (!is_db_ignored) 1700 1701 { 1701 VideoDisplayProfile vdp ;1702 VideoDisplayProfile vdp(GetPlayer()->GetPlaySettings()); 1702 1703 vdp.SetInput(QSize(width, height)); 1703 1704 dec = vdp.GetDecoder(); 1704 1705 thread_count = vdp.GetMaxCPUs(); … … int AvFormatDecoder::ScanStreams(bool novideo) 1726 1727 MythCodecID vdpau_mcid; 1727 1728 vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec( 1728 1729 width, height, 1729 mpeg_version(enc->codec_id), no_hardware_decoders); 1730 mpeg_version(enc->codec_id), no_hardware_decoders, 1731 GetPlayer()->GetPlaySettings()); 1730 1732 1731 1733 if (vdpau_mcid >= video_codec_id) 1732 1734 { -
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 75b289a..5b5802e 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, 548 0 /*embedid*/ );542 0 /*embedid*/, GetPlaySettings()); 549 543 } 550 544 551 545 if (videoOutput) … … void MythPlayer::ReinitOSD(void) 634 628 635 629 void MythPlayer::ReinitVideo(void) 636 630 { 637 if (!videoOutput->IsPreferredRenderer(video_disp_dim ))631 if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings())) 638 632 { 639 633 VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer.")); 640 634 SetErrored(QObject::tr("Need to switch video renderer.")); … … void MythPlayer::VideoStart(void) 2045 2039 } 2046 2040 #endif // USING_MHEG 2047 2041 2048 SetCaptionsEnabled(gCoreContext->GetNumSetting("DefaultCCMode"), false); 2042 SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0), 2043 false); 2049 2044 osdLock.unlock(); 2050 2045 } 2051 2046 … … void MythPlayer::VideoStart(void) 2092 2087 m_double_process = videoOutput->IsExtraProcessingRequired(); 2093 2088 2094 2089 videosync = VideoSync::BestMethod( 2095 videoOutput, fr_int, rf_int, m_double_framerate); 2090 videoOutput, GetPlaySettings(), 2091 fr_int, rf_int, m_double_framerate); 2096 2092 2097 2093 // Make sure video sync can do it 2098 2094 if (videosync != NULL && m_double_framerate) … … void MythPlayer::InitialSeek(void) 2475 2471 if (bookmarkseek > 30) 2476 2472 { 2477 2473 DoFastForward(bookmarkseek, true, false); 2478 if ( gCoreContext->GetNumSetting("ClearSavedPosition", 1) &&2474 if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) && 2479 2475 !player_ctx->IsPIP()) 2480 2476 { 2481 2477 ClearBookmark(false); … … void MythPlayer::EventLoop(void) 2703 2699 { 2704 2700 if (jumpto == totalFrames) 2705 2701 { 2706 if (!( gCoreContext->GetNumSetting("EndOfRecordingExitPrompt") == 12702 if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1 2707 2703 && !player_ctx->IsPIP() && 2708 2704 player_ctx->GetState() == kState_WatchingPreRecorded)) 2709 2705 { … … PIPLocation MythPlayer::GetNextPIPLocation(void) const 2996 2992 return kPIP_END; 2997 2993 2998 2994 if (pip_players.isEmpty()) 2999 return (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft); 2995 return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation", 2996 kPIPTopLeft); 3000 2997 3001 2998 // order of preference, could be stored in db if we want it configurable 3002 2999 PIPLocation ols[] = … … void MythPlayer::SetPlayerInfo(TV *tv, QWidget *widget, 3502 3499 exactseeks = frame_exact_seek; 3503 3500 player_ctx = ctx; 3504 3501 livetv = ctx->tvchain; 3502 3503 vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", "")); 3504 3505 // Playback (output) zoom control 3506 detect_letter_box = new DetectLetterbox(this); 3507 3508 decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0); 3509 itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0); 3510 db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1); 3505 3511 } 3506 3512 3507 3513 bool MythPlayer::EnableEdit(void) -
mythtv/libs/libmythtv/mythplayer.h
diff --git a/mythtv/libs/libmythtv/mythplayer.h b/mythtv/libs/libmythtv/mythplayer.h index 3229f4a..f1de3a4 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 82a6382..22346b2 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, 398 400 WId embedwinid, const QRect *embedbounds, 399 401 bool muted) 400 402 { 401 int exact_seeking = gCoreContext->GetNumSetting("ExactSeeking", 0);403 int exact_seeking = settings->GetNumSetting("ExactSeeking", 0); 402 404 403 405 if (HasPlayer()) 404 406 { … … bool PlayerContext::CreatePlayer(TV *tv, QWidget *widget, 441 443 { 442 444 QString subfn = buffer->GetSubtitleFilename(); 443 445 if (!subfn.isEmpty() && player->GetSubReader()) 444 player->GetSubReader()->LoadExternalSubtitles(subfn );446 player->GetSubReader()->LoadExternalSubtitles(subfn, settings); 445 447 } 446 448 447 449 if ((embedwinid > 0) && embedbounds) … … void PlayerContext::SetRingBuffer(RingBuffer *buf) 888 890 /** 889 891 * \brief assign programinfo to the context 890 892 */ 891 void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 893 void PlayerContext::SetPlayingInfo(const ProgramInfo *info, 894 PlaySettings *_settings) 892 895 { 893 896 bool ignoreDB = gCoreContext->IsDatabaseIgnored(); 894 897 … … void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 900 903 playingInfo->MarkAsInUse(false, recUsage); 901 904 delete playingInfo; 902 905 playingInfo = NULL; 906 // XXX delete settings? 903 907 } 904 908 905 909 if (info) … … void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 908 912 if (!ignoreDB) 909 913 playingInfo->MarkAsInUse(true, recUsage); 910 914 playingLen = playingInfo->GetSecondsInRecording(); 915 settings = (_settings ? _settings : 916 new PlaySettings(playingInfo->GetPlaybackGroup())); 911 917 } 912 918 } 913 919 -
mythtv/libs/libmythtv/playercontext.h
diff --git a/mythtv/libs/libmythtv/playercontext.h b/mythtv/libs/libmythtv/playercontext.h index b4766e7..8a9a79f 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 114 115 void SetRecorder(RemoteEncoder *rec); 115 116 void SetTVChain(LiveTVChain *chain); 116 117 void SetRingBuffer(RingBuffer *buf); 117 void SetPlayingInfo(const ProgramInfo *info );118 void SetPlayingInfo(const ProgramInfo *info, PlaySettings *settings=NULL); 118 119 void SetPlayGroup(const QString &group); 119 120 void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state); 120 121 void SetPIPLocation(int loc) { pipLocation = loc; } … … class MPUBLIC PlayerContext 171 172 LiveTVChain *tvchain; 172 173 RingBuffer *buffer; 173 174 ProgramInfo *playingInfo; ///< Currently playing info 175 PlaySettings *settings; // corresponding to playingInfo 174 176 long long playingLen; ///< Initial CalculateLength() 175 177 AVSpecialDecode specialDecode; 176 178 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 7c54fdb..b7d3377 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) 2222 2227 QString msg = tr("%1 Settings") 2223 2228 .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup())); 2224 2229 ctx->UnlockPlayingInfo(__FILE__, __LINE__); 2225 if (count > 0) 2230 if (count > 0 && 2231 ctx->playingInfo->GetPlaybackGroup() != "Default" && 2232 ctx->playingInfo->GetPlaybackGroup() != "Videos") 2226 2233 SetOSDMessage(ctx, msg); 2227 2234 ITVRestart(ctx, false); 2228 2235 } -
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 39074d5..85b607f 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 125 127 static QString GetDecoderName(const QString &decoder); 126 128 static QString GetDecoderHelp(QString decoder = QString::null); 127 129 128 static QString GetDefaultProfileName(const QString &hostname); 130 static QString GetDefaultProfileName(const QString &hostname, 131 PlaySettings *settings); 129 132 static void SetDefaultProfileName(const QString &profilename, 130 133 const QString &hostname); 131 134 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 e143bee..c843b8f 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() : 342 345 monitor_sz(640,480), monitor_dim(400,300), 343 346 344 347 // OSD 345 osd_painter(NULL), osd_image(NULL) 348 osd_painter(NULL), osd_image(NULL), 349 settings(_settings) 346 350 347 351 { 348 352 bzero(&pip_tmp_image, sizeof(pip_tmp_image)); 349 db_display_dim = QSize( gCoreContext->GetNumSetting("DisplaySizeWidth", 0),350 gCoreContext->GetNumSetting("DisplaySizeHeight", 0));353 db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth", 0), 354 settings->GetNumSetting("DisplaySizeHeight", 0)); 351 355 352 356 db_aspectoverride = (AspectOverrideMode) 353 gCoreContext->GetNumSetting("AspectOverride", 0);357 settings->GetNumSetting("AspectOverride", 0); 354 358 db_adjustfill = (AdjustFillMode) 355 gCoreContext->GetNumSetting("AdjustFill", 0);359 settings->GetNumSetting("AdjustFill", 0); 356 360 db_letterbox_colour = (LetterBoxColour) 357 gCoreContext->GetNumSetting("LetterboxColour", 0);361 settings->GetNumSetting("LetterboxColour", 0); 358 362 359 363 if (!gCoreContext->IsDatabaseIgnored()) 360 db_vdisp_profile = new VideoDisplayProfile( );364 db_vdisp_profile = new VideoDisplayProfile(settings); 361 365 } 362 366 363 367 /** … … QString VideoOutput::GetFilters(void) const 433 437 return QString::null; 434 438 } 435 439 436 bool VideoOutput::IsPreferredRenderer(QSize video_size )440 bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings) 437 441 { 438 442 if (!db_vdisp_profile || (video_size == window.GetVideoDispDim())) 439 443 return true; 440 444 441 VideoDisplayProfile vdisp ;445 VideoDisplayProfile vdisp(settings); 442 446 vdisp.SetInput(video_size); 443 447 QString new_rend = vdisp.GetVideoRenderer(); 444 448 if (new_rend.isEmpty()) -
mythtv/libs/libmythtv/videooutbase.h
diff --git a/mythtv/libs/libmythtv/videooutbase.h b/mythtv/libs/libmythtv/videooutbase.h index 112e4f4..9a24f71 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 330 332 // OSD painter and surface 331 333 MythYUVAPainter *osd_painter; 332 334 MythImage *osd_image; 335 336 PlaySettings *settings; 333 337 }; 334 338 335 339 #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 300c073..8e7c6a0 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 } 41 134 42 static HostCheckBox *DecodeExtraAudio() 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 } 156 157 static Setting *DecodeExtraAudio(PlaySettings *settings) 43 158 { 44 HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");159 CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings); 45 160 gc->setLabel(QObject::tr("Extra audio buffering")); 46 161 gc->setValue(true); 47 162 gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing " … … static HostCheckBox *DecodeExtraAudio() 50 165 "effect on framegrabbers (MPEG-4/RTJPEG). MythTV will " 51 166 "keep extra audio data in its internal buffers to " 52 167 "workaround this bug.")); 53 return gc;168 return wrap(gc, settings); 54 169 } 55 170 56 static HostComboBox *PIPLocationComboBox()171 static Setting *PIPLocationComboBox(PlaySettings *settings) 57 172 { 58 HostComboBox *gc = new HostComboBox("PIPLocation");173 CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings); 59 174 gc->setLabel(QObject::tr("PIP video location")); 60 175 for (uint loc = 0; loc < kPIP_END; ++loc) 61 176 gc->addSelection(toString((PIPLocation) loc), QString::number(loc)); 62 177 gc->setHelpText(QObject::tr("Location of PIP Video window.")); 63 return gc;178 return wrap(gc, settings); 64 179 } 65 180 66 181 static HostComboBox *DisplayRecGroup() … … static HostCheckBox *PBBStartInTitle() 146 261 return gc; 147 262 } 148 263 149 static HostCheckBox *SmartForward()264 static Setting *SmartForward(PlaySettings *settings) 150 265 { 151 HostCheckBox *gc = new HostCheckBox("SmartForward");266 CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings); 152 267 gc->setLabel(QObject::tr("Smart fast forwarding")); 153 268 gc->setValue(false); 154 269 gc->setHelpText(QObject::tr("If enabled, then immediately after " 155 270 "rewinding, only skip forward the same amount as " 156 271 "skipping backwards.")); 157 return gc;272 return wrap(gc, settings); 158 273 } 159 274 160 static HostCheckBox *ExactSeeking()275 static Setting *ExactSeeking(PlaySettings *settings) 161 276 { 162 HostCheckBox *gc = new HostCheckBox("ExactSeeking");277 CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings); 163 278 gc->setLabel(QObject::tr("Seek to exact frame")); 164 279 gc->setValue(false); 165 280 gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but " 166 281 "slower.")); 167 return gc;282 return wrap(gc, settings); 168 283 } 169 284 170 285 static GlobalComboBox *CommercialSkipMethod() … … static GlobalCheckBox *CommFlagFast() 192 307 return gc; 193 308 } 194 309 195 static HostComboBox *AutoCommercialSkip()310 static Setting *AutoCommercialSkip(PlaySettings *settings) 196 311 { 197 HostComboBox *gc = new HostComboBox("AutoCommercialSkip");312 CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings); 198 313 gc->setLabel(QObject::tr("Automatically skip commercials")); 199 314 gc->addSelection(QObject::tr("Off"), "0"); 200 315 gc->addSelection(QObject::tr("Notify, but do not skip"), "2"); … … static HostComboBox *AutoCommercialSkip() 203 318 "have been flagged during automatic commercial detection " 204 319 "or by the mythcommflag program, or just notify that a " 205 320 "commercial has been detected.")); 206 return gc;321 return wrap(gc, settings); 207 322 } 208 323 209 324 static GlobalCheckBox *AutoCommercialFlag() … … static GlobalCheckBox *AggressiveCommDetect() 277 392 return bc; 278 393 } 279 394 280 static HostSpinBox *CommRewindAmount()395 static Setting *CommRewindAmount(PlaySettings *settings) 281 396 { 282 HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);397 CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false); 283 398 gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)")); 284 399 gs->setHelpText(QObject::tr("MythTV will automatically rewind " 285 400 "this many seconds after performing a commercial skip.")); 286 401 gs->setValue(0); 287 return gs;402 return wrap(gs, settings); 288 403 } 289 404 290 static HostSpinBox *CommNotifyAmount()405 static Setting *CommNotifyAmount(PlaySettings *settings) 291 406 { 292 HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);407 CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false); 293 408 gs->setLabel(QObject::tr("Commercial skip notify amount (secs)")); 294 409 gs->setHelpText(QObject::tr("MythTV will act like a commercial " 295 410 "begins this many seconds early. This can be useful " 296 411 "when commercial notification is used in place of " 297 412 "automatic skipping.")); 298 413 gs->setValue(0); 299 return gs;414 return wrap(gs, settings); 300 415 } 301 416 302 417 static GlobalSpinBox *MaximumCommercialSkip() … … void PlaybackProfileConfig::swap(int i, int j) 1098 1213 labels[j]->setValue(label_i); 1099 1214 } 1100 1215 1101 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) : 1216 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str, 1217 PlaySettings *settings) : 1102 1218 TriggeredConfigurationGroup(false, true, true, true, 1103 1219 false, false, true, true), grouptrigger(NULL) 1104 1220 { 1105 1221 setLabel(QObject::tr("Playback Profiles") + str); 1222 if (settings) 1223 setLabel(QObject::tr("Playback group settings for ") + 1224 settings->mGroupName + " - " + 1225 getLabel()); 1106 1226 1107 1227 QString host = gCoreContext->GetHostName(); 1108 1228 QStringList profiles = VideoDisplayProfile::GetProfiles(host); … … PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) : 1130 1250 profiles = VideoDisplayProfile::GetProfiles(host); 1131 1251 } 1132 1252 1133 QString profile = VideoDisplayProfile::GetDefaultProfileName(host );1253 QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings); 1134 1254 if (!profiles.contains(profile)) 1135 1255 { 1136 1256 profile = (profiles.contains("Normal")) ? "Normal" : profiles[0]; 1137 1257 VideoDisplayProfile::SetDefaultProfileName(profile, host); 1138 1258 } 1139 1259 1140 grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile"); 1260 CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings); 1261 grouptrigger = gs; 1141 1262 grouptrigger->setLabel(QObject::tr("Current Video Playback Profile")); 1142 1263 QStringList::const_iterator it; 1143 1264 for (it = profiles.begin(); it != profiles.end(); ++it) 1144 1265 grouptrigger->addSelection(ProgramInfo::i18n(*it), *it); 1266 if (settings) 1267 { 1268 addChild(wrap(grouptrigger, settings)); 1269 return; 1270 } 1145 1271 1146 1272 HorizontalConfigurationGroup *grp = 1147 1273 new HorizontalConfigurationGroup(false, false, true, true); … … static HostComboBox *PlayBoxEpisodeSort() 1274 1400 return gc; 1275 1401 } 1276 1402 1277 static HostSpinBox *FFRewReposTime()1403 static Setting *FFRewReposTime(PlaySettings *settings) 1278 1404 { 1279 HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);1405 CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false); 1280 1406 gs->setLabel(QObject::tr("Fast forward/rewind reposition amount")); 1281 1407 gs->setValue(100); 1282 1408 gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind " … … static HostSpinBox *FFRewReposTime() 1284 1410 "resuming normal playback. This " 1285 1411 "compensates for the reaction time between seeing " 1286 1412 "where to resume playback and actually exiting seeking.")); 1287 return gs;1413 return wrap(gs, settings); 1288 1414 } 1289 1415 1290 static HostCheckBox *FFRewReverse()1416 static Setting *FFRewReverse(PlaySettings *settings) 1291 1417 { 1292 HostCheckBox *gc = new HostCheckBox("FFRewReverse");1418 CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings); 1293 1419 gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind")); 1294 1420 gc->setValue(true); 1295 1421 gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key " … … static HostCheckBox *FFRewReverse() 1297 1423 "vice versa. If disabled, it will decrease the " 1298 1424 "current speed or switch to play mode if " 1299 1425 "the speed can't be decreased further.")); 1300 return gc;1426 return wrap(gc, settings); 1301 1427 } 1302 1428 1303 1429 static HostComboBox *MenuTheme() … … static HostComboBox __attribute__ ((unused)) *DecodeVBIFormat() 1334 1460 return gc; 1335 1461 } 1336 1462 1337 static HostSpinBox *OSDCC708TextZoomPercentage(void)1463 static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings) 1338 1464 { 1339 HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5); 1465 CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings, 1466 50, 200, 5, false); 1340 1467 gs->setLabel(QObject::tr("Subtitle text zoom percentage")); 1341 1468 gs->setValue(100); 1342 1469 gs->setHelpText(QObject::tr("Use this to enlarge or shrink text based subtitles.")); 1343 1470 1344 return gs;1471 return wrap(gs, settings); 1345 1472 } 1346 1473 1347 1474 static HostComboBox *SubtitleFont() … … static HostComboBox *SubtitleFont() 1361 1488 return hcb; 1362 1489 } 1363 1490 1364 static HostComboBox *SubtitleCodec()1491 static Setting *SubtitleCodec(PlaySettings *settings) 1365 1492 { 1366 HostComboBox *gc = new HostComboBox("SubtitleCodec");1493 CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings); 1367 1494 1368 1495 gc->setLabel(QObject::tr("Subtitle Codec")); 1369 1496 QList<QByteArray> list = QTextCodec::availableCodecs(); … … static HostComboBox *SubtitleCodec() 1373 1500 gc->addSelection(val, val, val.toLower() == "utf-8"); 1374 1501 } 1375 1502 1376 return gc;1503 return wrap(gc, settings); 1377 1504 } 1378 1505 1379 1506 static HostComboBox *ChannelOrdering() … … static HostComboBox *ChannelOrdering() 1385 1512 return gc; 1386 1513 } 1387 1514 1388 static HostSpinBox *VertScanPercentage()1515 static Setting *VertScanPercentage(PlaySettings *settings) 1389 1516 { 1390 HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1); 1517 CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings, 1518 -100, 100, 1, false); 1391 1519 gs->setLabel(QObject::tr("Vertical scaling")); 1392 1520 gs->setValue(0); 1393 1521 gs->setHelpText(QObject::tr( 1394 1522 "Adjust this if the image does not fill your " 1395 1523 "screen vertically. Range -100% to 100%")); 1396 return gs;1524 return wrap(gs, settings); 1397 1525 } 1398 1526 1399 static HostSpinBox *HorizScanPercentage()1527 static Setting *HorizScanPercentage(PlaySettings *settings) 1400 1528 { 1401 HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1); 1529 CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings, 1530 -100, 100, 1, false); 1402 1531 gs->setLabel(QObject::tr("Horizontal scaling")); 1403 1532 gs->setValue(0); 1404 1533 gs->setHelpText(QObject::tr( 1405 1534 "Adjust this if the image does not fill your " 1406 1535 "screen horizontally. Range -100% to 100%")); 1407 return gs;1536 return wrap(gs, settings); 1408 1537 }; 1409 1538 1410 static HostSpinBox *XScanDisplacement()1539 static Setting *XScanDisplacement(PlaySettings *settings) 1411 1540 { 1412 HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1); 1541 CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings, 1542 -50, 50, 1, false); 1413 1543 gs->setLabel(QObject::tr("Scan displacement (X)")); 1414 1544 gs->setValue(0); 1415 1545 gs->setHelpText(QObject::tr("Adjust this to move the image horizontally.")); 1416 return gs;1546 return wrap(gs, settings); 1417 1547 } 1418 1548 1419 static HostSpinBox *YScanDisplacement()1549 static Setting *YScanDisplacement(PlaySettings *settings) 1420 1550 { 1421 HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1); 1551 CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings, 1552 -50, 50, 1, false); 1422 1553 gs->setLabel(QObject::tr("Scan displacement (Y)")); 1423 1554 gs->setValue(0); 1424 1555 gs->setHelpText(QObject::tr("Adjust this to move the image vertically.")); 1425 return gs;1556 return wrap(gs, settings); 1426 1557 }; 1427 1558 1428 static HostCheckBox *CCBackground()1559 static Setting *CCBackground(PlaySettings *settings) 1429 1560 { 1430 HostCheckBox *gc = new HostCheckBox("CCBackground");1561 CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings); 1431 1562 gc->setLabel(QObject::tr("Black background for closed captioning")); 1432 1563 gc->setValue(false); 1433 1564 gc->setHelpText(QObject::tr( 1434 1565 "If enabled, captions will be displayed " 1435 1566 "as white text over a black background " 1436 1567 "for better contrast.")); 1437 return gc;1568 return wrap(gc, settings); 1438 1569 } 1439 1570 1440 static HostCheckBox *DefaultCCMode()1571 static Setting *DefaultCCMode(PlaySettings *settings) 1441 1572 { 1442 HostCheckBox *gc = new HostCheckBox("DefaultCCMode");1573 CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings); 1443 1574 gc->setLabel(QObject::tr("Always display closed captioning or subtitles")); 1444 1575 gc->setValue(false); 1445 1576 gc->setHelpText(QObject::tr( … … static HostCheckBox *DefaultCCMode() 1447 1578 "when playing back recordings or watching " 1448 1579 "Live TV. Closed Captioning can be turned on or off " 1449 1580 "by pressing \"T\" during playback.")); 1450 return gc;1581 return wrap(gc, settings); 1451 1582 } 1452 1583 1453 static HostCheckBox *PreferCC708()1584 static Setting *PreferCC708(PlaySettings *settings) 1454 1585 { 1455 HostCheckBox *gc = new HostCheckBox("Prefer708Captions");1586 CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings); 1456 1587 gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions")); 1457 1588 gc->setValue(true); 1458 1589 gc->setHelpText( … … static HostCheckBox *PreferCC708() 1460 1591 "If enabled, the newer EIA-708 captions will be preferred over " 1461 1592 "the older EIA-608 captions in ATSC streams.")); 1462 1593 1463 return gc;1594 return wrap(gc, settings); 1464 1595 } 1465 1596 1466 static HostCheckBox *EnableMHEG()1597 static Setting *EnableMHEG(PlaySettings *settings) 1467 1598 { 1468 HostCheckBox *gc = new HostCheckBox("EnableMHEG");1599 CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings); 1469 1600 gc->setLabel(QObject::tr("Enable interactive TV")); 1470 1601 gc->setValue(false); 1471 1602 gc->setHelpText(QObject::tr( 1472 1603 "If enabled, interactive TV applications (MHEG) will " 1473 1604 "be activated. This is used for teletext and logos for " 1474 1605 "radio and channels that are currently off-air.")); 1475 return gc;1606 return wrap(gc, settings); 1476 1607 } 1477 1608 1478 static HostCheckBox *PersistentBrowseMode()1609 static Setting *PersistentBrowseMode(PlaySettings *settings) 1479 1610 { 1480 HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");1611 CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings); 1481 1612 gc->setLabel(QObject::tr("Always use browse mode in Live TV")); 1482 1613 gc->setValue(true); 1483 1614 gc->setHelpText( 1484 1615 QObject::tr( 1485 1616 "If enabled, browse mode will automatically be activated " 1486 1617 "whenever you use channel up/down while watching Live TV.")); 1487 return gc;1618 return wrap(gc, settings); 1488 1619 } 1489 1620 1490 static HostCheckBox *BrowseAllTuners()1621 static Setting *BrowseAllTuners(PlaySettings *settings) 1491 1622 { 1492 HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");1623 CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings); 1493 1624 gc->setLabel(QObject::tr("Browse all channels")); 1494 1625 gc->setValue(false); 1495 1626 gc->setHelpText( … … static HostCheckBox *BrowseAllTuners() 1497 1628 "If enabled, browse mode will shows channels on all " 1498 1629 "available recording devices, instead of showing " 1499 1630 "channels on just the current recorder.")); 1500 return gc;1631 return wrap(gc, settings); 1501 1632 } 1502 1633 1503 static HostCheckBox *ClearSavedPosition()1634 static Setting *ClearSavedPosition(PlaySettings *settings) 1504 1635 { 1505 HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");1636 CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings); 1506 1637 gc->setLabel(QObject::tr("Clear bookmark on playback")); 1507 1638 gc->setValue(true); 1508 1639 gc->setHelpText(QObject::tr("If enabled, automatically clear the " 1509 1640 "bookmark on a recording when the recording is played " 1510 1641 "back. If disabled, you can mark the beginning with " 1511 1642 "rewind then save position.")); 1512 return gc;1643 return wrap(gc, settings); 1513 1644 } 1514 1645 1515 static HostCheckBox *AltClearSavedPosition()1646 static Setting *AltClearSavedPosition(PlaySettings *settings) 1516 1647 { 1517 HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");1648 CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings); 1518 1649 gc->setLabel(QObject::tr("Alternate clear and save bookmark")); 1519 1650 gc->setValue(true); 1520 1651 gc->setHelpText(QObject::tr("During playback the SELECT key " … … static HostCheckBox *AltClearSavedPosition() 1522 1653 "Saved\" and \"Bookmark Cleared\". If disabled, the " 1523 1654 "SELECT key will save the current position for each " 1524 1655 "keypress.")); 1525 return gc;1656 return wrap(gc, settings); 1526 1657 } 1527 1658 1528 1659 // This currently does not work 1529 1660 /* 1530 static HostLineEdit *UDPNotifyPort()1661 static Setting *UDPNotifyPort(PlaySettings *settings) 1531 1662 { 1532 HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");1663 CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings); 1533 1664 ge->setLabel(QObject::tr("UDP notify port")); 1534 1665 ge->setValue("6948"); 1535 1666 ge->setHelpText(QObject::tr("During playback, MythTV will listen for " 1536 1667 "connections from the \"mythtvosd\" or \"mythudprelay\" " 1537 1668 "programs on this port. For additional information, see " 1538 1669 "http://www.mythtv.org/wiki/MythNotify .")); 1539 return ge;1670 return wrap(ge, settings); 1540 1671 } 1541 1672 */ 1542 1673 1543 static HostComboBox *PlaybackExitPrompt()1674 static Setting *PlaybackExitPrompt(PlaySettings *settings) 1544 1675 { 1545 HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");1676 CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings); 1546 1677 gc->setLabel(QObject::tr("Action on playback exit")); 1547 1678 gc->addSelection(QObject::tr("Just exit"), "0"); 1548 1679 gc->addSelection(QObject::tr("Save position and exit"), "2"); … … static HostComboBox *PlaybackExitPrompt() 1553 1684 "when you exit playback mode. The options available will " 1554 1685 "allow you to save your position, delete the " 1555 1686 "recording, or continue watching.")); 1556 return gc;1687 return wrap(gc, settings); 1557 1688 } 1558 1689 1559 static HostCheckBox *EndOfRecordingExitPrompt()1690 static Setting *EndOfRecordingExitPrompt(PlaySettings *settings) 1560 1691 { 1561 HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");1692 CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings); 1562 1693 gc->setLabel(QObject::tr("Prompt at end of recording")); 1563 1694 gc->setValue(false); 1564 1695 gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing " 1565 1696 "you to delete the recording when it has finished " 1566 1697 "playing.")); 1567 return gc;1698 return wrap(gc, settings); 1568 1699 } 1569 1700 1570 static HostCheckBox *JumpToProgramOSD()1701 static Setting *JumpToProgramOSD(PlaySettings *settings) 1571 1702 { 1572 HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");1703 CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings); 1573 1704 gc->setLabel(QObject::tr("Jump to program OSD")); 1574 1705 gc->setValue(true); 1575 1706 gc->setHelpText(QObject::tr( … … static HostCheckBox *JumpToProgramOSD() 1578 1709 "'Watch Recording' screen when 'Jump to Program' " 1579 1710 "is activated. If enabled, the recordings are shown " 1580 1711 "in the OSD")); 1581 return gc;1712 return wrap(gc, settings); 1582 1713 } 1583 1714 1584 static HostCheckBox *ContinueEmbeddedTVPlay()1715 static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings) 1585 1716 { 1586 HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");1717 CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings); 1587 1718 gc->setLabel(QObject::tr("Continue playback when embedded")); 1588 1719 gc->setValue(false); 1589 1720 gc->setHelpText(QObject::tr( … … static HostCheckBox *ContinueEmbeddedTVPlay() 1591 1722 "is embedded in the upcoming program list or recorded " 1592 1723 "list. The default is to pause the recorded show when " 1593 1724 "embedded.")); 1594 return gc;1725 return wrap(gc, settings); 1595 1726 } 1596 1727 1597 static HostCheckBox *AutomaticSetWatched()1728 static Setting *AutomaticSetWatched(PlaySettings *settings) 1598 1729 { 1599 HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");1730 CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings); 1600 1731 gc->setLabel(QObject::tr("Automatically mark a recording as watched")); 1601 1732 gc->setValue(false); 1602 1733 gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a " … … static HostCheckBox *AutomaticSetWatched() 1604 1735 "detection is not foolproof, so do not enable this " 1605 1736 "setting if you don't want an unwatched recording marked " 1606 1737 "as watched.")); 1607 return gc;1738 return wrap(gc, settings); 1608 1739 } 1609 1740 1610 1741 static HostSpinBox *LiveTVIdleTimeout() … … static HostComboBox *XineramaMonitorAspectRatio() 1794 1925 return gc; 1795 1926 } 1796 1927 1797 static HostComboBox *LetterboxingColour()1928 static Setting *LetterboxingColour(PlaySettings *settings) 1798 1929 { 1799 HostComboBox *gc = new HostComboBox("LetterboxColour");1930 CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings); 1800 1931 gc->setLabel(QObject::tr("Letterboxing color")); 1801 1932 for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m) 1802 1933 gc->addSelection(toString((LetterBoxColour)m), QString::number(m)); … … static HostComboBox *LetterboxingColour() 1806 1937 "letterboxing, but those with plasma screens may prefer gray " 1807 1938 "to minimize burn-in.") + " " + 1808 1939 QObject::tr("Currently only works with XVideo video renderer.")); 1809 return gc;1940 return wrap(gc, settings); 1810 1941 } 1811 1942 1812 static HostComboBox *AspectOverride()1943 static Setting *AspectOverride(PlaySettings *settings) 1813 1944 { 1814 HostComboBox *gc = new HostComboBox("AspectOverride");1945 CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings); 1815 1946 gc->setLabel(QObject::tr("Video aspect override")); 1816 1947 for (int m = kAspect_Off; m < kAspect_END; ++m) 1817 1948 gc->addSelection(toString((AspectOverrideMode)m), QString::number(m)); … … static HostComboBox *AspectOverride() 1819 1950 "When enabled, these will override the aspect " 1820 1951 "ratio specified by any broadcaster for all " 1821 1952 "video streams.")); 1822 return gc;1953 return wrap(gc, settings); 1823 1954 } 1824 1955 1825 static HostComboBox *AdjustFill()1956 static Setting *AdjustFill(PlaySettings *settings) 1826 1957 { 1827 HostComboBox *gc = new HostComboBox("AdjustFill");1958 CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings); 1828 1959 gc->setLabel(QObject::tr("Zoom")); 1829 1960 gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff), 1830 1961 QString::number(kAdjustFill_AutoDetect_DefaultOff)); … … static HostComboBox *AdjustFill() 1835 1966 gc->setHelpText(QObject::tr( 1836 1967 "When enabled, these will apply a predefined " 1837 1968 "zoom to all video playback in MythTV.")); 1838 return gc;1969 return wrap(gc, settings); 1839 1970 } 1840 1971 1841 1972 // Theme settings … … static HostSpinBox *NetworkControlPort() 2730 2861 return gs; 2731 2862 } 2732 2863 2733 static HostCheckBox *RealtimePriority()2864 static Setting *RealtimePriority(PlaySettings *settings) 2734 2865 { 2735 HostCheckBox *gc = new HostCheckBox("RealtimePriority");2866 CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings); 2736 2867 gc->setLabel(QObject::tr("Enable realtime priority threads")); 2737 2868 gc->setHelpText(QObject::tr("When running mythfrontend with root " 2738 2869 "privileges, some threads can be given enhanced priority. " 2739 2870 "Disable this if mythfrontend freezes during video " 2740 2871 "playback.")); 2741 2872 gc->setValue(true); 2742 return gc;2873 return wrap(gc, settings, false); 2743 2874 } 2744 2875 2745 2876 static HostCheckBox *EnableMediaMon() … … class WatchListSettings : public TriggeredConfigurationGroup 2896 3027 2897 3028 #ifdef USING_OPENGL_VSYNC 2898 3029 /* 2899 static HostCheckBox *UseOpenGLVSync()3030 static Setting *UseOpenGLVSync(PlaySettings *settings) 2900 3031 { 2901 HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");3032 CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings); 2902 3033 gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing")); 2903 3034 gc->setValue(false); 2904 3035 gc->setHelpText(QObject::tr( 2905 3036 "If supported by your hardware/drivers, " 2906 3037 "MythTV will use OpenGL vertical syncing for " 2907 3038 "video timing, reducing frame jitter.")); 2908 return gc;3039 return wrap(gc, settings); 2909 3040 } 2910 3041 */ 2911 3042 #endif … … static HostCheckBox *WatchTVGuide() 3332 3463 return gc; 3333 3464 } 3334 3465 3335 MainGeneralSettings::MainGeneralSettings() 3466 MainGeneralSettings::MainGeneralSettings(PlaySettings *settings, 3467 ConfigurationWizard *base) 3336 3468 { 3469 if (!settings) 3470 { 3337 3471 DatabaseSettings::addDatabaseSettings(this); 3338 3472 3339 3473 VerticalConfigurationGroup *pin = … … MainGeneralSettings::MainGeneralSettings() 3381 3515 remotecontrol->addChild(NetworkControlEnabled()); 3382 3516 remotecontrol->addChild(NetworkControlPort()); 3383 3517 addChild(remotecontrol); 3518 } 3384 3519 } 3385 3520 3386 PlaybackSettings::PlaybackSettings() 3521 PlaybackSettings::PlaybackSettings(PlaySettings *settings, 3522 ConfigurationWizard *base) 3387 3523 { 3388 3524 uint i = 0, total = 8; 3389 3525 #if CONFIG_DARWIN 3390 3526 total += 2; 3391 3527 #endif // USING_DARWIN 3528 if (settings) 3529 total -= 3; 3392 3530 3393 3531 3394 3532 VerticalConfigurationGroup* general1 = 3395 3533 new VerticalConfigurationGroup(false); 3396 3534 general1->setLabel(QObject::tr("General Playback") + 3397 3535 QString(" (%1/%2)").arg(++i).arg(total)); 3536 if (settings) 3537 general1->setLabel(QObject::tr("Playback group settings for ") + 3538 settings->mGroupName + " - " + 3539 general1->getLabel()); 3398 3540 3399 3541 HorizontalConfigurationGroup *columns = 3400 3542 new HorizontalConfigurationGroup(false, false, true, true); 3401 3543 3402 3544 VerticalConfigurationGroup *column1 = 3403 3545 new VerticalConfigurationGroup(false, false, true, true); 3404 column1->addChild(RealtimePriority()); 3405 column1->addChild(DecodeExtraAudio()); 3406 column1->addChild(JumpToProgramOSD()); 3546 if (!settings) 3547 column1->addChild(RealtimePriority(settings)); 3548 column1->addChild(DecodeExtraAudio(settings)); 3549 column1->addChild(JumpToProgramOSD(settings)); 3407 3550 columns->addChild(column1); 3408 3551 3409 3552 VerticalConfigurationGroup *column2 = 3410 3553 new VerticalConfigurationGroup(false, false, true, true); 3411 column2->addChild(ClearSavedPosition( ));3412 column2->addChild(AltClearSavedPosition( ));3413 column2->addChild(AutomaticSetWatched( ));3414 column2->addChild(ContinueEmbeddedTVPlay( ));3554 column2->addChild(ClearSavedPosition(settings)); 3555 column2->addChild(AltClearSavedPosition(settings)); 3556 column2->addChild(AutomaticSetWatched(settings)); 3557 column2->addChild(ContinueEmbeddedTVPlay(settings)); 3415 3558 columns->addChild(column2); 3416 3559 3417 3560 general1->addChild(columns); 3418 general1->addChild(LiveTVIdleTimeout()); 3561 if (!settings) 3562 general1->addChild(LiveTVIdleTimeout()); 3419 3563 #ifdef USING_OPENGL_VSYNC 3420 //general1->addChild(UseOpenGLVSync( ));3564 //general1->addChild(UseOpenGLVSync(settings)); 3421 3565 #endif // USING_OPENGL_VSYNC 3422 addChild(general1); 3566 if (base) 3567 base->addChild(general1); 3568 else 3569 addChild(general1); 3423 3570 3424 3571 VerticalConfigurationGroup* general2 = 3425 3572 new VerticalConfigurationGroup(false); 3426 3573 general2->setLabel(QObject::tr("General Playback") + 3427 3574 QString(" (%1/%2)").arg(++i).arg(total)); 3575 if (settings) 3576 general2->setLabel(QObject::tr("Playback group settings for ") + 3577 settings->mGroupName + " - " + 3578 general2->getLabel()); 3428 3579 3429 3580 HorizontalConfigurationGroup* oscan = 3430 3581 new HorizontalConfigurationGroup(false, false, true, true); … … PlaybackSettings::PlaybackSettings() 3432 3583 new VerticalConfigurationGroup(false, false, true, true); 3433 3584 VerticalConfigurationGroup *ocol2 = 3434 3585 new VerticalConfigurationGroup(false, false, true, true); 3435 ocol1->addChild(VertScanPercentage( ));3436 ocol1->addChild(YScanDisplacement( ));3437 ocol2->addChild(HorizScanPercentage( ));3438 ocol2->addChild(XScanDisplacement( ));3586 ocol1->addChild(VertScanPercentage(settings)); 3587 ocol1->addChild(YScanDisplacement(settings)); 3588 ocol2->addChild(HorizScanPercentage(settings)); 3589 ocol2->addChild(XScanDisplacement(settings)); 3439 3590 oscan->addChild(ocol1); 3440 3591 oscan->addChild(ocol2); 3441 3592 3442 3593 HorizontalConfigurationGroup* aspect_fill = 3443 3594 new HorizontalConfigurationGroup(false, false, true, true); 3444 aspect_fill->addChild(AspectOverride( ));3445 aspect_fill->addChild(AdjustFill( ));3595 aspect_fill->addChild(AspectOverride(settings)); 3596 aspect_fill->addChild(AdjustFill(settings)); 3446 3597 3447 3598 general2->addChild(oscan); 3448 3599 general2->addChild(aspect_fill); 3449 general2->addChild(LetterboxingColour()); 3450 general2->addChild(PIPLocationComboBox()); 3451 general2->addChild(PlaybackExitPrompt()); 3452 general2->addChild(EndOfRecordingExitPrompt()); 3453 addChild(general2); 3600 general2->addChild(LetterboxingColour(settings)); 3601 general2->addChild(PIPLocationComboBox(settings)); 3602 general2->addChild(PlaybackExitPrompt(settings)); 3603 general2->addChild(EndOfRecordingExitPrompt(settings)); 3604 if (base) 3605 base->addChild(general2); 3606 else 3607 addChild(general2); 3454 3608 3455 3609 QString tmp = QString(" (%1/%2)").arg(++i).arg(total); 3456 addChild(new PlaybackProfileConfigs(tmp)); 3610 if (base) 3611 base->addChild(new PlaybackProfileConfigs(tmp, settings)); 3612 else 3613 addChild(new PlaybackProfileConfigs(tmp, settings)); 3457 3614 3615 if (!settings) 3616 { 3458 3617 VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false); 3459 3618 pbox->setLabel(QObject::tr("View Recordings") + 3460 3619 QString(" (%1/%2)").arg(++i).arg(total)); … … PlaybackSettings::PlaybackSettings() 3481 3640 pbox3->addChild(DisplayGroupTitleSort()); 3482 3641 pbox3->addChild(new WatchListSettings()); 3483 3642 addChild(pbox3); 3643 } 3484 3644 3485 3645 VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false); 3486 3646 seek->setLabel(QObject::tr("Seeking") + 3487 3647 QString(" (%1/%2)").arg(++i).arg(total)); 3488 seek->addChild(SmartForward()); 3489 seek->addChild(FFRewReposTime()); 3490 seek->addChild(FFRewReverse()); 3491 seek->addChild(ExactSeeking()); 3492 addChild(seek); 3648 if (settings) 3649 seek->setLabel(QObject::tr("Playback group settings for ") + 3650 settings->mGroupName + " - " + 3651 seek->getLabel()); 3652 seek->addChild(SmartForward(settings)); 3653 seek->addChild(FFRewReposTime(settings)); 3654 seek->addChild(FFRewReverse(settings)); 3655 seek->addChild(ExactSeeking(settings)); 3656 if (base) 3657 base->addChild(seek); 3658 else 3659 addChild(seek); 3493 3660 3494 3661 VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false); 3495 3662 comms->setLabel(QObject::tr("Commercial Skip") + 3496 3663 QString(" (%1/%2)").arg(++i).arg(total)); 3497 comms->addChild(AutoCommercialSkip()); 3498 comms->addChild(CommRewindAmount()); 3499 comms->addChild(CommNotifyAmount()); 3664 if (settings) 3665 comms->setLabel(QObject::tr("Playback group settings for ") + 3666 settings->mGroupName + " - " + 3667 comms->getLabel()); 3668 comms->addChild(AutoCommercialSkip(settings)); 3669 comms->addChild(CommRewindAmount(settings)); 3670 comms->addChild(CommNotifyAmount(settings)); 3671 if (!settings) // these are global settings, not host-specific 3672 { 3500 3673 comms->addChild(MaximumCommercialSkip()); 3501 3674 comms->addChild(MergeShortCommBreaks()); 3502 addChild(comms); 3675 } 3676 if (base) 3677 base->addChild(comms); 3678 else 3679 addChild(comms); 3503 3680 3504 3681 #if CONFIG_DARWIN 3505 3682 VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false); 3506 3683 mac1->setLabel(QObject::tr("Mac OS X Video Settings") + 3507 3684 QString(" (%1/%2)").arg(++i).arg(total)); 3685 if (settings) 3686 mac1->setLabel(QObject::tr("Playback group settings for ") + 3687 settings->mGroupName + " - " + 3688 mac1->getLabel()); 3689 if (!settings) 3690 { 3508 3691 mac1->addChild(MacGammaCorrect()); 3509 3692 mac1->addChild(MacScaleUp()); 3510 3693 mac1->addChild(MacFullSkip()); 3511 addChild(mac1); 3694 } 3695 if (base) 3696 base->addChild(mac1); 3697 else 3698 addChild(mac1); 3512 3699 3513 3700 VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false); 3514 3701 mac2->setLabel(QObject::tr("Mac OS X Video Settings") + 3515 3702 QString(" (%1/%2)").arg(++i).arg(total)); 3703 if (settings) 3704 mac2->setLabel(QObject::tr("Playback group settings for ") + 3705 settings->mGroupName + " - " + 3706 mac2->getLabel()); 3707 if (!setings) 3708 { 3516 3709 mac2->addChild(new MacMainSettings()); 3517 3710 mac2->addChild(new MacFloatSettings()); 3518 3711 … … PlaybackSettings::PlaybackSettings() 3526 3719 #endif 3527 3720 } 3528 3721 3529 OSDSettings::OSDSettings() 3722 OSDSettings::OSDSettings(PlaySettings *settings, 3723 ConfigurationWizard *base) 3530 3724 { 3531 3725 VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false); 3532 3726 osd->setLabel(QObject::tr("On-screen Display")); 3727 if (settings) 3728 osd->setLabel(QObject::tr("Playback group settings for ") + 3729 settings->mGroupName + " - " + 3730 osd->getLabel()); 3533 3731 3534 osd->addChild(EnableMHEG()); 3535 osd->addChild(PersistentBrowseMode()); 3536 osd->addChild(BrowseAllTuners()); 3537 osd->addChild(CCBackground()); 3538 osd->addChild(DefaultCCMode()); 3539 osd->addChild(PreferCC708()); 3732 if (!settings) 3733 { 3734 osd->addChild(EnableMHEG(settings)); 3735 osd->addChild(PersistentBrowseMode(settings)); 3736 osd->addChild(BrowseAllTuners(settings)); 3737 } 3738 osd->addChild(CCBackground(settings)); 3739 osd->addChild(DefaultCCMode(settings)); 3740 osd->addChild(PreferCC708(settings)); 3741 if (!settings) 3540 3742 osd->addChild(SubtitleFont()); 3541 osd->addChild(OSDCC708TextZoomPercentage()); 3542 osd->addChild(SubtitleCodec()); 3543 //osd->addChild(UDPNotifyPort()); 3544 addChild(osd); 3743 osd->addChild(OSDCC708TextZoomPercentage(settings)); 3744 osd->addChild(SubtitleCodec(settings)); 3745 //osd->addChild(UDPNotifyPort(settings)); 3746 if (base) 3747 base->addChild(osd); 3748 else 3749 addChild(osd); 3545 3750 3546 3751 //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false); 3547 3752 //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 90cb98a..032d476 100644
a b 11 11 #include <QMutex> 12 12 13 13 class QFileInfo; 14 class PlaySettings; 14 15 15 16 class ThemeSelector : public HostImageSelect 16 17 { … … class ThemeSelector : public HostImageSelect 24 25 class PlaybackSettings : public ConfigurationWizard 25 26 { 26 27 public: 27 PlaybackSettings(); 28 PlaybackSettings(PlaySettings *settings=NULL, 29 ConfigurationWizard *base=NULL); 28 30 }; 29 31 30 32 class OSDSettings: virtual public ConfigurationWizard 31 33 { 32 34 public: 33 OSDSettings(); 35 OSDSettings(PlaySettings *settings=NULL, 36 ConfigurationWizard *base=NULL); 34 37 }; 35 38 36 39 class GeneralSettings : public ConfigurationWizard … … class AppearanceSettings : public ConfigurationWizard 54 57 class MainGeneralSettings : public ConfigurationWizard 55 58 { 56 59 public: 57 MainGeneralSettings(); 60 MainGeneralSettings(PlaySettings *settings=NULL, 61 ConfigurationWizard *base=NULL); 58 62 }; 59 63 60 64 class GeneralRecPrioritiesSettings : public ConfigurationWizard … … class PlaybackProfileConfigs : public TriggeredConfigurationGroup 142 146 Q_OBJECT 143 147 144 148 public: 145 PlaybackProfileConfigs(const QString &str );149 PlaybackProfileConfigs(const QString &str, PlaySettings *settings); 146 150 virtual ~PlaybackProfileConfigs(); 147 151 148 152 private: … … class PlaybackProfileConfigs : public TriggeredConfigurationGroup 154 158 155 159 private: 156 160 QStringList profiles; 157 HostComboBox*grouptrigger;161 ComboBoxSetting *grouptrigger; 158 162 }; 159 163 160 164 #endif -
mythtv/programs/mythfrontend/main.cpp
diff --git a/mythtv/programs/mythfrontend/main.cpp b/mythtv/programs/mythfrontend/main.cpp index bf4036f..726eb79 100644
a b using namespace std; 38 38 #include "audiogeneralsettings.h" 39 39 #include "profilegroup.h" 40 40 #include "playgroup.h" 41 #include "playsettings.h" 41 42 #include "networkcontrol.h" 42 43 #include "dvdringbuffer.h" 43 44 #include "scheduledrecording.h" … … static void showStatus(void) 482 483 delete statusbox; 483 484 } 484 485 486 ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 487 { 488 return new PlaybackSettings(settings, base); 489 } 490 491 ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 492 { 493 return new OSDSettings(settings, base); 494 } 495 496 ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 497 { 498 return new MainGeneralSettings(settings, base); 499 } 500 501 static PlayGroupEditor::SettingsLookup pbgroupSetup[] = { 502 createPlaybackSettingsForPlaybackGroup, 503 createOSDSettingsForPlaybackGroup, 504 createMainGeneralSettingsForPlaybackGroup 505 }; 506 485 507 static void TVMenuCallback(void *data, QString &selection) 486 508 { 487 509 (void)data; … … static void TVMenuCallback(void *data, QString &selection) 580 602 } 581 603 else if (sel == "settings playgroup") 582 604 { 583 PlayGroupEditor editor; 605 PlayGroupEditor editor(pbgroupSetup, 606 sizeof(pbgroupSetup)/sizeof(*pbgroupSetup)); 584 607 editor.exec(); 585 608 } 586 609 else if (sel == "settings general") … … static int internal_play_media(const QString &mrl, const QString &plot, 782 805 } 783 806 } 784 807 delete tmprbuf; 808 pginfo->SetPlaybackGroup("Videos"); 785 809 } 786 810 else if (pginfo->IsVideo()) 811 { 787 812 pos = pginfo->QueryBookmark(); 813 pginfo->SetPlaybackGroup("Videos"); 814 } 788 815 789 816 if (pos > 0) 790 817 {