Ticket #7269: playgroup.diff

File playgroup.diff, 5.3 KB (added by doug@…, 10 years ago)
  • libs/libmythtv/playgroup.cpp

     
    66#include <iostream>
    77#include "playgroup.h"
    88#include "programinfo.h"
     9#include "videoouttypes.h"
    910
    1011// A parameter associated with the profile itself
    1112class PlayGroupDBStorage : public SimpleDBStorage
     
    125126    }
    126127};
    127128
     129class AspectOverrideModeSetting : public ComboBoxSetting, public PlayGroupDBStorage
     130{
     131  public:
     132    AspectOverrideModeSetting(const PlayGroup& _parent) :
     133        ComboBoxSetting(this),
     134        PlayGroupDBStorage(this, _parent, "aspectoverridemode")
     135    {
     136        setLabel(QObject::tr("Aspect Ratio"));
     137        setHelpText(QObject::tr("Change the default Aspect Ratio. "));
     138    }
     139
     140    void Load(void)
     141    {
     142        for (int j = kAspect_Off; j < kAspect_END; j++)
     143        {
     144            // swap 14:9 and 16:9
     145            int i = ((kAspect_14_9 == j) ? kAspect_16_9 :
     146                    ((kAspect_16_9 == j) ? kAspect_14_9 : j));
     147
     148            addSelection(toString((AspectOverrideMode) i), QString("%1").arg(i));
     149        }
     150
     151        PlayGroupDBStorage::Load();
     152    }
     153
     154};
     155
     156class AdjustFillModeSetting : public ComboBoxSetting, public PlayGroupDBStorage
     157{
     158  public:
     159    AdjustFillModeSetting(const PlayGroup& _parent) :
     160        ComboBoxSetting(this),
     161        PlayGroupDBStorage(this, _parent, "adjustfillmode")
     162    {
     163        setLabel(QObject::tr("Fill Mode"));
     164        setHelpText(QObject::tr("Change the default Fill Modeo. "));
     165    }
     166
     167    void Load(void)
     168    {
     169        for (int i = kAdjustFill_Off; i < kAdjustFill_END; i++)
     170        {
     171            addSelection(toString((AdjustFillMode) i), QString("%1").arg(i));
     172        }
     173
     174        PlayGroupDBStorage::Load();
     175    }
     176
     177};
     178
     179
    128180PlayGroup::PlayGroup(QString _name)
    129181    : name(_name)
    130182{
     
    136188    cgroup->addChild(new SkipBack(*this));
    137189    cgroup->addChild(new JumpMinutes(*this));
    138190    cgroup->addChild(new TimeStretch(*this));
     191    cgroup->addChild(new AspectOverrideModeSetting(*this));
     192    cgroup->addChild(new AdjustFillModeSetting(*this));
    139193
    140194    addChild(cgroup);
    141195};
  • libs/libmythtv/dbcheck.cpp

     
    1818#define MINIMUM_DBMS_VERSION 5,0,15
    1919
    2020/// This is the DB schema version expected by the running MythTV instance.
    21 const QString currentDatabaseVersion = "1244";
     21const QString currentDatabaseVersion = "1245";
    2222
    2323static bool UpdateDBVersionNumber(const QString &newnumber);
    2424static bool performActualUpdate(
     
    48964896            return false;
    48974897    }
    48984898
     4899    if (dbver == "1244")
     4900    {
     4901       const char *updates[] = {
     4902"ALTER TABLE playgroup ADD COLUMN aspectoverridemode INT NOT NULL DEFAULT 0;",
     4903"ALTER TABLE playgroup ADD COLUMN adjustfillmode INT NOT NULL DEFAULT 0;",
     4904"UPDATE playgroup SET aspectoverridemode = 0, adjustfillmode = 0;",
     4905NULL
     4906};
     4907        if (!performActualUpdate(updates, "1245", dbver))
     4908            return false;
     4909    }
     4910
     4911
    48994912if (0) // apply at or near 0.22 release..
    49004913{
    49014914    if (dbver == "XXXX")
  • libs/libmythtv/playercontext.cpp

     
    4747    // DB values
    4848    fftime(0), rewtime(0),
    4949    jumptime(0), ts_normal(1.0f), ts_alt(1.5f),
     50    overrideMode(kAspect_Off), adjustFillMode(kAdjustFill_Off),
    5051    // locks
    5152    playingInfoLock(QMutex::Recursive), deleteNVPLock(QMutex::Recursive),
    5253    stateLock(QMutex::Recursive),
     
    953954    jumptime     = PlayGroup::GetSetting(group, "jump", 10);
    954955    ts_normal    = PlayGroup::GetSetting(group, "timestretch", 100) * 0.01f;
    955956    ts_alt       = (ts_normal == 1.0f) ? 1.5f : 1.0f;
     957    overrideMode = (AspectOverrideMode) PlayGroup::GetSetting(group, "aspectoverridemode", kAspect_Off);
     958    adjustFillMode = (AdjustFillMode) PlayGroup::GetSetting(group, "adjustfillmode", kAdjustFill_Off);
    956959}
    957960
    958961void PlayerContext::SetPseudoLiveTV(
  • libs/libmythtv/tv_play.cpp

     
    51295129    {
    51305130        ctx->StartOSD(this);
    51315131        SetSpeedChangeTimer(25, __LINE__);
     5132
     5133        if (ctx->nvp) {
     5134            ctx->nvp->ToggleAspectOverride(ctx->overrideMode);
     5135            ctx->nvp->ToggleAdjustFill(ctx->adjustFillMode);
     5136        }
    51325137    }
    51335138
     5139
    51345140    VERBOSE(VB_IMPORTANT, LOC + QString("StartPlayer(%1, %2, %3) -- end %4")
    51355141            .arg(find_player_index(ctx)).arg(StateToString(desiredState))
    51365142            .arg((wantPiP) ? "PiP" : "main").arg((ok) ? "ok" : "error"));
  • libs/libmythtv/playercontext.h

     
    180180     */
    181181    float               ts_normal;
    182182    float               ts_alt;
     183    AspectOverrideMode  overrideMode;
     184    AdjustFillMode      adjustFillMode;
    183185
    184186    mutable QMutex      playingInfoLock;
    185187    mutable QMutex      deleteNVPLock;