Ticket #8088: 8088_playgroups_v20.patch

File 8088_playgroups_v20.patch, 109.2 KB (added by Jim Stichnoth <stichnot@…>, 9 years ago)
  • libs/libmythtv/videoout_vdpau.h

     
    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,
     
    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
  • libs/libmythtv/subtitlereader.h

     
    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);
  • libs/libmythtv/videooutwindow.cpp

     
    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"
     
    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),
     
    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;
     
    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
  • libs/libmythtv/videoout_d3d.cpp

     
    5252    opts.priorities->insert("direct3d", 55);
    5353}
    5454
    55 VideoOutputD3D::VideoOutputD3D(void)
    56   : VideoOutput(),        m_lock(QMutex::Recursive),
     55VideoOutputD3D::VideoOutputD3D(PlaySettigns *settings)
     56  : VideoOutput(settings), m_lock(QMutex::Recursive),
    5757    m_hWnd(NULL),          m_render(NULL),
    5858    m_video(NULL),
    5959    m_render_valid(false), m_render_reset(false), m_pip_active(NULL),
  • libs/libmythtv/DetectLetterbox.cpp

     
    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,
     
    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
  • libs/libmythtv/videoout_opengl.cpp

     
    3939    opts.priorities->insert("opengl", 65);
    4040}
    4141
    42 VideoOutputOpenGL::VideoOutputOpenGL()
    43     : VideoOutput(),
     42VideoOutputOpenGL::VideoOutputOpenGL(PlaySettings *settings)
     43    : VideoOutput(settings),
    4444    gl_context_lock(QMutex::Recursive),
    4545    gl_context(NULL), gl_videochain(NULL), gl_pipchain_active(NULL),
    4646    gl_parent_win(0), gl_embed_win(0), gl_painter(NULL)
  • libs/libmythtv/videoout_quartz.cpp

     
    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
     
    11051107/** \class VideoOutputQuartz
    11061108 *  \brief Implementation of Quartz (Mac OS X windowing system) video output
    11071109 */
    1108 VideoOutputQuartz::VideoOutputQuartz() :
    1109     VideoOutput(), Started(false), data(new QuartzData())
     1110VideoOutputQuartz::VideoOutputQuartz(PlaySettings *settings) :
     1111    VideoOutput(settings), Started(false), data(new QuartzData())
    11101112{
    11111113    init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0);
    11121114}
     
    17561758MythCodecID VideoOutputQuartz::GetBestSupportedCodec(
    17571759    uint width, uint height,
    17581760    uint osd_width, uint osd_height,
    1759     uint stream_type, uint fourcc)
     1761    uint stream_type, uint fourcc, PlaySettings *settings)
    17601762{
    17611763    (void) osd_width;
    17621764    (void) osd_height;
    17631765
    1764     VideoDisplayProfile vdp;
     1766    VideoDisplayProfile vdp(settings);
    17651767    vdp.SetInput(QSize(width, height));
    17661768    QString dec = vdp.GetDecoder();
    17671769    if ((dec == "libmpeg2") || (dec == "ffmpeg"))
  • libs/libmythtv/avformatdecoder.cpp

     
    3333#include "BDRingBuffer.h"
    3434#include "videodisplayprofile.h"
    3535#include "mythuihelper.h"
     36#include "playsettings.h"
    3637
    3738#include "lcddevice.h"
    3839
     
    307308
    308309    cc608_build_parity_table(cc608_parity_table);
    309310
    310     if (gCoreContext->GetNumSetting("CCBackground", 0))
     311    if (GetPlayer()->GetPlaySettings()->GetNumSetting("CCBackground", 0))
    311312        CC708Window::forceWhiteOnBlackText = true;
    312313
    313314    no_dts_hack = false;
     
    12441245    if (selectedStream)
    12451246    {
    12461247        directrendering = true;
    1247         if (!gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&
     1248        if (!GetPlayer()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) &&
    12481249            !CODEC_IS_HWACCEL(codec, enc))
    12491250        {
    12501251            SetLowBuffers(false);
     
    17771778
    17781779                if (!is_db_ignored)
    17791780                {
    1780                     VideoDisplayProfile vdp;
     1781                    VideoDisplayProfile vdp(GetPlayer()->GetPlaySettings());
    17811782                    vdp.SetInput(QSize(width, height));
    17821783                    dec = vdp.GetDecoder();
    17831784                    thread_count = vdp.GetMaxCPUs();
     
    18051806                    MythCodecID vdpau_mcid;
    18061807                    vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec(
    18071808                        width, height,
    1808                         mpeg_version(enc->codec_id), no_hardware_decoders);
     1809                        mpeg_version(enc->codec_id), no_hardware_decoders,
     1810                        GetPlayer()->GetPlaySettings());
    18091811
    18101812                    if (vdpau_mcid >= video_codec_id)
    18111813                    {
     
    18371839                        /* mpeg type    */ mpeg_version(enc->codec_id),
    18381840                        /* xvmc pix fmt */ xvmc_pixel_format(enc->pix_fmt),
    18391841                        /* test surface */ codec_is_std(video_codec_id),
    1840                         /* force_xv     */ force_xv);
     1842                        /* force_xv     */ force_xv,
     1843                        GetPlayer()->GetPlaySettings());
    18411844
    18421845                    if (mcid >= video_codec_id)
    18431846                    {
  • libs/libmythtv/playgroup.cpp

     
    11#include "mythdb.h"
    22#include "playgroup.h"
    33#include "programinfo.h"
     4#include "playsettings.h"
    45
    56// A parameter associated with the profile itself
    67class PlayGroupDBStorage : public SimpleDBStorage
     
    210211    return res;
    211212}
    212213
    213 PlayGroupEditor::PlayGroupEditor(void) :
    214     listbox(new ListBoxSetting(this)), lastValue("Default")
     214PlayGroupEditor::PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize) :
     215    listbox(new ListBoxSetting(this)), lastValue("Default"),
     216    getSettings(funcArray), getSettingsSize(funcArraySize)
    215217{
    216218    listbox->setLabel(tr("Playback Groups"));
    217219    addChild(listbox);
     
    242244    }
    243245
    244246    PlayGroup group(name);
     247    PlaySettings *psettings = new PlaySettings(name);
     248    for (int i=0; i<getSettingsSize; i++)
     249        getSettings[i](psettings, &group);
    245250    if (group.exec() == QDialog::Accepted || !created)
    246251        lastValue = name;
    247252    else
     
    276281        query.bindValue(":NAME", name);
    277282        if (!query.exec())
    278283            MythDB::DBError("PlayGroupEditor::doDelete", query);
     284        PlaySettings::deleteGroup(name);
    279285
    280286        int lastIndex = listbox->getValueIndex(name);
    281287        lastValue = "";
  • libs/libmythtv/videoout_opengl.h

     
    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,
  • libs/libmythtv/tv_play.h

     
    6060class OSDListTreeItemSelectedEvent;
    6161class TVBrowseHelper;
    6262struct osdInfo;
     63class PlaySettings;
    6364
    6465typedef QMap<QString,InfoMap>    DDValueMap;
    6566typedef QMap<QString,DDValueMap> DDKeyMap;
     
    184185        unsigned long seconds;
    185186    };
    186187
    187     TV(void);
     188    TV(PlaySettings *settings);
    188189   ~TV();
    189190
    190     void InitFromDB(void);
     191    void InitFromDB(PlaySettings *settings);
    191192    bool Init(bool createWindow = true);
    192193
    193194    // User input processing commands
     
    211212
    212213    // Recording commands
    213214    int  PlayFromRecorder(int recordernum);
    214     int  Playback(const ProgramInfo &rcinfo);
     215    int  Playback(const ProgramInfo &rcinfo, PlaySettings *settings);
    215216
    216217    // Commands used by frontend playback box
    217218    QString GetRecordingGroup(int player_idx) const;
  • libs/libmythtv/playgroup.h

     
    77#include "mythwidgets.h"
    88
    99class ProgramInfo;
     10class PlaySettings;
    1011
    1112class MPUBLIC PlayGroup: public ConfigurationWizard
    1213{
     
    2930    Q_OBJECT
    3031
    3132  public:
    32     PlayGroupEditor(void);
     33    typedef ConfigurationWizard *(*SettingsLookup)(PlaySettings *settings,
     34                                                   ConfigurationWizard *base);
     35    PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize);
    3336    virtual DialogCode exec(void);
    3437    virtual void Load(void);
    3538    virtual void Save(void) { }
     
    4447  protected:
    4548    ListBoxSetting *listbox;
    4649    QString         lastValue;
     50    SettingsLookup *getSettings;
     51    int             getSettingsSize;
    4752};
    4853
    4954#endif
  • libs/libmythtv/dbcheck.cpp

     
    35553555
    35563556            VideoDisplayProfile::CreateNewProfiles(host);
    35573557            profiles = VideoDisplayProfile::GetProfiles(host);
    3558             QString profile = VideoDisplayProfile::GetDefaultProfileName(host);
     3558            QString profile =
     3559                VideoDisplayProfile::GetDefaultProfileName(host, NULL);
    35593560
    35603561            if (profiles.contains("Normal") &&
    35613562                (profile=="CPU++" || profile=="CPU+" || profile=="CPU--"))
     
    59725973"  jump int(11) NOT NULL default '0',"
    59735974"  PRIMARY KEY  (`name`)"
    59745975");",
     5976"CREATE TABLE playgroupsettings ("
     5977"  playgroupname varchar(64) NOT NULL,"
     5978"  `value` varchar(128) NOT NULL,"
     5979"  `data` text,"
     5980"  overridden tinyint(1) NOT NULL,"
     5981"  PRIMARY KEY (playgroupname, `value`)"
     5982");",
    59755983"CREATE TABLE powerpriority ("
    59765984"  priorityname varchar(64) collate utf8_bin NOT NULL,"
    59775985"  recpriority int(10) NOT NULL default '0',"
  • libs/libmythtv/videoout_vdpau.cpp

     
    4949    opts.deints->insert("vdpau", deints);
    5050}
    5151
    52 VideoOutputVDPAU::VideoOutputVDPAU()
    53   : m_win(0),                m_render(NULL),
     52VideoOutputVDPAU::VideoOutputVDPAU(PlaySettings *settings)
     53  : VideoOutput(settings), m_win(0),           m_render(NULL),
    5454    m_buffer_size(NUM_VDPAU_BUFFERS),          m_pause_surface(0),
    5555    m_need_deintrefs(false), m_video_mixer(0), m_mixer_features(kVDPFeatNone),
    5656    m_checked_surface_ownership(false),
     
    850850
    851851MythCodecID VideoOutputVDPAU::GetBestSupportedCodec(
    852852    uint width,       uint height,
    853     uint stream_type, bool no_acceleration)
     853    uint stream_type, bool no_acceleration, PlaySettings *settings)
    854854{
    855855    bool use_cpu = no_acceleration;
    856     VideoDisplayProfile vdp;
     856    VideoDisplayProfile vdp(settings);
    857857    vdp.SetInput(QSize(width, height));
    858858    QString dec = vdp.GetDecoder();
    859859
  • libs/libmythtv/videoout_directfb.cpp

     
    277277    opts.priorities->insert("directfb", 60);
    278278}
    279279
    280 VideoOutputDirectfb::VideoOutputDirectfb()
    281     : VideoOutput(), XJ_started(false), widget(NULL),
     280VideoOutputDirectfb::VideoOutputDirectfb(PlaySettings *settings)
     281    : VideoOutput(settings), XJ_started(false), widget(NULL),
    282282      data(new DirectfbData())
    283283{
    284284    init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0);
  • libs/libmythtv/mythplayer.h

     
    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; }
  • libs/libmythtv/videoout_d3d.h

     
    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,
  • libs/libmythtv/playercontext.cpp

     
    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: ")
     
    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    {
     
    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)
     
    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
     
    927930            playingInfo->MarkAsInUse(false, recUsage);
    928931        delete playingInfo;
    929932        playingInfo = NULL;
     933        // XXX delete settings?
    930934    }
    931935
    932936    if (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
  • libs/libmythtv/subtitlereader.cpp

     
    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)
  • libs/libmythtv/textsubtitleparser.h

     
    1717// Qt headers
    1818#include <QStringList>
    1919
     20class PlaySettings;
     21
    2022class text_subtitle_t
    2123{
    2224  public:
     
    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
  • libs/libmythtv/vsync.cpp

     
    3434
    3535#include "mythcontext.h"
    3636#include "mythmainwindow.h"
     37#include "playsettings.h"
    3738
    3839#ifdef USING_XV
    3940#include "videoout_xv.h"
     
    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{
     
    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);
  • libs/libmythtv/tv_play.cpp

     
    6060#include "mythdialogbox.h"
    6161#include "mythdirs.h"
    6262#include "tvbrowsehelper.h"
     63#include "playsettings.h"
    6364
    6465#if ! HAVE_ROUND
    6566#define round(x) ((int) ((x) + 0.5))
     
    210211    bool startInGuide = flags & kStartTVInGuide;
    211212    bool inPlaylist = flags & kStartTVInPlayList;
    212213    bool initByNetworkCommand = flags & kStartTVByNetworkCommand;
    213     TV *tv = new TV();
    214214    bool quitAll = false;
    215215    bool showDialogs = true;
    216216    bool playCompleted = false;
     
    224224        curProgram->SetIgnoreBookmark(flags & kStartTVIgnoreBookmark);
    225225    }
    226226
     227    PlaySettings settings(curProgram ? curProgram->GetPlaybackGroup() : "Default");
     228    TV *tv = new TV(&settings);
     229
    227230    // Initialize TV
    228231    if (!tv->Init())
    229232    {
     
    254257        if (curProgram)
    255258        {
    256259            VERBOSE(VB_PLAYBACK, LOC + "tv->Playback() -- begin");
    257             if (!tv->Playback(*curProgram))
     260            if (!tv->Playback(*curProgram, &settings))
    258261            {
    259262                quitAll = true;
    260263            }
     
    848851class TVInitRunnable : public QRunnable
    849852{
    850853  public:
    851     TVInitRunnable(TV *ourTV) : tv(ourTV) {}
    852     virtual void run(void) { tv->InitFromDB(); }
     854    TVInitRunnable(TV *ourTV, PlaySettings *ourSettings) :
     855        tv(ourTV), settings(ourSettings) {}
     856    virtual void run(void) { tv->InitFromDB(settings); }
    853857    TV *tv;
     858    PlaySettings *settings;
    854859};
    855860
    856861/** \fn TV::TV(void)
    857862 *  \sa Init(void)
    858863 */
    859 TV::TV(void)
     864TV::TV(PlaySettings *settings)
    860865    : // Configuration variables from database
    861866      baseFilters(""),
    862867      db_channel_format("<num> <sign>"),
     
    954959    playerActive = 0;
    955960    playerLock.unlock();
    956961
    957     QThreadPool::globalInstance()->start(new TVInitRunnable(this), 99);
     962    QThreadPool::globalInstance()->start(new TVInitRunnable(this, settings), 99);
    958963
    959964    VERBOSE(VB_PLAYBACK, LOC + "ctor -- end");
    960965}
    961966
    962 void TV::InitFromDB(void)
     967void TV::InitFromDB(PlaySettings *settings)
    963968{
    964969    QMap<QString,QString> kv;
    965970    kv["LiveTVIdleTimeout"]        = "0";
     
    10061011        kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]);
    10071012
    10081013    MythDB::getMythDB()->GetSettings(kv);
     1014    settings->AddToMap(kv);
    10091015
    10101016    QString db_time_format;
    10111017    QString db_short_date_format;
     
    17491755    askAllowLock.unlock();
    17501756}
    17511757
    1752 int TV::Playback(const ProgramInfo &rcinfo)
     1758int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings)
    17531759{
    17541760    wantsToQuit   = false;
    17551761    jumpToProgram = false;
     
    17631769        return 0;
    17641770    }
    17651771
    1766     mctx->SetPlayingInfo(&rcinfo);
     1772    mctx->SetPlayingInfo(&rcinfo, settings);
    17671773    mctx->SetInitialTVState(false);
    17681774    ScheduleStateChange(mctx);
    17691775
     
    18461852
    18471853    if (fileexists)
    18481854    {
    1849         Playback(pginfo);
     1855        PlaySettings settings("Default");
     1856        Playback(pginfo, &settings);
    18501857        retval = 1;
    18511858    }
    18521859
     
    22342241            QString msg = tr("%1 Settings")
    22352242                    .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup()));
    22362243            ctx->UnlockPlayingInfo(__FILE__, __LINE__);
    2237             if (count > 0)
     2244            if (count > 0 &&
     2245                ctx->playingInfo->GetPlaybackGroup() != "Default" &&
     2246                ctx->playingInfo->GetPlaybackGroup() != "Videos")
    22382247                SetOSDMessage(ctx, msg);
    22392248            ITVRestart(ctx, false);
    22402249        }
  • libs/libmythtv/videodisplayprofile.h

     
    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;
     
    8082class MPUBLIC VideoDisplayProfile
    8183{
    8284  public:
    83     VideoDisplayProfile();
     85    VideoDisplayProfile(PlaySettings *settings);
    8486    ~VideoDisplayProfile();
    8587
    8688    void SetInput(const QSize &size);
     
    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,
  • libs/libmythtv/videoout_null.cpp

     
    3030    opts.priorities->insert("null", 10);
    3131}
    3232
    33 VideoOutputNull::VideoOutputNull() :
    34     VideoOutput(), global_lock(QMutex::Recursive)
     33VideoOutputNull::VideoOutputNull(PlaySettings *settings) :
     34    VideoOutput(settings), global_lock(QMutex::Recursive)
    3535{
    3636    VERBOSE(VB_PLAYBACK, "VideoOutputNull()");
    3737    memset(&av_pause_frame, 0, sizeof(av_pause_frame));
  • libs/libmythtv/videooutbase.cpp

     
    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"
     
    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
     
    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();
     
    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)
     
    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),
     
    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/**
     
    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())
  • libs/libmythtv/videooutwindow.h

     
    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,
     
    164165    bool     allowpreviewepg;
    165166    PIPState pip_state;
    166167
     168    PlaySettings *settings;
     169
    167170    // Constants
    168171    static const float kManualZoomMaxHorizontalZoom;
    169172    static const float kManualZoomMaxVerticalZoom;
  • libs/libmythtv/videoout_directfb.h

     
    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,
  • libs/libmythtv/playercontext.h

     
    2828class LiveTVChain;
    2929class MythDialog;
    3030class QPainter;
     31class PlaySettings;
    3132
    3233struct osdInfo
    3334{
     
    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; }
     
    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
  • libs/libmythtv/vsync.h

     
    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:
  • libs/libmythtv/videoout_xv.h

     
    5151    friend class XvMCOSD;
    5252  public:
    5353    static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
    54     VideoOutputXv();
     54    VideoOutputXv(PlaySettings *settings);
    5555   ~VideoOutputXv();
    5656
    5757    bool Init(int width, int height, float aspect, WId winid,
     
    109109    static MythCodecID GetBestSupportedCodec(uint width, uint height,
    110110                                             uint osd_width, uint osd_height,
    111111                                             uint stream_type, int xvmc_chroma,
    112                                              bool test_surface, bool force_xv);
     112                                             bool test_surface, bool force_xv,
     113                                             PlaySettings *settings);
    113114
    114115    static int GrabSuitableXvPort(MythXDisplay* disp, Window root,
     116                                  PlaySettings *settings,
    115117                                  MythCodecID type,
    116118                                  uint width, uint height,
    117119                                  bool &xvsetdefaults,
  • libs/libmythtv/videoout_xv.cpp

     
    170170 * \see VideoOutput, VideoBuffers
    171171 *
    172172 */
    173 VideoOutputXv::VideoOutputXv()
    174     : VideoOutput(),
     173VideoOutputXv::VideoOutputXv(PlaySettings *settings)
     174    : VideoOutput(settings),
    175175      video_output_subtype(XVUnknown),
    176176      global_lock(QMutex::Recursive),
    177177
     
    401401 * \return port number if it succeeds, else -1.
    402402 */
    403403int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root,
     404                                      PlaySettings *settings,
    404405                                      MythCodecID mcodecid,
    405406                                      uint width, uint height,
    406407                                      bool &xvsetdefaults,
     
    485486    }
    486487
    487488    // figure out if we want chromakeying..
    488     VideoDisplayProfile vdp;
     489    VideoDisplayProfile vdp(settings);
    489490    vdp.SetInput(QSize(width, height));
    490491    bool check_for_colorkey = (vdp.GetOSDRenderer() == "chromakey");
    491492
     
    785786    disp->StartLog();
    786787    QString adaptor_name = QString::null;
    787788    const QSize video_dim = window.GetVideoDim();
    788     xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), video_codec_id,
     789    xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, video_codec_id,
    789790                                 video_dim.width(), video_dim.height(),
    790791                                 xv_set_defaults,
    791792                                 xvmc_chroma, &xvmc_surf_info, &adaptor_name);
     
    864865    disp->StartLog();
    865866    QString adaptor_name = QString::null;
    866867    const QSize video_dim = window.GetVideoDim();
    867     xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), kCodec_MPEG2,
     868    xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, kCodec_MPEG2,
    868869                                 video_dim.width(), video_dim.height(),
    869870                                 xv_set_defaults, 0, NULL, &adaptor_name);
    870871    if (xv_port == -1)
     
    10181019    uint width,       uint height,
    10191020    uint osd_width,   uint osd_height,
    10201021    uint stream_type, int xvmc_chroma,
    1021     bool test_surface, bool force_xv)
     1022    bool test_surface, bool force_xv,
     1023    PlaySettings *settings)
    10221024{
    10231025    (void)width, (void)height, (void)osd_width, (void)osd_height;
    10241026    (void)stream_type, (void)xvmc_chroma, (void)test_surface;
     
    10291031        return ret;
    10301032
    10311033#ifdef USING_XVMC
    1032     VideoDisplayProfile vdp;
     1034    VideoDisplayProfile vdp(settings);
    10331035    vdp.SetInput(QSize(width, height));
    10341036    QString dec = vdp.GetDecoder();
    10351037    if ((dec == "libmpeg2") || (dec == "ffmpeg"))
     
    10791081
    10801082        ok = false;
    10811083        bool dummy;
    1082         int port = GrabSuitableXvPort(disp, disp->GetRoot(), ret, width, height,
     1084        int port = GrabSuitableXvPort(disp, disp->GetRoot(), settings,
     1085                                      ret, width, height,
    10831086                                      dummy, xvmc_chroma, &info);
    10841087        if (port >= 0)
    10851088        {
  • libs/libmythtv/mythplayer.cpp

     
    6060#include "mythpainter.h"
    6161#include "mythimage.h"
    6262#include "mythuiimage.h"
     63#include "playsettings.h"
    6364
    6465extern "C" {
    6566#include "vbitext/vbi.h"
     
    250251      output_jmeter(NULL)
    251252{
    252253    playerThread = QThread::currentThread();
    253     // Playback (output) zoom control
    254     detect_letter_box = new DetectLetterbox(this);
    255254
    256     vbimode = VBIMode::Parse(gCoreContext->GetSetting("VbiFormat"));
    257     decode_extra_audio = gCoreContext->GetNumSetting("DecodeExtraAudio", 0);
    258     itvEnabled         = gCoreContext->GetNumSetting("EnableMHEG", 0);
    259     db_prefer708       = gCoreContext->GetNumSetting("Prefer708Captions", 1);
    260 
    261255    bzero(&tc_lastval, sizeof(tc_lastval));
    262256    bzero(&tc_wrap,    sizeof(tc_wrap));
    263257    tc_wrap[TC_AUDIO] = gCoreContext->GetNumSetting("AudioSyncOffset", 0);
     
    496490    if (using_null_videoout && decoder)
    497491    {
    498492        MythCodecID codec = decoder->GetVideoCodecID();
    499         videoOutput = new VideoOutputNull();
     493        videoOutput = new VideoOutputNull(GetPlaySettings());
    500494        if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(),
    501495                               video_aspect, 0, 0, 0, 0, 0, codec, 0))
    502496        {
     
    546540                pipState,
    547541                video_disp_dim, video_aspect,
    548542                widget->winId(), display_rect, (video_frame_rate * play_speed),
    549                 0 /*embedid*/);
     543                0 /*embedid*/, GetPlaySettings());
    550544        }
    551545
    552546        if (videoOutput)
     
    638632
    639633void MythPlayer::ReinitVideo(void)
    640634{
    641     if (!videoOutput->IsPreferredRenderer(video_disp_dim))
     635    if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings()))
    642636    {
    643637        VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer."));
    644638        SetErrored(QObject::tr("Need to switch video renderer."));
     
    20622056        }
    20632057#endif // USING_MHEG
    20642058
    2065         SetCaptionsEnabled(gCoreContext->GetNumSetting("DefaultCCMode"), false);
     2059        SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0),
     2060                           false);
    20662061        osdLock.unlock();
    20672062    }
    20682063
     
    21092104        m_double_process = videoOutput->IsExtraProcessingRequired();
    21102105
    21112106        videosync = VideoSync::BestMethod(
    2112             videoOutput, fr_int, rf_int, m_double_framerate);
     2107            videoOutput, GetPlaySettings(),
     2108            fr_int, rf_int, m_double_framerate);
    21132109
    21142110        // Make sure video sync can do it
    21152111        if (videosync != NULL && m_double_framerate)
     
    24922488    if (bookmarkseek > 30)
    24932489    {
    24942490        DoFastForward(bookmarkseek, true, false);
    2495         if (gCoreContext->GetNumSetting("ClearSavedPosition", 1) &&
     2491        if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) &&
    24962492            !player_ctx->IsPIP())
    24972493        {
    24982494            ClearBookmark(false);
     
    27242720    {
    27252721        if (jumpto == totalFrames)
    27262722        {
    2727             if (!(gCoreContext->GetNumSetting("EndOfRecordingExitPrompt") == 1
     2723            if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1
    27282724                  && !player_ctx->IsPIP() &&
    27292725                  player_ctx->GetState() == kState_WatchingPreRecorded))
    27302726            {
     
    30073003        return kPIP_END;
    30083004
    30093005    if (pip_players.isEmpty())
    3010         return (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft);
     3006        return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation",
     3007                                                             kPIPTopLeft);
    30113008
    30123009    // order of preference, could be stored in db if we want it configurable
    30133010    PIPLocation ols[] =
     
    35153512    exactseeks   = frame_exact_seek;
    35163513    player_ctx   = ctx;
    35173514    livetv       = ctx->tvchain;
     3515
     3516    vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", ""));
     3517
     3518    // Playback (output) zoom control
     3519    detect_letter_box = new DetectLetterbox(this);
     3520
     3521    decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0);
     3522    itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0);
     3523    db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1);
    35183524}
    35193525
    35203526bool MythPlayer::EnableEdit(void)
  • libs/libmythtv/videooutbase.h

     
    3434class FilterChain;
    3535class FilterManager;
    3636class OpenGLContextGLX;
     37class PlaySettings;
    3738
    3839typedef QMap<MythPlayer*,PIPLocation> PIPMap;
    3940
     
    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,
     
    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);
     
    331333    // OSD painter and surface
    332334    MythYUVAPainter *osd_painter;
    333335    MythImage       *osd_image;
     336
     337    PlaySettings *settings;
    334338};
    335339
    336340#endif
  • libs/libmythtv/textsubtitleparser.cpp

     
    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)
     
    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 = new RingBuffer(fileName, 0, false);
     
    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)
  • libs/libmythtv/subtitlescreen.cpp

     
    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: ")
     
    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
  • libs/libmythtv/videoout_quartz.h

     
    22#define VIDEOOUT_QUARTZ_H_
    33
    44struct QuartzData;
     5class PlaySettings;
    56
    67#include "videooutbase.h"
    78
     
    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,
     
    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
  • libs/libmythtv/videodisplayprofile.cpp

     
    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{
     
    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{
     
    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);
     
    772773    return list;
    773774}
    774775
    775 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname)
     776QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname,
     777                                                   PlaySettings *settings)
    776778{
    777779    QString tmp =
     780        settings ? settings->GetSetting("DefaultVideoPlaybackProfile", "") :
    778781        gCoreContext->GetSettingOnHost("DefaultVideoPlaybackProfile", hostname);
    779782
    780783    QStringList profiles = GetProfiles(hostname);
  • libs/libmythtv/videoout_null.h

     
    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,
  • libs/libmyth/settings.cpp

     
    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);
     
    299313        QLabel *label = new QLabel();
    300314        label->setText(getLabel() + ":     ");
    301315        layout->addWidget(label);
     316        labelWidget = label;
    302317    }
    303318
    304319    bxwidget = widget;
     
    327342
    328343    widget->setLayout(layout);
    329344
     345    setValue(getValue());
     346
    330347    return widget;
    331348}
    332349
     
    336353    {
    337354        bxwidget = NULL;
    338355        edit     = NULL;
     356        labelWidget = NULL;
    339357    }
    340358}
    341359
     
    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);
     
    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;
     
    476516        QLabel *label = new QLabel();
    477517        label->setText(getLabel() + ":     ");
    478518        layout->addWidget(label);
     519        labelWidget = label;
    479520    }
    480521
    481522    bxwidget = widget;
     
    506547
    507548    widget->setLayout(layout);
    508549
     550    setValue(intValue());
     551
    509552    return widget;
    510553}
    511554
     
    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();
     
    631680        QLabel *label = new QLabel();
    632681        label->setText(getLabel() + ":     ");
    633682        layout->addWidget(label);
     683        labelWidget = label;
    634684    }
    635685
    636686    bxwidget = widget;
     
    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,
     
    673727
    674728    widget->setLayout(layout);
    675729
     730    setValue(current);
     731
    676732    return widget;
    677733}
    678734
     
    682738    {
    683739        bxwidget = NULL;
    684740        cbwidget = NULL;
     741        labelWidget = NULL;
    685742    }
    686743}
    687744
     
    717774
    718775    if (rw)
    719776    {
     777        changeLabel(newValue);
    720778        Setting::setValue(newValue);
    721779        if (cbwidget)
    722780            cbwidget->setCurrentIndex(current);
     
    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)
    735793{
     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)
     803{
    736804    if ((findSelection(label, value) < 0) && cbwidget)
    737805    {
    738806        resetMaxCount(cbwidget->count()+1);
    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)
     
    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)
     
    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();
     
    11641319    bxwidget   = NULL;
    11651320    imagelabel = NULL;
    11661321    combo      = NULL;
     1322    labelWidget = NULL;
    11671323}
    11681324
    11691325void ImageSelectSetting::imageSet(int num)
     
    12111367        QLabel *label = new QLabel();
    12121368        label->setText(getLabel() + ":");
    12131369        layout->addWidget(label);
     1370        labelWidget = label;
    12141371    }
    12151372
    12161373    combo = new MythComboBox(false);
     
    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()));
     
    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)
  • libs/libmyth/mythwidgets.cpp

     
    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    }
  • libs/libmyth/settings.h

     
    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,
     
    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
     
    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);
     
    248258    bool         relayEnabled;
    249259    bool         sstep;
    250260    QString      svtext;
     261    QLabel      *labelWidget;
     262    bool         changeOnSpecial;
    251263};
    252264
    253265class 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);
     
    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);
     
    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;
     
    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);
     
    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);
     
    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
     
    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:
  • libs/libmyth/libmyth.pro

     
    6262SOURCES += mythrssmanager.cpp     netgrabbermanager.cpp
    6363SOURCES += rssparse.cpp           netutils.cpp
    6464
     65HEADERS += playsettings.h
     66SOURCES += playsettings.cpp
     67
    6568# remove when everything is switched to mythui
    6669SOURCES += virtualkeyboard_qt.cpp
    6770
  • libs/libmyth/mythconfiggroups.cpp

     
    476476                                            Configurable *target)
    477477{
    478478    VerifyLayout();
     479    bool isDuplicate = triggerMap.values().contains(target);
    479480    triggerMap[triggerValue] = target;
    480481
    481482    if (!configStack)
     
    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)
  • libs/libmyth/mythwidgets.h

     
    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
  • programs/mythfrontend/globalsettings.cpp

     
    3838#include "mythconfig.h"
    3939#include "mythdirs.h"
    4040#include "mythuihelper.h"
     41#include "playsettings.h"
    4142
     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}
     156
    42157class TriggeredItem : public TriggeredConfigurationGroup
    43158{
    44159  public:
     
    603718    return gs;
    604719}
    605720
    606 static HostCheckBox *DecodeExtraAudio()
     721static Setting *DecodeExtraAudio(PlaySettings *settings)
    607722{
    608     HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");
     723    CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings);
    609724    gc->setLabel(QObject::tr("Extra audio buffering"));
    610725    gc->setValue(true);
    611726    gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing "
     
    614729                    "effect on framegrabbers (MPEG-4/RTJPEG). MythTV will "
    615730                    "keep extra audio data in its internal buffers to "
    616731                    "workaround this bug."));
    617     return gc;
     732    return wrap(gc, settings);
    618733}
    619734
    620 static HostComboBox *PIPLocationComboBox()
     735static Setting *PIPLocationComboBox(PlaySettings *settings)
    621736{
    622     HostComboBox *gc = new HostComboBox("PIPLocation");
     737    CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings);
    623738    gc->setLabel(QObject::tr("PIP video location"));
    624739    for (uint loc = 0; loc < kPIP_END; ++loc)
    625740        gc->addSelection(toString((PIPLocation) loc), QString::number(loc));
    626741    gc->setHelpText(QObject::tr("Location of PIP Video window."));
    627     return gc;
     742    return wrap(gc, settings);
    628743}
    629744
    630745static HostComboBox *DisplayRecGroup()
     
    710825    return gc;
    711826}
    712827
    713 static HostCheckBox *SmartForward()
     828static Setting *SmartForward(PlaySettings *settings)
    714829{
    715     HostCheckBox *gc = new HostCheckBox("SmartForward");
     830    CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings);
    716831    gc->setLabel(QObject::tr("Smart fast forwarding"));
    717832    gc->setValue(false);
    718833    gc->setHelpText(QObject::tr("If enabled, then immediately after "
    719834                    "rewinding, only skip forward the same amount as "
    720835                    "skipping backwards."));
    721     return gc;
     836    return wrap(gc, settings);
    722837}
    723838
    724 static HostCheckBox *ExactSeeking()
     839static Setting *ExactSeeking(PlaySettings *settings)
    725840{
    726     HostCheckBox *gc = new HostCheckBox("ExactSeeking");
     841    CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings);
    727842    gc->setLabel(QObject::tr("Seek to exact frame"));
    728843    gc->setValue(false);
    729844    gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but "
    730845                    "slower."));
    731     return gc;
     846    return wrap(gc, settings);
    732847}
    733848
    734849static GlobalComboBox *CommercialSkipMethod()
     
    756871    return gc;
    757872}
    758873
    759 static HostComboBox *AutoCommercialSkip()
     874static Setting *AutoCommercialSkip(PlaySettings *settings)
    760875{
    761     HostComboBox *gc = new HostComboBox("AutoCommercialSkip");
     876    CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings);
    762877    gc->setLabel(QObject::tr("Automatically skip commercials"));
    763878    gc->addSelection(QObject::tr("Off"), "0");
    764879    gc->addSelection(QObject::tr("Notify, but do not skip"), "2");
     
    767882                    "have been flagged during automatic commercial detection "
    768883                    "or by the mythcommflag program, or just notify that a "
    769884                    "commercial has been detected."));
    770     return gc;
     885    return wrap(gc, settings);
    771886}
    772887
    773888static GlobalCheckBox *AutoCommercialFlag()
     
    853968    return bc;
    854969}
    855970
    856 static HostSpinBox *CommRewindAmount()
     971static Setting *CommRewindAmount(PlaySettings *settings)
    857972{
    858     HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);
     973    CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false);
    859974    gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)"));
    860975    gs->setHelpText(QObject::tr("MythTV will automatically rewind "
    861976                    "this many seconds after performing a commercial skip."));
    862977    gs->setValue(0);
    863     return gs;
     978    return wrap(gs, settings);
    864979}
    865980
    866 static HostSpinBox *CommNotifyAmount()
     981static Setting *CommNotifyAmount(PlaySettings *settings)
    867982{
    868     HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);
     983    CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false);
    869984    gs->setLabel(QObject::tr("Commercial skip notify amount (secs)"));
    870985    gs->setHelpText(QObject::tr("MythTV will act like a commercial "
    871986                    "begins this many seconds early. This can be useful "
    872987                    "when commercial notification is used in place of "
    873988                    "automatic skipping."));
    874989    gs->setValue(0);
    875     return gs;
     990    return wrap(gs, settings);
    876991}
    877992
    878993static GlobalSpinBox *MaximumCommercialSkip()
     
    16741789    labels[j]->setValue(label_i);
    16751790}
    16761791
    1677 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) :
     1792PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str,
     1793                                               PlaySettings *settings) :
    16781794    TriggeredConfigurationGroup(false, true,  true, true,
    16791795                                false, false, true, true), grouptrigger(NULL)
    16801796{
    16811797    setLabel(QObject::tr("Playback Profiles") + str);
     1798    if (settings)
     1799        setLabel(QObject::tr("Playback group settings for ") +
     1800                 settings->mGroupName + " - " +
     1801                 getLabel());
    16821802
    16831803    QString host = gCoreContext->GetHostName();
    16841804    QStringList profiles = VideoDisplayProfile::GetProfiles(host);
     
    17061826        profiles = VideoDisplayProfile::GetProfiles(host);
    17071827    }
    17081828
    1709     QString profile = VideoDisplayProfile::GetDefaultProfileName(host);
     1829    QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings);
    17101830    if (!profiles.contains(profile))
    17111831    {
    17121832        profile = (profiles.contains("Normal")) ? "Normal" : profiles[0];
    17131833        VideoDisplayProfile::SetDefaultProfileName(profile, host);
    17141834    }
    17151835
    1716     grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile");
     1836    CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings);
     1837    grouptrigger = gs;
    17171838    grouptrigger->setLabel(QObject::tr("Current Video Playback Profile"));
    17181839    QStringList::const_iterator it;
    17191840    for (it = profiles.begin(); it != profiles.end(); ++it)
    17201841        grouptrigger->addSelection(ProgramInfo::i18n(*it), *it);
     1842    if (settings)
     1843    {
     1844        addChild(wrap(grouptrigger, settings));
     1845        return;
     1846    }
    17211847
    17221848    HorizontalConfigurationGroup *grp =
    17231849        new HorizontalConfigurationGroup(false, false, true, true);
     
    18501976    return gc;
    18511977}
    18521978
    1853 static HostSpinBox *FFRewReposTime()
     1979static Setting *FFRewReposTime(PlaySettings *settings)
    18541980{
    1855     HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);
     1981    CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false);
    18561982    gs->setLabel(QObject::tr("Fast forward/rewind reposition amount"));
    18571983    gs->setValue(100);
    18581984    gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind "
     
    18601986                    "resuming normal playback. This "
    18611987                    "compensates for the reaction time between seeing "
    18621988                    "where to resume playback and actually exiting seeking."));
    1863     return gs;
     1989    return wrap(gs, settings);
    18641990}
    18651991
    1866 static HostCheckBox *FFRewReverse()
     1992static Setting *FFRewReverse(PlaySettings *settings)
    18671993{
    1868     HostCheckBox *gc = new HostCheckBox("FFRewReverse");
     1994    CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings);
    18691995    gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind"));
    18701996    gc->setValue(true);
    18711997    gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key "
     
    18731999                    "vice versa. If disabled, it will decrease the "
    18742000                    "current speed or switch to play mode if "
    18752001                    "the speed can't be decreased further."));
    1876     return gc;
     2002    return wrap(gc, settings);
    18772003}
    18782004
    18792005static HostComboBox *MenuTheme()
     
    19102036    return gc;
    19112037}
    19122038
    1913 static HostSpinBox *OSDCC708TextZoomPercentage(void)
     2039static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings)
    19142040{
    1915     HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5);
     2041    CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings,
     2042                           50, 200, 5, false);
    19162043    gs->setLabel(QObject::tr("Subtitle text zoom percentage"));
    19172044    gs->setValue(100);
    19182045    gs->setHelpText(QObject::tr("Use this to enlarge or shrink text based subtitles."));
    19192046
    1920     return gs;
     2047    return wrap(gs, settings);
    19212048}
    19222049
    19232050static HostComboBox *SubtitleFont()
     
    19372064    return hcb;
    19382065}
    19392066
    1940 static HostComboBox *SubtitleCodec()
     2067static Setting *SubtitleCodec(PlaySettings *settings)
    19412068{
    1942     HostComboBox *gc = new HostComboBox("SubtitleCodec");
     2069    CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings);
    19432070
    19442071    gc->setLabel(QObject::tr("Subtitle Codec"));
    19452072    QList<QByteArray> list = QTextCodec::availableCodecs();
     
    19492076        gc->addSelection(val, val, val.toLower() == "utf-8");
    19502077    }
    19512078
    1952     return gc;
     2079    return wrap(gc, settings);
    19532080}
    19542081
    19552082static HostComboBox *ChannelOrdering()
     
    19612088    return gc;
    19622089}
    19632090
    1964 static HostSpinBox *VertScanPercentage()
     2091static Setting *VertScanPercentage(PlaySettings *settings)
    19652092{
    1966     HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1);
     2093    CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings,
     2094                           -100, 100, 1, false);
    19672095    gs->setLabel(QObject::tr("Vertical scaling"));
    19682096    gs->setValue(0);
    19692097    gs->setHelpText(QObject::tr(
    19702098                        "Adjust this if the image does not fill your "
    19712099                        "screen vertically. Range -100% to 100%"));
    1972     return gs;
     2100    return wrap(gs, settings);
    19732101}
    19742102
    1975 static HostSpinBox *HorizScanPercentage()
     2103static Setting *HorizScanPercentage(PlaySettings *settings)
    19762104{
    1977     HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1);
     2105    CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings,
     2106                           -100, 100, 1, false);
    19782107    gs->setLabel(QObject::tr("Horizontal scaling"));
    19792108    gs->setValue(0);
    19802109    gs->setHelpText(QObject::tr(
    19812110                        "Adjust this if the image does not fill your "
    19822111                        "screen horizontally. Range -100% to 100%"));
    1983     return gs;
     2112    return wrap(gs, settings);
    19842113};
    19852114
    1986 static HostSpinBox *XScanDisplacement()
     2115static Setting *XScanDisplacement(PlaySettings *settings)
    19872116{
    1988     HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1);
     2117    CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings,
     2118                           -50, 50, 1, false);
    19892119    gs->setLabel(QObject::tr("Scan displacement (X)"));
    19902120    gs->setValue(0);
    19912121    gs->setHelpText(QObject::tr("Adjust this to move the image horizontally."));
    1992     return gs;
     2122    return wrap(gs, settings);
    19932123}
    19942124
    1995 static HostSpinBox *YScanDisplacement()
     2125static Setting *YScanDisplacement(PlaySettings *settings)
    19962126{
    1997     HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1);
     2127    CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings,
     2128                           -50, 50, 1, false);
    19982129    gs->setLabel(QObject::tr("Scan displacement (Y)"));
    19992130    gs->setValue(0);
    20002131    gs->setHelpText(QObject::tr("Adjust this to move the image vertically."));
    2001     return gs;
     2132    return wrap(gs, settings);
    20022133};
    20032134
    2004 static HostCheckBox *CCBackground()
     2135static Setting *CCBackground(PlaySettings *settings)
    20052136{
    2006     HostCheckBox *gc = new HostCheckBox("CCBackground");
     2137    CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings);
    20072138    gc->setLabel(QObject::tr("Black background for closed captioning"));
    20082139    gc->setValue(false);
    20092140    gc->setHelpText(QObject::tr(
    20102141                        "If enabled, captions will be displayed "
    20112142                        "as white text over a black background "
    20122143                        "for better contrast."));
    2013     return gc;
     2144    return wrap(gc, settings);
    20142145}
    20152146
    2016 static HostCheckBox *DefaultCCMode()
     2147static Setting *DefaultCCMode(PlaySettings *settings)
    20172148{
    2018     HostCheckBox *gc = new HostCheckBox("DefaultCCMode");
     2149    CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings);
    20192150    gc->setLabel(QObject::tr("Always display closed captioning or subtitles"));
    20202151    gc->setValue(false);
    20212152    gc->setHelpText(QObject::tr(
     
    20232154                        "when playing back recordings or watching "
    20242155                        "Live TV. Closed Captioning can be turned on or off "
    20252156                        "by pressing \"T\" during playback."));
    2026     return gc;
     2157    return wrap(gc, settings);
    20272158}
    20282159
    2029 static HostCheckBox *PreferCC708()
     2160static Setting *PreferCC708(PlaySettings *settings)
    20302161{
    2031     HostCheckBox *gc = new HostCheckBox("Prefer708Captions");
     2162    CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings);
    20322163    gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions"));
    20332164    gc->setValue(true);
    20342165    gc->setHelpText(
     
    20362167            "If enabled, the newer EIA-708 captions will be preferred over "
    20372168            "the older EIA-608 captions in ATSC streams."));
    20382169
    2039     return gc;
     2170    return wrap(gc, settings);
    20402171}
    20412172
    2042 static HostCheckBox *EnableMHEG()
     2173static Setting *EnableMHEG(PlaySettings *settings)
    20432174{
    2044     HostCheckBox *gc = new HostCheckBox("EnableMHEG");
     2175    CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings);
    20452176    gc->setLabel(QObject::tr("Enable interactive TV"));
    20462177    gc->setValue(false);
    20472178    gc->setHelpText(QObject::tr(
    20482179                        "If enabled, interactive TV applications (MHEG) will "
    20492180                        "be activated. This is used for teletext and logos for "
    20502181                        "radio and channels that are currently off-air."));
    2051     return gc;
     2182    return wrap(gc, settings);
    20522183}
    20532184
    2054 static HostCheckBox *PersistentBrowseMode()
     2185static Setting *PersistentBrowseMode(PlaySettings *settings)
    20552186{
    2056     HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");
     2187    CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings);
    20572188    gc->setLabel(QObject::tr("Always use browse mode in Live TV"));
    20582189    gc->setValue(true);
    20592190    gc->setHelpText(
    20602191        QObject::tr(
    20612192            "If enabled, browse mode will automatically be activated "
    20622193            "whenever you use channel up/down while watching Live TV."));
    2063     return gc;
     2194    return wrap(gc, settings);
    20642195}
    20652196
    2066 static HostCheckBox *BrowseAllTuners()
     2197static Setting *BrowseAllTuners(PlaySettings *settings)
    20672198{
    2068     HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");
     2199    CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings);
    20692200    gc->setLabel(QObject::tr("Browse all channels"));
    20702201    gc->setValue(false);
    20712202    gc->setHelpText(
     
    20732204            "If enabled, browse mode will shows channels on all "
    20742205            "available recording devices, instead of showing "
    20752206            "channels on just the current recorder."));
    2076     return gc;
     2207    return wrap(gc, settings);
    20772208}
    20782209
    2079 static HostCheckBox *ClearSavedPosition()
     2210static Setting *ClearSavedPosition(PlaySettings *settings)
    20802211{
    2081     HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");
     2212    CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings);
    20822213    gc->setLabel(QObject::tr("Clear bookmark on playback"));
    20832214    gc->setValue(true);
    20842215    gc->setHelpText(QObject::tr("If enabled, automatically clear the "
    20852216                    "bookmark on a recording when the recording is played "
    20862217                    "back. If disabled, you can mark the beginning with "
    20872218                    "rewind then save position."));
    2088     return gc;
     2219    return wrap(gc, settings);
    20892220}
    20902221
    2091 static HostCheckBox *AltClearSavedPosition()
     2222static Setting *AltClearSavedPosition(PlaySettings *settings)
    20922223{
    2093     HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");
     2224    CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings);
    20942225    gc->setLabel(QObject::tr("Alternate clear and save bookmark"));
    20952226    gc->setValue(true);
    20962227    gc->setHelpText(QObject::tr("During playback the SELECT key "
     
    20982229                    "Saved\" and \"Bookmark Cleared\". If disabled, the "
    20992230                    "SELECT key will save the current position for each "
    21002231                    "keypress."));
    2101     return gc;
     2232    return wrap(gc, settings);
    21022233}
    21032234
    21042235// This currently does not work
    21052236/*
    2106 static HostLineEdit *UDPNotifyPort()
     2237static Setting *UDPNotifyPort(PlaySettings *settings)
    21072238{
    2108     HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");
     2239    CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings);
    21092240    ge->setLabel(QObject::tr("UDP notify port"));
    21102241    ge->setValue("6948");
    21112242    ge->setHelpText(QObject::tr("During playback, MythTV will listen for "
    21122243                    "connections from the \"mythtvosd\" or \"mythudprelay\" "
    21132244                    "programs on this port. For additional information, see "
    21142245                    "http://www.mythtv.org/wiki/MythNotify ."));
    2115     return ge;
     2246    return wrap(ge, settings);
    21162247}
    21172248*/
    21182249
    2119 static HostComboBox *PlaybackExitPrompt()
     2250static Setting *PlaybackExitPrompt(PlaySettings *settings)
    21202251{
    2121     HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");
     2252    CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings);
    21222253    gc->setLabel(QObject::tr("Action on playback exit"));
    21232254    gc->addSelection(QObject::tr("Just exit"), "0");
    21242255    gc->addSelection(QObject::tr("Save position and exit"), "2");
     
    21292260                    "when you exit playback mode. The options available will "
    21302261                    "allow you to save your position, delete the "
    21312262                    "recording, or continue watching."));
    2132     return gc;
     2263    return wrap(gc, settings);
    21332264}
    21342265
    2135 static HostCheckBox *EndOfRecordingExitPrompt()
     2266static Setting *EndOfRecordingExitPrompt(PlaySettings *settings)
    21362267{
    2137     HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");
     2268    CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings);
    21382269    gc->setLabel(QObject::tr("Prompt at end of recording"));
    21392270    gc->setValue(false);
    21402271    gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing "
    21412272                    "you to delete the recording when it has finished "
    21422273                    "playing."));
    2143     return gc;
     2274    return wrap(gc, settings);
    21442275}
    21452276
    2146 static HostCheckBox *JumpToProgramOSD()
     2277static Setting *JumpToProgramOSD(PlaySettings *settings)
    21472278{
    2148     HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");
     2279    CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings);
    21492280    gc->setLabel(QObject::tr("Jump to program OSD"));
    21502281    gc->setValue(true);
    21512282    gc->setHelpText(QObject::tr(
     
    21542285                        "'Watch Recording' screen when 'Jump to Program' "
    21552286                        "is activated. If enabled, the recordings are shown "
    21562287                        "in the OSD"));
    2157     return gc;
     2288    return wrap(gc, settings);
    21582289}
    21592290
    2160 static HostCheckBox *ContinueEmbeddedTVPlay()
     2291static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings)
    21612292{
    2162     HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");
     2293    CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings);
    21632294    gc->setLabel(QObject::tr("Continue playback when embedded"));
    21642295    gc->setValue(false);
    21652296    gc->setHelpText(QObject::tr(
     
    21672298                    "is embedded in the upcoming program list or recorded "
    21682299                    "list. The default is to pause the recorded show when "
    21692300                    "embedded."));
    2170     return gc;
     2301    return wrap(gc, settings);
    21712302}
    21722303
    2173 static HostCheckBox *AutomaticSetWatched()
     2304static Setting *AutomaticSetWatched(PlaySettings *settings)
    21742305{
    2175     HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");
     2306    CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings);
    21762307    gc->setLabel(QObject::tr("Automatically mark a recording as watched"));
    21772308    gc->setValue(false);
    21782309    gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a "
     
    21802311                    "detection is not foolproof, so do not enable this "
    21812312                    "setting if you don't want an unwatched recording marked "
    21822313                    "as watched."));
    2183     return gc;
     2314    return wrap(gc, settings);
    21842315}
    21852316
    21862317static HostSpinBox *LiveTVIdleTimeout()
     
    23702501    return gc;
    23712502}
    23722503
    2373 static HostComboBox *LetterboxingColour()
     2504static Setting *LetterboxingColour(PlaySettings *settings)
    23742505{
    2375     HostComboBox *gc = new HostComboBox("LetterboxColour");
     2506    CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings);
    23762507    gc->setLabel(QObject::tr("Letterboxing color"));
    23772508    for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
    23782509        gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
     
    23822513            "letterboxing, but those with plasma screens may prefer gray "
    23832514            "to minimize burn-in.") + " " +
    23842515        QObject::tr("Currently only works with XVideo video renderer."));
    2385     return gc;
     2516    return wrap(gc, settings);
    23862517}
    23872518
    2388 static HostComboBox *AspectOverride()
     2519static Setting *AspectOverride(PlaySettings *settings)
    23892520{
    2390     HostComboBox *gc = new HostComboBox("AspectOverride");
     2521    CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings);
    23912522    gc->setLabel(QObject::tr("Video aspect override"));
    23922523    for (int m = kAspect_Off; m < kAspect_END; ++m)
    23932524        gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
     
    23952526                        "When enabled, these will override the aspect "
    23962527                        "ratio specified by any broadcaster for all "
    23972528                        "video streams."));
    2398     return gc;
     2529    return wrap(gc, settings);
    23992530}
    24002531
    2401 static HostComboBox *AdjustFill()
     2532static Setting *AdjustFill(PlaySettings *settings)
    24022533{
    2403     HostComboBox *gc = new HostComboBox("AdjustFill");
     2534    CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings);
    24042535    gc->setLabel(QObject::tr("Zoom"));
    24052536    gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff),
    24062537                     QString::number(kAdjustFill_AutoDetect_DefaultOff));
     
    24112542    gc->setHelpText(QObject::tr(
    24122543                        "When enabled, these will apply a predefined "
    24132544                        "zoom to all video playback in MythTV."));
    2414     return gc;
     2545    return wrap(gc, settings);
    24152546}
    24162547
    24172548// Theme settings
     
    33363467    return gs;
    33373468}
    33383469
    3339 static HostCheckBox *RealtimePriority()
     3470static Setting *RealtimePriority(PlaySettings *settings)
    33403471{
    3341     HostCheckBox *gc = new HostCheckBox("RealtimePriority");
     3472    CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings);
    33423473    gc->setLabel(QObject::tr("Enable realtime priority threads"));
    33433474    gc->setHelpText(QObject::tr("When running mythfrontend with root "
    33443475                    "privileges, some threads can be given enhanced priority. "
    33453476                    "Disable this if mythfrontend freezes during video "
    33463477                    "playback."));
    33473478    gc->setValue(true);
    3348     return gc;
     3479    return wrap(gc, settings, false);
    33493480}
    33503481
    33513482static HostCheckBox *EnableMediaMon()
     
    35023633
    35033634#ifdef USING_OPENGL_VSYNC
    35043635/*
    3505 static HostCheckBox *UseOpenGLVSync()
     3636static Setting *UseOpenGLVSync(PlaySettings *settings)
    35063637{
    3507     HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");
     3638    CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings);
    35083639    gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing"));
    35093640    gc->setValue(false);
    35103641    gc->setHelpText(QObject::tr(
    35113642                        "If supported by your hardware/drivers, "
    35123643                        "MythTV will use OpenGL vertical syncing for "
    35133644                        "video timing, reducing frame jitter."));
    3514     return gc;
     3645    return wrap(gc, settings);
    35153646}
    35163647*/
    35173648#endif
     
    39384069    return gc;
    39394070}
    39404071
    3941 MainGeneralSettings::MainGeneralSettings()
     4072MainGeneralSettings::MainGeneralSettings(PlaySettings *settings,
     4073                                         ConfigurationWizard *base)
    39424074{
     4075    if (!settings)
     4076    {
    39434077    DatabaseSettings::addDatabaseSettings(this);
    39444078
    39454079    VerticalConfigurationGroup *pin =
     
    39914125    remotecontrol->addChild(NetworkControlEnabled());
    39924126    remotecontrol->addChild(NetworkControlPort());
    39934127    addChild(remotecontrol);
     4128    }
    39944129}
    39954130
    3996 PlaybackSettings::PlaybackSettings()
     4131PlaybackSettings::PlaybackSettings(PlaySettings *settings,
     4132                                   ConfigurationWizard *base)
    39974133{
    39984134    uint i = 0, total = 8;
    39994135#if CONFIG_DARWIN
    40004136    total += 2;
    40014137#endif // USING_DARWIN
     4138    if (settings)
     4139        total -= 3;
    40024140
    40034141
    40044142    VerticalConfigurationGroup* general1 =
    40054143        new VerticalConfigurationGroup(false);
    40064144    general1->setLabel(QObject::tr("General Playback") +
    40074145                      QString(" (%1/%2)").arg(++i).arg(total));
     4146    if (settings)
     4147        general1->setLabel(QObject::tr("Playback group settings for ") +
     4148                           settings->mGroupName + " - " +
     4149                           general1->getLabel());
    40084150
    40094151    HorizontalConfigurationGroup *columns =
    40104152        new HorizontalConfigurationGroup(false, false, true, true);
    40114153
    40124154    VerticalConfigurationGroup *column1 =
    40134155        new VerticalConfigurationGroup(false, false, true, true);
    4014     column1->addChild(RealtimePriority());
    4015     column1->addChild(DecodeExtraAudio());
    4016     column1->addChild(JumpToProgramOSD());
     4156    if (!settings)
     4157        column1->addChild(RealtimePriority(settings));
     4158    column1->addChild(DecodeExtraAudio(settings));
     4159    column1->addChild(JumpToProgramOSD(settings));
    40174160    columns->addChild(column1);
    40184161
    40194162    VerticalConfigurationGroup *column2 =
    40204163        new VerticalConfigurationGroup(false, false, true, true);
    4021     column2->addChild(ClearSavedPosition());
    4022     column2->addChild(AltClearSavedPosition());
    4023     column2->addChild(AutomaticSetWatched());
    4024     column2->addChild(ContinueEmbeddedTVPlay());
     4164    column2->addChild(ClearSavedPosition(settings));
     4165    column2->addChild(AltClearSavedPosition(settings));
     4166    column2->addChild(AutomaticSetWatched(settings));
     4167    column2->addChild(ContinueEmbeddedTVPlay(settings));
    40254168    columns->addChild(column2);
    40264169
    40274170    general1->addChild(columns);
    4028     general1->addChild(LiveTVIdleTimeout());
     4171    if (!settings)
     4172        general1->addChild(LiveTVIdleTimeout());
    40294173#ifdef USING_OPENGL_VSYNC
    4030     //general1->addChild(UseOpenGLVSync());
     4174    //general1->addChild(UseOpenGLVSync(settings));
    40314175#endif // USING_OPENGL_VSYNC
    4032     addChild(general1);
     4176    if (base)
     4177        base->addChild(general1);
     4178    else
     4179        addChild(general1);
    40334180
    40344181    VerticalConfigurationGroup* general2 =
    40354182        new VerticalConfigurationGroup(false);
    40364183    general2->setLabel(QObject::tr("General Playback") +
    40374184                      QString(" (%1/%2)").arg(++i).arg(total));
     4185    if (settings)
     4186        general2->setLabel(QObject::tr("Playback group settings for ") +
     4187                           settings->mGroupName + " - " +
     4188                           general2->getLabel());
    40384189
    40394190    HorizontalConfigurationGroup* oscan =
    40404191        new HorizontalConfigurationGroup(false, false, true, true);
     
    40424193        new VerticalConfigurationGroup(false, false, true, true);
    40434194    VerticalConfigurationGroup *ocol2 =
    40444195        new VerticalConfigurationGroup(false, false, true, true);
    4045     ocol1->addChild(VertScanPercentage());
    4046     ocol1->addChild(YScanDisplacement());
    4047     ocol2->addChild(HorizScanPercentage());
    4048     ocol2->addChild(XScanDisplacement());
     4196    ocol1->addChild(VertScanPercentage(settings));
     4197    ocol1->addChild(YScanDisplacement(settings));
     4198    ocol2->addChild(HorizScanPercentage(settings));
     4199    ocol2->addChild(XScanDisplacement(settings));
    40494200    oscan->addChild(ocol1);
    40504201    oscan->addChild(ocol2);
    40514202
    40524203    HorizontalConfigurationGroup* aspect_fill =
    40534204        new HorizontalConfigurationGroup(false, false, true, true);
    4054     aspect_fill->addChild(AspectOverride());
    4055     aspect_fill->addChild(AdjustFill());
     4205    aspect_fill->addChild(AspectOverride(settings));
     4206    aspect_fill->addChild(AdjustFill(settings));
    40564207
    40574208    general2->addChild(oscan);
    40584209    general2->addChild(aspect_fill);
    4059     general2->addChild(LetterboxingColour());
    4060     general2->addChild(PIPLocationComboBox());
    4061     general2->addChild(PlaybackExitPrompt());
    4062     general2->addChild(EndOfRecordingExitPrompt());
    4063     addChild(general2);
     4210    general2->addChild(LetterboxingColour(settings));
     4211    general2->addChild(PIPLocationComboBox(settings));
     4212    general2->addChild(PlaybackExitPrompt(settings));
     4213    general2->addChild(EndOfRecordingExitPrompt(settings));
     4214    if (base)
     4215        base->addChild(general2);
     4216    else
     4217        addChild(general2);
    40644218
    40654219    QString tmp = QString(" (%1/%2)").arg(++i).arg(total);
    4066     addChild(new PlaybackProfileConfigs(tmp));
     4220    if (base)
     4221        base->addChild(new PlaybackProfileConfigs(tmp, settings));
     4222    else
     4223        addChild(new PlaybackProfileConfigs(tmp, settings));
    40674224
     4225    if (!settings)
     4226    {
    40684227    VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false);
    40694228    pbox->setLabel(QObject::tr("View Recordings") +
    40704229                   QString(" (%1/%2)").arg(++i).arg(total));
     
    40914250    pbox3->addChild(DisplayGroupTitleSort());
    40924251    pbox3->addChild(new WatchListSettings());
    40934252    addChild(pbox3);
     4253    }
    40944254
    40954255    VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false);
    40964256    seek->setLabel(QObject::tr("Seeking") +
    40974257                   QString(" (%1/%2)").arg(++i).arg(total));
    4098     seek->addChild(SmartForward());
    4099     seek->addChild(FFRewReposTime());
    4100     seek->addChild(FFRewReverse());
    4101     seek->addChild(ExactSeeking());
    4102     addChild(seek);
     4258    if (settings)
     4259        seek->setLabel(QObject::tr("Playback group settings for ") +
     4260                       settings->mGroupName + " - " +
     4261                       seek->getLabel());
     4262    seek->addChild(SmartForward(settings));
     4263    seek->addChild(FFRewReposTime(settings));
     4264    seek->addChild(FFRewReverse(settings));
     4265    seek->addChild(ExactSeeking(settings));
     4266    if (base)
     4267        base->addChild(seek);
     4268    else
     4269        addChild(seek);
    41034270
    41044271    VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false);
    41054272    comms->setLabel(QObject::tr("Commercial Skip") +
    41064273                    QString(" (%1/%2)").arg(++i).arg(total));
    4107     comms->addChild(AutoCommercialSkip());
    4108     comms->addChild(CommRewindAmount());
    4109     comms->addChild(CommNotifyAmount());
     4274    if (settings)
     4275        comms->setLabel(QObject::tr("Playback group settings for ") +
     4276                        settings->mGroupName + " - " +
     4277                        comms->getLabel());
     4278    comms->addChild(AutoCommercialSkip(settings));
     4279    comms->addChild(CommRewindAmount(settings));
     4280    comms->addChild(CommNotifyAmount(settings));
     4281    if (!settings) // these are global settings, not host-specific
     4282    {
    41104283    comms->addChild(MaximumCommercialSkip());
    41114284    comms->addChild(MergeShortCommBreaks());
    41124285    comms->addChild(CommSkipAllBlanks());
    4113     addChild(comms);
     4286    }
     4287    if (base)
     4288        base->addChild(comms);
     4289    else
     4290        addChild(comms);
    41144291
    41154292#if CONFIG_DARWIN
    41164293    VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false);
    41174294    mac1->setLabel(QObject::tr("Mac OS X Video Settings") +
    41184295                   QString(" (%1/%2)").arg(++i).arg(total));
     4296    if (settings)
     4297        mac1->setLabel(QObject::tr("Playback group settings for ") +
     4298                       settings->mGroupName + " - " +
     4299                       mac1->getLabel());
     4300    if (!settings)
     4301    {
    41194302    mac1->addChild(MacGammaCorrect());
    41204303    mac1->addChild(MacScaleUp());
    41214304    mac1->addChild(MacFullSkip());
    4122     addChild(mac1);
     4305    }
     4306    if (base)
     4307        base->addChild(mac1);
     4308    else
     4309        addChild(mac1);
    41234310
    41244311    VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false);
    41254312    mac2->setLabel(QObject::tr("Mac OS X Video Settings") +
    41264313                   QString(" (%1/%2)").arg(++i).arg(total));
     4314    if (settings)
     4315        mac2->setLabel(QObject::tr("Playback group settings for ") +
     4316                       settings->mGroupName + " - " +
     4317                       mac2->getLabel());
     4318    if (!setings)
     4319    {
    41274320    mac2->addChild(new MacMainSettings());
    41284321    mac2->addChild(new MacFloatSettings());
    41294322
     
    41374330#endif
    41384331}
    41394332
    4140 OSDSettings::OSDSettings()
     4333OSDSettings::OSDSettings(PlaySettings *settings,
     4334                         ConfigurationWizard *base)
    41414335{
    41424336    VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false);
    41434337    osd->setLabel(QObject::tr("On-screen Display"));
     4338    if (settings)
     4339        osd->setLabel(QObject::tr("Playback group settings for ") +
     4340                      settings->mGroupName + " - " +
     4341                      osd->getLabel());
    41444342
    4145     osd->addChild(EnableMHEG());
    4146     osd->addChild(PersistentBrowseMode());
    4147     osd->addChild(BrowseAllTuners());
    4148     osd->addChild(CCBackground());
    4149     osd->addChild(DefaultCCMode());
    4150     osd->addChild(PreferCC708());
     4343    if (!settings)
     4344    {
     4345    osd->addChild(EnableMHEG(settings));
     4346    osd->addChild(PersistentBrowseMode(settings));
     4347    osd->addChild(BrowseAllTuners(settings));
     4348    }
     4349    osd->addChild(CCBackground(settings));
     4350    osd->addChild(DefaultCCMode(settings));
     4351    osd->addChild(PreferCC708(settings));
     4352    if (!settings)
    41514353    osd->addChild(SubtitleFont());
    4152     osd->addChild(OSDCC708TextZoomPercentage());
    4153     osd->addChild(SubtitleCodec());
    4154     //osd->addChild(UDPNotifyPort());
    4155     addChild(osd);
     4354    osd->addChild(OSDCC708TextZoomPercentage(settings));
     4355    osd->addChild(SubtitleCodec(settings));
     4356    //osd->addChild(UDPNotifyPort(settings));
     4357    if (base)
     4358        base->addChild(osd);
     4359    else
     4360        addChild(osd);
    41564361
    41574362    //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false);
    41584363    //cc->setLabel(QObject::tr("Closed Captions"));
  • programs/mythfrontend/main.cpp

     
    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"
     
    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;
     
    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")
     
    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    {
  • programs/mythfrontend/globalsettings.h

     
    1313
    1414class QFileInfo;
    1515class AudioDeviceComboBox;
     16class PlaySettings;
    1617
    1718class AudioConfigSettings : public VerticalConfigurationGroup
    1819{
     
    9091class PlaybackSettings : public ConfigurationWizard
    9192{
    9293  public:
    93     PlaybackSettings();
     94    PlaybackSettings(PlaySettings *settings=NULL,
     95                     ConfigurationWizard *base=NULL);
    9496};
    9597
    9698class OSDSettings: virtual public ConfigurationWizard
    9799{
    98100  public:
    99     OSDSettings();
     101    OSDSettings(PlaySettings *settings=NULL,
     102                ConfigurationWizard *base=NULL);
    100103};
    101104
    102105class GeneralSettings : public ConfigurationWizard
     
    120123class MainGeneralSettings : public ConfigurationWizard
    121124{
    122125  public:
    123     MainGeneralSettings();
     126    MainGeneralSettings(PlaySettings *settings=NULL,
     127                        ConfigurationWizard *base=NULL);
    124128};
    125129
    126130class GeneralRecPrioritiesSettings : public ConfigurationWizard
     
    208212    Q_OBJECT
    209213
    210214  public:
    211     PlaybackProfileConfigs(const QString &str);
     215    PlaybackProfileConfigs(const QString &str, PlaySettings *settings);
    212216    virtual ~PlaybackProfileConfigs();
    213217
    214218  private:
     
    220224
    221225  private:
    222226    QStringList   profiles;
    223     HostComboBox *grouptrigger;
     227    ComboBoxSetting *grouptrigger;
    224228};
    225229
    226230#endif
  • programs/mythavtest/main.cpp

     
    1818#include "mythdbcon.h"
    1919#include "compat.h"
    2020#include "dbcheck.h"
     21#include "playsettings.h"
    2122
    2223// libmythui
    2324#include "mythuihelper.h"
     
    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
     
    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.");