Ticket #8088: 8088_playgroups_v21.patch

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

    diff --git a/mythtv/libs/libmyth/libmyth.pro b/mythtv/libs/libmyth/libmyth.pro
    index 2178699..e8d35ba 100644
    a b SOURCES += programtypes.cpp recordingtypes.cpp  
    6565SOURCES += mythrssmanager.cpp     netgrabbermanager.cpp
    6666SOURCES += rssparse.cpp           netutils.cpp
    6767
     68HEADERS += playsettings.h
     69SOURCES += playsettings.cpp
     70
    6871# remove when everything is switched to mythui
    6972SOURCES += virtualkeyboard_qt.cpp
    7073
  • 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 b955a9b..5b253b2 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 9e8335e..202975e 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 6a7252c..1a08078 100644
    a b using namespace std;  
    3535#include "bdringbuffer.h"
    3636#include "videodisplayprofile.h"
    3737#include "mythuihelper.h"
     38#include "playsettings.h"
    3839
    3940#include "lcddevice.h"
    4041
    AvFormatDecoder::AvFormatDecoder(MythPlayer *parent,  
    284285
    285286    cc608_build_parity_table(cc608_parity_table);
    286287
    287     if (gCoreContext->GetNumSetting("CCBackground", 0))
     288    if (GetPlayer()->GetPlaySettings()->GetNumSetting("CCBackground", 0))
    288289        CC708Window::forceWhiteOnBlackText = true;
    289290
    290291    no_dts_hack = false;
    void AvFormatDecoder::InitVideoCodec(AVStream *stream, AVCodecContext *enc,  
    11811182    if (selectedStream)
    11821183    {
    11831184        directrendering = true;
    1184         if (!gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&
     1185        if (!GetPlayer()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) &&
    11851186            !CODEC_IS_HWACCEL(codec, enc))
    11861187        {
    11871188            SetLowBuffers(false);
    int AvFormatDecoder::ScanStreams(bool novideo)  
    16861687
    16871688                if (!is_db_ignored)
    16881689                {
    1689                     VideoDisplayProfile vdp;
     1690                    VideoDisplayProfile vdp(GetPlayer()->GetPlaySettings());
    16901691                    vdp.SetInput(QSize(width, height));
    16911692                    dec = vdp.GetDecoder();
    16921693                    thread_count = vdp.GetMaxCPUs();
    int AvFormatDecoder::ScanStreams(bool novideo)  
    17141715                    MythCodecID vdpau_mcid;
    17151716                    vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec(
    17161717                        width, height,
    1717                         mpeg_version(enc->codec_id), no_hardware_decoders);
     1718                        mpeg_version(enc->codec_id), no_hardware_decoders,
     1719                        GetPlayer()->GetPlaySettings());
    17181720
    17191721                    if (vdpau_mcid >= video_codec_id)
    17201722                    {
  • 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 198e1fa..faf4986 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 * play_speed),
    548                 0 /*embedid*/);
     542                0 /*embedid*/, GetPlaySettings());
    549543        }
    550544
    551545        if (videoOutput)
    void MythPlayer::ReinitOSD(void)  
    636630
    637631void MythPlayer::ReinitVideo(void)
    638632{
    639     if (!videoOutput->IsPreferredRenderer(video_disp_dim))
     633    if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings()))
    640634    {
    641635        VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer."));
    642636        SetErrored(QObject::tr("Need to switch video renderer."));
    void MythPlayer::VideoStart(void)  
    20392033        }
    20402034#endif // USING_MHEG
    20412035
    2042         SetCaptionsEnabled(gCoreContext->GetNumSetting("DefaultCCMode"), false);
     2036        SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0),
     2037                           false);
    20432038        osdLock.unlock();
    20442039    }
    20452040
    void MythPlayer::VideoStart(void)  
    20862081        m_double_process = videoOutput->IsExtraProcessingRequired();
    20872082
    20882083        videosync = VideoSync::BestMethod(
    2089             videoOutput, fr_int, rf_int, m_double_framerate);
     2084            videoOutput, GetPlaySettings(),
     2085            fr_int, rf_int, m_double_framerate);
    20902086
    20912087        // Make sure video sync can do it
    20922088        if (videosync != NULL && m_double_framerate)
    void MythPlayer::InitialSeek(void)  
    24692465    if (bookmarkseek > 30)
    24702466    {
    24712467        DoFastForward(bookmarkseek, true, false);
    2472         if (gCoreContext->GetNumSetting("ClearSavedPosition", 1) &&
     2468        if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) &&
    24732469            !player_ctx->IsPIP())
    24742470        {
    24752471            ClearBookmark(false);
    void MythPlayer::EventLoop(void)  
    26972693    {
    26982694        if (jumpto == totalFrames)
    26992695        {
    2700             if (!(gCoreContext->GetNumSetting("EndOfRecordingExitPrompt") == 1
     2696            if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1
    27012697                  && !player_ctx->IsPIP() &&
    27022698                  player_ctx->GetState() == kState_WatchingPreRecorded))
    27032699            {
    PIPLocation MythPlayer::GetNextPIPLocation(void) const  
    29802976        return kPIP_END;
    29812977
    29822978    if (pip_players.isEmpty())
    2983         return (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft);
     2979        return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation",
     2980                                                             kPIPTopLeft);
    29842981
    29852982    // order of preference, could be stored in db if we want it configurable
    29862983    PIPLocation ols[] =
    void MythPlayer::SetPlayerInfo(TV *tv, QWidget *widget,  
    34883485    exactseeks   = frame_exact_seek;
    34893486    player_ctx   = ctx;
    34903487    livetv       = ctx->tvchain;
     3488
     3489    vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", ""));
     3490
     3491    // Playback (output) zoom control
     3492    detect_letter_box = new DetectLetterbox(this);
     3493
     3494    decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0);
     3495    itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0);
     3496    db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1);
    34913497}
    34923498
    34933499bool MythPlayer::EnableEdit(void)
  • mythtv/libs/libmythtv/mythplayer.h

    diff --git a/mythtv/libs/libmythtv/mythplayer.h b/mythtv/libs/libmythtv/mythplayer.h
    index b776296..90f8417 100644
    a b class MPUBLIC MythPlayer  
    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 6c9111b..eadae1b 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,  
    405407                                 WId embedwinid, const QRect *embedbounds,
    406408                                 bool muted)
    407409{
    408     int exact_seeking = gCoreContext->GetNumSetting("ExactSeeking", 0);
     410    int exact_seeking = settings->GetNumSetting("ExactSeeking", 0);
    409411
    410412    if (HasPlayer())
    411413    {
    bool PlayerContext::CreatePlayer(TV *tv, QWidget *widget,  
    448450    {
    449451        QString subfn = buffer->GetSubtitleFilename();
    450452        if (!subfn.isEmpty() && player->GetSubReader())
    451             player->GetSubReader()->LoadExternalSubtitles(subfn);
     453            player->GetSubReader()->LoadExternalSubtitles(subfn, settings);
    452454    }
    453455
    454456    if ((embedwinid > 0) && embedbounds)
    void PlayerContext::SetRingBuffer(RingBuffer *buf)  
    915917/**
    916918 * \brief assign programinfo to the context
    917919 */
    918 void PlayerContext::SetPlayingInfo(const ProgramInfo *info)
     920void PlayerContext::SetPlayingInfo(const ProgramInfo *info,
     921                                   PlaySettings *_settings)
    919922{
    920923    bool ignoreDB = gCoreContext->IsDatabaseIgnored();
    921924
    void PlayerContext::SetPlayingInfo(const ProgramInfo *info)  
    927930            playingInfo->MarkAsInUse(false, recUsage);
    928931        delete playingInfo;
    929932        playingInfo = NULL;
     933        // XXX delete settings?
    930934    }
    931935
    932936    if (info)
    void PlayerContext::SetPlayingInfo(const ProgramInfo *info)  
    935939        if (!ignoreDB)
    936940            playingInfo->MarkAsInUse(true, recUsage);
    937941        playingLen = playingInfo->GetSecondsInRecording();
     942        settings = (_settings ? _settings :
     943                    new PlaySettings(playingInfo->GetPlaybackGroup()));
    938944    }
    939945}
    940946
  • mythtv/libs/libmythtv/playercontext.h

    diff --git a/mythtv/libs/libmythtv/playercontext.h b/mythtv/libs/libmythtv/playercontext.h
    index 97faf89..c0abcb1 100644
    a b class ProgramInfo;  
    2828class LiveTVChain;
    2929class MythDialog;
    3030class QPainter;
     31class PlaySettings;
    3132
    3233struct osdInfo
    3334{
    class MPUBLIC PlayerContext  
    115116    void SetRecorder(RemoteEncoder *rec);
    116117    void SetTVChain(LiveTVChain *chain);
    117118    void SetRingBuffer(RingBuffer *buf);
    118     void SetPlayingInfo(const ProgramInfo *info);
     119    void SetPlayingInfo(const ProgramInfo *info, PlaySettings *settings=NULL);
    119120    void SetPlayGroup(const QString &group);
    120121    void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state);
    121122    void SetPIPLocation(int loc) { pipLocation = loc; }
    class MPUBLIC PlayerContext  
    173174    LiveTVChain        *tvchain;
    174175    RingBuffer         *buffer;
    175176    ProgramInfo        *playingInfo; ///< Currently playing info
     177    PlaySettings       *settings; // corresponding to playingInfo
    176178    long long           playingLen;  ///< Initial CalculateLength()
    177179    AVSpecialDecode     specialDecode;
    178180    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 d7a381c..d4ac611 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)  
    22242229            QString msg = tr("%1 Settings")
    22252230                    .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup()));
    22262231            ctx->UnlockPlayingInfo(__FILE__, __LINE__);
    2227             if (count > 0)
     2232            if (count > 0 &&
     2233                ctx->playingInfo->GetPlaybackGroup() != "Default" &&
     2234                ctx->playingInfo->GetPlaybackGroup() != "Videos")
    22282235                SetOSDMessage(ctx, msg);
    22292236            ITVRestart(ctx, false);
    22302237        }
  • 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 a3b4ced..66ce548 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  
    124126    static QString     GetDecoderName(const QString &decoder);
    125127    static QString     GetDecoderHelp(QString decoder = QString::null);
    126128
    127     static QString     GetDefaultProfileName(const QString &hostname);
     129    static QString     GetDefaultProfileName(const QString &hostname,
     130                                             PlaySettings *settings);
    128131    static void        SetDefaultProfileName(const QString &profilename,
    129132                                             const QString &hostname);
    130133    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 4119fb5..507999e 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() :  
    343346    monitor_sz(640,480),                monitor_dim(400,300),
    344347
    345348    // OSD
    346     osd_painter(NULL),                  osd_image(NULL)
     349    osd_painter(NULL),                  osd_image(NULL),
     350    settings(_settings)
    347351
    348352{
    349353    bzero(&pip_tmp_image, sizeof(pip_tmp_image));
    350     db_display_dim = QSize(gCoreContext->GetNumSetting("DisplaySizeWidth",  0),
    351                            gCoreContext->GetNumSetting("DisplaySizeHeight", 0));
     354    db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth",  0),
     355                           settings->GetNumSetting("DisplaySizeHeight", 0));
    352356
    353357    db_aspectoverride = (AspectOverrideMode)
    354         gCoreContext->GetNumSetting("AspectOverride",      0);
     358        settings->GetNumSetting("AspectOverride",      0);
    355359    db_adjustfill = (AdjustFillMode)
    356         gCoreContext->GetNumSetting("AdjustFill",          0);
     360        settings->GetNumSetting("AdjustFill",          0);
    357361    db_letterbox_colour = (LetterBoxColour)
    358         gCoreContext->GetNumSetting("LetterboxColour",     0);
     362        settings->GetNumSetting("LetterboxColour",     0);
    359363
    360364    if (!gCoreContext->IsDatabaseIgnored())
    361         db_vdisp_profile = new VideoDisplayProfile();
     365        db_vdisp_profile = new VideoDisplayProfile(settings);
    362366}
    363367
    364368/**
    QString VideoOutput::GetFilters(void) const  
    434438    return QString::null;
    435439}
    436440
    437 bool VideoOutput::IsPreferredRenderer(QSize video_size)
     441bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings)
    438442{
    439443    if (!db_vdisp_profile || (video_size == window.GetVideoDispDim()))
    440444        return true;
    441445
    442     VideoDisplayProfile vdisp;
     446    VideoDisplayProfile vdisp(settings);
    443447    vdisp.SetInput(video_size);
    444448    QString new_rend = vdisp.GetVideoRenderer();
    445449    if (new_rend.isEmpty())
  • mythtv/libs/libmythtv/videooutbase.h

    diff --git a/mythtv/libs/libmythtv/videooutbase.h b/mythtv/libs/libmythtv/videooutbase.h
    index 91de709..659b528 100644
    a b class OSD;  
    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  
    331333    // OSD painter and surface
    332334    MythYUVAPainter *osd_painter;
    333335    MythImage       *osd_image;
     336
     337    PlaySettings *settings;
    334338};
    335339
    336340#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 47f96af..a3c30eb 100644
    a b  
    3838#include "mythconfig.h"
    3939#include "mythdirs.h"
    4040#include "mythuihelper.h"
     41#include "playsettings.h"
     42
     43#define CREATE_CHECKBOX_SETTING(var, name, settings) \
     44    BooleanSetting *var; \
     45    if ((settings)) \
     46        var = new PlaySettingsCheckBox((name), (settings)); \
     47    else \
     48        var = new HostCheckBox((name))
     49
     50#define CREATE_COMBOBOX_SETTING(var, name, settings) \
     51    ComboBoxSetting *var; \
     52    if ((settings)) \
     53        var = new PlaySettingsComboBox((name), (settings)); \
     54    else \
     55        var = new HostComboBox((name))
     56
     57#define CREATE_COMBOBOX1_SETTING(var, name, settings, arg1) \
     58    ComboBoxSetting *var; \
     59    if ((settings)) \
     60        var = new PlaySettingsComboBox((name), (settings), (arg1)); \
     61    else \
     62        var = new HostComboBox((name), (arg1))
     63
     64#define CREATE_SPINBOX_SETTING(var, name, settings, arg1, arg2, arg3, arg4) \
     65    SpinBoxSetting *var; \
     66    if ((settings)) \
     67        var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3), (arg4)); \
     68    else \
     69        var = new HostSpinBox((name), (arg1), (arg2), (arg3), (arg4))
     70
     71#define CREATE_LINEEDIT_SETTING(var, name, settings) \
     72    LineEditSetting *var; \
     73    if ((settings)) \
     74        var = new PlaySettingsLineEdit((name), (settings), ""); \
     75    else \
     76        var = new HostLineEdit((name))
     77
     78// For PlaySettings, use a SpinBox instead of a Slider so that a
     79// default value can be easily used.
     80#define CREATE_SLIDER_SETTING(var, name, settings, arg1, arg2, arg3) \
     81    BoundedIntegerSetting *var; \
     82    if ((settings)) \
     83        var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3)); \
     84    else \
     85        var = new HostSlider((name), (arg1), (arg2), (arg3))
     86
     87#define CREATE_IMAGESELECT_SETTING(var, name, settings) \
     88    ImageSelectSetting *var; \
     89    if ((settings)) \
     90        var = new PlaySettingsImageSelect((name), (settings)); \
     91    else \
     92        var = new HostImageSelect((name))
     93
     94static Setting *wrap(Setting *obj, PlaySettings *settings,
     95                     bool twoLineLabel=false)
     96{
     97    if (!settings)
     98        return obj;
     99
     100    // Get the setting name
     101    PlaySettingsCombinedStorage *storage =
     102        dynamic_cast<PlaySettingsCombinedStorage *>(obj);
     103    const QString &name = storage->getName();
     104
     105    // Get the default value and label.  The label is  different
     106    // from the value for most object types.
     107    QString defaultValue = settings->GetSetting(name, "", true);
     108    QString defaultLabel(defaultValue);
     109    if (dynamic_cast<BooleanSetting *>(obj))
     110        defaultLabel = (defaultValue == "0" || defaultValue.isEmpty() ?
     111                        QObject::tr("disabled") : QObject::tr("enabled"));
     112    if (dynamic_cast<SpinBoxSetting *>(obj) && defaultValue.isEmpty())
     113        defaultLabel = "0";
     114    ComboBoxSetting *cb = dynamic_cast<ComboBoxSetting *>(obj);
     115    if (cb)
     116    {
     117        defaultLabel = cb->GetValueLabel(defaultValue);
     118        // Add the default selection to a ComboBox
     119        cb->addSelection(QString("(") + QObject::tr("default") + ")",
     120                         storage->getDefault(),
     121                         !settings->IsOverridden(name),
     122                         true);
     123    }
     124    ImageSelectSetting *is = dynamic_cast<ImageSelectSetting *>(obj);
     125    if (is)
     126    {
     127        defaultLabel = is->GetValueLabel(defaultValue);
     128        // Add the default selection to a ImageSelect
     129        is->addDefaultSelection(QString("(") + QObject::tr("default") + ")",
     130                                storage->getDefault(),
     131                                defaultValue,
     132                                !settings->IsOverridden(name));
     133    }
     134   
     135    // Change the help text to include the default and its source.
     136    QString helpPrefix;
     137    if (dynamic_cast<LineEditSetting *>(obj))
     138        helpPrefix = QObject::tr("Leave blank to keep default value");
     139    else
     140        helpPrefix = QObject::tr("Override default value");
     141    helpPrefix += " (" + defaultLabel + ") ";
     142    QString inheritsFrom = settings->InheritsFrom(name);
     143    if (inheritsFrom.isNull())
     144        helpPrefix += QObject::tr("from global settings");
     145    else
     146        helpPrefix += QObject::tr("from group") + " " + inheritsFrom;
     147    helpPrefix += ". " + obj->getHelpText();
     148    obj->setHelpText(helpPrefix);
     149
     150    // Change the label to include the default.
     151    obj->setLabel(obj->getLabel() + (twoLineLabel ? "\n" : "") +
     152                  " (" + defaultLabel + ")");
     153
     154    return obj;
     155}
    41156
    42157class TriggeredItem : public TriggeredConfigurationGroup
    43158{
    static HostSlider *PCMVolume()  
    589704    return gs;
    590705}
    591706
    592 static HostCheckBox *DecodeExtraAudio()
     707static Setting *DecodeExtraAudio(PlaySettings *settings)
    593708{
    594     HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");
     709    CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings);
    595710    gc->setLabel(QObject::tr("Extra audio buffering"));
    596711    gc->setValue(true);
    597712    gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing "
    static HostCheckBox *DecodeExtraAudio()  
    600715                    "effect on framegrabbers (MPEG-4/RTJPEG). MythTV will "
    601716                    "keep extra audio data in its internal buffers to "
    602717                    "workaround this bug."));
    603     return gc;
     718    return wrap(gc, settings);
    604719}
    605720
    606 static HostComboBox *PIPLocationComboBox()
     721static Setting *PIPLocationComboBox(PlaySettings *settings)
    607722{
    608     HostComboBox *gc = new HostComboBox("PIPLocation");
     723    CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings);
    609724    gc->setLabel(QObject::tr("PIP video location"));
    610725    for (uint loc = 0; loc < kPIP_END; ++loc)
    611726        gc->addSelection(toString((PIPLocation) loc), QString::number(loc));
    612727    gc->setHelpText(QObject::tr("Location of PIP Video window."));
    613     return gc;
     728    return wrap(gc, settings);
    614729}
    615730
    616731static HostComboBox *DisplayRecGroup()
    static HostCheckBox *PBBStartInTitle()  
    696811    return gc;
    697812}
    698813
    699 static HostCheckBox *SmartForward()
     814static Setting *SmartForward(PlaySettings *settings)
    700815{
    701     HostCheckBox *gc = new HostCheckBox("SmartForward");
     816    CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings);
    702817    gc->setLabel(QObject::tr("Smart fast forwarding"));
    703818    gc->setValue(false);
    704819    gc->setHelpText(QObject::tr("If enabled, then immediately after "
    705820                    "rewinding, only skip forward the same amount as "
    706821                    "skipping backwards."));
    707     return gc;
     822    return wrap(gc, settings);
    708823}
    709824
    710 static HostCheckBox *ExactSeeking()
     825static Setting *ExactSeeking(PlaySettings *settings)
    711826{
    712     HostCheckBox *gc = new HostCheckBox("ExactSeeking");
     827    CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings);
    713828    gc->setLabel(QObject::tr("Seek to exact frame"));
    714829    gc->setValue(false);
    715830    gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but "
    716831                    "slower."));
    717     return gc;
     832    return wrap(gc, settings);
    718833}
    719834
    720835static GlobalComboBox *CommercialSkipMethod()
    static GlobalCheckBox *CommFlagFast()  
    742857    return gc;
    743858}
    744859
    745 static HostComboBox *AutoCommercialSkip()
     860static Setting *AutoCommercialSkip(PlaySettings *settings)
    746861{
    747     HostComboBox *gc = new HostComboBox("AutoCommercialSkip");
     862    CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings);
    748863    gc->setLabel(QObject::tr("Automatically skip commercials"));
    749864    gc->addSelection(QObject::tr("Off"), "0");
    750865    gc->addSelection(QObject::tr("Notify, but do not skip"), "2");
    static HostComboBox *AutoCommercialSkip()  
    753868                    "have been flagged during automatic commercial detection "
    754869                    "or by the mythcommflag program, or just notify that a "
    755870                    "commercial has been detected."));
    756     return gc;
     871    return wrap(gc, settings);
    757872}
    758873
    759874static GlobalCheckBox *AutoCommercialFlag()
    static GlobalCheckBox *AggressiveCommDetect()  
    827942    return bc;
    828943}
    829944
    830 static HostSpinBox *CommRewindAmount()
     945static Setting *CommRewindAmount(PlaySettings *settings)
    831946{
    832     HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);
     947    CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false);
    833948    gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)"));
    834949    gs->setHelpText(QObject::tr("MythTV will automatically rewind "
    835950                    "this many seconds after performing a commercial skip."));
    836951    gs->setValue(0);
    837     return gs;
     952    return wrap(gs, settings);
    838953}
    839954
    840 static HostSpinBox *CommNotifyAmount()
     955static Setting *CommNotifyAmount(PlaySettings *settings)
    841956{
    842     HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);
     957    CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false);
    843958    gs->setLabel(QObject::tr("Commercial skip notify amount (secs)"));
    844959    gs->setHelpText(QObject::tr("MythTV will act like a commercial "
    845960                    "begins this many seconds early. This can be useful "
    846961                    "when commercial notification is used in place of "
    847962                    "automatic skipping."));
    848963    gs->setValue(0);
    849     return gs;
     964    return wrap(gs, settings);
    850965}
    851966
    852967static GlobalSpinBox *MaximumCommercialSkip()
    void PlaybackProfileConfig::swap(int i, int j)  
    16481763    labels[j]->setValue(label_i);
    16491764}
    16501765
    1651 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) :
     1766PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str,
     1767                                               PlaySettings *settings) :
    16521768    TriggeredConfigurationGroup(false, true,  true, true,
    16531769                                false, false, true, true), grouptrigger(NULL)
    16541770{
    16551771    setLabel(QObject::tr("Playback Profiles") + str);
     1772    if (settings)
     1773        setLabel(QObject::tr("Playback group settings for ") +
     1774                 settings->mGroupName + " - " +
     1775                 getLabel());
    16561776
    16571777    QString host = gCoreContext->GetHostName();
    16581778    QStringList profiles = VideoDisplayProfile::GetProfiles(host);
    PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) :  
    16801800        profiles = VideoDisplayProfile::GetProfiles(host);
    16811801    }
    16821802
    1683     QString profile = VideoDisplayProfile::GetDefaultProfileName(host);
     1803    QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings);
    16841804    if (!profiles.contains(profile))
    16851805    {
    16861806        profile = (profiles.contains("Normal")) ? "Normal" : profiles[0];
    16871807        VideoDisplayProfile::SetDefaultProfileName(profile, host);
    16881808    }
    16891809
    1690     grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile");
     1810    CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings);
     1811    grouptrigger = gs;
    16911812    grouptrigger->setLabel(QObject::tr("Current Video Playback Profile"));
    16921813    QStringList::const_iterator it;
    16931814    for (it = profiles.begin(); it != profiles.end(); ++it)
    16941815        grouptrigger->addSelection(ProgramInfo::i18n(*it), *it);
     1816    if (settings)
     1817    {
     1818        addChild(wrap(grouptrigger, settings));
     1819        return;
     1820    }
    16951821
    16961822    HorizontalConfigurationGroup *grp =
    16971823        new HorizontalConfigurationGroup(false, false, true, true);
    static HostComboBox *PlayBoxEpisodeSort()  
    18241950    return gc;
    18251951}
    18261952
    1827 static HostSpinBox *FFRewReposTime()
     1953static Setting *FFRewReposTime(PlaySettings *settings)
    18281954{
    1829     HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);
     1955    CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false);
    18301956    gs->setLabel(QObject::tr("Fast forward/rewind reposition amount"));
    18311957    gs->setValue(100);
    18321958    gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind "
    static HostSpinBox *FFRewReposTime()  
    18341960                    "resuming normal playback. This "
    18351961                    "compensates for the reaction time between seeing "
    18361962                    "where to resume playback and actually exiting seeking."));
    1837     return gs;
     1963    return wrap(gs, settings);
    18381964}
    18391965
    1840 static HostCheckBox *FFRewReverse()
     1966static Setting *FFRewReverse(PlaySettings *settings)
    18411967{
    1842     HostCheckBox *gc = new HostCheckBox("FFRewReverse");
     1968    CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings);
    18431969    gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind"));
    18441970    gc->setValue(true);
    18451971    gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key "
    static HostCheckBox *FFRewReverse()  
    18471973                    "vice versa. If disabled, it will decrease the "
    18481974                    "current speed or switch to play mode if "
    18491975                    "the speed can't be decreased further."));
    1850     return gc;
     1976    return wrap(gc, settings);
    18511977}
    18521978
    18531979static HostComboBox *MenuTheme()
    static HostComboBox __attribute__ ((unused)) *DecodeVBIFormat()  
    18842010    return gc;
    18852011}
    18862012
    1887 static HostSpinBox *OSDCC708TextZoomPercentage(void)
     2013static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings)
    18882014{
    1889     HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5);
     2015    CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings,
     2016                           50, 200, 5, false);
    18902017    gs->setLabel(QObject::tr("Subtitle text zoom percentage"));
    18912018    gs->setValue(100);
    18922019    gs->setHelpText(QObject::tr("Use this to enlarge or shrink text based subtitles."));
    18932020
    1894     return gs;
     2021    return wrap(gs, settings);
    18952022}
    18962023
    18972024static HostComboBox *SubtitleFont()
    static HostComboBox *SubtitleFont()  
    19112038    return hcb;
    19122039}
    19132040
    1914 static HostComboBox *SubtitleCodec()
     2041static Setting *SubtitleCodec(PlaySettings *settings)
    19152042{
    1916     HostComboBox *gc = new HostComboBox("SubtitleCodec");
     2043    CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings);
    19172044
    19182045    gc->setLabel(QObject::tr("Subtitle Codec"));
    19192046    QList<QByteArray> list = QTextCodec::availableCodecs();
    static HostComboBox *SubtitleCodec()  
    19232050        gc->addSelection(val, val, val.toLower() == "utf-8");
    19242051    }
    19252052
    1926     return gc;
     2053    return wrap(gc, settings);
    19272054}
    19282055
    19292056static HostComboBox *ChannelOrdering()
    static HostComboBox *ChannelOrdering()  
    19352062    return gc;
    19362063}
    19372064
    1938 static HostSpinBox *VertScanPercentage()
     2065static Setting *VertScanPercentage(PlaySettings *settings)
    19392066{
    1940     HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1);
     2067    CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings,
     2068                           -100, 100, 1, false);
    19412069    gs->setLabel(QObject::tr("Vertical scaling"));
    19422070    gs->setValue(0);
    19432071    gs->setHelpText(QObject::tr(
    19442072                        "Adjust this if the image does not fill your "
    19452073                        "screen vertically. Range -100% to 100%"));
    1946     return gs;
     2074    return wrap(gs, settings);
    19472075}
    19482076
    1949 static HostSpinBox *HorizScanPercentage()
     2077static Setting *HorizScanPercentage(PlaySettings *settings)
    19502078{
    1951     HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1);
     2079    CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings,
     2080                           -100, 100, 1, false);
    19522081    gs->setLabel(QObject::tr("Horizontal scaling"));
    19532082    gs->setValue(0);
    19542083    gs->setHelpText(QObject::tr(
    19552084                        "Adjust this if the image does not fill your "
    19562085                        "screen horizontally. Range -100% to 100%"));
    1957     return gs;
     2086    return wrap(gs, settings);
    19582087};
    19592088
    1960 static HostSpinBox *XScanDisplacement()
     2089static Setting *XScanDisplacement(PlaySettings *settings)
    19612090{
    1962     HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1);
     2091    CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings,
     2092                           -50, 50, 1, false);
    19632093    gs->setLabel(QObject::tr("Scan displacement (X)"));
    19642094    gs->setValue(0);
    19652095    gs->setHelpText(QObject::tr("Adjust this to move the image horizontally."));
    1966     return gs;
     2096    return wrap(gs, settings);
    19672097}
    19682098
    1969 static HostSpinBox *YScanDisplacement()
     2099static Setting *YScanDisplacement(PlaySettings *settings)
    19702100{
    1971     HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1);
     2101    CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings,
     2102                           -50, 50, 1, false);
    19722103    gs->setLabel(QObject::tr("Scan displacement (Y)"));
    19732104    gs->setValue(0);
    19742105    gs->setHelpText(QObject::tr("Adjust this to move the image vertically."));
    1975     return gs;
     2106    return wrap(gs, settings);
    19762107};
    19772108
    1978 static HostCheckBox *CCBackground()
     2109static Setting *CCBackground(PlaySettings *settings)
    19792110{
    1980     HostCheckBox *gc = new HostCheckBox("CCBackground");
     2111    CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings);
    19812112    gc->setLabel(QObject::tr("Black background for closed captioning"));
    19822113    gc->setValue(false);
    19832114    gc->setHelpText(QObject::tr(
    19842115                        "If enabled, captions will be displayed "
    19852116                        "as white text over a black background "
    19862117                        "for better contrast."));
    1987     return gc;
     2118    return wrap(gc, settings);
    19882119}
    19892120
    1990 static HostCheckBox *DefaultCCMode()
     2121static Setting *DefaultCCMode(PlaySettings *settings)
    19912122{
    1992     HostCheckBox *gc = new HostCheckBox("DefaultCCMode");
     2123    CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings);
    19932124    gc->setLabel(QObject::tr("Always display closed captioning or subtitles"));
    19942125    gc->setValue(false);
    19952126    gc->setHelpText(QObject::tr(
    static HostCheckBox *DefaultCCMode()  
    19972128                        "when playing back recordings or watching "
    19982129                        "Live TV. Closed Captioning can be turned on or off "
    19992130                        "by pressing \"T\" during playback."));
    2000     return gc;
     2131    return wrap(gc, settings);
    20012132}
    20022133
    2003 static HostCheckBox *PreferCC708()
     2134static Setting *PreferCC708(PlaySettings *settings)
    20042135{
    2005     HostCheckBox *gc = new HostCheckBox("Prefer708Captions");
     2136    CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings);
    20062137    gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions"));
    20072138    gc->setValue(true);
    20082139    gc->setHelpText(
    static HostCheckBox *PreferCC708()  
    20102141            "If enabled, the newer EIA-708 captions will be preferred over "
    20112142            "the older EIA-608 captions in ATSC streams."));
    20122143
    2013     return gc;
     2144    return wrap(gc, settings);
    20142145}
    20152146
    2016 static HostCheckBox *EnableMHEG()
     2147static Setting *EnableMHEG(PlaySettings *settings)
    20172148{
    2018     HostCheckBox *gc = new HostCheckBox("EnableMHEG");
     2149    CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings);
    20192150    gc->setLabel(QObject::tr("Enable interactive TV"));
    20202151    gc->setValue(false);
    20212152    gc->setHelpText(QObject::tr(
    20222153                        "If enabled, interactive TV applications (MHEG) will "
    20232154                        "be activated. This is used for teletext and logos for "
    20242155                        "radio and channels that are currently off-air."));
    2025     return gc;
     2156    return wrap(gc, settings);
    20262157}
    20272158
    2028 static HostCheckBox *PersistentBrowseMode()
     2159static Setting *PersistentBrowseMode(PlaySettings *settings)
    20292160{
    2030     HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");
     2161    CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings);
    20312162    gc->setLabel(QObject::tr("Always use browse mode in Live TV"));
    20322163    gc->setValue(true);
    20332164    gc->setHelpText(
    20342165        QObject::tr(
    20352166            "If enabled, browse mode will automatically be activated "
    20362167            "whenever you use channel up/down while watching Live TV."));
    2037     return gc;
     2168    return wrap(gc, settings);
    20382169}
    20392170
    2040 static HostCheckBox *BrowseAllTuners()
     2171static Setting *BrowseAllTuners(PlaySettings *settings)
    20412172{
    2042     HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");
     2173    CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings);
    20432174    gc->setLabel(QObject::tr("Browse all channels"));
    20442175    gc->setValue(false);
    20452176    gc->setHelpText(
    static HostCheckBox *BrowseAllTuners()  
    20472178            "If enabled, browse mode will shows channels on all "
    20482179            "available recording devices, instead of showing "
    20492180            "channels on just the current recorder."));
    2050     return gc;
     2181    return wrap(gc, settings);
    20512182}
    20522183
    2053 static HostCheckBox *ClearSavedPosition()
     2184static Setting *ClearSavedPosition(PlaySettings *settings)
    20542185{
    2055     HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");
     2186    CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings);
    20562187    gc->setLabel(QObject::tr("Clear bookmark on playback"));
    20572188    gc->setValue(true);
    20582189    gc->setHelpText(QObject::tr("If enabled, automatically clear the "
    20592190                    "bookmark on a recording when the recording is played "
    20602191                    "back. If disabled, you can mark the beginning with "
    20612192                    "rewind then save position."));
    2062     return gc;
     2193    return wrap(gc, settings);
    20632194}
    20642195
    2065 static HostCheckBox *AltClearSavedPosition()
     2196static Setting *AltClearSavedPosition(PlaySettings *settings)
    20662197{
    2067     HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");
     2198    CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings);
    20682199    gc->setLabel(QObject::tr("Alternate clear and save bookmark"));
    20692200    gc->setValue(true);
    20702201    gc->setHelpText(QObject::tr("During playback the SELECT key "
    static HostCheckBox *AltClearSavedPosition()  
    20722203                    "Saved\" and \"Bookmark Cleared\". If disabled, the "
    20732204                    "SELECT key will save the current position for each "
    20742205                    "keypress."));
    2075     return gc;
     2206    return wrap(gc, settings);
    20762207}
    20772208
    20782209// This currently does not work
    20792210/*
    2080 static HostLineEdit *UDPNotifyPort()
     2211static Setting *UDPNotifyPort(PlaySettings *settings)
    20812212{
    2082     HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");
     2213    CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings);
    20832214    ge->setLabel(QObject::tr("UDP notify port"));
    20842215    ge->setValue("6948");
    20852216    ge->setHelpText(QObject::tr("During playback, MythTV will listen for "
    20862217                    "connections from the \"mythtvosd\" or \"mythudprelay\" "
    20872218                    "programs on this port. For additional information, see "
    20882219                    "http://www.mythtv.org/wiki/MythNotify ."));
    2089     return ge;
     2220    return wrap(ge, settings);
    20902221}
    20912222*/
    20922223
    2093 static HostComboBox *PlaybackExitPrompt()
     2224static Setting *PlaybackExitPrompt(PlaySettings *settings)
    20942225{
    2095     HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");
     2226    CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings);
    20962227    gc->setLabel(QObject::tr("Action on playback exit"));
    20972228    gc->addSelection(QObject::tr("Just exit"), "0");
    20982229    gc->addSelection(QObject::tr("Save position and exit"), "2");
    static HostComboBox *PlaybackExitPrompt()  
    21032234                    "when you exit playback mode. The options available will "
    21042235                    "allow you to save your position, delete the "
    21052236                    "recording, or continue watching."));
    2106     return gc;
     2237    return wrap(gc, settings);
    21072238}
    21082239
    2109 static HostCheckBox *EndOfRecordingExitPrompt()
     2240static Setting *EndOfRecordingExitPrompt(PlaySettings *settings)
    21102241{
    2111     HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");
     2242    CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings);
    21122243    gc->setLabel(QObject::tr("Prompt at end of recording"));
    21132244    gc->setValue(false);
    21142245    gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing "
    21152246                    "you to delete the recording when it has finished "
    21162247                    "playing."));
    2117     return gc;
     2248    return wrap(gc, settings);
    21182249}
    21192250
    2120 static HostCheckBox *JumpToProgramOSD()
     2251static Setting *JumpToProgramOSD(PlaySettings *settings)
    21212252{
    2122     HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");
     2253    CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings);
    21232254    gc->setLabel(QObject::tr("Jump to program OSD"));
    21242255    gc->setValue(true);
    21252256    gc->setHelpText(QObject::tr(
    static HostCheckBox *JumpToProgramOSD()  
    21282259                        "'Watch Recording' screen when 'Jump to Program' "
    21292260                        "is activated. If enabled, the recordings are shown "
    21302261                        "in the OSD"));
    2131     return gc;
     2262    return wrap(gc, settings);
    21322263}
    21332264
    2134 static HostCheckBox *ContinueEmbeddedTVPlay()
     2265static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings)
    21352266{
    2136     HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");
     2267    CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings);
    21372268    gc->setLabel(QObject::tr("Continue playback when embedded"));
    21382269    gc->setValue(false);
    21392270    gc->setHelpText(QObject::tr(
    static HostCheckBox *ContinueEmbeddedTVPlay()  
    21412272                    "is embedded in the upcoming program list or recorded "
    21422273                    "list. The default is to pause the recorded show when "
    21432274                    "embedded."));
    2144     return gc;
     2275    return wrap(gc, settings);
    21452276}
    21462277
    2147 static HostCheckBox *AutomaticSetWatched()
     2278static Setting *AutomaticSetWatched(PlaySettings *settings)
    21482279{
    2149     HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");
     2280    CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings);
    21502281    gc->setLabel(QObject::tr("Automatically mark a recording as watched"));
    21512282    gc->setValue(false);
    21522283    gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a "
    static HostCheckBox *AutomaticSetWatched()  
    21542285                    "detection is not foolproof, so do not enable this "
    21552286                    "setting if you don't want an unwatched recording marked "
    21562287                    "as watched."));
    2157     return gc;
     2288    return wrap(gc, settings);
    21582289}
    21592290
    21602291static HostSpinBox *LiveTVIdleTimeout()
    static HostComboBox *XineramaMonitorAspectRatio()  
    23442475    return gc;
    23452476}
    23462477
    2347 static HostComboBox *LetterboxingColour()
     2478static Setting *LetterboxingColour(PlaySettings *settings)
    23482479{
    2349     HostComboBox *gc = new HostComboBox("LetterboxColour");
     2480    CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings);
    23502481    gc->setLabel(QObject::tr("Letterboxing color"));
    23512482    for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
    23522483        gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
    static HostComboBox *LetterboxingColour()  
    23562487            "letterboxing, but those with plasma screens may prefer gray "
    23572488            "to minimize burn-in.") + " " +
    23582489        QObject::tr("Currently only works with XVideo video renderer."));
    2359     return gc;
     2490    return wrap(gc, settings);
    23602491}
    23612492
    2362 static HostComboBox *AspectOverride()
     2493static Setting *AspectOverride(PlaySettings *settings)
    23632494{
    2364     HostComboBox *gc = new HostComboBox("AspectOverride");
     2495    CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings);
    23652496    gc->setLabel(QObject::tr("Video aspect override"));
    23662497    for (int m = kAspect_Off; m < kAspect_END; ++m)
    23672498        gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
    static HostComboBox *AspectOverride()  
    23692500                        "When enabled, these will override the aspect "
    23702501                        "ratio specified by any broadcaster for all "
    23712502                        "video streams."));
    2372     return gc;
     2503    return wrap(gc, settings);
    23732504}
    23742505
    2375 static HostComboBox *AdjustFill()
     2506static Setting *AdjustFill(PlaySettings *settings)
    23762507{
    2377     HostComboBox *gc = new HostComboBox("AdjustFill");
     2508    CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings);
    23782509    gc->setLabel(QObject::tr("Zoom"));
    23792510    gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff),
    23802511                     QString::number(kAdjustFill_AutoDetect_DefaultOff));
    static HostComboBox *AdjustFill()  
    23852516    gc->setHelpText(QObject::tr(
    23862517                        "When enabled, these will apply a predefined "
    23872518                        "zoom to all video playback in MythTV."));
    2388     return gc;
     2519    return wrap(gc, settings);
    23892520}
    23902521
    23912522// Theme settings
    static HostSpinBox *NetworkControlPort()  
    33103441    return gs;
    33113442}
    33123443
    3313 static HostCheckBox *RealtimePriority()
     3444static Setting *RealtimePriority(PlaySettings *settings)
    33143445{
    3315     HostCheckBox *gc = new HostCheckBox("RealtimePriority");
     3446    CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings);
    33163447    gc->setLabel(QObject::tr("Enable realtime priority threads"));
    33173448    gc->setHelpText(QObject::tr("When running mythfrontend with root "
    33183449                    "privileges, some threads can be given enhanced priority. "
    33193450                    "Disable this if mythfrontend freezes during video "
    33203451                    "playback."));
    33213452    gc->setValue(true);
    3322     return gc;
     3453    return wrap(gc, settings, false);
    33233454}
    33243455
    33253456static HostCheckBox *EnableMediaMon()
    class WatchListSettings : public TriggeredConfigurationGroup  
    34763607
    34773608#ifdef USING_OPENGL_VSYNC
    34783609/*
    3479 static HostCheckBox *UseOpenGLVSync()
     3610static Setting *UseOpenGLVSync(PlaySettings *settings)
    34803611{
    3481     HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");
     3612    CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings);
    34823613    gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing"));
    34833614    gc->setValue(false);
    34843615    gc->setHelpText(QObject::tr(
    34853616                        "If supported by your hardware/drivers, "
    34863617                        "MythTV will use OpenGL vertical syncing for "
    34873618                        "video timing, reducing frame jitter."));
    3488     return gc;
     3619    return wrap(gc, settings);
    34893620}
    34903621*/
    34913622#endif
    static HostCheckBox *WatchTVGuide()  
    39124043    return gc;
    39134044}
    39144045
    3915 MainGeneralSettings::MainGeneralSettings()
     4046MainGeneralSettings::MainGeneralSettings(PlaySettings *settings,
     4047                                         ConfigurationWizard *base)
    39164048{
     4049    if (!settings)
     4050    {
    39174051    DatabaseSettings::addDatabaseSettings(this);
    39184052
    39194053    VerticalConfigurationGroup *pin =
    MainGeneralSettings::MainGeneralSettings()  
    39654099    remotecontrol->addChild(NetworkControlEnabled());
    39664100    remotecontrol->addChild(NetworkControlPort());
    39674101    addChild(remotecontrol);
     4102    }
    39684103}
    39694104
    3970 PlaybackSettings::PlaybackSettings()
     4105PlaybackSettings::PlaybackSettings(PlaySettings *settings,
     4106                                   ConfigurationWizard *base)
    39714107{
    39724108    uint i = 0, total = 8;
    39734109#if CONFIG_DARWIN
    39744110    total += 2;
    39754111#endif // USING_DARWIN
     4112    if (settings)
     4113        total -= 3;
    39764114
    39774115
    39784116    VerticalConfigurationGroup* general1 =
    39794117        new VerticalConfigurationGroup(false);
    39804118    general1->setLabel(QObject::tr("General Playback") +
    39814119                      QString(" (%1/%2)").arg(++i).arg(total));
     4120    if (settings)
     4121        general1->setLabel(QObject::tr("Playback group settings for ") +
     4122                           settings->mGroupName + " - " +
     4123                           general1->getLabel());
    39824124
    39834125    HorizontalConfigurationGroup *columns =
    39844126        new HorizontalConfigurationGroup(false, false, true, true);
    39854127
    39864128    VerticalConfigurationGroup *column1 =
    39874129        new VerticalConfigurationGroup(false, false, true, true);
    3988     column1->addChild(RealtimePriority());
    3989     column1->addChild(DecodeExtraAudio());
    3990     column1->addChild(JumpToProgramOSD());
     4130    if (!settings)
     4131        column1->addChild(RealtimePriority(settings));
     4132    column1->addChild(DecodeExtraAudio(settings));
     4133    column1->addChild(JumpToProgramOSD(settings));
    39914134    columns->addChild(column1);
    39924135
    39934136    VerticalConfigurationGroup *column2 =
    39944137        new VerticalConfigurationGroup(false, false, true, true);
    3995     column2->addChild(ClearSavedPosition());
    3996     column2->addChild(AltClearSavedPosition());
    3997     column2->addChild(AutomaticSetWatched());
    3998     column2->addChild(ContinueEmbeddedTVPlay());
     4138    column2->addChild(ClearSavedPosition(settings));
     4139    column2->addChild(AltClearSavedPosition(settings));
     4140    column2->addChild(AutomaticSetWatched(settings));
     4141    column2->addChild(ContinueEmbeddedTVPlay(settings));
    39994142    columns->addChild(column2);
    40004143
    40014144    general1->addChild(columns);
    4002     general1->addChild(LiveTVIdleTimeout());
     4145    if (!settings)
     4146        general1->addChild(LiveTVIdleTimeout());
    40034147#ifdef USING_OPENGL_VSYNC
    4004     //general1->addChild(UseOpenGLVSync());
     4148    //general1->addChild(UseOpenGLVSync(settings));
    40054149#endif // USING_OPENGL_VSYNC
    4006     addChild(general1);
     4150    if (base)
     4151        base->addChild(general1);
     4152    else
     4153        addChild(general1);
    40074154
    40084155    VerticalConfigurationGroup* general2 =
    40094156        new VerticalConfigurationGroup(false);
    40104157    general2->setLabel(QObject::tr("General Playback") +
    40114158                      QString(" (%1/%2)").arg(++i).arg(total));
     4159    if (settings)
     4160        general2->setLabel(QObject::tr("Playback group settings for ") +
     4161                           settings->mGroupName + " - " +
     4162                           general2->getLabel());
    40124163
    40134164    HorizontalConfigurationGroup* oscan =
    40144165        new HorizontalConfigurationGroup(false, false, true, true);
    PlaybackSettings::PlaybackSettings()  
    40164167        new VerticalConfigurationGroup(false, false, true, true);
    40174168    VerticalConfigurationGroup *ocol2 =
    40184169        new VerticalConfigurationGroup(false, false, true, true);
    4019     ocol1->addChild(VertScanPercentage());
    4020     ocol1->addChild(YScanDisplacement());
    4021     ocol2->addChild(HorizScanPercentage());
    4022     ocol2->addChild(XScanDisplacement());
     4170    ocol1->addChild(VertScanPercentage(settings));
     4171    ocol1->addChild(YScanDisplacement(settings));
     4172    ocol2->addChild(HorizScanPercentage(settings));
     4173    ocol2->addChild(XScanDisplacement(settings));
    40234174    oscan->addChild(ocol1);
    40244175    oscan->addChild(ocol2);
    40254176
    40264177    HorizontalConfigurationGroup* aspect_fill =
    40274178        new HorizontalConfigurationGroup(false, false, true, true);
    4028     aspect_fill->addChild(AspectOverride());
    4029     aspect_fill->addChild(AdjustFill());
     4179    aspect_fill->addChild(AspectOverride(settings));
     4180    aspect_fill->addChild(AdjustFill(settings));
    40304181
    40314182    general2->addChild(oscan);
    40324183    general2->addChild(aspect_fill);
    4033     general2->addChild(LetterboxingColour());
    4034     general2->addChild(PIPLocationComboBox());
    4035     general2->addChild(PlaybackExitPrompt());
    4036     general2->addChild(EndOfRecordingExitPrompt());
    4037     addChild(general2);
     4184    general2->addChild(LetterboxingColour(settings));
     4185    general2->addChild(PIPLocationComboBox(settings));
     4186    general2->addChild(PlaybackExitPrompt(settings));
     4187    general2->addChild(EndOfRecordingExitPrompt(settings));
     4188    if (base)
     4189        base->addChild(general2);
     4190    else
     4191        addChild(general2);
    40384192
    40394193    QString tmp = QString(" (%1/%2)").arg(++i).arg(total);
    4040     addChild(new PlaybackProfileConfigs(tmp));
     4194    if (base)
     4195        base->addChild(new PlaybackProfileConfigs(tmp, settings));
     4196    else
     4197        addChild(new PlaybackProfileConfigs(tmp, settings));
    40414198
     4199    if (!settings)
     4200    {
    40424201    VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false);
    40434202    pbox->setLabel(QObject::tr("View Recordings") +
    40444203                   QString(" (%1/%2)").arg(++i).arg(total));
    PlaybackSettings::PlaybackSettings()  
    40654224    pbox3->addChild(DisplayGroupTitleSort());
    40664225    pbox3->addChild(new WatchListSettings());
    40674226    addChild(pbox3);
     4227    }
    40684228
    40694229    VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false);
    40704230    seek->setLabel(QObject::tr("Seeking") +
    40714231                   QString(" (%1/%2)").arg(++i).arg(total));
    4072     seek->addChild(SmartForward());
    4073     seek->addChild(FFRewReposTime());
    4074     seek->addChild(FFRewReverse());
    4075     seek->addChild(ExactSeeking());
    4076     addChild(seek);
     4232    if (settings)
     4233        seek->setLabel(QObject::tr("Playback group settings for ") +
     4234                       settings->mGroupName + " - " +
     4235                       seek->getLabel());
     4236    seek->addChild(SmartForward(settings));
     4237    seek->addChild(FFRewReposTime(settings));
     4238    seek->addChild(FFRewReverse(settings));
     4239    seek->addChild(ExactSeeking(settings));
     4240    if (base)
     4241        base->addChild(seek);
     4242    else
     4243        addChild(seek);
    40774244
    40784245    VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false);
    40794246    comms->setLabel(QObject::tr("Commercial Skip") +
    40804247                    QString(" (%1/%2)").arg(++i).arg(total));
    4081     comms->addChild(AutoCommercialSkip());
    4082     comms->addChild(CommRewindAmount());
    4083     comms->addChild(CommNotifyAmount());
     4248    if (settings)
     4249        comms->setLabel(QObject::tr("Playback group settings for ") +
     4250                        settings->mGroupName + " - " +
     4251                        comms->getLabel());
     4252    comms->addChild(AutoCommercialSkip(settings));
     4253    comms->addChild(CommRewindAmount(settings));
     4254    comms->addChild(CommNotifyAmount(settings));
     4255    if (!settings) // these are global settings, not host-specific
     4256    {
    40844257    comms->addChild(MaximumCommercialSkip());
    40854258    comms->addChild(MergeShortCommBreaks());
    4086     addChild(comms);
     4259    }
     4260    if (base)
     4261        base->addChild(comms);
     4262    else
     4263        addChild(comms);
    40874264
    40884265#if CONFIG_DARWIN
    40894266    VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false);
    40904267    mac1->setLabel(QObject::tr("Mac OS X Video Settings") +
    40914268                   QString(" (%1/%2)").arg(++i).arg(total));
     4269    if (settings)
     4270        mac1->setLabel(QObject::tr("Playback group settings for ") +
     4271                       settings->mGroupName + " - " +
     4272                       mac1->getLabel());
     4273    if (!settings)
     4274    {
    40924275    mac1->addChild(MacGammaCorrect());
    40934276    mac1->addChild(MacScaleUp());
    40944277    mac1->addChild(MacFullSkip());
    4095     addChild(mac1);
     4278    }
     4279    if (base)
     4280        base->addChild(mac1);
     4281    else
     4282        addChild(mac1);
    40964283
    40974284    VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false);
    40984285    mac2->setLabel(QObject::tr("Mac OS X Video Settings") +
    40994286                   QString(" (%1/%2)").arg(++i).arg(total));
     4287    if (settings)
     4288        mac2->setLabel(QObject::tr("Playback group settings for ") +
     4289                       settings->mGroupName + " - " +
     4290                       mac2->getLabel());
     4291    if (!setings)
     4292    {
    41004293    mac2->addChild(new MacMainSettings());
    41014294    mac2->addChild(new MacFloatSettings());
    41024295
    PlaybackSettings::PlaybackSettings()  
    41104303#endif
    41114304}
    41124305
    4113 OSDSettings::OSDSettings()
     4306OSDSettings::OSDSettings(PlaySettings *settings,
     4307                         ConfigurationWizard *base)
    41144308{
    41154309    VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false);
    41164310    osd->setLabel(QObject::tr("On-screen Display"));
     4311    if (settings)
     4312        osd->setLabel(QObject::tr("Playback group settings for ") +
     4313                      settings->mGroupName + " - " +
     4314                      osd->getLabel());
    41174315
    4118     osd->addChild(EnableMHEG());
    4119     osd->addChild(PersistentBrowseMode());
    4120     osd->addChild(BrowseAllTuners());
    4121     osd->addChild(CCBackground());
    4122     osd->addChild(DefaultCCMode());
    4123     osd->addChild(PreferCC708());
     4316    if (!settings)
     4317    {
     4318    osd->addChild(EnableMHEG(settings));
     4319    osd->addChild(PersistentBrowseMode(settings));
     4320    osd->addChild(BrowseAllTuners(settings));
     4321    }
     4322    osd->addChild(CCBackground(settings));
     4323    osd->addChild(DefaultCCMode(settings));
     4324    osd->addChild(PreferCC708(settings));
     4325    if (!settings)
    41244326    osd->addChild(SubtitleFont());
    4125     osd->addChild(OSDCC708TextZoomPercentage());
    4126     osd->addChild(SubtitleCodec());
    4127     //osd->addChild(UDPNotifyPort());
    4128     addChild(osd);
     4327    osd->addChild(OSDCC708TextZoomPercentage(settings));
     4328    osd->addChild(SubtitleCodec(settings));
     4329    //osd->addChild(UDPNotifyPort(settings));
     4330    if (base)
     4331        base->addChild(osd);
     4332    else
     4333        addChild(osd);
    41294334
    41304335    //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false);
    41314336    //cc->setLabel(QObject::tr("Closed Captions"));
  • mythtv/programs/mythfrontend/globalsettings.h

    diff --git a/mythtv/programs/mythfrontend/globalsettings.h b/mythtv/programs/mythfrontend/globalsettings.h
    index 7c9b4d5..f9197a5 100644
    a b  
    1313
    1414class QFileInfo;
    1515class AudioDeviceComboBox;
     16class PlaySettings;
    1617
    1718class AudioConfigSettings : public VerticalConfigurationGroup
    1819{
    class ThemeSelector : public HostImageSelect  
    8990class PlaybackSettings : public ConfigurationWizard
    9091{
    9192  public:
    92     PlaybackSettings();
     93    PlaybackSettings(PlaySettings *settings=NULL,
     94                     ConfigurationWizard *base=NULL);
    9395};
    9496
    9597class OSDSettings: virtual public ConfigurationWizard
    9698{
    9799  public:
    98     OSDSettings();
     100    OSDSettings(PlaySettings *settings=NULL,
     101                ConfigurationWizard *base=NULL);
    99102};
    100103
    101104class GeneralSettings : public ConfigurationWizard
    class AppearanceSettings : public ConfigurationWizard  
    119122class MainGeneralSettings : public ConfigurationWizard
    120123{
    121124  public:
    122     MainGeneralSettings();
     125    MainGeneralSettings(PlaySettings *settings=NULL,
     126                        ConfigurationWizard *base=NULL);
    123127};
    124128
    125129class GeneralRecPrioritiesSettings : public ConfigurationWizard
    class PlaybackProfileConfigs : public TriggeredConfigurationGroup  
    207211    Q_OBJECT
    208212
    209213  public:
    210     PlaybackProfileConfigs(const QString &str);
     214    PlaybackProfileConfigs(const QString &str, PlaySettings *settings);
    211215    virtual ~PlaybackProfileConfigs();
    212216
    213217  private:
    class PlaybackProfileConfigs : public TriggeredConfigurationGroup  
    219223
    220224  private:
    221225    QStringList   profiles;
    222     HostComboBox *grouptrigger;
     226    ComboBoxSetting *grouptrigger;
    223227};
    224228
    225229#endif
  • mythtv/programs/mythfrontend/main.cpp

    diff --git a/mythtv/programs/mythfrontend/main.cpp b/mythtv/programs/mythfrontend/main.cpp
    index 7b42569..4658195 100644
    a b using namespace std;  
    3636#include "globalsettings.h"
    3737#include "profilegroup.h"
    3838#include "playgroup.h"
     39#include "playsettings.h"
    3940#include "networkcontrol.h"
    4041#include "dvdringbuffer.h"
    4142#include "scheduledrecording.h"
    static void showStatus(void)  
    480481        delete statusbox;
    481482}
    482483
     484ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     485{
     486    return new PlaybackSettings(settings, base);
     487}
     488
     489ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     490{
     491    return new OSDSettings(settings, base);
     492}
     493
     494ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     495{
     496    return new MainGeneralSettings(settings, base);
     497}
     498
     499static PlayGroupEditor::SettingsLookup pbgroupSetup[] = {
     500    createPlaybackSettingsForPlaybackGroup,
     501    createOSDSettingsForPlaybackGroup,
     502    createMainGeneralSettingsForPlaybackGroup
     503};
     504
    483505static void TVMenuCallback(void *data, QString &selection)
    484506{
    485507    (void)data;
    static void TVMenuCallback(void *data, QString &selection)  
    578600    }
    579601    else if (sel == "settings playgroup")
    580602    {
    581         PlayGroupEditor editor;
     603        PlayGroupEditor editor(pbgroupSetup,
     604                               sizeof(pbgroupSetup)/sizeof(*pbgroupSetup));
    582605        editor.exec();
    583606    }
    584607    else if (sel == "settings general")
    static int internal_play_media(const QString &mrl, const QString &plot,  
    770793            }
    771794        }
    772795        delete tmprbuf;
     796        pginfo->SetPlaybackGroup("Videos");
    773797    }
    774798    else if (pginfo->IsVideo())
     799    {
    775800        pos = pginfo->QueryBookmark();
     801        pginfo->SetPlaybackGroup("Videos");
     802    }
    776803
    777804    if (pos > 0)
    778805    {