Ticket #8088: 8088_playgroups_v26.patch
File 8088_playgroups_v26.patch, 112.9 KB (added by , 14 years ago) |
---|
-
mythtv/libs/libmyth/libmyth.pro
diff --git a/mythtv/libs/libmyth/libmyth.pro b/mythtv/libs/libmyth/libmyth.pro index bde661a..5b93129 100644
a b SOURCES += mythrssmanager.cpp netgrabbermanager.cpp 68 68 SOURCES += rssparse.cpp netutils.cpp 69 69 SOURCES += filesysteminfo.cpp 70 70 71 HEADERS += playsettings.h 72 SOURCES += playsettings.cpp 73 71 74 # remove when everything is switched to mythui 72 75 SOURCES += virtualkeyboard_qt.cpp 73 76 -
mythtv/libs/libmyth/mythconfiggroups.cpp
diff --git a/mythtv/libs/libmyth/mythconfiggroups.cpp b/mythtv/libs/libmyth/mythconfiggroups.cpp index 648c810..04bd5ca 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 df87fa5..bbd41e9 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 aa79763..bca42b2 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 9fe7516..625045e 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 3bceff4..991304e 100644
a b using namespace std; 37 37 #include "bdringbuffer.h" 38 38 #include "videodisplayprofile.h" 39 39 #include "mythuihelper.h" 40 #include "playsettings.h" 40 41 41 42 #include "lcddevice.h" 42 43 … … AvFormatDecoder::AvFormatDecoder(MythPlayer *parent, 317 318 318 319 cc608_build_parity_table(cc608_parity_table); 319 320 320 if ( gCoreContext->GetNumSetting("CCBackground", 0))321 if (GetPlayer()->GetPlaySettings()->GetNumSetting("CCBackground", 0)) 321 322 CC708Window::forceWhiteOnBlackText = true; 322 323 323 324 no_dts_hack = false; … … void AvFormatDecoder::InitVideoCodec(AVStream *stream, AVCodecContext *enc, 1260 1261 if (selectedStream) 1261 1262 { 1262 1263 directrendering = true; 1263 if (! gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&1264 if (!GetPlayer()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) && 1264 1265 !CODEC_IS_HWACCEL(codec, enc)) 1265 1266 { 1266 1267 SetLowBuffers(false); … … int AvFormatDecoder::ScanStreams(bool novideo) 1786 1787 1787 1788 if (!is_db_ignored) 1788 1789 { 1789 VideoDisplayProfile vdp ;1790 VideoDisplayProfile vdp(GetPlayer()->GetPlaySettings()); 1790 1791 vdp.SetInput(QSize(width, height)); 1791 1792 dec = vdp.GetDecoder(); 1792 1793 thread_count = vdp.GetMaxCPUs(); … … int AvFormatDecoder::ScanStreams(bool novideo) 1814 1815 MythCodecID vdpau_mcid; 1815 1816 vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec( 1816 1817 width, height, 1817 mpeg_version(enc->codec_id), no_hardware_decoders); 1818 mpeg_version(enc->codec_id), no_hardware_decoders, 1819 GetPlayer()->GetPlaySettings()); 1818 1820 1819 1821 if (vdpau_mcid >= video_codec_id) 1820 1822 { -
mythtv/libs/libmythtv/dbcheck.cpp
diff --git a/mythtv/libs/libmythtv/dbcheck.cpp b/mythtv/libs/libmythtv/dbcheck.cpp index daf4123..5b4424f 100644
a b NULL 3564 3564 3565 3565 VideoDisplayProfile::CreateNewProfiles(host); 3566 3566 profiles = VideoDisplayProfile::GetProfiles(host); 3567 QString profile = VideoDisplayProfile::GetDefaultProfileName(host); 3567 QString profile = 3568 VideoDisplayProfile::GetDefaultProfileName(host, NULL); 3568 3569 3569 3570 if (profiles.contains("Normal") && 3570 3571 (profile=="CPU++" || profile=="CPU+" || profile=="CPU--")) … … tmp.constData(), 6216 6217 " jump int(11) NOT NULL default '0'," 6217 6218 " PRIMARY KEY (`name`)" 6218 6219 ");", 6220 "CREATE TABLE playgroupsettings (" 6221 " playgroupname varchar(64) NOT NULL," 6222 " `value` varchar(128) NOT NULL," 6223 " `data` text," 6224 " overridden tinyint(1) NOT NULL," 6225 " PRIMARY KEY (playgroupname, `value`)" 6226 ");", 6219 6227 "CREATE TABLE powerpriority (" 6220 6228 " priorityname varchar(64) collate utf8_bin NOT NULL," 6221 6229 " 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 c374956..08bd08b 100644
a b using namespace std; 60 60 #include "mythimage.h" 61 61 #include "mythuiimage.h" 62 62 #include "mythlogging.h" 63 #include "playsettings.h" 63 64 64 65 extern "C" { 65 66 #include "vbitext/vbi.h" … … MythPlayer::MythPlayer(bool muted) 215 216 memset(&tc_wrap, 0, sizeof(tc_wrap)); 216 217 217 218 playerThread = QThread::currentThread(); 218 // Playback (output) zoom control219 detect_letter_box = new DetectLetterbox(this);220 221 vbimode = VBIMode::Parse(gCoreContext->GetSetting("VbiFormat"));222 223 219 defaultDisplayAspect = 224 220 gCoreContext->GetFloatSettingOnHost("XineramaMonitorAspectRatio", 225 221 gCoreContext->GetHostName(), 1.3333); 226 captionsEnabledbyDefault = gCoreContext->GetNumSetting("DefaultCCMode");227 decode_extra_audio = gCoreContext->GetNumSetting("DecodeExtraAudio", 0);228 itvEnabled = gCoreContext->GetNumSetting("EnableMHEG", 0);229 db_prefer708 = gCoreContext->GetNumSetting("Prefer708Captions", 1);230 clearSavedPosition = gCoreContext->GetNumSetting("ClearSavedPosition", 1);231 endExitPrompt = gCoreContext->GetNumSetting("EndOfRecordingExitPrompt");232 pip_default_loc = (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft);233 222 tc_wrap[TC_AUDIO] = gCoreContext->GetNumSetting("AudioSyncOffset", 0); 234 223 235 224 // Get VBI page number … … bool MythPlayer::InitVideo(void) 457 446 if (using_null_videoout && decoder) 458 447 { 459 448 MythCodecID codec = decoder->GetVideoCodecID(); 460 videoOutput = new VideoOutputNull( );449 videoOutput = new VideoOutputNull(GetPlaySettings()); 461 450 if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(), 462 451 video_aspect, 0, QRect(), codec)) 463 452 { … … bool MythPlayer::InitVideo(void) 506 495 decoder->GetVideoCodecPrivate(), 507 496 pipState, 508 497 video_disp_dim, video_aspect, 509 widget->winId(), display_rect, video_frame_rate );498 widget->winId(), display_rect, video_frame_rate, GetPlaySettings()); 510 499 } 511 500 512 501 if (videoOutput) … … void MythPlayer::ReinitOSD(void) 593 582 594 583 void MythPlayer::ReinitVideo(void) 595 584 { 596 if (!videoOutput->IsPreferredRenderer(video_disp_dim ))585 if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings())) 597 586 { 598 587 LOG(VB_PLAYBACK, LOG_INFO, LOC + "Need to switch video renderer."); 599 588 SetErrored(QObject::tr("Need to switch video renderer.")); … … void MythPlayer::VideoStart(void) 2160 2149 m_double_process = videoOutput->IsExtraProcessingRequired(); 2161 2150 2162 2151 videosync = VideoSync::BestMethod( 2163 videoOutput, (uint)fr_int, (uint)rf_int, m_double_framerate); 2152 videoOutput, GetPlaySettings(), 2153 (uint)fr_int, (uint)rf_int, m_double_framerate); 2164 2154 2165 2155 // Make sure video sync can do it 2166 2156 if (videosync != NULL && m_double_framerate) … … void MythPlayer::SetPlayerInfo(TV *tv, QWidget *widget, 3562 3552 player_ctx = ctx; 3563 3553 livetv = ctx->tvchain; 3554 3555 vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", "")); 3556 3557 // Playback (output) zoom control 3558 detect_letter_box = new DetectLetterbox(this); 3559 3560 captionsEnabledbyDefault = GetPlaySettings()->GetNumSetting("DefaultCCMode", 0); 3561 decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0); 3562 itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0); 3563 db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1); 3564 clearSavedPosition = GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1); 3565 endExitPrompt = GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0); 3566 pip_default_loc = (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation", kPIPTopLeft); 3564 3567 } 3565 3568 3566 3569 bool MythPlayer::EnableEdit(void) -
mythtv/libs/libmythtv/mythplayer.h
diff --git a/mythtv/libs/libmythtv/mythplayer.h b/mythtv/libs/libmythtv/mythplayer.h index b8b7244..166bac4 100644
a b class MTV_PUBLIC MythPlayer 177 177 QString GetXDS(const QString &key) const; 178 178 PIPLocation GetNextPIPLocation(void) const; 179 179 180 PlaySettings *GetPlaySettings(void) const { 181 return player_ctx ? player_ctx->settings : NULL; 182 } 183 180 184 // Bool Gets 181 185 bool IsPaused(void) { return allpaused; } 182 186 bool GetRawAudioState(void) const; -
mythtv/libs/libmythtv/playercontext.cpp
diff --git a/mythtv/libs/libmythtv/playercontext.cpp b/mythtv/libs/libmythtv/playercontext.cpp index 4acc16a..bff747b 100644
a b 17 17 #include "mythcorecontext.h" 18 18 #include "videometadatautil.h" 19 19 #include "mythlogging.h" 20 #include "DetectLetterbox.h" 21 #include "playsettings.h" 20 22 21 23 #define LOC QString("playCtx: ") 22 24 #define LOC_ERR QString("playCtx, Error: ") … … bool PlayerContext::CreatePlayer(TV *tv, QWidget *widget, 375 377 bool embed, const QRect &embedbounds, 376 378 bool muted) 377 379 { 378 int exact_seeking = gCoreContext->GetNumSetting("ExactSeeking", 0);380 int exact_seeking = settings->GetNumSetting("ExactSeeking", 0); 379 381 380 382 if (HasPlayer()) 381 383 { … … bool PlayerContext::CreatePlayer(TV *tv, QWidget *widget, 418 420 { 419 421 QString subfn = buffer->GetSubtitleFilename(); 420 422 if (!subfn.isEmpty() && player->GetSubReader()) 421 player->GetSubReader()->LoadExternalSubtitles(subfn );423 player->GetSubReader()->LoadExternalSubtitles(subfn, settings); 422 424 } 423 425 424 426 if (embed && !embedbounds.isNull()) … … void PlayerContext::SetRingBuffer(RingBuffer *buf) 839 841 /** 840 842 * \brief assign programinfo to the context 841 843 */ 842 void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 844 void PlayerContext::SetPlayingInfo(const ProgramInfo *info, 845 PlaySettings *_settings) 843 846 { 844 847 bool ignoreDB = gCoreContext->IsDatabaseIgnored(); 845 848 … … void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 851 854 playingInfo->MarkAsInUse(false, recUsage); 852 855 delete playingInfo; 853 856 playingInfo = NULL; 857 // XXX delete settings? 854 858 } 855 859 856 860 if (info) … … void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 859 863 if (!ignoreDB) 860 864 playingInfo->MarkAsInUse(true, recUsage); 861 865 playingLen = playingInfo->GetSecondsInRecording(); 866 settings = (_settings ? _settings : 867 new PlaySettings(playingInfo->GetPlaybackGroup())); 862 868 } 863 869 } 864 870 -
mythtv/libs/libmythtv/playercontext.h
diff --git a/mythtv/libs/libmythtv/playercontext.h b/mythtv/libs/libmythtv/playercontext.h index 6a6a767..fd2a0e7 100644
a b class ProgramInfo; 25 25 class LiveTVChain; 26 26 class MythDialog; 27 27 class QPainter; 28 class PlaySettings; 28 29 29 30 struct osdInfo 30 31 { … … class MTV_PUBLIC PlayerContext 96 97 void SetRecorder(RemoteEncoder *rec); 97 98 void SetTVChain(LiveTVChain *chain); 98 99 void SetRingBuffer(RingBuffer *buf); 99 void SetPlayingInfo(const ProgramInfo *info );100 void SetPlayingInfo(const ProgramInfo *info, PlaySettings *settings=NULL); 100 101 void SetPlayGroup(const QString &group); 101 102 void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state); 102 103 void SetPIPLocation(int loc) { pipLocation = loc; } … … class MTV_PUBLIC PlayerContext 153 154 LiveTVChain *tvchain; 154 155 RingBuffer *buffer; 155 156 ProgramInfo *playingInfo; ///< Currently playing info 157 PlaySettings *settings; // corresponding to playingInfo 156 158 long long playingLen; ///< Initial CalculateLength() 157 159 AVSpecialDecode specialDecode; 158 160 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 0eed2ae..785a730 100644
a b 7 7 #include "settings.h" 8 8 9 9 class ProgramInfo; 10 class PlaySettings; 10 11 11 12 class MTV_PUBLIC PlayGroup 12 13 { … … class MTV_PUBLIC PlayGroupEditor : public QObject, public ConfigurationDialog 23 24 Q_OBJECT 24 25 25 26 public: 26 PlayGroupEditor(void); 27 typedef ConfigurationWizard *(*SettingsLookup)(PlaySettings *settings, 28 ConfigurationWizard *base); 29 PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize); 27 30 virtual DialogCode exec(void); 28 31 virtual void Load(void); 29 32 virtual void Save(void) { } … … class MTV_PUBLIC PlayGroupEditor : public QObject, public ConfigurationDialog 38 41 protected: 39 42 ListBoxSetting *listbox; 40 43 QString lastValue; 44 SettingsLookup *getSettings; 45 int getSettingsSize; 41 46 }; 42 47 43 48 #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 60b90e2..8867532 100644
a b 8 8 #include "mythpainter.h" 9 9 #include "subtitlescreen.h" 10 10 #include "bdringbuffer.h" 11 #include "playsettings.h" 11 12 12 13 #define LOC QString("Subtitles: ") 13 14 #define LOC_WARN QString("Subtitles Warning: ") … … bool SubtitleScreen::Create(void) 80 81 LOG(VB_GENERAL, LOG_WARNING, LOC + "Failed to get CEA-608 reader."); 81 82 if (!m_708reader) 82 83 LOG(VB_GENERAL, LOG_WARNING, LOC + "Failed to get CEA-708 reader."); 83 m_useBackground = (bool) gCoreContext->GetNumSetting("CCBackground", 0);84 m_textFontZoom = gCoreContext->GetNumSetting("OSDCC708TextZoom", 100);84 m_useBackground = (bool)m_player->GetPlaySettings()->GetNumSetting("CCBackground", 0); 85 m_textFontZoom = m_player->GetPlaySettings()->GetNumSetting("OSDCC708TextZoom", 100); 85 86 return true; 86 87 } 87 88 -
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 8f9a23e..3802ba1 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 83 85 class TextSubtitleParser 84 86 { 85 87 public: 86 static bool LoadSubtitles(QString fileName, TextSubtitles &target); 88 static bool LoadSubtitles(QString fileName, TextSubtitles &target, 89 PlaySettings *settings); 87 90 }; 88 91 89 92 #endif -
mythtv/libs/libmythtv/tv_play.cpp
diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp index 83126f1..a4f5c50 100644
a b using namespace std; 58 58 #include "mythdirs.h" 59 59 #include "tvbrowsehelper.h" 60 60 #include "mythlogging.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 LOG(VB_PLAYBACK, LOG_INFO, 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) 779 782 /** \fn TV::TV(void) 780 783 * \sa Init(void) 781 784 */ 782 TV::TV( void)785 TV::TV(PlaySettings *settings) 783 786 : // Configuration variables from database 784 787 baseFilters(""), 785 788 db_channel_format("<num> <sign>"), … … TV::TV(void) 877 880 playerActive = 0; 878 881 playerLock.unlock(); 879 882 880 InitFromDB( );883 InitFromDB(settings); 881 884 882 885 LOG(VB_PLAYBACK, LOG_INFO, LOC + "Finished creating TV object"); 883 886 } 884 887 885 void TV::InitFromDB( void)888 void TV::InitFromDB(PlaySettings *settings) 886 889 { 887 890 QMap<QString,QString> kv; 888 891 kv["LiveTVIdleTimeout"] = "0"; … … void TV::InitFromDB(void) 928 931 kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]); 929 932 930 933 MythDB::getMythDB()->GetSettings(kv); 934 settings->AddToMap(kv); 931 935 932 936 QString db_time_format; 933 937 QString db_short_date_format; … … void TV::HandleOSDAskAllow(PlayerContext *ctx, QString action) 1685 1689 askAllowLock.unlock(); 1686 1690 } 1687 1691 1688 int TV::Playback(const ProgramInfo &rcinfo )1692 int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings) 1689 1693 { 1690 1694 wantsToQuit = false; 1691 1695 jumpToProgram = false; … … int TV::Playback(const ProgramInfo &rcinfo) 1699 1703 return 0; 1700 1704 } 1701 1705 1702 mctx->SetPlayingInfo(&rcinfo );1706 mctx->SetPlayingInfo(&rcinfo, settings); 1703 1707 mctx->SetInitialTVState(false); 1704 1708 HandleStateChange(mctx, mctx); 1705 1709 … … void TV::HandleStateChange(PlayerContext *mctx, PlayerContext *ctx) 2062 2066 QString msg = tr("%1 Settings") 2063 2067 .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup())); 2064 2068 ctx->UnlockPlayingInfo(__FILE__, __LINE__); 2065 if (count > 0) 2069 if (count > 0 && 2070 ctx->playingInfo->GetPlaybackGroup() != "Default" && 2071 ctx->playingInfo->GetPlaybackGroup() != "Videos") 2066 2072 SetOSDMessage(ctx, msg); 2067 2073 ITVRestart(ctx, false); 2068 2074 } -
mythtv/libs/libmythtv/tv_play.h
diff --git a/mythtv/libs/libmythtv/tv_play.h b/mythtv/libs/libmythtv/tv_play.h index 1a6264b..4137d97 100644
a b class OSDListTreeItemEnteredEvent; 59 59 class OSDListTreeItemSelectedEvent; 60 60 class TVBrowseHelper; 61 61 struct osdInfo; 62 class PlaySettings; 62 63 63 64 typedef QMap<QString,InfoMap> DDValueMap; 64 65 typedef QMap<QString,DDValueMap> DDKeyMap; … … class MTV_PUBLIC TV : public QObject 164 165 unsigned long seconds; 165 166 }; 166 167 167 TV( void);168 TV(PlaySettings *settings); 168 169 ~TV(); 169 170 170 void InitFromDB( void);171 void InitFromDB(PlaySettings *settings); 171 172 bool Init(bool createWindow = true); 172 173 173 174 // User input processing commands … … class MTV_PUBLIC TV : public QObject 192 193 193 194 // Recording commands 194 195 int PlayFromRecorder(int recordernum); 195 int Playback(const ProgramInfo &rcinfo );196 int Playback(const ProgramInfo &rcinfo, PlaySettings *settings); 196 197 197 198 // Commands used by frontend playback box 198 199 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 bb31bb0..35c6aaa 100644
a b using namespace std; 8 8 #include "mythlogging.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) 770 771 return list; 771 772 } 772 773 773 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname) 774 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname, 775 PlaySettings *settings) 774 776 { 775 777 QString tmp = 778 settings ? settings->GetSetting("DefaultVideoPlaybackProfile", "") : 776 779 gCoreContext->GetSettingOnHost("DefaultVideoPlaybackProfile", hostname); 777 780 778 781 QStringList profiles = GetProfiles(hostname); -
mythtv/libs/libmythtv/videodisplayprofile.h
diff --git a/mythtv/libs/libmythtv/videodisplayprofile.h b/mythtv/libs/libmythtv/videodisplayprofile.h index e71978b..b71b5ed 100644
a b using namespace std; 14 14 #include "mythtvexp.h" 15 15 #include "mythcontext.h" 16 16 17 class PlaySettings; 18 17 19 typedef QMap<QString,QString> pref_map_t; 18 20 typedef QMap<QString,QStringList> safe_map_t; 19 21 typedef QStringList safe_list_t; … … typedef vector<ProfileItem> item_list_t; 81 83 class MTV_PUBLIC VideoDisplayProfile 82 84 { 83 85 public: 84 VideoDisplayProfile( );86 VideoDisplayProfile(PlaySettings *settings); 85 87 ~VideoDisplayProfile(); 86 88 87 89 void SetInput(const QSize &size); … … class MTV_PUBLIC VideoDisplayProfile 126 128 static QString GetDecoderName(const QString &decoder); 127 129 static QString GetDecoderHelp(QString decoder = QString::null); 128 130 129 static QString GetDefaultProfileName(const QString &hostname); 131 static QString GetDefaultProfileName(const QString &hostname, 132 PlaySettings *settings); 130 133 static void SetDefaultProfileName(const QString &profilename, 131 134 const QString &hostname); 132 135 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 5a6f917..312ec51 100644
a b void VideoOutputD3D::GetRenderOptions(render_opts &opts, 56 56 #endif 57 57 } 58 58 59 VideoOutputD3D::VideoOutputD3D( void)60 : VideoOutput( ),m_lock(QMutex::Recursive),59 VideoOutputD3D::VideoOutputD3D(PlaySettigns *settings) 60 : VideoOutput(settings), m_lock(QMutex::Recursive), 61 61 m_hWnd(NULL), m_render(NULL), 62 62 m_video(NULL), 63 63 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 1dcff21..3c31774 100644
a b class VideoOutputD3D : public VideoOutput 16 16 { 17 17 public: 18 18 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 19 VideoOutputD3D( );19 VideoOutputD3D(PlaySettings *settings); 20 20 ~VideoOutputD3D(); 21 21 22 22 bool Init(int width, int height, float aspect, -
mythtv/libs/libmythtv/videoout_null.cpp
diff --git a/mythtv/libs/libmythtv/videoout_null.cpp b/mythtv/libs/libmythtv/videoout_null.cpp index 9d51f7c..c78b4b1 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 LOG(VB_PLAYBACK, LOG_INFO, "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 d7a6747..20a6a12 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, -
mythtv/libs/libmythtv/videoout_opengl.cpp
diff --git a/mythtv/libs/libmythtv/videoout_opengl.cpp b/mythtv/libs/libmythtv/videoout_opengl.cpp index 8d89a10..14a8d2b 100644
a b void VideoOutputOpenGL::GetRenderOptions(render_opts &opts, 38 38 opts.priorities->insert("opengl", 65); 39 39 } 40 40 41 VideoOutputOpenGL::VideoOutputOpenGL( )42 : VideoOutput( ),41 VideoOutputOpenGL::VideoOutputOpenGL(PlaySettings *settings) 42 : VideoOutput(settings), 43 43 gl_context_lock(QMutex::Recursive), gl_context(NULL), gl_valid(true), 44 44 gl_videochain(NULL), gl_pipchain_active(NULL), 45 45 gl_parent_win(0), gl_painter(NULL), gl_created_painter(false) -
mythtv/libs/libmythtv/videoout_opengl.h
diff --git a/mythtv/libs/libmythtv/videoout_opengl.h b/mythtv/libs/libmythtv/videoout_opengl.h index 7fce601..545c446 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, -
mythtv/libs/libmythtv/videoout_openglvaapi.cpp
diff --git a/mythtv/libs/libmythtv/videoout_openglvaapi.cpp b/mythtv/libs/libmythtv/videoout_openglvaapi.cpp index 92d8d0f..afc3b53 100644
a b void VideoOutputOpenGLVAAPI::GetRenderOptions(render_opts &opts) 25 25 opts.priorities->insert("openglvaapi", 120); 26 26 } 27 27 28 VideoOutputOpenGLVAAPI::VideoOutputOpenGLVAAPI( )29 : VideoOutputOpenGL( ), m_ctx(NULL), m_pauseBuffer(NULL)28 VideoOutputOpenGLVAAPI::VideoOutputOpenGLVAAPI(PlaySettings *settings) 29 : VideoOutputOpenGL(settings), m_ctx(NULL), m_pauseBuffer(NULL) 30 30 { 31 31 } 32 32 -
mythtv/libs/libmythtv/videoout_openglvaapi.h
diff --git a/mythtv/libs/libmythtv/videoout_openglvaapi.h b/mythtv/libs/libmythtv/videoout_openglvaapi.h index 2650095..915113d 100644
a b class VideoOutputOpenGLVAAPI : public VideoOutputOpenGL 10 10 public: 11 11 static void GetRenderOptions(render_opts &opts); 12 12 13 VideoOutputOpenGLVAAPI( );13 VideoOutputOpenGLVAAPI(PlaySettings *settings); 14 14 ~VideoOutputOpenGLVAAPI(); 15 15 16 16 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 85838d7..44fdb5b 100644
a b using namespace std; 66 66 #include "mythlogging.h" 67 67 #include "videodisplayprofile.h" 68 68 69 class PlaySettings; 70 69 71 #define LOC QString("VideoOutputQuartz::") 70 72 #define LOC_ERR QString("VideoOutputQuartz Error: ") 71 73 … … void VideoOutputQuartz::GetRenderOptions(render_opts &opts, 1107 1109 /** \class VideoOutputQuartz 1108 1110 * \brief Implementation of Quartz (Mac OS X windowing system) video output 1109 1111 */ 1110 VideoOutputQuartz::VideoOutputQuartz( ) :1111 VideoOutput( ), Started(false), data(new QuartzData())1112 VideoOutputQuartz::VideoOutputQuartz(PlaySettings *settings) : 1113 VideoOutput(settings), Started(false), data(new QuartzData()) 1112 1114 { 1113 1115 init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0); 1114 1116 } … … QStringList VideoOutputQuartz::GetAllowedRenderers( 1757 1759 MythCodecID VideoOutputQuartz::GetBestSupportedCodec( 1758 1760 uint width, uint height, 1759 1761 uint osd_width, uint osd_height, 1760 uint stream_type, uint fourcc )1762 uint stream_type, uint fourcc, PlaySettings *settings) 1761 1763 { 1762 1764 (void) osd_width; 1763 1765 (void) osd_height; 1764 1766 1765 VideoDisplayProfile vdp ;1767 VideoDisplayProfile vdp(settings); 1766 1768 vdp.SetInput(QSize(width, height)); 1767 1769 QString dec = vdp.GetDecoder(); 1768 1770 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 6b2a4ee..640fddf 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 51 52 static MythCodecID GetBestSupportedCodec( 52 53 uint width, uint height, 53 54 uint osd_width, uint osd_height, 54 uint stream_type, uint fourcc );55 uint stream_type, uint fourcc, PlaySettings *settings); 55 56 virtual bool NeedExtraAudioDecode(void) const 56 57 { return !codec_is_std(video_codec_id); } 57 58 -
mythtv/libs/libmythtv/videoout_vdpau.cpp
diff --git a/mythtv/libs/libmythtv/videoout_vdpau.cpp b/mythtv/libs/libmythtv/videoout_vdpau.cpp index fd10407..b2207ac 100644
a b void VideoOutputVDPAU::GetRenderOptions(render_opts &opts) 52 52 opts.deints->insert("vdpau", deints); 53 53 } 54 54 55 VideoOutputVDPAU::VideoOutputVDPAU( )56 : m_win(0),m_render(NULL),55 VideoOutputVDPAU::VideoOutputVDPAU(PlaySettings *settings) 56 : VideoOutput(settings), m_win(0), m_render(NULL), 57 57 m_decoder_buffer_size(MAX_REFERENCE_FRAMES), 58 58 m_process_buffer_size(DEF_PROCESS_BUFFER), m_pause_surface(0), 59 59 m_need_deintrefs(false), m_video_mixer(0), m_mixer_features(kVDPFeatNone), … … QStringList VideoOutputVDPAU::GetAllowedRenderers( 897 897 898 898 MythCodecID VideoOutputVDPAU::GetBestSupportedCodec( 899 899 uint width, uint height, 900 uint stream_type, bool no_acceleration )900 uint stream_type, bool no_acceleration, PlaySettings *settings) 901 901 { 902 902 bool use_cpu = no_acceleration; 903 VideoDisplayProfile vdp ;903 VideoDisplayProfile vdp(settings); 904 904 vdp.SetInput(QSize(width, height)); 905 905 QString dec = vdp.GetDecoder(); 906 906 -
mythtv/libs/libmythtv/videoout_vdpau.h
diff --git a/mythtv/libs/libmythtv/videoout_vdpau.h b/mythtv/libs/libmythtv/videoout_vdpau.h index 2404bb3..5de1064 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, 26 26 WId winid, const QRect &win_rect, MythCodecID codec_id); … … class VideoOutputVDPAU : public VideoOutput 53 53 const QSize &video_dim); 54 54 static MythCodecID GetBestSupportedCodec(uint width, uint height, 55 55 uint stream_type, 56 bool no_acceleration); 56 bool no_acceleration, 57 PlaySettings *settings); 57 58 virtual bool IsPIPSupported(void) const { return true; } 58 59 virtual bool IsPBPSupported(void) const { return false; } 59 60 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 345075a..8557538 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() 594 595 disp->StartLog(); 595 596 QString adaptor_name = QString::null; 596 597 const QSize video_dim = window.GetVideoDim(); 597 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), kCodec_MPEG2,598 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, kCodec_MPEG2, 598 599 video_dim.width(), video_dim.height(), 599 600 xv_set_defaults, &adaptor_name); 600 601 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 befbcdd..df0544b 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, … … class VideoOutputXv : public VideoOutput 81 81 static MythCodecID GetBestSupportedCodec(uint stream_type); 82 82 83 83 static int GrabSuitableXvPort(MythXDisplay* disp, Window root, 84 PlaySettings *settings, 84 85 MythCodecID type, 85 86 uint width, uint height, 86 87 bool &xvsetdefaults, -
mythtv/libs/libmythtv/videooutbase.cpp
diff --git a/mythtv/libs/libmythtv/videooutbase.cpp b/mythtv/libs/libmythtv/videooutbase.cpp index 162ad92..68fa831 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 "mythlogging.h" … … void VideoOutput::GetRenderOptions(render_opts &opts) 106 107 VideoOutput *VideoOutput::Create( 107 108 const QString &decoder, MythCodecID codec_id, void *codec_priv, 108 109 PIPState pipState, const QSize &video_dim, float video_aspect, 109 WId win_id, const QRect &display_rect, float video_prate )110 WId win_id, const QRect &display_rect, float video_prate, PlaySettings *settings) 110 111 { 111 112 (void) codec_priv; 112 113 … … VideoOutput *VideoOutput::Create( 151 152 QString renderer = QString::null; 152 153 if (renderers.size() > 0) 153 154 { 154 VideoDisplayProfile vprof ;155 VideoDisplayProfile vprof(settings); 155 156 vprof.SetInput(video_dim); 156 157 157 158 QString tmp = vprof.GetVideoRenderer(); … … VideoOutput *VideoOutput::Create( 179 180 180 181 #ifdef USING_MINGW 181 182 if (renderer == "direct3d") 182 vo = new VideoOutputD3D( );183 vo = new VideoOutputD3D(settings); 183 184 #endif // USING_MINGW 184 185 185 186 #ifdef USING_QUARTZ_VIDEO 186 187 if (osxlist.contains(renderer)) 187 vo = new VideoOutputQuartz( );188 vo = new VideoOutputQuartz(settings); 188 189 #endif // Q_OS_MACX 189 190 190 191 #ifdef USING_OPENGL_VIDEO 191 192 if (renderer == "opengl") 192 vo = new VideoOutputOpenGL( );193 vo = new VideoOutputOpenGL(settings); 193 194 #endif // USING_OPENGL_VIDEO 194 195 195 196 #ifdef USING_VDPAU 196 197 if (renderer == "vdpau") 197 vo = new VideoOutputVDPAU( );198 vo = new VideoOutputVDPAU(settings); 198 199 #endif // USING_VDPAU 199 200 200 201 #ifdef USING_VAAPI 201 202 if (renderer == "openglvaapi") 202 vo = new VideoOutputOpenGLVAAPI( );203 vo = new VideoOutputOpenGLVAAPI(settings); 203 204 #endif // USING_VAAPI 204 205 205 206 #ifdef USING_XV 206 207 if (xvlist.contains(renderer)) 207 vo = new VideoOutputXv( );208 vo = new VideoOutputXv(settings); 208 209 #endif // USING_XV 209 210 210 211 if (vo) … … VideoOutput *VideoOutput::Create( 300 301 * \brief This constructor for VideoOutput must be followed by an 301 302 * Init(int,int,float,WId,int,int,int,int,WId) call. 302 303 */ 303 VideoOutput::VideoOutput( ) :304 VideoOutput::VideoOutput(PlaySettings *_settings) : 304 305 // DB Settings 306 window(_settings), 305 307 db_display_dim(0,0), 306 308 db_aspectoverride(kAspect_Off), db_adjustfill(kAdjustFill_Off), 307 309 db_letterbox_colour(kLetterBoxColour_Black), … … VideoOutput::VideoOutput() : 340 342 osd_painter(NULL), osd_image(NULL), 341 343 342 344 // Visualisation 343 m_visual(NULL) 345 m_visual(NULL), 346 347 settings(_settings) 344 348 { 345 349 memset(&pip_tmp_image, 0, sizeof(pip_tmp_image)); 346 db_display_dim = QSize( gCoreContext->GetNumSetting("DisplaySizeWidth", 0),347 gCoreContext->GetNumSetting("DisplaySizeHeight", 0));350 db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth", 0), 351 settings->GetNumSetting("DisplaySizeHeight", 0)); 348 352 349 353 db_aspectoverride = (AspectOverrideMode) 350 gCoreContext->GetNumSetting("AspectOverride", 0);354 settings->GetNumSetting("AspectOverride", 0); 351 355 db_adjustfill = (AdjustFillMode) 352 gCoreContext->GetNumSetting("AdjustFill", 0);356 settings->GetNumSetting("AdjustFill", 0); 353 357 db_letterbox_colour = (LetterBoxColour) 354 gCoreContext->GetNumSetting("LetterboxColour", 0);358 settings->GetNumSetting("LetterboxColour", 0); 355 359 356 360 if (!gCoreContext->IsDatabaseIgnored()) 357 db_vdisp_profile = new VideoDisplayProfile( );361 db_vdisp_profile = new VideoDisplayProfile(settings); 358 362 } 359 363 360 364 /** … … QString VideoOutput::GetFilters(void) const 430 434 return QString::null; 431 435 } 432 436 433 bool VideoOutput::IsPreferredRenderer(QSize video_size )437 bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings) 434 438 { 435 439 if (!db_vdisp_profile || (video_size == window.GetVideoDispDim())) 436 440 return true; 437 441 438 VideoDisplayProfile vdisp ;442 VideoDisplayProfile vdisp(settings); 439 443 vdisp.SetInput(video_size); 440 444 QString new_rend = vdisp.GetVideoRenderer(); 441 445 if (new_rend.isEmpty()) -
mythtv/libs/libmythtv/videooutbase.h
diff --git a/mythtv/libs/libmythtv/videooutbase.h b/mythtv/libs/libmythtv/videooutbase.h index 334d08c..e03f03d 100644
a b class FilterChain; 36 36 class FilterManager; 37 37 class AudioPlayer; 38 38 class MythRender; 39 class PlaySettings; 39 40 40 41 typedef QMap<MythPlayer*,PIPLocation> PIPMap; 41 42 … … class VideoOutput 51 52 static VideoOutput *Create( 52 53 const QString &decoder, MythCodecID codec_id, void *codec_priv, 53 54 PIPState pipState, const QSize &video_dim, float video_aspect, 54 WId win_id, const QRect &display_rect, float video_prate );55 WId win_id, const QRect &display_rect, float video_prate, PlaySettings *settings); 55 56 56 VideoOutput( );57 VideoOutput(PlaySettings *settings); 57 58 virtual ~VideoOutput(); 58 59 59 60 virtual bool Init(int width, int height, float aspect, 60 61 WId winid, const QRect &win_rect, MythCodecID codec_id); 61 62 virtual void InitOSD(OSD *osd); 62 63 virtual void SetVideoFrameRate(float); 63 virtual bool IsPreferredRenderer(QSize video_size );64 virtual bool IsPreferredRenderer(QSize video_size, PlaySettings *settings); 64 65 virtual bool SetDeinterlacingEnabled(bool); 65 66 virtual bool SetupDeinterlace(bool i, const QString& ovrf=""); 66 67 virtual void FallbackDeint(void); … … class VideoOutput 333 334 334 335 // Visualisation 335 336 VideoVisual *m_visual; 337 338 PlaySettings *settings; 336 339 }; 337 340 338 341 #endif -
mythtv/libs/libmythtv/videooutwindow.cpp
diff --git a/mythtv/libs/libmythtv/videooutwindow.cpp b/mythtv/libs/libmythtv/videooutwindow.cpp index e5bf183..c7a79f6 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; 52 53 const float VideoOutWindow::kManualZoomMinVerticalZoom = 0.5f; 53 54 const int VideoOutWindow::kManualZoomMaxMove = 50; 54 55 55 VideoOutWindow::VideoOutWindow( ) :56 VideoOutWindow::VideoOutWindow(PlaySettings *_settings) : 56 57 // DB settings 57 58 db_move(0, 0), db_scale_horiz(0.0f), db_scale_vert(0.0f), 58 59 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) 635 638 if (change) 636 639 { 637 640 db_scale_vert = 638 gCoreContext->GetNumSetting("VertScanPercentage", 0) * 0.01f;641 settings->GetNumSetting("VertScanPercentage", 0) * 0.01f; 639 642 db_scale_horiz = 640 gCoreContext->GetNumSetting("HorizScanPercentage", 0) * 0.01f;643 settings->GetNumSetting("HorizScanPercentage", 0) * 0.01f; 641 644 db_scaling_allowed = true; 642 645 } 643 646 else -
mythtv/libs/libmythtv/videooutwindow.h
diff --git a/mythtv/libs/libmythtv/videooutwindow.h b/mythtv/libs/libmythtv/videooutwindow.h index 017eede..1a26adb 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 167 168 bool allowpreviewepg; 168 169 PIPState pip_state; 169 170 171 PlaySettings *settings; 172 170 173 // Constants 171 174 static const float kManualZoomMaxHorizontalZoom; 172 175 static const float kManualZoomMaxVerticalZoom; -
mythtv/libs/libmythtv/vsync.cpp
diff --git a/mythtv/libs/libmythtv/vsync.cpp b/mythtv/libs/libmythtv/vsync.cpp index 2c0a5df..5aa56f6 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; 74 75 * \brief Returns the most sophisticated video sync method available. 75 76 */ 76 77 VideoSync *VideoSync::BestMethod(VideoOutput *video_output, 78 PlaySettings *settings, 77 79 uint frame_interval, uint refresh_interval, 78 80 bool halve_frame_interval) 79 81 { -
mythtv/libs/libmythtv/vsync.h
diff --git a/mythtv/libs/libmythtv/vsync.h b/mythtv/libs/libmythtv/vsync.h index 5764ddc..0961292 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 784f68e..388d550 100644
a b using namespace std; 20 20 #include "compat.h" 21 21 #include "dbcheck.h" 22 22 #include "mythlogging.h" 23 #include "playsettings.h" 23 24 24 25 // libmythui 25 26 #include "mythuihelper.h" … … int main(int argc, char *argv[]) 122 123 123 124 GetMythUI()->LoadQtConfig(); 124 125 125 #if defined(Q_OS_MACX)126 // Mac OS X doesn't define the AudioOutputDevice setting127 #else128 QString auddevice = gCoreContext->GetSetting("AudioOutputDevice");129 if (auddevice.isEmpty())130 {131 LOG(VB_GENERAL, LOG_ERR, "Fatal Error: Audio not configured, you need "132 "to run 'mythfrontend', not 'mythtv'.");133 return GENERIC_EXIT_SETUP_ERROR;134 }135 #endif136 137 126 MythMainWindow *mainWindow = GetMythMainWindow(); 138 127 mainWindow->Init(); 139 128 … … int main(int argc, char *argv[]) 146 135 return GENERIC_EXIT_DB_OUTOFDATE; 147 136 } 148 137 149 TV *tv = new TV(); 138 QString playgroup(""); 139 if (!filename.isEmpty()) 140 { 141 ProgramInfo pg(filename); 142 playgroup = pg.GetPlaybackGroup(); 143 } 144 PlaySettings settings(playgroup); 145 146 #if defined(Q_OS_MACX) 147 // Mac OS X doesn't define the AudioOutputDevice setting 148 #else 149 QString auddevice = settings.GetSetting("AudioOutputDevice", ""); 150 if (auddevice.isEmpty()) 151 { 152 LOG(VB_GENERAL, LOG_ERR, "Fatal Error: Audio not configured, you need " 153 "to run 'mythfrontend', not 'mythtv'."); 154 return GENERIC_EXIT_SETUP_ERROR; 155 } 156 #endif 157 158 TV *tv = new TV(&settings); 150 159 if (!tv->Init()) 151 160 { 152 161 LOG(VB_GENERAL, LOG_ERR, "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 0763cc4..d0bb4bb 100644
a b 38 38 #include "mythconfig.h" 39 39 #include "mythdirs.h" 40 40 #include "mythuihelper.h" 41 #include "playsettings.h" 42 43 #define CREATE_CHECKBOX_SETTING(var, name, settings) \ 44 BooleanSetting *var; \ 45 if ((settings)) \ 46 var = new PlaySettingsCheckBox((name), (settings)); \ 47 else \ 48 var = new HostCheckBox((name)) 49 50 #define CREATE_COMBOBOX_SETTING(var, name, settings) \ 51 ComboBoxSetting *var; \ 52 if ((settings)) \ 53 var = new PlaySettingsComboBox((name), (settings)); \ 54 else \ 55 var = new HostComboBox((name)) 56 57 #define CREATE_COMBOBOX1_SETTING(var, name, settings, arg1) \ 58 ComboBoxSetting *var; \ 59 if ((settings)) \ 60 var = new PlaySettingsComboBox((name), (settings), (arg1)); \ 61 else \ 62 var = new HostComboBox((name), (arg1)) 63 64 #define CREATE_SPINBOX_SETTING(var, name, settings, arg1, arg2, arg3, arg4) \ 65 SpinBoxSetting *var; \ 66 if ((settings)) \ 67 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3), (arg4)); \ 68 else \ 69 var = new HostSpinBox((name), (arg1), (arg2), (arg3), (arg4)) 70 71 #define CREATE_LINEEDIT_SETTING(var, name, settings) \ 72 LineEditSetting *var; \ 73 if ((settings)) \ 74 var = new PlaySettingsLineEdit((name), (settings), ""); \ 75 else \ 76 var = new HostLineEdit((name)) 77 78 // For PlaySettings, use a SpinBox instead of a Slider so that a 79 // default value can be easily used. 80 #define CREATE_SLIDER_SETTING(var, name, settings, arg1, arg2, arg3) \ 81 BoundedIntegerSetting *var; \ 82 if ((settings)) \ 83 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3)); \ 84 else \ 85 var = new HostSlider((name), (arg1), (arg2), (arg3)) 86 87 #define CREATE_IMAGESELECT_SETTING(var, name, settings) \ 88 ImageSelectSetting *var; \ 89 if ((settings)) \ 90 var = new PlaySettingsImageSelect((name), (settings)); \ 91 else \ 92 var = new HostImageSelect((name)) 93 94 static Setting *wrap(Setting *obj, PlaySettings *settings, 95 bool twoLineLabel=false) 96 { 97 if (!settings) 98 return obj; 99 100 // Get the setting name 101 PlaySettingsCombinedStorage *storage = 102 dynamic_cast<PlaySettingsCombinedStorage *>(obj); 103 const QString &name = storage->getName(); 104 105 // Get the default value and label. The label is different 106 // from the value for most object types. 107 QString defaultValue = settings->GetSetting(name, "", true); 108 QString defaultLabel(defaultValue); 109 if (dynamic_cast<BooleanSetting *>(obj)) 110 defaultLabel = (defaultValue == "0" || defaultValue.isEmpty() ? 111 QObject::tr("disabled") : QObject::tr("enabled")); 112 if (dynamic_cast<SpinBoxSetting *>(obj) && defaultValue.isEmpty()) 113 defaultLabel = "0"; 114 ComboBoxSetting *cb = dynamic_cast<ComboBoxSetting *>(obj); 115 if (cb) 116 { 117 defaultLabel = cb->GetValueLabel(defaultValue); 118 // Add the default selection to a ComboBox 119 cb->addSelection(QString("(") + QObject::tr("default") + ")", 120 storage->getDefault(), 121 !settings->IsOverridden(name), 122 true); 123 } 124 ImageSelectSetting *is = dynamic_cast<ImageSelectSetting *>(obj); 125 if (is) 126 { 127 defaultLabel = is->GetValueLabel(defaultValue); 128 // Add the default selection to a ImageSelect 129 is->addDefaultSelection(QString("(") + QObject::tr("default") + ")", 130 storage->getDefault(), 131 defaultValue, 132 !settings->IsOverridden(name)); 133 } 134 135 // Change the help text to include the default and its source. 136 QString helpPrefix; 137 if (dynamic_cast<LineEditSetting *>(obj)) 138 helpPrefix = QObject::tr("Leave blank to keep default value"); 139 else 140 helpPrefix = QObject::tr("Override default value"); 141 helpPrefix += " (" + defaultLabel + ") "; 142 QString inheritsFrom = settings->InheritsFrom(name); 143 if (inheritsFrom.isNull()) 144 helpPrefix += QObject::tr("from global settings"); 145 else 146 helpPrefix += QObject::tr("from group") + " " + inheritsFrom; 147 helpPrefix += ". " + obj->getHelpText(); 148 obj->setHelpText(helpPrefix); 149 150 // Change the label to include the default. 151 obj->setLabel(obj->getLabel() + (twoLineLabel ? "\n" : "") + 152 " (" + defaultLabel + ")"); 41 153 42 static HostCheckBox *DecodeExtraAudio() 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 *AutoMetadataLookup() … … 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 MUNUSED *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 static HostComboBox *PlaybackExitPrompt()1659 static Setting *PlaybackExitPrompt(PlaySettings *settings) 1529 1660 { 1530 HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");1661 CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings); 1531 1662 gc->setLabel(QObject::tr("Action on playback exit")); 1532 1663 gc->addSelection(QObject::tr("Just exit"), "0"); 1533 1664 gc->addSelection(QObject::tr("Save position and exit"), "2"); … … static HostComboBox *PlaybackExitPrompt() 1538 1669 "when you exit playback mode. The options available will " 1539 1670 "allow you to save your position, delete the " 1540 1671 "recording, or continue watching.")); 1541 return gc;1672 return wrap(gc, settings); 1542 1673 } 1543 1674 1544 static HostCheckBox *EndOfRecordingExitPrompt()1675 static Setting *EndOfRecordingExitPrompt(PlaySettings *settings) 1545 1676 { 1546 HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");1677 CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings); 1547 1678 gc->setLabel(QObject::tr("Prompt at end of recording")); 1548 1679 gc->setValue(false); 1549 1680 gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing " 1550 1681 "you to delete the recording when it has finished " 1551 1682 "playing.")); 1552 return gc;1683 return wrap(gc, settings); 1553 1684 } 1554 1685 1555 static HostCheckBox *JumpToProgramOSD()1686 static Setting *JumpToProgramOSD(PlaySettings *settings) 1556 1687 { 1557 HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");1688 CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings); 1558 1689 gc->setLabel(QObject::tr("Jump to program OSD")); 1559 1690 gc->setValue(true); 1560 1691 gc->setHelpText(QObject::tr( … … static HostCheckBox *JumpToProgramOSD() 1563 1694 "'Watch Recording' screen when 'Jump to Program' " 1564 1695 "is activated. If enabled, the recordings are shown " 1565 1696 "in the OSD")); 1566 return gc;1697 return wrap(gc, settings); 1567 1698 } 1568 1699 1569 static HostCheckBox *ContinueEmbeddedTVPlay()1700 static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings) 1570 1701 { 1571 HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");1702 CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings); 1572 1703 gc->setLabel(QObject::tr("Continue playback when embedded")); 1573 1704 gc->setValue(false); 1574 1705 gc->setHelpText(QObject::tr( … … static HostCheckBox *ContinueEmbeddedTVPlay() 1576 1707 "is embedded in the upcoming program list or recorded " 1577 1708 "list. The default is to pause the recorded show when " 1578 1709 "embedded.")); 1579 return gc;1710 return wrap(gc, settings); 1580 1711 } 1581 1712 1582 static HostCheckBox *AutomaticSetWatched()1713 static Setting *AutomaticSetWatched(PlaySettings *settings) 1583 1714 { 1584 HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");1715 CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings); 1585 1716 gc->setLabel(QObject::tr("Automatically mark a recording as watched")); 1586 1717 gc->setValue(false); 1587 1718 gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a " … … static HostCheckBox *AutomaticSetWatched() 1589 1720 "detection is not foolproof, so do not enable this " 1590 1721 "setting if you don't want an unwatched recording marked " 1591 1722 "as watched.")); 1592 return gc;1723 return wrap(gc, settings); 1593 1724 } 1594 1725 1595 1726 static HostSpinBox *LiveTVIdleTimeout() … … static HostComboBox *XineramaMonitorAspectRatio() 1779 1910 return gc; 1780 1911 } 1781 1912 1782 static HostComboBox *LetterboxingColour()1913 static Setting *LetterboxingColour(PlaySettings *settings) 1783 1914 { 1784 HostComboBox *gc = new HostComboBox("LetterboxColour");1915 CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings); 1785 1916 gc->setLabel(QObject::tr("Letterboxing color")); 1786 1917 for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m) 1787 1918 gc->addSelection(toString((LetterBoxColour)m), QString::number(m)); … … static HostComboBox *LetterboxingColour() 1791 1922 "letterboxing, but those with plasma screens may prefer gray " 1792 1923 "to minimize burn-in.") + " " + 1793 1924 QObject::tr("Currently only works with XVideo video renderer.")); 1794 return gc;1925 return wrap(gc, settings); 1795 1926 } 1796 1927 1797 static HostComboBox *AspectOverride()1928 static Setting *AspectOverride(PlaySettings *settings) 1798 1929 { 1799 HostComboBox *gc = new HostComboBox("AspectOverride");1930 CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings); 1800 1931 gc->setLabel(QObject::tr("Video aspect override")); 1801 1932 for (int m = kAspect_Off; m < kAspect_END; ++m) 1802 1933 gc->addSelection(toString((AspectOverrideMode)m), QString::number(m)); … … static HostComboBox *AspectOverride() 1804 1935 "When enabled, these will override the aspect " 1805 1936 "ratio specified by any broadcaster for all " 1806 1937 "video streams.")); 1807 return gc;1938 return wrap(gc, settings); 1808 1939 } 1809 1940 1810 static HostComboBox *AdjustFill()1941 static Setting *AdjustFill(PlaySettings *settings) 1811 1942 { 1812 HostComboBox *gc = new HostComboBox("AdjustFill");1943 CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings); 1813 1944 gc->setLabel(QObject::tr("Zoom")); 1814 1945 for (int m = kAdjustFill_Off; m < kAdjustFill_END; ++m) 1815 1946 gc->addSelection(toString((AdjustFillMode)m), QString::number(m)); … … static HostComboBox *AdjustFill() 1820 1951 gc->setHelpText(QObject::tr( 1821 1952 "When enabled, these will apply a predefined " 1822 1953 "zoom to all video playback in MythTV.")); 1823 return gc;1954 return wrap(gc, settings); 1824 1955 } 1825 1956 1826 1957 // Theme settings … … static HostLineEdit *UDPNotifyPort() 2711 2842 return ge; 2712 2843 } 2713 2844 2714 static HostCheckBox *RealtimePriority()2845 static Setting *RealtimePriority(PlaySettings *settings) 2715 2846 { 2716 HostCheckBox *gc = new HostCheckBox("RealtimePriority");2847 CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings); 2717 2848 gc->setLabel(QObject::tr("Enable realtime priority threads")); 2718 2849 gc->setHelpText(QObject::tr("When running mythfrontend with root " 2719 2850 "privileges, some threads can be given enhanced priority. " 2720 2851 "Disable this if mythfrontend freezes during video " 2721 2852 "playback.")); 2722 2853 gc->setValue(true); 2723 return gc;2854 return wrap(gc, settings, false); 2724 2855 } 2725 2856 2726 2857 static HostCheckBox *EnableMediaMon() … … static HostCheckBox *WatchTVGuide() 3286 3417 return gc; 3287 3418 } 3288 3419 3289 MainGeneralSettings::MainGeneralSettings() 3420 MainGeneralSettings::MainGeneralSettings(PlaySettings *settings, 3421 ConfigurationWizard *base) 3290 3422 { 3423 if (!settings) 3424 { 3291 3425 DatabaseSettings::addDatabaseSettings(this); 3292 3426 3293 3427 VerticalConfigurationGroup *pin = … … MainGeneralSettings::MainGeneralSettings() 3336 3470 remotecontrol->addChild(NetworkControlPort()); 3337 3471 remotecontrol->addChild(UDPNotifyPort()); 3338 3472 addChild(remotecontrol); 3473 } 3339 3474 } 3340 3475 3341 PlaybackSettings::PlaybackSettings() 3476 PlaybackSettings::PlaybackSettings(PlaySettings *settings, 3477 ConfigurationWizard *base) 3342 3478 { 3343 3479 uint i = 0, total = 8; 3344 3480 #if CONFIG_DARWIN 3345 3481 total += 2; 3346 3482 #endif // USING_DARWIN 3483 if (settings) 3484 total -= 3; 3347 3485 3348 3486 3349 3487 VerticalConfigurationGroup* general1 = 3350 3488 new VerticalConfigurationGroup(false); 3351 3489 general1->setLabel(QObject::tr("General Playback") + 3352 3490 QString(" (%1/%2)").arg(++i).arg(total)); 3491 if (settings) 3492 general1->setLabel(QObject::tr("Playback group settings for ") + 3493 settings->mGroupName + " - " + 3494 general1->getLabel()); 3353 3495 3354 3496 HorizontalConfigurationGroup *columns = 3355 3497 new HorizontalConfigurationGroup(false, false, true, true); 3356 3498 3357 3499 VerticalConfigurationGroup *column1 = 3358 3500 new VerticalConfigurationGroup(false, false, true, true); 3359 column1->addChild(RealtimePriority()); 3360 column1->addChild(DecodeExtraAudio()); 3361 column1->addChild(JumpToProgramOSD()); 3501 if (!settings) 3502 column1->addChild(RealtimePriority(settings)); 3503 column1->addChild(DecodeExtraAudio(settings)); 3504 column1->addChild(JumpToProgramOSD(settings)); 3362 3505 columns->addChild(column1); 3363 3506 3364 3507 VerticalConfigurationGroup *column2 = 3365 3508 new VerticalConfigurationGroup(false, false, true, true); 3366 column2->addChild(ClearSavedPosition( ));3367 column2->addChild(AltClearSavedPosition( ));3368 column2->addChild(AutomaticSetWatched( ));3369 column2->addChild(ContinueEmbeddedTVPlay( ));3509 column2->addChild(ClearSavedPosition(settings)); 3510 column2->addChild(AltClearSavedPosition(settings)); 3511 column2->addChild(AutomaticSetWatched(settings)); 3512 column2->addChild(ContinueEmbeddedTVPlay(settings)); 3370 3513 columns->addChild(column2); 3371 3514 3372 3515 general1->addChild(columns); 3373 general1->addChild(LiveTVIdleTimeout()); 3374 addChild(general1); 3516 if (!settings) 3517 general1->addChild(LiveTVIdleTimeout()); 3518 if (base) 3519 base->addChild(general1); 3520 else 3521 addChild(general1); 3375 3522 3376 3523 VerticalConfigurationGroup* general2 = 3377 3524 new VerticalConfigurationGroup(false); 3378 3525 general2->setLabel(QObject::tr("General Playback") + 3379 3526 QString(" (%1/%2)").arg(++i).arg(total)); 3527 if (settings) 3528 general2->setLabel(QObject::tr("Playback group settings for ") + 3529 settings->mGroupName + " - " + 3530 general2->getLabel()); 3380 3531 3381 3532 HorizontalConfigurationGroup* oscan = 3382 3533 new HorizontalConfigurationGroup(false, false, true, true); … … PlaybackSettings::PlaybackSettings() 3384 3535 new VerticalConfigurationGroup(false, false, true, true); 3385 3536 VerticalConfigurationGroup *ocol2 = 3386 3537 new VerticalConfigurationGroup(false, false, true, true); 3387 ocol1->addChild(VertScanPercentage( ));3388 ocol1->addChild(YScanDisplacement( ));3389 ocol2->addChild(HorizScanPercentage( ));3390 ocol2->addChild(XScanDisplacement( ));3538 ocol1->addChild(VertScanPercentage(settings)); 3539 ocol1->addChild(YScanDisplacement(settings)); 3540 ocol2->addChild(HorizScanPercentage(settings)); 3541 ocol2->addChild(XScanDisplacement(settings)); 3391 3542 oscan->addChild(ocol1); 3392 3543 oscan->addChild(ocol2); 3393 3544 3394 3545 HorizontalConfigurationGroup* aspect_fill = 3395 3546 new HorizontalConfigurationGroup(false, false, true, true); 3396 aspect_fill->addChild(AspectOverride( ));3397 aspect_fill->addChild(AdjustFill( ));3547 aspect_fill->addChild(AspectOverride(settings)); 3548 aspect_fill->addChild(AdjustFill(settings)); 3398 3549 3399 3550 general2->addChild(oscan); 3400 3551 general2->addChild(aspect_fill); 3401 general2->addChild(LetterboxingColour()); 3402 general2->addChild(PIPLocationComboBox()); 3403 general2->addChild(PlaybackExitPrompt()); 3404 general2->addChild(EndOfRecordingExitPrompt()); 3405 addChild(general2); 3552 general2->addChild(LetterboxingColour(settings)); 3553 general2->addChild(PIPLocationComboBox(settings)); 3554 general2->addChild(PlaybackExitPrompt(settings)); 3555 general2->addChild(EndOfRecordingExitPrompt(settings)); 3556 if (base) 3557 base->addChild(general2); 3558 else 3559 addChild(general2); 3406 3560 3407 3561 QString tmp = QString(" (%1/%2)").arg(++i).arg(total); 3408 addChild(new PlaybackProfileConfigs(tmp)); 3562 if (base) 3563 base->addChild(new PlaybackProfileConfigs(tmp, settings)); 3564 else 3565 addChild(new PlaybackProfileConfigs(tmp, settings)); 3409 3566 3567 if (!settings) 3568 { 3410 3569 VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false); 3411 3570 pbox->setLabel(QObject::tr("View Recordings") + 3412 3571 QString(" (%1/%2)").arg(++i).arg(total)); … … PlaybackSettings::PlaybackSettings() 3433 3592 pbox3->addChild(DisplayGroupTitleSort()); 3434 3593 pbox3->addChild(new WatchListSettings()); 3435 3594 addChild(pbox3); 3595 } 3436 3596 3437 3597 VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false); 3438 3598 seek->setLabel(QObject::tr("Seeking") + 3439 3599 QString(" (%1/%2)").arg(++i).arg(total)); 3440 seek->addChild(SmartForward()); 3441 seek->addChild(FFRewReposTime()); 3442 seek->addChild(FFRewReverse()); 3443 seek->addChild(ExactSeeking()); 3444 addChild(seek); 3600 if (settings) 3601 seek->setLabel(QObject::tr("Playback group settings for ") + 3602 settings->mGroupName + " - " + 3603 seek->getLabel()); 3604 seek->addChild(SmartForward(settings)); 3605 seek->addChild(FFRewReposTime(settings)); 3606 seek->addChild(FFRewReverse(settings)); 3607 seek->addChild(ExactSeeking(settings)); 3608 if (base) 3609 base->addChild(seek); 3610 else 3611 addChild(seek); 3445 3612 3446 3613 VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false); 3447 3614 comms->setLabel(QObject::tr("Commercial Skip") + 3448 3615 QString(" (%1/%2)").arg(++i).arg(total)); 3449 comms->addChild(AutoCommercialSkip()); 3450 comms->addChild(CommRewindAmount()); 3451 comms->addChild(CommNotifyAmount()); 3616 if (settings) 3617 comms->setLabel(QObject::tr("Playback group settings for ") + 3618 settings->mGroupName + " - " + 3619 comms->getLabel()); 3620 comms->addChild(AutoCommercialSkip(settings)); 3621 comms->addChild(CommRewindAmount(settings)); 3622 comms->addChild(CommNotifyAmount(settings)); 3623 if (!settings) // these are global settings, not host-specific 3624 { 3452 3625 comms->addChild(MaximumCommercialSkip()); 3453 3626 comms->addChild(MergeShortCommBreaks()); 3454 addChild(comms); 3627 } 3628 if (base) 3629 base->addChild(comms); 3630 else 3631 addChild(comms); 3455 3632 3456 3633 #if CONFIG_DARWIN 3457 3634 VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false); 3458 3635 mac1->setLabel(QObject::tr("Mac OS X Video Settings") + 3459 3636 QString(" (%1/%2)").arg(++i).arg(total)); 3637 if (settings) 3638 mac1->setLabel(QObject::tr("Playback group settings for ") + 3639 settings->mGroupName + " - " + 3640 mac1->getLabel()); 3641 if (!settings) 3642 { 3460 3643 mac1->addChild(MacGammaCorrect()); 3461 3644 mac1->addChild(MacScaleUp()); 3462 3645 mac1->addChild(MacFullSkip()); 3463 addChild(mac1); 3646 } 3647 if (base) 3648 base->addChild(mac1); 3649 else 3650 addChild(mac1); 3464 3651 3465 3652 VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false); 3466 3653 mac2->setLabel(QObject::tr("Mac OS X Video Settings") + 3467 3654 QString(" (%1/%2)").arg(++i).arg(total)); 3655 if (settings) 3656 mac2->setLabel(QObject::tr("Playback group settings for ") + 3657 settings->mGroupName + " - " + 3658 mac2->getLabel()); 3659 if (!setings) 3660 { 3468 3661 mac2->addChild(new MacMainSettings()); 3469 3662 mac2->addChild(new MacFloatSettings()); 3470 3663 … … PlaybackSettings::PlaybackSettings() 3478 3671 #endif 3479 3672 } 3480 3673 3481 OSDSettings::OSDSettings() 3674 OSDSettings::OSDSettings(PlaySettings *settings, 3675 ConfigurationWizard *base) 3482 3676 { 3483 3677 VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false); 3484 3678 osd->setLabel(QObject::tr("On-screen Display")); 3679 if (settings) 3680 osd->setLabel(QObject::tr("Playback group settings for ") + 3681 settings->mGroupName + " - " + 3682 osd->getLabel()); 3485 3683 3486 osd->addChild(EnableMHEG()); 3487 osd->addChild(PersistentBrowseMode()); 3488 osd->addChild(BrowseAllTuners()); 3489 osd->addChild(CCBackground()); 3490 osd->addChild(DefaultCCMode()); 3491 osd->addChild(PreferCC708()); 3684 if (!settings) 3685 { 3686 osd->addChild(EnableMHEG(settings)); 3687 osd->addChild(PersistentBrowseMode(settings)); 3688 osd->addChild(BrowseAllTuners(settings)); 3689 } 3690 osd->addChild(CCBackground(settings)); 3691 osd->addChild(DefaultCCMode(settings)); 3692 osd->addChild(PreferCC708(settings)); 3693 if (!settings) 3492 3694 osd->addChild(SubtitleFont()); 3493 osd->addChild(OSDCC708TextZoomPercentage()); 3494 osd->addChild(SubtitleCodec()); 3495 addChild(osd); 3695 osd->addChild(OSDCC708TextZoomPercentage(settings)); 3696 osd->addChild(SubtitleCodec(settings)); 3697 if (base) 3698 base->addChild(osd); 3699 else 3700 addChild(osd); 3496 3701 3497 3702 //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false); 3498 3703 //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 95a4521..814fb5e 100644
a b using namespace std; 38 38 #include "grabbersettings.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) 566 567 delete statusbox; 567 568 } 568 569 570 ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 571 { 572 return new PlaybackSettings(settings, base); 573 } 574 575 ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 576 { 577 return new OSDSettings(settings, base); 578 } 579 580 ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 581 { 582 return new MainGeneralSettings(settings, base); 583 } 584 585 static PlayGroupEditor::SettingsLookup pbgroupSetup[] = { 586 createPlaybackSettingsForPlaybackGroup, 587 createOSDSettingsForPlaybackGroup, 588 createMainGeneralSettingsForPlaybackGroup 589 }; 590 569 591 static void RunVideoScreen(VideoDialog::DialogType type, bool fromJump = false) 570 592 { 571 593 QString message = QObject::tr("Loading videos ..."); … … static void TVMenuCallback(void *data, QString &selection) 879 901 } 880 902 else if (sel == "settings playgroup") 881 903 { 882 PlayGroupEditor editor; 904 PlayGroupEditor editor(pbgroupSetup, 905 sizeof(pbgroupSetup)/sizeof(*pbgroupSetup)); 883 906 editor.exec(); 884 907 } 885 908 else if (sel == "settings general") … … static int internal_play_media(const QString &mrl, const QString &plot, 1124 1147 pos = (int64_t)((*++it).toLongLong() & 0xffffffffLL); 1125 1148 } 1126 1149 } 1150 pginfo->SetPlaybackGroup("Videos"); 1127 1151 } 1128 1152 else 1129 1153 { … … static int internal_play_media(const QString &mrl, const QString &plot, 1135 1159 delete dvd; 1136 1160 } 1137 1161 else if (pginfo->IsVideo()) 1162 { 1138 1163 pos = pginfo->QueryBookmark(); 1164 pginfo->SetPlaybackGroup("Videos"); 1165 } 1139 1166 1140 1167 if (pos > 0) 1141 1168 { -
mythtv/programs/mythfrontend/setupwizard_video.cpp
diff --git a/mythtv/programs/mythfrontend/setupwizard_video.cpp b/mythtv/programs/mythfrontend/setupwizard_video.cpp index 52ed4d5..8e55225 100644
a b VideoSetupWizard::VideoSetupWizard(MythScreenStack *parent, MythScreenType *gene 33 33 m_prevButton(NULL) 34 34 { 35 35 m_popupStack = GetMythMainWindow()->GetStack("popup stack"); 36 m_vdp = new VideoDisplayProfile( );36 m_vdp = new VideoDisplayProfile(NULL); 37 37 m_audioScreen->Hide(); 38 38 gCoreContext->addListener(this); 39 39 } … … void VideoSetupWizard::loadData(void) 110 110 item->SetData(*i); 111 111 } 112 112 113 QString currentpbp = m_vdp->GetDefaultProfileName(gCoreContext->GetHostName() );113 QString currentpbp = m_vdp->GetDefaultProfileName(gCoreContext->GetHostName(), NULL); 114 114 if (!currentpbp.isEmpty()) 115 115 { 116 116 MythUIButtonListItem *set = … … void VideoSetupWizard::playVideoTest(QString desc, QString title, QString file) 211 211 { 212 212 QString desiredpbp = 213 213 m_playbackProfileButtonList->GetItemCurrent()->GetText(); 214 QString currentpbp = m_vdp->GetDefaultProfileName(gCoreContext->GetHostName() );214 QString currentpbp = m_vdp->GetDefaultProfileName(gCoreContext->GetHostName(), NULL); 215 215 216 216 m_vdp->SetDefaultProfileName(desiredpbp, gCoreContext->GetHostName()); 217 217 GetMythMainWindow()->HandleMedia("Internal", file, desc, title);