Ticket #8088: 8088_playgroups_v18.patch

File 8088_playgroups_v18.patch, 112.7 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

     
    3333
    3434    TextSubtitles* GetTextSubtitles(void) { return &m_TextSubtitles; }
    3535    bool HasTextSubtitles(void);
    36     bool LoadExternalSubtitles(const QString &videoFile);
     36    bool LoadExternalSubtitles(const QString &videoFile, PlaySettings *settings);
    3737
    3838  private:
    3939    AVSubtitles   m_AVSubtitles;
  • 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),
     
    8485
    8586    // Various state variables
    8687    embedding(false), needrepaint(false),
    87     allowpreviewepg(true), pip_state(kPIPOff)
     88    allowpreviewepg(true), pip_state(kPIPOff),
     89
     90    settings(_settings)
    8891{
    8992    db_pip_size = gCoreContext->GetNumSetting("PIPSize", 26);
    9093
    91     db_move = QPoint(gCoreContext->GetNumSetting("xScanDisplacement", 0),
    92                      gCoreContext->GetNumSetting("yScanDisplacement", 0));
     94    db_move = QPoint(settings->GetNumSetting("xScanDisplacement", 0),
     95                     settings->GetNumSetting("yScanDisplacement", 0));
    9396    db_use_gui_size = gCoreContext->GetNumSetting("GuiSizeForTV", 0);
    9497
    9598    QDesktopWidget *desktop = NULL;
     
    612615    if (change)
    613616    {
    614617        db_scale_vert =
    615             gCoreContext->GetNumSetting("VertScanPercentage", 0) * 0.01f;
     618            settings->GetNumSetting("VertScanPercentage", 0) * 0.01f;
    616619        db_scale_horiz =
    617             gCoreContext->GetNumSetting("HorizScanPercentage", 0) * 0.01f;
     620            settings->GetNumSetting("HorizScanPercentage", 0) * 0.01f;
    618621        db_scaling_allowed = true;
    619622    }
    620623    else
  • libs/libmythtv/videoout_d3d.cpp

     
    5050    opts.priorities->insert("direct3d", 55);
    5151}
    5252
    53 VideoOutputD3D::VideoOutputD3D(void)
    54   : VideoOutput(),        m_lock(QMutex::Recursive),
     53VideoOutputD3D::VideoOutputD3D(PlaySettigns *settings)
     54  : VideoOutput(settings), m_lock(QMutex::Recursive),
    5555    m_hWnd(NULL),          m_render(NULL),
    5656    m_video(NULL),
    5757    m_render_valid(false), m_render_reset(false), m_pip_active(NULL),
  • 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

     
    3737    opts.priorities->insert("opengl", 65);
    3838}
    3939
    40 VideoOutputOpenGL::VideoOutputOpenGL()
    41     : VideoOutput(),
     40VideoOutputOpenGL::VideoOutputOpenGL(PlaySettings *settings)
     41    : VideoOutput(settings),
    4242    gl_context_lock(QMutex::Recursive),
    4343    gl_context(NULL), gl_videochain(NULL), gl_pipchain_active(NULL),
    4444    gl_parent_win(0), gl_embed_win(0), gl_painter(NULL)
  • libs/libmythtv/videoout_quartz.cpp

     
    6363#include "mythverbose.h"
    6464#include "videodisplayprofile.h"
    6565
     66class PlaySettings;
     67
    6668#define LOC     QString("VideoOutputQuartz::")
    6769#define LOC_ERR QString("VideoOutputQuartz Error: ")
    6870
     
    11041106/** \class VideoOutputQuartz
    11051107 *  \brief Implementation of Quartz (Mac OS X windowing system) video output
    11061108 */
    1107 VideoOutputQuartz::VideoOutputQuartz() :
    1108     VideoOutput(), Started(false), data(new QuartzData())
     1109VideoOutputQuartz::VideoOutputQuartz(PlaySettings *settings) :
     1110    VideoOutput(settings), Started(false), data(new QuartzData())
    11091111{
    11101112    init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0);
    11111113}
     
    17551757MythCodecID VideoOutputQuartz::GetBestSupportedCodec(
    17561758    uint width, uint height,
    17571759    uint osd_width, uint osd_height,
    1758     uint stream_type, uint fourcc)
     1760    uint stream_type, uint fourcc, PlaySettings *settings)
    17591761{
    17601762    (void) osd_width;
    17611763    (void) osd_height;
    17621764
    1763     VideoDisplayProfile vdp;
     1765    VideoDisplayProfile vdp(settings);
    17641766    vdp.SetInput(QSize(width, height));
    17651767    QString dec = vdp.GetDecoder();
    17661768    if ((dec == "libmpeg2") || (dec == "ffmpeg"))
  • libs/libmythtv/avformatdecoder.cpp

     
    3131#include "BDRingBuffer.h"
    3232#include "videodisplayprofile.h"
    3333#include "mythuihelper.h"
     34#include "playsettings.h"
    3435
    3536#include "lcddevice.h"
    3637
     
    301302
    302303    cc608_build_parity_table(cc608_parity_table);
    303304
    304     if (gCoreContext->GetNumSetting("CCBackground", 0))
     305    if (GetPlayer()->GetPlaySettings()->GetNumSetting("CCBackground", 0))
    305306        CC708Window::forceWhiteOnBlackText = true;
    306307
    307308    no_dts_hack = false;
     
    11881189    if (selectedStream)
    11891190    {
    11901191        directrendering = true;
    1191         if (!gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&
     1192        if (!GetPlayer()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) &&
    11921193            !CODEC_IS_HWACCEL(codec))
    11931194        {
    11941195            SetLowBuffers(false);
     
    17051706
    17061707                if (!is_db_ignored)
    17071708                {
    1708                     VideoDisplayProfile vdp;
     1709                    VideoDisplayProfile vdp(GetPlayer()->GetPlaySettings());
    17091710                    vdp.SetInput(QSize(width, height));
    17101711                    dec = vdp.GetDecoder();
    17111712                    thread_count = vdp.GetMaxCPUs();
     
    17331734                    MythCodecID vdpau_mcid;
    17341735                    vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec(
    17351736                        width, height,
    1736                         mpeg_version(enc->codec_id), no_hardware_decoders);
     1737                        mpeg_version(enc->codec_id), no_hardware_decoders,
     1738                        GetPlayer()->GetPlaySettings());
    17371739
    17381740                    if (vdpau_mcid >= video_codec_id)
    17391741                    {
     
    17651767                        /* mpeg type    */ mpeg_version(enc->codec_id),
    17661768                        /* xvmc pix fmt */ xvmc_pixel_format(enc->pix_fmt),
    17671769                        /* test surface */ codec_is_std(video_codec_id),
    1768                         /* force_xv     */ force_xv);
     1770                        /* force_xv     */ force_xv,
     1771                        GetPlayer()->GetPlaySettings());
    17691772
    17701773                    if (mcid >= video_codec_id)
    17711774                    {
  • 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   ~VideoOutputOpenGL();
    1515
    1616    bool Init(int width, int height, float aspect, WId winid,
  • libs/libmythtv/tv_play.h

     
    5656class OSDListTreeItemEnteredEvent;
    5757class OSDListTreeItemSelectedEvent;
    5858struct osdInfo;
     59class PlaySettings;
    5960
    6061typedef QMap<QString,InfoMap>    DDValueMap;
    6162typedef QMap<QString,DDValueMap> DDKeyMap;
     
    179180        unsigned long seconds;
    180181    };
    181182
    182     TV(void);
     183    TV(PlaySettings *settings);
    183184   ~TV();
    184185
    185     void InitFromDB(void);
     186    void InitFromDB(PlaySettings *settings);
    186187    bool Init(bool createWindow = true);
    187188
    188189    // User input processing commands
     
    205206
    206207    // Recording commands
    207208    int  PlayFromRecorder(int recordernum);
    208     int  Playback(const ProgramInfo &rcinfo);
     209    int  Playback(const ProgramInfo &rcinfo, PlaySettings *settings);
    209210
    210211    // Commands used by frontend playback box
    211212    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

     
    35563556
    35573557            VideoDisplayProfile::CreateNewProfiles(host);
    35583558            profiles = VideoDisplayProfile::GetProfiles(host);
    3559             QString profile = VideoDisplayProfile::GetDefaultProfileName(host);
     3559            QString profile =
     3560                VideoDisplayProfile::GetDefaultProfileName(host, NULL);
    35603561
    35613562            if (profiles.contains("Normal") &&
    35623563                (profile=="CPU++" || profile=="CPU+" || profile=="CPU--"))
     
    59485949"  jump int(11) NOT NULL default '0',"
    59495950"  PRIMARY KEY  (`name`)"
    59505951");",
     5952"CREATE TABLE playgroupsettings ("
     5953"  playgroupname varchar(64) NOT NULL,"
     5954"  `value` varchar(128) NOT NULL,"
     5955"  `data` text,"
     5956"  overridden tinyint(1) NOT NULL,"
     5957"  PRIMARY KEY (playgroupname, `value`)"
     5958");",
    59515959"CREATE TABLE powerpriority ("
    59525960"  priorityname varchar(64) collate utf8_bin NOT NULL,"
    59535961"  recpriority int(10) NOT NULL default '0',"
  • libs/libmythtv/videoout_vdpau.cpp

     
    4848    opts.deints->insert("vdpau", deints);
    4949}
    5050
    51 VideoOutputVDPAU::VideoOutputVDPAU()
    52   : m_win(0),                m_render(NULL),
     51VideoOutputVDPAU::VideoOutputVDPAU(PlaySettings *settings)
     52  : VideoOutput(settings), m_win(0),           m_render(NULL),
    5353    m_buffer_size(NUM_VDPAU_BUFFERS),          m_pause_surface(0),
    5454    m_need_deintrefs(false), m_video_mixer(0), m_mixer_features(kVDPFeatNone),
    5555    m_checked_surface_ownership(false),
     
    877877
    878878MythCodecID VideoOutputVDPAU::GetBestSupportedCodec(
    879879    uint width,       uint height,
    880     uint stream_type, bool no_acceleration)
     880    uint stream_type, bool no_acceleration, PlaySettings *settings)
    881881{
    882882    bool use_cpu = no_acceleration;
    883     VideoDisplayProfile vdp;
     883    VideoDisplayProfile vdp(settings);
    884884    vdp.SetInput(QSize(width, height));
    885885    QString dec = vdp.GetDecoder();
    886886
  • libs/libmythtv/videoout_directfb.cpp

     
    274274    opts.priorities->insert("directfb", 60);
    275275}
    276276
    277 VideoOutputDirectfb::VideoOutputDirectfb()
    278     : VideoOutput(), XJ_started(false), widget(NULL),
     277VideoOutputDirectfb::VideoOutputDirectfb(PlaySettings *settings)
     278    : VideoOutput(settings), XJ_started(false), widget(NULL),
    279279      data(new DirectfbData())
    280280{
    281281    init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0);
  • libs/libmythtv/mythplayer.h

     
    213213    QString   GetXDS(const QString &key) const;
    214214    PIPLocation GetNextPIPLocation(void) const;
    215215
     216    PlaySettings *GetPlaySettings(void) const {
     217        return player_ctx ? player_ctx->settings : NULL;
     218    }
     219
    216220    // Bool Gets
    217221    bool    GetRawAudioState(void) const;
    218222    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)
     
    893895/**
    894896 * \brief assign programinfo to the context
    895897 */
    896 void PlayerContext::SetPlayingInfo(const ProgramInfo *info)
     898void PlayerContext::SetPlayingInfo(const ProgramInfo *info,
     899                                   PlaySettings *_settings)
    897900{
    898901    bool ignoreDB = gCoreContext->IsDatabaseIgnored();
    899902
     
    905908            playingInfo->MarkAsInUse(false, recUsage);
    906909        delete playingInfo;
    907910        playingInfo = NULL;
     911        // XXX delete settings?
    908912    }
    909913
    910914    if (info)
     
    913917        if (!ignoreDB)
    914918            playingInfo->MarkAsInUse(true, recUsage);
    915919        playingLen = playingInfo->GetSecondsInRecording();
     920        settings = (_settings ? _settings :
     921                    new PlaySettings(playingInfo->GetPlaybackGroup()));
    916922    }
    917923}
    918924
  • libs/libmythtv/subtitlereader.cpp

     
    5656        av_free(subtitle.rects);
    5757}
    5858
    59 bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName)
     59bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName,
     60                                           PlaySettings *settings)
    6061{
    6162    m_TextSubtitles.Clear();
    62     return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles);
     63    return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles,
     64                                             settings);
    6365}
    6466
    6567bool 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{
     
    102104#ifndef _WIN32
    103105    TESTVIDEOSYNC(DRMVideoSync);
    104106#ifdef USING_OPENGL_VSYNC
    105     if (gCoreContext->GetNumSetting("UseOpenGLVSync", 1) &&
     107    if (settings->GetNumSetting("UseOpenGLVSync", 1) &&
    106108       (getenv("NO_OPENGL_VSYNC") == NULL))
    107109    {
    108110        TESTVIDEOSYNC(OpenGLVideoSync);
  • libs/libmythtv/tv_play.cpp

     
    5656#include "mythsystemevent.h"
    5757#include "videometadatautil.h"
    5858#include "mythdialogbox.h"
     59#include "playsettings.h"
    5960
    6061#if ! HAVE_ROUND
    6162#define round(x) ((int) ((x) + 0.5))
     
    206207    bool startInGuide = flags & kStartTVInGuide;
    207208    bool inPlaylist = flags & kStartTVInPlayList;
    208209    bool initByNetworkCommand = flags & kStartTVByNetworkCommand;
    209     TV *tv = new TV();
    210210    bool quitAll = false;
    211211    bool showDialogs = true;
    212212    bool playCompleted = false;
     
    220220        curProgram->SetIgnoreBookmark(flags & kStartTVIgnoreBookmark);
    221221    }
    222222
     223    PlaySettings settings(curProgram ? curProgram->GetPlaybackGroup() : "Default");
     224    TV *tv = new TV(&settings);
     225
    223226    // Initialize TV
    224227    if (!tv->Init())
    225228    {
     
    250253        if (curProgram)
    251254        {
    252255            VERBOSE(VB_PLAYBACK, LOC + "tv->Playback() -- begin");
    253             if (!tv->Playback(*curProgram))
     256            if (!tv->Playback(*curProgram, &settings))
    254257            {
    255258                quitAll = true;
    256259            }
     
    831834class TVInitRunnable : public QRunnable
    832835{
    833836  public:
    834     TVInitRunnable(TV *ourTV) : tv(ourTV) {}
    835     virtual void run(void) { tv->InitFromDB(); }
     837    TVInitRunnable(TV *ourTV, PlaySettings *ourSettings) :
     838        tv(ourTV), settings(ourSettings) {}
     839    virtual void run(void) { tv->InitFromDB(settings); }
    836840    TV *tv;
     841    PlaySettings *settings;
    837842};
    838843
    839844/** \fn TV::TV(void)
    840845 *  \sa Init(void)
    841846 */
    842 TV::TV(void)
     847TV::TV(PlaySettings *settings)
    843848    : // Configuration variables from database
    844849      baseFilters(""),
    845850      db_channel_format("<num> <sign>"),
     
    938943    playerActive = 0;
    939944    playerLock.unlock();
    940945
    941     QThreadPool::globalInstance()->start(new TVInitRunnable(this), 99);
     946    QThreadPool::globalInstance()->start(new TVInitRunnable(this, settings), 99);
    942947
    943948    VERBOSE(VB_PLAYBACK, LOC + "ctor -- end");
    944949}
    945950
    946 void TV::InitFromDB(void)
     951void TV::InitFromDB(PlaySettings *settings)
    947952{
    948953    QMap<QString,QString> kv;
    949954    kv["LiveTVIdleTimeout"]        = "0";
     
    988993        kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]);
    989994
    990995    MythDB::getMythDB()->GetSettings(kv);
     996    settings->AddToMap(kv);
    991997
    992998    // convert from minutes to ms.
    993999    db_idle_timeout        = kv["LiveTVIdleTimeout"].toInt() * 60 * 1000;
     
    17181724    askAllowLock.unlock();
    17191725}
    17201726
    1721 int TV::Playback(const ProgramInfo &rcinfo)
     1727int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings)
    17221728{
    17231729    wantsToQuit   = false;
    17241730    jumpToProgram = false;
     
    17321738        return 0;
    17331739    }
    17341740
    1735     mctx->SetPlayingInfo(&rcinfo);
     1741    mctx->SetPlayingInfo(&rcinfo, settings);
    17361742    mctx->SetInitialTVState(false);
    17371743    ScheduleStateChange(mctx);
    17381744
     
    18151821
    18161822    if (fileexists)
    18171823    {
    1818         Playback(pginfo);
     1824        PlaySettings settings("Default");
     1825        Playback(pginfo, &settings);
    18191826        retval = 1;
    18201827    }
    18211828
     
    21562163            QString msg = tr("%1 Settings")
    21572164                    .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup()));
    21582165            ctx->UnlockPlayingInfo(__FILE__, __LINE__);
    2159             if (count > 0)
     2166            if (count > 0 &&
     2167                ctx->playingInfo->GetPlaybackGroup() != "Default" &&
     2168                ctx->playingInfo->GetPlaybackGroup() != "Videos")
    21602169                SetOSDMessage(ctx, msg);
    21612170            ITVRestart(ctx, false);
    21622171        }
  • 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

     
    2727    opts.priorities->insert("null", 10);
    2828}
    2929
    30 VideoOutputNull::VideoOutputNull() :
    31     VideoOutput(), global_lock(QMutex::Recursive)
     30VideoOutputNull::VideoOutputNull(PlaySettings *settings) :
     31    VideoOutput(settings), global_lock(QMutex::Recursive)
    3232{
    3333    VERBOSE(VB_PLAYBACK, "VideoOutputNull()");
    3434    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),
     
    345348    monitor_sz(640,480),                monitor_dim(400,300),
    346349
    347350    // OSD
    348     osd_painter(NULL),                  osd_image(NULL)
     351    osd_painter(NULL),                  osd_image(NULL),
     352    settings(_settings)
    349353
    350354{
    351355    bzero(&pip_tmp_image, sizeof(pip_tmp_image));
    352     db_display_dim = QSize(gCoreContext->GetNumSetting("DisplaySizeWidth",  0),
    353                            gCoreContext->GetNumSetting("DisplaySizeHeight", 0));
     356    db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth",  0),
     357                           settings->GetNumSetting("DisplaySizeHeight", 0));
    354358
    355359    db_pict_attr[kPictureAttribute_Brightness] =
    356         gCoreContext->GetNumSetting("PlaybackBrightness", 50);
     360        settings->GetNumSetting("PlaybackBrightness", 50);
    357361    db_pict_attr[kPictureAttribute_Contrast] =
    358         gCoreContext->GetNumSetting("PlaybackContrast",   50);
     362        settings->GetNumSetting("PlaybackContrast",   50);
    359363    db_pict_attr[kPictureAttribute_Colour] =
    360         gCoreContext->GetNumSetting("PlaybackColour",     50);
     364        settings->GetNumSetting("PlaybackColour",     50);
    361365    db_pict_attr[kPictureAttribute_Hue] =
    362         gCoreContext->GetNumSetting("PlaybackHue",         0);
     366        settings->GetNumSetting("PlaybackHue",         0);
    363367
    364368    db_aspectoverride = (AspectOverrideMode)
    365         gCoreContext->GetNumSetting("AspectOverride",      0);
     369        settings->GetNumSetting("AspectOverride",      0);
    366370    db_adjustfill = (AdjustFillMode)
    367         gCoreContext->GetNumSetting("AdjustFill",          0);
     371        settings->GetNumSetting("AdjustFill",          0);
    368372    db_letterbox_colour = (LetterBoxColour)
    369         gCoreContext->GetNumSetting("LetterboxColour",     0);
     373        settings->GetNumSetting("LetterboxColour",     0);
    370374    db_use_picture_controls =
    371         gCoreContext->GetNumSetting("UseOutputPictureControls", 0);
     375        settings->GetNumSetting("UseOutputPictureControls", 0);
    372376
    373377    if (!gCoreContext->IsDatabaseIgnored())
    374         db_vdisp_profile = new VideoDisplayProfile();
     378        db_vdisp_profile = new VideoDisplayProfile(settings);
    375379}
    376380
    377381/**
     
    447451    return QString::null;
    448452}
    449453
    450 bool VideoOutput::IsPreferredRenderer(QSize video_size)
     454bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings)
    451455{
    452456    if (!db_vdisp_profile || (video_size == window.GetVideoDispDim()))
    453457        return true;
    454458
    455     VideoDisplayProfile vdisp;
     459    VideoDisplayProfile vdisp(settings);
    456460    vdisp.SetInput(video_size);
    457461    QString new_rend = vdisp.GetVideoRenderer();
    458462    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,
     
    162163    bool     allowpreviewepg;
    163164    PIPState pip_state;
    164165
     166    PlaySettings *settings;
     167
    165168    // Constants
    166169    static const float kManualZoomMaxHorizontalZoom;
    167170    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{
     
    112113    void SetRecorder(RemoteEncoder *rec);
    113114    void SetTVChain(LiveTVChain *chain);
    114115    void SetRingBuffer(RingBuffer *buf);
    115     void SetPlayingInfo(const ProgramInfo *info);
     116    void SetPlayingInfo(const ProgramInfo *info, PlaySettings *settings=NULL);
    116117    void SetPlayGroup(const QString &group);
    117118    void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state);
    118119    void SetPIPLocation(int loc) { pipLocation = loc; }
     
    170171    LiveTVChain        *tvchain;
    171172    RingBuffer         *buffer;
    172173    ProgramInfo        *playingInfo; ///< Currently playing info
     174    PlaySettings       *settings; // corresponding to playingInfo
    173175    long long           playingLen;  ///< Initial CalculateLength()
    174176    AVSpecialDecode     specialDecode;
    175177    bool                nohardwaredecoders; // < Disable use of VDPAU decoding
  • libs/libmythtv/vsync.h

     
    8787
    8888    // documented in vsync.cpp
    8989    static VideoSync *BestMethod(VideoOutput*,
     90                                 PlaySettings *settings,
    9091                                 uint frame_interval, uint refresh_interval,
    9192                                 bool interlaced);
    9293  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

     
    165165 * \see VideoOutput, VideoBuffers
    166166 *
    167167 */
    168 VideoOutputXv::VideoOutputXv()
    169     : VideoOutput(),
     168VideoOutputXv::VideoOutputXv(PlaySettings *settings)
     169    : VideoOutput(settings),
    170170      video_output_subtype(XVUnknown),
    171171      global_lock(QMutex::Recursive),
    172172
     
    390390 * \return port number if it succeeds, else -1.
    391391 */
    392392int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root,
     393                                      PlaySettings *settings,
    393394                                      MythCodecID mcodecid,
    394395                                      uint width, uint height,
    395396                                      bool &xvsetdefaults,
     
    474475    }
    475476
    476477    // figure out if we want chromakeying..
    477     VideoDisplayProfile vdp;
     478    VideoDisplayProfile vdp(settings);
    478479    vdp.SetInput(QSize(width, height));
    479480    bool check_for_colorkey = (vdp.GetOSDRenderer() == "chromakey");
    480481
     
    763764    disp->StartLog();
    764765    QString adaptor_name = QString::null;
    765766    const QSize video_dim = window.GetVideoDim();
    766     xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), video_codec_id,
     767    xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, video_codec_id,
    767768                                 video_dim.width(), video_dim.height(),
    768769                                 xv_set_defaults,
    769770                                 xvmc_chroma, &xvmc_surf_info, &adaptor_name);
     
    842843    disp->StartLog();
    843844    QString adaptor_name = QString::null;
    844845    const QSize video_dim = window.GetVideoDim();
    845     xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), kCodec_MPEG2,
     846    xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, kCodec_MPEG2,
    846847                                 video_dim.width(), video_dim.height(),
    847848                                 xv_set_defaults, 0, NULL, &adaptor_name);
    848849    if (xv_port == -1)
     
    996997    uint width,       uint height,
    997998    uint osd_width,   uint osd_height,
    998999    uint stream_type, int xvmc_chroma,
    999     bool test_surface, bool force_xv)
     1000    bool test_surface, bool force_xv,
     1001    PlaySettings *settings)
    10001002{
    10011003    (void)width, (void)height, (void)osd_width, (void)osd_height;
    10021004    (void)stream_type, (void)xvmc_chroma, (void)test_surface;
     
    10071009        return ret;
    10081010
    10091011#ifdef USING_XVMC
    1010     VideoDisplayProfile vdp;
     1012    VideoDisplayProfile vdp(settings);
    10111013    vdp.SetInput(QSize(width, height));
    10121014    QString dec = vdp.GetDecoder();
    10131015    if ((dec == "libmpeg2") || (dec == "ffmpeg"))
     
    10571059
    10581060        ok = false;
    10591061        bool dummy;
    1060         int port = GrabSuitableXvPort(disp, disp->GetRoot(), ret, width, height,
     1062        int port = GrabSuitableXvPort(disp, disp->GetRoot(), settings,
     1063                                      ret, width, height,
    10611064                                      dummy, xvmc_chroma, &info);
    10621065        if (port >= 0)
    10631066        {
  • libs/libmythtv/mythplayer.cpp

     
    6161#include "mythpainter.h"
    6262#include "mythimage.h"
    6363#include "mythuiimage.h"
     64#include "playsettings.h"
    6465
    6566extern "C" {
    6667#include "vbitext/vbi.h"
     
    246247      output_jmeter(NULL)
    247248{
    248249    playerThread = QThread::currentThread();
    249     // Playback (output) zoom control
    250     detect_letter_box = new DetectLetterbox(this);
    251250
    252     vbimode = VBIMode::Parse(gCoreContext->GetSetting("VbiFormat"));
    253     decode_extra_audio = gCoreContext->GetNumSetting("DecodeExtraAudio", 0);
    254     itvEnabled         = gCoreContext->GetNumSetting("EnableMHEG", 0);
    255     db_prefer708       = gCoreContext->GetNumSetting("Prefer708Captions", 1);
    256 
    257251    bzero(&tc_lastval, sizeof(tc_lastval));
    258252    bzero(&tc_wrap,    sizeof(tc_wrap));
    259253
     
    491485    if (using_null_videoout && GetDecoder())
    492486    {
    493487        MythCodecID codec = GetDecoder()->GetVideoCodecID();
    494         videoOutput = new VideoOutputNull();
     488        videoOutput = new VideoOutputNull(GetPlaySettings());
    495489        if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(),
    496490                               video_aspect, 0, 0, 0, 0, 0, codec, 0))
    497491        {
     
    541535                pipState,
    542536                video_disp_dim, video_aspect,
    543537                widget->winId(), display_rect, (video_frame_rate * play_speed),
    544                 0 /*embedid*/);
     538                0 /*embedid*/, GetPlaySettings());
    545539        }
    546540
    547541        if (videoOutput)
     
    631625
    632626void MythPlayer::ReinitVideo(void)
    633627{
    634     if (!videoOutput->IsPreferredRenderer(video_disp_dim))
     628    if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings()))
    635629    {
    636630        VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer."));
    637631        SetErrored(QObject::tr("Need to switch video renderer."));
     
    19691963        }
    19701964#endif // USING_MHEG
    19711965
    1972         SetCaptionsEnabled(gCoreContext->GetNumSetting("DefaultCCMode"), false);
     1966        SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0),
     1967                           false);
    19731968    }
    19741969
    19751970    SetPlaying(true);
     
    20152010        m_double_process = videoOutput->IsExtraProcessingRequired();
    20162011
    20172012        videosync = VideoSync::BestMethod(
    2018             videoOutput, fr_int, rf_int, m_double_framerate);
     2013            videoOutput, GetPlaySettings(),
     2014            fr_int, rf_int, m_double_framerate);
    20192015
    20202016        // Make sure video sync can do it
    20212017        if (videosync != NULL && m_double_framerate)
     
    23782374    if (bookmarkseek > 30)
    23792375    {
    23802376        DoFastForward(bookmarkseek, true, false);
    2381         if (gCoreContext->GetNumSetting("ClearSavedPosition", 1) &&
     2377        if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) &&
    23822378            !player_ctx->IsPIP())
    23832379        {
    23842380            ClearBookmark(false);
     
    25922588    {
    25932589        if (jumpto == totalFrames)
    25942590        {
    2595             if (!(gCoreContext->GetNumSetting("EndOfRecordingExitPrompt") == 1
     2591            if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1
    25962592                  && !player_ctx->IsPIP() &&
    25972593                  player_ctx->GetState() == kState_WatchingPreRecorded))
    25982594            {
     
    28592855        return kPIP_END;
    28602856
    28612857    if (pip_players.isEmpty())
    2862         return (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft);
     2858        return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation",
     2859                                                             kPIPTopLeft);
    28632860
    28642861    // order of preference, could be stored in db if we want it configurable
    28652862    PIPLocation ols[] =
     
    33573354    exactseeks   = frame_exact_seek;
    33583355    player_ctx   = ctx;
    33593356    livetv       = ctx->tvchain;
     3357
     3358    vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", ""));
     3359
     3360    // Playback (output) zoom control
     3361    detect_letter_box = new DetectLetterbox(this);
     3362
     3363    decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0);
     3364    itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0);
     3365    db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1);
    33603366}
    33613367
    33623368bool MythPlayer::EnableEdit(void)
  • libs/libmythtv/videooutbase.h

     
    3232class FilterChain;
    3333class FilterManager;
    3434class OpenGLContextGLX;
     35class PlaySettings;
    3536
    3637typedef QMap<MythPlayer*,PIPLocation> PIPMap;
    3738
     
    5253        PIPState       pipState,
    5354        const QSize   &video_dim, float        video_aspect,
    5455        WId            win_id,    const QRect &display_rect,
    55         float video_prate,        WId          embed_id);
     56        float video_prate,        WId          embed_id,
     57        PlaySettings *settings);
    5658
    57     VideoOutput();
     59    VideoOutput(PlaySettings *settings);
    5860    virtual ~VideoOutput();
    5961
    6062    virtual bool Init(int width, int height, float aspect,
     
    6264                      int winh, MythCodecID codec_id, WId embedid = 0);
    6365    virtual void InitOSD(OSD *osd);
    6466    virtual void SetVideoFrameRate(float);
    65     virtual bool IsPreferredRenderer(QSize video_size);
     67    virtual bool IsPreferredRenderer(QSize video_size, PlaySettings *settings);
    6668    virtual bool SetDeinterlacingEnabled(bool);
    6769    virtual bool SetupDeinterlace(bool i, const QString& ovrf="");
    6870    virtual void FallbackDeint(void);
     
    338340    // OSD painter and surface
    339341    MythYUVAPainter *osd_painter;
    340342    MythImage       *osd_image;
     343
     344    PlaySettings *settings;
    341345};
    342346
    343347#endif
  • libs/libmythtv/textsubtitleparser.cpp

     
    2121#include "RingBuffer.h"
    2222#include "textsubtitleparser.h"
    2323#include "xine_demux_sputext.h"
     24#include "playsettings.h"
    2425
    2526bool 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: ")
     
    6263        VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-608 reader.");
    6364    if (!m_708reader)
    6465        VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-708 reader.");
    65     m_useBackground = (bool)gCoreContext->GetNumSetting("CCBackground", 0);
    66     m_708fontZoom   = gCoreContext->GetNumSetting("OSDCC708TextZoom", 100);
     66    m_useBackground = (bool)m_player->GetPlaySettings()->GetNumSetting("CCBackground", 0);
     67    m_708fontZoom   = m_player->GetPlaySettings()->GetNumSetting("OSDCC708TextZoom", 100);
    6768    return true;
    6869}
    6970
  • 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

     
    224224        else if (action == "DOWN")
    225225            focusNextPrevChild(true);
    226226        else if (action == "LEFT" || action == "RIGHT" || action == "SELECT")
    227             toggle();
     227        {
     228            if (isTristate())
     229            {
     230                Qt::CheckState newState =
     231                    (Qt::CheckState)(((int)checkState() + 1) % 3);
     232                setCheckState(newState);
     233            }
     234            else
     235                toggle();
     236        }
    228237        else
    229238            handled = false;
    230239    }
  • 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:
     
    594709    return gs;
    595710}
    596711
    597 static HostCheckBox *DecodeExtraAudio()
     712static Setting *DecodeExtraAudio(PlaySettings *settings)
    598713{
    599     HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");
     714    CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings);
    600715    gc->setLabel(QObject::tr("Extra audio buffering"));
    601716    gc->setValue(true);
    602717    gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing "
     
    605720                    "effect on framegrabbers (MPEG-4/RTJPEG). MythTV will "
    606721                    "keep extra audio data in its internal buffers to "
    607722                    "workaround this bug."));
    608     return gc;
     723    return wrap(gc, settings);
    609724}
    610725
    611 static HostComboBox *PIPLocationComboBox()
     726static Setting *PIPLocationComboBox(PlaySettings *settings)
    612727{
    613     HostComboBox *gc = new HostComboBox("PIPLocation");
     728    CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings);
    614729    gc->setLabel(QObject::tr("PIP video location"));
    615730    for (uint loc = 0; loc < kPIP_END; ++loc)
    616731        gc->addSelection(toString((PIPLocation) loc), QString::number(loc));
    617732    gc->setHelpText(QObject::tr("Location of PIP Video window."));
    618     return gc;
     733    return wrap(gc, settings);
    619734}
    620735
    621736static HostComboBox *DisplayRecGroup()
     
    701816    return gc;
    702817}
    703818
    704 static HostCheckBox *SmartForward()
     819static Setting *SmartForward(PlaySettings *settings)
    705820{
    706     HostCheckBox *gc = new HostCheckBox("SmartForward");
     821    CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings);
    707822    gc->setLabel(QObject::tr("Smart fast forwarding"));
    708823    gc->setValue(false);
    709824    gc->setHelpText(QObject::tr("If enabled, then immediately after "
    710825                    "rewinding, only skip forward the same amount as "
    711826                    "skipping backwards."));
    712     return gc;
     827    return wrap(gc, settings);
    713828}
    714829
    715 static HostCheckBox *ExactSeeking()
     830static Setting *ExactSeeking(PlaySettings *settings)
    716831{
    717     HostCheckBox *gc = new HostCheckBox("ExactSeeking");
     832    CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings);
    718833    gc->setLabel(QObject::tr("Seek to exact frame"));
    719834    gc->setValue(false);
    720835    gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but "
    721836                    "slower."));
    722     return gc;
     837    return wrap(gc, settings);
    723838}
    724839
    725840static GlobalComboBox *CommercialSkipMethod()
     
    747862    return gc;
    748863}
    749864
    750 static HostComboBox *AutoCommercialSkip()
     865static Setting *AutoCommercialSkip(PlaySettings *settings)
    751866{
    752     HostComboBox *gc = new HostComboBox("AutoCommercialSkip");
     867    CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings);
    753868    gc->setLabel(QObject::tr("Automatically skip commercials"));
    754869    gc->addSelection(QObject::tr("Off"), "0");
    755870    gc->addSelection(QObject::tr("Notify, but do not skip"), "2");
     
    758873                    "have been flagged during automatic commercial detection "
    759874                    "or by the mythcommflag program, or just notify that a "
    760875                    "commercial has been detected."));
    761     return gc;
     876    return wrap(gc, settings);
    762877}
    763878
    764879static GlobalCheckBox *AutoCommercialFlag()
     
    844959    return bc;
    845960}
    846961
    847 static HostSpinBox *CommRewindAmount()
     962static Setting *CommRewindAmount(PlaySettings *settings)
    848963{
    849     HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);
     964    CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false);
    850965    gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)"));
    851966    gs->setHelpText(QObject::tr("MythTV will automatically rewind "
    852967                    "this many seconds after performing a commercial skip."));
    853968    gs->setValue(0);
    854     return gs;
     969    return wrap(gs, settings);
    855970}
    856971
    857 static HostSpinBox *CommNotifyAmount()
     972static Setting *CommNotifyAmount(PlaySettings *settings)
    858973{
    859     HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);
     974    CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false);
    860975    gs->setLabel(QObject::tr("Commercial skip notify amount (secs)"));
    861976    gs->setHelpText(QObject::tr("MythTV will act like a commercial "
    862977                    "begins this many seconds early. This can be useful "
    863978                    "when commercial notification is used in place of "
    864979                    "automatic skipping."));
    865980    gs->setValue(0);
    866     return gs;
     981    return wrap(gs, settings);
    867982}
    868983
    869984static GlobalSpinBox *MaximumCommercialSkip()
     
    16651780    labels[j]->setValue(label_i);
    16661781}
    16671782
    1668 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) :
     1783PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str,
     1784                                               PlaySettings *settings) :
    16691785    TriggeredConfigurationGroup(false, true,  true, true,
    16701786                                false, false, true, true), grouptrigger(NULL)
    16711787{
    16721788    setLabel(QObject::tr("Playback Profiles") + str);
     1789    if (settings)
     1790        setLabel(QObject::tr("Playback group settings for ") +
     1791                 settings->mGroupName + " - " +
     1792                 getLabel());
    16731793
    16741794    QString host = gCoreContext->GetHostName();
    16751795    QStringList profiles = VideoDisplayProfile::GetProfiles(host);
     
    16971817        profiles = VideoDisplayProfile::GetProfiles(host);
    16981818    }
    16991819
    1700     QString profile = VideoDisplayProfile::GetDefaultProfileName(host);
     1820    QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings);
    17011821    if (!profiles.contains(profile))
    17021822    {
    17031823        profile = (profiles.contains("Normal")) ? "Normal" : profiles[0];
    17041824        VideoDisplayProfile::SetDefaultProfileName(profile, host);
    17051825    }
    17061826
    1707     grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile");
     1827    CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings);
     1828    grouptrigger = gs;
    17081829    grouptrigger->setLabel(QObject::tr("Current Video Playback Profile"));
    17091830    QStringList::const_iterator it;
    17101831    for (it = profiles.begin(); it != profiles.end(); ++it)
    17111832        grouptrigger->addSelection(ProgramInfo::i18n(*it), *it);
     1833    if (settings)
     1834    {
     1835        addChild(wrap(grouptrigger, settings));
     1836        return;
     1837    }
    17121838
    17131839    HorizontalConfigurationGroup *grp =
    17141840        new HorizontalConfigurationGroup(false, false, true, true);
     
    18411967    return gc;
    18421968}
    18431969
    1844 static HostSpinBox *FFRewReposTime()
     1970static Setting *FFRewReposTime(PlaySettings *settings)
    18451971{
    1846     HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);
     1972    CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false);
    18471973    gs->setLabel(QObject::tr("Fast forward/rewind reposition amount"));
    18481974    gs->setValue(100);
    18491975    gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind "
     
    18511977                    "resuming normal playback. This "
    18521978                    "compensates for the reaction time between seeing "
    18531979                    "where to resume playback and actually exiting seeking."));
    1854     return gs;
     1980    return wrap(gs, settings);
    18551981}
    18561982
    1857 static HostCheckBox *FFRewReverse()
     1983static Setting *FFRewReverse(PlaySettings *settings)
    18581984{
    1859     HostCheckBox *gc = new HostCheckBox("FFRewReverse");
     1985    CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings);
    18601986    gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind"));
    18611987    gc->setValue(true);
    18621988    gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key "
     
    18641990                    "vice versa. If disabled, it will decrease the "
    18651991                    "current speed or switch to play mode if "
    18661992                    "the speed can't be decreased further."));
    1867     return gc;
     1993    return wrap(gc, settings);
    18681994}
    18691995
    18701996static HostComboBox *MenuTheme()
     
    19152041    return gc;
    19162042}
    19172043
    1918 static HostSpinBox *OSDCC708TextZoomPercentage(void)
     2044static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings)
    19192045{
    1920     HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5);
     2046    CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings,
     2047                           50, 200, 5, false);
    19212048    gs->setLabel(QObject::tr("ATSC caption text zoom percentage"));
    19222049    gs->setValue(100);
    19232050    gs->setHelpText(QObject::tr("Use this to enlarge or shrink captions."));
    19242051
    1925     return gs;
     2052    return wrap(gs, settings);
    19262053}
    19272054
    19282055static HostComboBox *SubtitleFont()
     
    19422069    return hcb;
    19432070}
    19442071
    1945 static HostComboBox *SubtitleCodec()
     2072static Setting *SubtitleCodec(PlaySettings *settings)
    19462073{
    1947     HostComboBox *gc = new HostComboBox("SubtitleCodec");
     2074    CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings);
    19482075
    19492076    gc->setLabel(QObject::tr("Subtitle Codec"));
    19502077    QList<QByteArray> list = QTextCodec::availableCodecs();
     
    19542081        gc->addSelection(val, val, val.toLower() == "utf-8");
    19552082    }
    19562083
    1957     return gc;
     2084    return wrap(gc, settings);
    19582085}
    19592086
    19602087static HostComboBox *ChannelOrdering()
     
    19662093    return gc;
    19672094}
    19682095
    1969 static HostSpinBox *VertScanPercentage()
     2096static Setting *VertScanPercentage(PlaySettings *settings)
    19702097{
    1971     HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1);
     2098    CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings,
     2099                           -100, 100, 1, false);
    19722100    gs->setLabel(QObject::tr("Vertical scaling"));
    19732101    gs->setValue(0);
    19742102    gs->setHelpText(QObject::tr(
    19752103                        "Adjust this if the image does not fill your "
    19762104                        "screen vertically. Range -100% to 100%"));
    1977     return gs;
     2105    return wrap(gs, settings);
    19782106}
    19792107
    1980 static HostSpinBox *HorizScanPercentage()
     2108static Setting *HorizScanPercentage(PlaySettings *settings)
    19812109{
    1982     HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1);
     2110    CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings,
     2111                           -100, 100, 1, false);
    19832112    gs->setLabel(QObject::tr("Horizontal scaling"));
    19842113    gs->setValue(0);
    19852114    gs->setHelpText(QObject::tr(
    19862115                        "Adjust this if the image does not fill your "
    19872116                        "screen horizontally. Range -100% to 100%"));
    1988     return gs;
     2117    return wrap(gs, settings);
    19892118};
    19902119
    1991 static HostSpinBox *XScanDisplacement()
     2120static Setting *XScanDisplacement(PlaySettings *settings)
    19922121{
    1993     HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1);
     2122    CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings,
     2123                           -50, 50, 1, false);
    19942124    gs->setLabel(QObject::tr("Scan displacement (X)"));
    19952125    gs->setValue(0);
    19962126    gs->setHelpText(QObject::tr("Adjust this to move the image horizontally."));
    1997     return gs;
     2127    return wrap(gs, settings);
    19982128}
    19992129
    2000 static HostSpinBox *YScanDisplacement()
     2130static Setting *YScanDisplacement(PlaySettings *settings)
    20012131{
    2002     HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1);
     2132    CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings,
     2133                           -50, 50, 1, false);
    20032134    gs->setLabel(QObject::tr("Scan displacement (Y)"));
    20042135    gs->setValue(0);
    20052136    gs->setHelpText(QObject::tr("Adjust this to move the image vertically."));
    2006     return gs;
     2137    return wrap(gs, settings);
    20072138};
    20082139
    20092140static HostCheckBox *AlwaysStreamFiles()
     
    20182149    return gc;
    20192150}
    20202151
    2021 static HostCheckBox *CCBackground()
     2152static Setting *CCBackground(PlaySettings *settings)
    20222153{
    2023     HostCheckBox *gc = new HostCheckBox("CCBackground");
     2154    CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings);
    20242155    gc->setLabel(QObject::tr("Black background for closed captioning"));
    20252156    gc->setValue(false);
    20262157    gc->setHelpText(QObject::tr(
    20272158                        "If enabled, captions will be displayed "
    20282159                        "as white text over a black background "
    20292160                        "for better contrast."));
    2030     return gc;
     2161    return wrap(gc, settings);
    20312162}
    20322163
    2033 static HostCheckBox *DefaultCCMode()
     2164static Setting *DefaultCCMode(PlaySettings *settings)
    20342165{
    2035     HostCheckBox *gc = new HostCheckBox("DefaultCCMode");
     2166    CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings);
    20362167    gc->setLabel(QObject::tr("Always display closed captioning or subtitles"));
    20372168    gc->setValue(false);
    20382169    gc->setHelpText(QObject::tr(
     
    20402171                        "when playing back recordings or watching "
    20412172                        "Live TV. Closed Captioning can be turned on or off "
    20422173                        "by pressing \"T\" during playback."));
    2043     return gc;
     2174    return wrap(gc, settings);
    20442175}
    20452176
    2046 static HostCheckBox *PreferCC708()
     2177static Setting *PreferCC708(PlaySettings *settings)
    20472178{
    2048     HostCheckBox *gc = new HostCheckBox("Prefer708Captions");
     2179    CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings);
    20492180    gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions"));
    20502181    gc->setValue(true);
    20512182    gc->setHelpText(
     
    20532184            "If enabled, the newer EIA-708 captions will be preferred over "
    20542185            "the older EIA-608 captions in ATSC streams."));
    20552186
    2056     return gc;
     2187    return wrap(gc, settings);
    20572188}
    20582189
    2059 static HostCheckBox *EnableMHEG()
     2190static Setting *EnableMHEG(PlaySettings *settings)
    20602191{
    2061     HostCheckBox *gc = new HostCheckBox("EnableMHEG");
     2192    CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings);
    20622193    gc->setLabel(QObject::tr("Enable interactive TV"));
    20632194    gc->setValue(false);
    20642195    gc->setHelpText(QObject::tr(
    20652196                        "If enabled, interactive TV applications (MHEG) will "
    20662197                        "be activated. This is used for teletext and logos for "
    20672198                        "radio and channels that are currently off-air."));
    2068     return gc;
     2199    return wrap(gc, settings);
    20692200}
    20702201
    2071 static HostCheckBox *PersistentBrowseMode()
     2202static Setting *PersistentBrowseMode(PlaySettings *settings)
    20722203{
    2073     HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");
     2204    CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings);
    20742205    gc->setLabel(QObject::tr("Always use browse mode in Live TV"));
    20752206    gc->setValue(true);
    20762207    gc->setHelpText(
    20772208        QObject::tr(
    20782209            "If enabled, browse mode will automatically be activated "
    20792210            "whenever you use channel up/down while watching Live TV."));
    2080     return gc;
     2211    return wrap(gc, settings);
    20812212}
    20822213
    2083 static HostCheckBox *BrowseAllTuners()
     2214static Setting *BrowseAllTuners(PlaySettings *settings)
    20842215{
    2085     HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");
     2216    CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings);
    20862217    gc->setLabel(QObject::tr("Browse all channels"));
    20872218    gc->setValue(false);
    20882219    gc->setHelpText(
     
    20902221            "If enabled, browse mode will shows channels on all "
    20912222            "available recording devices, instead of showing "
    20922223            "channels on just the current recorder."));
    2093     return gc;
     2224    return wrap(gc, settings);
    20942225}
    20952226
    2096 static HostCheckBox *ClearSavedPosition()
     2227static Setting *ClearSavedPosition(PlaySettings *settings)
    20972228{
    2098     HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");
     2229    CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings);
    20992230    gc->setLabel(QObject::tr("Clear bookmark on playback"));
    21002231    gc->setValue(true);
    21012232    gc->setHelpText(QObject::tr("If enabled, automatically clear the "
    21022233                    "bookmark on a recording when the recording is played "
    21032234                    "back. If disabled, you can mark the beginning with "
    21042235                    "rewind then save position."));
    2105     return gc;
     2236    return wrap(gc, settings);
    21062237}
    21072238
    2108 static HostCheckBox *AltClearSavedPosition()
     2239static Setting *AltClearSavedPosition(PlaySettings *settings)
    21092240{
    2110     HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");
     2241    CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings);
    21112242    gc->setLabel(QObject::tr("Alternate clear and save bookmark"));
    21122243    gc->setValue(true);
    21132244    gc->setHelpText(QObject::tr("During playback the SELECT key "
     
    21152246                    "Saved\" and \"Bookmark Cleared\". If disabled, the "
    21162247                    "SELECT key will save the current position for each "
    21172248                    "keypress."));
    2118     return gc;
     2249    return wrap(gc, settings);
    21192250}
    21202251
    21212252#if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU)
    2122 static HostCheckBox *UsePicControls()
     2253static Setting *UsePicControls(PlaySettings *settings)
    21232254{
    2124     HostCheckBox *gc = new HostCheckBox("UseOutputPictureControls");
     2255    CREATE_CHECKBOX_SETTING(gc, "UseOutputPictureControls", settings);
    21252256    gc->setLabel(QObject::tr("Enable picture controls"));
    21262257    gc->setValue(false);
    21272258    gc->setHelpText(
    21282259        QObject::tr(
    21292260            "If enabled, MythTV attempts to initialize picture controls "
    21302261            "(brightness, contrast, etc.) that are applied during playback."));
    2131     return gc;
     2262    return wrap(gc, settings);
    21322263}
    21332264#endif
    21342265
    2135 static HostLineEdit *UDPNotifyPort()
     2266static Setting *UDPNotifyPort(PlaySettings *settings)
    21362267{
    2137     HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");
     2268    CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings);
    21382269    ge->setLabel(QObject::tr("UDP notify port"));
    21392270    ge->setValue("6948");
    21402271    ge->setHelpText(QObject::tr("During playback, MythTV will listen for "
    21412272                    "connections from the \"mythtvosd\" or \"mythudprelay\" "
    21422273                    "programs on this port. For additional information, see "
    21432274                    "http://www.mythtv.org/wiki/MythNotify ."));
    2144     return ge;
     2275    return wrap(ge, settings);
    21452276}
    21462277
    2147 static HostComboBox *PlaybackExitPrompt()
     2278static Setting *PlaybackExitPrompt(PlaySettings *settings)
    21482279{
    2149     HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");
     2280    CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings);
    21502281    gc->setLabel(QObject::tr("Action on playback exit"));
    21512282    gc->addSelection(QObject::tr("Just exit"), "0");
    21522283    gc->addSelection(QObject::tr("Save position and exit"), "2");
     
    21572288                    "when you exit playback mode. The options available will "
    21582289                    "allow you to save your position, delete the "
    21592290                    "recording, or continue watching."));
    2160     return gc;
     2291    return wrap(gc, settings);
    21612292}
    21622293
    2163 static HostCheckBox *EndOfRecordingExitPrompt()
     2294static Setting *EndOfRecordingExitPrompt(PlaySettings *settings)
    21642295{
    2165     HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");
     2296    CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings);
    21662297    gc->setLabel(QObject::tr("Prompt at end of recording"));
    21672298    gc->setValue(false);
    21682299    gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing "
    21692300                    "you to delete the recording when it has finished "
    21702301                    "playing."));
    2171     return gc;
     2302    return wrap(gc, settings);
    21722303}
    21732304
    2174 static HostCheckBox *JumpToProgramOSD()
     2305static Setting *JumpToProgramOSD(PlaySettings *settings)
    21752306{
    2176     HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");
     2307    CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings);
    21772308    gc->setLabel(QObject::tr("Jump to program OSD"));
    21782309    gc->setValue(true);
    21792310    gc->setHelpText(QObject::tr(
     
    21822313                        "'Watch Recording' screen when 'Jump to Program' "
    21832314                        "is activated. If enabled, the recordings are shown "
    21842315                        "in the OSD"));
    2185     return gc;
     2316    return wrap(gc, settings);
    21862317}
    21872318
    2188 static HostCheckBox *ContinueEmbeddedTVPlay()
     2319static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings)
    21892320{
    2190     HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");
     2321    CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings);
    21912322    gc->setLabel(QObject::tr("Continue playback when embedded"));
    21922323    gc->setValue(false);
    21932324    gc->setHelpText(QObject::tr(
     
    21952326                    "is embedded in the upcoming program list or recorded "
    21962327                    "list. The default is to pause the recorded show when "
    21972328                    "embedded."));
    2198     return gc;
     2329    return wrap(gc, settings);
    21992330}
    22002331
    2201 static HostCheckBox *AutomaticSetWatched()
     2332static Setting *AutomaticSetWatched(PlaySettings *settings)
    22022333{
    2203     HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");
     2334    CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings);
    22042335    gc->setLabel(QObject::tr("Automatically mark a recording as watched"));
    22052336    gc->setValue(false);
    22062337    gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a "
     
    22082339                    "detection is not foolproof, so do not enable this "
    22092340                    "setting if you don't want an unwatched recording marked "
    22102341                    "as watched."));
    2211     return gc;
     2342    return wrap(gc, settings);
    22122343}
    22132344
    22142345static HostSpinBox *LiveTVIdleTimeout()
     
    24082539    return gc;
    24092540}
    24102541
    2411 static HostComboBox *LetterboxingColour()
     2542static Setting *LetterboxingColour(PlaySettings *settings)
    24122543{
    2413     HostComboBox *gc = new HostComboBox("LetterboxColour");
     2544    CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings);
    24142545    gc->setLabel(QObject::tr("Letterboxing color"));
    24152546    for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
    24162547        gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
     
    24202551            "letterboxing, but those with plasma screens may prefer gray "
    24212552            "to minimize burn-in.") + " " +
    24222553        QObject::tr("Currently only works with XVideo video renderer."));
    2423     return gc;
     2554    return wrap(gc, settings);
    24242555}
    24252556
    2426 static HostComboBox *AspectOverride()
     2557static Setting *AspectOverride(PlaySettings *settings)
    24272558{
    2428     HostComboBox *gc = new HostComboBox("AspectOverride");
     2559    CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings);
    24292560    gc->setLabel(QObject::tr("Video aspect override"));
    24302561    for (int m = kAspect_Off; m < kAspect_END; ++m)
    24312562        gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
     
    24332564                        "When enabled, these will override the aspect "
    24342565                        "ratio specified by any broadcaster for all "
    24352566                        "video streams."));
    2436     return gc;
     2567    return wrap(gc, settings);
    24372568}
    24382569
    2439 static HostComboBox *AdjustFill()
     2570static Setting *AdjustFill(PlaySettings *settings)
    24402571{
    2441     HostComboBox *gc = new HostComboBox("AdjustFill");
     2572    CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings);
    24422573    gc->setLabel(QObject::tr("Zoom"));
    24432574    gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff),
    24442575                     QString::number(kAdjustFill_AutoDetect_DefaultOff));
     
    24492580    gc->setHelpText(QObject::tr(
    24502581                        "When enabled, these will apply a predefined "
    24512582                        "zoom to all video playback in MythTV."));
    2452     return gc;
     2583    return wrap(gc, settings);
    24532584}
    24542585
    24552586// Theme settings
     
    28763007    return gc;
    28773008}
    28783009
    2879 ThemeSelector::ThemeSelector(QString label):
    2880     HostImageSelect(label) {
    2881 
     3010static Setting *ThemeSelector(QString label, PlaySettings *settings=NULL)
     3011{
     3012    CREATE_IMAGESELECT_SETTING(gs, label, settings);
    28823013    ThemeType themetype = THEME_UI;
    28833014
    28843015    if (label == "Theme")
    28853016    {
    28863017        themetype = THEME_UI;
    2887         setLabel(QObject::tr("UI theme"));
     3018        gs->setLabel(QObject::tr("UI theme"));
    28883019    }
    28893020    else if (label == "MenuTheme")
    28903021    {
    28913022        themetype = THEME_MENU;
    2892         setLabel(QObject::tr("Menu theme"));
     3023        gs->setLabel(QObject::tr("Menu theme"));
    28933024    }
    28943025
    28953026    QDir themes(GetThemesParentDir());
     
    29533084            VERBOSE(VB_IMPORTANT, QString("Problem reading theme preview image"
    29543085                                          " %1").arg(preview.filePath()));
    29553086
    2956         addImageSelection(name, previewImage, theme.fileName());
     3087        gs->addImageSelection(name, previewImage, theme.fileName());
    29573088    }
    29583089
    29593090    if (themetype & THEME_UI)
    2960         setValue(DEFAULT_UI_THEME);
     3091        gs->setValue(DEFAULT_UI_THEME);
     3092
     3093    return wrap(gs, settings);
    29613094}
    29623095
    29633096static HostComboBox *ChannelFormat()
     
    34623595    return gs;
    34633596}
    34643597
    3465 static HostCheckBox *RealtimePriority()
     3598static Setting *RealtimePriority(PlaySettings *settings)
    34663599{
    3467     HostCheckBox *gc = new HostCheckBox("RealtimePriority");
     3600    CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings);
    34683601    gc->setLabel(QObject::tr("Enable realtime priority threads"));
    34693602    gc->setHelpText(QObject::tr("When running mythfrontend with root "
    34703603                    "privileges, some threads can be given enhanced priority. "
    34713604                    "Disable this if mythfrontend freezes during video "
    34723605                    "playback."));
    34733606    gc->setValue(true);
    3474     return gc;
     3607    return wrap(gc, settings, false);
    34753608}
    34763609
    34773610static HostCheckBox *EnableMediaMon()
     
    36273760};
    36283761
    36293762#ifdef USING_OPENGL_VSYNC
    3630 static HostCheckBox *UseOpenGLVSync()
     3763static Setting *UseOpenGLVSync(PlaySettings *settings)
    36313764{
    3632     HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");
     3765    CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings);
    36333766    gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing"));
    36343767    gc->setValue(false);
    36353768    gc->setHelpText(QObject::tr(
    36363769                        "If supported by your hardware/drivers, "
    36373770                        "MythTV will use OpenGL vertical syncing for "
    36383771                        "video timing, reducing frame jitter."));
    3639     return gc;
     3772    return wrap(gc, settings);
    36403773}
    36413774#endif
    36423775
     
    40624195    return gc;
    40634196}
    40644197
    4065 MainGeneralSettings::MainGeneralSettings()
     4198MainGeneralSettings::MainGeneralSettings(PlaySettings *settings,
     4199                                         ConfigurationWizard *base)
    40664200{
     4201    if (!settings)
     4202    {
    40674203    DatabaseSettings::addDatabaseSettings(this);
    40684204
    40694205    VerticalConfigurationGroup *pin =
     
    41164252    remotecontrol->addChild(NetworkControlEnabled());
    41174253    remotecontrol->addChild(NetworkControlPort());
    41184254    addChild(remotecontrol);
     4255    }
    41194256}
    41204257
    4121 PlaybackSettings::PlaybackSettings()
     4258PlaybackSettings::PlaybackSettings(PlaySettings *settings,
     4259                                   ConfigurationWizard *base)
    41224260{
    41234261    uint i = 0, total = 8;
    41244262#if CONFIG_DARWIN
    41254263    total += 2;
    41264264#endif // USING_DARWIN
     4265    if (settings)
     4266        total -= 3;
    41274267
    41284268
    41294269    VerticalConfigurationGroup* general1 =
    41304270        new VerticalConfigurationGroup(false);
    41314271    general1->setLabel(QObject::tr("General Playback") +
    41324272                      QString(" (%1/%2)").arg(++i).arg(total));
     4273    if (settings)
     4274        general1->setLabel(QObject::tr("Playback group settings for ") +
     4275                           settings->mGroupName + " - " +
     4276                           general1->getLabel());
    41334277
    41344278    HorizontalConfigurationGroup *columns =
    41354279        new HorizontalConfigurationGroup(false, false, true, true);
    41364280
    41374281    VerticalConfigurationGroup *column1 =
    41384282        new VerticalConfigurationGroup(false, false, true, true);
    4139     column1->addChild(RealtimePriority());
    4140     column1->addChild(DecodeExtraAudio());
    4141     column1->addChild(JumpToProgramOSD());
     4283    if (!settings)
     4284        column1->addChild(RealtimePriority(settings));
     4285    column1->addChild(DecodeExtraAudio(settings));
     4286    column1->addChild(JumpToProgramOSD(settings));
    41424287    columns->addChild(column1);
    41434288
    41444289    VerticalConfigurationGroup *column2 =
    41454290        new VerticalConfigurationGroup(false, false, true, true);
    4146     column2->addChild(ClearSavedPosition());
    4147     column2->addChild(AltClearSavedPosition());
    4148     column2->addChild(AutomaticSetWatched());
    4149     column2->addChild(ContinueEmbeddedTVPlay());
     4291    column2->addChild(ClearSavedPosition(settings));
     4292    column2->addChild(AltClearSavedPosition(settings));
     4293    column2->addChild(AutomaticSetWatched(settings));
     4294    column2->addChild(ContinueEmbeddedTVPlay(settings));
    41504295    columns->addChild(column2);
    41514296
    41524297    general1->addChild(columns);
    4153     general1->addChild(LiveTVIdleTimeout());
    4154     general1->addChild(AlwaysStreamFiles());
     4298    if (!settings)
     4299        general1->addChild(LiveTVIdleTimeout());
     4300    if (!settings)
     4301        general1->addChild(AlwaysStreamFiles());
    41554302#ifdef USING_OPENGL_VSYNC
    4156     general1->addChild(UseOpenGLVSync());
     4303    general1->addChild(UseOpenGLVSync(settings));
    41574304#endif // USING_OPENGL_VSYNC
    41584305#if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU)
    4159     general1->addChild(UsePicControls());
     4306    general1->addChild(UsePicControls(settings));
    41604307#endif // USING_XV
    4161     addChild(general1);
     4308    if (base)
     4309        base->addChild(general1);
     4310    else
     4311        addChild(general1);
    41624312
    41634313    VerticalConfigurationGroup* general2 =
    41644314        new VerticalConfigurationGroup(false);
    41654315    general2->setLabel(QObject::tr("General Playback") +
    41664316                      QString(" (%1/%2)").arg(++i).arg(total));
     4317    if (settings)
     4318        general2->setLabel(QObject::tr("Playback group settings for ") +
     4319                           settings->mGroupName + " - " +
     4320                           general2->getLabel());
    41674321
    41684322    HorizontalConfigurationGroup* oscan =
    41694323        new HorizontalConfigurationGroup(false, false, true, true);
     
    41714325        new VerticalConfigurationGroup(false, false, true, true);
    41724326    VerticalConfigurationGroup *ocol2 =
    41734327        new VerticalConfigurationGroup(false, false, true, true);
    4174     ocol1->addChild(VertScanPercentage());
    4175     ocol1->addChild(YScanDisplacement());
    4176     ocol2->addChild(HorizScanPercentage());
    4177     ocol2->addChild(XScanDisplacement());
     4328    ocol1->addChild(VertScanPercentage(settings));
     4329    ocol1->addChild(YScanDisplacement(settings));
     4330    ocol2->addChild(HorizScanPercentage(settings));
     4331    ocol2->addChild(XScanDisplacement(settings));
    41784332    oscan->addChild(ocol1);
    41794333    oscan->addChild(ocol2);
    41804334
    41814335    HorizontalConfigurationGroup* aspect_fill =
    41824336        new HorizontalConfigurationGroup(false, false, true, true);
    4183     aspect_fill->addChild(AspectOverride());
    4184     aspect_fill->addChild(AdjustFill());
     4337    aspect_fill->addChild(AspectOverride(settings));
     4338    aspect_fill->addChild(AdjustFill(settings));
    41854339
    41864340    general2->addChild(oscan);
    41874341    general2->addChild(aspect_fill);
    4188     general2->addChild(LetterboxingColour());
    4189     general2->addChild(PIPLocationComboBox());
    4190     general2->addChild(PlaybackExitPrompt());
    4191     general2->addChild(EndOfRecordingExitPrompt());
    4192     addChild(general2);
     4342    general2->addChild(LetterboxingColour(settings));
     4343    general2->addChild(PIPLocationComboBox(settings));
     4344    general2->addChild(PlaybackExitPrompt(settings));
     4345    general2->addChild(EndOfRecordingExitPrompt(settings));
     4346    if (base)
     4347        base->addChild(general2);
     4348    else
     4349        addChild(general2);
    41934350
    41944351    QString tmp = QString(" (%1/%2)").arg(++i).arg(total);
    4195     addChild(new PlaybackProfileConfigs(tmp));
     4352    if (base)
     4353        base->addChild(new PlaybackProfileConfigs(tmp, settings));
     4354    else
     4355        addChild(new PlaybackProfileConfigs(tmp, settings));
    41964356
     4357    if (!settings)
     4358    {
    41974359    VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false);
    41984360    pbox->setLabel(QObject::tr("View Recordings") +
    41994361                   QString(" (%1/%2)").arg(++i).arg(total));
     
    42204382    pbox3->addChild(DisplayGroupTitleSort());
    42214383    pbox3->addChild(new WatchListSettings());
    42224384    addChild(pbox3);
     4385    }
    42234386
    42244387    VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false);
    42254388    seek->setLabel(QObject::tr("Seeking") +
    42264389                   QString(" (%1/%2)").arg(++i).arg(total));
    4227     seek->addChild(SmartForward());
    4228     seek->addChild(FFRewReposTime());
    4229     seek->addChild(FFRewReverse());
    4230     seek->addChild(ExactSeeking());
    4231     addChild(seek);
     4390    if (settings)
     4391        seek->setLabel(QObject::tr("Playback group settings for ") +
     4392                       settings->mGroupName + " - " +
     4393                       seek->getLabel());
     4394    seek->addChild(SmartForward(settings));
     4395    seek->addChild(FFRewReposTime(settings));
     4396    seek->addChild(FFRewReverse(settings));
     4397    seek->addChild(ExactSeeking(settings));
     4398    if (base)
     4399        base->addChild(seek);
     4400    else
     4401        addChild(seek);
    42324402
    42334403    VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false);
    42344404    comms->setLabel(QObject::tr("Commercial Skip") +
    42354405                    QString(" (%1/%2)").arg(++i).arg(total));
    4236     comms->addChild(AutoCommercialSkip());
    4237     comms->addChild(CommRewindAmount());
    4238     comms->addChild(CommNotifyAmount());
     4406    if (settings)
     4407        comms->setLabel(QObject::tr("Playback group settings for ") +
     4408                        settings->mGroupName + " - " +
     4409                        comms->getLabel());
     4410    comms->addChild(AutoCommercialSkip(settings));
     4411    comms->addChild(CommRewindAmount(settings));
     4412    comms->addChild(CommNotifyAmount(settings));
     4413    if (!settings) // these are global settings, not host-specific
     4414    {
    42394415    comms->addChild(MaximumCommercialSkip());
    42404416    comms->addChild(MergeShortCommBreaks());
    42414417    comms->addChild(CommSkipAllBlanks());
    4242     addChild(comms);
     4418    }
     4419    if (base)
     4420        base->addChild(comms);
     4421    else
     4422        addChild(comms);
    42434423
    42444424#if CONFIG_DARWIN
    42454425    VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false);
    42464426    mac1->setLabel(QObject::tr("Mac OS X Video Settings") +
    42474427                   QString(" (%1/%2)").arg(++i).arg(total));
     4428    if (settings)
     4429        mac1->setLabel(QObject::tr("Playback group settings for ") +
     4430                       settings->mGroupName + " - " +
     4431                       mac1->getLabel());
     4432    if (!settings)
     4433    {
    42484434    mac1->addChild(MacGammaCorrect());
    42494435    mac1->addChild(MacScaleUp());
    42504436    mac1->addChild(MacFullSkip());
    4251     addChild(mac1);
     4437    }
     4438    if (base)
     4439        base->addChild(mac1);
     4440    else
     4441        addChild(mac1);
    42524442
    42534443    VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false);
    42544444    mac2->setLabel(QObject::tr("Mac OS X Video Settings") +
    42554445                   QString(" (%1/%2)").arg(++i).arg(total));
     4446    if (settings)
     4447        mac2->setLabel(QObject::tr("Playback group settings for ") +
     4448                       settings->mGroupName + " - " +
     4449                       mac2->getLabel());
     4450    if (!setings)
     4451    {
    42564452    mac2->addChild(new MacMainSettings());
    42574453    mac2->addChild(new MacFloatSettings());
    42584454
     
    42664462#endif
    42674463}
    42684464
    4269 OSDSettings::OSDSettings()
     4465OSDSettings::OSDSettings(PlaySettings *settings,
     4466                         ConfigurationWizard *base)
    42704467{
    42714468    VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false);
    42724469    osd->setLabel(QObject::tr("On-screen Display"));
     4470    if (settings)
     4471        osd->setLabel(QObject::tr("Playback group settings for ") +
     4472                      settings->mGroupName + " - " +
     4473                      osd->getLabel());
    42734474
    4274     osd->addChild(EnableMHEG());
    4275     osd->addChild(PersistentBrowseMode());
    4276     osd->addChild(BrowseAllTuners());
     4475    if (!settings)
     4476    {
     4477    osd->addChild(EnableMHEG(settings));
     4478    osd->addChild(PersistentBrowseMode(settings));
     4479    osd->addChild(BrowseAllTuners(settings));
    42774480    osd->addChild(SubtitleFont());
    4278     osd->addChild(SubtitleCodec());
    4279     osd->addChild(UDPNotifyPort());
    4280     addChild(osd);
     4481    osd->addChild(SubtitleCodec(settings));
     4482    osd->addChild(UDPNotifyPort(settings));
     4483    }
     4484    if (base)
     4485        base->addChild(osd);
     4486    else
     4487        addChild(osd);
    42814488
    42824489    VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false);
    42834490    cc->setLabel(QObject::tr("Closed Captions"));
     4491    if (settings)
     4492        cc->setLabel(QObject::tr("Playback group settings for ") +
     4493                     settings->mGroupName + " - " +
     4494                     cc->getLabel());
    42844495    //cc->addChild(DecodeVBIFormat());
    4285     cc->addChild(CCBackground());
    4286     cc->addChild(DefaultCCMode());
    4287     cc->addChild(PreferCC708());
    4288     cc->addChild(OSDCC708TextZoomPercentage());
    4289     addChild(cc);
     4496    cc->addChild(CCBackground(settings));
     4497    cc->addChild(DefaultCCMode(settings));
     4498    cc->addChild(PreferCC708(settings));
     4499    cc->addChild(OSDCC708TextZoomPercentage(settings));
     4500    if (base)
     4501        base->addChild(cc);
     4502    else
     4503        addChild(cc);
    42904504
    42914505#if CONFIG_DARWIN
    42924506    // Any Mac OS-specific OSD stuff would go here.
     
    44304644    VerticalConfigurationGroup* theme = new VerticalConfigurationGroup(false);
    44314645    theme->setLabel(QObject::tr("Theme"));
    44324646
    4433     theme->addChild(new ThemeSelector("Theme"));
     4647    theme->addChild(ThemeSelector("Theme"));
    44344648
    44354649    theme->addChild(ThemePainter());
    44364650    theme->addChild(MenuTheme());
  • programs/mythfrontend/main.cpp

     
    3434#include "globalsettings.h"
    3535#include "profilegroup.h"
    3636#include "playgroup.h"
     37#include "playsettings.h"
    3738#include "networkcontrol.h"
    3839#include "DVDRingBuffer.h"
    3940#include "scheduledrecording.h"
     
    469470        delete statusbox;
    470471}
    471472
     473ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     474{
     475    return new PlaybackSettings(settings, base);
     476}
     477
     478ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     479{
     480    return new OSDSettings(settings, base);
     481}
     482
     483ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     484{
     485    return new MainGeneralSettings(settings, base);
     486}
     487
     488static PlayGroupEditor::SettingsLookup pbgroupSetup[] = {
     489    createPlaybackSettingsForPlaybackGroup,
     490    createOSDSettingsForPlaybackGroup,
     491    createMainGeneralSettingsForPlaybackGroup
     492};
     493
    472494void TVMenuCallback(void *data, QString &selection)
    473495{
    474496    (void)data;
     
    557579    }
    558580    else if (sel == "settings playgroup")
    559581    {
    560         PlayGroupEditor editor;
     582        PlayGroupEditor editor(pbgroupSetup,
     583                               sizeof(pbgroupSetup)/sizeof(*pbgroupSetup));
    561584        editor.exec();
    562585    }
    563586    else if (sel == "settings general")
     
    749772            }
    750773        }
    751774        delete tmprbuf;
     775        pginfo->SetPlaybackGroup("Videos");
    752776    }
    753777    else if (pginfo->IsVideo())
     778    {
    754779        pos = pginfo->QueryBookmark();
     780        pginfo->SetPlaybackGroup("Videos");
     781    }
    755782
    756783    if (pos > 0)
    757784    {
  • programs/mythfrontend/globalsettings.h

     
    1313
    1414class QFileInfo;
    1515class AudioDeviceComboBox;
     16class PlaySettings;
    1617
    1718class AudioConfigSettings : public VerticalConfigurationGroup
    1819{
     
    8889class PlaybackSettings : public ConfigurationWizard
    8990{
    9091  public:
    91     PlaybackSettings();
     92    PlaybackSettings(PlaySettings *settings=NULL,
     93                     ConfigurationWizard *base=NULL);
    9294};
    9395
    9496class OSDSettings: virtual public ConfigurationWizard
    9597{
    9698  public:
    97     OSDSettings();
     99    OSDSettings(PlaySettings *settings=NULL,
     100                ConfigurationWizard *base=NULL);
    98101};
    99102
    100103class GeneralSettings : public ConfigurationWizard
     
    118121class MainGeneralSettings : public ConfigurationWizard
    119122{
    120123  public:
    121     MainGeneralSettings();
     124    MainGeneralSettings(PlaySettings *settings=NULL,
     125                        ConfigurationWizard *base=NULL);
    122126};
    123127
    124128class GeneralRecPrioritiesSettings : public ConfigurationWizard
     
    206210    Q_OBJECT
    207211
    208212  public:
    209     PlaybackProfileConfigs(const QString &str);
     213    PlaybackProfileConfigs(const QString &str, PlaySettings *settings);
    210214    virtual ~PlaybackProfileConfigs();
    211215
    212216  private:
     
    218222
    219223  private:
    220224    QStringList   profiles;
    221     HostComboBox *grouptrigger;
     225    ComboBoxSetting *grouptrigger;
    222226};
    223227
    224228#endif
  • programs/mythavtest/main.cpp

     
    2020#include "compat.h"
    2121#include "mythuihelper.h"
    2222#include "dbcheck.h"
     23#include "playsettings.h"
    2324
    2425static void *run_priv_thread(void *data)
    2526{
     
    186187
    187188    GetMythUI()->LoadQtConfig();
    188189
    189 #if defined(Q_OS_MACX)
    190     // Mac OS X doesn't define the AudioOutputDevice setting
    191 #else
    192     QString auddevice = gCoreContext->GetSetting("AudioOutputDevice");
    193     if (auddevice.isEmpty())
    194     {
    195         VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "
    196                 "to run 'mythfrontend', not 'mythtv'.");
    197         return TV_EXIT_NO_AUDIO;
    198     }
    199 #endif
    200 
    201190    MythMainWindow *mainWindow = GetMythMainWindow();
    202191    mainWindow->Init();
    203192
     
    210199        return GENERIC_EXIT_DB_OUTOFDATE;
    211200    }
    212201
    213     TV *tv = new TV();
     202    QString playgroup("");
     203    if (!filename.isEmpty())
     204    {
     205        ProgramInfo pg(filename);
     206        playgroup = pg.GetPlaybackGroup();
     207    }
     208    PlaySettings settings(playgroup);
     209
     210#if defined(Q_OS_MACX)
     211    // Mac OS X doesn't define the AudioOutputDevice setting
     212#else
     213    QString auddevice = settings.GetSetting("AudioOutputDevice", "");
     214    if (auddevice.isEmpty())
     215    {
     216        VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "
     217                "to run 'mythfrontend', not 'mythtv'.");
     218        return TV_EXIT_NO_AUDIO;
     219    }
     220#endif
     221
     222    TV *tv = new TV(&settings);
    214223    if (!tv->Init())
    215224    {
    216225        VERBOSE(VB_IMPORTANT, "Fatal Error: Could not initialize TV class.");