Ticket #8088: 8088_playgroups_v26.patch

File 8088_playgroups_v26.patch, 112.9 KB (added by Jim Stichnoth <stichnot@…>, 8 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 
    6868SOURCES += rssparse.cpp           netutils.cpp
    6969SOURCES += filesysteminfo.cpp
    7070
     71HEADERS += playsettings.h
     72SOURCES += playsettings.cpp
     73
    7174# remove when everything is switched to mythui
    7275SOURCES += virtualkeyboard_qt.cpp
    7376
  • 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, 
    476476                                            Configurable *target)
    477477{
    478478    VerifyLayout();
     479    bool isDuplicate = triggerMap.values().contains(target);
    479480    triggerMap[triggerValue] = target;
    480481
    481482    if (!configStack)
    void TriggeredConfigurationGroup::addTarget(QString triggerValue, 
    485486        configStack->setSaveAll(isSaveAll);
    486487    }
    487488
    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);
    489493}
    490494
    491495Setting *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) 
    223223        else if (action == "DOWN")
    224224            focusNextPrevChild(true);
    225225        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        }
    227236        else
    228237            handled = false;
    229238    }
  • 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 
    329329    Q_OBJECT
    330330
    331331  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    }
    334338    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    }
    337345
    338346    void setHelpText(const QString&);
    339347
  • 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) 
    235235    return -1;
    236236}
    237237
     238QString 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
    238252bool SelectSetting::ReplaceLabel(const QString &new_label, const QString &value)
    239253{
    240254    int i = getValueIndex(value);
    QWidget* LineEditSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 
    299313        QLabel *label = new QLabel();
    300314        label->setText(getLabel() + ":     ");
    301315        layout->addWidget(label);
     316        labelWidget = label;
    302317    }
    303318
    304319    bxwidget = widget;
    QWidget* LineEditSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 
    327342
    328343    widget->setLayout(layout);
    329344
     345    setValue(getValue());
     346
    330347    return widget;
    331348}
    332349
    void LineEditSetting::widgetInvalid(QObject *obj) 
    336353    {
    337354        bxwidget = NULL;
    338355        edit     = NULL;
     356        labelWidget = NULL;
    339357    }
    340358}
    341359
    void LineEditSetting::setHelpText(const QString &str) 
    373391    Setting::setHelpText(str);
    374392}
    375393
     394static 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
     404void 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
    376414void BoundedIntegerSetting::setValue(int newValue)
    377415{
    378416    newValue = std::max(std::min(newValue, max), min);
    QWidget* SliderSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 
    439477
    440478SpinBoxSetting::SpinBoxSetting(
    441479    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) :
    443482    BoundedIntegerSetting(_storage, _min, _max, _step),
    444483    spinbox(NULL), relayEnabled(true),
    445     sstep(_allow_single_step), svtext("")
     484    sstep(_allow_single_step), svtext(""), labelWidget(NULL),
     485    changeOnSpecial(change_style_on_special)
    446486{
    447487    if (!_special_value_text.isEmpty())
    448488        svtext = _special_value_text;
    QWidget* SpinBoxSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 
    476516        QLabel *label = new QLabel();
    477517        label->setText(getLabel() + ":     ");
    478518        layout->addWidget(label);
     519        labelWidget = label;
    479520    }
    480521
    481522    bxwidget = widget;
    QWidget* SpinBoxSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 
    506547
    507548    widget->setLayout(layout);
    508549
     550    setValue(intValue());
     551
    509552    return widget;
    510553}
    511554
    void SpinBoxSetting::widgetInvalid(QObject *obj) 
    515558    {
    516559        bxwidget = NULL;
    517560        spinbox  = NULL;
     561        labelWidget = NULL;
    518562    }
    519563}
    520564
    521565void SpinBoxSetting::setValue(int newValue)
    522566{
    523567    newValue = std::max(std::min(newValue, max), min);
     568    if (changeOnSpecial)
     569    {
     570        adjustFont(labelWidget, (newValue == min));
     571        adjustFont(spinbox,     (newValue == min));
     572    }
    524573    if (spinbox && (spinbox->value() != newValue))
    525574    {
    526575        //int old = intValue();
    QWidget* ComboBoxSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 
    631680        QLabel *label = new QLabel();
    632681        label->setText(getLabel() + ":     ");
    633682        layout->addWidget(label);
     683        labelWidget = label;
    634684    }
    635685
    636686    bxwidget = widget;
    QWidget* ComboBoxSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 
    659709            cbwidget, SLOT(clear()));
    660710
    661711    if (rw)
     712    {
    662713        connect(cbwidget, SIGNAL(editTextChanged(const QString &)),
    663714                this, SLOT(editTextChanged(const QString &)));
     715        connect(cbwidget, SIGNAL(editTextChanged(const QString &)),
     716                this, SLOT(changeLabel(const QString &)));
     717    }
    664718
    665719    if (cg)
    666720        connect(cbwidget, SIGNAL(changeHelpText(QString)), cg,
    QWidget* ComboBoxSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 
    673727
    674728    widget->setLayout(layout);
    675729
     730    setValue(current);
     731
    676732    return widget;
    677733}
    678734
    void ComboBoxSetting::widgetInvalid(QObject *obj) 
    682738    {
    683739        bxwidget = NULL;
    684740        cbwidget = NULL;
     741        labelWidget = NULL;
    685742    }
    686743}
    687744
    void ComboBoxSetting::setValue(QString newValue) 
    717774
    718775    if (rw)
    719776    {
     777        changeLabel(newValue);
    720778        Setting::setValue(newValue);
    721779        if (cbwidget)
    722780            cbwidget->setCurrentIndex(current);
    void ComboBoxSetting::setValue(int which) 
    727785{
    728786    if (cbwidget)
    729787        cbwidget->setCurrentIndex(which);
     788    changeLabel(labels[which]);
    730789    SelectSetting::setValue(which);
    731790}
    732791
    733 void ComboBoxSetting::addSelection(
    734     const QString &label, QString value, bool select)
     792void ComboBoxSetting::changeLabel(const QString &newLabel)
     793{
     794    if (changeOnSpecial)
     795    {
     796        adjustFont(labelWidget, specialLabel == newLabel);
     797        adjustFont(cbwidget,    specialLabel == newLabel);
     798    }
     799}
     800
     801void ComboBoxSetting::addSelection(const QString &label, QString value,
     802                                   bool select, bool special_formatting)
    735803{
    736804    if ((findSelection(label, value) < 0) && cbwidget)
    737805    {
    void ComboBoxSetting::addSelection( 
    739807        cbwidget->insertItem(label);
    740808    }
    741809
     810    if (special_formatting)
     811    {
     812        changeOnSpecial = true;
     813        specialLabel = label;
     814    }
     815
    742816    SelectSetting::addSelection(label, value, select);
    743817
    744818    if (cbwidget && isSet)
    void CheckBoxSetting::setHelpText(const QString &str) 
    9551029    BooleanSetting::setHelpText(str);
    9561030}
    9571031
     1032QWidget* 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
     1056void TristateCheckBoxSetting::widgetInvalid(QObject *obj)
     1057{
     1058    widget = (widget == obj) ? NULL : widget;
     1059}
     1060
     1061void TristateCheckBoxSetting::setEnabled(bool fEnabled)
     1062{
     1063    TristateSetting::setEnabled(fEnabled);
     1064    if (widget)
     1065        widget->setEnabled(fEnabled);
     1066}
     1067
     1068void TristateCheckBoxSetting::setHelpText(const QString &str)
     1069{
     1070    if (widget)
     1071        widget->setHelpText(str);
     1072    TristateSetting::setHelpText(str);
     1073}
     1074
     1075const char *TristateSetting::kPartiallyCheckedString = "default";
     1076
     1077void TristateCheckBoxSetting::setValue(int check)
     1078{
     1079    adjustFont(widget, (check != Qt::Checked && check != Qt::Unchecked));
     1080    TristateSetting::setValue(check);
     1081    emit valueChanged(check);
     1082}
     1083
     1084void 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
    9581095void AutoIncrementDBSetting::Save(QString table)
    9591096{
    9601097    if (intValue() == 0)
    void ImageSelectSetting::addImageSelection(const QString& label, 
    11421279    addSelection(label, value, select);
    11431280}
    11441281
     1282void 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
    11451300ImageSelectSetting::~ImageSelectSetting()
    11461301{
    11471302    Teardown();
    void ImageSelectSetting::Teardown(void) 
    11641319    bxwidget   = NULL;
    11651320    imagelabel = NULL;
    11661321    combo      = NULL;
     1322    labelWidget = NULL;
    11671323}
    11681324
    11691325void ImageSelectSetting::imageSet(int num)
    QWidget* ImageSelectSetting::configWidget(ConfigurationGroup *cg, 
    12111367        QLabel *label = new QLabel();
    12121368        label->setText(getLabel() + ":");
    12131369        layout->addWidget(label);
     1370        labelWidget = label;
    12141371    }
    12151372
    12161373    combo = new MythComboBox(false);
    QWidget* ImageSelectSetting::configWidget(ConfigurationGroup *cg, 
    12571414    connect(combo, SIGNAL(highlighted(int)), this, SLOT(imageSet(int)));
    12581415    connect(combo, SIGNAL(activated(int)), this, SLOT(setValue(int)));
    12591416    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 &)));
    12601421
    12611422    connect(this, SIGNAL(selectionsCleared()),
    12621423            combo, SLOT(clear()));
    QWidget* ImageSelectSetting::configWidget(ConfigurationGroup *cg, 
    12671428
    12681429    bxwidget->setLayout(layout);
    12691430
     1431    changeLabel(GetLabel(current));
     1432
    12701433    return bxwidget;
    12711434}
    12721435
     1436void ImageSelectSetting::changeLabel(const QString &newLabel)
     1437{
     1438    if (changeOnSpecial)
     1439    {
     1440        adjustFont(labelWidget, specialLabel == newLabel);
     1441        adjustFont(combo,       specialLabel == newLabel);
     1442    }
     1443}
     1444
    12731445void ImageSelectSetting::widgetInvalid(QObject *obj)
    12741446{
    12751447    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 
    134134
    135135class MPUBLIC LineEditSetting : public Setting
    136136{
     137    Q_OBJECT
     138
    137139  protected:
    138     LineEditSetting(Storage *_storage, bool readwrite = true) :
     140    LineEditSetting(Storage *_storage, bool readwrite = true,
     141                    bool adjust_on_blank = false) :
    139142        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) { }
    141145
    142146  public:
    143147    virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent,
    class MPUBLIC LineEditSetting : public Setting 
    159163
    160164    virtual void setHelpText(const QString &str);
    161165
     166  public slots:
     167    virtual void setValue(const QString &newValue);
     168
    162169  private:
    163170    QWidget      *bxwidget;
    164171    MythLineEdit *edit;
    165172    bool rw;
    166173    bool password_echo;
     174    bool adjustOnBlank;
     175    QWidget *labelWidget;
    167176};
    168177
    169178// TODO: set things up so that setting the value as a string emits
    class MPUBLIC SpinBoxSetting: public BoundedIntegerSetting 
    219228  public:
    220229    SpinBoxSetting(Storage *_storage, int min, int max, int step,
    221230                   bool allow_single_step = false,
    222                    QString special_value_text = "");
     231                   QString special_value_text = "",
     232                   bool change_style_on_special = false);
    223233
    224234    virtual QWidget *configWidget(ConfigurationGroup *cg, QWidget *parent,
    225235                                  const char *widgetName = 0);
    class MPUBLIC SpinBoxSetting: public BoundedIntegerSetting 
    248258    bool         relayEnabled;
    249259    bool         sstep;
    250260    QString      svtext;
     261    QLabel      *labelWidget;
     262    bool         changeOnSpecial;
    251263};
    252264
    253265class MPUBLIC SelectSetting : public Setting
    class MPUBLIC SelectSetting : public Setting 
    277289        { return (i < labels.size()) ? labels[i] : QString::null; }
    278290    virtual QString GetValue(uint i) const
    279291        { return (i < values.size()) ? values[i] : QString::null; }
     292    virtual QString GetValueLabel(const QString &value);
    280293
    281294signals:
    282295    void selectionAdded(const QString& label, QString value);
    class MPUBLIC ComboBoxSetting: public SelectSetting { 
    318331protected:
    319332    ComboBoxSetting(Storage *_storage, bool _rw = false, int _step = 1) :
    320333        SelectSetting(_storage), rw(_rw),
    321         bxwidget(NULL), cbwidget(NULL), step(_step) { }
     334        bxwidget(NULL), cbwidget(NULL), changeOnSpecial(false),
     335        specialLabel(""), labelWidget(NULL), step(_step) { }
    322336
    323337public:
    324338    virtual void setValue(QString newValue);
    public: 
    340354public slots:
    341355    void addSelection(const QString &label,
    342356                      QString value = QString::null,
    343                       bool select = false);
     357                      bool select = false,
     358                      bool special_formatting = false);
    344359    bool removeSelection(const QString &label,
    345360                         QString value = QString::null);
     361    virtual void changeLabel(const QString &newValue);
    346362    void editTextChanged(const QString &newText);
    347363
    348364private:
    349365    bool rw;
    350366    QWidget      *bxwidget;
    351367    MythComboBox *cbwidget;
     368    bool          changeOnSpecial;
     369    QString       specialLabel;
     370    QLabel       *labelWidget;
    352371
    353372protected:
    354373    int step;
    public: 
    417436    ImageSelectSetting(Storage *_storage) :
    418437        SelectSetting(_storage),
    419438        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) { }
    421441    virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent,
    422442                                  const char* widgetName = 0);
    423443    virtual void widgetInvalid(QObject *obj);
    public: 
    428448                                   QImage* image,
    429449                                   QString value=QString::null,
    430450                                   bool select=false);
     451    virtual void addDefaultSelection(const QString label,
     452                                     const QString value,
     453                                     const QString defaultValue,
     454                                     bool select);
    431455
    432456protected slots:
    433457    void imageSet(int);
     458    void changeLabel(const QString &newLabel);
    434459
    435460  protected:
    436461    void Teardown(void);
    protected: 
    442467    QLabel *imagelabel;
    443468    MythComboBox *combo;
    444469    float m_hmult, m_wmult;
     470    bool          changeOnSpecial;
     471    QString       specialLabel;
     472    QLabel       *labelWidget;
    445473};
    446474
    447475class MPUBLIC BooleanSetting : public Setting
    protected: 
    484512    MythCheckBox *widget;
    485513};
    486514
     515class 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
     532public slots:
     533    virtual void setValue(/*Qt::CheckState*/int check);
     534
     535signals:
     536    void valueChanged(int);
     537};
     538
     539class MPUBLIC TristateCheckBoxSetting: public TristateSetting {
     540    Q_OBJECT
     541
     542public:
     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
     554public 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
     561protected:
     562    MythCheckBox *widget;
     563};
     564
    487565class MPUBLIC PathSetting : public ComboBoxSetting
    488566{
    489567public:
  • 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  
    55#include "mythplayer.h"
    66#include "videoouttypes.h"
    77#include "mythcorecontext.h"
     8#include "playsettings.h"
    89
    910DetectLetterbox::DetectLetterbox(MythPlayer* const player)
    1011{
    11     int dbAdjustFill = gCoreContext->GetNumSetting("AdjustFill", 0);
     12    int dbAdjustFill = player->GetPlaySettings()->GetNumSetting("AdjustFill", 0);
    1213    isDetectLetterbox = dbAdjustFill >= kAdjustFill_AutoDetect_DefaultOff;
    1314    firstFrameChecked = 0;
    1415    detectLetterboxDefaultMode = (AdjustFillMode) max((int) kAdjustFill_Off,
    DetectLetterbox::DetectLetterbox(MythPlayer* const player) 
    1819    detectLetterboxPossibleFullFrame = -1;
    1920    detectLetterboxConsecutiveCounter = 0;
    2021    detectLetterboxDetectedMode = player->GetAdjustFill();
    21     detectLetterboxLimit = gCoreContext->GetNumSetting("DetectLeterboxLimit", 75);
     22    detectLetterboxLimit =
     23        player->GetPlaySettings()->GetNumSetting("DetectLeterboxLimit", 75);
    2224    m_player = player;
    2325}
    2426
  • 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; 
    3737#include "bdringbuffer.h"
    3838#include "videodisplayprofile.h"
    3939#include "mythuihelper.h"
     40#include "playsettings.h"
    4041
    4142#include "lcddevice.h"
    4243
    AvFormatDecoder::AvFormatDecoder(MythPlayer *parent, 
    317318
    318319    cc608_build_parity_table(cc608_parity_table);
    319320
    320     if (gCoreContext->GetNumSetting("CCBackground", 0))
     321    if (GetPlayer()->GetPlaySettings()->GetNumSetting("CCBackground", 0))
    321322        CC708Window::forceWhiteOnBlackText = true;
    322323
    323324    no_dts_hack = false;
    void AvFormatDecoder::InitVideoCodec(AVStream *stream, AVCodecContext *enc, 
    12601261    if (selectedStream)
    12611262    {
    12621263        directrendering = true;
    1263         if (!gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&
     1264        if (!GetPlayer()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) &&
    12641265            !CODEC_IS_HWACCEL(codec, enc))
    12651266        {
    12661267            SetLowBuffers(false);
    int AvFormatDecoder::ScanStreams(bool novideo) 
    17861787
    17871788                if (!is_db_ignored)
    17881789                {
    1789                     VideoDisplayProfile vdp;
     1790                    VideoDisplayProfile vdp(GetPlayer()->GetPlaySettings());
    17901791                    vdp.SetInput(QSize(width, height));
    17911792                    dec = vdp.GetDecoder();
    17921793                    thread_count = vdp.GetMaxCPUs();
    int AvFormatDecoder::ScanStreams(bool novideo) 
    18141815                    MythCodecID vdpau_mcid;
    18151816                    vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec(
    18161817                        width, height,
    1817                         mpeg_version(enc->codec_id), no_hardware_decoders);
     1818                        mpeg_version(enc->codec_id), no_hardware_decoders,
     1819                        GetPlayer()->GetPlaySettings());
    18181820
    18191821                    if (vdpau_mcid >= video_codec_id)
    18201822                    {
  • 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 
    35643564
    35653565            VideoDisplayProfile::CreateNewProfiles(host);
    35663566            profiles = VideoDisplayProfile::GetProfiles(host);
    3567             QString profile = VideoDisplayProfile::GetDefaultProfileName(host);
     3567            QString profile =
     3568                VideoDisplayProfile::GetDefaultProfileName(host, NULL);
    35683569
    35693570            if (profiles.contains("Normal") &&
    35703571                (profile=="CPU++" || profile=="CPU+" || profile=="CPU--"))
    tmp.constData(), 
    62166217"  jump int(11) NOT NULL default '0',"
    62176218"  PRIMARY KEY  (`name`)"
    62186219");",
     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");",
    62196227"CREATE TABLE powerpriority ("
    62206228"  priorityname varchar(64) collate utf8_bin NOT NULL,"
    62216229"  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; 
    6060#include "mythimage.h"
    6161#include "mythuiimage.h"
    6262#include "mythlogging.h"
     63#include "playsettings.h"
    6364
    6465extern "C" {
    6566#include "vbitext/vbi.h"
    MythPlayer::MythPlayer(bool muted) 
    215216    memset(&tc_wrap,    0, sizeof(tc_wrap));
    216217
    217218    playerThread = QThread::currentThread();
    218     // Playback (output) zoom control
    219     detect_letter_box = new DetectLetterbox(this);
    220 
    221     vbimode = VBIMode::Parse(gCoreContext->GetSetting("VbiFormat"));
    222 
    223219    defaultDisplayAspect =
    224220        gCoreContext->GetFloatSettingOnHost("XineramaMonitorAspectRatio",
    225221                                            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);
    233222    tc_wrap[TC_AUDIO]  = gCoreContext->GetNumSetting("AudioSyncOffset", 0);
    234223
    235224    // Get VBI page number
    bool MythPlayer::InitVideo(void) 
    457446    if (using_null_videoout && decoder)
    458447    {
    459448        MythCodecID codec = decoder->GetVideoCodecID();
    460         videoOutput = new VideoOutputNull();
     449        videoOutput = new VideoOutputNull(GetPlaySettings());
    461450        if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(),
    462451                               video_aspect, 0, QRect(), codec))
    463452        {
    bool MythPlayer::InitVideo(void) 
    506495                decoder->GetVideoCodecPrivate(),
    507496                pipState,
    508497                video_disp_dim, video_aspect,
    509                 widget->winId(), display_rect, video_frame_rate);
     498                widget->winId(), display_rect, video_frame_rate, GetPlaySettings());
    510499        }
    511500
    512501        if (videoOutput)
    void MythPlayer::ReinitOSD(void) 
    593582
    594583void MythPlayer::ReinitVideo(void)
    595584{
    596     if (!videoOutput->IsPreferredRenderer(video_disp_dim))
     585    if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings()))
    597586    {
    598587        LOG(VB_PLAYBACK, LOG_INFO, LOC + "Need to switch video renderer.");
    599588        SetErrored(QObject::tr("Need to switch video renderer."));
    void MythPlayer::VideoStart(void) 
    21602149        m_double_process = videoOutput->IsExtraProcessingRequired();
    21612150
    21622151        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);
    21642154
    21652155        // Make sure video sync can do it
    21662156        if (videosync != NULL && m_double_framerate)
    void MythPlayer::SetPlayerInfo(TV *tv, QWidget *widget, 
    35623552    player_ctx   = ctx;
    35633553    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);
    35643567}
    35653568
    35663569bool 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 
    177177    QString   GetXDS(const QString &key) const;
    178178    PIPLocation GetNextPIPLocation(void) const;
    179179
     180    PlaySettings *GetPlaySettings(void) const {
     181        return player_ctx ? player_ctx->settings : NULL;
     182    }
     183
    180184    // Bool Gets
    181185    bool    IsPaused(void)                    { return allpaused;      }
    182186    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  
    1717#include "mythcorecontext.h"
    1818#include "videometadatautil.h"
    1919#include "mythlogging.h"
     20#include "DetectLetterbox.h"
     21#include "playsettings.h"
    2022
    2123#define LOC QString("playCtx: ")
    2224#define LOC_ERR QString("playCtx, Error: ")
    bool PlayerContext::CreatePlayer(TV *tv, QWidget *widget, 
    375377                                 bool embed, const QRect &embedbounds,
    376378                                 bool muted)
    377379{
    378     int exact_seeking = gCoreContext->GetNumSetting("ExactSeeking", 0);
     380    int exact_seeking = settings->GetNumSetting("ExactSeeking", 0);
    379381
    380382    if (HasPlayer())
    381383    {
    bool PlayerContext::CreatePlayer(TV *tv, QWidget *widget, 
    418420    {
    419421        QString subfn = buffer->GetSubtitleFilename();
    420422        if (!subfn.isEmpty() && player->GetSubReader())
    421             player->GetSubReader()->LoadExternalSubtitles(subfn);
     423            player->GetSubReader()->LoadExternalSubtitles(subfn, settings);
    422424    }
    423425
    424426    if (embed && !embedbounds.isNull())
    void PlayerContext::SetRingBuffer(RingBuffer *buf) 
    839841/**
    840842 * \brief assign programinfo to the context
    841843 */
    842 void PlayerContext::SetPlayingInfo(const ProgramInfo *info)
     844void PlayerContext::SetPlayingInfo(const ProgramInfo *info,
     845                                   PlaySettings *_settings)
    843846{
    844847    bool ignoreDB = gCoreContext->IsDatabaseIgnored();
    845848
    void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 
    851854            playingInfo->MarkAsInUse(false, recUsage);
    852855        delete playingInfo;
    853856        playingInfo = NULL;
     857        // XXX delete settings?
    854858    }
    855859
    856860    if (info)
    void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 
    859863        if (!ignoreDB)
    860864            playingInfo->MarkAsInUse(true, recUsage);
    861865        playingLen = playingInfo->GetSecondsInRecording();
     866        settings = (_settings ? _settings :
     867                    new PlaySettings(playingInfo->GetPlaybackGroup()));
    862868    }
    863869}
    864870
  • 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; 
    2525class LiveTVChain;
    2626class MythDialog;
    2727class QPainter;
     28class PlaySettings;
    2829
    2930struct osdInfo
    3031{
    class MTV_PUBLIC PlayerContext 
    9697    void SetRecorder(RemoteEncoder *rec);
    9798    void SetTVChain(LiveTVChain *chain);
    9899    void SetRingBuffer(RingBuffer *buf);
    99     void SetPlayingInfo(const ProgramInfo *info);
     100    void SetPlayingInfo(const ProgramInfo *info, PlaySettings *settings=NULL);
    100101    void SetPlayGroup(const QString &group);
    101102    void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state);
    102103    void SetPIPLocation(int loc) { pipLocation = loc; }
    class MTV_PUBLIC PlayerContext 
    153154    LiveTVChain        *tvchain;
    154155    RingBuffer         *buffer;
    155156    ProgramInfo        *playingInfo; ///< Currently playing info
     157    PlaySettings       *settings; // corresponding to playingInfo
    156158    long long           playingLen;  ///< Initial CalculateLength()
    157159    AVSpecialDecode     specialDecode;
    158160    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  
    22#include "playgroup.h"
    33#include "programinfo.h"
    44#include "mythwidgets.h"
     5#include "playsettings.h"
    56
    67class PlayGroupConfig: public ConfigurationWizard
    78{
    int PlayGroup::GetSetting(const QString &name, const QString &field, 
    220221    return res;
    221222}
    222223
    223 PlayGroupEditor::PlayGroupEditor(void) :
    224     listbox(new ListBoxSetting(this)), lastValue("Default")
     224PlayGroupEditor::PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize) :
     225    listbox(new ListBoxSetting(this)), lastValue("Default"),
     226    getSettings(funcArray), getSettingsSize(funcArraySize)
    225227{
    226228    listbox->setLabel(tr("Playback Groups"));
    227229    addChild(listbox);
    void PlayGroupEditor::open(QString name) 
    252254    }
    253255
    254256    PlayGroupConfig group(name);
     257    PlaySettings *psettings = new PlaySettings(name);
     258    for (int i=0; i<getSettingsSize; i++)
     259        getSettings[i](psettings, &group);
    255260    if (group.exec() == QDialog::Accepted || !created)
    256261        lastValue = name;
    257262    else
    void PlayGroupEditor::doDelete(void) 
    286291        query.bindValue(":NAME", name);
    287292        if (!query.exec())
    288293            MythDB::DBError("PlayGroupEditor::doDelete", query);
     294        PlaySettings::deleteGroup(name);
    289295
    290296        int lastIndex = listbox->getValueIndex(name);
    291297        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  
    77#include "settings.h"
    88
    99class ProgramInfo;
     10class PlaySettings;
    1011
    1112class MTV_PUBLIC PlayGroup
    1213{
    class MTV_PUBLIC PlayGroupEditor : public QObject, public ConfigurationDialog 
    2324    Q_OBJECT
    2425
    2526  public:
    26     PlayGroupEditor(void);
     27    typedef ConfigurationWizard *(*SettingsLookup)(PlaySettings *settings,
     28                                                   ConfigurationWizard *base);
     29    PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize);
    2730    virtual DialogCode exec(void);
    2831    virtual void Load(void);
    2932    virtual void Save(void) { }
    class MTV_PUBLIC PlayGroupEditor : public QObject, public ConfigurationDialog 
    3841  protected:
    3942    ListBoxSetting *listbox;
    4043    QString         lastValue;
     44    SettingsLookup *getSettings;
     45    int             getSettingsSize;
    4146};
    4247
    4348#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) 
    6565        av_free(subtitle.rects);
    6666}
    6767
    68 bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName)
     68bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName,
     69                                           PlaySettings *settings)
    6970{
    7071    m_TextSubtitles.Clear();
    71     return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles);
     72    return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles,
     73                                             settings);
    7274}
    7375
    7476bool 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 
    4444
    4545    TextSubtitles* GetTextSubtitles(void) { return &m_TextSubtitles; }
    4646    bool HasTextSubtitles(void);
    47     bool LoadExternalSubtitles(const QString &videoFile);
     47    bool LoadExternalSubtitles(const QString &videoFile, PlaySettings *settings);
    4848
    4949    QStringList GetRawTextSubtitles(uint64_t &duration);
    5050    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  
    88#include "mythpainter.h"
    99#include "subtitlescreen.h"
    1010#include "bdringbuffer.h"
     11#include "playsettings.h"
    1112
    1213#define LOC      QString("Subtitles: ")
    1314#define LOC_WARN QString("Subtitles Warning: ")
    bool SubtitleScreen::Create(void) 
    8081        LOG(VB_GENERAL, LOG_WARNING, LOC + "Failed to get CEA-608 reader.");
    8182    if (!m_708reader)
    8283        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);
    8586    return true;
    8687}
    8788
  • 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; 
    2121#include "ringbuffer.h"
    2222#include "textsubtitleparser.h"
    2323#include "xine_demux_sputext.h"
     24#include "playsettings.h"
    2425
    2526static bool operator<(const text_subtitle_t& left,
    2627                      const text_subtitle_t& right)
    void TextSubtitles::Clear(void) 
    116117    m_lock.unlock();
    117118}
    118119
    119 bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target)
     120bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target,
     121                                       PlaySettings *settings)
    120122{
    121123    demux_sputext_t sub_data;
    122124    sub_data.rbuffer = RingBuffer::Create(fileName, 0, false);
    bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target) 
    134136    target.SetFrameBasedTiming(!sub_data.uses_time);
    135137
    136138    QTextCodec *textCodec = NULL;
    137     QString codec = gCoreContext->GetSetting("SubtitleCodec", "");
     139    QString codec = settings->GetSetting("SubtitleCodec", "");
    138140    if (!codec.isEmpty())
    139141        textCodec = QTextCodec::codecForName(codec.toLatin1());
    140142    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; 
    1717// Qt headers
    1818#include <QStringList>
    1919
     20class PlaySettings;
     21
    2022class text_subtitle_t
    2123{
    2224  public:
    class TextSubtitles 
    8385class TextSubtitleParser
    8486{
    8587  public:
    86     static bool LoadSubtitles(QString fileName, TextSubtitles &target);
     88    static bool LoadSubtitles(QString fileName, TextSubtitles &target,
     89                              PlaySettings *settings);
    8790};
    8891
    8992#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; 
    5858#include "mythdirs.h"
    5959#include "tvbrowsehelper.h"
    6060#include "mythlogging.h"
     61#include "playsettings.h"
    6162
    6263#if ! HAVE_ROUND
    6364#define round(x) ((int) ((x) + 0.5))
    bool TV::StartTV(ProgramInfo *tvrec, uint flags) 
    208209    bool startInGuide = flags & kStartTVInGuide;
    209210    bool inPlaylist = flags & kStartTVInPlayList;
    210211    bool initByNetworkCommand = flags & kStartTVByNetworkCommand;
    211     TV *tv = new TV();
    212212    bool quitAll = false;
    213213    bool showDialogs = true;
    214214    bool playCompleted = false;
    bool TV::StartTV(ProgramInfo *tvrec, uint flags) 
    222222        curProgram->SetIgnoreBookmark(flags & kStartTVIgnoreBookmark);
    223223    }
    224224
     225    PlaySettings settings(curProgram ? curProgram->GetPlaybackGroup() : "Default");
     226    TV *tv = new TV(&settings);
     227
    225228    // Initialize TV
    226229    if (!tv->Init())
    227230    {
    bool TV::StartTV(ProgramInfo *tvrec, uint flags) 
    252255        if (curProgram)
    253256        {
    254257            LOG(VB_PLAYBACK, LOG_INFO, LOC + "tv->Playback() -- begin");
    255             if (!tv->Playback(*curProgram))
     258            if (!tv->Playback(*curProgram, &settings))
    256259            {
    257260                quitAll = true;
    258261            }
    void TV::ResetKeys(void) 
    779782/** \fn TV::TV(void)
    780783 *  \sa Init(void)
    781784 */
    782 TV::TV(void)
     785TV::TV(PlaySettings *settings)
    783786    : // Configuration variables from database
    784787      baseFilters(""),
    785788      db_channel_format("<num> <sign>"),
    TV::TV(void) 
    877880    playerActive = 0;
    878881    playerLock.unlock();
    879882
    880     InitFromDB();
     883    InitFromDB(settings);
    881884
    882885    LOG(VB_PLAYBACK, LOG_INFO, LOC + "Finished creating TV object");
    883886}
    884887
    885 void TV::InitFromDB(void)
     888void TV::InitFromDB(PlaySettings *settings)
    886889{
    887890    QMap<QString,QString> kv;
    888891    kv["LiveTVIdleTimeout"]        = "0";
    void TV::InitFromDB(void) 
    928931        kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]);
    929932
    930933    MythDB::getMythDB()->GetSettings(kv);
     934    settings->AddToMap(kv);
    931935
    932936    QString db_time_format;
    933937    QString db_short_date_format;
    void TV::HandleOSDAskAllow(PlayerContext *ctx, QString action) 
    16851689    askAllowLock.unlock();
    16861690}
    16871691
    1688 int TV::Playback(const ProgramInfo &rcinfo)
     1692int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings)
    16891693{
    16901694    wantsToQuit   = false;
    16911695    jumpToProgram = false;
    int TV::Playback(const ProgramInfo &rcinfo) 
    16991703        return 0;
    17001704    }
    17011705
    1702     mctx->SetPlayingInfo(&rcinfo);
     1706    mctx->SetPlayingInfo(&rcinfo, settings);
    17031707    mctx->SetInitialTVState(false);
    17041708    HandleStateChange(mctx, mctx);
    17051709
    void TV::HandleStateChange(PlayerContext *mctx, PlayerContext *ctx) 
    20622066            QString msg = tr("%1 Settings")
    20632067                    .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup()));
    20642068            ctx->UnlockPlayingInfo(__FILE__, __LINE__);
    2065             if (count > 0)
     2069            if (count > 0 &&
     2070                ctx->playingInfo->GetPlaybackGroup() != "Default" &&
     2071                ctx->playingInfo->GetPlaybackGroup() != "Videos")
    20662072                SetOSDMessage(ctx, msg);
    20672073            ITVRestart(ctx, false);
    20682074        }
  • 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; 
    5959class OSDListTreeItemSelectedEvent;
    6060class TVBrowseHelper;
    6161struct osdInfo;
     62class PlaySettings;
    6263
    6364typedef QMap<QString,InfoMap>    DDValueMap;
    6465typedef QMap<QString,DDValueMap> DDKeyMap;
    class MTV_PUBLIC TV : public QObject 
    164165        unsigned long seconds;
    165166    };
    166167
    167     TV(void);
     168    TV(PlaySettings *settings);
    168169   ~TV();
    169170
    170     void InitFromDB(void);
     171    void InitFromDB(PlaySettings *settings);
    171172    bool Init(bool createWindow = true);
    172173
    173174    // User input processing commands
    class MTV_PUBLIC TV : public QObject 
    192193
    193194    // Recording commands
    194195    int  PlayFromRecorder(int recordernum);
    195     int  Playback(const ProgramInfo &rcinfo);
     196    int  Playback(const ProgramInfo &rcinfo, PlaySettings *settings);
    196197
    197198    // Commands used by frontend playback box
    198199    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; 
    88#include "mythlogging.h"
    99#include "videooutbase.h"
    1010#include "avformatdecoder.h"
     11#include "playsettings.h"
    1112
    1213bool ProfileItem::IsMatch(const QSize &size, float rate) const
    1314{
    priority_map_t VideoDisplayProfile::safe_renderer_priority; 
    212213pref_map_t  VideoDisplayProfile::dec_name;
    213214safe_list_t VideoDisplayProfile::safe_decoders;
    214215
    215 VideoDisplayProfile::VideoDisplayProfile()
     216VideoDisplayProfile::VideoDisplayProfile(PlaySettings *settings)
    216217    : lock(QMutex::Recursive), last_size(0,0), last_rate(0.0f),
    217218      last_video_renderer(QString::null)
    218219{
    VideoDisplayProfile::VideoDisplayProfile() 
    220221    init_statics();
    221222
    222223    QString hostname    = gCoreContext->GetHostName();
    223     QString cur_profile = GetDefaultProfileName(hostname);
     224    QString cur_profile = GetDefaultProfileName(hostname, settings);
    224225    uint    groupid     = GetProfileGroupID(cur_profile, hostname);
    225226
    226227    item_list_t items = LoadDB(groupid);
    QStringList VideoDisplayProfile::GetProfiles(const QString &hostname) 
    770771    return list;
    771772}
    772773
    773 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname)
     774QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname,
     775                                                   PlaySettings *settings)
    774776{
    775777    QString tmp =
     778        settings ? settings->GetSetting("DefaultVideoPlaybackProfile", "") :
    776779        gCoreContext->GetSettingOnHost("DefaultVideoPlaybackProfile", hostname);
    777780
    778781    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; 
    1414#include "mythtvexp.h"
    1515#include "mythcontext.h"
    1616
     17class PlaySettings;
     18
    1719typedef QMap<QString,QString>     pref_map_t;
    1820typedef QMap<QString,QStringList> safe_map_t;
    1921typedef QStringList               safe_list_t;
    typedef vector<ProfileItem> item_list_t; 
    8183class MTV_PUBLIC VideoDisplayProfile
    8284{
    8385  public:
    84     VideoDisplayProfile();
     86    VideoDisplayProfile(PlaySettings *settings);
    8587    ~VideoDisplayProfile();
    8688
    8789    void SetInput(const QSize &size);
    class MTV_PUBLIC VideoDisplayProfile 
    126128    static QString     GetDecoderName(const QString &decoder);
    127129    static QString     GetDecoderHelp(QString decoder = QString::null);
    128130
    129     static QString     GetDefaultProfileName(const QString &hostname);
     131    static QString     GetDefaultProfileName(const QString &hostname,
     132                                             PlaySettings *settings);
    130133    static void        SetDefaultProfileName(const QString &profilename,
    131134                                             const QString &hostname);
    132135    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, 
    5656#endif
    5757}
    5858
    59 VideoOutputD3D::VideoOutputD3D(void)
    60   : VideoOutput(),        m_lock(QMutex::Recursive),
     59VideoOutputD3D::VideoOutputD3D(PlaySettigns *settings)
     60  : VideoOutput(settings), m_lock(QMutex::Recursive),
    6161    m_hWnd(NULL),          m_render(NULL),
    6262    m_video(NULL),
    6363    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 
    1616{
    1717  public:
    1818    static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
    19     VideoOutputD3D();
     19    VideoOutputD3D(PlaySettings *settings);
    2020   ~VideoOutputD3D();
    2121
    2222    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, 
    2828    opts.priorities->insert("null", 10);
    2929}
    3030
    31 VideoOutputNull::VideoOutputNull() :
    32     VideoOutput(), global_lock(QMutex::Recursive)
     31VideoOutputNull::VideoOutputNull(PlaySettings *settings) :
     32    VideoOutput(settings), global_lock(QMutex::Recursive)
    3333{
    3434    LOG(VB_PLAYBACK, LOG_INFO, "VideoOutputNull()");
    3535    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 
    99{
    1010  public:
    1111    static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
    12     VideoOutputNull();
     12    VideoOutputNull(PlaySettings *settings);
    1313   ~VideoOutputNull();
    1414
    1515    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, 
    3838    opts.priorities->insert("opengl", 65);
    3939}
    4040
    41 VideoOutputOpenGL::VideoOutputOpenGL()
    42     : VideoOutput(),
     41VideoOutputOpenGL::VideoOutputOpenGL(PlaySettings *settings)
     42    : VideoOutput(settings),
    4343    gl_context_lock(QMutex::Recursive), gl_context(NULL), gl_valid(true),
    4444    gl_videochain(NULL), gl_pipchain_active(NULL),
    4545    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 
    1010{
    1111  public:
    1212    static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
    13     VideoOutputOpenGL();
     13    VideoOutputOpenGL(PlaySettings *settings);
    1414    virtual ~VideoOutputOpenGL();
    1515
    1616    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) 
    2525    opts.priorities->insert("openglvaapi", 120);
    2626}
    2727
    28 VideoOutputOpenGLVAAPI::VideoOutputOpenGLVAAPI()
    29   : VideoOutputOpenGL(), m_ctx(NULL), m_pauseBuffer(NULL)
     28VideoOutputOpenGLVAAPI::VideoOutputOpenGLVAAPI(PlaySettings *settings)
     29  : VideoOutputOpenGL(settings), m_ctx(NULL), m_pauseBuffer(NULL)
    3030{
    3131}
    3232
  • 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 
    1010  public:
    1111    static void GetRenderOptions(render_opts &opts);
    1212
    13     VideoOutputOpenGLVAAPI();
     13    VideoOutputOpenGLVAAPI(PlaySettings *settings);
    1414   ~VideoOutputOpenGLVAAPI();
    1515
    1616    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; 
    6666#include "mythlogging.h"
    6767#include "videodisplayprofile.h"
    6868
     69class PlaySettings;
     70
    6971#define LOC     QString("VideoOutputQuartz::")
    7072#define LOC_ERR QString("VideoOutputQuartz Error: ")
    7173
    void VideoOutputQuartz::GetRenderOptions(render_opts &opts, 
    11071109/** \class VideoOutputQuartz
    11081110 *  \brief Implementation of Quartz (Mac OS X windowing system) video output
    11091111 */
    1110 VideoOutputQuartz::VideoOutputQuartz() :
    1111     VideoOutput(), Started(false), data(new QuartzData())
     1112VideoOutputQuartz::VideoOutputQuartz(PlaySettings *settings) :
     1113    VideoOutput(settings), Started(false), data(new QuartzData())
    11121114{
    11131115    init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0);
    11141116}
    QStringList VideoOutputQuartz::GetAllowedRenderers( 
    17571759MythCodecID VideoOutputQuartz::GetBestSupportedCodec(
    17581760    uint width, uint height,
    17591761    uint osd_width, uint osd_height,
    1760     uint stream_type, uint fourcc)
     1762    uint stream_type, uint fourcc, PlaySettings *settings)
    17611763{
    17621764    (void) osd_width;
    17631765    (void) osd_height;
    17641766
    1765     VideoDisplayProfile vdp;
     1767    VideoDisplayProfile vdp(settings);
    17661768    vdp.SetInput(QSize(width, height));
    17671769    QString dec = vdp.GetDecoder();
    17681770    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  
    22#define VIDEOOUT_QUARTZ_H_
    33
    44struct QuartzData;
     5class PlaySettings;
    56
    67#include "videooutbase.h"
    78
    class VideoOutputQuartz : public VideoOutput 
    910{
    1011  public:
    1112    static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
    12     VideoOutputQuartz();
     13    VideoOutputQuartz(PlaySettings *settings);
    1314   ~VideoOutputQuartz();
    1415
    1516    bool Init(int width, int height, float aspect, WId winid,
    class VideoOutputQuartz : public VideoOutput 
    5152    static MythCodecID GetBestSupportedCodec(
    5253        uint width, uint height,
    5354        uint osd_width, uint osd_height,
    54         uint stream_type, uint fourcc);
     55        uint stream_type, uint fourcc, PlaySettings *settings);
    5556    virtual bool NeedExtraAudioDecode(void) const
    5657        { return !codec_is_std(video_codec_id); }
    5758
  • 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) 
    5252    opts.deints->insert("vdpau", deints);
    5353}
    5454
    55 VideoOutputVDPAU::VideoOutputVDPAU()
    56   : m_win(0),                m_render(NULL),
     55VideoOutputVDPAU::VideoOutputVDPAU(PlaySettings *settings)
     56  : VideoOutput(settings), m_win(0),           m_render(NULL),
    5757    m_decoder_buffer_size(MAX_REFERENCE_FRAMES),
    5858    m_process_buffer_size(DEF_PROCESS_BUFFER), m_pause_surface(0),
    5959    m_need_deintrefs(false), m_video_mixer(0), m_mixer_features(kVDPFeatNone),
    QStringList VideoOutputVDPAU::GetAllowedRenderers( 
    897897
    898898MythCodecID VideoOutputVDPAU::GetBestSupportedCodec(
    899899    uint width,       uint height,
    900     uint stream_type, bool no_acceleration)
     900    uint stream_type, bool no_acceleration, PlaySettings *settings)
    901901{
    902902    bool use_cpu = no_acceleration;
    903     VideoDisplayProfile vdp;
     903    VideoDisplayProfile vdp(settings);
    904904    vdp.SetInput(QSize(width, height));
    905905    QString dec = vdp.GetDecoder();
    906906
  • 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 
    2020{
    2121  public:
    2222    static void GetRenderOptions(render_opts &opts);
    23     VideoOutputVDPAU();
     23    VideoOutputVDPAU(PlaySettings *settings);
    2424    ~VideoOutputVDPAU();
    2525    bool Init(int width, int height, float aspect,
    2626              WId winid, const QRect &win_rect, MythCodecID codec_id);
    class VideoOutputVDPAU : public VideoOutput 
    5353                                    const QSize &video_dim);
    5454    static MythCodecID GetBestSupportedCodec(uint width, uint height,
    5555                                             uint stream_type,
    56                                              bool no_acceleration);
     56                                             bool no_acceleration,
     57                                             PlaySettings *settings);
    5758    virtual bool IsPIPSupported(void) const { return true;  }
    5859    virtual bool IsPBPSupported(void) const { return false; }
    5960    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, 
    136136 * \see VideoOutput, VideoBuffers
    137137 *
    138138 */
    139 VideoOutputXv::VideoOutputXv()
    140     : VideoOutput(),
     139VideoOutputXv::VideoOutputXv(PlaySettings *settings)
     140    : VideoOutput(settings),
    141141      video_output_subtype(XVUnknown),
    142142      global_lock(QMutex::Recursive),
    143143
    void VideoOutputXv::UngrabXvPort(MythXDisplay *disp, int port) 
    357357 * \return port number if it succeeds, else -1.
    358358 */
    359359int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root,
     360                                      PlaySettings *settings,
    360361                                      MythCodecID mcodecid,
    361362                                      uint width, uint height,
    362363                                      bool &xvsetdefaults,
    int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root, 
    381382    }
    382383
    383384    // figure out if we want chromakeying..
    384     VideoDisplayProfile vdp;
     385    VideoDisplayProfile vdp(settings);
    385386    vdp.SetInput(QSize(width, height));
    386387    if (vdp.GetOSDRenderer() == "chromakey")
    387388    {
    bool VideoOutputXv::InitXVideo() 
    594595    disp->StartLog();
    595596    QString adaptor_name = QString::null;
    596597    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,
    598599                                 video_dim.width(), video_dim.height(),
    599600                                 xv_set_defaults, &adaptor_name);
    600601    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 
    3030    friend class ChromaKeyOSD;
    3131  public:
    3232    static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
    33     VideoOutputXv();
     33    VideoOutputXv(PlaySettings *settings);
    3434   ~VideoOutputXv();
    3535
    3636    bool Init(int width, int height, float aspect,
    class VideoOutputXv : public VideoOutput 
    8181    static MythCodecID GetBestSupportedCodec(uint stream_type);
    8282
    8383    static int GrabSuitableXvPort(MythXDisplay* disp, Window root,
     84                                  PlaySettings *settings,
    8485                                  MythCodecID type,
    8586                                  uint width, uint height,
    8687                                  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  
    77#include "mythplayer.h"
    88#include "videodisplayprofile.h"
    99#include "decoderbase.h"
     10#include "playsettings.h"
    1011
    1112#include "mythcorecontext.h"
    1213#include "mythlogging.h"
    void VideoOutput::GetRenderOptions(render_opts &opts) 
    106107VideoOutput *VideoOutput::Create(
    107108    const QString &decoder, MythCodecID  codec_id,     void *codec_priv,
    108109    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)
    110111{
    111112    (void) codec_priv;
    112113
    VideoOutput *VideoOutput::Create( 
    151152    QString renderer = QString::null;
    152153    if (renderers.size() > 0)
    153154    {
    154         VideoDisplayProfile vprof;
     155        VideoDisplayProfile vprof(settings);
    155156        vprof.SetInput(video_dim);
    156157
    157158        QString tmp = vprof.GetVideoRenderer();
    VideoOutput *VideoOutput::Create( 
    179180
    180181#ifdef USING_MINGW
    181182        if (renderer == "direct3d")
    182             vo = new VideoOutputD3D();
     183            vo = new VideoOutputD3D(settings);
    183184#endif // USING_MINGW
    184185
    185186#ifdef USING_QUARTZ_VIDEO
    186187        if (osxlist.contains(renderer))
    187             vo = new VideoOutputQuartz();
     188            vo = new VideoOutputQuartz(settings);
    188189#endif // Q_OS_MACX
    189190
    190191#ifdef USING_OPENGL_VIDEO
    191192        if (renderer == "opengl")
    192             vo = new VideoOutputOpenGL();
     193            vo = new VideoOutputOpenGL(settings);
    193194#endif // USING_OPENGL_VIDEO
    194195
    195196#ifdef USING_VDPAU
    196197        if (renderer == "vdpau")
    197             vo = new VideoOutputVDPAU();
     198            vo = new VideoOutputVDPAU(settings);
    198199#endif // USING_VDPAU
    199200
    200201#ifdef USING_VAAPI
    201202        if (renderer == "openglvaapi")
    202             vo = new VideoOutputOpenGLVAAPI();
     203            vo = new VideoOutputOpenGLVAAPI(settings);
    203204#endif // USING_VAAPI
    204205
    205206#ifdef USING_XV
    206207        if (xvlist.contains(renderer))
    207             vo = new VideoOutputXv();
     208            vo = new VideoOutputXv(settings);
    208209#endif // USING_XV
    209210
    210211        if (vo)
    VideoOutput *VideoOutput::Create( 
    300301 * \brief This constructor for VideoOutput must be followed by an
    301302 *        Init(int,int,float,WId,int,int,int,int,WId) call.
    302303 */
    303 VideoOutput::VideoOutput() :
     304VideoOutput::VideoOutput(PlaySettings *_settings) :
    304305    // DB Settings
     306    window(_settings),
    305307    db_display_dim(0,0),
    306308    db_aspectoverride(kAspect_Off), db_adjustfill(kAdjustFill_Off),
    307309    db_letterbox_colour(kLetterBoxColour_Black),
    VideoOutput::VideoOutput() : 
    340342    osd_painter(NULL),                  osd_image(NULL),
    341343
    342344    // Visualisation
    343     m_visual(NULL)
     345    m_visual(NULL),
     346
     347    settings(_settings)
    344348{
    345349    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));
    348352
    349353    db_aspectoverride = (AspectOverrideMode)
    350         gCoreContext->GetNumSetting("AspectOverride",      0);
     354        settings->GetNumSetting("AspectOverride",      0);
    351355    db_adjustfill = (AdjustFillMode)
    352         gCoreContext->GetNumSetting("AdjustFill",          0);
     356        settings->GetNumSetting("AdjustFill",          0);
    353357    db_letterbox_colour = (LetterBoxColour)
    354         gCoreContext->GetNumSetting("LetterboxColour",     0);
     358        settings->GetNumSetting("LetterboxColour",     0);
    355359
    356360    if (!gCoreContext->IsDatabaseIgnored())
    357         db_vdisp_profile = new VideoDisplayProfile();
     361        db_vdisp_profile = new VideoDisplayProfile(settings);
    358362}
    359363
    360364/**
    QString VideoOutput::GetFilters(void) const 
    430434    return QString::null;
    431435}
    432436
    433 bool VideoOutput::IsPreferredRenderer(QSize video_size)
     437bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings)
    434438{
    435439    if (!db_vdisp_profile || (video_size == window.GetVideoDispDim()))
    436440        return true;
    437441
    438     VideoDisplayProfile vdisp;
     442    VideoDisplayProfile vdisp(settings);
    439443    vdisp.SetInput(video_size);
    440444    QString new_rend = vdisp.GetVideoRenderer();
    441445    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; 
    3636class FilterManager;
    3737class AudioPlayer;
    3838class MythRender;
     39class PlaySettings;
    3940
    4041typedef QMap<MythPlayer*,PIPLocation> PIPMap;
    4142
    class VideoOutput 
    5152    static VideoOutput *Create(
    5253        const QString &decoder, MythCodecID  codec_id,     void *codec_priv,
    5354        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);
    5556
    56     VideoOutput();
     57    VideoOutput(PlaySettings *settings);
    5758    virtual ~VideoOutput();
    5859
    5960    virtual bool Init(int width, int height, float aspect,
    6061                      WId winid, const QRect &win_rect, MythCodecID codec_id);
    6162    virtual void InitOSD(OSD *osd);
    6263    virtual void SetVideoFrameRate(float);
    63     virtual bool IsPreferredRenderer(QSize video_size);
     64    virtual bool IsPreferredRenderer(QSize video_size, PlaySettings *settings);
    6465    virtual bool SetDeinterlacingEnabled(bool);
    6566    virtual bool SetupDeinterlace(bool i, const QString& ovrf="");
    6667    virtual void FallbackDeint(void);
    class VideoOutput 
    333334
    334335    // Visualisation
    335336    VideoVisual     *m_visual;
     337
     338    PlaySettings *settings;
    336339};
    337340
    338341#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  
    2929
    3030#include "videooutwindow.h"
    3131#include "osd.h"
     32#include "playsettings.h"
    3233#include "mythplayer.h"
    3334#include "videodisplayprofile.h"
    3435#include "decoderbase.h"
    const float VideoOutWindow::kManualZoomMinHorizontalZoom = 0.5f; 
    5253const float VideoOutWindow::kManualZoomMinVerticalZoom   = 0.5f;
    5354const int   VideoOutWindow::kManualZoomMaxMove           = 50;
    5455
    55 VideoOutWindow::VideoOutWindow() :
     56VideoOutWindow::VideoOutWindow(PlaySettings *_settings) :
    5657    // DB settings
    5758    db_move(0, 0), db_scale_horiz(0.0f), db_scale_vert(0.0f),
    5859    db_pip_size(26),
    VideoOutWindow::VideoOutWindow() : 
    8586
    8687    // Various state variables
    8788    embedding(false), needrepaint(false),
    88     allowpreviewepg(true), pip_state(kPIPOff)
     89    allowpreviewepg(true), pip_state(kPIPOff),
     90
     91    settings(_settings)
    8992{
    9093    db_pip_size = gCoreContext->GetNumSetting("PIPSize", 26);
    9194
    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));
    9497    db_use_gui_size = gCoreContext->GetNumSetting("GuiSizeForTV", 0);
    9598
    9699    QDesktopWidget *desktop = NULL;
    void VideoOutWindow::SetVideoScalingAllowed(bool change) 
    635638    if (change)
    636639    {
    637640        db_scale_vert =
    638             gCoreContext->GetNumSetting("VertScanPercentage", 0) * 0.01f;
     641            settings->GetNumSetting("VertScanPercentage", 0) * 0.01f;
    639642        db_scale_horiz =
    640             gCoreContext->GetNumSetting("HorizScanPercentage", 0) * 0.01f;
     643            settings->GetNumSetting("HorizScanPercentage", 0) * 0.01f;
    641644        db_scaling_allowed = true;
    642645    }
    643646    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  
    1616#include "videoouttypes.h"
    1717
    1818class MythPlayer;
     19class PlaySettings;
    1920
    2021class VideoOutWindow
    2122{
    2223  public:
    23     VideoOutWindow();
     24    VideoOutWindow(PlaySettings *settings);
    2425
    2526    bool Init(const QSize &new_video_dim, float aspect,
    2627              const QRect &new_display_visible_rect,
    class VideoOutWindow 
    167168    bool     allowpreviewepg;
    168169    PIPState pip_state;
    169170
     171    PlaySettings *settings;
     172
    170173    // Constants
    171174    static const float kManualZoomMaxHorizontalZoom;
    172175    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  
    3434
    3535#include "mythcontext.h"
    3636#include "mythmainwindow.h"
     37#include "playsettings.h"
    3738
    3839#ifdef USING_XV
    3940#include "videoout_xv.h"
    int VideoSync::m_forceskip = 0; 
    7475 *  \brief Returns the most sophisticated video sync method available.
    7576 */
    7677VideoSync *VideoSync::BestMethod(VideoOutput *video_output,
     78                                 PlaySettings *settings,
    7779                                 uint frame_interval, uint refresh_interval,
    7880                                 bool halve_frame_interval)
    7981{
  • 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 
    8989
    9090    // documented in vsync.cpp
    9191    static VideoSync *BestMethod(VideoOutput*,
     92                                 PlaySettings *settings,
    9293                                 uint frame_interval, uint refresh_interval,
    9394                                 bool interlaced);
    9495  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; 
    2020#include "compat.h"
    2121#include "dbcheck.h"
    2222#include "mythlogging.h"
     23#include "playsettings.h"
    2324
    2425// libmythui
    2526#include "mythuihelper.h"
    int main(int argc, char *argv[]) 
    122123
    123124    GetMythUI()->LoadQtConfig();
    124125
    125 #if defined(Q_OS_MACX)
    126     // Mac OS X doesn't define the AudioOutputDevice setting
    127 #else
    128     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 #endif
    136 
    137126    MythMainWindow *mainWindow = GetMythMainWindow();
    138127    mainWindow->Init();
    139128
    int main(int argc, char *argv[]) 
    146135        return GENERIC_EXIT_DB_OUTOFDATE;
    147136    }
    148137
    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);
    150159    if (!tv->Init())
    151160    {
    152161        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  
    3838#include "mythconfig.h"
    3939#include "mythdirs.h"
    4040#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
     94static 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 + ")");
    41153
    42 static HostCheckBox *DecodeExtraAudio()
     154    return obj;
     155}
     156
     157static Setting *DecodeExtraAudio(PlaySettings *settings)
    43158{
    44     HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");
     159    CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings);
    45160    gc->setLabel(QObject::tr("Extra audio buffering"));
    46161    gc->setValue(true);
    47162    gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing "
    static HostCheckBox *DecodeExtraAudio() 
    50165                    "effect on framegrabbers (MPEG-4/RTJPEG). MythTV will "
    51166                    "keep extra audio data in its internal buffers to "
    52167                    "workaround this bug."));
    53     return gc;
     168    return wrap(gc, settings);
    54169}
    55170
    56 static HostComboBox *PIPLocationComboBox()
     171static Setting *PIPLocationComboBox(PlaySettings *settings)
    57172{
    58     HostComboBox *gc = new HostComboBox("PIPLocation");
     173    CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings);
    59174    gc->setLabel(QObject::tr("PIP video location"));
    60175    for (uint loc = 0; loc < kPIP_END; ++loc)
    61176        gc->addSelection(toString((PIPLocation) loc), QString::number(loc));
    62177    gc->setHelpText(QObject::tr("Location of PIP Video window."));
    63     return gc;
     178    return wrap(gc, settings);
    64179}
    65180
    66181static HostComboBox *DisplayRecGroup()
    static HostCheckBox *PBBStartInTitle() 
    146261    return gc;
    147262}
    148263
    149 static HostCheckBox *SmartForward()
     264static Setting *SmartForward(PlaySettings *settings)
    150265{
    151     HostCheckBox *gc = new HostCheckBox("SmartForward");
     266    CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings);
    152267    gc->setLabel(QObject::tr("Smart fast forwarding"));
    153268    gc->setValue(false);
    154269    gc->setHelpText(QObject::tr("If enabled, then immediately after "
    155270                    "rewinding, only skip forward the same amount as "
    156271                    "skipping backwards."));
    157     return gc;
     272    return wrap(gc, settings);
    158273}
    159274
    160 static HostCheckBox *ExactSeeking()
     275static Setting *ExactSeeking(PlaySettings *settings)
    161276{
    162     HostCheckBox *gc = new HostCheckBox("ExactSeeking");
     277    CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings);
    163278    gc->setLabel(QObject::tr("Seek to exact frame"));
    164279    gc->setValue(false);
    165280    gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but "
    166281                    "slower."));
    167     return gc;
     282    return wrap(gc, settings);
    168283}
    169284
    170285static GlobalComboBox *CommercialSkipMethod()
    static GlobalCheckBox *CommFlagFast() 
    192307    return gc;
    193308}
    194309
    195 static HostComboBox *AutoCommercialSkip()
     310static Setting *AutoCommercialSkip(PlaySettings *settings)
    196311{
    197     HostComboBox *gc = new HostComboBox("AutoCommercialSkip");
     312    CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings);
    198313    gc->setLabel(QObject::tr("Automatically skip commercials"));
    199314    gc->addSelection(QObject::tr("Off"), "0");
    200315    gc->addSelection(QObject::tr("Notify, but do not skip"), "2");
    static HostComboBox *AutoCommercialSkip() 
    203318                    "have been flagged during automatic commercial detection "
    204319                    "or by the mythcommflag program, or just notify that a "
    205320                    "commercial has been detected."));
    206     return gc;
     321    return wrap(gc, settings);
    207322}
    208323
    209324static GlobalCheckBox *AutoMetadataLookup()
    static GlobalCheckBox *AggressiveCommDetect() 
    277392    return bc;
    278393}
    279394
    280 static HostSpinBox *CommRewindAmount()
     395static Setting *CommRewindAmount(PlaySettings *settings)
    281396{
    282     HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);
     397    CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false);
    283398    gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)"));
    284399    gs->setHelpText(QObject::tr("MythTV will automatically rewind "
    285400                    "this many seconds after performing a commercial skip."));
    286401    gs->setValue(0);
    287     return gs;
     402    return wrap(gs, settings);
    288403}
    289404
    290 static HostSpinBox *CommNotifyAmount()
     405static Setting *CommNotifyAmount(PlaySettings *settings)
    291406{
    292     HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);
     407    CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false);
    293408    gs->setLabel(QObject::tr("Commercial skip notify amount (secs)"));
    294409    gs->setHelpText(QObject::tr("MythTV will act like a commercial "
    295410                    "begins this many seconds early. This can be useful "
    296411                    "when commercial notification is used in place of "
    297412                    "automatic skipping."));
    298413    gs->setValue(0);
    299     return gs;
     414    return wrap(gs, settings);
    300415}
    301416
    302417static GlobalSpinBox *MaximumCommercialSkip()
    void PlaybackProfileConfig::swap(int i, int j) 
    10981213    labels[j]->setValue(label_i);
    10991214}
    11001215
    1101 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) :
     1216PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str,
     1217                                               PlaySettings *settings) :
    11021218    TriggeredConfigurationGroup(false, true,  true, true,
    11031219                                false, false, true, true), grouptrigger(NULL)
    11041220{
    11051221    setLabel(QObject::tr("Playback Profiles") + str);
     1222    if (settings)
     1223        setLabel(QObject::tr("Playback group settings for ") +
     1224                 settings->mGroupName + " - " +
     1225                 getLabel());
    11061226
    11071227    QString host = gCoreContext->GetHostName();
    11081228    QStringList profiles = VideoDisplayProfile::GetProfiles(host);
    PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) : 
    11301250        profiles = VideoDisplayProfile::GetProfiles(host);
    11311251    }
    11321252
    1133     QString profile = VideoDisplayProfile::GetDefaultProfileName(host);
     1253    QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings);
    11341254    if (!profiles.contains(profile))
    11351255    {
    11361256        profile = (profiles.contains("Normal")) ? "Normal" : profiles[0];
    11371257        VideoDisplayProfile::SetDefaultProfileName(profile, host);
    11381258    }
    11391259
    1140     grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile");
     1260    CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings);
     1261    grouptrigger = gs;
    11411262    grouptrigger->setLabel(QObject::tr("Current Video Playback Profile"));
    11421263    QStringList::const_iterator it;
    11431264    for (it = profiles.begin(); it != profiles.end(); ++it)
    11441265        grouptrigger->addSelection(ProgramInfo::i18n(*it), *it);
     1266    if (settings)
     1267    {
     1268        addChild(wrap(grouptrigger, settings));
     1269        return;
     1270    }
    11451271
    11461272    HorizontalConfigurationGroup *grp =
    11471273        new HorizontalConfigurationGroup(false, false, true, true);
    static HostComboBox *PlayBoxEpisodeSort() 
    12741400    return gc;
    12751401}
    12761402
    1277 static HostSpinBox *FFRewReposTime()
     1403static Setting *FFRewReposTime(PlaySettings *settings)
    12781404{
    1279     HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);
     1405    CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false);
    12801406    gs->setLabel(QObject::tr("Fast forward/rewind reposition amount"));
    12811407    gs->setValue(100);
    12821408    gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind "
    static HostSpinBox *FFRewReposTime() 
    12841410                    "resuming normal playback. This "
    12851411                    "compensates for the reaction time between seeing "
    12861412                    "where to resume playback and actually exiting seeking."));
    1287     return gs;
     1413    return wrap(gs, settings);
    12881414}
    12891415
    1290 static HostCheckBox *FFRewReverse()
     1416static Setting *FFRewReverse(PlaySettings *settings)
    12911417{
    1292     HostCheckBox *gc = new HostCheckBox("FFRewReverse");
     1418    CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings);
    12931419    gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind"));
    12941420    gc->setValue(true);
    12951421    gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key "
    static HostCheckBox *FFRewReverse() 
    12971423                    "vice versa. If disabled, it will decrease the "
    12981424                    "current speed or switch to play mode if "
    12991425                    "the speed can't be decreased further."));
    1300     return gc;
     1426    return wrap(gc, settings);
    13011427}
    13021428
    13031429static HostComboBox *MenuTheme()
    static HostComboBox MUNUSED *DecodeVBIFormat() 
    13341460    return gc;
    13351461}
    13361462
    1337 static HostSpinBox *OSDCC708TextZoomPercentage(void)
     1463static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings)
    13381464{
    1339     HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5);
     1465    CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings,
     1466                           50, 200, 5, false);
    13401467    gs->setLabel(QObject::tr("Subtitle text zoom percentage"));
    13411468    gs->setValue(100);
    13421469    gs->setHelpText(QObject::tr("Use this to enlarge or shrink text based subtitles."));
    13431470
    1344     return gs;
     1471    return wrap(gs, settings);
    13451472}
    13461473
    13471474static HostComboBox *SubtitleFont()
    static HostComboBox *SubtitleFont() 
    13611488    return hcb;
    13621489}
    13631490
    1364 static HostComboBox *SubtitleCodec()
     1491static Setting *SubtitleCodec(PlaySettings *settings)
    13651492{
    1366     HostComboBox *gc = new HostComboBox("SubtitleCodec");
     1493    CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings);
    13671494
    13681495    gc->setLabel(QObject::tr("Subtitle Codec"));
    13691496    QList<QByteArray> list = QTextCodec::availableCodecs();
    static HostComboBox *SubtitleCodec() 
    13731500        gc->addSelection(val, val, val.toLower() == "utf-8");
    13741501    }
    13751502
    1376     return gc;
     1503    return wrap(gc, settings);
    13771504}
    13781505
    13791506static HostComboBox *ChannelOrdering()
    static HostComboBox *ChannelOrdering() 
    13851512    return gc;
    13861513}
    13871514
    1388 static HostSpinBox *VertScanPercentage()
     1515static Setting *VertScanPercentage(PlaySettings *settings)
    13891516{
    1390     HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1);
     1517    CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings,
     1518                           -100, 100, 1, false);
    13911519    gs->setLabel(QObject::tr("Vertical scaling"));
    13921520    gs->setValue(0);
    13931521    gs->setHelpText(QObject::tr(
    13941522                        "Adjust this if the image does not fill your "
    13951523                        "screen vertically. Range -100% to 100%"));
    1396     return gs;
     1524    return wrap(gs, settings);
    13971525}
    13981526
    1399 static HostSpinBox *HorizScanPercentage()
     1527static Setting *HorizScanPercentage(PlaySettings *settings)
    14001528{
    1401     HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1);
     1529    CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings,
     1530                           -100, 100, 1, false);
    14021531    gs->setLabel(QObject::tr("Horizontal scaling"));
    14031532    gs->setValue(0);
    14041533    gs->setHelpText(QObject::tr(
    14051534                        "Adjust this if the image does not fill your "
    14061535                        "screen horizontally. Range -100% to 100%"));
    1407     return gs;
     1536    return wrap(gs, settings);
    14081537};
    14091538
    1410 static HostSpinBox *XScanDisplacement()
     1539static Setting *XScanDisplacement(PlaySettings *settings)
    14111540{
    1412     HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1);
     1541    CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings,
     1542                           -50, 50, 1, false);
    14131543    gs->setLabel(QObject::tr("Scan displacement (X)"));
    14141544    gs->setValue(0);
    14151545    gs->setHelpText(QObject::tr("Adjust this to move the image horizontally."));
    1416     return gs;
     1546    return wrap(gs, settings);
    14171547}
    14181548
    1419 static HostSpinBox *YScanDisplacement()
     1549static Setting *YScanDisplacement(PlaySettings *settings)
    14201550{
    1421     HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1);
     1551    CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings,
     1552                           -50, 50, 1, false);
    14221553    gs->setLabel(QObject::tr("Scan displacement (Y)"));
    14231554    gs->setValue(0);
    14241555    gs->setHelpText(QObject::tr("Adjust this to move the image vertically."));
    1425     return gs;
     1556    return wrap(gs, settings);
    14261557};
    14271558
    1428 static HostCheckBox *CCBackground()
     1559static Setting *CCBackground(PlaySettings *settings)
    14291560{
    1430     HostCheckBox *gc = new HostCheckBox("CCBackground");
     1561    CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings);
    14311562    gc->setLabel(QObject::tr("Black background for closed captioning"));
    14321563    gc->setValue(false);
    14331564    gc->setHelpText(QObject::tr(
    14341565                        "If enabled, captions will be displayed "
    14351566                        "as white text over a black background "
    14361567                        "for better contrast."));
    1437     return gc;
     1568    return wrap(gc, settings);
    14381569}
    14391570
    1440 static HostCheckBox *DefaultCCMode()
     1571static Setting *DefaultCCMode(PlaySettings *settings)
    14411572{
    1442     HostCheckBox *gc = new HostCheckBox("DefaultCCMode");
     1573    CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings);
    14431574    gc->setLabel(QObject::tr("Always display closed captioning or subtitles"));
    14441575    gc->setValue(false);
    14451576    gc->setHelpText(QObject::tr(
    static HostCheckBox *DefaultCCMode() 
    14471578                        "when playing back recordings or watching "
    14481579                        "Live TV. Closed Captioning can be turned on or off "
    14491580                        "by pressing \"T\" during playback."));
    1450     return gc;
     1581    return wrap(gc, settings);
    14511582}
    14521583
    1453 static HostCheckBox *PreferCC708()
     1584static Setting *PreferCC708(PlaySettings *settings)
    14541585{
    1455     HostCheckBox *gc = new HostCheckBox("Prefer708Captions");
     1586    CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings);
    14561587    gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions"));
    14571588    gc->setValue(true);
    14581589    gc->setHelpText(
    static HostCheckBox *PreferCC708() 
    14601591            "If enabled, the newer EIA-708 captions will be preferred over "
    14611592            "the older EIA-608 captions in ATSC streams."));
    14621593
    1463     return gc;
     1594    return wrap(gc, settings);
    14641595}
    14651596
    1466 static HostCheckBox *EnableMHEG()
     1597static Setting *EnableMHEG(PlaySettings *settings)
    14671598{
    1468     HostCheckBox *gc = new HostCheckBox("EnableMHEG");
     1599    CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings);
    14691600    gc->setLabel(QObject::tr("Enable interactive TV"));
    14701601    gc->setValue(false);
    14711602    gc->setHelpText(QObject::tr(
    14721603                        "If enabled, interactive TV applications (MHEG) will "
    14731604                        "be activated. This is used for teletext and logos for "
    14741605                        "radio and channels that are currently off-air."));
    1475     return gc;
     1606    return wrap(gc, settings);
    14761607}
    14771608
    1478 static HostCheckBox *PersistentBrowseMode()
     1609static Setting *PersistentBrowseMode(PlaySettings *settings)
    14791610{
    1480     HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");
     1611    CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings);
    14811612    gc->setLabel(QObject::tr("Always use browse mode in Live TV"));
    14821613    gc->setValue(true);
    14831614    gc->setHelpText(
    14841615        QObject::tr(
    14851616            "If enabled, browse mode will automatically be activated "
    14861617            "whenever you use channel up/down while watching Live TV."));
    1487     return gc;
     1618    return wrap(gc, settings);
    14881619}
    14891620
    1490 static HostCheckBox *BrowseAllTuners()
     1621static Setting *BrowseAllTuners(PlaySettings *settings)
    14911622{
    1492     HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");
     1623    CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings);
    14931624    gc->setLabel(QObject::tr("Browse all channels"));
    14941625    gc->setValue(false);
    14951626    gc->setHelpText(
    static HostCheckBox *BrowseAllTuners() 
    14971628            "If enabled, browse mode will shows channels on all "
    14981629            "available recording devices, instead of showing "
    14991630            "channels on just the current recorder."));
    1500     return gc;
     1631    return wrap(gc, settings);
    15011632}
    15021633
    1503 static HostCheckBox *ClearSavedPosition()
     1634static Setting *ClearSavedPosition(PlaySettings *settings)
    15041635{
    1505     HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");
     1636    CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings);
    15061637    gc->setLabel(QObject::tr("Clear bookmark on playback"));
    15071638    gc->setValue(true);
    15081639    gc->setHelpText(QObject::tr("If enabled, automatically clear the "
    15091640                    "bookmark on a recording when the recording is played "
    15101641                    "back. If disabled, you can mark the beginning with "
    15111642                    "rewind then save position."));
    1512     return gc;
     1643    return wrap(gc, settings);
    15131644}
    15141645
    1515 static HostCheckBox *AltClearSavedPosition()
     1646static Setting *AltClearSavedPosition(PlaySettings *settings)
    15161647{
    1517     HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");
     1648    CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings);
    15181649    gc->setLabel(QObject::tr("Alternate clear and save bookmark"));
    15191650    gc->setValue(true);
    15201651    gc->setHelpText(QObject::tr("During playback the SELECT key "
    static HostCheckBox *AltClearSavedPosition() 
    15221653                    "Saved\" and \"Bookmark Cleared\". If disabled, the "
    15231654                    "SELECT key will save the current position for each "
    15241655                    "keypress."));
    1525     return gc;
     1656    return wrap(gc, settings);
    15261657}
    15271658
    1528 static HostComboBox *PlaybackExitPrompt()
     1659static Setting *PlaybackExitPrompt(PlaySettings *settings)
    15291660{
    1530     HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");
     1661    CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings);
    15311662    gc->setLabel(QObject::tr("Action on playback exit"));
    15321663    gc->addSelection(QObject::tr("Just exit"), "0");
    15331664    gc->addSelection(QObject::tr("Save position and exit"), "2");
    static HostComboBox *PlaybackExitPrompt() 
    15381669                    "when you exit playback mode. The options available will "
    15391670                    "allow you to save your position, delete the "
    15401671                    "recording, or continue watching."));
    1541     return gc;
     1672    return wrap(gc, settings);
    15421673}
    15431674
    1544 static HostCheckBox *EndOfRecordingExitPrompt()
     1675static Setting *EndOfRecordingExitPrompt(PlaySettings *settings)
    15451676{
    1546     HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");
     1677    CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings);
    15471678    gc->setLabel(QObject::tr("Prompt at end of recording"));
    15481679    gc->setValue(false);
    15491680    gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing "
    15501681                    "you to delete the recording when it has finished "
    15511682                    "playing."));
    1552     return gc;
     1683    return wrap(gc, settings);
    15531684}
    15541685
    1555 static HostCheckBox *JumpToProgramOSD()
     1686static Setting *JumpToProgramOSD(PlaySettings *settings)
    15561687{
    1557     HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");
     1688    CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings);
    15581689    gc->setLabel(QObject::tr("Jump to program OSD"));
    15591690    gc->setValue(true);
    15601691    gc->setHelpText(QObject::tr(
    static HostCheckBox *JumpToProgramOSD() 
    15631694                        "'Watch Recording' screen when 'Jump to Program' "
    15641695                        "is activated. If enabled, the recordings are shown "
    15651696                        "in the OSD"));
    1566     return gc;
     1697    return wrap(gc, settings);
    15671698}
    15681699
    1569 static HostCheckBox *ContinueEmbeddedTVPlay()
     1700static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings)
    15701701{
    1571     HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");
     1702    CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings);
    15721703    gc->setLabel(QObject::tr("Continue playback when embedded"));
    15731704    gc->setValue(false);
    15741705    gc->setHelpText(QObject::tr(
    static HostCheckBox *ContinueEmbeddedTVPlay() 
    15761707                    "is embedded in the upcoming program list or recorded "
    15771708                    "list. The default is to pause the recorded show when "
    15781709                    "embedded."));
    1579     return gc;
     1710    return wrap(gc, settings);
    15801711}
    15811712
    1582 static HostCheckBox *AutomaticSetWatched()
     1713static Setting *AutomaticSetWatched(PlaySettings *settings)
    15831714{
    1584     HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");
     1715    CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings);
    15851716    gc->setLabel(QObject::tr("Automatically mark a recording as watched"));
    15861717    gc->setValue(false);
    15871718    gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a "
    static HostCheckBox *AutomaticSetWatched() 
    15891720                    "detection is not foolproof, so do not enable this "
    15901721                    "setting if you don't want an unwatched recording marked "
    15911722                    "as watched."));
    1592     return gc;
     1723    return wrap(gc, settings);
    15931724}
    15941725
    15951726static HostSpinBox *LiveTVIdleTimeout()
    static HostComboBox *XineramaMonitorAspectRatio() 
    17791910    return gc;
    17801911}
    17811912
    1782 static HostComboBox *LetterboxingColour()
     1913static Setting *LetterboxingColour(PlaySettings *settings)
    17831914{
    1784     HostComboBox *gc = new HostComboBox("LetterboxColour");
     1915    CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings);
    17851916    gc->setLabel(QObject::tr("Letterboxing color"));
    17861917    for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
    17871918        gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
    static HostComboBox *LetterboxingColour() 
    17911922            "letterboxing, but those with plasma screens may prefer gray "
    17921923            "to minimize burn-in.") + " " +
    17931924        QObject::tr("Currently only works with XVideo video renderer."));
    1794     return gc;
     1925    return wrap(gc, settings);
    17951926}
    17961927
    1797 static HostComboBox *AspectOverride()
     1928static Setting *AspectOverride(PlaySettings *settings)
    17981929{
    1799     HostComboBox *gc = new HostComboBox("AspectOverride");
     1930    CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings);
    18001931    gc->setLabel(QObject::tr("Video aspect override"));
    18011932    for (int m = kAspect_Off; m < kAspect_END; ++m)
    18021933        gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
    static HostComboBox *AspectOverride() 
    18041935                        "When enabled, these will override the aspect "
    18051936                        "ratio specified by any broadcaster for all "
    18061937                        "video streams."));
    1807     return gc;
     1938    return wrap(gc, settings);
    18081939}
    18091940
    1810 static HostComboBox *AdjustFill()
     1941static Setting *AdjustFill(PlaySettings *settings)
    18111942{
    1812     HostComboBox *gc = new HostComboBox("AdjustFill");
     1943    CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings);
    18131944    gc->setLabel(QObject::tr("Zoom"));
    18141945    for (int m = kAdjustFill_Off; m < kAdjustFill_END; ++m)
    18151946        gc->addSelection(toString((AdjustFillMode)m), QString::number(m));
    static HostComboBox *AdjustFill() 
    18201951    gc->setHelpText(QObject::tr(
    18211952                        "When enabled, these will apply a predefined "
    18221953                        "zoom to all video playback in MythTV."));
    1823     return gc;
     1954    return wrap(gc, settings);
    18241955}
    18251956
    18261957// Theme settings
    static HostLineEdit *UDPNotifyPort() 
    27112842    return ge;
    27122843}
    27132844
    2714 static HostCheckBox *RealtimePriority()
     2845static Setting *RealtimePriority(PlaySettings *settings)
    27152846{
    2716     HostCheckBox *gc = new HostCheckBox("RealtimePriority");
     2847    CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings);
    27172848    gc->setLabel(QObject::tr("Enable realtime priority threads"));
    27182849    gc->setHelpText(QObject::tr("When running mythfrontend with root "
    27192850                    "privileges, some threads can be given enhanced priority. "
    27202851                    "Disable this if mythfrontend freezes during video "
    27212852                    "playback."));
    27222853    gc->setValue(true);
    2723     return gc;
     2854    return wrap(gc, settings, false);
    27242855}
    27252856
    27262857static HostCheckBox *EnableMediaMon()
    static HostCheckBox *WatchTVGuide() 
    32863417    return gc;
    32873418}
    32883419
    3289 MainGeneralSettings::MainGeneralSettings()
     3420MainGeneralSettings::MainGeneralSettings(PlaySettings *settings,
     3421                                         ConfigurationWizard *base)
    32903422{
     3423    if (!settings)
     3424    {
    32913425    DatabaseSettings::addDatabaseSettings(this);
    32923426
    32933427    VerticalConfigurationGroup *pin =
    MainGeneralSettings::MainGeneralSettings() 
    33363470    remotecontrol->addChild(NetworkControlPort());
    33373471    remotecontrol->addChild(UDPNotifyPort());
    33383472    addChild(remotecontrol);
     3473    }
    33393474}
    33403475
    3341 PlaybackSettings::PlaybackSettings()
     3476PlaybackSettings::PlaybackSettings(PlaySettings *settings,
     3477                                   ConfigurationWizard *base)
    33423478{
    33433479    uint i = 0, total = 8;
    33443480#if CONFIG_DARWIN
    33453481    total += 2;
    33463482#endif // USING_DARWIN
     3483    if (settings)
     3484        total -= 3;
    33473485
    33483486
    33493487    VerticalConfigurationGroup* general1 =
    33503488        new VerticalConfigurationGroup(false);
    33513489    general1->setLabel(QObject::tr("General Playback") +
    33523490                      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());
    33533495
    33543496    HorizontalConfigurationGroup *columns =
    33553497        new HorizontalConfigurationGroup(false, false, true, true);
    33563498
    33573499    VerticalConfigurationGroup *column1 =
    33583500        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));
    33623505    columns->addChild(column1);
    33633506
    33643507    VerticalConfigurationGroup *column2 =
    33653508        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));
    33703513    columns->addChild(column2);
    33713514
    33723515    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);
    33753522
    33763523    VerticalConfigurationGroup* general2 =
    33773524        new VerticalConfigurationGroup(false);
    33783525    general2->setLabel(QObject::tr("General Playback") +
    33793526                      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());
    33803531
    33813532    HorizontalConfigurationGroup* oscan =
    33823533        new HorizontalConfigurationGroup(false, false, true, true);
    PlaybackSettings::PlaybackSettings() 
    33843535        new VerticalConfigurationGroup(false, false, true, true);
    33853536    VerticalConfigurationGroup *ocol2 =
    33863537        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));
    33913542    oscan->addChild(ocol1);
    33923543    oscan->addChild(ocol2);
    33933544
    33943545    HorizontalConfigurationGroup* aspect_fill =
    33953546        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));
    33983549
    33993550    general2->addChild(oscan);
    34003551    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);
    34063560
    34073561    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));
    34093566
     3567    if (!settings)
     3568    {
    34103569    VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false);
    34113570    pbox->setLabel(QObject::tr("View Recordings") +
    34123571                   QString(" (%1/%2)").arg(++i).arg(total));
    PlaybackSettings::PlaybackSettings() 
    34333592    pbox3->addChild(DisplayGroupTitleSort());
    34343593    pbox3->addChild(new WatchListSettings());
    34353594    addChild(pbox3);
     3595    }
    34363596
    34373597    VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false);
    34383598    seek->setLabel(QObject::tr("Seeking") +
    34393599                   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);
    34453612
    34463613    VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false);
    34473614    comms->setLabel(QObject::tr("Commercial Skip") +
    34483615                    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    {
    34523625    comms->addChild(MaximumCommercialSkip());
    34533626    comms->addChild(MergeShortCommBreaks());
    3454     addChild(comms);
     3627    }
     3628    if (base)
     3629        base->addChild(comms);
     3630    else
     3631        addChild(comms);
    34553632
    34563633#if CONFIG_DARWIN
    34573634    VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false);
    34583635    mac1->setLabel(QObject::tr("Mac OS X Video Settings") +
    34593636                   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    {
    34603643    mac1->addChild(MacGammaCorrect());
    34613644    mac1->addChild(MacScaleUp());
    34623645    mac1->addChild(MacFullSkip());
    3463     addChild(mac1);
     3646    }
     3647    if (base)
     3648        base->addChild(mac1);
     3649    else
     3650        addChild(mac1);
    34643651
    34653652    VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false);
    34663653    mac2->setLabel(QObject::tr("Mac OS X Video Settings") +
    34673654                   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    {
    34683661    mac2->addChild(new MacMainSettings());
    34693662    mac2->addChild(new MacFloatSettings());
    34703663
    PlaybackSettings::PlaybackSettings() 
    34783671#endif
    34793672}
    34803673
    3481 OSDSettings::OSDSettings()
     3674OSDSettings::OSDSettings(PlaySettings *settings,
     3675                         ConfigurationWizard *base)
    34823676{
    34833677    VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false);
    34843678    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());
    34853683
    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)
    34923694    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);
    34963701
    34973702    //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false);
    34983703    //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  
    1111#include <QMutex>
    1212
    1313class QFileInfo;
     14class PlaySettings;
    1415
    1516class ThemeSelector : public HostImageSelect
    1617{
    class ThemeSelector : public HostImageSelect 
    2425class PlaybackSettings : public ConfigurationWizard
    2526{
    2627  public:
    27     PlaybackSettings();
     28    PlaybackSettings(PlaySettings *settings=NULL,
     29                     ConfigurationWizard *base=NULL);
    2830};
    2931
    3032class OSDSettings: virtual public ConfigurationWizard
    3133{
    3234  public:
    33     OSDSettings();
     35    OSDSettings(PlaySettings *settings=NULL,
     36                ConfigurationWizard *base=NULL);
    3437};
    3538
    3639class GeneralSettings : public ConfigurationWizard
    class AppearanceSettings : public ConfigurationWizard 
    5457class MainGeneralSettings : public ConfigurationWizard
    5558{
    5659  public:
    57     MainGeneralSettings();
     60    MainGeneralSettings(PlaySettings *settings=NULL,
     61                        ConfigurationWizard *base=NULL);
    5862};
    5963
    6064class GeneralRecPrioritiesSettings : public ConfigurationWizard
    class PlaybackProfileConfigs : public TriggeredConfigurationGroup 
    142146    Q_OBJECT
    143147
    144148  public:
    145     PlaybackProfileConfigs(const QString &str);
     149    PlaybackProfileConfigs(const QString &str, PlaySettings *settings);
    146150    virtual ~PlaybackProfileConfigs();
    147151
    148152  private:
    class PlaybackProfileConfigs : public TriggeredConfigurationGroup 
    154158
    155159  private:
    156160    QStringList   profiles;
    157     HostComboBox *grouptrigger;
     161    ComboBoxSetting *grouptrigger;
    158162};
    159163
    160164#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; 
    3838#include "grabbersettings.h"
    3939#include "profilegroup.h"
    4040#include "playgroup.h"
     41#include "playsettings.h"
    4142#include "networkcontrol.h"
    4243#include "dvdringbuffer.h"
    4344#include "scheduledrecording.h"
    static void showStatus(void) 
    566567        delete statusbox;
    567568}
    568569
     570ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     571{
     572    return new PlaybackSettings(settings, base);
     573}
     574
     575ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     576{
     577    return new OSDSettings(settings, base);
     578}
     579
     580ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     581{
     582    return new MainGeneralSettings(settings, base);
     583}
     584
     585static PlayGroupEditor::SettingsLookup pbgroupSetup[] = {
     586    createPlaybackSettingsForPlaybackGroup,
     587    createOSDSettingsForPlaybackGroup,
     588    createMainGeneralSettingsForPlaybackGroup
     589};
     590
    569591static void RunVideoScreen(VideoDialog::DialogType type, bool fromJump = false)
    570592{
    571593    QString message = QObject::tr("Loading videos ...");
    static void TVMenuCallback(void *data, QString &selection) 
    879901    }
    880902    else if (sel == "settings playgroup")
    881903    {
    882         PlayGroupEditor editor;
     904        PlayGroupEditor editor(pbgroupSetup,
     905                               sizeof(pbgroupSetup)/sizeof(*pbgroupSetup));
    883906        editor.exec();
    884907    }
    885908    else if (sel == "settings general")
    static int internal_play_media(const QString &mrl, const QString &plot, 
    11241147                    pos = (int64_t)((*++it).toLongLong() & 0xffffffffLL);
    11251148                }
    11261149            }
     1150            pginfo->SetPlaybackGroup("Videos");
    11271151        }
    11281152        else
    11291153        {
    static int internal_play_media(const QString &mrl, const QString &plot, 
    11351159        delete dvd;
    11361160    }
    11371161    else if (pginfo->IsVideo())
     1162    {
    11381163        pos = pginfo->QueryBookmark();
     1164        pginfo->SetPlaybackGroup("Videos");
     1165    }
    11391166
    11401167    if (pos > 0)
    11411168    {
  • 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 
    3333      m_prevButton(NULL)
    3434{
    3535    m_popupStack = GetMythMainWindow()->GetStack("popup stack");
    36     m_vdp = new VideoDisplayProfile();
     36    m_vdp = new VideoDisplayProfile(NULL);
    3737    m_audioScreen->Hide();
    3838    gCoreContext->addListener(this);
    3939}
    void VideoSetupWizard::loadData(void) 
    110110        item->SetData(*i);
    111111    }
    112112
    113     QString currentpbp = m_vdp->GetDefaultProfileName(gCoreContext->GetHostName());
     113    QString currentpbp = m_vdp->GetDefaultProfileName(gCoreContext->GetHostName(), NULL);
    114114    if (!currentpbp.isEmpty())
    115115    {
    116116        MythUIButtonListItem *set =
    void VideoSetupWizard::playVideoTest(QString desc, QString title, QString file) 
    211211{
    212212    QString desiredpbp =
    213213        m_playbackProfileButtonList->GetItemCurrent()->GetText();
    214     QString currentpbp = m_vdp->GetDefaultProfileName(gCoreContext->GetHostName());
     214    QString currentpbp = m_vdp->GetDefaultProfileName(gCoreContext->GetHostName(), NULL);
    215215
    216216    m_vdp->SetDefaultProfileName(desiredpbp, gCoreContext->GetHostName());
    217217    GetMythMainWindow()->HandleMedia("Internal", file, desc, title);