Ticket #8088: 8088_playgroups_v23.patch

File 8088_playgroups_v23.patch, 114.0 KB (added by Jim Stichnoth <stichnot@…>, 13 years ago)
  • mythtv/libs/libmyth/libmyth.pro

    diff --git a/mythtv/libs/libmyth/libmyth.pro b/mythtv/libs/libmyth/libmyth.pro
    index 9e64548..d5c3a07 100644
    a b SOURCES += programtypes.cpp recordingtypes.cpp 
    6666SOURCES += mythrssmanager.cpp     netgrabbermanager.cpp
    6767SOURCES += rssparse.cpp           netutils.cpp
    6868
     69HEADERS += playsettings.h
     70SOURCES += playsettings.cpp
     71
    6972# remove when everything is switched to mythui
    7073SOURCES += virtualkeyboard_qt.cpp
    7174
  • mythtv/libs/libmyth/mythconfiggroups.cpp

    diff --git a/mythtv/libs/libmyth/mythconfiggroups.cpp b/mythtv/libs/libmyth/mythconfiggroups.cpp
    index 28933af..7e61bcb 100644
    a b void TriggeredConfigurationGroup::addTarget(QString triggerValue, 
    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 48168b3..5d1078a 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 46c7bd0..2875601 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 57e659a..2bc92ea 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 98f7514..804d9dc 100644
    a b using namespace std; 
    3636#include "bdringbuffer.h"
    3737#include "videodisplayprofile.h"
    3838#include "mythuihelper.h"
     39#include "playsettings.h"
    3940
    4041#include "lcddevice.h"
    4142
    AvFormatDecoder::AvFormatDecoder(MythPlayer *parent, 
    280281
    281282    cc608_build_parity_table(cc608_parity_table);
    282283
    283     if (gCoreContext->GetNumSetting("CCBackground", 0))
     284    if (GetPlayer()->GetPlaySettings()->GetNumSetting("CCBackground", 0))
    284285        CC708Window::forceWhiteOnBlackText = true;
    285286
    286287    no_dts_hack = false;
    void AvFormatDecoder::InitVideoCodec(AVStream *stream, AVCodecContext *enc, 
    11931194    if (selectedStream)
    11941195    {
    11951196        directrendering = true;
    1196         if (!gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&
     1197        if (!GetPlayer()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) &&
    11971198            !CODEC_IS_HWACCEL(codec, enc))
    11981199        {
    11991200            SetLowBuffers(false);
    int AvFormatDecoder::ScanStreams(bool novideo) 
    16981699
    16991700                if (!is_db_ignored)
    17001701                {
    1701                     VideoDisplayProfile vdp;
     1702                    VideoDisplayProfile vdp(GetPlayer()->GetPlaySettings());
    17021703                    vdp.SetInput(QSize(width, height));
    17031704                    dec = vdp.GetDecoder();
    17041705                    thread_count = vdp.GetMaxCPUs();
    int AvFormatDecoder::ScanStreams(bool novideo) 
    17261727                    MythCodecID vdpau_mcid;
    17271728                    vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec(
    17281729                        width, height,
    1729                         mpeg_version(enc->codec_id), no_hardware_decoders);
     1730                        mpeg_version(enc->codec_id), no_hardware_decoders,
     1731                        GetPlayer()->GetPlaySettings());
    17301732
    17311733                    if (vdpau_mcid >= video_codec_id)
    17321734                    {
  • mythtv/libs/libmythtv/dbcheck.cpp

    diff --git a/mythtv/libs/libmythtv/dbcheck.cpp b/mythtv/libs/libmythtv/dbcheck.cpp
    index f9abdce..ff35dca 100644
    a b NULL 
    35583558
    35593559            VideoDisplayProfile::CreateNewProfiles(host);
    35603560            profiles = VideoDisplayProfile::GetProfiles(host);
    3561             QString profile = VideoDisplayProfile::GetDefaultProfileName(host);
     3561            QString profile =
     3562                VideoDisplayProfile::GetDefaultProfileName(host, NULL);
    35623563
    35633564            if (profiles.contains("Normal") &&
    35643565                (profile=="CPU++" || profile=="CPU+" || profile=="CPU--"))
    tmp.constData(), 
    59945995"  jump int(11) NOT NULL default '0',"
    59955996"  PRIMARY KEY  (`name`)"
    59965997");",
     5998"CREATE TABLE playgroupsettings ("
     5999"  playgroupname varchar(64) NOT NULL,"
     6000"  `value` varchar(128) NOT NULL,"
     6001"  `data` text,"
     6002"  overridden tinyint(1) NOT NULL,"
     6003"  PRIMARY KEY (playgroupname, `value`)"
     6004");",
    59976005"CREATE TABLE powerpriority ("
    59986006"  priorityname varchar(64) collate utf8_bin NOT NULL,"
    59996007"  recpriority int(10) NOT NULL default '0',"
  • mythtv/libs/libmythtv/mythplayer.cpp

    diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp
    index 75b289a..5b5802e 100644
    a b using namespace std; 
    6060#include "mythpainter.h"
    6161#include "mythimage.h"
    6262#include "mythuiimage.h"
     63#include "playsettings.h"
    6364
    6465extern "C" {
    6566#include "vbitext/vbi.h"
    MythPlayer::MythPlayer(bool muted) 
    249250      output_jmeter(NULL)
    250251{
    251252    playerThread = QThread::currentThread();
    252     // Playback (output) zoom control
    253     detect_letter_box = new DetectLetterbox(this);
    254 
    255     vbimode = VBIMode::Parse(gCoreContext->GetSetting("VbiFormat"));
    256     decode_extra_audio = gCoreContext->GetNumSetting("DecodeExtraAudio", 0);
    257     itvEnabled         = gCoreContext->GetNumSetting("EnableMHEG", 0);
    258     db_prefer708       = gCoreContext->GetNumSetting("Prefer708Captions", 1);
    259253
    260254    bzero(&tc_lastval, sizeof(tc_lastval));
    261255    bzero(&tc_wrap,    sizeof(tc_wrap));
    bool MythPlayer::InitVideo(void) 
    495489    if (using_null_videoout && decoder)
    496490    {
    497491        MythCodecID codec = decoder->GetVideoCodecID();
    498         videoOutput = new VideoOutputNull();
     492        videoOutput = new VideoOutputNull(GetPlaySettings());
    499493        if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(),
    500494                               video_aspect, 0, 0, 0, 0, 0, codec, 0))
    501495        {
    bool MythPlayer::InitVideo(void) 
    545539                pipState,
    546540                video_disp_dim, video_aspect,
    547541                widget->winId(), display_rect, video_frame_rate,
    548                 0 /*embedid*/);
     542                0 /*embedid*/, GetPlaySettings());
    549543        }
    550544
    551545        if (videoOutput)
    void MythPlayer::ReinitOSD(void) 
    634628
    635629void MythPlayer::ReinitVideo(void)
    636630{
    637     if (!videoOutput->IsPreferredRenderer(video_disp_dim))
     631    if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings()))
    638632    {
    639633        VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer."));
    640634        SetErrored(QObject::tr("Need to switch video renderer."));
    void MythPlayer::VideoStart(void) 
    20452039        }
    20462040#endif // USING_MHEG
    20472041
    2048         SetCaptionsEnabled(gCoreContext->GetNumSetting("DefaultCCMode"), false);
     2042        SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0),
     2043                           false);
    20492044        osdLock.unlock();
    20502045    }
    20512046
    void MythPlayer::VideoStart(void) 
    20922087        m_double_process = videoOutput->IsExtraProcessingRequired();
    20932088
    20942089        videosync = VideoSync::BestMethod(
    2095             videoOutput, fr_int, rf_int, m_double_framerate);
     2090            videoOutput, GetPlaySettings(),
     2091            fr_int, rf_int, m_double_framerate);
    20962092
    20972093        // Make sure video sync can do it
    20982094        if (videosync != NULL && m_double_framerate)
    void MythPlayer::InitialSeek(void) 
    24752471    if (bookmarkseek > 30)
    24762472    {
    24772473        DoFastForward(bookmarkseek, true, false);
    2478         if (gCoreContext->GetNumSetting("ClearSavedPosition", 1) &&
     2474        if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) &&
    24792475            !player_ctx->IsPIP())
    24802476        {
    24812477            ClearBookmark(false);
    void MythPlayer::EventLoop(void) 
    27032699    {
    27042700        if (jumpto == totalFrames)
    27052701        {
    2706             if (!(gCoreContext->GetNumSetting("EndOfRecordingExitPrompt") == 1
     2702            if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1
    27072703                  && !player_ctx->IsPIP() &&
    27082704                  player_ctx->GetState() == kState_WatchingPreRecorded))
    27092705            {
    PIPLocation MythPlayer::GetNextPIPLocation(void) const 
    29962992        return kPIP_END;
    29972993
    29982994    if (pip_players.isEmpty())
    2999         return (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft);
     2995        return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation",
     2996                                                             kPIPTopLeft);
    30002997
    30012998    // order of preference, could be stored in db if we want it configurable
    30022999    PIPLocation ols[] =
    void MythPlayer::SetPlayerInfo(TV *tv, QWidget *widget, 
    35023499    exactseeks   = frame_exact_seek;
    35033500    player_ctx   = ctx;
    35043501    livetv       = ctx->tvchain;
     3502
     3503    vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", ""));
     3504
     3505    // Playback (output) zoom control
     3506    detect_letter_box = new DetectLetterbox(this);
     3507
     3508    decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0);
     3509    itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0);
     3510    db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1);
    35053511}
    35063512
    35073513bool MythPlayer::EnableEdit(void)
  • mythtv/libs/libmythtv/mythplayer.h

    diff --git a/mythtv/libs/libmythtv/mythplayer.h b/mythtv/libs/libmythtv/mythplayer.h
    index 3229f4a..f1de3a4 100644
    a b class MPUBLIC MythPlayer 
    186186    QString   GetXDS(const QString &key) const;
    187187    PIPLocation GetNextPIPLocation(void) const;
    188188
     189    PlaySettings *GetPlaySettings(void) const {
     190        return player_ctx ? player_ctx->settings : NULL;
     191    }
     192
    189193    // Bool Gets
    190194    bool    GetRawAudioState(void) const;
    191195    bool    GetLimitKeyRepeat(void) const     { return limitKeyRepeat; }
  • mythtv/libs/libmythtv/playercontext.cpp

    diff --git a/mythtv/libs/libmythtv/playercontext.cpp b/mythtv/libs/libmythtv/playercontext.cpp
    index 82a6382..22346b2 100644
    a b  
    1616#include "storagegroup.h"
    1717#include "mythcorecontext.h"
    1818#include "videometadatautil.h"
     19#include "DetectLetterbox.h"
     20#include "playsettings.h"
    1921
    2022#define LOC QString("playCtx: ")
    2123#define LOC_ERR QString("playCtx, Error: ")
    bool PlayerContext::CreatePlayer(TV *tv, QWidget *widget, 
    398400                                 WId embedwinid, const QRect *embedbounds,
    399401                                 bool muted)
    400402{
    401     int exact_seeking = gCoreContext->GetNumSetting("ExactSeeking", 0);
     403    int exact_seeking = settings->GetNumSetting("ExactSeeking", 0);
    402404
    403405    if (HasPlayer())
    404406    {
    bool PlayerContext::CreatePlayer(TV *tv, QWidget *widget, 
    441443    {
    442444        QString subfn = buffer->GetSubtitleFilename();
    443445        if (!subfn.isEmpty() && player->GetSubReader())
    444             player->GetSubReader()->LoadExternalSubtitles(subfn);
     446            player->GetSubReader()->LoadExternalSubtitles(subfn, settings);
    445447    }
    446448
    447449    if ((embedwinid > 0) && embedbounds)
    void PlayerContext::SetRingBuffer(RingBuffer *buf) 
    888890/**
    889891 * \brief assign programinfo to the context
    890892 */
    891 void PlayerContext::SetPlayingInfo(const ProgramInfo *info)
     893void PlayerContext::SetPlayingInfo(const ProgramInfo *info,
     894                                   PlaySettings *_settings)
    892895{
    893896    bool ignoreDB = gCoreContext->IsDatabaseIgnored();
    894897
    void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 
    900903            playingInfo->MarkAsInUse(false, recUsage);
    901904        delete playingInfo;
    902905        playingInfo = NULL;
     906        // XXX delete settings?
    903907    }
    904908
    905909    if (info)
    void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 
    908912        if (!ignoreDB)
    909913            playingInfo->MarkAsInUse(true, recUsage);
    910914        playingLen = playingInfo->GetSecondsInRecording();
     915        settings = (_settings ? _settings :
     916                    new PlaySettings(playingInfo->GetPlaybackGroup()));
    911917    }
    912918}
    913919
  • mythtv/libs/libmythtv/playercontext.h

    diff --git a/mythtv/libs/libmythtv/playercontext.h b/mythtv/libs/libmythtv/playercontext.h
    index b4766e7..8a9a79f 100644
    a b class ProgramInfo; 
    2828class LiveTVChain;
    2929class MythDialog;
    3030class QPainter;
     31class PlaySettings;
    3132
    3233struct osdInfo
    3334{
    class MPUBLIC PlayerContext 
    114115    void SetRecorder(RemoteEncoder *rec);
    115116    void SetTVChain(LiveTVChain *chain);
    116117    void SetRingBuffer(RingBuffer *buf);
    117     void SetPlayingInfo(const ProgramInfo *info);
     118    void SetPlayingInfo(const ProgramInfo *info, PlaySettings *settings=NULL);
    118119    void SetPlayGroup(const QString &group);
    119120    void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state);
    120121    void SetPIPLocation(int loc) { pipLocation = loc; }
    class MPUBLIC PlayerContext 
    171172    LiveTVChain        *tvchain;
    172173    RingBuffer         *buffer;
    173174    ProgramInfo        *playingInfo; ///< Currently playing info
     175    PlaySettings       *settings; // corresponding to playingInfo
    174176    long long           playingLen;  ///< Initial CalculateLength()
    175177    AVSpecialDecode     specialDecode;
    176178    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 d6fc29f..8a5c6cb 100644
    a b  
    66#include "settings.h"
    77
    88class ProgramInfo;
     9class PlaySettings;
    910
    1011class MPUBLIC PlayGroup
    1112{
    class MPUBLIC PlayGroupEditor : public QObject, public ConfigurationDialog 
    2223    Q_OBJECT
    2324
    2425  public:
    25     PlayGroupEditor(void);
     26    typedef ConfigurationWizard *(*SettingsLookup)(PlaySettings *settings,
     27                                                   ConfigurationWizard *base);
     28    PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize);
    2629    virtual DialogCode exec(void);
    2730    virtual void Load(void);
    2831    virtual void Save(void) { }
    class MPUBLIC PlayGroupEditor : public QObject, public ConfigurationDialog 
    3740  protected:
    3841    ListBoxSetting *listbox;
    3942    QString         lastValue;
     43    SettingsLookup *getSettings;
     44    int             getSettingsSize;
    4045};
    4146
    4247#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 c09f965..f282b2a 100644
    a b  
    77#include "mythuiimage.h"
    88#include "mythpainter.h"
    99#include "subtitlescreen.h"
     10#include "playsettings.h"
    1011
    1112#define LOC      QString("Subtitles: ")
    1213#define LOC_WARN QString("Subtitles Warning: ")
    bool SubtitleScreen::Create(void) 
    6869        VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-608 reader.");
    6970    if (!m_708reader)
    7071        VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-708 reader.");
    71     m_useBackground = (bool)gCoreContext->GetNumSetting("CCBackground", 0);
    72     m_textFontZoom  = gCoreContext->GetNumSetting("OSDCC708TextZoom", 100);
     72    m_useBackground = (bool)m_player->GetPlaySettings()->GetNumSetting("CCBackground", 0);
     73    m_textFontZoom   = m_player->GetPlaySettings()->GetNumSetting("OSDCC708TextZoom", 100);
    7374    return true;
    7475}
    7576
  • 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 5589984..d7e9d0d 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 
    7981class TextSubtitleParser
    8082{
    8183  public:
    82     static bool LoadSubtitles(QString fileName, TextSubtitles &target);
     84    static bool LoadSubtitles(QString fileName, TextSubtitles &target,
     85                              PlaySettings *settings);
    8386};
    8487
    8588#endif
  • mythtv/libs/libmythtv/tv_play.cpp

    diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
    index 7c54fdb..b7d3377 100644
    a b using namespace std; 
    5858#include "videometadatautil.h"
    5959#include "mythdirs.h"
    6060#include "tvbrowsehelper.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            VERBOSE(VB_PLAYBACK, LOC + "tv->Playback() -- begin");
    255             if (!tv->Playback(*curProgram))
     258            if (!tv->Playback(*curProgram, &settings))
    256259            {
    257260                quitAll = true;
    258261            }
    void TV::ResetKeys(void) 
    838841/** \fn TV::TV(void)
    839842 *  \sa Init(void)
    840843 */
    841 TV::TV(void)
     844TV::TV(PlaySettings *settings)
    842845    : // Configuration variables from database
    843846      baseFilters(""),
    844847      db_channel_format("<num> <sign>"),
    TV::TV(void) 
    936939    playerActive = 0;
    937940    playerLock.unlock();
    938941
    939     InitFromDB();
     942    InitFromDB(settings);
    940943
    941944    VERBOSE(VB_PLAYBACK, LOC + "ctor -- end");
    942945}
    943946
    944 void TV::InitFromDB(void)
     947void TV::InitFromDB(PlaySettings *settings)
    945948{
    946949    QMap<QString,QString> kv;
    947950    kv["LiveTVIdleTimeout"]        = "0";
    void TV::InitFromDB(void) 
    988991        kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]);
    989992
    990993    MythDB::getMythDB()->GetSettings(kv);
     994    settings->AddToMap(kv);
    991995
    992996    QString db_time_format;
    993997    QString db_short_date_format;
    void TV::HandleOSDAskAllow(PlayerContext *ctx, QString action) 
    17421746    askAllowLock.unlock();
    17431747}
    17441748
    1745 int TV::Playback(const ProgramInfo &rcinfo)
     1749int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings)
    17461750{
    17471751    wantsToQuit   = false;
    17481752    jumpToProgram = false;
    int TV::Playback(const ProgramInfo &rcinfo) 
    17561760        return 0;
    17571761    }
    17581762
    1759     mctx->SetPlayingInfo(&rcinfo);
     1763    mctx->SetPlayingInfo(&rcinfo, settings);
    17601764    mctx->SetInitialTVState(false);
    17611765    ScheduleStateChange(mctx);
    17621766
    int TV::PlayFromRecorder(int recordernum) 
    18391843
    18401844    if (fileexists)
    18411845    {
    1842         Playback(pginfo);
     1846        PlaySettings settings("Default");
     1847        Playback(pginfo, &settings);
    18431848        retval = 1;
    18441849    }
    18451850
    void TV::HandleStateChange(PlayerContext *mctx, PlayerContext *ctx) 
    22222227            QString msg = tr("%1 Settings")
    22232228                    .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup()));
    22242229            ctx->UnlockPlayingInfo(__FILE__, __LINE__);
    2225             if (count > 0)
     2230            if (count > 0 &&
     2231                ctx->playingInfo->GetPlaybackGroup() != "Default" &&
     2232                ctx->playingInfo->GetPlaybackGroup() != "Videos")
    22262233                SetOSDMessage(ctx, msg);
    22272234            ITVRestart(ctx, false);
    22282235        }
  • mythtv/libs/libmythtv/tv_play.h

    diff --git a/mythtv/libs/libmythtv/tv_play.h b/mythtv/libs/libmythtv/tv_play.h
    index 9207280..a2b2ad7 100644
    a b class OSDListTreeItemEnteredEvent; 
    6060class OSDListTreeItemSelectedEvent;
    6161class TVBrowseHelper;
    6262struct osdInfo;
     63class PlaySettings;
    6364
    6465typedef QMap<QString,InfoMap>    DDValueMap;
    6566typedef QMap<QString,DDValueMap> DDKeyMap;
    class MPUBLIC TV : public QObject 
    182183        unsigned long seconds;
    183184    };
    184185
    185     TV(void);
     186    TV(PlaySettings *settings);
    186187   ~TV();
    187188
    188     void InitFromDB(void);
     189    void InitFromDB(PlaySettings *settings);
    189190    bool Init(bool createWindow = true);
    190191
    191192    // User input processing commands
    class MPUBLIC TV : public QObject 
    209210
    210211    // Recording commands
    211212    int  PlayFromRecorder(int recordernum);
    212     int  Playback(const ProgramInfo &rcinfo);
     213    int  Playback(const ProgramInfo &rcinfo, PlaySettings *settings);
    213214
    214215    // Commands used by frontend playback box
    215216    QString GetRecordingGroup(int player_idx) const;
  • mythtv/libs/libmythtv/videodisplayprofile.cpp

    diff --git a/mythtv/libs/libmythtv/videodisplayprofile.cpp b/mythtv/libs/libmythtv/videodisplayprofile.cpp
    index 8999558..6f3c707 100644
    a b using namespace std; 
    88#include "mythverbose.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) 
    754755    return list;
    755756}
    756757
    757 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname)
     758QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname,
     759                                                   PlaySettings *settings)
    758760{
    759761    QString tmp =
     762        settings ? settings->GetSetting("DefaultVideoPlaybackProfile", "") :
    760763        gCoreContext->GetSettingOnHost("DefaultVideoPlaybackProfile", hostname);
    761764
    762765    QStringList profiles = GetProfiles(hostname);
  • mythtv/libs/libmythtv/videodisplayprofile.h

    diff --git a/mythtv/libs/libmythtv/videodisplayprofile.h b/mythtv/libs/libmythtv/videodisplayprofile.h
    index 39074d5..85b607f 100644
    a b using namespace std; 
    1313
    1414#include "mythcontext.h"
    1515
     16class PlaySettings;
     17
    1618typedef QMap<QString,QString>     pref_map_t;
    1719typedef QMap<QString,QStringList> safe_map_t;
    1820typedef QStringList               safe_list_t;
    typedef vector<ProfileItem> item_list_t; 
    8082class MPUBLIC VideoDisplayProfile
    8183{
    8284  public:
    83     VideoDisplayProfile();
     85    VideoDisplayProfile(PlaySettings *settings);
    8486    ~VideoDisplayProfile();
    8587
    8688    void SetInput(const QSize &size);
    class MPUBLIC VideoDisplayProfile 
    125127    static QString     GetDecoderName(const QString &decoder);
    126128    static QString     GetDecoderHelp(QString decoder = QString::null);
    127129
    128     static QString     GetDefaultProfileName(const QString &hostname);
     130    static QString     GetDefaultProfileName(const QString &hostname,
     131                                             PlaySettings *settings);
    129132    static void        SetDefaultProfileName(const QString &profilename,
    130133                                             const QString &hostname);
    131134    static uint        GetProfileGroupID(const QString &profilename,
  • mythtv/libs/libmythtv/videoout_d3d.cpp

    diff --git a/mythtv/libs/libmythtv/videoout_d3d.cpp b/mythtv/libs/libmythtv/videoout_d3d.cpp
    index badf6af..0cbadb4 100644
    a b void VideoOutputD3D::GetRenderOptions(render_opts &opts, 
    5050    opts.priorities->insert("direct3d", 55);
    5151}
    5252
    53 VideoOutputD3D::VideoOutputD3D(void)
    54   : VideoOutput(),        m_lock(QMutex::Recursive),
     53VideoOutputD3D::VideoOutputD3D(PlaySettigns *settings)
     54  : VideoOutput(settings), m_lock(QMutex::Recursive),
    5555    m_hWnd(NULL),          m_render(NULL),
    5656    m_video(NULL),
    5757    m_render_valid(false), m_render_reset(false), m_pip_active(NULL),
  • mythtv/libs/libmythtv/videoout_d3d.h

    diff --git a/mythtv/libs/libmythtv/videoout_d3d.h b/mythtv/libs/libmythtv/videoout_d3d.h
    index 7731c3b..1fa7641 100644
    a b class VideoOutputD3D : public VideoOutput 
    1212{
    1313  public:
    1414    static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
    15     VideoOutputD3D();
     15    VideoOutputD3D(PlaySettings *settings);
    1616   ~VideoOutputD3D();
    1717
    1818    bool Init(int width, int height, float aspect, WId winid,
  • mythtv/libs/libmythtv/videoout_directfb.cpp

    diff --git a/mythtv/libs/libmythtv/videoout_directfb.cpp b/mythtv/libs/libmythtv/videoout_directfb.cpp
    index 417b1c8..a3bdd6b 100644
    a b void VideoOutputDirectfb::GetRenderOptions(render_opts &opts, 
    275275    opts.priorities->insert("directfb", 60);
    276276}
    277277
    278 VideoOutputDirectfb::VideoOutputDirectfb()
    279     : VideoOutput(), XJ_started(false), widget(NULL),
     278VideoOutputDirectfb::VideoOutputDirectfb(PlaySettings *settings)
     279    : VideoOutput(settings), XJ_started(false), widget(NULL),
    280280      data(new DirectfbData())
    281281{
    282282    init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0);
  • mythtv/libs/libmythtv/videoout_directfb.h

    diff --git a/mythtv/libs/libmythtv/videoout_directfb.h b/mythtv/libs/libmythtv/videoout_directfb.h
    index 20d42d8..9d2439e 100644
    a b class VideoOutputDirectfb: public VideoOutput 
    1212{
    1313  public:
    1414    static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
    15     VideoOutputDirectfb();
     15    VideoOutputDirectfb(PlaySettings *settings);
    1616    ~VideoOutputDirectfb();
    1717
    1818    bool Init(int width, int height, float aspect, WId winid,
  • mythtv/libs/libmythtv/videoout_null.cpp

    diff --git a/mythtv/libs/libmythtv/videoout_null.cpp b/mythtv/libs/libmythtv/videoout_null.cpp
    index cd2b170..c927c2a 100644
    a b void VideoOutputNull::GetRenderOptions(render_opts &opts, 
    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    VERBOSE(VB_PLAYBACK, "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 8fff602..30c2ea6 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, WId winid,
  • mythtv/libs/libmythtv/videoout_opengl.cpp

    diff --git a/mythtv/libs/libmythtv/videoout_opengl.cpp b/mythtv/libs/libmythtv/videoout_opengl.cpp
    index 208137e..8aaa4d9 100644
    a b void VideoOutputOpenGL::GetRenderOptions(render_opts &opts, 
    3737    opts.priorities->insert("opengl", 65);
    3838}
    3939
    40 VideoOutputOpenGL::VideoOutputOpenGL()
    41     : VideoOutput(),
     40VideoOutputOpenGL::VideoOutputOpenGL(PlaySettings *settings)
     41    : VideoOutput(settings),
    4242    gl_context_lock(QMutex::Recursive),
    4343    gl_context(NULL), gl_videochain(NULL), gl_pipchain_active(NULL),
    4444    gl_parent_win(0), gl_embed_win(0), gl_painter(NULL)
  • mythtv/libs/libmythtv/videoout_opengl.h

    diff --git a/mythtv/libs/libmythtv/videoout_opengl.h b/mythtv/libs/libmythtv/videoout_opengl.h
    index e728da7..a9ef03c 100644
    a b class VideoOutputOpenGL : public VideoOutput 
    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, WId winid,
  • mythtv/libs/libmythtv/videoout_quartz.cpp

    diff --git a/mythtv/libs/libmythtv/videoout_quartz.cpp b/mythtv/libs/libmythtv/videoout_quartz.cpp
    index f380da0..8be3831 100644
    a b using namespace std; 
    6262#include "mythverbose.h"
    6363#include "videodisplayprofile.h"
    6464
     65class PlaySettings;
     66
    6567#define LOC     QString("VideoOutputQuartz::")
    6668#define LOC_ERR QString("VideoOutputQuartz Error: ")
    6769
    void VideoOutputQuartz::GetRenderOptions(render_opts &opts, 
    11031105/** \class VideoOutputQuartz
    11041106 *  \brief Implementation of Quartz (Mac OS X windowing system) video output
    11051107 */
    1106 VideoOutputQuartz::VideoOutputQuartz() :
    1107     VideoOutput(), Started(false), data(new QuartzData())
     1108VideoOutputQuartz::VideoOutputQuartz(PlaySettings *settings) :
     1109    VideoOutput(settings), Started(false), data(new QuartzData())
    11081110{
    11091111    init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0);
    11101112}
    QStringList VideoOutputQuartz::GetAllowedRenderers( 
    17541756MythCodecID VideoOutputQuartz::GetBestSupportedCodec(
    17551757    uint width, uint height,
    17561758    uint osd_width, uint osd_height,
    1757     uint stream_type, uint fourcc)
     1759    uint stream_type, uint fourcc, PlaySettings *settings)
    17581760{
    17591761    (void) osd_width;
    17601762    (void) osd_height;
    17611763
    1762     VideoDisplayProfile vdp;
     1764    VideoDisplayProfile vdp(settings);
    17631765    vdp.SetInput(QSize(width, height));
    17641766    QString dec = vdp.GetDecoder();
    17651767    if (dec == "ffmpeg")
  • mythtv/libs/libmythtv/videoout_quartz.h

    diff --git a/mythtv/libs/libmythtv/videoout_quartz.h b/mythtv/libs/libmythtv/videoout_quartz.h
    index a5a3bf2..da66ac8 100644
    a b  
    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 
    5253    static MythCodecID GetBestSupportedCodec(
    5354        uint width, uint height,
    5455        uint osd_width, uint osd_height,
    55         uint stream_type, uint fourcc);
     56        uint stream_type, uint fourcc, PlaySettings *settings);
    5657    virtual bool NeedExtraAudioDecode(void) const
    5758        { return !codec_is_std(video_codec_id); }
    5859
  • mythtv/libs/libmythtv/videoout_vdpau.cpp

    diff --git a/mythtv/libs/libmythtv/videoout_vdpau.cpp b/mythtv/libs/libmythtv/videoout_vdpau.cpp
    index 0317b38..dbdd2be 100644
    a b void VideoOutputVDPAU::GetRenderOptions(render_opts &opts) 
    4747    opts.deints->insert("vdpau", deints);
    4848}
    4949
    50 VideoOutputVDPAU::VideoOutputVDPAU()
    51   : m_win(0),                m_render(NULL),
     50VideoOutputVDPAU::VideoOutputVDPAU(PlaySettings *settings)
     51  : VideoOutput(settings), m_win(0),           m_render(NULL),
    5252    m_buffer_size(NUM_VDPAU_BUFFERS),          m_pause_surface(0),
    5353    m_need_deintrefs(false), m_video_mixer(0), m_mixer_features(kVDPFeatNone),
    5454    m_checked_surface_ownership(false),
    QStringList VideoOutputVDPAU::GetAllowedRenderers( 
    848848
    849849MythCodecID VideoOutputVDPAU::GetBestSupportedCodec(
    850850    uint width,       uint height,
    851     uint stream_type, bool no_acceleration)
     851    uint stream_type, bool no_acceleration, PlaySettings *settings)
    852852{
    853853    bool use_cpu = no_acceleration;
    854     VideoDisplayProfile vdp;
     854    VideoDisplayProfile vdp(settings);
    855855    vdp.SetInput(QSize(width, height));
    856856    QString dec = vdp.GetDecoder();
    857857
  • mythtv/libs/libmythtv/videoout_vdpau.h

    diff --git a/mythtv/libs/libmythtv/videoout_vdpau.h b/mythtv/libs/libmythtv/videoout_vdpau.h
    index 7107745..b5f9aa9 100644
    a b class VideoOutputVDPAU : public VideoOutput 
    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, WId winid,
    2626              int winx, int winy, int winw, int winh,
    class VideoOutputVDPAU : public VideoOutput 
    5454                                    const QSize &video_dim);
    5555    static MythCodecID GetBestSupportedCodec(uint width, uint height,
    5656                                             uint stream_type,
    57                                              bool no_acceleration);
     57                                             bool no_acceleration,
     58                                             PlaySettings *settings);
    5859    virtual bool IsPIPSupported(void) const { return true; }
    5960    virtual bool IsPBPSupported(void) const { return false; }
    6061    virtual bool NeedExtraAudioDecode(void) const
  • mythtv/libs/libmythtv/videoout_xv.cpp

    diff --git a/mythtv/libs/libmythtv/videoout_xv.cpp b/mythtv/libs/libmythtv/videoout_xv.cpp
    index ec9c215..e44aabd 100644
    a b void VideoOutputXv::GetRenderOptions(render_opts &opts, 
    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() 
    600601    disp->StartLog();
    601602    QString adaptor_name = QString::null;
    602603    const QSize video_dim = window.GetVideoDim();
    603     xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), kCodec_MPEG2,
     604    xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, kCodec_MPEG2,
    604605                                 video_dim.width(), video_dim.height(),
    605606                                 xv_set_defaults, &adaptor_name);
    606607    if (xv_port == -1)
  • mythtv/libs/libmythtv/videoout_xv.h

    diff --git a/mythtv/libs/libmythtv/videoout_xv.h b/mythtv/libs/libmythtv/videoout_xv.h
    index c42665b..78e5f66 100644
    a b class VideoOutputXv : public VideoOutput 
    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, WId winid,
    class VideoOutputXv : public VideoOutput 
    8383    static MythCodecID GetBestSupportedCodec(uint stream_type);
    8484
    8585    static int GrabSuitableXvPort(MythXDisplay* disp, Window root,
     86                                  PlaySettings *settings,
    8687                                  MythCodecID type,
    8788                                  uint width, uint height,
    8889                                  bool &xvsetdefaults,
  • mythtv/libs/libmythtv/videooutbase.cpp

    diff --git a/mythtv/libs/libmythtv/videooutbase.cpp b/mythtv/libs/libmythtv/videooutbase.cpp
    index e143bee..c843b8f 100644
    a b  
    77#include "mythplayer.h"
    88#include "videodisplayprofile.h"
    99#include "decoderbase.h"
     10#include "playsettings.h"
    1011
    1112#include "mythcorecontext.h"
    1213#include "mythverbose.h"
    VideoOutput *VideoOutput::Create( 
    109110        PIPState pipState,
    110111        const QSize   &video_dim, float        video_aspect,
    111112        WId            win_id,    const QRect &display_rect,
    112         float          video_prate,     WId    embed_id)
     113        float          video_prate,     WId    embed_id,
     114        PlaySettings *settings)
    113115{
    114116    (void) codec_priv;
    115117
    VideoOutput *VideoOutput::Create( 
    154156    QString renderer = QString::null;
    155157    if (renderers.size() > 0)
    156158    {
    157         VideoDisplayProfile vprof;
     159        VideoDisplayProfile vprof(settings);
    158160        vprof.SetInput(video_dim);
    159161
    160162        QString tmp = vprof.GetVideoRenderer();
    VideoOutput *VideoOutput::Create( 
    182184
    183185#ifdef USING_DIRECTFB
    184186        if (renderer == "directfb")
    185             vo = new VideoOutputDirectfb();
     187            vo = new VideoOutputDirectfb(settings);
    186188#endif // USING_DIRECTFB
    187189
    188190#ifdef USING_MINGW
    189191        if (renderer == "direct3d")
    190             vo = new VideoOutputD3D();
     192            vo = new VideoOutputD3D(settings);
    191193#endif // USING_MINGW
    192194
    193195#ifdef USING_QUARTZ_VIDEO
    194196        if (osxlist.contains(renderer))
    195             vo = new VideoOutputQuartz();
     197            vo = new VideoOutputQuartz(settings);
    196198#endif // Q_OS_MACX
    197199
    198200#ifdef USING_OPENGL_VIDEO
    199201        if (renderer == "opengl")
    200             vo = new VideoOutputOpenGL();
     202            vo = new VideoOutputOpenGL(settings);
    201203#endif // USING_OPENGL_VIDEO
    202204
    203205#ifdef USING_VDPAU
    204206        if (renderer == "vdpau")
    205             vo = new VideoOutputVDPAU();
     207            vo = new VideoOutputVDPAU(settings);
    206208#endif // USING_VDPAU
    207209
    208210#ifdef USING_XV
    209211        if (xvlist.contains(renderer))
    210             vo = new VideoOutputXv();
     212            vo = new VideoOutputXv(settings);
    211213#endif // USING_XV
    212214
    213215        if (vo)
    VideoOutput *VideoOutput::Create( 
    305307 * \brief This constructor for VideoOutput must be followed by an
    306308 *        Init(int,int,float,WId,int,int,int,int,WId) call.
    307309 */
    308 VideoOutput::VideoOutput() :
     310VideoOutput::VideoOutput(PlaySettings *_settings) :
    309311    // DB Settings
     312    window(_settings),
    310313    db_display_dim(0,0),
    311314    db_aspectoverride(kAspect_Off), db_adjustfill(kAdjustFill_Off),
    312315    db_letterbox_colour(kLetterBoxColour_Black),
    VideoOutput::VideoOutput() : 
    342345    monitor_sz(640,480),                monitor_dim(400,300),
    343346
    344347    // OSD
    345     osd_painter(NULL),                  osd_image(NULL)
     348    osd_painter(NULL),                  osd_image(NULL),
     349    settings(_settings)
    346350
    347351{
    348352    bzero(&pip_tmp_image, sizeof(pip_tmp_image));
    349     db_display_dim = QSize(gCoreContext->GetNumSetting("DisplaySizeWidth",  0),
    350                            gCoreContext->GetNumSetting("DisplaySizeHeight", 0));
     353    db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth",  0),
     354                           settings->GetNumSetting("DisplaySizeHeight", 0));
    351355
    352356    db_aspectoverride = (AspectOverrideMode)
    353         gCoreContext->GetNumSetting("AspectOverride",      0);
     357        settings->GetNumSetting("AspectOverride",      0);
    354358    db_adjustfill = (AdjustFillMode)
    355         gCoreContext->GetNumSetting("AdjustFill",          0);
     359        settings->GetNumSetting("AdjustFill",          0);
    356360    db_letterbox_colour = (LetterBoxColour)
    357         gCoreContext->GetNumSetting("LetterboxColour",     0);
     361        settings->GetNumSetting("LetterboxColour",     0);
    358362
    359363    if (!gCoreContext->IsDatabaseIgnored())
    360         db_vdisp_profile = new VideoDisplayProfile();
     364        db_vdisp_profile = new VideoDisplayProfile(settings);
    361365}
    362366
    363367/**
    QString VideoOutput::GetFilters(void) const 
    433437    return QString::null;
    434438}
    435439
    436 bool VideoOutput::IsPreferredRenderer(QSize video_size)
     440bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings)
    437441{
    438442    if (!db_vdisp_profile || (video_size == window.GetVideoDispDim()))
    439443        return true;
    440444
    441     VideoDisplayProfile vdisp;
     445    VideoDisplayProfile vdisp(settings);
    442446    vdisp.SetInput(video_size);
    443447    QString new_rend = vdisp.GetVideoRenderer();
    444448    if (new_rend.isEmpty())
  • mythtv/libs/libmythtv/videooutbase.h

    diff --git a/mythtv/libs/libmythtv/videooutbase.h b/mythtv/libs/libmythtv/videooutbase.h
    index 112e4f4..9a24f71 100644
    a b class OSD; 
    3434class FilterChain;
    3535class FilterManager;
    3636class OpenGLContextGLX;
     37class PlaySettings;
    3738
    3839typedef QMap<MythPlayer*,PIPLocation> PIPMap;
    3940
    class VideoOutput 
    5455        PIPState       pipState,
    5556        const QSize   &video_dim, float        video_aspect,
    5657        WId            win_id,    const QRect &display_rect,
    57         float video_prate,        WId          embed_id);
     58        float video_prate,        WId          embed_id,
     59        PlaySettings *settings);
    5860
    59     VideoOutput();
     61    VideoOutput(PlaySettings *settings);
    6062    virtual ~VideoOutput();
    6163
    6264    virtual bool Init(int width, int height, float aspect,
    class VideoOutput 
    6466                      int winh, MythCodecID codec_id, WId embedid = 0);
    6567    virtual void InitOSD(OSD *osd);
    6668    virtual void SetVideoFrameRate(float);
    67     virtual bool IsPreferredRenderer(QSize video_size);
     69    virtual bool IsPreferredRenderer(QSize video_size, PlaySettings *settings);
    6870    virtual bool SetDeinterlacingEnabled(bool);
    6971    virtual bool SetupDeinterlace(bool i, const QString& ovrf="");
    7072    virtual void FallbackDeint(void);
    class VideoOutput 
    330332    // OSD painter and surface
    331333    MythYUVAPainter *osd_painter;
    332334    MythImage       *osd_image;
     335
     336    PlaySettings *settings;
    333337};
    334338
    335339#endif
  • mythtv/libs/libmythtv/videooutwindow.cpp

    diff --git a/mythtv/libs/libmythtv/videooutwindow.cpp b/mythtv/libs/libmythtv/videooutwindow.cpp
    index d103cac..a27d59f 100644
    a b  
    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; 
    5354const float VideoOutWindow::kManualZoomMinVerticalZoom   = 0.5f;
    5455const int   VideoOutWindow::kManualZoomMaxMove           = 50;
    5556
    56 VideoOutWindow::VideoOutWindow() :
     57VideoOutWindow::VideoOutWindow(PlaySettings *_settings) :
    5758    // DB settings
    5859    db_move(0, 0), db_scale_horiz(0.0f), db_scale_vert(0.0f),
    5960    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) 
    615618    if (change)
    616619    {
    617620        db_scale_vert =
    618             gCoreContext->GetNumSetting("VertScanPercentage", 0) * 0.01f;
     621            settings->GetNumSetting("VertScanPercentage", 0) * 0.01f;
    619622        db_scale_horiz =
    620             gCoreContext->GetNumSetting("HorizScanPercentage", 0) * 0.01f;
     623            settings->GetNumSetting("HorizScanPercentage", 0) * 0.01f;
    621624        db_scaling_allowed = true;
    622625    }
    623626    else
  • mythtv/libs/libmythtv/videooutwindow.h

    diff --git a/mythtv/libs/libmythtv/videooutwindow.h b/mythtv/libs/libmythtv/videooutwindow.h
    index 37f4502..c381b8e 100644
    a b  
    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 
    164165    bool     allowpreviewepg;
    165166    PIPState pip_state;
    166167
     168    PlaySettings *settings;
     169
    167170    // Constants
    168171    static const float kManualZoomMaxHorizontalZoom;
    169172    static const float kManualZoomMaxVerticalZoom;
  • mythtv/libs/libmythtv/vsync.cpp

    diff --git a/mythtv/libs/libmythtv/vsync.cpp b/mythtv/libs/libmythtv/vsync.cpp
    index 1f08fc5..8257809 100644
    a b  
    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; 
    7879 *  \brief Returns the most sophisticated video sync method available.
    7980 */
    8081VideoSync *VideoSync::BestMethod(VideoOutput *video_output,
     82                                 PlaySettings *settings,
    8183                                 uint frame_interval, uint refresh_interval,
    8284                                 bool halve_frame_interval)
    8385{
    VideoSync *VideoSync::BestMethod(VideoOutput *video_output, 
    103105    TESTVIDEOSYNC(DRMVideoSync);
    104106#ifdef USING_OPENGL_VSYNC
    105107/*
    106     if (gCoreContext->GetNumSetting("UseOpenGLVSync", 1) &&
     108    if (settings->GetNumSetting("UseOpenGLVSync", 1) &&
    107109       (getenv("NO_OPENGL_VSYNC") == NULL))
    108110    {
    109111        TESTVIDEOSYNC(OpenGLVideoSync);
  • mythtv/libs/libmythtv/vsync.h

    diff --git a/mythtv/libs/libmythtv/vsync.h b/mythtv/libs/libmythtv/vsync.h
    index 156cdad..d1867c7 100644
    a b class VideoSync 
    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 efa01df..e0c47ec 100644
    a b using namespace std; 
    1818#include "mythdbcon.h"
    1919#include "compat.h"
    2020#include "dbcheck.h"
     21#include "playsettings.h"
    2122
    2223// libmythui
    2324#include "mythuihelper.h"
    int main(int argc, char *argv[]) 
    188189
    189190    GetMythUI()->LoadQtConfig();
    190191
    191 #if defined(Q_OS_MACX)
    192     // Mac OS X doesn't define the AudioOutputDevice setting
    193 #else
    194     QString auddevice = gCoreContext->GetSetting("AudioOutputDevice");
    195     if (auddevice.isEmpty())
    196     {
    197         VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "
    198                 "to run 'mythfrontend', not 'mythtv'.");
    199         return TV_EXIT_NO_AUDIO;
    200     }
    201 #endif
    202 
    203192    MythMainWindow *mainWindow = GetMythMainWindow();
    204193    mainWindow->Init();
    205194
    int main(int argc, char *argv[]) 
    212201        return GENERIC_EXIT_DB_OUTOFDATE;
    213202    }
    214203
    215     TV *tv = new TV();
     204    QString playgroup("");
     205    if (!filename.isEmpty())
     206    {
     207        ProgramInfo pg(filename);
     208        playgroup = pg.GetPlaybackGroup();
     209    }
     210    PlaySettings settings(playgroup);
     211
     212#if defined(Q_OS_MACX)
     213    // Mac OS X doesn't define the AudioOutputDevice setting
     214#else
     215    QString auddevice = settings.GetSetting("AudioOutputDevice", "");
     216    if (auddevice.isEmpty())
     217    {
     218        VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "
     219                "to run 'mythfrontend', not 'mythtv'.");
     220        return TV_EXIT_NO_AUDIO;
     221    }
     222#endif
     223
     224    TV *tv = new TV(&settings);
    216225    if (!tv->Init())
    217226    {
    218227        VERBOSE(VB_IMPORTANT, "Fatal Error: Could not initialize TV class.");
  • mythtv/programs/mythfrontend/globalsettings.cpp

    diff --git a/mythtv/programs/mythfrontend/globalsettings.cpp b/mythtv/programs/mythfrontend/globalsettings.cpp
    index 300c073..8e7c6a0 100644
    a b  
    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    }
    41134
    42 static HostCheckBox *DecodeExtraAudio()
     135    // Change the help text to include the default and its source.
     136    QString helpPrefix;
     137    if (dynamic_cast<LineEditSetting *>(obj))
     138        helpPrefix = QObject::tr("Leave blank to keep default value");
     139    else
     140        helpPrefix = QObject::tr("Override default value");
     141    helpPrefix += " (" + defaultLabel + ") ";
     142    QString inheritsFrom = settings->InheritsFrom(name);
     143    if (inheritsFrom.isNull())
     144        helpPrefix += QObject::tr("from global settings");
     145    else
     146        helpPrefix += QObject::tr("from group") + " " + inheritsFrom;
     147    helpPrefix += ". " + obj->getHelpText();
     148    obj->setHelpText(helpPrefix);
     149
     150    // Change the label to include the default.
     151    obj->setLabel(obj->getLabel() + (twoLineLabel ? "\n" : "") +
     152                  " (" + defaultLabel + ")");
     153
     154    return obj;
     155}
     156
     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 *AutoCommercialFlag()
    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 __attribute__ ((unused)) *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
    15281659// This currently does not work
    15291660/*
    1530 static HostLineEdit *UDPNotifyPort()
     1661static Setting *UDPNotifyPort(PlaySettings *settings)
    15311662{
    1532     HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");
     1663    CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings);
    15331664    ge->setLabel(QObject::tr("UDP notify port"));
    15341665    ge->setValue("6948");
    15351666    ge->setHelpText(QObject::tr("During playback, MythTV will listen for "
    15361667                    "connections from the \"mythtvosd\" or \"mythudprelay\" "
    15371668                    "programs on this port. For additional information, see "
    15381669                    "http://www.mythtv.org/wiki/MythNotify ."));
    1539     return ge;
     1670    return wrap(ge, settings);
    15401671}
    15411672*/
    15421673
    1543 static HostComboBox *PlaybackExitPrompt()
     1674static Setting *PlaybackExitPrompt(PlaySettings *settings)
    15441675{
    1545     HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");
     1676    CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings);
    15461677    gc->setLabel(QObject::tr("Action on playback exit"));
    15471678    gc->addSelection(QObject::tr("Just exit"), "0");
    15481679    gc->addSelection(QObject::tr("Save position and exit"), "2");
    static HostComboBox *PlaybackExitPrompt() 
    15531684                    "when you exit playback mode. The options available will "
    15541685                    "allow you to save your position, delete the "
    15551686                    "recording, or continue watching."));
    1556     return gc;
     1687    return wrap(gc, settings);
    15571688}
    15581689
    1559 static HostCheckBox *EndOfRecordingExitPrompt()
     1690static Setting *EndOfRecordingExitPrompt(PlaySettings *settings)
    15601691{
    1561     HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");
     1692    CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings);
    15621693    gc->setLabel(QObject::tr("Prompt at end of recording"));
    15631694    gc->setValue(false);
    15641695    gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing "
    15651696                    "you to delete the recording when it has finished "
    15661697                    "playing."));
    1567     return gc;
     1698    return wrap(gc, settings);
    15681699}
    15691700
    1570 static HostCheckBox *JumpToProgramOSD()
     1701static Setting *JumpToProgramOSD(PlaySettings *settings)
    15711702{
    1572     HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");
     1703    CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings);
    15731704    gc->setLabel(QObject::tr("Jump to program OSD"));
    15741705    gc->setValue(true);
    15751706    gc->setHelpText(QObject::tr(
    static HostCheckBox *JumpToProgramOSD() 
    15781709                        "'Watch Recording' screen when 'Jump to Program' "
    15791710                        "is activated. If enabled, the recordings are shown "
    15801711                        "in the OSD"));
    1581     return gc;
     1712    return wrap(gc, settings);
    15821713}
    15831714
    1584 static HostCheckBox *ContinueEmbeddedTVPlay()
     1715static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings)
    15851716{
    1586     HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");
     1717    CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings);
    15871718    gc->setLabel(QObject::tr("Continue playback when embedded"));
    15881719    gc->setValue(false);
    15891720    gc->setHelpText(QObject::tr(
    static HostCheckBox *ContinueEmbeddedTVPlay() 
    15911722                    "is embedded in the upcoming program list or recorded "
    15921723                    "list. The default is to pause the recorded show when "
    15931724                    "embedded."));
    1594     return gc;
     1725    return wrap(gc, settings);
    15951726}
    15961727
    1597 static HostCheckBox *AutomaticSetWatched()
     1728static Setting *AutomaticSetWatched(PlaySettings *settings)
    15981729{
    1599     HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");
     1730    CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings);
    16001731    gc->setLabel(QObject::tr("Automatically mark a recording as watched"));
    16011732    gc->setValue(false);
    16021733    gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a "
    static HostCheckBox *AutomaticSetWatched() 
    16041735                    "detection is not foolproof, so do not enable this "
    16051736                    "setting if you don't want an unwatched recording marked "
    16061737                    "as watched."));
    1607     return gc;
     1738    return wrap(gc, settings);
    16081739}
    16091740
    16101741static HostSpinBox *LiveTVIdleTimeout()
    static HostComboBox *XineramaMonitorAspectRatio() 
    17941925    return gc;
    17951926}
    17961927
    1797 static HostComboBox *LetterboxingColour()
     1928static Setting *LetterboxingColour(PlaySettings *settings)
    17981929{
    1799     HostComboBox *gc = new HostComboBox("LetterboxColour");
     1930    CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings);
    18001931    gc->setLabel(QObject::tr("Letterboxing color"));
    18011932    for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
    18021933        gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
    static HostComboBox *LetterboxingColour() 
    18061937            "letterboxing, but those with plasma screens may prefer gray "
    18071938            "to minimize burn-in.") + " " +
    18081939        QObject::tr("Currently only works with XVideo video renderer."));
    1809     return gc;
     1940    return wrap(gc, settings);
    18101941}
    18111942
    1812 static HostComboBox *AspectOverride()
     1943static Setting *AspectOverride(PlaySettings *settings)
    18131944{
    1814     HostComboBox *gc = new HostComboBox("AspectOverride");
     1945    CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings);
    18151946    gc->setLabel(QObject::tr("Video aspect override"));
    18161947    for (int m = kAspect_Off; m < kAspect_END; ++m)
    18171948        gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
    static HostComboBox *AspectOverride() 
    18191950                        "When enabled, these will override the aspect "
    18201951                        "ratio specified by any broadcaster for all "
    18211952                        "video streams."));
    1822     return gc;
     1953    return wrap(gc, settings);
    18231954}
    18241955
    1825 static HostComboBox *AdjustFill()
     1956static Setting *AdjustFill(PlaySettings *settings)
    18261957{
    1827     HostComboBox *gc = new HostComboBox("AdjustFill");
     1958    CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings);
    18281959    gc->setLabel(QObject::tr("Zoom"));
    18291960    gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff),
    18301961                     QString::number(kAdjustFill_AutoDetect_DefaultOff));
    static HostComboBox *AdjustFill() 
    18351966    gc->setHelpText(QObject::tr(
    18361967                        "When enabled, these will apply a predefined "
    18371968                        "zoom to all video playback in MythTV."));
    1838     return gc;
     1969    return wrap(gc, settings);
    18391970}
    18401971
    18411972// Theme settings
    static HostSpinBox *NetworkControlPort() 
    27302861    return gs;
    27312862}
    27322863
    2733 static HostCheckBox *RealtimePriority()
     2864static Setting *RealtimePriority(PlaySettings *settings)
    27342865{
    2735     HostCheckBox *gc = new HostCheckBox("RealtimePriority");
     2866    CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings);
    27362867    gc->setLabel(QObject::tr("Enable realtime priority threads"));
    27372868    gc->setHelpText(QObject::tr("When running mythfrontend with root "
    27382869                    "privileges, some threads can be given enhanced priority. "
    27392870                    "Disable this if mythfrontend freezes during video "
    27402871                    "playback."));
    27412872    gc->setValue(true);
    2742     return gc;
     2873    return wrap(gc, settings, false);
    27432874}
    27442875
    27452876static HostCheckBox *EnableMediaMon()
    class WatchListSettings : public TriggeredConfigurationGroup 
    28963027
    28973028#ifdef USING_OPENGL_VSYNC
    28983029/*
    2899 static HostCheckBox *UseOpenGLVSync()
     3030static Setting *UseOpenGLVSync(PlaySettings *settings)
    29003031{
    2901     HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");
     3032    CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings);
    29023033    gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing"));
    29033034    gc->setValue(false);
    29043035    gc->setHelpText(QObject::tr(
    29053036                        "If supported by your hardware/drivers, "
    29063037                        "MythTV will use OpenGL vertical syncing for "
    29073038                        "video timing, reducing frame jitter."));
    2908     return gc;
     3039    return wrap(gc, settings);
    29093040}
    29103041*/
    29113042#endif
    static HostCheckBox *WatchTVGuide() 
    33323463    return gc;
    33333464}
    33343465
    3335 MainGeneralSettings::MainGeneralSettings()
     3466MainGeneralSettings::MainGeneralSettings(PlaySettings *settings,
     3467                                         ConfigurationWizard *base)
    33363468{
     3469    if (!settings)
     3470    {
    33373471    DatabaseSettings::addDatabaseSettings(this);
    33383472
    33393473    VerticalConfigurationGroup *pin =
    MainGeneralSettings::MainGeneralSettings() 
    33813515    remotecontrol->addChild(NetworkControlEnabled());
    33823516    remotecontrol->addChild(NetworkControlPort());
    33833517    addChild(remotecontrol);
     3518    }
    33843519}
    33853520
    3386 PlaybackSettings::PlaybackSettings()
     3521PlaybackSettings::PlaybackSettings(PlaySettings *settings,
     3522                                   ConfigurationWizard *base)
    33873523{
    33883524    uint i = 0, total = 8;
    33893525#if CONFIG_DARWIN
    33903526    total += 2;
    33913527#endif // USING_DARWIN
     3528    if (settings)
     3529        total -= 3;
    33923530
    33933531
    33943532    VerticalConfigurationGroup* general1 =
    33953533        new VerticalConfigurationGroup(false);
    33963534    general1->setLabel(QObject::tr("General Playback") +
    33973535                      QString(" (%1/%2)").arg(++i).arg(total));
     3536    if (settings)
     3537        general1->setLabel(QObject::tr("Playback group settings for ") +
     3538                           settings->mGroupName + " - " +
     3539                           general1->getLabel());
    33983540
    33993541    HorizontalConfigurationGroup *columns =
    34003542        new HorizontalConfigurationGroup(false, false, true, true);
    34013543
    34023544    VerticalConfigurationGroup *column1 =
    34033545        new VerticalConfigurationGroup(false, false, true, true);
    3404     column1->addChild(RealtimePriority());
    3405     column1->addChild(DecodeExtraAudio());
    3406     column1->addChild(JumpToProgramOSD());
     3546    if (!settings)
     3547        column1->addChild(RealtimePriority(settings));
     3548    column1->addChild(DecodeExtraAudio(settings));
     3549    column1->addChild(JumpToProgramOSD(settings));
    34073550    columns->addChild(column1);
    34083551
    34093552    VerticalConfigurationGroup *column2 =
    34103553        new VerticalConfigurationGroup(false, false, true, true);
    3411     column2->addChild(ClearSavedPosition());
    3412     column2->addChild(AltClearSavedPosition());
    3413     column2->addChild(AutomaticSetWatched());
    3414     column2->addChild(ContinueEmbeddedTVPlay());
     3554    column2->addChild(ClearSavedPosition(settings));
     3555    column2->addChild(AltClearSavedPosition(settings));
     3556    column2->addChild(AutomaticSetWatched(settings));
     3557    column2->addChild(ContinueEmbeddedTVPlay(settings));
    34153558    columns->addChild(column2);
    34163559
    34173560    general1->addChild(columns);
    3418     general1->addChild(LiveTVIdleTimeout());
     3561    if (!settings)
     3562        general1->addChild(LiveTVIdleTimeout());
    34193563#ifdef USING_OPENGL_VSYNC
    3420     //general1->addChild(UseOpenGLVSync());
     3564    //general1->addChild(UseOpenGLVSync(settings));
    34213565#endif // USING_OPENGL_VSYNC
    3422     addChild(general1);
     3566    if (base)
     3567        base->addChild(general1);
     3568    else
     3569        addChild(general1);
    34233570
    34243571    VerticalConfigurationGroup* general2 =
    34253572        new VerticalConfigurationGroup(false);
    34263573    general2->setLabel(QObject::tr("General Playback") +
    34273574                      QString(" (%1/%2)").arg(++i).arg(total));
     3575    if (settings)
     3576        general2->setLabel(QObject::tr("Playback group settings for ") +
     3577                           settings->mGroupName + " - " +
     3578                           general2->getLabel());
    34283579
    34293580    HorizontalConfigurationGroup* oscan =
    34303581        new HorizontalConfigurationGroup(false, false, true, true);
    PlaybackSettings::PlaybackSettings() 
    34323583        new VerticalConfigurationGroup(false, false, true, true);
    34333584    VerticalConfigurationGroup *ocol2 =
    34343585        new VerticalConfigurationGroup(false, false, true, true);
    3435     ocol1->addChild(VertScanPercentage());
    3436     ocol1->addChild(YScanDisplacement());
    3437     ocol2->addChild(HorizScanPercentage());
    3438     ocol2->addChild(XScanDisplacement());
     3586    ocol1->addChild(VertScanPercentage(settings));
     3587    ocol1->addChild(YScanDisplacement(settings));
     3588    ocol2->addChild(HorizScanPercentage(settings));
     3589    ocol2->addChild(XScanDisplacement(settings));
    34393590    oscan->addChild(ocol1);
    34403591    oscan->addChild(ocol2);
    34413592
    34423593    HorizontalConfigurationGroup* aspect_fill =
    34433594        new HorizontalConfigurationGroup(false, false, true, true);
    3444     aspect_fill->addChild(AspectOverride());
    3445     aspect_fill->addChild(AdjustFill());
     3595    aspect_fill->addChild(AspectOverride(settings));
     3596    aspect_fill->addChild(AdjustFill(settings));
    34463597
    34473598    general2->addChild(oscan);
    34483599    general2->addChild(aspect_fill);
    3449     general2->addChild(LetterboxingColour());
    3450     general2->addChild(PIPLocationComboBox());
    3451     general2->addChild(PlaybackExitPrompt());
    3452     general2->addChild(EndOfRecordingExitPrompt());
    3453     addChild(general2);
     3600    general2->addChild(LetterboxingColour(settings));
     3601    general2->addChild(PIPLocationComboBox(settings));
     3602    general2->addChild(PlaybackExitPrompt(settings));
     3603    general2->addChild(EndOfRecordingExitPrompt(settings));
     3604    if (base)
     3605        base->addChild(general2);
     3606    else
     3607        addChild(general2);
    34543608
    34553609    QString tmp = QString(" (%1/%2)").arg(++i).arg(total);
    3456     addChild(new PlaybackProfileConfigs(tmp));
     3610    if (base)
     3611        base->addChild(new PlaybackProfileConfigs(tmp, settings));
     3612    else
     3613        addChild(new PlaybackProfileConfigs(tmp, settings));
    34573614
     3615    if (!settings)
     3616    {
    34583617    VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false);
    34593618    pbox->setLabel(QObject::tr("View Recordings") +
    34603619                   QString(" (%1/%2)").arg(++i).arg(total));
    PlaybackSettings::PlaybackSettings() 
    34813640    pbox3->addChild(DisplayGroupTitleSort());
    34823641    pbox3->addChild(new WatchListSettings());
    34833642    addChild(pbox3);
     3643    }
    34843644
    34853645    VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false);
    34863646    seek->setLabel(QObject::tr("Seeking") +
    34873647                   QString(" (%1/%2)").arg(++i).arg(total));
    3488     seek->addChild(SmartForward());
    3489     seek->addChild(FFRewReposTime());
    3490     seek->addChild(FFRewReverse());
    3491     seek->addChild(ExactSeeking());
    3492     addChild(seek);
     3648    if (settings)
     3649        seek->setLabel(QObject::tr("Playback group settings for ") +
     3650                       settings->mGroupName + " - " +
     3651                       seek->getLabel());
     3652    seek->addChild(SmartForward(settings));
     3653    seek->addChild(FFRewReposTime(settings));
     3654    seek->addChild(FFRewReverse(settings));
     3655    seek->addChild(ExactSeeking(settings));
     3656    if (base)
     3657        base->addChild(seek);
     3658    else
     3659        addChild(seek);
    34933660
    34943661    VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false);
    34953662    comms->setLabel(QObject::tr("Commercial Skip") +
    34963663                    QString(" (%1/%2)").arg(++i).arg(total));
    3497     comms->addChild(AutoCommercialSkip());
    3498     comms->addChild(CommRewindAmount());
    3499     comms->addChild(CommNotifyAmount());
     3664    if (settings)
     3665        comms->setLabel(QObject::tr("Playback group settings for ") +
     3666                        settings->mGroupName + " - " +
     3667                        comms->getLabel());
     3668    comms->addChild(AutoCommercialSkip(settings));
     3669    comms->addChild(CommRewindAmount(settings));
     3670    comms->addChild(CommNotifyAmount(settings));
     3671    if (!settings) // these are global settings, not host-specific
     3672    {
    35003673    comms->addChild(MaximumCommercialSkip());
    35013674    comms->addChild(MergeShortCommBreaks());
    3502     addChild(comms);
     3675    }
     3676    if (base)
     3677        base->addChild(comms);
     3678    else
     3679        addChild(comms);
    35033680
    35043681#if CONFIG_DARWIN
    35053682    VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false);
    35063683    mac1->setLabel(QObject::tr("Mac OS X Video Settings") +
    35073684                   QString(" (%1/%2)").arg(++i).arg(total));
     3685    if (settings)
     3686        mac1->setLabel(QObject::tr("Playback group settings for ") +
     3687                       settings->mGroupName + " - " +
     3688                       mac1->getLabel());
     3689    if (!settings)
     3690    {
    35083691    mac1->addChild(MacGammaCorrect());
    35093692    mac1->addChild(MacScaleUp());
    35103693    mac1->addChild(MacFullSkip());
    3511     addChild(mac1);
     3694    }
     3695    if (base)
     3696        base->addChild(mac1);
     3697    else
     3698        addChild(mac1);
    35123699
    35133700    VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false);
    35143701    mac2->setLabel(QObject::tr("Mac OS X Video Settings") +
    35153702                   QString(" (%1/%2)").arg(++i).arg(total));
     3703    if (settings)
     3704        mac2->setLabel(QObject::tr("Playback group settings for ") +
     3705                       settings->mGroupName + " - " +
     3706                       mac2->getLabel());
     3707    if (!setings)
     3708    {
    35163709    mac2->addChild(new MacMainSettings());
    35173710    mac2->addChild(new MacFloatSettings());
    35183711
    PlaybackSettings::PlaybackSettings() 
    35263719#endif
    35273720}
    35283721
    3529 OSDSettings::OSDSettings()
     3722OSDSettings::OSDSettings(PlaySettings *settings,
     3723                         ConfigurationWizard *base)
    35303724{
    35313725    VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false);
    35323726    osd->setLabel(QObject::tr("On-screen Display"));
     3727    if (settings)
     3728        osd->setLabel(QObject::tr("Playback group settings for ") +
     3729                      settings->mGroupName + " - " +
     3730                      osd->getLabel());
    35333731
    3534     osd->addChild(EnableMHEG());
    3535     osd->addChild(PersistentBrowseMode());
    3536     osd->addChild(BrowseAllTuners());
    3537     osd->addChild(CCBackground());
    3538     osd->addChild(DefaultCCMode());
    3539     osd->addChild(PreferCC708());
     3732    if (!settings)
     3733    {
     3734    osd->addChild(EnableMHEG(settings));
     3735    osd->addChild(PersistentBrowseMode(settings));
     3736    osd->addChild(BrowseAllTuners(settings));
     3737    }
     3738    osd->addChild(CCBackground(settings));
     3739    osd->addChild(DefaultCCMode(settings));
     3740    osd->addChild(PreferCC708(settings));
     3741    if (!settings)
    35403742    osd->addChild(SubtitleFont());
    3541     osd->addChild(OSDCC708TextZoomPercentage());
    3542     osd->addChild(SubtitleCodec());
    3543     //osd->addChild(UDPNotifyPort());
    3544     addChild(osd);
     3743    osd->addChild(OSDCC708TextZoomPercentage(settings));
     3744    osd->addChild(SubtitleCodec(settings));
     3745    //osd->addChild(UDPNotifyPort(settings));
     3746    if (base)
     3747        base->addChild(osd);
     3748    else
     3749        addChild(osd);
    35453750
    35463751    //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false);
    35473752    //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 bf4036f..726eb79 100644
    a b using namespace std; 
    3838#include "audiogeneralsettings.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) 
    482483        delete statusbox;
    483484}
    484485
     486ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     487{
     488    return new PlaybackSettings(settings, base);
     489}
     490
     491ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     492{
     493    return new OSDSettings(settings, base);
     494}
     495
     496ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     497{
     498    return new MainGeneralSettings(settings, base);
     499}
     500
     501static PlayGroupEditor::SettingsLookup pbgroupSetup[] = {
     502    createPlaybackSettingsForPlaybackGroup,
     503    createOSDSettingsForPlaybackGroup,
     504    createMainGeneralSettingsForPlaybackGroup
     505};
     506
    485507static void TVMenuCallback(void *data, QString &selection)
    486508{
    487509    (void)data;
    static void TVMenuCallback(void *data, QString &selection) 
    580602    }
    581603    else if (sel == "settings playgroup")
    582604    {
    583         PlayGroupEditor editor;
     605        PlayGroupEditor editor(pbgroupSetup,
     606                               sizeof(pbgroupSetup)/sizeof(*pbgroupSetup));
    584607        editor.exec();
    585608    }
    586609    else if (sel == "settings general")
    static int internal_play_media(const QString &mrl, const QString &plot, 
    782805            }
    783806        }
    784807        delete tmprbuf;
     808        pginfo->SetPlaybackGroup("Videos");
    785809    }
    786810    else if (pginfo->IsVideo())
     811    {
    787812        pos = pginfo->QueryBookmark();
     813        pginfo->SetPlaybackGroup("Videos");
     814    }
    788815
    789816    if (pos > 0)
    790817    {