Ticket #8088: 8088_playgroups_v13.patch

File 8088_playgroups_v13.patch, 125.0 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(MythCodecID codec_id);
     23    VideoOutputVDPAU(PlaySettings *settings, MythCodecID codec_id);
    2424    ~VideoOutputVDPAU();
    2525    bool Init(int width, int height, float aspect, WId winid,
    2626              int winx, int winy, int winw, int winh, WId embedid = 0);
     
    5353                                    const QSize &video_dim);
    5454    static MythCodecID GetBestSupportedCodec(uint width, uint height,
    5555                                             uint stream_type,
    56                                              bool no_acceleration);
     56                                             bool no_acceleration,
     57                                             PlaySettings *settings);
    5758    DisplayInfo  GetDisplayInfo(void);
    5859    virtual bool IsPIPSupported(void) const { return true; }
    5960    virtual bool IsPBPSupported(void) const { return false; }
  • libs/libmythtv/NuppelVideoPlayer.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"
     
    243244      output_jmeter(NULL)
    244245{
    245246    playerThread = QThread::currentThread();
    246     // Playback (output) zoom control
    247     detect_letter_box = new DetectLetterbox(this);
    248247
    249     vbimode = VBIMode::Parse(gCoreContext->GetSetting("VbiFormat"));
    250     decode_extra_audio = gCoreContext->GetNumSetting("DecodeExtraAudio", 0);
    251     itvEnabled         = gCoreContext->GetNumSetting("EnableMHEG", 0);
    252     db_prefer708       = gCoreContext->GetNumSetting("Prefer708Captions", 1);
    253 
    254248    bzero(&tc_lastval, sizeof(tc_lastval));
    255249    bzero(&tc_wrap,    sizeof(tc_wrap));
    256250
     
    476470
    477471    if (using_null_videoout)
    478472    {
    479         videoOutput = new VideoOutputNull();
     473        videoOutput = new VideoOutputNull(GetPlaySettings());
    480474        if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(),
    481475                               video_aspect, 0, 0, 0, 0, 0, 0))
    482476        {
     
    526520                pipState,
    527521                video_disp_dim, video_aspect,
    528522                widget->winId(), display_rect, (video_frame_rate * play_speed),
    529                 0 /*embedid*/);
     523                0 /*embedid*/, GetPlaySettings());
    530524        }
    531525
    532526        if (!videoOutput)
     
    609603
    610604void NuppelVideoPlayer::ReinitVideo(void)
    611605{
    612     if (!videoOutput->IsPreferredRenderer(video_disp_dim))
     606    if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings()))
    613607    {
    614608        VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer."));
    615609        SetErrored(QObject::tr("Need to switch video renderer."));
     
    19341928        }
    19351929#endif // USING_MHEG
    19361930
    1937         SetCaptionsEnabled(gCoreContext->GetNumSetting("DefaultCCMode"), false);
     1931        SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0),
     1932                           false);
    19381933    }
    19391934
    19401935    SetPlaying(true);
     
    19821977        m_double_process = videoOutput->IsExtraProcessingRequired();
    19831978
    19841979        videosync = VideoSync::BestMethod(
    1985             videoOutput, fr_int, rf_int, m_double_framerate);
     1980            videoOutput, GetPlaySettings(),
     1981            fr_int, rf_int, m_double_framerate);
    19861982
    19871983        // Make sure video sync can do it
    19881984        if (videosync != NULL && m_double_framerate)
     
    25282524    {
    25292525        if (jumpto == totalFrames)
    25302526        {
    2531             if (!(gCoreContext->GetNumSetting("EndOfRecordingExitPrompt") == 1
     2527            if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1
    25322528                  && !player_ctx->IsPIP() &&
    25332529                  player_ctx->GetState() == kState_WatchingPreRecorded))
    25342530            {
     
    26052601    if (bookmarkseek > 30)
    26062602    {
    26072603        DoFastForward(bookmarkseek, true, false);
    2608         if (gCoreContext->GetNumSetting("ClearSavedPosition", 1) &&
     2604        if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) &&
    26092605            !player_ctx->IsPIP())
    26102606        {
    26112607            ClearBookmark(false);
     
    27962792        return kPIP_END;
    27972793
    27982794    if (pip_players.isEmpty())
    2799         return (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft);
     2795        return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation",
     2796                                                             kPIPTopLeft);
    28002797
    28012798    // order of preference, could be stored in db if we want it configurable
    28022799    PIPLocation ols[] =
     
    33053302    exactseeks   = frame_exact_seek;
    33063303    player_ctx   = ctx;
    33073304    livetv       = ctx->tvchain;
     3305
     3306    vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", ""));
     3307
     3308    // Playback (output) zoom control
     3309    detect_letter_box = new DetectLetterbox(this);
     3310
     3311    decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0);
     3312    itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0);
     3313    db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1);
    33083314}
    33093315
    33103316bool NuppelVideoPlayer::EnableEdit(void)
  • libs/libmythtv/subtitlereader.h

     
    3232
    3333    TextSubtitles* GetTextSubtitles(void) { return &m_TextSubtitles; }
    3434    bool HasTextSubtitles(void);
    35     bool LoadExternalSubtitles(const QString &videoFile);
     35    bool LoadExternalSubtitles(const QString &videoFile, PlaySettings *settings);
    3636
    3737  private:
    3838    AVSubtitles   m_AVSubtitles;
  • libs/libmythtv/videooutwindow.cpp

     
    2929
    3030#include "videooutwindow.h"
    3131#include "osd.h"
     32#include "playsettings.h"
    3233#include "NuppelVideoPlayer.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

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

     
    55#include "NuppelVideoPlayer.h"
    66#include "videoouttypes.h"
    77#include "mythcorecontext.h"
     8#include "playsettings.h"
    89
    910DetectLetterbox::DetectLetterbox(NuppelVideoPlayer* const nvp)
    1011{
    11     int dbAdjustFill = gCoreContext->GetNumSetting("AdjustFill", 0);
     12    int dbAdjustFill = nvp->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 = nvp->GetAdjustFill();
    21     detectLetterboxLimit = gCoreContext->GetNumSetting("DetectLeterboxLimit", 75);
     22    detectLetterboxLimit =
     23        nvp->GetPlaySettings()->GetNumSetting("DetectLeterboxLimit", 75);
    2224    nupple_video_player = nvp;
    2325}
    2426
  • libs/libmythtv/videoout_opengl.cpp

     
    3737    opts.priorities->insert("opengl", 65);
    3838}
    3939
    40 VideoOutputOpenGL::VideoOutputOpenGL(void)
    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

     
    6464#include "videodisplayprofile.h"
    6565#include "videoout_dvdv.h"
    6666
     67class PlaySettings;
     68
    6769#define LOC     QString("VideoOutputQuartz::")
    6870#define LOC_ERR QString("VideoOutputQuartz Error: ")
    6971
     
    11071109/** \class VideoOutputQuartz
    11081110 *  \brief Implementation of Quartz (Mac OS X windowing system) video output
    11091111 */
    1110 VideoOutputQuartz::VideoOutputQuartz(
     1112VideoOutputQuartz::VideoOutputQuartz(PlaySettings *settings
    11111113    MythCodecID _myth_codec_id, void *codec_priv) :
    1112     VideoOutput(), Started(false), data(new QuartzData()),
     1114    VideoOutput(settings), Started(false), data(new QuartzData()),
    11131115    myth_codec_id(_myth_codec_id)
    11141116{
    11151117    init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0);
     
    18171819MythCodecID VideoOutputQuartz::GetBestSupportedCodec(
    18181820    uint width, uint height,
    18191821    uint osd_width, uint osd_height,
    1820     uint stream_type, uint fourcc)
     1822    uint stream_type, uint fourcc, PlaySettings *settings)
    18211823{
    18221824    (void) osd_width;
    18231825    (void) osd_height;
    18241826
    1825     VideoDisplayProfile vdp;
     1827    VideoDisplayProfile vdp(settings);
    18261828    vdp.SetInput(QSize(width, height));
    18271829    QString dec = vdp.GetDecoder();
    18281830    if ((dec == "libmpeg2") || (dec == "ffmpeg"))
  • libs/libmythtv/avformatdecoder.cpp

     
    2929#include "DVDRingBuffer.h"
    3030#include "videodisplayprofile.h"
    3131#include "mythuihelper.h"
     32#include "playsettings.h"
    3233
    3334#include "lcddevice.h"
    3435
     
    536537
    537538    cc608_build_parity_table(cc608_parity_table);
    538539
    539     if (gCoreContext->GetNumSetting("CCBackground", 0))
     540    if (GetNVP()->GetPlaySettings()->GetNumSetting("CCBackground", 0))
    540541        CC708Window::forceWhiteOnBlackText = true;
    541542
    542543    no_dts_hack = false;
     
    14381439    {
    14391440        directrendering = true;
    14401441        if (
    1441         !gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&
     1442        !GetNVP()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) &&
    14421443        !CODEC_IS_HWACCEL(codec))
    14431444    {
    14441445        SetLowBuffers(false);
     
    19181919
    19191920                if (!is_db_ignored)
    19201921                {
    1921                     VideoDisplayProfile vdp;
     1922                    VideoDisplayProfile vdp(GetNVP()->GetPlaySettings());
    19221923                    vdp.SetInput(QSize(width, height));
    19231924                    dec = vdp.GetDecoder();
    19241925                    thread_count = vdp.GetMaxCPUs();
     
    19461947                    MythCodecID vdpau_mcid;
    19471948                    vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec(
    19481949                        width, height,
    1949                         mpeg_version(enc->codec_id), no_hardware_decoders);
     1950                        mpeg_version(enc->codec_id), no_hardware_decoders,
     1951                        GetNVP()->GetPlaySettings());
    19501952
    19511953                    if (vdpau_mcid >= video_codec_id)
    19521954                    {
     
    19781980                        /* mpeg type    */ mpeg_version(enc->codec_id),
    19791981                        /* xvmc pix fmt */ xvmc_pixel_format(enc->pix_fmt),
    19801982                        /* test surface */ codec_is_std(video_codec_id),
    1981                         /* force_xv     */ force_xv);
     1983                        /* force_xv     */ force_xv,
     1984                        GetNVP()->GetPlaySettings());
    19821985
    19831986                    if (mcid >= video_codec_id)
    19841987                    {
     
    20112014                        /* osd dim      */ 0, 0,
    20122015                        /* mpeg type    */ mpeg_version(enc->codec_id),
    20132016                        /* pixel format */
    2014                         (PIX_FMT_YUV420P == enc->pix_fmt) ? FOURCC_I420 : 0);
     2017                        (PIX_FMT_YUV420P == enc->pix_fmt) ? FOURCC_I420 : 0,
     2018                        GetNVP()->GetPlaySettings());
    20152019
    20162020                    if (quartz_mcid >= video_codec_id)
    20172021                    {
  • 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
    185186    bool Init(bool createWindow = true);
     
    204205
    205206    // Recording commands
    206207    int  PlayFromRecorder(int recordernum);
    207     int  Playback(const ProgramInfo &rcinfo);
     208    int  Playback(const ProgramInfo &rcinfo, PlaySettings *settings);
    208209
    209210    // Commands used by frontend playback box
    210211    QString GetRecordingGroup(int player_idx) const;
     
    644645    static TVState RemoveRecording(TVState state);
    645646    void RestoreScreenSaver(const PlayerContext*);
    646647
    647     void InitUDPNotifyEvent(void);
     648    void InitUDPNotifyEvent(PlaySettings *settings);
    648649
    649650    // for temp debugging only..
    650651    int find_player_index(const PlayerContext*) 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

     
    35613561
    35623562            VideoDisplayProfile::CreateNewProfiles(host);
    35633563            profiles = VideoDisplayProfile::GetProfiles(host);
    3564             QString profile = VideoDisplayProfile::GetDefaultProfileName(host);
     3564            QString profile =
     3565                VideoDisplayProfile::GetDefaultProfileName(host, NULL);
    35653566
    35663567            if (profiles.contains("Normal") &&
    35673568                (profile=="CPU++" || profile=="CPU+" || profile=="CPU--"))
     
    57995800"  jump int(11) NOT NULL default '0',"
    58005801"  PRIMARY KEY  (`name`)"
    58015802");",
     5803"CREATE TABLE playgroupsettings ("
     5804"  playgroupname varchar(64) NOT NULL,"
     5805"  `value` varchar(128) NOT NULL,"
     5806"  `data` text,"
     5807"  overridden tinyint(1) NOT NULL,"
     5808"  PRIMARY KEY (playgroupname, `value`)"
     5809");",
    58025810"CREATE TABLE powerpriority ("
    58035811"  priorityname varchar(64) collate utf8_bin NOT NULL,"
    58045812"  recpriority int(10) NOT NULL default '0',"
  • libs/libmythtv/videoout_vdpau.cpp

     
    4848    opts.deints->insert("vdpau", deints);
    4949}
    5050
    51 VideoOutputVDPAU::VideoOutputVDPAU(MythCodecID codec_id)
    52   : VideoOutput(),
     51VideoOutputVDPAU::VideoOutputVDPAU(PlaySettings *settings, MythCodecID codec_id)
     52  : VideoOutput(settings),
    5353    m_codec_id(codec_id),    m_win(0),         m_render(NULL),
    5454    m_buffer_size(NUM_VDPAU_BUFFERS),          m_pause_surface(0),
    5555    m_need_deintrefs(false), m_video_mixer(0), m_mixer_features(kVDPFeatNone),
     
    870870
    871871MythCodecID VideoOutputVDPAU::GetBestSupportedCodec(
    872872    uint width,       uint height,
    873     uint stream_type, bool no_acceleration)
     873    uint stream_type, bool no_acceleration, PlaySettings *settings)
    874874{
    875875    bool use_cpu = no_acceleration;
    876     VideoDisplayProfile vdp;
     876    VideoDisplayProfile vdp(settings);
    877877    vdp.SetInput(QSize(width, height));
    878878    QString dec = vdp.GetDecoder();
    879879
  • libs/libmythtv/videoout_directfb.cpp

     
    274274    opts.priorities->insert("directfb", 60);
    275275}
    276276
    277 VideoOutputDirectfb::VideoOutputDirectfb(void)
    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/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

     
    1717#include "storagegroup.h"
    1818#include "mythcorecontext.h"
    1919#include "videometadatautil.h"
     20#include "DetectLetterbox.h"
     21#include "playsettings.h"
    2022
    2123#define LOC QString("playCtx: ")
    2224#define LOC_ERR QString("playCtx, Error: ")
     
    404406                              WId embedwinid, const QRect *embedbounds,
    405407                              bool muted)
    406408{
    407     int exact_seeking = gCoreContext->GetNumSetting("ExactSeeking", 0);
     409    int exact_seeking = settings->GetNumSetting("ExactSeeking", 0);
    408410
    409411    if (HasNVP())
    410412    {
     
    447449    {
    448450        QString subfn = buffer->GetSubtitleFilename();
    449451        if (!subfn.isEmpty() && _nvp->GetSubReader())
    450             _nvp->GetSubReader()->LoadExternalSubtitles(subfn);
     452            _nvp->GetSubReader()->LoadExternalSubtitles(subfn, settings);
    451453    }
    452454
    453455    if ((embedwinid > 0) && embedbounds)
     
    888890/**
    889891 * \brief assign programinfo to the context
    890892 */
    891 void PlayerContext::SetPlayingInfo(const ProgramInfo *info)
     893void PlayerContext::SetPlayingInfo(const ProgramInfo *info,
     894                                   PlaySettings *_settings)
    892895{
    893896    bool ignoreDB = gCoreContext->IsDatabaseIgnored();
    894897
     
    900903            playingInfo->MarkAsInUse(false, recUsage);
    901904        delete playingInfo;
    902905        playingInfo = NULL;
     906        // XXX delete settings?
    903907    }
    904908
    905909    if (info)
     
    908912        if (!ignoreDB)
    909913            playingInfo->MarkAsInUse(true, recUsage);
    910914        playingLen = playingInfo->GetSecondsInRecording();
     915        settings = (_settings ? _settings :
     916                    new PlaySettings(playingInfo->GetPlaybackGroup()));
    911917    }
    912918}
    913919
  • libs/libmythtv/NuppelVideoPlayer.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/subtitlereader.cpp

     
    5050    m_AVSubtitles.lock.unlock();
    5151}
    5252
    53 bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName)
     53bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName,
     54                                           PlaySettings *settings)
    5455{
    5556    m_TextSubtitles.Clear();
    56     return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles);
     57    return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles,
     58                                             settings);
    5759}
    5860
    5961bool 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{
    8486    VideoSync *trial = NULL;
    8587    tryingVideoSync  = true;
    86     bool tryOpenGL   = (gCoreContext->GetNumSetting("UseOpenGLVSync", 1) &&
     88    bool tryOpenGL   = (settings->GetNumSetting("UseOpenGLVSync", 1) &&
    8789                        (getenv("NO_OPENGL_VSYNC") == NULL));
    8890
    8991    // m_forceskip allows for skipping one sync method
  • libs/libmythtv/tv_play.cpp

     
    5959#include "mythsystemevent.h"
    6060#include "videometadatautil.h"
    6161#include "mythdialogbox.h"
     62#include "playsettings.h"
    6263
    6364#if ! HAVE_ROUND
    6465#define round(x) ((int) ((x) + 0.5))
     
    209210    bool startInGuide = flags & kStartTVInGuide;
    210211    bool inPlaylist = flags & kStartTVInPlayList;
    211212    bool initByNetworkCommand = flags & kStartTVByNetworkCommand;
    212     TV *tv = new TV();
    213213    bool quitAll = false;
    214214    bool showDialogs = true;
    215215    bool playCompleted = false;
     
    223223        curProgram->SetIgnoreBookmark(flags & kStartTVIgnoreBookmark);
    224224    }
    225225
     226    PlaySettings settings(curProgram ? curProgram->GetPlaybackGroup() : "Default");
     227    TV *tv = new TV(&settings);
     228
    226229    // Initialize TV
    227230    if (!tv->Init())
    228231    {
     
    253256        if (curProgram)
    254257        {
    255258            VERBOSE(VB_PLAYBACK, LOC + "tv->Playback() -- begin");
    256             if (!tv->Playback(*curProgram))
     259            if (!tv->Playback(*curProgram, &settings))
    257260            {
    258261                quitAll = true;
    259262            }
     
    838841 *  \brief Performs instance initialiation not requiring access to database.
    839842 *  \sa Init(void)
    840843 */
    841 TV::TV(void)
     844TV::TV(PlaySettings *settings)
    842845    : // Configuration variables from database
    843846      baseFilters(""),
    844847      db_channel_format("<num> <sign>"),
     
    974977        kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]);
    975978
    976979    MythDB::getMythDB()->GetSettings(kv);
     980    settings->AddToMap(kv);
    977981
    978982    // convert from minutes to ms.
    979983    db_idle_timeout        = kv["LiveTVIdleTimeout"].toInt() * 60 * 1000;
     
    17111715    askAllowLock.unlock();
    17121716}
    17131717
    1714 int TV::Playback(const ProgramInfo &rcinfo)
     1718int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings)
    17151719{
    17161720    wantsToQuit   = false;
    17171721    jumpToProgram = false;
     
    17251729        return 0;
    17261730    }
    17271731
    1728     mctx->SetPlayingInfo(&rcinfo);
     1732    mctx->SetPlayingInfo(&rcinfo, settings);
    17291733    mctx->SetInitialTVState(false);
    17301734    ScheduleStateChange(mctx);
    17311735
     
    18081812
    18091813    if (fileexists)
    18101814    {
    1811         Playback(pginfo);
     1815        PlaySettings settings("Default");
     1816        Playback(pginfo, &settings);
    18121817        retval = 1;
    18131818    }
    18141819
     
    21392144            QString msg = tr("%1 Settings")
    21402145                    .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup()));
    21412146            ctx->UnlockPlayingInfo(__FILE__, __LINE__);
    2142             if (count > 0)
     2147            if (count > 0 &&
     2148                ctx->playingInfo->GetPlaybackGroup() != "Default" &&
     2149                ctx->playingInfo->GetPlaybackGroup() != "Videos")
    21432150                SetOSDMessage(ctx, msg);
    21442151            ITVRestart(ctx, false);
    21452152        }
     
    48804887        return false;
    48814888    }
    48824889
    4883     InitUDPNotifyEvent();
     4890    InitUDPNotifyEvent(ctx->settings);
    48844891    bool ok = false;
    48854892    if (ctx->IsNullVideoDesired())
    48864893    {
     
    1171511722        GetMythUI()->RestoreScreensaver();
    1171611723}
    1171711724
    11718 void TV::InitUDPNotifyEvent(void)
     11725void TV::InitUDPNotifyEvent(PlaySettings *settings)
    1171911726{
    1172011727    if (db_udpnotify_port && !udpnotify)
    1172111728    {
    11722         udpnotify = new UDPNotify(db_udpnotify_port);
     11729        udpnotify = new UDPNotify(db_udpnotify_port, settings);
    1172311730        connect(udpnotify,
    1172411731                SIGNAL(AddUDPNotifyEvent(
    1172511732                        const QString&,const UDPNotifyOSDSet*)),
  • 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(void) :
    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 "NuppelVideoPlayer.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 Q_OS_MACX
    194196        if (osxlist.contains(renderer))
    195             vo = new VideoOutputQuartz(codec_id, codec_priv);
     197            vo = new VideoOutputQuartz(settings, codec_id, codec_priv);
    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(codec_id);
     207            vo = new VideoOutputVDPAU(settings, codec_id);
    206208#endif // USING_VDPAU
    207209
    208210#ifdef USING_XV
    209211        if (xvlist.contains(renderer))
    210             vo = new VideoOutputXv(codec_id);
     212            vo = new VideoOutputXv(settings, codec_id);
    211213#endif // USING_XV
    212214
    213215        if (vo)
     
    304306 * \brief This constructor for VideoOutput must be followed by an
    305307 *        Init(int,int,float,WId,int,int,int,int,WId) call.
    306308 */
    307 VideoOutput::VideoOutput() :
     309VideoOutput::VideoOutput(PlaySettings *_settings) :
    308310    // DB Settings
    309311    db_display_dim(0,0),
    310312    db_aspectoverride(kAspect_Off),     db_adjustfill(kAdjustFill_Off),
     
    341343    monitor_sz(640,480),                monitor_dim(400,300),
    342344
    343345    // OSD
    344     osd_painter(NULL),                  osd_image(NULL)
     346    osd_painter(NULL),                  osd_image(NULL),
     347    settings(_settings)
    345348
    346349{
    347350    bzero(&pip_tmp_image, sizeof(pip_tmp_image));
    348     db_display_dim = QSize(gCoreContext->GetNumSetting("DisplaySizeWidth",  0),
    349                            gCoreContext->GetNumSetting("DisplaySizeHeight", 0));
     351    db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth",  0),
     352                           settings->GetNumSetting("DisplaySizeHeight", 0));
    350353
    351354    db_pict_attr[kPictureAttribute_Brightness] =
    352         gCoreContext->GetNumSetting("PlaybackBrightness", 50);
     355        settings->GetNumSetting("PlaybackBrightness", 50);
    353356    db_pict_attr[kPictureAttribute_Contrast] =
    354         gCoreContext->GetNumSetting("PlaybackContrast",   50);
     357        settings->GetNumSetting("PlaybackContrast",   50);
    355358    db_pict_attr[kPictureAttribute_Colour] =
    356         gCoreContext->GetNumSetting("PlaybackColour",     50);
     359        settings->GetNumSetting("PlaybackColour",     50);
    357360    db_pict_attr[kPictureAttribute_Hue] =
    358         gCoreContext->GetNumSetting("PlaybackHue",         0);
     361        settings->GetNumSetting("PlaybackHue",         0);
    359362
    360363    db_aspectoverride = (AspectOverrideMode)
    361         gCoreContext->GetNumSetting("AspectOverride",      0);
     364        settings->GetNumSetting("AspectOverride",      0);
    362365    db_adjustfill = (AdjustFillMode)
    363         gCoreContext->GetNumSetting("AdjustFill",          0);
     366        settings->GetNumSetting("AdjustFill",          0);
    364367    db_letterbox_colour = (LetterBoxColour)
    365         gCoreContext->GetNumSetting("LetterboxColour",     0);
     368        settings->GetNumSetting("LetterboxColour",     0);
    366369    db_use_picture_controls =
    367         gCoreContext->GetNumSetting("UseOutputPictureControls", 0);
     370        settings->GetNumSetting("UseOutputPictureControls", 0);
    368371
    369372    if (!gCoreContext->IsDatabaseIgnored())
    370         db_vdisp_profile = new VideoDisplayProfile();
     373        db_vdisp_profile = new VideoDisplayProfile(settings);
    371374
    372     windows.push_back(VideoOutWindow());
     375    windows.push_back(VideoOutWindow(settings));
    373376}
    374377
    375378/**
     
    443446    return QString::null;
    444447}
    445448
    446 bool VideoOutput::IsPreferredRenderer(QSize video_size)
     449bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings)
    447450{
    448451    if (!db_vdisp_profile || (video_size == windows[0].GetVideoDispDim()))
    449452        return true;
    450453
    451     VideoDisplayProfile vdisp;
     454    VideoDisplayProfile vdisp(settings);
    452455    vdisp.SetInput(video_size);
    453456    QString new_rend = vdisp.GetVideoRenderer();
    454457    if (new_rend.isEmpty())
  • libs/libmythtv/videooutwindow.h

     
    1616#include "videoouttypes.h"
    1717
    1818class NuppelVideoPlayer;
     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; }
     
    168169    LiveTVChain        *tvchain;
    169170    RingBuffer         *buffer;
    170171    ProgramInfo        *playingInfo; ///< Currently playing info
     172    PlaySettings       *settings; // corresponding to playingInfo
    171173    long long           playingLen;  ///< Initial CalculateLength()
    172174    bool                nohardwaredecoders; // < Disable use of VDPAU decoding
    173175    int                 last_cardid; ///< CardID of current/last recorder
  • libs/libmythtv/vsync.h

     
    101101
    102102    // documented in vsync.cpp
    103103    static VideoSync *BestMethod(VideoOutput*,
     104                                 PlaySettings *settings,
    104105                                 uint frame_interval, uint refresh_interval,
    105106                                 bool interlaced);
    106107  protected:
  • libs/libmythtv/videoout_xv.h

     
    5151    friend class XvMCOSD;
    5252  public:
    5353    static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
    54     VideoOutputXv(MythCodecID av_codec_id);
     54    VideoOutputXv(PlaySettings *settings, MythCodecID av_codec_id);
    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(MythCodecID codec_id)
    169     : VideoOutput(),
     168VideoOutputXv::VideoOutputXv(PlaySettings *settings, MythCodecID codec_id)
     169    : VideoOutput(settings),
    170170      myth_codec_id(codec_id), video_output_subtype(XVUnknown),
    171171      global_lock(QMutex::Recursive),
    172172
     
    404404 * \return port number if it succeeds, else -1.
    405405 */
    406406int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root,
     407                                      PlaySettings *settings,
    407408                                      MythCodecID mcodecid,
    408409                                      uint width, uint height,
    409410                                      bool &xvsetdefaults,
     
    488489    }
    489490
    490491    // figure out if we want chromakeying..
    491     VideoDisplayProfile vdp;
     492    VideoDisplayProfile vdp(settings);
    492493    vdp.SetInput(QSize(width, height));
    493494    bool check_for_colorkey = (vdp.GetOSDRenderer() == "chromakey");
    494495
     
    781782    disp->StartLog();
    782783    QString adaptor_name = QString::null;
    783784    const QSize video_dim = windows[0].GetVideoDim();
    784     xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), mcodecid,
     785    xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, mcodecid,
    785786                                 video_dim.width(), video_dim.height(),
    786787                                 xv_set_defaults,
    787788                                 xvmc_chroma, &xvmc_surf_info, &adaptor_name);
     
    860861    disp->StartLog();
    861862    QString adaptor_name = QString::null;
    862863    const QSize video_dim = windows[0].GetVideoDim();
    863     xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), kCodec_MPEG2,
     864    xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, kCodec_MPEG2,
    864865                                 video_dim.width(), video_dim.height(),
    865866                                 xv_set_defaults, 0, NULL, &adaptor_name);
    866867    if (xv_port == -1)
     
    10141015    uint width,       uint height,
    10151016    uint osd_width,   uint osd_height,
    10161017    uint stream_type, int xvmc_chroma,
    1017     bool test_surface, bool force_xv)
     1018    bool test_surface, bool force_xv,
     1019    PlaySettings *settings)
    10181020{
    10191021    (void)width, (void)height, (void)osd_width, (void)osd_height;
    10201022    (void)stream_type, (void)xvmc_chroma, (void)test_surface;
     
    10251027        return ret;
    10261028
    10271029#ifdef USING_XVMC
    1028     VideoDisplayProfile vdp;
     1030    VideoDisplayProfile vdp(settings);
    10291031    vdp.SetInput(QSize(width, height));
    10301032    QString dec = vdp.GetDecoder();
    10311033    if ((dec == "libmpeg2") || (dec == "ffmpeg"))
     
    10751077
    10761078        ok = false;
    10771079        bool dummy;
    1078         int port = GrabSuitableXvPort(disp, disp->GetRoot(), ret, width, height,
     1080        int port = GrabSuitableXvPort(disp, disp->GetRoot(), settings,
     1081                                      ret, width, height,
    10791082                                      dummy, xvmc_chroma, &info);
    10801083        if (port >= 0)
    10811084        {
  • libs/libmythtv/udpnotify.cpp

     
    3131#include "udpnotify.h"
    3232#include "mythcorecontext.h"
    3333#include "mythverbose.h"
     34#include "playsettings.h"
    3435
    3536UDPNotifyOSDSet::UDPNotifyOSDSet(const QString &name, uint timeout)
    3637    : m_name(name), m_timeout(timeout)
     
    7374
    7475/////////////////////////////////////////////////////////////////////////
    7576
    76 UDPNotify::UDPNotify(uint udp_port) :
     77UDPNotify::UDPNotify(uint udp_port, PlaySettings *settings) :
    7778    m_socket(new QUdpSocket()), m_db_osd_udpnotify_timeout(5)
    7879{
    7980    connect(m_socket, SIGNAL(readyRead()),
     
    8182
    8283    m_socket->bind(udp_port);
    8384
    84     m_db_osd_udpnotify_timeout = gCoreContext->GetNumSetting("OSDNotifyTimeout", 5);
     85    m_db_osd_udpnotify_timeout = settings->GetNumSetting("OSDNotifyTimeout", 5);
    8586}
    8687
    8788void UDPNotify::deleteLater(void)
  • libs/libmythtv/videooutbase.h

     
    3131class FilterChain;
    3232class FilterManager;
    3333class OpenGLContextGLX;
     34class PlaySettings;
    3435
    3536typedef QMap<NuppelVideoPlayer*,PIPLocation> PIPMap;
    3637
     
    5152        PIPState       pipState,
    5253        const QSize   &video_dim, float        video_aspect,
    5354        WId            win_id,    const QRect &display_rect,
    54         float video_prate,        WId          embed_id);
     55        float video_prate,        WId          embed_id,
     56        PlaySettings *settings);
    5557
    56     VideoOutput();
     58    VideoOutput(PlaySettings *settings);
    5759    virtual ~VideoOutput();
    5860
    5961    virtual bool Init(int width, int height, float aspect,
     
    6163                      int winh, WId embedid = 0);
    6264    virtual void InitOSD(OSD *osd);
    6365    virtual void SetVideoFrameRate(float);
    64     virtual bool IsPreferredRenderer(QSize video_size);
     66    virtual bool IsPreferredRenderer(QSize video_size, PlaySettings *settings);
    6567    virtual bool SetDeinterlacingEnabled(bool);
    6668    virtual bool SetupDeinterlace(bool i, const QString& ovrf="");
    6769    virtual void FallbackDeint(void);
     
    337339    // OSD painter and surface
    338340    MythYUVAPainter *osd_painter;
    339341    MythImage       *osd_image;
     342
     343    PlaySettings *settings;
    340344};
    341345
    342346#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
     
    803804    if (initialised)
    804805        return gTextSubFont;
    805806
     807    // XXX JMS: InitialiseFont() is a static method and this code is
     808    // executed only once per program execution.  Needs some attention
     809    // for PlayGroups.
    806810    QString font = gCoreContext->GetSetting("OSDCCFont");
    807811
    808812    MythFontProperties *mythfont = new MythFontProperties();
     
    829833
    830834    initialised = true;
    831835
     836    // XXX JMS: Initialise708Fonts() is a static method and this code
     837    // is executed only once per program execution.  Needs some
     838    // attention for PlayGroups.
     839
    832840    // TODO remove extra fonts from settings page
    833841    QString def = gCoreContext->GetSetting("OSDCC708DefaultFontType", "MonoSerif");
    834842    QStringList fonts;
  • libs/libmythtv/videoout_quartz.h

     
    33
    44class DVDV;
    55struct QuartzData;
     6class PlaySettings;
    67
    78#include "videooutbase.h"
    89
     
    1011{
    1112  public:
    1213    static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
    13     VideoOutputQuartz(MythCodecID av_codec_id, void *codec_priv);
     14    VideoOutputQuartz(PlaySettings *settings, MythCodecID av_codec_id,
     15                      void *codec_priv);
    1416   ~VideoOutputQuartz();
    1517
    1618    bool Init(int width, int height, float aspect, WId winid,
     
    5153    static MythCodecID GetBestSupportedCodec(
    5254        uint width, uint height,
    5355        uint osd_width, uint osd_height,
    54         uint stream_type, uint fourcc);
     56        uint stream_type, uint fourcc, PlaySettings *settings);
    5557    virtual bool NeedExtraAudioDecode(void) const
    5658        { return !codec_is_std(myth_codec_id); }
    5759
  • 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/udpnotify.h

     
    2020class QByteArray;
    2121class QUdpSocket;
    2222class QDomElement;
     23class PlaySettings;
    2324
    2425class UDPNotifyOSDSet
    2526{
     
    5455    Q_OBJECT
    5556
    5657  public:
    57     UDPNotify(uint udp_port);
     58    UDPNotify(uint udp_port, PlaySettings *settings);
    5859
    5960  signals:
    6061    void AddUDPNotifyEvent(const QString &name, const UDPNotifyOSDSet*);
  • 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        cbwidget->insertItem(label);
    739807    }
    740808
     809    if (special_formatting)
     810    {
     811        changeOnSpecial = true;
     812        specialLabel = label;
     813    }
     814
    741815    SelectSetting::addSelection(label, value, select);
    742816
    743817    if (cbwidget && isSet)
     
    9341008    BooleanSetting::setHelpText(str);
    9351009}
    9361010
     1011QWidget* TristateCheckBoxSetting::configWidget(ConfigurationGroup *cg,
     1012                                               QWidget* parent,
     1013                                               const char* widgetName) {
     1014    widget = new MythCheckBox(parent, widgetName, true);
     1015    connect(widget, SIGNAL(destroyed(QObject*)),
     1016            this,   SLOT(widgetDeleted(QObject*)));
     1017
     1018    widget->setHelpText(getHelpText());
     1019    widget->setText(getLabel());
     1020    widget->setCheckState(tristateValue());
     1021    setValue(tristateValue());
     1022
     1023    connect(widget, SIGNAL(stateChanged(int)),
     1024            this, SLOT(setValue(int)));
     1025    connect(this, SIGNAL(valueChanged(int)),
     1026            this, SLOT(relayValueChanged(int)));
     1027
     1028    if (cg)
     1029        connect(widget, SIGNAL(changeHelpText(QString)), cg,
     1030                SIGNAL(changeHelpText(QString)));
     1031
     1032    return widget;
     1033}
     1034
     1035void TristateCheckBoxSetting::widgetInvalid(QObject *obj)
     1036{
     1037    widget = (widget == obj) ? NULL : widget;
     1038}
     1039
     1040void TristateCheckBoxSetting::setEnabled(bool fEnabled)
     1041{
     1042    TristateSetting::setEnabled(fEnabled);
     1043    if (widget)
     1044        widget->setEnabled(fEnabled);
     1045}
     1046
     1047void TristateCheckBoxSetting::setHelpText(const QString &str)
     1048{
     1049    if (widget)
     1050        widget->setHelpText(str);
     1051    TristateSetting::setHelpText(str);
     1052}
     1053
     1054const char *TristateSetting::kPartiallyCheckedString = "default";
     1055
     1056void TristateCheckBoxSetting::setValue(int check)
     1057{
     1058    adjustFont(widget, (check != Qt::Checked && check != Qt::Unchecked));
     1059    TristateSetting::setValue(check);
     1060    emit valueChanged(check);
     1061}
     1062
     1063void TristateSetting::setValue(int check)
     1064{
     1065    if (check == Qt::Checked)
     1066        Setting::setValue("1");
     1067    else if (check == Qt::Unchecked)
     1068        Setting::setValue("0");
     1069    else
     1070        Setting::setValue(kPartiallyCheckedString);
     1071    emit valueChanged(check);
     1072}
     1073
    9371074void AutoIncrementDBSetting::Save(QString table)
    9381075{
    9391076    if (intValue() == 0)
     
    11211258    addSelection(label, value, select);
    11221259}
    11231260
     1261void ImageSelectSetting::addDefaultSelection(const QString label,
     1262                                             const QString value,
     1263                                             const QString defaultValue,
     1264                                             bool select)
     1265{
     1266    for (unsigned i=0; i<values.size(); i++)
     1267    {
     1268        if (values[i] == defaultValue)
     1269        {
     1270            changeOnSpecial = true;
     1271            specialLabel = label;
     1272            images.push_back(new QImage(*images[i]));
     1273            addSelection(label, value, select);
     1274            return;
     1275        }
     1276    }
     1277}
     1278
    11241279ImageSelectSetting::~ImageSelectSetting()
    11251280{
    11261281    Teardown();
     
    11431298    bxwidget   = NULL;
    11441299    imagelabel = NULL;
    11451300    combo      = NULL;
     1301    labelWidget = NULL;
    11461302}
    11471303
    11481304void ImageSelectSetting::imageSet(int num)
     
    11901346        QLabel *label = new QLabel();
    11911347        label->setText(getLabel() + ":");
    11921348        layout->addWidget(label);
     1349        labelWidget = label;
    11931350    }
    11941351
    11951352    combo = new MythComboBox(false);
     
    12361393    connect(combo, SIGNAL(highlighted(int)), this, SLOT(imageSet(int)));
    12371394    connect(combo, SIGNAL(activated(int)), this, SLOT(setValue(int)));
    12381395    connect(combo, SIGNAL(activated(int)), this, SLOT(imageSet(int)));
     1396    connect(combo, SIGNAL(highlighted(const QString &)),
     1397            this, SLOT(changeLabel(const QString &)));
     1398    connect(combo, SIGNAL(activated(const QString &)),
     1399            this, SLOT(changeLabel(const QString &)));
    12391400
    12401401    connect(this, SIGNAL(selectionsCleared()),
    12411402            combo, SLOT(clear()));
     
    12461407
    12471408    bxwidget->setLayout(layout);
    12481409
     1410    changeLabel(GetLabel(current));
     1411
    12491412    return bxwidget;
    12501413}
    12511414
     1415void ImageSelectSetting::changeLabel(const QString &newLabel)
     1416{
     1417    if (changeOnSpecial)
     1418    {
     1419        adjustFont(labelWidget, specialLabel == newLabel);
     1420        adjustFont(combo,       specialLabel == newLabel);
     1421    }
     1422}
     1423
    12521424void ImageSelectSetting::widgetInvalid(QObject *obj)
    12531425{
    12541426    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);
     
    338352public slots:
    339353    void addSelection(const QString &label,
    340354                      QString value = QString::null,
    341                       bool select = false);
     355                      bool select = false,
     356                      bool special_formatting = false);
    342357    bool removeSelection(const QString &label,
    343358                         QString value = QString::null);
     359    virtual void changeLabel(const QString &newValue);
    344360    void editTextChanged(const QString &newText);
    345361
    346362private:
    347363    bool rw;
    348364    QWidget      *bxwidget;
    349365    MythComboBox *cbwidget;
     366    bool          changeOnSpecial;
     367    QString       specialLabel;
     368    QLabel       *labelWidget;
    350369
    351370protected:
    352371    int step;
     
    415434    ImageSelectSetting(Storage *_storage) :
    416435        SelectSetting(_storage),
    417436        bxwidget(NULL), imagelabel(NULL), combo(NULL),
    418         m_hmult(1.0f), m_wmult(1.0f) { }
     437        m_hmult(1.0f), m_wmult(1.0f),
     438        changeOnSpecial(false), specialLabel(""), labelWidget(NULL) { }
    419439    virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent,
    420440                                  const char* widgetName = 0);
    421441    virtual void widgetInvalid(QObject *obj);
     
    426446                                   QImage* image,
    427447                                   QString value=QString::null,
    428448                                   bool select=false);
     449    virtual void addDefaultSelection(const QString label,
     450                                     const QString value,
     451                                     const QString defaultValue,
     452                                     bool select);
    429453
    430454protected slots:
    431455    void imageSet(int);
     456    void changeLabel(const QString &newLabel);
    432457
    433458  protected:
    434459    void Teardown(void);
     
    440465    QLabel *imagelabel;
    441466    MythComboBox *combo;
    442467    float m_hmult, m_wmult;
     468    bool          changeOnSpecial;
     469    QString       specialLabel;
     470    QLabel       *labelWidget;
    443471};
    444472
    445473class MPUBLIC BooleanSetting : public Setting
     
    480508    MythCheckBox *widget;
    481509};
    482510
     511class MPUBLIC TristateSetting : public BooleanSetting
     512{
     513    Q_OBJECT
     514
     515  public:
     516    TristateSetting(Storage *_storage) : BooleanSetting(_storage) {}
     517
     518    Qt::CheckState tristateValue(void) const {
     519        if (getValue() == "0")
     520            return Qt::Unchecked;
     521        if (getValue() == "1")
     522            return Qt::Checked;
     523        return Qt::PartiallyChecked;
     524    }
     525
     526    static const char *kPartiallyCheckedString;
     527
     528public slots:
     529    virtual void setValue(/*Qt::CheckState*/int check);
     530
     531signals:
     532    void valueChanged(int);
     533};
     534
     535class MPUBLIC TristateCheckBoxSetting: public TristateSetting {
     536    Q_OBJECT
     537
     538public:
     539    TristateCheckBoxSetting(Storage *_storage) :
     540        TristateSetting(_storage), widget(NULL) { }
     541    virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent,
     542                                  const char* widgetName = 0);
     543    virtual void widgetInvalid(QObject*);
     544
     545    virtual void setEnabled(bool b);
     546
     547    virtual void setHelpText(const QString &str);
     548
     549
     550public slots:
     551    virtual void setValue(/*Qt::CheckState*/int check);
     552    virtual void relayValueChanged(int state) {
     553        if (widget)
     554            widget->setCheckState((Qt::CheckState)state);
     555    }
     556
     557protected:
     558    MythCheckBox *widget;
     559};
     560
    483561class MPUBLIC PathSetting : public ComboBoxSetting
    484562{
    485563public:
  • 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

     
    475475                                            Configurable *target)
    476476{
    477477    VerifyLayout();
     478    bool isDuplicate = triggerMap.values().contains(target);
    478479    triggerMap[triggerValue] = target;
    479480
    480481    if (!configStack)
     
    484485        configStack->setSaveAll(isSaveAll);
    485486    }
    486487
    487     configStack->addChild(target);
     488    // Don't add a target as a child if it has already been added,
     489    // otherwise something goes wrong with signals in the child.
     490    if (!isDuplicate)
     491        configStack->addChild(target);
    488492}
    489493
    490494Setting *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

     
    4141#include "mythconfig.h"
    4242#include "mythdirs.h"
    4343#include "mythuihelper.h"
     44#include "playsettings.h"
    4445
     46#define CREATE_CHECKBOX_SETTING(var, name, settings) \
     47    BooleanSetting *var; \
     48    if ((settings)) \
     49        var = new PlaySettingsCheckBox((name), (settings)); \
     50    else \
     51        var = new HostCheckBox((name))
     52
     53#define CREATE_COMBOBOX_SETTING(var, name, settings) \
     54    ComboBoxSetting *var; \
     55    if ((settings)) \
     56        var = new PlaySettingsComboBox((name), (settings)); \
     57    else \
     58        var = new HostComboBox((name))
     59
     60#define CREATE_COMBOBOX1_SETTING(var, name, settings, arg1) \
     61    ComboBoxSetting *var; \
     62    if ((settings)) \
     63        var = new PlaySettingsComboBox((name), (settings), (arg1)); \
     64    else \
     65        var = new HostComboBox((name), (arg1))
     66
     67#define CREATE_SPINBOX_SETTING(var, name, settings, arg1, arg2, arg3, arg4) \
     68    SpinBoxSetting *var; \
     69    if ((settings)) \
     70        var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3), (arg4)); \
     71    else \
     72        var = new HostSpinBox((name), (arg1), (arg2), (arg3), (arg4))
     73
     74#define CREATE_LINEEDIT_SETTING(var, name, settings) \
     75    LineEditSetting *var; \
     76    if ((settings)) \
     77        var = new PlaySettingsLineEdit((name), (settings), ""); \
     78    else \
     79        var = new HostLineEdit((name))
     80
     81// For PlaySettings, use a SpinBox instead of a Slider so that a
     82// default value can be easily used.
     83#define CREATE_SLIDER_SETTING(var, name, settings, arg1, arg2, arg3) \
     84    BoundedIntegerSetting *var; \
     85    if ((settings)) \
     86        var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3)); \
     87    else \
     88        var = new HostSlider((name), (arg1), (arg2), (arg3))
     89
     90#define CREATE_IMAGESELECT_SETTING(var, name, settings) \
     91    ImageSelectSetting *var; \
     92    if ((settings)) \
     93        var = new PlaySettingsImageSelect((name), (settings)); \
     94    else \
     95        var = new HostImageSelect((name))
     96
     97static Setting *wrap(Setting *obj, PlaySettings *settings,
     98                     bool twoLineLabel=false)
     99{
     100    if (!settings)
     101        return obj;
     102
     103    // Get the setting name
     104    PlaySettingsCombinedStorage *storage =
     105        dynamic_cast<PlaySettingsCombinedStorage *>(obj);
     106    const QString &name = storage->getName();
     107
     108    // Get the default value and label.  The label is  different
     109    // from the value for most object types.
     110    QString defaultValue = settings->GetSetting(name, "", true);
     111    QString defaultLabel(defaultValue);
     112    if (dynamic_cast<BooleanSetting *>(obj))
     113        defaultLabel = (defaultValue == "0" || defaultValue.isEmpty() ?
     114                        QObject::tr("disabled") : QObject::tr("enabled"));
     115    if (dynamic_cast<SpinBoxSetting *>(obj) && defaultValue.isEmpty())
     116        defaultLabel = "0";
     117    ComboBoxSetting *cb = dynamic_cast<ComboBoxSetting *>(obj);
     118    if (cb)
     119    {
     120        defaultLabel = cb->GetValueLabel(defaultValue);
     121        // Add the default selection to a ComboBox
     122        cb->addSelection(QString("(") + QObject::tr("default") + ")",
     123                         storage->getDefault(),
     124                         !settings->IsOverridden(name),
     125                         true);
     126    }
     127    ImageSelectSetting *is = dynamic_cast<ImageSelectSetting *>(obj);
     128    if (is)
     129    {
     130        defaultLabel = is->GetValueLabel(defaultValue);
     131        // Add the default selection to a ImageSelect
     132        is->addDefaultSelection(QString("(") + QObject::tr("default") + ")",
     133                                storage->getDefault(),
     134                                defaultValue,
     135                                !settings->IsOverridden(name));
     136    }
     137   
     138    // Change the help text to include the default and its source.
     139    QString helpPrefix;
     140    if (dynamic_cast<LineEditSetting *>(obj))
     141        helpPrefix = QObject::tr("Leave blank to keep default value");
     142    else
     143        helpPrefix = QObject::tr("Override default value");
     144    helpPrefix += " (" + defaultLabel + ") ";
     145    QString inheritsFrom = settings->InheritsFrom(name);
     146    if (inheritsFrom.isNull())
     147        helpPrefix += QObject::tr("from global settings");
     148    else
     149        helpPrefix += QObject::tr("from group") + " " + inheritsFrom;
     150    helpPrefix += ". " + obj->getHelpText();
     151    obj->setHelpText(helpPrefix);
     152
     153    // Change the label to include the default.
     154    obj->setLabel(obj->getLabel() + (twoLineLabel ? "\n" : "") +
     155                  " (" + defaultLabel + ")");
     156
     157    return obj;
     158}
     159
    45160AudioOutputDevice::AudioOutputDevice() : HostComboBox("AudioOutputDevice", true)
    46161{
    47162    setLabel(QObject::tr("Audio output device"));
     
    336451    return gc;
    337452}
    338453
    339 static HostCheckBox *DecodeExtraAudio()
     454static Setting *DecodeExtraAudio(PlaySettings *settings)
    340455{
    341     HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");
     456    CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings);
    342457    gc->setLabel(QObject::tr("Extra audio buffering"));
    343458    gc->setValue(true);
    344459    gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing "
     
    347462                    "effect on framegrabbers (MPEG-4/RTJPEG). MythTV will "
    348463                    "keep extra audio data in its internal buffers to "
    349464                    "workaround this bug."));
    350     return gc;
     465    return wrap(gc, settings);
    351466}
    352467
    353 static HostComboBox *PIPLocationComboBox()
     468static Setting *PIPLocationComboBox(PlaySettings *settings)
    354469{
    355     HostComboBox *gc = new HostComboBox("PIPLocation");
     470    CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings);
    356471    gc->setLabel(QObject::tr("PIP video location"));
    357472    for (uint loc = 0; loc < kPIP_END; ++loc)
    358473        gc->addSelection(toString((PIPLocation) loc), QString::number(loc));
    359474    gc->setHelpText(QObject::tr("Location of PIP Video window."));
    360     return gc;
     475    return wrap(gc, settings);
    361476}
    362477
    363478static GlobalLineEdit *AllRecGroupPassword()
     
    454569    return gc;
    455570}
    456571
    457 static HostCheckBox *SmartForward()
     572static Setting *SmartForward(PlaySettings *settings)
    458573{
    459     HostCheckBox *gc = new HostCheckBox("SmartForward");
     574    CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings);
    460575    gc->setLabel(QObject::tr("Smart fast forwarding"));
    461576    gc->setValue(false);
    462577    gc->setHelpText(QObject::tr("If enabled, then immediately after "
    463578                    "rewinding, only skip forward the same amount as "
    464579                    "skipping backwards."));
    465     return gc;
     580    return wrap(gc, settings);
    466581}
    467582
    468 static HostCheckBox *ExactSeeking()
     583static Setting *ExactSeeking(PlaySettings *settings)
    469584{
    470     HostCheckBox *gc = new HostCheckBox("ExactSeeking");
     585    CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings);
    471586    gc->setLabel(QObject::tr("Seek to exact frame"));
    472587    gc->setValue(false);
    473588    gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but "
    474589                    "slower."));
    475     return gc;
     590    return wrap(gc, settings);
    476591}
    477592
    478593static GlobalComboBox *CommercialSkipMethod()
     
    490605    return bc;
    491606}
    492607
    493 static HostComboBox *AutoCommercialSkip()
     608static Setting *AutoCommercialSkip(PlaySettings *settings)
    494609{
    495     HostComboBox *gc = new HostComboBox("AutoCommercialSkip");
     610    CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings);
    496611    gc->setLabel(QObject::tr("Automatically skip commercials"));
    497612    gc->addSelection(QObject::tr("Off"), "0");
    498613    gc->addSelection(QObject::tr("Notify, but do not skip"), "2");
     
    501616                    "have been flagged during automatic commercial detection "
    502617                    "or by the mythcommflag program, or just notify that a "
    503618                    "commercial has been detected."));
    504     return gc;
     619    return wrap(gc, settings);
    505620}
    506621
    507622static GlobalCheckBox *AutoCommercialFlag()
     
    586701    return bc;
    587702}
    588703
    589 static HostSpinBox *CommRewindAmount()
     704static Setting *CommRewindAmount(PlaySettings *settings)
    590705{
    591     HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);
     706    CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false);
    592707    gs->setLabel(QObject::tr("Commercial skip automatic rewind amount"));
    593708    gs->setHelpText(QObject::tr("If set, MythTV will automatically rewind "
    594709                    "this many seconds after performing a commercial skip."));
    595710    gs->setValue(0);
    596     return gs;
     711    return wrap(gs, settings);
    597712}
    598713
    599 static HostSpinBox *CommNotifyAmount()
     714static Setting *CommNotifyAmount(PlaySettings *settings)
    600715{
    601     HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);
     716    CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false);
    602717    gs->setLabel(QObject::tr("Commercial skip notify amount"));
    603718    gs->setHelpText(QObject::tr("If set, MythTV will act like a commercial "
    604719                    "begins this many seconds early. This can be useful "
    605720                    "when commercial notification is used in place of "
    606721                    "automatic skipping."));
    607722    gs->setValue(0);
    608     return gs;
     723    return wrap(gs, settings);
    609724}
    610725
    611726static GlobalSpinBox *MaximumCommercialSkip()
     
    14071522    labels[j]->setValue(label_i);
    14081523}
    14091524
    1410 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) :
     1525PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str,
     1526                                               PlaySettings *settings) :
    14111527    TriggeredConfigurationGroup(false, true,  true, true,
    14121528                                false, false, true, true), grouptrigger(NULL)
    14131529{
    14141530    setLabel(QObject::tr("Playback Profiles") + str);
     1531    if (settings)
     1532        setLabel(QObject::tr("Playback group settings for ") +
     1533                 settings->mGroupName + " - " +
     1534                 getLabel());
    14151535
    14161536    QString host = gCoreContext->GetHostName();
    14171537    QStringList profiles = VideoDisplayProfile::GetProfiles(host);
     
    14391559        profiles = VideoDisplayProfile::GetProfiles(host);
    14401560    }
    14411561
    1442     QString profile = VideoDisplayProfile::GetDefaultProfileName(host);
     1562    QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings);
    14431563    if (!profiles.contains(profile))
    14441564    {
    14451565        profile = (profiles.contains("Normal")) ? "Normal" : profiles[0];
    14461566        VideoDisplayProfile::SetDefaultProfileName(profile, host);
    14471567    }
    14481568
    1449     grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile");
     1569    CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings);
     1570    grouptrigger = gs;
    14501571    grouptrigger->setLabel(QObject::tr("Current Video Playback Profile"));
    14511572    QStringList::const_iterator it;
    14521573    for (it = profiles.begin(); it != profiles.end(); ++it)
    14531574        grouptrigger->addSelection(ProgramInfo::i18n(*it), *it);
     1575    if (settings)
     1576    {
     1577        addChild(wrap(grouptrigger, settings));
     1578        return;
     1579    }
    14541580
    14551581    HorizontalConfigurationGroup *grp =
    14561582        new HorizontalConfigurationGroup(false, false, true, true);
     
    15831709    return gc;
    15841710}
    15851711
    1586 static HostSpinBox *FFRewReposTime()
     1712static Setting *FFRewReposTime(PlaySettings *settings)
    15871713{
    1588     HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);
     1714    CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false);
    15891715    gs->setLabel(QObject::tr("Fast forward/rewind reposition amount"));
    15901716    gs->setValue(100);
    15911717    gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind "
     
    15931719                    "resuming normal playback. This "
    15941720                    "compensates for the reaction time between seeing "
    15951721                    "where to resume playback and actually exiting seeking."));
    1596     return gs;
     1722    return wrap(gs, settings);
    15971723}
    15981724
    1599 static HostCheckBox *FFRewReverse()
     1725static Setting *FFRewReverse(PlaySettings *settings)
    16001726{
    1601     HostCheckBox *gc = new HostCheckBox("FFRewReverse");
     1727    CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings);
    16021728    gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind"));
    16031729    gc->setValue(true);
    16041730    gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key "
     
    16061732                    "vice versa. If disabled, it will decrease the "
    16071733                    "current speed or switch to play mode if "
    16081734                    "the speed can't be decreased further."));
    1609     return gc;
     1735    return wrap(gc, settings);
    16101736}
    16111737
    1612 static HostSpinBox *OSDGeneralTimeout()
     1738static Setting *OSDGeneralTimeout(PlaySettings *settings)
    16131739{
    1614     HostSpinBox *gs = new HostSpinBox("OSDGeneralTimeout", 1, 30, 1);
     1740    CREATE_SPINBOX_SETTING(gs, "OSDGeneralTimeout", settings, 1, 30, 1, false);
    16151741    gs->setLabel(QObject::tr("General OSD time-out (sec)"));
    16161742    gs->setValue(2);
    16171743    gs->setHelpText(QObject::tr("Length of time an on-screen display "
    16181744                    "window will be visible."));
    1619     return gs;
     1745    return wrap(gs, settings);
    16201746}
    16211747
    1622 static HostSpinBox *OSDProgramInfoTimeout()
     1748static Setting *OSDProgramInfoTimeout(PlaySettings *settings)
    16231749{
    1624     HostSpinBox *gs = new HostSpinBox("OSDProgramInfoTimeout", 1, 30, 1);
     1750    CREATE_SPINBOX_SETTING(gs, "OSDProgramInfoTimeout", settings,
     1751                           1, 30, 1, false);
    16251752    gs->setLabel(QObject::tr("Program info OSD time-out"));
    16261753    gs->setValue(3);
    16271754    gs->setHelpText(QObject::tr("Length of time the on-screen display "
    16281755                    "will display program information."));
    1629     return gs;
     1756    return wrap(gs, settings);
    16301757}
    16311758
    1632 static HostSpinBox *OSDNotifyTimeout()
     1759static Setting *OSDNotifyTimeout(PlaySettings *settings)
    16331760{
    1634     HostSpinBox *gs = new HostSpinBox("OSDNotifyTimeout", 1, 30, 1);
     1761    CREATE_SPINBOX_SETTING(gs, "OSDNotifyTimeout", settings, 1, 30, 1, false);
    16351762    gs->setLabel(QObject::tr("UDP notify OSD time-out"));
    16361763    gs->setValue(5);
    16371764    gs->setHelpText(QObject::tr("How many seconds an on-screen display "
    16381765                    "will be active for UDP Notify events."));
    1639     return gs;
     1766    return wrap(gs, settings);
    16401767}
    16411768
    16421769static HostSpinBox *ThemeCacheSize()
     
    16801807    return gc;
    16811808}
    16821809
    1683 static HostComboBox *OSDFont()
     1810static Setting *OSDFont(PlaySettings *settings)
    16841811{
    1685     HostComboBox *gc = new HostComboBox("OSDFont");
     1812    CREATE_COMBOBOX_SETTING(gc, "OSDFont", settings);
    16861813    gc->setLabel(QObject::tr("OSD font"));
    16871814    QDir ttf(GetFontsDir(), GetFontsNameFilter());
    16881815    gc->fillSelectionsFromDir(ttf, false);
     
    16901817    if (gc->findSelection(defaultOSDFont) > -1)
    16911818        gc->setValue(defaultOSDFont);
    16921819
    1693     return gc;
     1820    return wrap(gc, settings);
    16941821}
    16951822
    1696 static HostComboBox *OSDCCFont()
     1823static Setting *OSDCCFont(PlaySettings *settings)
    16971824{
    1698     HostComboBox *gc = new HostComboBox("OSDCCFont");
     1825    CREATE_COMBOBOX_SETTING(gc, "OSDCCFont", settings);
    16991826    gc->setLabel(QObject::tr("CC font"));
    17001827    QDir ttf(GetFontsDir(), GetFontsNameFilter());
    17011828    gc->fillSelectionsFromDir(ttf, false);
    17021829    gc->setHelpText(QObject::tr("Closed Caption font"));
    17031830
    1704     return gc;
     1831    return wrap(gc, settings);
    17051832}
    17061833
    17071834static HostComboBox __attribute__ ((unused)) *DecodeVBIFormat()
     
    17221849    return gc;
    17231850}
    17241851
    1725 static HostSpinBox *OSDCC708TextZoomPercentage(void)
     1852static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings)
    17261853{
    1727     HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5);
     1854    CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings,
     1855                           50, 200, 5, false);
    17281856    gs->setLabel(QObject::tr("Text zoom percentage"));
    17291857    gs->setValue(100);
    17301858    gs->setHelpText(QObject::tr("Use this to enlarge or shrink captions."));
    17311859
    1732     return gs;
     1860    return wrap(gs, settings);
    17331861}
    17341862
    1735 static HostComboBox *OSDCC708DefaultFontType(void)
     1863static Setting *OSDCC708DefaultFontType(PlaySettings *settings)
    17361864{
    1737     HostComboBox *hc = new HostComboBox("OSDCC708DefaultFontType");
     1865    CREATE_COMBOBOX_SETTING(hc, "OSDCC708DefaultFontType", settings);
    17381866    hc->setLabel(QObject::tr("Default caption font type"));
    17391867    hc->setHelpText(
    17401868        QObject::tr("This allows you to set which font type to use "
     
    17571885    };
    17581886    for (uint i = 0; i < 7; ++i)
    17591887        hc->addSelection(typeNames[i], types[i]);
    1760     return hc;
     1888    return wrap(hc, settings);
    17611889}
    17621890
    1763 static VerticalConfigurationGroup *OSDCC708Settings(void)
     1891static VerticalConfigurationGroup *OSDCC708Settings(PlaySettings *settings)
    17641892{
    17651893    VerticalConfigurationGroup *grp =
    17661894        new VerticalConfigurationGroup(false, true, true, true);
    17671895    grp->setLabel(QObject::tr("ATSC Caption Settings"));
     1896    if (settings)
     1897        grp->setLabel(QObject::tr("Playback group settings for ") +
     1898                      settings->mGroupName + " - " +
     1899                      grp->getLabel());
    17681900
    17691901// default text zoom 1.0
    1770     grp->addChild(OSDCC708TextZoomPercentage());
     1902    grp->addChild(OSDCC708TextZoomPercentage(settings));
    17711903
    17721904// force X lines of captions
    17731905// force caption character color
     
    17761908// force background opacity
    17771909
    17781910// set default font type
    1779     grp->addChild(OSDCC708DefaultFontType());
     1911    grp->addChild(OSDCC708DefaultFontType(settings));
    17801912
    17811913    return grp;
    17821914}
    17831915
    1784 static HostComboBox *OSDCC708Font(
     1916static Setting *OSDCC708Font(
    17851917    const QString &subtype, const QString &subtypeName,
    1786     const QString &subtypeNameForHelp)
     1918    const QString &subtypeNameForHelp, PlaySettings *settings)
    17871919{
    1788     HostComboBox *gc = new HostComboBox(
    1789         QString("OSDCC708%1Font").arg(subtype));
     1920    CREATE_COMBOBOX_SETTING(gc, QString("OSDCC708%1Font").arg(subtype),
     1921                            settings);
    17901922
    17911923    gc->setLabel(subtypeName);
    17921924    QDir ttf(GetFontsDir(), GetFontsNameFilter());
     
    17941926    gc->setHelpText(
    17951927        QObject::tr("ATSC %1 closed caption font.").arg(subtypeNameForHelp));
    17961928
    1797     return gc;
     1929    return wrap(gc, settings, (subtypeName.length() > 10));
    17981930}
    17991931
    1800 static HorizontalConfigurationGroup *OSDCC708Fonts(void)
     1932static HorizontalConfigurationGroup *OSDCC708Fonts(PlaySettings *settings)
    18011933{
    18021934    HorizontalConfigurationGroup *grpmain =
    18031935        new HorizontalConfigurationGroup(false, true, true, true);
    18041936    grpmain->setLabel(QObject::tr("ATSC Caption Fonts"));
     1937    if (settings)
     1938        grpmain->setLabel(QObject::tr("Playback group settings for ") +
     1939                          settings->mGroupName + " - " +
     1940                          grpmain->getLabel());
    18051941    VerticalConfigurationGroup *col[] =
    18061942    {
    18071943        new VerticalConfigurationGroup(false, false, true, true),
     
    18371973    for (uint j = 0; j < 7; ++j)
    18381974    {
    18391975        col[i]->addChild(OSDCC708Font(subtypes[i].arg(types[j]),
    1840                                       typeNames[j], typeNames[j]));
     1976                                      typeNames[j], typeNames[j],
     1977                                      settings));
    18411978    }
    18421979    grpmain->addChild(col[i]);
    18431980
    18441981    i = 1;
    18451982    for (uint j = 0; j < 7; ++j)
    18461983    {
    1847         col[i]->addChild(OSDCC708Font(
    1848                              subtypes[i].arg(types[j]), "",
    1849                              QObject::tr("Italic") + ' ' + typeNames[j]));
     1984        col[i]->addChild(OSDCC708Font(subtypes[i].arg(types[j]),
     1985                                      (settings ? typeNames[j] : ""),
     1986                                      QObject::tr("Italic") + ' ' + typeNames[j],
     1987                                      settings));
    18501988    }
    18511989
    18521990    grpmain->addChild(col[i]);
     
    18541992    return grpmain;
    18551993}
    18561994
    1857 static HostComboBox *SubtitleCodec()
     1995static Setting *SubtitleCodec(PlaySettings *settings)
    18581996{
    1859     HostComboBox *gc = new HostComboBox("SubtitleCodec");
     1997    CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings);
    18601998
    18611999    gc->setLabel(QObject::tr("Subtitle Codec"));
    18622000    QList<QByteArray> list = QTextCodec::availableCodecs();
     
    18662004        gc->addSelection(val, val, val.toLower() == "utf-8");
    18672005    }
    18682006
    1869     return gc;
     2007    return wrap(gc, settings);
    18702008}
    18712009
    1872 static HorizontalConfigurationGroup *ExternalSubtitleSettings()
     2010static HorizontalConfigurationGroup *ExternalSubtitleSettings(PlaySettings *settings)
    18732011{
    18742012    HorizontalConfigurationGroup *grpmain =
    18752013        new HorizontalConfigurationGroup(false, true, true, true);
    18762014
    18772015    grpmain->setLabel(QObject::tr("External subtitle settings"));
    18782016
    1879     grpmain->addChild(SubtitleCodec());
     2017    grpmain->addChild(SubtitleCodec(settings));
    18802018
    18812019    return grpmain;
    18822020}
    18832021
    1884 static HostComboBox *OSDThemeFontSizeType()
     2022static Setting *OSDThemeFontSizeType(PlaySettings *settings)
    18852023{
    1886     HostComboBox *gc = new HostComboBox("OSDThemeFontSizeType");
     2024    CREATE_COMBOBOX_SETTING(gc, "OSDThemeFontSizeType", settings);
    18872025    gc->setLabel(QObject::tr("Font size"));
    18882026    gc->addSelection(QObject::tr("default"), "default");
    18892027    gc->addSelection(QObject::tr("small"), "small");
    18902028    gc->addSelection(QObject::tr("big"), "big");
    18912029    gc->setHelpText(QObject::tr("default: TV, small: monitor, big:"));
    1892     return gc;
     2030    return wrap(gc, settings);
    18932031}
    18942032
    18952033static HostComboBox *ChannelOrdering()
     
    19012039    return gc;
    19022040}
    19032041
    1904 static HostSpinBox *VertScanPercentage()
     2042static Setting *VertScanPercentage(PlaySettings *settings)
    19052043{
    1906     HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1);
     2044    CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings,
     2045                           -100, 100, 1, false);
    19072046    gs->setLabel(QObject::tr("Vertical scaling"));
    19082047    gs->setValue(0);
    19092048    gs->setHelpText(QObject::tr(
    19102049                        "Adjust this if the image does not fill your "
    19112050                        "screen vertically. Range -100% to 100%"));
    1912     return gs;
     2051    return wrap(gs, settings);
    19132052}
    19142053
    1915 static HostSpinBox *HorizScanPercentage()
     2054static Setting *HorizScanPercentage(PlaySettings *settings)
    19162055{
    1917     HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1);
     2056    CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings,
     2057                           -100, 100, 1, false);
    19182058    gs->setLabel(QObject::tr("Horizontal scaling"));
    19192059    gs->setValue(0);
    19202060    gs->setHelpText(QObject::tr(
    19212061                        "Adjust this if the image does not fill your "
    19222062                        "screen horizontally. Range -100% to 100%"));
    1923     return gs;
     2063    return wrap(gs, settings);
    19242064};
    19252065
    1926 static HostSpinBox *XScanDisplacement()
     2066static Setting *XScanDisplacement(PlaySettings *settings)
    19272067{
    1928     HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1);
     2068    CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings,
     2069                           -50, 50, 1, false);
    19292070    gs->setLabel(QObject::tr("Scan displacement (X)"));
    19302071    gs->setValue(0);
    19312072    gs->setHelpText(QObject::tr("Adjust this to move the image horizontally."));
    1932     return gs;
     2073    return wrap(gs, settings);
    19332074}
    19342075
    1935 static HostSpinBox *YScanDisplacement()
     2076static Setting *YScanDisplacement(PlaySettings *settings)
    19362077{
    1937     HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1);
     2078    CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings,
     2079                           -50, 50, 1, false);
    19382080    gs->setLabel(QObject::tr("Scan displacement (Y)"));
    19392081    gs->setValue(0);
    19402082    gs->setHelpText(QObject::tr("Adjust this to move the image vertically."));
    1941     return gs;
     2083    return wrap(gs, settings);
    19422084};
    19432085
    19442086static HostCheckBox *AlwaysStreamFiles()
     
    19542096    return gc;
    19552097}
    19562098
    1957 static HostCheckBox *CCBackground()
     2099static Setting *CCBackground(PlaySettings *settings)
    19582100{
    1959     HostCheckBox *gc = new HostCheckBox("CCBackground");
     2101    CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings);
    19602102    gc->setLabel(QObject::tr("Black background for closed captioning"));
    19612103    gc->setValue(false);
    19622104    gc->setHelpText(QObject::tr(
    19632105                        "If enabled, captions will be displayed "
    19642106                        "as white text over a black background "
    19652107                        "for better contrast."));
    1966     return gc;
     2108    return wrap(gc, settings);
    19672109}
    19682110
    1969 static HostCheckBox *DefaultCCMode()
     2111static Setting *DefaultCCMode(PlaySettings *settings)
    19702112{
    1971     HostCheckBox *gc = new HostCheckBox("DefaultCCMode");
     2113    CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings);
    19722114    gc->setLabel(QObject::tr("Always display closed captioning or subtitles"));
    19732115    gc->setValue(false);
    19742116    gc->setHelpText(QObject::tr(
     
    19762118                        "when playing back recordings or watching "
    19772119                        "Live TV. Closed Captioning can be turned on or off "
    19782120                        "by pressing \"T\" during playback."));
    1979     return gc;
     2121    return wrap(gc, settings);
    19802122}
    19812123
    1982 static HostCheckBox *PreferCC708()
     2124static Setting *PreferCC708(PlaySettings *settings)
    19832125{
    1984     HostCheckBox *gc = new HostCheckBox("Prefer708Captions");
     2126    CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings);
    19852127    gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions"));
    19862128    gc->setValue(true);
    19872129    gc->setHelpText(
     
    19892131            "When enabled the new EIA-708 captions will be preferred over "
    19902132            "the old EIA-608 captions in ATSC streams."));
    19912133
    1992     return gc;
     2134    return wrap(gc, settings);
    19932135}
    19942136
    1995 static HostCheckBox *EnableMHEG()
     2137static Setting *EnableMHEG(PlaySettings *settings)
    19962138{
    1997     HostCheckBox *gc = new HostCheckBox("EnableMHEG");
     2139    CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings);
    19982140    gc->setLabel(QObject::tr("Enable interactive TV"));
    19992141    gc->setValue(false);
    20002142    gc->setHelpText(QObject::tr(
    20012143                        "If enabled, interactive TV applications (MHEG) will "
    20022144                        "be activated. This is used for teletext and logos for "
    20032145                        "radio and channels that are currently off-air."));
    2004     return gc;
     2146    return wrap(gc, settings);
    20052147}
    20062148
    2007 static HostCheckBox *PersistentBrowseMode()
     2149static Setting *PersistentBrowseMode(PlaySettings *settings)
    20082150{
    2009     HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");
     2151    CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings);
    20102152    gc->setLabel(QObject::tr("Always use browse mode in Live TV"));
    20112153    gc->setValue(true);
    20122154    gc->setHelpText(
    20132155        QObject::tr(
    20142156            "If enabled, browse mode will automatically be activated "
    20152157            "whenever you use channel up/down while watching Live TV."));
    2016     return gc;
     2158    return wrap(gc, settings);
    20172159}
    20182160
    2019 static HostCheckBox *BrowseAllTuners()
     2161static Setting *BrowseAllTuners(PlaySettings *settings)
    20202162{
    2021     HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");
     2163    CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings);
    20222164    gc->setLabel(QObject::tr("Browse all channels"));
    20232165    gc->setValue(false);
    20242166    gc->setHelpText(
     
    20262168            "If enabled, browse mode will shows channels on all "
    20272169            "available recording devices, instead of showing "
    20282170            "channels on just the current recorder."));
    2029     return gc;
     2171    return wrap(gc, settings);
    20302172}
    20312173
    2032 static HostCheckBox *ClearSavedPosition()
     2174static Setting *ClearSavedPosition(PlaySettings *settings)
    20332175{
    2034     HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");
     2176    CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings);
    20352177    gc->setLabel(QObject::tr("Clear bookmark on playback"));
    20362178    gc->setValue(true);
    20372179    gc->setHelpText(QObject::tr("Automatically clear the bookmark on a "
    20382180                    "recording when the recording is played back. If "
    20392181                    "disabled, you can mark the beginning with rewind "
    20402182                    "then save position."));
    2041     return gc;
     2183    return wrap(gc, settings);
    20422184}
    20432185
    2044 static HostCheckBox *AltClearSavedPosition()
     2186static Setting *AltClearSavedPosition(PlaySettings *settings)
    20452187{
    2046     HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");
     2188    CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings);
    20472189    gc->setLabel(QObject::tr("Alternate clear and save bookmark"));
    20482190    gc->setValue(true);
    20492191    gc->setHelpText(QObject::tr("During playback the SELECT key "
     
    20512193                    "Saved\" and \"Bookmark Cleared\". If disabled, the "
    20522194                    "SELECT key will save the current position for each "
    20532195                    "keypress."));
    2054     return gc;
     2196    return wrap(gc, settings);
    20552197}
    20562198
    20572199#if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU)
    2058 static HostCheckBox *UsePicControls()
     2200static Setting *UsePicControls(PlaySettings *settings)
    20592201{
    2060     HostCheckBox *gc = new HostCheckBox("UseOutputPictureControls");
     2202    CREATE_CHECKBOX_SETTING(gc, "UseOutputPictureControls", settings);
    20612203    gc->setLabel(QObject::tr("Enable picture controls"));
    20622204    gc->setValue(false);
    20632205    gc->setHelpText(
    20642206        QObject::tr(
    20652207            "If enabled, MythTV attempts to initialize picture controls "
    20662208            "(brightness, contrast, etc.) that are applied during playback."));
    2067     return gc;
     2209    return wrap(gc, settings);
    20682210}
    20692211#endif
    20702212
    2071 static HostLineEdit *UDPNotifyPort()
     2213static Setting *UDPNotifyPort(PlaySettings *settings)
    20722214{
    2073     HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");
     2215    CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings);
    20742216    ge->setLabel(QObject::tr("UDP notify port"));
    20752217    ge->setValue("6948");
    20762218    ge->setHelpText(QObject::tr("During playback, MythTV will listen for "
    20772219                    "connections from the \"mythtvosd\" or \"mythudprelay\" "
    20782220                    "programs on this port. For additional information, see "
    20792221                    "http://www.mythtv.org/wiki/MythNotify ."));
    2080     return ge;
     2222    return wrap(ge, settings);
    20812223}
    20822224
    2083 static HostComboBox *PlaybackExitPrompt()
     2225static Setting *PlaybackExitPrompt(PlaySettings *settings)
    20842226{
    2085     HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");
     2227    CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings);
    20862228    gc->setLabel(QObject::tr("Action on playback exit"));
    20872229    gc->addSelection(QObject::tr("Just exit"), "0");
    20882230    gc->addSelection(QObject::tr("Save position and exit"), "2");
     
    20932235                    "when you exit playback mode. The options available will "
    20942236                    "allow you to save your position, delete the "
    20952237                    "recording, or continue watching."));
    2096     return gc;
     2238    return wrap(gc, settings);
    20972239}
    20982240
    2099 static HostCheckBox *EndOfRecordingExitPrompt()
     2241static Setting *EndOfRecordingExitPrompt(PlaySettings *settings)
    21002242{
    2101     HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");
     2243    CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings);
    21022244    gc->setLabel(QObject::tr("Prompt at end of recording"));
    21032245    gc->setValue(false);
    21042246    gc->setHelpText(QObject::tr("If set, a menu will be displayed allowing "
    21052247                    "you to delete the recording when it has finished "
    21062248                    "playing."));
    2107     return gc;
     2249    return wrap(gc, settings);
    21082250}
    21092251
    2110 static HostCheckBox *JumpToProgramOSD()
     2252static Setting *JumpToProgramOSD(PlaySettings *settings)
    21112253{
    2112     HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");
     2254    CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings);
    21132255    gc->setLabel(QObject::tr("Jump to program OSD"));
    21142256    gc->setValue(true);
    21152257    gc->setHelpText(QObject::tr(
     
    21182260                        "'Watch Recording' screen when 'Jump to Program' "
    21192261                        "is activated. If set, the recordings are shown "
    21202262                        "in the OSD"));
    2121     return gc;
     2263    return wrap(gc, settings);
    21222264}
    21232265
    2124 static HostCheckBox *ContinueEmbeddedTVPlay()
     2266static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings)
    21252267{
    2126     HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");
     2268    CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings);
    21272269    gc->setLabel(QObject::tr("Continue playback when embedded"));
    21282270    gc->setValue(false);
    21292271    gc->setHelpText(QObject::tr(
     
    21312273                    "is embedded in the upcoming program list or recorded "
    21322274                    "list. The default is to pause the recorded show when "
    21332275                    "embedded."));
    2134     return gc;
     2276    return wrap(gc, settings);
    21352277}
    21362278
    2137 static HostCheckBox *AutomaticSetWatched()
     2279static Setting *AutomaticSetWatched(PlaySettings *settings)
    21382280{
    2139     HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");
     2281    CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings);
    21402282    gc->setLabel(QObject::tr("Automatically mark a recording as watched"));
    21412283    gc->setValue(false);
    21422284    gc->setHelpText(QObject::tr("If set, when you exit near the end of a "
     
    21442286                    "detection is not foolproof, so do not enable this "
    21452287                    "setting if you don't want an unwatched recording marked "
    21462288                    "as watched."));
    2147     return gc;
     2289    return wrap(gc, settings);
    21482290}
    21492291
    21502292static HostSpinBox *LiveTVIdleTimeout()
     
    23812523    return gc;
    23822524}
    23832525
    2384 static HostComboBox *LetterboxingColour()
     2526static Setting *LetterboxingColour(PlaySettings *settings)
    23852527{
    2386     HostComboBox *gc = new HostComboBox("LetterboxColour");
     2528    CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings);
    23872529    gc->setLabel(QObject::tr("Letterboxing color"));
    23882530    for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
    23892531        gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
     
    23932535            "letterboxing, but those with plasma screens may prefer gray "
    23942536            "to minimize burn-in.") + " " +
    23952537        QObject::tr("Currently only works with XVideo video renderer."));
    2396     return gc;
     2538    return wrap(gc, settings);
    23972539}
    23982540
    2399 static HostComboBox *AspectOverride()
     2541static Setting *AspectOverride(PlaySettings *settings)
    24002542{
    2401     HostComboBox *gc = new HostComboBox("AspectOverride");
     2543    CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings);
    24022544    gc->setLabel(QObject::tr("Video aspect override"));
    24032545    for (int m = kAspect_Off; m < kAspect_END; ++m)
    24042546        gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
     
    24062548                        "When enabled, these will override the aspect "
    24072549                        "ratio specified by any broadcaster for all "
    24082550                        "video streams."));
    2409     return gc;
     2551    return wrap(gc, settings);
    24102552}
    24112553
    2412 static HostComboBox *AdjustFill()
     2554static Setting *AdjustFill(PlaySettings *settings)
    24132555{
    2414     HostComboBox *gc = new HostComboBox("AdjustFill");
     2556    CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings);
    24152557    gc->setLabel(QObject::tr("Zoom"));
    24162558    gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff),
    24172559                     QString::number(kAdjustFill_AutoDetect_DefaultOff));
     
    24222564    gc->setHelpText(QObject::tr(
    24232565                        "When enabled, these will apply a predefined "
    24242566                        "zoom to all video playback in MythTV."));
    2425     return gc;
     2567    return wrap(gc, settings);
    24262568}
    24272569
    24282570// Theme settings
     
    28412983    return gc;
    28422984}
    28432985
    2844 ThemeSelector::ThemeSelector(QString label):
    2845     HostImageSelect(label) {
    2846 
     2986static Setting *ThemeSelector(QString label, PlaySettings *settings=NULL)
     2987{
     2988    CREATE_IMAGESELECT_SETTING(gs, label, settings);
    28472989    ThemeType themetype = THEME_UI;
    28482990
    28492991    if (label == "Theme")
    28502992    {
    28512993        themetype = THEME_UI;
    2852         setLabel(QObject::tr("UI theme"));
     2994        gs->setLabel(QObject::tr("UI theme"));
    28532995    }
    28542996    else if (label == "OSDTheme")
    28552997    {
    28562998        themetype = THEME_OSD;
    2857         setLabel(QObject::tr("OSD theme"));
     2999        gs->setLabel(QObject::tr("OSD theme"));
    28583000    }
    28593001    else if (label == "MenuTheme")
    28603002    {
    28613003        themetype = THEME_MENU;
    2862         setLabel(QObject::tr("Menu theme"));
     3004        gs->setLabel(QObject::tr("Menu theme"));
    28633005    }
    28643006
    28653007    QDir themes(GetThemesParentDir());
     
    29233065            VERBOSE(VB_IMPORTANT, QString("Problem reading theme preview image"
    29243066                                          " %1").arg(preview.filePath()));
    29253067
    2926         addImageSelection(name, previewImage, theme.fileName());
     3068        gs->addImageSelection(name, previewImage, theme.fileName());
    29273069    }
    29283070
    29293071    if (themetype & THEME_UI)
    2930         setValue(DEFAULT_UI_THEME);
     3072        gs->setValue(DEFAULT_UI_THEME);
    29313073    else if (themetype & THEME_OSD)
    2932         setValue("BlackCurves-OSD");
     3074        gs->setValue("BlackCurves-OSD");
     3075
     3076    return wrap(gs, settings);
    29333077}
    29343078
    29353079static HostComboBox *ChannelFormat()
     
    36153759    return gs;
    36163760}
    36173761
    3618 static HostCheckBox *RealtimePriority()
     3762static Setting *RealtimePriority(PlaySettings *settings)
    36193763{
    3620     HostCheckBox *gc = new HostCheckBox("RealtimePriority");
     3764    CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings);
    36213765    gc->setLabel(QObject::tr("Enable realtime priority threads"));
    36223766    gc->setHelpText(QObject::tr("When running mythfrontend with root "
    36233767                    "privileges, some threads can be given enhanced priority. "
    36243768                    "Disable this if mythfrontend freezes during video "
    36253769                    "playback."));
    36263770    gc->setValue(true);
    3627     return gc;
     3771    return wrap(gc, settings, false);
    36283772}
    36293773
    36303774static HostCheckBox *EnableMediaMon()
     
    37803924};
    37813925
    37823926#ifdef USING_OPENGL_VSYNC
    3783 static HostCheckBox *UseOpenGLVSync()
     3927static Setting *UseOpenGLVSync(PlaySettings *settings)
    37843928{
    3785     HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");
     3929    CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings);
    37863930    gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing"));
    37873931    gc->setValue(false);
    37883932    gc->setHelpText(QObject::tr(
    37893933                        "If it is supported by your hardware/drivers, "
    37903934                        "MythTV will use OpenGL vertical syncing for "
    37913935                        "video timing, reducing frame jitter."));
    3792     return gc;
     3936    return wrap(gc, settings);
    37933937}
    37943938#endif
    37953939
     
    42154359    return gc;
    42164360}
    42174361
    4218 MainGeneralSettings::MainGeneralSettings()
     4362MainGeneralSettings::MainGeneralSettings(PlaySettings *settings,
     4363                                         ConfigurationWizard *base)
    42194364{
     4365    if (!settings)
     4366    {
    42204367    DatabaseSettings::addDatabaseSettings(this);
    42214368
    42224369    VerticalConfigurationGroup *pin =
     
    42684415    remotecontrol->addChild(NetworkControlEnabled());
    42694416    remotecontrol->addChild(NetworkControlPort());
    42704417    addChild(remotecontrol);
     4418    }
    42714419}
    42724420
    4273 PlaybackSettings::PlaybackSettings()
     4421PlaybackSettings::PlaybackSettings(PlaySettings *settings,
     4422                                   ConfigurationWizard *base)
    42744423{
    42754424    uint i = 0, total = 8;
    42764425#if CONFIG_DARWIN
    42774426    total += 2;
    42784427#endif // USING_DARWIN
     4428    if (settings)
     4429        total -= 3;
    42794430
    42804431
    42814432    VerticalConfigurationGroup* general1 =
    42824433        new VerticalConfigurationGroup(false);
    42834434    general1->setLabel(QObject::tr("General Playback") +
    42844435                      QString(" (%1/%2)").arg(++i).arg(total));
     4436    if (settings)
     4437        general1->setLabel(QObject::tr("Playback group settings for ") +
     4438                           settings->mGroupName + " - " +
     4439                           general1->getLabel());
    42854440
    42864441    HorizontalConfigurationGroup *columns =
    42874442        new HorizontalConfigurationGroup(false, false, true, true);
    42884443
    42894444    VerticalConfigurationGroup *column1 =
    42904445        new VerticalConfigurationGroup(false, false, true, true);
    4291     column1->addChild(RealtimePriority());
    4292     column1->addChild(DecodeExtraAudio());
    4293     column1->addChild(JumpToProgramOSD());
     4446    if (!settings)
     4447        column1->addChild(RealtimePriority(settings));
     4448    column1->addChild(DecodeExtraAudio(settings));
     4449    column1->addChild(JumpToProgramOSD(settings));
    42944450    columns->addChild(column1);
    42954451
    42964452    VerticalConfigurationGroup *column2 =
    42974453        new VerticalConfigurationGroup(false, false, true, true);
    4298     column2->addChild(ClearSavedPosition());
    4299     column2->addChild(AltClearSavedPosition());
    4300     column2->addChild(AutomaticSetWatched());
    4301     column2->addChild(ContinueEmbeddedTVPlay());
     4454    column2->addChild(ClearSavedPosition(settings));
     4455    column2->addChild(AltClearSavedPosition(settings));
     4456    column2->addChild(AutomaticSetWatched(settings));
     4457    column2->addChild(ContinueEmbeddedTVPlay(settings));
    43024458    columns->addChild(column2);
    43034459
    43044460    general1->addChild(columns);
    4305     general1->addChild(LiveTVIdleTimeout());
    4306     general1->addChild(AlwaysStreamFiles());
     4461    if (!settings)
     4462        general1->addChild(LiveTVIdleTimeout());
     4463    if (!settings)
     4464        general1->addChild(AlwaysStreamFiles());
    43074465#ifdef USING_OPENGL_VSYNC
    4308     general1->addChild(UseOpenGLVSync());
     4466    general1->addChild(UseOpenGLVSync(settings));
    43094467#endif // USING_OPENGL_VSYNC
    43104468#if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU)
    4311     general1->addChild(UsePicControls());
     4469    general1->addChild(UsePicControls(settings));
    43124470#endif // USING_XV
    4313     addChild(general1);
     4471    if (base)
     4472        base->addChild(general1);
     4473    else
     4474        addChild(general1);
    43144475
    43154476    VerticalConfigurationGroup* general2 =
    43164477        new VerticalConfigurationGroup(false);
    43174478    general2->setLabel(QObject::tr("General Playback") +
    43184479                      QString(" (%1/%2)").arg(++i).arg(total));
     4480    if (settings)
     4481        general2->setLabel(QObject::tr("Playback group settings for ") +
     4482                           settings->mGroupName + " - " +
     4483                           general2->getLabel());
    43194484
    43204485    HorizontalConfigurationGroup* oscan =
    43214486        new HorizontalConfigurationGroup(false, false, true, true);
     
    43234488        new VerticalConfigurationGroup(false, false, true, true);
    43244489    VerticalConfigurationGroup *ocol2 =
    43254490        new VerticalConfigurationGroup(false, false, true, true);
    4326     ocol1->addChild(VertScanPercentage());
    4327     ocol1->addChild(YScanDisplacement());
    4328     ocol2->addChild(HorizScanPercentage());
    4329     ocol2->addChild(XScanDisplacement());
     4491    ocol1->addChild(VertScanPercentage(settings));
     4492    ocol1->addChild(YScanDisplacement(settings));
     4493    ocol2->addChild(HorizScanPercentage(settings));
     4494    ocol2->addChild(XScanDisplacement(settings));
    43304495    oscan->addChild(ocol1);
    43314496    oscan->addChild(ocol2);
    43324497
    43334498    HorizontalConfigurationGroup* aspect_fill =
    43344499        new HorizontalConfigurationGroup(false, false, true, true);
    4335     aspect_fill->addChild(AspectOverride());
    4336     aspect_fill->addChild(AdjustFill());
     4500    aspect_fill->addChild(AspectOverride(settings));
     4501    aspect_fill->addChild(AdjustFill(settings));
    43374502
    43384503    general2->addChild(oscan);
    43394504    general2->addChild(aspect_fill);
    4340     general2->addChild(LetterboxingColour());
    4341     general2->addChild(PIPLocationComboBox());
    4342     general2->addChild(PlaybackExitPrompt());
    4343     general2->addChild(EndOfRecordingExitPrompt());
    4344     addChild(general2);
     4505    general2->addChild(LetterboxingColour(settings));
     4506    general2->addChild(PIPLocationComboBox(settings));
     4507    general2->addChild(PlaybackExitPrompt(settings));
     4508    general2->addChild(EndOfRecordingExitPrompt(settings));
     4509    if (base)
     4510        base->addChild(general2);
     4511    else
     4512        addChild(general2);
    43454513
    43464514    QString tmp = QString(" (%1/%2)").arg(++i).arg(total);
    4347     addChild(new PlaybackProfileConfigs(tmp));
     4515    if (base)
     4516        base->addChild(new PlaybackProfileConfigs(tmp, settings));
     4517    else
     4518        addChild(new PlaybackProfileConfigs(tmp, settings));
    43484519
     4520    if (!settings)
     4521    {
    43494522    VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false);
    43504523    pbox->setLabel(QObject::tr("View Recordings") +
    43514524                   QString(" (%1/%2)").arg(++i).arg(total));
     
    43734546    pbox3->addChild(DisplayGroupTitleSort());
    43744547    pbox3->addChild(new WatchListSettings());
    43754548    addChild(pbox3);
     4549    }
    43764550
    43774551    VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false);
    43784552    seek->setLabel(QObject::tr("Seeking") +
    43794553                   QString(" (%1/%2)").arg(++i).arg(total));
    4380     seek->addChild(SmartForward());
    4381     seek->addChild(FFRewReposTime());
    4382     seek->addChild(FFRewReverse());
    4383     seek->addChild(ExactSeeking());
    4384     addChild(seek);
     4554    if (settings)
     4555        seek->setLabel(QObject::tr("Playback group settings for ") +
     4556                       settings->mGroupName + " - " +
     4557                       seek->getLabel());
     4558    seek->addChild(SmartForward(settings));
     4559    seek->addChild(FFRewReposTime(settings));
     4560    seek->addChild(FFRewReverse(settings));
     4561    seek->addChild(ExactSeeking(settings));
     4562    if (base)
     4563        base->addChild(seek);
     4564    else
     4565        addChild(seek);
    43854566
    43864567    VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false);
    43874568    comms->setLabel(QObject::tr("Commercial Skip") +
    43884569                    QString(" (%1/%2)").arg(++i).arg(total));
    4389     comms->addChild(AutoCommercialSkip());
    4390     comms->addChild(CommRewindAmount());
    4391     comms->addChild(CommNotifyAmount());
     4570    if (settings)
     4571        comms->setLabel(QObject::tr("Playback group settings for ") +
     4572                        settings->mGroupName + " - " +
     4573                        comms->getLabel());
     4574    comms->addChild(AutoCommercialSkip(settings));
     4575    comms->addChild(CommRewindAmount(settings));
     4576    comms->addChild(CommNotifyAmount(settings));
     4577    if (!settings) // these are global settings, not host-specific
     4578    {
    43924579    comms->addChild(MaximumCommercialSkip());
    43934580    comms->addChild(MergeShortCommBreaks());
    43944581    comms->addChild(CommSkipAllBlanks());
    4395     addChild(comms);
     4582    }
     4583    if (base)
     4584        base->addChild(comms);
     4585    else
     4586        addChild(comms);
    43964587
    43974588#if CONFIG_DARWIN
    43984589    VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false);
    43994590    mac1->setLabel(QObject::tr("Mac OS X Video Settings") +
    44004591                   QString(" (%1/%2)").arg(++i).arg(total));
     4592    if (settings)
     4593        mac1->setLabel(QObject::tr("Playback group settings for ") +
     4594                       settings->mGroupName + " - " +
     4595                       mac1->getLabel());
     4596    if (!settings)
     4597    {
    44014598    mac1->addChild(MacGammaCorrect());
    44024599    mac1->addChild(MacScaleUp());
    44034600    mac1->addChild(MacFullSkip());
    4404     addChild(mac1);
     4601    }
     4602    if (base)
     4603        base->addChild(mac1);
     4604    else
     4605        addChild(mac1);
    44054606
    44064607    VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false);
    44074608    mac2->setLabel(QObject::tr("Mac OS X Video Settings") +
    44084609                   QString(" (%1/%2)").arg(++i).arg(total));
     4610    if (settings)
     4611        mac2->setLabel(QObject::tr("Playback group settings for ") +
     4612                       settings->mGroupName + " - " +
     4613                       mac2->getLabel());
     4614    if (!setings)
     4615    {
    44094616    mac2->addChild(new MacMainSettings());
    44104617    mac2->addChild(new MacFloatSettings());
    44114618
     
    44144621    row->addChild(new MacDockSettings());
    44154622    row->addChild(new MacDesktopSettings());
    44164623    mac2->addChild(row);
     4624    }
    44174625
    4418     addChild(mac2);
     4626    if (base)
     4627        base->addChild(mac2);
     4628    else
     4629        addChild(mac2);
    44194630#endif
    44204631}
    44214632
    4422 OSDSettings::OSDSettings()
     4633OSDSettings::OSDSettings(PlaySettings *settings,
     4634                         ConfigurationWizard *base)
    44234635{
    44244636    VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false);
    44254637    osd->setLabel(QObject::tr("On-screen Display"));
     4638    if (settings)
     4639        osd->setLabel(QObject::tr("Playback group settings for ") +
     4640                      settings->mGroupName + " - " +
     4641                      osd->getLabel());
    44264642
    4427     osd->addChild(new ThemeSelector("OSDTheme"));
    4428     osd->addChild(OSDGeneralTimeout());
    4429     osd->addChild(OSDProgramInfoTimeout());
    4430     osd->addChild(OSDFont());
    4431     osd->addChild(OSDThemeFontSizeType());
    4432     osd->addChild(EnableMHEG());
    4433     osd->addChild(PersistentBrowseMode());
    4434     osd->addChild(BrowseAllTuners());
    4435     addChild(osd);
     4643    osd->addChild(ThemeSelector("OSDTheme", settings));
     4644    osd->addChild(OSDGeneralTimeout(settings));
     4645    osd->addChild(OSDProgramInfoTimeout(settings));
     4646    osd->addChild(OSDFont(settings));
     4647    osd->addChild(OSDThemeFontSizeType(settings));
     4648    osd->addChild(EnableMHEG(settings));
     4649    if (!settings)
     4650    {
     4651    osd->addChild(PersistentBrowseMode(settings));
     4652    osd->addChild(BrowseAllTuners(settings));
     4653    }
     4654    if (base)
     4655        base->addChild(osd);
     4656    else
     4657        addChild(osd);
    44364658
    44374659    VerticalConfigurationGroup *udp = new VerticalConfigurationGroup(false);
    44384660    udp->setLabel(QObject::tr("UDP OSD Notifications"));
    4439     udp->addChild(OSDNotifyTimeout());
    4440     udp->addChild(UDPNotifyPort());
    4441     addChild(udp);
     4661    if (settings)
     4662        udp->setLabel(QObject::tr("Playback group settings for ") +
     4663                      settings->mGroupName + " - " +
     4664                      udp->getLabel());
     4665    udp->addChild(OSDNotifyTimeout(settings));
     4666    udp->addChild(UDPNotifyPort(settings));
     4667    if (base)
     4668        base->addChild(udp);
     4669    else
     4670        addChild(udp);
    44424671
    44434672    VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false);
    44444673    cc->setLabel(QObject::tr("Analog Closed Captions"));
    4445     cc->addChild(OSDCCFont());
     4674    if (settings)
     4675        cc->setLabel(QObject::tr("Playback group settings for ") +
     4676                     settings->mGroupName + " - " +
     4677                     cc->getLabel());
     4678    cc->addChild(OSDCCFont(settings));
    44464679    //cc->addChild(DecodeVBIFormat());
    4447     cc->addChild(CCBackground());
    4448     cc->addChild(DefaultCCMode());
    4449     cc->addChild(PreferCC708());
    4450     addChild(cc);
     4680    cc->addChild(CCBackground(settings));
     4681    cc->addChild(DefaultCCMode(settings));
     4682    cc->addChild(PreferCC708(settings));
     4683    if (base)
     4684        base->addChild(cc);
     4685    else
     4686        addChild(cc);
    44514687
    4452     addChild(OSDCC708Settings());
    4453     addChild(OSDCC708Fonts());
    4454     addChild(ExternalSubtitleSettings());
     4688    if (base)
     4689    {
     4690        base->addChild(OSDCC708Settings(settings));
     4691        base->addChild(OSDCC708Fonts(settings));
     4692        base->addChild(ExternalSubtitleSettings(settings));
     4693    }
     4694    else
     4695    {
     4696        addChild(OSDCC708Settings(settings));
     4697        addChild(OSDCC708Fonts(settings));
     4698        addChild(ExternalSubtitleSettings(settings));
     4699    }
    44554700
    44564701#if CONFIG_DARWIN
    44574702    // Any Mac OS-specific OSD stuff would go here.
     
    46034848    VerticalConfigurationGroup* theme = new VerticalConfigurationGroup(false);
    46044849    theme->setLabel(QObject::tr("Theme"));
    46054850
    4606     theme->addChild(new ThemeSelector("Theme"));
     4851    theme->addChild(ThemeSelector("Theme"));
    46074852
    46084853    theme->addChild(ThemeCacheSize());
    46094854
  • 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"
     
    487488        delete statusbox;
    488489}
    489490
     491ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     492{
     493    return new PlaybackSettings(settings, base);
     494}
     495
     496ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     497{
     498    return new OSDSettings(settings, base);
     499}
     500
     501ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     502{
     503    return new MainGeneralSettings(settings, base);
     504}
     505
     506static PlayGroupEditor::SettingsLookup pbgroupSetup[] = {
     507    createPlaybackSettingsForPlaybackGroup,
     508    createOSDSettingsForPlaybackGroup,
     509    createMainGeneralSettingsForPlaybackGroup
     510};
     511
    490512void TVMenuCallback(void *data, QString &selection)
    491513{
    492514    (void)data;
     
    579601    }
    580602    else if (sel == "settings playgroup")
    581603    {
    582         PlayGroupEditor editor;
     604        PlayGroupEditor editor(pbgroupSetup,
     605                               sizeof(pbgroupSetup)/sizeof(*pbgroupSetup));
    583606        editor.exec();
    584607    }
    585608    else if (sel == "settings general")
     
    771794            }
    772795        }
    773796        delete tmprbuf;
     797        pginfo->SetPlaybackGroup("Videos");
    774798    }
    775799    else if (pginfo->IsVideo())
     800    {
    776801        pos = pginfo->QueryBookmark();
     802        pginfo->SetPlaybackGroup("Videos");
     803    }
    777804
    778805    if (pos > 0)
    779806    {
  • programs/mythfrontend/globalsettings.h

     
    99#include "videodisplayprofile.h"
    1010
    1111class QFileInfo;
     12class PlaySettings;
    1213
    1314class AudioOutputDevice : public HostComboBox
    1415{
     
    3637class PlaybackSettings : public ConfigurationWizard
    3738{
    3839  public:
    39     PlaybackSettings();
     40    PlaybackSettings(PlaySettings *settings=NULL,
     41                     ConfigurationWizard *base=NULL);
    4042};
    4143
    4244class OSDSettings: virtual public ConfigurationWizard
    4345{
    4446  public:
    45     OSDSettings();
     47    OSDSettings(PlaySettings *settings=NULL,
     48                ConfigurationWizard *base=NULL);
    4649};
    4750
    4851class GeneralSettings : public ConfigurationWizard
     
    6669class MainGeneralSettings : public ConfigurationWizard
    6770{
    6871  public:
    69     MainGeneralSettings();
     72    MainGeneralSettings(PlaySettings *settings=NULL,
     73                        ConfigurationWizard *base=NULL);
    7074};
    7175
    7276class GeneralRecPrioritiesSettings : public ConfigurationWizard
     
    154158    Q_OBJECT
    155159
    156160  public:
    157     PlaybackProfileConfigs(const QString &str);
     161    PlaybackProfileConfigs(const QString &str, PlaySettings *settings);
    158162    virtual ~PlaybackProfileConfigs();
    159163
    160164  private:
     
    166170
    167171  private:
    168172    QStringList   profiles;
    169     HostComboBox *grouptrigger;
     173    ComboBoxSetting *grouptrigger;
    170174};
    171175
    172176#endif
  • programs/mythavtest/main.cpp

     
    2222#include "dbcheck.h"
    2323#include "myththemebase.h"
    2424#include "audiopulseutil.h"
     25#include "playsettings.h"
    2526
    2627static void *run_priv_thread(void *data)
    2728{
     
    187188    if (pa_ret != GENERIC_EXIT_OK)
    188189        return pa_ret;
    189190
    190 #if defined(Q_OS_MACX)
    191     // Mac OS X doesn't define the AudioOutputDevice setting
    192 #else
    193     QString auddevice = gCoreContext->GetSetting("AudioOutputDevice");
    194     if (auddevice.isEmpty())
    195     {
    196         VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "
    197                 "to run 'mythfrontend', not 'mythtv'.");
    198         return TV_EXIT_NO_AUDIO;
    199     }
    200 #endif
    201 
    202191    MythMainWindow *mainWindow = GetMythMainWindow();
    203192    mainWindow->Init();
    204193    MythThemeBase *theme = new MythThemeBase();
     
    212201        return GENERIC_EXIT_DB_OUTOFDATE;
    213202    }
    214203
    215     TV *tv = new TV();
     204    QString playgroup("");
     205    if (!filename.isEmpty())
     206    {
     207        ProgramInfo pg(filename);
     208        playgroup = pg.GetPlaybackGroup();
     209    }
     210    PlaySettings settings(playgroup);
     211
     212#if defined(Q_OS_MACX)
     213    // Mac OS X doesn't define the AudioOutputDevice setting
     214#else
     215    QString auddevice = settings.GetSetting("AudioOutputDevice", "");
     216    if (auddevice.isEmpty())
     217    {
     218        VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "
     219                "to run 'mythfrontend', not 'mythtv'.");
     220        return TV_EXIT_NO_AUDIO;
     221    }
     222#endif
     223
     224    TV *tv = new TV(&settings);
    216225    if (!tv->Init())
    217226    {
    218227        VERBOSE(VB_IMPORTANT, "Fatal Error: Could not initialize TV class.");