Ticket #8088: 8088_playgroups_v12.patch

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

     
    1616{
    1717  public:
    1818    static void GetRenderOptions(render_opts &opts);
    19     VideoOutputVDPAU(MythCodecID codec_id);
     19    VideoOutputVDPAU(PlaySettings *settings, MythCodecID codec_id);
    2020    ~VideoOutputVDPAU();
    2121    bool Init(int width, int height, float aspect, WId winid,
    2222              int winx, int winy, int winw, int winh, WId embedid = 0);
     
    4949                                    const QSize &video_dim);
    5050    static MythCodecID GetBestSupportedCodec(uint width, uint height,
    5151                                             uint stream_type,
    52                                              bool no_acceleration);
     52                                             bool no_acceleration,
     53                                             PlaySettings *settings);
    5354    DisplayInfo  GetDisplayInfo(void);
    5455    virtual bool IsPIPSupported(void) const { return true; }
    5556    virtual bool IsPBPSupported(void) const { return false; }
  • libs/libmythtv/NuppelVideoPlayer.cpp

     
    6262#include "mythverbose.h"
    6363#include "myth_imgconvert.h"
    6464#include "mythsystemevent.h"
     65#include "playsettings.h"
    6566
    6667extern "C" {
    6768#include "vbitext/vbi.h"
     
    227228      // Debugging variables
    228229      output_jmeter(NULL)
    229230{
    230 
    231     // Playback (output) zoom control
    232     detect_letter_box = new DetectLetterbox(this);
    233 
    234     vbimode = VBIMode::Parse(gCoreContext->GetSetting("VbiFormat"));
    235 
    236     commrewindamount = gCoreContext->GetNumSetting("CommRewindAmount",0);
    237     commnotifyamount = gCoreContext->GetNumSetting("CommNotifyAmount",0);
    238     decode_extra_audio=gCoreContext->GetNumSetting("DecodeExtraAudio", 0);
    239     itvEnabled       = gCoreContext->GetNumSetting("EnableMHEG", 0);
    240     db_prefer708     = gCoreContext->GetNumSetting("Prefer708Captions", 1);
    241     autocommercialskip = (CommSkipMode)
    242         gCoreContext->GetNumSetting("AutoCommercialSkip", kCommSkipOff);
    243 
    244231    lastIgnoredManualSkip = QDateTime::currentDateTime().addSecs(-10);
    245232
    246233    bzero(&txtbuffers, sizeof(txtbuffers));
     
    691678
    692679    if (using_null_videoout)
    693680    {
    694         videoOutput = new VideoOutputNull();
     681        videoOutput = new VideoOutputNull(GetPlaySettings());
    695682        if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(),
    696683                               video_aspect, 0, 0, 0, 0, 0, 0))
    697684        {
     
    739726            pipState,
    740727            video_disp_dim, video_aspect,
    741728            widget->winId(), display_rect, (video_frame_rate * play_speed),
    742             0 /*embedid*/);
     729            0 /*embedid*/, GetPlaySettings());
    743730
    744731        if (!videoOutput)
    745732        {
     
    761748        videoOutput->EmbedInWidget(embx, emby, embw, embh);
    762749    }
    763750
    764     SetCaptionsEnabled(gCoreContext->GetNumSetting("DefaultCCMode"), false);
     751    SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0),
     752                       false);
    765753
    766754    InitFilters();
    767755
     
    812800
    813801void NuppelVideoPlayer::ReinitVideo(void)
    814802{
    815     if (!videoOutput->IsPreferredRenderer(video_disp_dim))
     803    if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings()))
    816804    {
    817805        VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer."));
    818806        SetErrored(QObject::tr("Need to switch video renderer."));
     
    29572945        m_double_process = videoOutput->IsExtraProcessingRequired();
    29582946
    29592947        videosync = VideoSync::BestMethod(
    2960             videoOutput, fr_int, rf_int, m_double_framerate);
     2948            videoOutput, GetPlaySettings(),
     2949            fr_int, rf_int, m_double_framerate);
    29612950
    29622951        // Make sure video sync can do it
    29632952        if (videosync != NULL && m_double_framerate)
     
    34413430        QRect visible, total;
    34423431        float aspect, scaling;
    34433432
    3444         osd = new OSD();
     3433        osd = new OSD(GetPlaySettings());
    34453434
    34463435        osd->SetListener(m_tv);
    34473436
     
    35203509
    35213510        GetDecoder()->setExactSeeks(seeks);
    35223511
    3523         if (gCoreContext->GetNumSetting("ClearSavedPosition", 1) &&
     3512        if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) &&
    35243513            !player_ctx->IsPIP())
    35253514        {
    35263515            if (player_ctx->buffer->isDVD())
     
    37883777            ++deleteIter;
    37893778            if (deleteIter.key() == totalFrames)
    37903779            {
    3791                 if (!(gCoreContext->GetNumSetting("EndOfRecordingExitPrompt") == 1
     3780                if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1
    37923781                      && !player_ctx->IsPIP() &&
    37933782                      player_ctx->GetState() == kState_WatchingPreRecorded))
    37943783                {
     
    39623951
    39633952    if (sim_pip_players.isEmpty())
    39643953    {
    3965         return (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft);
     3954        return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation",
     3955                                                             kPIPTopLeft);
    39663956    }
    39673957
    39683958    // order of preference, could be stored in db if we want it configurable
     
    47264716    exactseeks   = frame_exact_seek;
    47274717    player_ctx   = ctx;
    47284718    livetv       = ctx->tvchain;
     4719
     4720    vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", ""));
     4721
     4722    // Playback (output) zoom control
     4723    detect_letter_box = new DetectLetterbox(this);
     4724
     4725    commrewindamount = GetPlaySettings()->GetNumSetting("CommRewindAmount", 0);
     4726    commnotifyamount = GetPlaySettings()->GetNumSetting("CommNotifyAmount", 0);
     4727    decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0);
     4728    itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0);
     4729    db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1);
     4730    autocommercialskip = (CommSkipMode)
     4731        GetPlaySettings()->GetNumSetting("AutoCommercialSkip", kCommSkipOff);
    47294732}
    47304733
    47314734void NuppelVideoPlayer::SetDeleteIter(void)
     
    73977400{
    73987401    QMutexLocker locker(&subtitleLock);
    73997402    textSubtitles.Clear();
    7400     return TextSubtitleParser::LoadSubtitles(subtitleFileName, textSubtitles);
     7403    return TextSubtitleParser::LoadSubtitles(subtitleFileName, textSubtitles,
     7404                                             GetPlaySettings());
    74017405}
    74027406
    74037407void NuppelVideoPlayer::ChangeDVDTrack(bool ffw)
  • libs/libmythtv/videooutwindow.cpp

     
    3030#include "videooutwindow.h"
    3131#include "osd.h"
    3232#include "osdsurface.h"
     33#include "playsettings.h"
    3334#include "NuppelVideoPlayer.h"
    3435#include "videodisplayprofile.h"
    3536#include "decoderbase.h"
     
    5455const float VideoOutWindow::kManualZoomMinVerticalZoom   = 0.5f;
    5556const int   VideoOutWindow::kManualZoomMaxMove           = 50;
    5657
    57 VideoOutWindow::VideoOutWindow() :
     58VideoOutWindow::VideoOutWindow(PlaySettings *_settings) :
    5859    // DB settings
    5960    db_move(0, 0), db_scale_horiz(0.0f), db_scale_vert(0.0f),
    6061    db_pip_size(26),
     
    8586
    8687    // Various state variables
    8788    embedding(false), needrepaint(false),
    88     allowpreviewepg(true), pip_state(kPIPOff)
     89    allowpreviewepg(true), pip_state(kPIPOff),
     90
     91    settings(_settings)
    8992{
    9093    db_pip_size = gCoreContext->GetNumSetting("PIPSize", 26);
    9194
    92     db_move = QPoint(gCoreContext->GetNumSetting("xScanDisplacement", 0),
    93                      gCoreContext->GetNumSetting("yScanDisplacement", 0));
     95    db_move = QPoint(settings->GetNumSetting("xScanDisplacement", 0),
     96                     settings->GetNumSetting("yScanDisplacement", 0));
    9497    db_use_gui_size = gCoreContext->GetNumSetting("GuiSizeForTV", 0);
    9598
    9699    QDesktopWidget *desktop = NULL;
     
    613616    if (change)
    614617    {
    615618        db_scale_vert =
    616             gCoreContext->GetNumSetting("VertScanPercentage", 0) * 0.01f;
     619            settings->GetNumSetting("VertScanPercentage", 0) * 0.01f;
    617620        db_scale_horiz =
    618             gCoreContext->GetNumSetting("HorizScanPercentage", 0) * 0.01f;
     621            settings->GetNumSetting("HorizScanPercentage", 0) * 0.01f;
    619622        db_scaling_allowed = true;
    620623    }
    621624    else
  • libs/libmythtv/videoout_d3d.cpp

     
    948948    opts.priorities->insert("direct3d", 55);
    949949}
    950950
    951 VideoOutputD3D::VideoOutputD3D(void)
    952   : VideoOutput(),         m_lock(QMutex::Recursive),
     951VideoOutputD3D::VideoOutputD3D(PlaySettings *settings)
     952  : VideoOutput(settings),         m_lock(QMutex::Recursive),
    953953    m_hWnd(NULL),          m_ctx(NULL),
    954954    m_video(NULL),         m_osd(NULL),
    955955    m_d3d_osd(false),      m_osd_ready(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

     
    3838    opts.priorities->insert("opengl", 65);
    3939}
    4040
    41 VideoOutputOpenGL::VideoOutputOpenGL(void)
    42     : VideoOutput(),
     41VideoOutputOpenGL::VideoOutputOpenGL(PlaySettings *settings)
     42    : VideoOutput(settings),
    4343    gl_context_lock(QMutex::Recursive),
    4444    gl_context(NULL), gl_videochain(NULL),
    4545    gl_osdchain(NULL), gl_pipchain_active(NULL),
  • libs/libmythtv/videoout_quartz.cpp

     
    6565#include "videodisplayprofile.h"
    6666#include "videoout_dvdv.h"
    6767
     68class PlaySettings;
     69
    6870#define LOC     QString("VideoOutputQuartz::")
    6971#define LOC_ERR QString("VideoOutputQuartz Error: ")
    7072
     
    11081110/** \class VideoOutputQuartz
    11091111 *  \brief Implementation of Quartz (Mac OS X windowing system) video output
    11101112 */
    1111 VideoOutputQuartz::VideoOutputQuartz(
     1113VideoOutputQuartz::VideoOutputQuartz(PlaySettings *settings
    11121114    MythCodecID _myth_codec_id, void *codec_priv) :
    1113     VideoOutput(), Started(false), data(new QuartzData()),
     1115    VideoOutput(settings), Started(false), data(new QuartzData()),
    11141116    myth_codec_id(_myth_codec_id)
    11151117{
    11161118    init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0);
     
    18161818MythCodecID VideoOutputQuartz::GetBestSupportedCodec(
    18171819    uint width, uint height,
    18181820    uint osd_width, uint osd_height,
    1819     uint stream_type, uint fourcc)
     1821    uint stream_type, uint fourcc, PlaySettings *settings)
    18201822{
    18211823    (void) osd_width;
    18221824    (void) osd_height;
    18231825
    1824     VideoDisplayProfile vdp;
     1826    VideoDisplayProfile vdp(settings);
    18251827    vdp.SetInput(QSize(width, height));
    18261828    QString dec = vdp.GetDecoder();
    18271829    if ((dec == "libmpeg2") || (dec == "ffmpeg"))
  • libs/libmythtv/avformatdecoder.cpp

     
    2828#include "DVDRingBuffer.h"
    2929#include "videodisplayprofile.h"
    3030#include "mythuihelper.h"
     31#include "playsettings.h"
    3132
    3233#include "lcddevice.h"
    3334
     
    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;
     
    14311432    {
    14321433        directrendering = true;
    14331434        if (
    1434         !gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&
     1435        !GetNVP()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) &&
    14351436        !CODEC_IS_HWACCEL(codec))
    14361437    {
    14371438        SetLowBuffers(false);
     
    19111912
    19121913                if (!is_db_ignored)
    19131914                {
    1914                     VideoDisplayProfile vdp;
     1915                    VideoDisplayProfile vdp(GetNVP()->GetPlaySettings());
    19151916                    vdp.SetInput(QSize(width, height));
    19161917                    dec = vdp.GetDecoder();
    19171918                    thread_count = vdp.GetMaxCPUs();
     
    19391940                    MythCodecID vdpau_mcid;
    19401941                    vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec(
    19411942                        width, height,
    1942                         mpeg_version(enc->codec_id), no_hardware_decoders);
     1943                        mpeg_version(enc->codec_id), no_hardware_decoders,
     1944                        GetNVP()->GetPlaySettings());
    19431945
    19441946                    if (vdpau_mcid >= video_codec_id)
    19451947                    {
     
    19711973                        /* mpeg type    */ mpeg_version(enc->codec_id),
    19721974                        /* xvmc pix fmt */ xvmc_pixel_format(enc->pix_fmt),
    19731975                        /* test surface */ codec_is_std(video_codec_id),
    1974                         /* force_xv     */ force_xv);
     1976                        /* force_xv     */ force_xv,
     1977                        GetNVP()->GetPlaySettings());
    19751978
    19761979                    if (mcid >= video_codec_id)
    19771980                    {
     
    20042007                        /* osd dim      */ 0, 0,
    20052008                        /* mpeg type    */ mpeg_version(enc->codec_id),
    20062009                        /* pixel format */
    2007                         (PIX_FMT_YUV420P == enc->pix_fmt) ? FOURCC_I420 : 0);
     2010                        (PIX_FMT_YUV420P == enc->pix_fmt) ? FOURCC_I420 : 0,
     2011                        GetNVP()->GetPlaySettings());
    20082012
    20092013                    if (quartz_mcid >= video_codec_id)
    20102014                    {
  • libs/libmythtv/osdtypes.cpp

     
    1818#include "mythcontext.h"
    1919#include "mythdialogs.h"
    2020#include "mythverbose.h"
     21#include "playsettings.h"
    2122
    2223#ifdef USING_FRIBIDI
    2324    #include "fribidi/fribidi.h"
     
    23602361//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    23612362
    23622363OSDTypeCC::OSDTypeCC(const QString &name, TTFFont *font, int xoff, int yoff,
    2363                      int dispw, int disph, float wmult, float hmult)
     2364                     int dispw, int disph, float wmult, float hmult,
     2365                     PlaySettings *settings)
    23642366         : OSDType(name)
    23652367{
    23662368    m_font = font;
     
    23742376
    23752377    QRect rect = QRect(0, 0, 0, 0);
    23762378    m_box = new OSDTypeBox("cc_background", rect, wmult, hmult);
    2377     m_ccbackground = gCoreContext->GetNumSetting("CCBackground", 0);
     2379    m_ccbackground = settings->GetNumSetting("CCBackground", 0);
    23782380}
    23792381
    23802382OSDTypeCC::~OSDTypeCC()
  • 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/osdtypes.h

     
    3131class OSDTypeText;
    3232class OSDSurface;
    3333class TV;
     34class PlaySettings;
    3435
    3536typedef QHash<QString,QString> InfoMap;
    3637typedef QMap<int,uint>         HotKeyMap;
     
    573574{
    574575  public:
    575576    OSDTypeCC(const QString &name, TTFFont *font, int xoff, int yoff,
    576               int dispw, int disph, float wmult, float hmult);
     577              int dispw, int disph, float wmult, float hmult,
     578              PlaySettings *settings);
    577579   ~OSDTypeCC();
    578580
    579581    void Reinit(float wmult, float hmult);
  • libs/libmythtv/tv_play.h

     
    5555class TV;
    5656class OSDListTreeItemEnteredEvent;
    5757class OSDListTreeItemSelectedEvent;
     58class PlaySettings;
    5859
    5960typedef QMap<QString,InfoMap>    DDValueMap;
    6061typedef QMap<QString,DDValueMap> DDKeyMap;
     
    185186        unsigned long seconds;
    186187    };
    187188
    188     TV(void);
     189    TV(PlaySettings *settings);
    189190   ~TV();
    190191
    191192    bool Init(bool createWindow = true);
     
    210211
    211212    // Recording commands
    212213    int  PlayFromRecorder(int recordernum);
    213     int  Playback(const ProgramInfo &rcinfo);
     214    int  Playback(const ProgramInfo &rcinfo, PlaySettings *settings);
    214215
    215216    // Commands used by frontend playback box
    216217    QString GetRecordingGroup(int player_idx) const;
     
    599600    static TVState RemoveRecording(TVState state);
    600601    void RestoreScreenSaver(const PlayerContext*);
    601602
    602     void InitUDPNotifyEvent(void);
     603    void InitUDPNotifyEvent(PlaySettings *settings);
    603604
    604605    /// true if dialog is either videoplayexit, playexit or askdelete dialog
    605606    bool IsVideoExitDialog(const QString &dialog_name);
  • 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

     
    4646    opts.deints->insert("vdpau", deints);
    4747}
    4848
    49 VideoOutputVDPAU::VideoOutputVDPAU(MythCodecID codec_id)
    50   : VideoOutput(),
     49VideoOutputVDPAU::VideoOutputVDPAU(PlaySettings *settings, MythCodecID codec_id)
     50  : VideoOutput(settings),
    5151    m_codec_id(codec_id),    m_win(0),         m_render(NULL),
    5252    m_buffer_size(NUM_VDPAU_BUFFERS),          m_pause_surface(0),
    5353    m_need_deintrefs(false), m_video_mixer(0), m_mixer_features(kVDPFeatNone),
     
    858858
    859859MythCodecID VideoOutputVDPAU::GetBestSupportedCodec(
    860860    uint width,       uint height,
    861     uint stream_type, bool no_acceleration)
     861    uint stream_type, bool no_acceleration, PlaySettings *settings)
    862862{
    863863    bool use_cpu = no_acceleration;
    864     VideoDisplayProfile vdp;
     864    VideoDisplayProfile vdp(settings);
    865865    vdp.SetInput(QSize(width, height));
    866866    QString dec = vdp.GetDecoder();
    867867
  • 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

     
    9393{
    9494  public:
    9595    static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
    96     VideoOutputD3D();
     96    VideoOutputD3D(PlaySettings *settings);
    9797   ~VideoOutputD3D();
    9898
    9999    bool Init(int width, int height, float aspect, WId winid,
  • libs/libmythtv/playercontext.cpp

     
    1515#include "storagegroup.h"
    1616#include "mythcorecontext.h"
    1717#include "videometadatautil.h"
     18#include "DetectLetterbox.h"
     19#include "playsettings.h"
    1820
    1921#define LOC QString("playCtx: ")
    2022#define LOC_ERR QString("playCtx, Error: ")
     
    435437                              WId embedwinid, const QRect *embedbounds,
    436438                              bool muted)
    437439{
    438     int exact_seeking = gCoreContext->GetNumSetting("ExactSeeking", 0);
     440    int exact_seeking = settings->GetNumSetting("ExactSeeking", 0);
    439441
    440442    if (HasNVP())
    441443    {
     
    917919/**
    918920 * \brief assign programinfo to the context
    919921 */
    920 void PlayerContext::SetPlayingInfo(const ProgramInfo *info)
     922void PlayerContext::SetPlayingInfo(const ProgramInfo *info,
     923                                   PlaySettings *_settings)
    921924{
    922925    bool ignoreDB = gCoreContext->IsDatabaseIgnored();
    923926
     
    929932            playingInfo->MarkAsInUse(false, recUsage);
    930933        delete playingInfo;
    931934        playingInfo = NULL;
     935        // XXX delete settings?
    932936    }
    933937
    934938    if (info)
     
    937941        if (!ignoreDB)
    938942            playingInfo->MarkAsInUse(true, recUsage);
    939943        playingLen = playingInfo->GetSecondsInRecording();
     944        settings = (_settings ? _settings :
     945                    new PlaySettings(playingInfo->GetPlaybackGroup()));
    940946    }
    941947}
    942948
  • libs/libmythtv/NuppelVideoPlayer.h

     
    197197    bool      GetAudioBufferStatus(uint &fill, uint &total) const;
    198198    PIPLocation GetNextPIPLocation(void) const;
    199199
     200    PlaySettings *GetPlaySettings(void) const {
     201        return player_ctx ? player_ctx->settings : NULL;
     202    }
     203
    200204    // Bool Gets
    201205    bool    GetRawAudioState(void) const;
    202206    bool    GetLimitKeyRepeat(void) const     { return limitKeyRepeat; }
  • libs/libmythtv/textsubtitleparser.h

     
    1717// Qt headers
    1818#include <QStringList>
    1919
     20class PlaySettings;
     21
    2022class text_subtitle_t
    2123{
    2224  public:
     
    7577class TextSubtitleParser
    7678{
    7779  public:
    78     static bool LoadSubtitles(QString fileName, TextSubtitles &target);
     80    static bool LoadSubtitles(QString fileName, TextSubtitles &target,
     81                              PlaySettings *settings);
    7982};
    8083
    8184#endif
  • libs/libmythtv/osd.h

     
    7373class TeletextViewer;
    7474class QStringList;
    7575class QDomElement;
     76class PlaySettings;
    7677
    7778class OSD : public QObject
    7879{
    7980    Q_OBJECT
    8081 public:
    81     OSD();
     82    OSD(PlaySettings *settings);
    8283   ~OSD(void);
    8384
    8485    void Init(const QRect &totalBounds,   int   frameRate,
     
    236237
    237238    QObject *m_listener;
    238239
     240    PlaySettings *settings;
     241
    239242    QRect osdBounds;
    240243    int   frameint;
    241244    bool  needPillarBox;
  • 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"
     
    7677 *  \brief Returns the most sophisticated video sync method available.
    7778 */
    7879VideoSync *VideoSync::BestMethod(VideoOutput *video_output,
     80                                 PlaySettings *settings,
    7981                                 uint frame_interval, uint refresh_interval,
    8082                                 bool halve_frame_interval)
    8183{
    8284    VideoSync *trial = NULL;
    8385    tryingVideoSync  = true;
    84     bool tryOpenGL   = (gCoreContext->GetNumSetting("UseOpenGLVSync", 1) &&
     86    bool tryOpenGL   = (settings->GetNumSetting("UseOpenGLVSync", 1) &&
    8587                        (getenv("NO_OPENGL_VSYNC") == NULL));
    8688
    8789    // m_forceskip allows for skipping one sync method
  • libs/libmythtv/tv_play.cpp

     
    6161#include "recordinginfo.h"
    6262#include "mythsystemevent.h"
    6363#include "videometadatautil.h"
     64#include "playsettings.h"
    6465
    6566#if ! HAVE_ROUND
    6667#define round(x) ((int) ((x) + 0.5))
     
    192193    bool startInGuide = flags & kStartTVInGuide;
    193194    bool inPlaylist = flags & kStartTVInPlayList;
    194195    bool initByNetworkCommand = flags & kStartTVByNetworkCommand;
    195     TV *tv = new TV();
    196196    bool quitAll = false;
    197197    bool showDialogs = true;
    198198    bool playCompleted = false;
     
    207207        curProgram->SetIgnoreBookmark(flags & kStartTVIgnoreBookmark);
    208208    }
    209209
     210    PlaySettings settings(curProgram ? curProgram->GetPlaybackGroup() : "Default");
     211    TV *tv = new TV(&settings);
     212
    210213    // Initialize TV
    211214    if (!tv->Init())
    212215    {
     
    237240        if (curProgram)
    238241        {
    239242            VERBOSE(VB_PLAYBACK, LOC + "tv->Playback() -- begin");
    240             if (!tv->Playback(*curProgram))
     243            if (!tv->Playback(*curProgram, &settings))
    241244            {
    242245                quitAll = true;
    243246            }
     
    820823 *  \brief Performs instance initialiation not requiring access to database.
    821824 *  \sa Init(void)
    822825 */
    823 TV::TV(void)
     826TV::TV(PlaySettings *settings)
    824827    : // Configuration variables from database
    825828      baseFilters(""),
    826829      db_channel_format("<num> <sign>"),
     
    956959        kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]);
    957960
    958961    MythDB::getMythDB()->GetSettings(kv);
     962    settings->AddToMap(kv);
    959963
    960964    // convert from minutes to ms.
    961965    db_idle_timeout        = kv["LiveTVIdleTimeout"].toInt() * 60 * 1000;
     
    17491753}
    17501754
    17511755
    1752 int TV::Playback(const ProgramInfo &rcinfo)
     1756int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings)
    17531757{
    17541758    wantsToQuit   = false;
    17551759    jumpToProgram = false;
     
    17631767        return 0;
    17641768    }
    17651769
    1766     mctx->SetPlayingInfo(&rcinfo);
     1770    mctx->SetPlayingInfo(&rcinfo, settings);
    17671771    mctx->SetInitialTVState(false);
    17681772    ScheduleStateChange(mctx);
    17691773
     
    18461850
    18471851    if (fileexists)
    18481852    {
    1849         Playback(pginfo);
     1853        PlaySettings settings("Default");
     1854        Playback(pginfo, &settings);
    18501855        retval = 1;
    18511856    }
    18521857
     
    21922197        {
    21932198            OSD *osd = GetOSDLock(ctx);
    21942199            ctx->LockPlayingInfo(__FILE__, __LINE__);
    2195             if (osd && (PlayGroup::GetCount() > 0))
     2200            if (ctx->playingInfo->GetPlaybackGroup() != "Default" &&
     2201                ctx->playingInfo->GetPlaybackGroup() != "Videos" &&
     2202                osd && (PlayGroup::GetCount() > 0))
    21962203                osd->SetSettingsText(tr("%1 Settings")
    21972204                    .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup())), 3);
    21982205            ctx->UnlockPlayingInfo(__FILE__, __LINE__);
     
    51815188        return false;
    51825189    }
    51835190
    5184     InitUDPNotifyEvent();
     5191    InitUDPNotifyEvent(ctx->settings);
    51855192    bool ok = false;
    51865193    if (ctx->IsNullVideoDesired())
    51875194    {
     
    1184411851        GetMythUI()->RestoreScreensaver();
    1184511852}
    1184611853
    11847 void TV::InitUDPNotifyEvent(void)
     11854void TV::InitUDPNotifyEvent(PlaySettings *settings)
    1184811855{
    1184911856    if (db_udpnotify_port && !udpnotify)
    1185011857    {
    11851         udpnotify = new UDPNotify(db_udpnotify_port);
     11858        udpnotify = new UDPNotify(db_udpnotify_port, settings);
    1185211859        connect(udpnotify,
    1185311860                SIGNAL(AddUDPNotifyEvent(
    1185411861                        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

     
    88#include "NuppelVideoPlayer.h"
    99#include "videodisplayprofile.h"
    1010#include "decoderbase.h"
     11#include "playsettings.h"
    1112
    1213#include "mythcorecontext.h"
    1314#include "mythverbose.h"
     
    108109        PIPState pipState,
    109110        const QSize   &video_dim, float        video_aspect,
    110111        WId            win_id,    const QRect &display_rect,
    111         float          video_prate,     WId    embed_id)
     112        float          video_prate,     WId    embed_id,
     113        PlaySettings *settings)
    112114{
    113115    (void) codec_priv;
    114116
     
    153155    QString renderer = QString::null;
    154156    if (renderers.size() > 0)
    155157    {
    156         VideoDisplayProfile vprof;
     158        VideoDisplayProfile vprof(settings);
    157159        vprof.SetInput(video_dim);
    158160
    159161        QString tmp = vprof.GetVideoRenderer();
     
    181183
    182184#ifdef USING_DIRECTFB
    183185        if (renderer == "directfb")
    184             vo = new VideoOutputDirectfb();
     186            vo = new VideoOutputDirectfb(settings);
    185187#endif // USING_DIRECTFB
    186188
    187189#ifdef USING_MINGW
    188190        if (renderer == "direct3d")
    189             vo = new VideoOutputD3D();
     191            vo = new VideoOutputD3D(settings);
    190192#endif // USING_MINGW
    191193
    192194#ifdef Q_OS_MACX
    193195        if (osxlist.contains(renderer))
    194             vo = new VideoOutputQuartz(codec_id, codec_priv);
     196            vo = new VideoOutputQuartz(settings, codec_id, codec_priv);
    195197#endif // Q_OS_MACX
    196198
    197199#ifdef USING_OPENGL_VIDEO
    198200        if (renderer == "opengl")
    199             vo = new VideoOutputOpenGL();
     201            vo = new VideoOutputOpenGL(settings);
    200202#endif // USING_OPENGL_VIDEO
    201203
    202204#ifdef USING_VDPAU
    203205        if (renderer == "vdpau")
    204             vo = new VideoOutputVDPAU(codec_id);
     206            vo = new VideoOutputVDPAU(settings, codec_id);
    205207#endif // USING_VDPAU
    206208
    207209#ifdef USING_XV
    208210        if (xvlist.contains(renderer))
    209             vo = new VideoOutputXv(codec_id);
     211            vo = new VideoOutputXv(settings, codec_id);
    210212#endif // USING_XV
    211213
    212214        if (vo)
     
    303305 * \brief This constructor for VideoOutput must be followed by an
    304306 *        Init(int,int,float,WId,int,int,int,int,WId) call.
    305307 */
    306 VideoOutput::VideoOutput() :
     308VideoOutput::VideoOutput(PlaySettings *_settings) :
    307309    // DB Settings
    308310    db_display_dim(0,0),
    309311    db_aspectoverride(kAspect_Off),     db_adjustfill(kAdjustFill_Off),
     
    337339    display_res(NULL),
    338340
    339341    // Physical display
    340     monitor_sz(640,480),                monitor_dim(400,300)
     342    monitor_sz(640,480),                monitor_dim(400,300),
    341343
     344    settings(_settings)
     345
    342346{
    343347    bzero(&pip_tmp_image, sizeof(pip_tmp_image));
    344     db_display_dim = QSize(gCoreContext->GetNumSetting("DisplaySizeWidth",  0),
    345                            gCoreContext->GetNumSetting("DisplaySizeHeight", 0));
     348    db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth",  0),
     349                           settings->GetNumSetting("DisplaySizeHeight", 0));
    346350
    347351    db_pict_attr[kPictureAttribute_Brightness] =
    348         gCoreContext->GetNumSetting("PlaybackBrightness", 50);
     352        settings->GetNumSetting("PlaybackBrightness", 50);
    349353    db_pict_attr[kPictureAttribute_Contrast] =
    350         gCoreContext->GetNumSetting("PlaybackContrast",   50);
     354        settings->GetNumSetting("PlaybackContrast",   50);
    351355    db_pict_attr[kPictureAttribute_Colour] =
    352         gCoreContext->GetNumSetting("PlaybackColour",     50);
     356        settings->GetNumSetting("PlaybackColour",     50);
    353357    db_pict_attr[kPictureAttribute_Hue] =
    354         gCoreContext->GetNumSetting("PlaybackHue",         0);
     358        settings->GetNumSetting("PlaybackHue",         0);
    355359
    356360    db_aspectoverride = (AspectOverrideMode)
    357         gCoreContext->GetNumSetting("AspectOverride",      0);
     361        settings->GetNumSetting("AspectOverride",      0);
    358362    db_adjustfill = (AdjustFillMode)
    359         gCoreContext->GetNumSetting("AdjustFill",          0);
     363        settings->GetNumSetting("AdjustFill",          0);
    360364    db_letterbox_colour = (LetterBoxColour)
    361         gCoreContext->GetNumSetting("LetterboxColour",     0);
     365        settings->GetNumSetting("LetterboxColour",     0);
    362366    db_use_picture_controls =
    363         gCoreContext->GetNumSetting("UseOutputPictureControls", 0);
     367        settings->GetNumSetting("UseOutputPictureControls", 0);
    364368
    365369    if (!gCoreContext->IsDatabaseIgnored())
    366         db_vdisp_profile = new VideoDisplayProfile();
     370        db_vdisp_profile = new VideoDisplayProfile(settings);
    367371
    368     windows.push_back(VideoOutWindow());
     372    windows.push_back(VideoOutWindow(settings));
    369373}
    370374
    371375/**
     
    434438    return QString::null;
    435439}
    436440
    437 bool VideoOutput::IsPreferredRenderer(QSize video_size)
     441bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings)
    438442{
    439443    if (!db_vdisp_profile || (video_size == windows[0].GetVideoDispDim()))
    440444        return true;
    441445
    442     VideoDisplayProfile vdisp;
     446    VideoDisplayProfile vdisp(settings);
    443447    vdisp.SetInput(video_size);
    444448    QString new_rend = vdisp.GetVideoRenderer();
    445449    if (new_rend.isEmpty())
  • libs/libmythtv/videooutwindow.h

     
    1616#include "videoouttypes.h"
    1717
    1818class 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

     
    2727class LiveTVChain;
    2828class MythDialog;
    2929class QPainter;
     30class PlaySettings;
    3031
    3132typedef enum
    3233{
     
    9091    void SetRecorder(RemoteEncoder *rec);
    9192    void SetTVChain(LiveTVChain *chain);
    9293    void SetRingBuffer(RingBuffer *buf);
    93     void SetPlayingInfo(const ProgramInfo *info);
     94    void SetPlayingInfo(const ProgramInfo *info, PlaySettings *settings=NULL);
    9495    void SetPlayGroup(const QString &group);
    9596    void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state);
    9697    void SetPIPLocation(int loc) { pipLocation = loc; }
     
    146147    LiveTVChain        *tvchain;
    147148    RingBuffer         *buffer;
    148149    ProgramInfo        *playingInfo; ///< Currently playing info
     150    PlaySettings       *settings; // corresponding to playingInfo
    149151    long long           playingLen;  ///< Initial CalculateLength()
    150152    bool                nohardwaredecoders; // < Disable use of VDPAU decoding
    151153    bool                decoding;    ///< Video decoder thread started
  • 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

     
    166166 * \see VideoOutput, VideoBuffers
    167167 *
    168168 */
    169 VideoOutputXv::VideoOutputXv(MythCodecID codec_id)
    170     : VideoOutput(),
     169VideoOutputXv::VideoOutputXv(PlaySettings *settings, MythCodecID codec_id)
     170    : VideoOutput(settings),
    171171      myth_codec_id(codec_id), video_output_subtype(XVUnknown),
    172172      global_lock(QMutex::Recursive),
    173173
     
    408408 * \return port number if it succeeds, else -1.
    409409 */
    410410int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root,
     411                                      PlaySettings *settings,
    411412                                      MythCodecID mcodecid,
    412413                                      uint width, uint height,
    413414                                      bool &xvsetdefaults,
     
    492493    }
    493494
    494495    // figure out if we want chromakeying..
    495     VideoDisplayProfile vdp;
     496    VideoDisplayProfile vdp(settings);
    496497    vdp.SetInput(QSize(width, height));
    497498    bool check_for_colorkey = (vdp.GetOSDRenderer() == "chromakey");
    498499
     
    785786    disp->StartLog();
    786787    QString adaptor_name = QString::null;
    787788    const QSize video_dim = windows[0].GetVideoDim();
    788     xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), mcodecid,
     789    xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, mcodecid,
    789790                                 video_dim.width(), video_dim.height(),
    790791                                 xv_set_defaults,
    791792                                 xvmc_chroma, &xvmc_surf_info, &adaptor_name);
     
    864865    disp->StartLog();
    865866    QString adaptor_name = QString::null;
    866867    const QSize video_dim = windows[0].GetVideoDim();
    867     xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), kCodec_MPEG2,
     868    xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, kCodec_MPEG2,
    868869                                 video_dim.width(), video_dim.height(),
    869870                                 xv_set_defaults, 0, NULL, &adaptor_name);
    870871    if (xv_port == -1)
     
    10181019    uint width,       uint height,
    10191020    uint osd_width,   uint osd_height,
    10201021    uint stream_type, int xvmc_chroma,
    1021     bool test_surface, bool force_xv)
     1022    bool test_surface, bool force_xv,
     1023    PlaySettings *settings)
    10221024{
    10231025    (void)width, (void)height, (void)osd_width, (void)osd_height;
    10241026    (void)stream_type, (void)xvmc_chroma, (void)test_surface;
     
    10291031        return ret;
    10301032
    10311033#ifdef USING_XVMC
    1032     VideoDisplayProfile vdp;
     1034    VideoDisplayProfile vdp(settings);
    10331035    vdp.SetInput(QSize(width, height));
    10341036    QString dec = vdp.GetDecoder();
    10351037    if ((dec == "libmpeg2") || (dec == "ffmpeg"))
     
    10791081
    10801082        ok = false;
    10811083        bool dummy;
    1082         int port = GrabSuitableXvPort(disp, disp->GetRoot(), ret, width, height,
     1084        int port = GrabSuitableXvPort(disp, disp->GetRoot(), settings,
     1085                                      ret, width, height,
    10831086                                      dummy, xvmc_chroma, &info);
    10841087        if (port >= 0)
    10851088        {
  • libs/libmythtv/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

     
    2929class FilterChain;
    3030class FilterManager;
    3131class OpenGLContextGLX;
     32class PlaySettings;
    3233
    3334typedef QMap<NuppelVideoPlayer*,PIPLocation> PIPMap;
    3435
     
    4950        PIPState       pipState,
    5051        const QSize   &video_dim, float        video_aspect,
    5152        WId            win_id,    const QRect &display_rect,
    52         float video_prate,        WId          embed_id);
     53        float video_prate,        WId          embed_id,
     54        PlaySettings *settings);
    5355
    54     VideoOutput();
     56    VideoOutput(PlaySettings *settings);
    5557    virtual ~VideoOutput();
    5658
    5759    virtual bool Init(int width, int height, float aspect,
     
    5961                      int winh, WId embedid = 0);
    6062    virtual void InitOSD(OSD *osd);
    6163    virtual void SetVideoFrameRate(float);
    62     virtual bool IsPreferredRenderer(QSize video_size);
     64    virtual bool IsPreferredRenderer(QSize video_size, PlaySettings *settings);
    6365    virtual bool SetDeinterlacingEnabled(bool);
    6466    virtual bool SetupDeinterlace(bool i, const QString& ovrf="");
    6567    virtual void FallbackDeint(void);
     
    328330    // Display information
    329331    QSize monitor_sz;
    330332    QSize monitor_dim;
     333
     334    PlaySettings *settings;
    331335};
    332336
    333337#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)
     
    112113    m_subtitles.clear();
    113114}
    114115
    115 bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target)
     116bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target,
     117                                       PlaySettings *settings)
    116118{
    117119    demux_sputext_t sub_data;
    118120    sub_data.rbuffer = new RingBuffer(fileName, 0, false);
     
    130132    target.SetFrameBasedTiming(!sub_data.uses_time);
    131133
    132134    QTextCodec *textCodec = NULL;
    133     QString codec = gCoreContext->GetSetting("SubtitleCodec", "");
     135    QString codec = settings->GetSetting("SubtitleCodec", "");
    134136    if (!codec.isEmpty())
    135137        textCodec = QTextCodec::codecForName(codec.toLatin1());
    136138    if (!textCodec)
  • libs/libmythtv/osd.cpp

     
    3232#include "mythverbose.h"
    3333#include "util.h"
    3434#include "channelutil.h"
     35#include "playsettings.h"
    3536
    3637#include "x11colors.h"
    3738#include "mythdirs.h"
     
    4243static char  *cc708_default_font_names[16];
    4344static bool   cc708_defaults_initialized = false;
    4445static QMutex cc708_init_lock;
    45 static void initialize_osd_fonts(void);
     46static void initialize_osd_fonts(PlaySettings *settings);
    4647
    4748#define LOC QString("OSD: ")
    4849#define LOC_ERR QString("OSD, Error: ")
     
    5960const char *kOSDDialogInfo           = "infobox";
    6061const char *kOSDDialogEditChannel    = "channel_editor";
    6162
    62 OSD::OSD() :
     63OSD::OSD(PlaySettings *_settings) :
    6364    QObject(),                          m_listener(NULL),
     65    settings(_settings),
    6466    osdBounds(),                        frameint(0),
    6567    needPillarBox(false),
    66     themepath(FindTheme(gCoreContext->GetSetting("OSDTheme"))),
     68    themepath(FindTheme(settings->GetSetting("OSDTheme", ""))),
    6769    wscale(1.0f),                       fscale(1.0f),
    6870    m_themeinfo(new ThemeInfo(themepath)),
    6971    m_themeaspect(4.0f/3.0f),
     
    174176    drawSurface = new OSDSurface(osd_bounds.width(), osd_bounds.height());
    175177
    176178    if (!cc708_defaults_initialized)
    177         initialize_osd_fonts();
     179        initialize_osd_fonts(settings);
    178180
    179181    for (uint i = 0; i < 16; i++)
    180182        cc708fontnames[i] = cc708_default_font_names[i];
     
    187189    if (themepath.isEmpty())
    188190    {
    189191        VERBOSE(VB_IMPORTANT, "Couldn't find OSD theme: "
    190                 <<gCoreContext->GetSetting("OSDTheme"));
     192                <<settings->GetSetting("OSDTheme", ""));
    191193        InitDefaults();
    192194        return;
    193195    }
     
    196198    if (!LoadTheme())
    197199    {
    198200        VERBOSE(VB_IMPORTANT, "Couldn't load OSD theme: "
    199                 <<gCoreContext->GetSetting("OSDTheme")<<" at "<<themepath);
     201                <<settings->GetSetting("OSDTheme", "")<<" at "<<themepath);
    200202    }
    201203
    202204    InitDefaults();
     
    240242        QString name = "cc_font";
    241243        int fontsize = m_themeinfo->GetBaseRes()->height() / 27;
    242244
    243         ccfont = LoadFont(gCoreContext->GetSetting("OSDCCFont"), fontsize);
     245        ccfont = LoadFont(settings->GetSetting("OSDCCFont", ""), fontsize);
    244246
    245247        if (ccfont)
    246248            fontMap[name] = ccfont;
     
    276278
    277279    OSDTypeCC *ccpage =
    278280        new OSDTypeCC(name, ccfont, sub_xoff, sub_yoff,
    279                       sub_dispw, sub_disph, wmult, hmult);
     281                      sub_dispw, sub_disph, wmult, hmult, settings);
    280282    container->AddType(ccpage);
    281283    return true;
    282284}
     
    295297
    296298    // Create fonts...
    297299    TTFFont* ccfonts[48];
    298     uint z = gCoreContext->GetNumSetting("OSDCC708TextZoom", 100) *
     300    uint z = settings->GetNumSetting("OSDCC708TextZoom", 100) *
    299301                    m_themeinfo->GetBaseRes()->height();
    300302    uint fontsizes[3] = { z / 3600, z / 2900, z / 2200 };
    301303    for (uint i = 0; i < 48; i++)
     
    362364    if (!font)
    363365    {
    364366        int fontsize = (size->height() - (2 * safe_y)) / 26;
    365         font = LoadFont(gCoreContext->GetSetting("OSDCCFont"), fontsize);
     367        font = LoadFont(settings->GetSetting("OSDCCFont", ""), fontsize);
    366368
    367369        if (font)
    368370            fontMap[fontname] = font;
     
    470472    TTFFont *font = GetFont(fontname);
    471473    if (!font)
    472474    {
    473         font = LoadFont(gCoreContext->GetSetting("OSDCCFont"), SUBTITLE_FONT_SIZE);
     475        font = LoadFont(settings->GetSetting("OSDCCFont", ""),
     476                        SUBTITLE_FONT_SIZE);
    474477
    475478        if (font)
    476479        {
     
    538541
    539542    if (!actfont)
    540543    {
    541         actfont = LoadFont(gCoreContext->GetSetting("OSDFont"), 16);
     544        actfont = LoadFont(settings->GetSetting("OSDFont", ""), 16);
    542545
    543546        if (actfont)
    544547            fontMap["treemenulistfont"] = actfont;
     
    687690    if (dir.exists())
    688691    {
    689692        VERBOSE(VB_IMPORTANT, QString("Couldn't find OSD theme: %1. "
    690                 "Switching to default.").arg(gCoreContext->GetSetting("OSDTheme")));
    691         gCoreContext->OverrideSettingForSession("OSDTheme", "BlackCurves-OSD");
     693                                      "Switching to default.").arg(settings->GetSetting("OSDTheme", "")));
     694        settings->OverrideSetting/*ForSession*/("OSDTheme", "BlackCurves-OSD");
    692695        return testdir;
    693696    }
    694697
     
    855858void OSD::parseFont(QDomElement &element)
    856859{
    857860    QString name;
    858     QString fontfile = gCoreContext->GetSetting("OSDFont");
     861    QString fontfile = settings->GetSetting("OSDFont", "");
    859862    int size = -1;
    860863    int sizeSmall = -1;
    861864    int sizeBig = -1;
     
    933936        return;
    934937    }
    935938
    936     QString fontSizeType = gCoreContext->GetSetting("OSDThemeFontSizeType",
     939    QString fontSizeType = settings->GetSetting("OSDThemeFontSizeType",
    937940                                                "default");
    938941    if (fontSizeType == "small")
    939942    {
     
    31143117    return QRect(xoffset, yoffset, displaywidth, displayheight);
    31153118}
    31163119
    3117 #define OSD_STRDUP(X) strdup(gCoreContext->GetSetting(X).toLocal8Bit().constData())
     3120#define OSD_STRDUP(X) strdup(settings->GetSetting(X, "").toLocal8Bit().constData())
    31183121
    3119 static void initialize_osd_fonts(void)
     3122static void initialize_osd_fonts(PlaySettings *settings)
    31203123{
    31213124    QMutexLocker locker(&cc708_init_lock);
    31223125    if (cc708_defaults_initialized)
    31233126        return;
    31243127    cc708_defaults_initialized = true;
    31253128
    3126     QString default_font_type = gCoreContext->GetSetting(
     3129    QString default_font_type = settings->GetSetting(
    31273130        "OSDCC708DefaultFontType", "MonoSerif");
    31283131
    31293132    // 0
  • 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"));
     
    320435    return gc;
    321436}
    322437
    323 static HostCheckBox *DecodeExtraAudio()
     438static Setting *DecodeExtraAudio(PlaySettings *settings)
    324439{
    325     HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");
     440    CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings);
    326441    gc->setLabel(QObject::tr("Extra audio buffering"));
    327442    gc->setValue(true);
    328443    gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing "
     
    331446                    "effect on framegrabbers (MPEG-4/RTJPEG).  MythTV will "
    332447                    "keep extra audio data in its internal buffers to workaround "
    333448                    "this bug."));
    334     return gc;
     449    return wrap(gc, settings);
    335450}
    336451
    337 static HostComboBox *PIPLocationComboBox()
     452static Setting *PIPLocationComboBox(PlaySettings *settings)
    338453{
    339     HostComboBox *gc = new HostComboBox("PIPLocation");
     454    CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings);
    340455    gc->setLabel(QObject::tr("PIP Video Location"));
    341456    for (uint loc = 0; loc < kPIP_END; ++loc)
    342457        gc->addSelection(toString((PIPLocation) loc), QString::number(loc));
    343458    gc->setHelpText(QObject::tr("Location of PIP Video window."));
    344     return gc;
     459    return wrap(gc, settings);
    345460}
    346461
    347462static GlobalLineEdit *AllRecGroupPassword()
     
    438553    return gc;
    439554}
    440555
    441 static HostCheckBox *SmartForward()
     556static Setting *SmartForward(PlaySettings *settings)
    442557{
    443     HostCheckBox *gc = new HostCheckBox("SmartForward");
     558    CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings);
    444559    gc->setLabel(QObject::tr("Smart Fast Forwarding"));
    445560    gc->setValue(false);
    446561    gc->setHelpText(QObject::tr("If enabled, then immediately after "
    447562                    "rewinding, only skip forward the same amount as "
    448563                    "skipping backwards."));
    449     return gc;
     564    return wrap(gc, settings);
    450565}
    451566
    452 static HostCheckBox *ExactSeeking()
     567static Setting *ExactSeeking(PlaySettings *settings)
    453568{
    454     HostCheckBox *gc = new HostCheckBox("ExactSeeking");
     569    CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings);
    455570    gc->setLabel(QObject::tr("Seek to exact frame"));
    456571    gc->setValue(false);
    457572    gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but "
    458573                    "slower."));
    459     return gc;
     574    return wrap(gc, settings);
    460575}
    461576
    462577static GlobalComboBox *CommercialSkipMethod()
     
    474589    return bc;
    475590}
    476591
    477 static HostComboBox *AutoCommercialSkip()
     592static Setting *AutoCommercialSkip(PlaySettings *settings)
    478593{
    479     HostComboBox *gc = new HostComboBox("AutoCommercialSkip");
     594    CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings);
    480595    gc->setLabel(QObject::tr("Automatically Skip Commercials"));
    481596    gc->addSelection(QObject::tr("Off"), "0");
    482597    gc->addSelection(QObject::tr("Notify, but do not skip"), "2");
     
    485600                    "have been flagged during Automatic Commercial Detection "
    486601                    "or by the mythcommflag program, or just notify that a "
    487602                    "commercial has been detected."));
    488     return gc;
     603    return wrap(gc, settings);
    489604}
    490605
    491606static GlobalCheckBox *AutoCommercialFlag()
     
    570685    return bc;
    571686}
    572687
    573 static HostSpinBox *CommRewindAmount()
     688static Setting *CommRewindAmount(PlaySettings *settings)
    574689{
    575     HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);
     690    CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false);
    576691    gs->setLabel(QObject::tr("Commercial Skip Auto-Rewind Amount"));
    577692    gs->setHelpText(QObject::tr("If set, MythTV will automatically rewind "
    578693                    "this many seconds after performing a commercial skip."));
    579694    gs->setValue(0);
    580     return gs;
     695    return wrap(gs, settings);
    581696}
    582697
    583 static HostSpinBox *CommNotifyAmount()
     698static Setting *CommNotifyAmount(PlaySettings *settings)
    584699{
    585     HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);
     700    CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false);
    586701    gs->setLabel(QObject::tr("Commercial Skip Notify Amount"));
    587702    gs->setHelpText(QObject::tr("If set, MythTV will act like a commercial "
    588703                    "begins this many seconds early.  This can be useful "
    589704                    "when commercial notification is used in place of "
    590705                    "automatic skipping."));
    591706    gs->setValue(0);
    592     return gs;
     707    return wrap(gs, settings);
    593708}
    594709
    595710static GlobalSpinBox *MaximumCommercialSkip()
     
    13911506    labels[j]->setValue(label_i);
    13921507}
    13931508
    1394 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) :
     1509PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str,
     1510                                               PlaySettings *settings) :
    13951511    TriggeredConfigurationGroup(false, true,  true, true,
    13961512                                false, false, true, true), grouptrigger(NULL)
    13971513{
    13981514    setLabel(QObject::tr("Playback Profiles") + str);
     1515    if (settings)
     1516        setLabel(QObject::tr("Playback group settings for ") +
     1517                 settings->mGroupName + " - " +
     1518                 getLabel());
    13991519
    14001520    QString host = gCoreContext->GetHostName();
    14011521    QStringList profiles = VideoDisplayProfile::GetProfiles(host);
     
    14231543        profiles = VideoDisplayProfile::GetProfiles(host);
    14241544    }
    14251545
    1426     QString profile = VideoDisplayProfile::GetDefaultProfileName(host);
     1546    QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings);
    14271547    if (!profiles.contains(profile))
    14281548    {
    14291549        profile = (profiles.contains("Normal")) ? "Normal" : profiles[0];
    14301550        VideoDisplayProfile::SetDefaultProfileName(profile, host);
    14311551    }
    14321552
    1433     grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile");
     1553    CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings);
     1554    grouptrigger = gs;
    14341555    grouptrigger->setLabel(QObject::tr("Current Video Playback Profile"));
    14351556    QStringList::const_iterator it;
    14361557    for (it = profiles.begin(); it != profiles.end(); ++it)
    14371558        grouptrigger->addSelection(ProgramInfo::i18n(*it), *it);
     1559    if (settings)
     1560    {
     1561        addChild(wrap(grouptrigger, settings));
     1562        return;
     1563    }
    14381564
    14391565    HorizontalConfigurationGroup *grp =
    14401566        new HorizontalConfigurationGroup(false, false, true, true);
     
    15671693    return gc;
    15681694}
    15691695
    1570 static HostSpinBox *FFRewReposTime()
     1696static Setting *FFRewReposTime(PlaySettings *settings)
    15711697{
    1572     HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);
     1698    CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false);
    15731699    gs->setLabel(QObject::tr("Fast forward/rewind reposition amount"));
    15741700    gs->setValue(100);
    15751701    gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind "
     
    15771703                    "resuming normal playback. This "
    15781704                    "compensates for the reaction time between seeing "
    15791705                    "where to resume playback and actually exiting seeking."));
    1580     return gs;
     1706    return wrap(gs, settings);
    15811707}
    15821708
    1583 static HostCheckBox *FFRewReverse()
     1709static Setting *FFRewReverse(PlaySettings *settings)
    15841710{
    1585     HostCheckBox *gc = new HostCheckBox("FFRewReverse");
     1711    CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings);
    15861712    gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind"));
    15871713    gc->setValue(true);
    15881714    gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key "
     
    15901716                    "vice versa.  If disabled, it will decrease the "
    15911717                    "current speed or switch to play mode if "
    15921718                    "the speed can't be decreased further."));
    1593     return gc;
     1719    return wrap(gc, settings);
    15941720}
    15951721
    1596 static HostSpinBox *OSDGeneralTimeout()
     1722static Setting *OSDGeneralTimeout(PlaySettings *settings)
    15971723{
    1598     HostSpinBox *gs = new HostSpinBox("OSDGeneralTimeout", 1, 30, 1);
     1724    CREATE_SPINBOX_SETTING(gs, "OSDGeneralTimeout", settings, 1, 30, 1, false);
    15991725    gs->setLabel(QObject::tr("General OSD time-out (sec)"));
    16001726    gs->setValue(2);
    16011727    gs->setHelpText(QObject::tr("Length of time an on-screen display "
    16021728                    "window will be visible."));
    1603     return gs;
     1729    return wrap(gs, settings);
    16041730}
    16051731
    1606 static HostSpinBox *OSDProgramInfoTimeout()
     1732static Setting *OSDProgramInfoTimeout(PlaySettings *settings)
    16071733{
    1608     HostSpinBox *gs = new HostSpinBox("OSDProgramInfoTimeout", 1, 30, 1);
     1734    CREATE_SPINBOX_SETTING(gs, "OSDProgramInfoTimeout", settings,
     1735                           1, 30, 1, false);
    16091736    gs->setLabel(QObject::tr("Program Info OSD time-out"));
    16101737    gs->setValue(3);
    16111738    gs->setHelpText(QObject::tr("Length of time the on-screen display "
    16121739                    "will display program information."));
    1613     return gs;
     1740    return wrap(gs, settings);
    16141741}
    16151742
    1616 static HostSpinBox *OSDNotifyTimeout()
     1743static Setting *OSDNotifyTimeout(PlaySettings *settings)
    16171744{
    1618     HostSpinBox *gs = new HostSpinBox("OSDNotifyTimeout", 1, 30, 1);
     1745    CREATE_SPINBOX_SETTING(gs, "OSDNotifyTimeout", settings, 1, 30, 1, false);
    16191746    gs->setLabel(QObject::tr("UDP Notify OSD time-out"));
    16201747    gs->setValue(5);
    16211748    gs->setHelpText(QObject::tr("How many seconds an on-screen display "
    16221749                    "will be active for UDP Notify events."));
    1623     return gs;
     1750    return wrap(gs, settings);
    16241751}
    16251752
    16261753static HostSpinBox *ThemeCacheSize()
     
    16641791    return gc;
    16651792}
    16661793
    1667 static HostComboBox *OSDFont()
     1794static Setting *OSDFont(PlaySettings *settings)
    16681795{
    1669     HostComboBox *gc = new HostComboBox("OSDFont");
     1796    CREATE_COMBOBOX_SETTING(gc, "OSDFont", settings);
    16701797    gc->setLabel(QObject::tr("OSD font"));
    16711798    QDir ttf(GetFontsDir(), GetFontsNameFilter());
    16721799    gc->fillSelectionsFromDir(ttf, false);
     
    16741801    if (gc->findSelection(defaultOSDFont) > -1)
    16751802        gc->setValue(defaultOSDFont);
    16761803
    1677     return gc;
     1804    return wrap(gc, settings);
    16781805}
    16791806
    1680 static HostComboBox *OSDCCFont()
     1807static Setting *OSDCCFont(PlaySettings *settings)
    16811808{
    1682     HostComboBox *gc = new HostComboBox("OSDCCFont");
     1809    CREATE_COMBOBOX_SETTING(gc, "OSDCCFont", settings);
    16831810    gc->setLabel(QObject::tr("CC font"));
    16841811    QDir ttf(GetFontsDir(), GetFontsNameFilter());
    16851812    gc->fillSelectionsFromDir(ttf, false);
    16861813    gc->setHelpText(QObject::tr("Closed Caption font"));
    16871814
    1688     return gc;
     1815    return wrap(gc, settings);
    16891816}
    16901817
    16911818static HostComboBox __attribute__ ((unused)) *DecodeVBIFormat()
     
    17061833    return gc;
    17071834}
    17081835
    1709 static HostSpinBox *OSDCC708TextZoomPercentage(void)
     1836static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings)
    17101837{
    1711     HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5);
     1838    CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings,
     1839                           50, 200, 5, false);
    17121840    gs->setLabel(QObject::tr("Text zoom percentage"));
    17131841    gs->setValue(100);
    17141842    gs->setHelpText(QObject::tr("Use this to enlarge or shrink captions."));
    17151843
    1716     return gs;
     1844    return wrap(gs, settings);
    17171845}
    17181846
    1719 static HostComboBox *OSDCC708DefaultFontType(void)
     1847static Setting *OSDCC708DefaultFontType(PlaySettings *settings)
    17201848{
    1721     HostComboBox *hc = new HostComboBox("OSDCC708DefaultFontType");
     1849    CREATE_COMBOBOX_SETTING(hc, "OSDCC708DefaultFontType", settings);
    17221850    hc->setLabel(QObject::tr("Default Caption Font Type"));
    17231851    hc->setHelpText(
    17241852        QObject::tr("This allows you to set which font type to use "
     
    17411869    };
    17421870    for (uint i = 0; i < 7; ++i)
    17431871        hc->addSelection(typeNames[i], types[i]);
    1744     return hc;
     1872    return wrap(hc, settings);
    17451873}
    17461874
    1747 static VerticalConfigurationGroup *OSDCC708Settings(void)
     1875static VerticalConfigurationGroup *OSDCC708Settings(PlaySettings *settings)
    17481876{
    17491877    VerticalConfigurationGroup *grp =
    17501878        new VerticalConfigurationGroup(false, true, true, true);
    17511879    grp->setLabel(QObject::tr("ATSC Caption Settings"));
     1880    if (settings)
     1881        grp->setLabel(QObject::tr("Playback group settings for ") +
     1882                      settings->mGroupName + " - " +
     1883                      grp->getLabel());
    17521884
    17531885// default text zoom 1.0
    1754     grp->addChild(OSDCC708TextZoomPercentage());
     1886    grp->addChild(OSDCC708TextZoomPercentage(settings));
    17551887
    17561888// force X lines of captions
    17571889// force caption character color
     
    17601892// force background opacity
    17611893
    17621894// set default font type
    1763     grp->addChild(OSDCC708DefaultFontType());
     1895    grp->addChild(OSDCC708DefaultFontType(settings));
    17641896
    17651897    return grp;
    17661898}
    17671899
    1768 static HostComboBox *OSDCC708Font(
     1900static Setting *OSDCC708Font(
    17691901    const QString &subtype, const QString &subtypeName,
    1770     const QString &subtypeNameForHelp)
     1902    const QString &subtypeNameForHelp, PlaySettings *settings)
    17711903{
    1772     HostComboBox *gc = new HostComboBox(
    1773         QString("OSDCC708%1Font").arg(subtype));
     1904    CREATE_COMBOBOX_SETTING(gc, QString("OSDCC708%1Font").arg(subtype),
     1905                            settings);
    17741906
    17751907    gc->setLabel(subtypeName);
    17761908    QDir ttf(GetFontsDir(), GetFontsNameFilter());
     
    17781910    gc->setHelpText(
    17791911        QObject::tr("ATSC %1 closed caption font.").arg(subtypeNameForHelp));
    17801912
    1781     return gc;
     1913    return wrap(gc, settings, (subtypeName.length() > 10));
    17821914}
    17831915
    1784 static HorizontalConfigurationGroup *OSDCC708Fonts(void)
     1916static HorizontalConfigurationGroup *OSDCC708Fonts(PlaySettings *settings)
    17851917{
    17861918    HorizontalConfigurationGroup *grpmain =
    17871919        new HorizontalConfigurationGroup(false, true, true, true);
    17881920    grpmain->setLabel(QObject::tr("ATSC Caption Fonts"));
     1921    if (settings)
     1922        grpmain->setLabel(QObject::tr("Playback group settings for ") +
     1923                          settings->mGroupName + " - " +
     1924                          grpmain->getLabel());
    17891925    VerticalConfigurationGroup *col[] =
    17901926    {
    17911927        new VerticalConfigurationGroup(false, false, true, true),
     
    18211957    for (uint j = 0; j < 7; ++j)
    18221958    {
    18231959        col[i]->addChild(OSDCC708Font(subtypes[i].arg(types[j]),
    1824                                       typeNames[j], typeNames[j]));
     1960                                      typeNames[j], typeNames[j],
     1961                                      settings));
    18251962    }
    18261963    grpmain->addChild(col[i]);
    18271964
    18281965    i = 1;
    18291966    for (uint j = 0; j < 7; ++j)
    18301967    {
    1831         col[i]->addChild(OSDCC708Font(
    1832                              subtypes[i].arg(types[j]), "",
    1833                              QObject::tr("Italic") + ' ' + typeNames[j]));
     1968        col[i]->addChild(OSDCC708Font(subtypes[i].arg(types[j]),
     1969                                      (settings ? typeNames[j] : ""),
     1970                                      QObject::tr("Italic") + ' ' + typeNames[j],
     1971                                      settings));
    18341972    }
    18351973
    18361974    grpmain->addChild(col[i]);
     
    18381976    return grpmain;
    18391977}
    18401978
    1841 static HostComboBox *SubtitleCodec()
     1979static Setting *SubtitleCodec(PlaySettings *settings)
    18421980{
    1843     HostComboBox *gc = new HostComboBox("SubtitleCodec");
     1981    CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings);
    18441982
    18451983    gc->setLabel(QObject::tr("Subtitle Codec"));
    18461984    QList<QByteArray> list = QTextCodec::availableCodecs();
     
    18501988        gc->addSelection(val, val, val.toLower() == "utf-8");
    18511989    }
    18521990
    1853     return gc;
     1991    return wrap(gc, settings);
    18541992}
    18551993
    1856 static HorizontalConfigurationGroup *ExternalSubtitleSettings()
     1994static HorizontalConfigurationGroup *ExternalSubtitleSettings(PlaySettings *settings)
    18571995{
    18581996    HorizontalConfigurationGroup *grpmain =
    18591997        new HorizontalConfigurationGroup(false, true, true, true);
    18601998
    18611999    grpmain->setLabel(QObject::tr("External Subtitle Settings"));
    18622000
    1863     grpmain->addChild(SubtitleCodec());
     2001    grpmain->addChild(SubtitleCodec(settings));
    18642002
    18652003    return grpmain;
    18662004}
    18672005
    1868 static HostComboBox *OSDThemeFontSizeType()
     2006static Setting *OSDThemeFontSizeType(PlaySettings *settings)
    18692007{
    1870     HostComboBox *gc = new HostComboBox("OSDThemeFontSizeType");
     2008    CREATE_COMBOBOX_SETTING(gc, "OSDThemeFontSizeType", settings);
    18712009    gc->setLabel(QObject::tr("Font size"));
    18722010    gc->addSelection(QObject::tr("default"), "default");
    18732011    gc->addSelection(QObject::tr("small"), "small");
    18742012    gc->addSelection(QObject::tr("big"), "big");
    18752013    gc->setHelpText(QObject::tr("default: TV, small: monitor, big:"));
    1876     return gc;
     2014    return wrap(gc, settings);
    18772015}
    18782016
    18792017static HostComboBox *ChannelOrdering()
     
    18852023    return gc;
    18862024}
    18872025
    1888 static HostSpinBox *VertScanPercentage()
     2026static Setting *VertScanPercentage(PlaySettings *settings)
    18892027{
    1890     HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1);
     2028    CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings,
     2029                           -100, 100, 1, false);
    18912030    gs->setLabel(QObject::tr("Vertical scaling"));
    18922031    gs->setValue(0);
    18932032    gs->setHelpText(QObject::tr(
    18942033                        "Adjust this if the image does not fill your "
    18952034                        "screen vertically. Range -100% to 100%"));
    1896     return gs;
     2035    return wrap(gs, settings);
    18972036}
    18982037
    1899 static HostSpinBox *HorizScanPercentage()
     2038static Setting *HorizScanPercentage(PlaySettings *settings)
    19002039{
    1901     HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1);
     2040    CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings,
     2041                           -100, 100, 1, false);
    19022042    gs->setLabel(QObject::tr("Horizontal scaling"));
    19032043    gs->setValue(0);
    19042044    gs->setHelpText(QObject::tr(
    19052045                        "Adjust this if the image does not fill your "
    19062046                        "screen horizontally. Range -100% to 100%"));
    1907     return gs;
     2047    return wrap(gs, settings);
    19082048};
    19092049
    1910 static HostSpinBox *XScanDisplacement()
     2050static Setting *XScanDisplacement(PlaySettings *settings)
    19112051{
    1912     HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1);
     2052    CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings,
     2053                           -50, 50, 1, false);
    19132054    gs->setLabel(QObject::tr("Scan displacement (X)"));
    19142055    gs->setValue(0);
    19152056    gs->setHelpText(QObject::tr("Adjust this to move the image horizontally."));
    1916     return gs;
     2057    return wrap(gs, settings);
    19172058}
    19182059
    1919 static HostSpinBox *YScanDisplacement()
     2060static Setting *YScanDisplacement(PlaySettings *settings)
    19202061{
    1921     HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1);
     2062    CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings,
     2063                           -50, 50, 1, false);
    19222064    gs->setLabel(QObject::tr("Scan displacement (Y)"));
    19232065    gs->setValue(0);
    19242066    gs->setHelpText(QObject::tr("Adjust this to move the image vertically."));
    1925     return gs;
     2067    return wrap(gs, settings);
    19262068};
    19272069
    19282070static HostCheckBox *AlwaysStreamFiles()
     
    19382080    return gc;
    19392081}
    19402082
    1941 static HostCheckBox *CCBackground()
     2083static Setting *CCBackground(PlaySettings *settings)
    19422084{
    1943     HostCheckBox *gc = new HostCheckBox("CCBackground");
     2085    CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings);
    19442086    gc->setLabel(QObject::tr("Black background for closed captioning"));
    19452087    gc->setValue(false);
    19462088    gc->setHelpText(QObject::tr(
    19472089                        "If enabled, captions will be displayed "
    19482090                        "as white text over a black background "
    19492091                        "for better contrast."));
    1950     return gc;
     2092    return wrap(gc, settings);
    19512093}
    19522094
    1953 static HostCheckBox *DefaultCCMode()
     2095static Setting *DefaultCCMode(PlaySettings *settings)
    19542096{
    1955     HostCheckBox *gc = new HostCheckBox("DefaultCCMode");
     2097    CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings);
    19562098    gc->setLabel(QObject::tr("Always display closed captioning or subtitles"));
    19572099    gc->setValue(false);
    19582100    gc->setHelpText(QObject::tr(
     
    19602102                        "when playing back recordings or watching "
    19612103                        "live TV.  Closed Captioning can be turned on or off "
    19622104                        "by pressing \"T\" during playback."));
    1963     return gc;
     2105    return wrap(gc, settings);
    19642106}
    19652107
    1966 static HostCheckBox *PreferCC708()
     2108static Setting *PreferCC708(PlaySettings *settings)
    19672109{
    1968     HostCheckBox *gc = new HostCheckBox("Prefer708Captions");
     2110    CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings);
    19692111    gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions"));
    19702112    gc->setValue(true);
    19712113    gc->setHelpText(
     
    19732115            "When enabled the new EIA-708 captions will be preferred over "
    19742116            "the old EIA-608 captions in ATSC streams."));
    19752117
    1976     return gc;
     2118    return wrap(gc, settings);
    19772119}
    19782120
    1979 static HostCheckBox *EnableMHEG()
     2121static Setting *EnableMHEG(PlaySettings *settings)
    19802122{
    1981     HostCheckBox *gc = new HostCheckBox("EnableMHEG");
     2123    CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings);
    19822124    gc->setLabel(QObject::tr("Enable Interactive TV"));
    19832125    gc->setValue(false);
    19842126    gc->setHelpText(QObject::tr(
    19852127                        "If enabled, interactive TV applications (MHEG) will "
    19862128                        "be activated.  This is used for teletext and logos for "
    19872129                        "radio and channels that are currently off-air."));
    1988     return gc;
     2130    return wrap(gc, settings);
    19892131}
    19902132
    1991 static HostCheckBox *PersistentBrowseMode()
     2133static Setting *PersistentBrowseMode(PlaySettings *settings)
    19922134{
    1993     HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");
     2135    CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings);
    19942136    gc->setLabel(QObject::tr("Always use Browse mode in LiveTV"));
    19952137    gc->setValue(true);
    19962138    gc->setHelpText(
    19972139        QObject::tr(
    19982140            "If enabled, Browse mode will automatically be activated "
    19992141            "whenever you use Channel UP/DOWN while watching Live TV."));
    2000     return gc;
     2142    return wrap(gc, settings);
    20012143}
    20022144
    2003 static HostCheckBox *BrowseAllTuners()
     2145static Setting *BrowseAllTuners(PlaySettings *settings)
    20042146{
    2005     HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");
     2147    CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings);
    20062148    gc->setLabel(QObject::tr("Browse all channels"));
    20072149    gc->setValue(false);
    20082150    gc->setHelpText(
     
    20102152            "If enabled, browse mode will shows channels on all "
    20112153            "available recording devices, instead of showing "
    20122154            "channels on just the current recorder."));
    2013     return gc;
     2155    return wrap(gc, settings);
    20142156}
    20152157
    2016 static HostCheckBox *ClearSavedPosition()
     2158static Setting *ClearSavedPosition(PlaySettings *settings)
    20172159{
    2018     HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");
     2160    CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings);
    20192161    gc->setLabel(QObject::tr("Clear bookmark on playback"));
    20202162    gc->setValue(true);
    20212163    gc->setHelpText(QObject::tr("Automatically clear the bookmark on a "
    20222164                    "recording when the recording is played back.  If "
    20232165                    "disabled, you can mark the beginning with rewind "
    20242166                    "then save position."));
    2025     return gc;
     2167    return wrap(gc, settings);
    20262168}
    20272169
    2028 static HostCheckBox *AltClearSavedPosition()
     2170static Setting *AltClearSavedPosition(PlaySettings *settings)
    20292171{
    2030     HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");
     2172    CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings);
    20312173    gc->setLabel(QObject::tr("Alternate clear and save bookmark"));
    20322174    gc->setValue(true);
    20332175    gc->setHelpText(QObject::tr("During playback the Select key "
     
    20352177                    "Saved\" and \"Bookmark Cleared\". If disabled, the "
    20362178                    "Select key will save the current position for each "
    20372179                    "keypress."));
    2038     return gc;
     2180    return wrap(gc, settings);
    20392181}
    20402182
    20412183#if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU)
    2042 static HostCheckBox *UsePicControls()
     2184static Setting *UsePicControls(PlaySettings *settings)
    20432185{
    2044     HostCheckBox *gc = new HostCheckBox("UseOutputPictureControls");
     2186    CREATE_CHECKBOX_SETTING(gc, "UseOutputPictureControls", settings);
    20452187    gc->setLabel(QObject::tr("Enable picture controls"));
    20462188    gc->setValue(false);
    20472189    gc->setHelpText(
    20482190        QObject::tr(
    20492191            "If enabled, MythTV attempts to initialize picture controls "
    20502192            "(brightness, contrast, etc.) that are applied during playback."));
    2051     return gc;
     2193    return wrap(gc, settings);
    20522194}
    20532195#endif
    20542196
    2055 static HostLineEdit *UDPNotifyPort()
     2197static Setting *UDPNotifyPort(PlaySettings *settings)
    20562198{
    2057     HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");
     2199    CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings);
    20582200    ge->setLabel(QObject::tr("UDP Notify Port"));
    20592201    ge->setValue("6948");
    20602202    ge->setHelpText(QObject::tr("During playback, MythTV will listen for "
    20612203                    "connections from the \"mythtvosd\" or \"mythudprelay\" "
    20622204                    "programs on this port.  See the README in "
    20632205                    "contrib/mythnotify/ for additional information."));
    2064     return ge;
     2206    return wrap(ge, settings);
    20652207}
    20662208
    2067 static HostComboBox *PlaybackExitPrompt()
     2209static Setting *PlaybackExitPrompt(PlaySettings *settings)
    20682210{
    2069     HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");
     2211    CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings);
    20702212    gc->setLabel(QObject::tr("Action on playback exit"));
    20712213    gc->addSelection(QObject::tr("Just exit"), "0");
    20722214    gc->addSelection(QObject::tr("Save position and exit"), "2");
     
    20772219                    "when you exit playback mode.  The options available will "
    20782220                    "allow you to save your position, delete the "
    20792221                    "recording, or continue watching."));
    2080     return gc;
     2222    return wrap(gc, settings);
    20812223}
    20822224
    2083 static HostCheckBox *EndOfRecordingExitPrompt()
     2225static Setting *EndOfRecordingExitPrompt(PlaySettings *settings)
    20842226{
    2085     HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");
     2227    CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings);
    20862228    gc->setLabel(QObject::tr("Prompt at end of recording"));
    20872229    gc->setValue(false);
    20882230    gc->setHelpText(QObject::tr("If set, a menu will be displayed allowing "
    20892231                    "you to delete the recording when it has finished "
    20902232                    "playing."));
    2091     return gc;
     2233    return wrap(gc, settings);
    20922234}
    20932235
    2094 static HostCheckBox *JumpToProgramOSD()
     2236static Setting *JumpToProgramOSD(PlaySettings *settings)
    20952237{
    2096     HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");
     2238    CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings);
    20972239    gc->setLabel(QObject::tr("Jump to Program OSD"));
    20982240    gc->setValue(true);
    20992241    gc->setHelpText(QObject::tr(
     
    21022244                        "'Watch Recording' screen when 'Jump to Program' "
    21032245                        "is activated. If set, the recordings are shown "
    21042246                        "in the OSD"));
    2105     return gc;
     2247    return wrap(gc, settings);
    21062248}
    21072249
    2108 static HostCheckBox *ContinueEmbeddedTVPlay()
     2250static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings)
    21092251{
    2110     HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");
     2252    CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings);
    21112253    gc->setLabel(QObject::tr("Continue Playback When Embedded"));
    21122254    gc->setValue(false);
    21132255    gc->setHelpText(QObject::tr(
     
    21152257                    "is embedded in the upcoming program list or recorded "
    21162258                    "list. The default is to pause the recorded show when "
    21172259                    "embedded."));
    2118     return gc;
     2260    return wrap(gc, settings);
    21192261}
    21202262
    2121 static HostCheckBox *AutomaticSetWatched()
     2263static Setting *AutomaticSetWatched(PlaySettings *settings)
    21222264{
    2123     HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");
     2265    CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings);
    21242266    gc->setLabel(QObject::tr("Automatically mark a recording as watched"));
    21252267    gc->setValue(false);
    21262268    gc->setHelpText(QObject::tr("If set, when you exit near the end of a "
     
    21282270                    "detection is not foolproof, so do not enable this "
    21292271                    "setting if you don't want an unwatched recording marked "
    21302272                    "as watched."));
    2131     return gc;
     2273    return wrap(gc, settings);
    21322274}
    21332275
    21342276static HostSpinBox *LiveTVIdleTimeout()
     
    23652507    return gc;
    23662508}
    23672509
    2368 static HostComboBox *LetterboxingColour()
     2510static Setting *LetterboxingColour(PlaySettings *settings)
    23692511{
    2370     HostComboBox *gc = new HostComboBox("LetterboxColour");
     2512    CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings);
    23712513    gc->setLabel(QObject::tr("Letterboxing Color"));
    23722514    for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
    23732515        gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
     
    23772519            "letterboxing, but those with plasma screens may prefer gray "
    23782520            "to minimize burn-in.") + " " +
    23792521        QObject::tr("Currently only works with XVideo video renderer."));
    2380     return gc;
     2522    return wrap(gc, settings);
    23812523}
    23822524
    2383 static HostComboBox *AspectOverride()
     2525static Setting *AspectOverride(PlaySettings *settings)
    23842526{
    2385     HostComboBox *gc = new HostComboBox("AspectOverride");
     2527    CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings);
    23862528    gc->setLabel(QObject::tr("Video Aspect Override"));
    23872529    for (int m = kAspect_Off; m < kAspect_END; ++m)
    23882530        gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
     
    23902532                        "When enabled, these will override the aspect "
    23912533                        "ratio specified by any broadcaster for all "
    23922534                        "video streams."));
    2393     return gc;
     2535    return wrap(gc, settings);
    23942536}
    23952537
    2396 static HostComboBox *AdjustFill()
     2538static Setting *AdjustFill(PlaySettings *settings)
    23972539{
    2398     HostComboBox *gc = new HostComboBox("AdjustFill");
     2540    CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings);
    23992541    gc->setLabel(QObject::tr("Zoom"));
    24002542    gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff),
    24012543                     QString::number(kAdjustFill_AutoDetect_DefaultOff));
     
    24062548    gc->setHelpText(QObject::tr(
    24072549                        "When enabled, these will apply a predefined "
    24082550                        "zoom to all video playback in MythTV."));
    2409     return gc;
     2551    return wrap(gc, settings);
    24102552}
    24112553
    24122554// Theme settings
     
    28252967    return gc;
    28262968}
    28272969
    2828 ThemeSelector::ThemeSelector(QString label):
    2829     HostImageSelect(label) {
    2830 
     2970static Setting *ThemeSelector(QString label, PlaySettings *settings=NULL)
     2971{
     2972    CREATE_IMAGESELECT_SETTING(gs, label, settings);
    28312973    ThemeType themetype = THEME_UI;
    28322974
    28332975    if (label == "Theme")
    28342976    {
    28352977        themetype = THEME_UI;
    2836         setLabel(QObject::tr("UI Theme"));
     2978        gs->setLabel(QObject::tr("UI Theme"));
    28372979    }
    28382980    else if (label == "OSDTheme")
    28392981    {
    28402982        themetype = THEME_OSD;
    2841         setLabel(QObject::tr("OSD Theme"));
     2983        gs->setLabel(QObject::tr("OSD Theme"));
    28422984    }
    28432985    else if (label == "MenuTheme")
    28442986    {
    28452987        themetype = THEME_MENU;
    2846         setLabel(QObject::tr("Menu Theme"));
     2988        gs->setLabel(QObject::tr("Menu Theme"));
    28472989    }
    28482990
    28492991    QDir themes(GetThemesParentDir());
     
    29073049            VERBOSE(VB_IMPORTANT, QString("Problem reading theme preview image"
    29083050                                          " %1").arg(preview.filePath()));
    29093051
    2910         addImageSelection(name, previewImage, theme.fileName());
     3052        gs->addImageSelection(name, previewImage, theme.fileName());
    29113053    }
    29123054
    29133055    if (themetype & THEME_UI)
    2914         setValue(DEFAULT_UI_THEME);
     3056        gs->setValue(DEFAULT_UI_THEME);
    29153057    else if (themetype & THEME_OSD)
    2916         setValue("BlackCurves-OSD");
     3058        gs->setValue("BlackCurves-OSD");
     3059
     3060    return wrap(gs, settings);
    29173061}
    29183062
    29193063static HostComboBox *ChannelFormat()
     
    35983742    return gs;
    35993743}
    36003744
    3601 static HostCheckBox *RealtimePriority()
     3745static Setting *RealtimePriority(PlaySettings *settings)
    36023746{
    3603     HostCheckBox *gc = new HostCheckBox("RealtimePriority");
     3747    CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings);
    36043748    gc->setLabel(QObject::tr("Enable realtime priority threads"));
    36053749    gc->setHelpText(QObject::tr("When running mythfrontend with root "
    36063750                    "privileges, some threads can be given enhanced priority. "
    36073751                    "Disable this if mythfrontend freezes during video "
    36083752                    "playback."));
    36093753    gc->setValue(true);
    3610     return gc;
     3754    return wrap(gc, settings, false);
    36113755}
    36123756
    36133757static HostCheckBox *EnableMediaMon()
     
    37633907};
    37643908
    37653909#ifdef USING_OPENGL_VSYNC
    3766 static HostCheckBox *UseOpenGLVSync()
     3910static Setting *UseOpenGLVSync(PlaySettings *settings)
    37673911{
    3768     HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");
     3912    CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings);
    37693913    gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing"));
    37703914    gc->setValue(false);
    37713915    gc->setHelpText(QObject::tr(
    37723916                        "If it is supported by your hardware/drivers, "
    37733917                        "MythTV will use OpenGL vertical syncing for "
    37743918                        "video timing, reducing frame jitter."));
    3775     return gc;
     3919    return wrap(gc, settings);
    37763920}
    37773921#endif
    37783922
     
    41984342    return gc;
    41994343}
    42004344
    4201 MainGeneralSettings::MainGeneralSettings()
     4345MainGeneralSettings::MainGeneralSettings(PlaySettings *settings,
     4346                                         ConfigurationWizard *base)
    42024347{
     4348    if (!settings)
     4349    {
    42034350    DatabaseSettings::addDatabaseSettings(this);
    42044351
    42054352    VerticalConfigurationGroup *pin =
     
    42514398    remotecontrol->addChild(NetworkControlEnabled());
    42524399    remotecontrol->addChild(NetworkControlPort());
    42534400    addChild(remotecontrol);
     4401    }
    42544402}
    42554403
    4256 PlaybackSettings::PlaybackSettings()
     4404PlaybackSettings::PlaybackSettings(PlaySettings *settings,
     4405                                   ConfigurationWizard *base)
    42574406{
    42584407    uint i = 0, total = 8;
    42594408#if CONFIG_DARWIN
    42604409    total += 2;
    42614410#endif // USING_DARWIN
     4411    if (settings)
     4412        total -= 3;
    42624413
    42634414
    42644415    VerticalConfigurationGroup* general1 =
    42654416        new VerticalConfigurationGroup(false);
    42664417    general1->setLabel(QObject::tr("General Playback") +
    42674418                      QString(" (%1/%2)").arg(++i).arg(total));
     4419    if (settings)
     4420        general1->setLabel(QObject::tr("Playback group settings for ") +
     4421                           settings->mGroupName + " - " +
     4422                           general1->getLabel());
    42684423
    42694424    HorizontalConfigurationGroup *columns =
    42704425        new HorizontalConfigurationGroup(false, false, true, true);
    42714426
    42724427    VerticalConfigurationGroup *column1 =
    42734428        new VerticalConfigurationGroup(false, false, true, true);
    4274     column1->addChild(RealtimePriority());
    4275     column1->addChild(DecodeExtraAudio());
    4276     column1->addChild(JumpToProgramOSD());
     4429    if (!settings)
     4430        column1->addChild(RealtimePriority(settings));
     4431    column1->addChild(DecodeExtraAudio(settings));
     4432    column1->addChild(JumpToProgramOSD(settings));
    42774433    columns->addChild(column1);
    42784434
    42794435    VerticalConfigurationGroup *column2 =
    42804436        new VerticalConfigurationGroup(false, false, true, true);
    4281     column2->addChild(ClearSavedPosition());
    4282     column2->addChild(AltClearSavedPosition());
    4283     column2->addChild(AutomaticSetWatched());
    4284     column2->addChild(ContinueEmbeddedTVPlay());
     4437    column2->addChild(ClearSavedPosition(settings));
     4438    column2->addChild(AltClearSavedPosition(settings));
     4439    column2->addChild(AutomaticSetWatched(settings));
     4440    column2->addChild(ContinueEmbeddedTVPlay(settings));
    42854441    columns->addChild(column2);
    42864442
    42874443    general1->addChild(columns);
    4288     general1->addChild(LiveTVIdleTimeout());
    4289     general1->addChild(AlwaysStreamFiles());
     4444    if (!settings)
     4445        general1->addChild(LiveTVIdleTimeout());
     4446    if (!settings)
     4447        general1->addChild(AlwaysStreamFiles());
    42904448#ifdef USING_OPENGL_VSYNC
    4291     general1->addChild(UseOpenGLVSync());
     4449    general1->addChild(UseOpenGLVSync(settings));
    42924450#endif // USING_OPENGL_VSYNC
    42934451#if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU)
    4294     general1->addChild(UsePicControls());
     4452    general1->addChild(UsePicControls(settings));
    42954453#endif // USING_XV
    4296     addChild(general1);
     4454    if (base)
     4455        base->addChild(general1);
     4456    else
     4457        addChild(general1);
    42974458
    42984459    VerticalConfigurationGroup* general2 =
    42994460        new VerticalConfigurationGroup(false);
    43004461    general2->setLabel(QObject::tr("General Playback") +
    43014462                      QString(" (%1/%2)").arg(++i).arg(total));
     4463    if (settings)
     4464        general2->setLabel(QObject::tr("Playback group settings for ") +
     4465                           settings->mGroupName + " - " +
     4466                           general2->getLabel());
    43024467
    43034468    HorizontalConfigurationGroup* oscan =
    43044469        new HorizontalConfigurationGroup(false, false, true, true);
     
    43064471        new VerticalConfigurationGroup(false, false, true, true);
    43074472    VerticalConfigurationGroup *ocol2 =
    43084473        new VerticalConfigurationGroup(false, false, true, true);
    4309     ocol1->addChild(VertScanPercentage());
    4310     ocol1->addChild(YScanDisplacement());
    4311     ocol2->addChild(HorizScanPercentage());
    4312     ocol2->addChild(XScanDisplacement());
     4474    ocol1->addChild(VertScanPercentage(settings));
     4475    ocol1->addChild(YScanDisplacement(settings));
     4476    ocol2->addChild(HorizScanPercentage(settings));
     4477    ocol2->addChild(XScanDisplacement(settings));
    43134478    oscan->addChild(ocol1);
    43144479    oscan->addChild(ocol2);
    43154480
    43164481    HorizontalConfigurationGroup* aspect_fill =
    43174482        new HorizontalConfigurationGroup(false, false, true, true);
    4318     aspect_fill->addChild(AspectOverride());
    4319     aspect_fill->addChild(AdjustFill());
     4483    aspect_fill->addChild(AspectOverride(settings));
     4484    aspect_fill->addChild(AdjustFill(settings));
    43204485
    43214486    general2->addChild(oscan);
    43224487    general2->addChild(aspect_fill);
    4323     general2->addChild(LetterboxingColour());
    4324     general2->addChild(PIPLocationComboBox());
    4325     general2->addChild(PlaybackExitPrompt());
    4326     general2->addChild(EndOfRecordingExitPrompt());
    4327     addChild(general2);
     4488    general2->addChild(LetterboxingColour(settings));
     4489    general2->addChild(PIPLocationComboBox(settings));
     4490    general2->addChild(PlaybackExitPrompt(settings));
     4491    general2->addChild(EndOfRecordingExitPrompt(settings));
     4492    if (base)
     4493        base->addChild(general2);
     4494    else
     4495        addChild(general2);
    43284496
    43294497    QString tmp = QString(" (%1/%2)").arg(++i).arg(total);
    4330     addChild(new PlaybackProfileConfigs(tmp));
     4498    if (base)
     4499        base->addChild(new PlaybackProfileConfigs(tmp, settings));
     4500    else
     4501        addChild(new PlaybackProfileConfigs(tmp, settings));
    43314502
     4503    if (!settings)
     4504    {
    43324505    VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false);
    43334506    pbox->setLabel(QObject::tr("View Recordings") +
    43344507                   QString(" (%1/%2)").arg(++i).arg(total));
     
    43564529    pbox3->addChild(DisplayGroupTitleSort());
    43574530    pbox3->addChild(new WatchListSettings());
    43584531    addChild(pbox3);
     4532    }
    43594533
    43604534    VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false);
    43614535    seek->setLabel(QObject::tr("Seeking") +
    43624536                   QString(" (%1/%2)").arg(++i).arg(total));
    4363     seek->addChild(SmartForward());
    4364     seek->addChild(FFRewReposTime());
    4365     seek->addChild(FFRewReverse());
    4366     seek->addChild(ExactSeeking());
    4367     addChild(seek);
     4537    if (settings)
     4538        seek->setLabel(QObject::tr("Playback group settings for ") +
     4539                       settings->mGroupName + " - " +
     4540                       seek->getLabel());
     4541    seek->addChild(SmartForward(settings));
     4542    seek->addChild(FFRewReposTime(settings));
     4543    seek->addChild(FFRewReverse(settings));
     4544    seek->addChild(ExactSeeking(settings));
     4545    if (base)
     4546        base->addChild(seek);
     4547    else
     4548        addChild(seek);
    43684549
    43694550    VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false);
    43704551    comms->setLabel(QObject::tr("Commercial Skip") +
    43714552                    QString(" (%1/%2)").arg(++i).arg(total));
    4372     comms->addChild(AutoCommercialSkip());
    4373     comms->addChild(CommRewindAmount());
    4374     comms->addChild(CommNotifyAmount());
     4553    if (settings)
     4554        comms->setLabel(QObject::tr("Playback group settings for ") +
     4555                        settings->mGroupName + " - " +
     4556                        comms->getLabel());
     4557    comms->addChild(AutoCommercialSkip(settings));
     4558    comms->addChild(CommRewindAmount(settings));
     4559    comms->addChild(CommNotifyAmount(settings));
     4560    if (!settings) // these are global settings, not host-specific
     4561    {
    43754562    comms->addChild(MaximumCommercialSkip());
    43764563    comms->addChild(MergeShortCommBreaks());
    43774564    comms->addChild(CommSkipAllBlanks());
    4378     addChild(comms);
     4565    }
     4566    if (base)
     4567        base->addChild(comms);
     4568    else
     4569        addChild(comms);
    43794570
    43804571#if CONFIG_DARWIN
    43814572    VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false);
    43824573    mac1->setLabel(QObject::tr("Mac OS X video settings") +
    43834574                   QString(" (%1/%2)").arg(++i).arg(total));
     4575    if (settings)
     4576        mac1->setLabel(QObject::tr("Playback group settings for ") +
     4577                       settings->mGroupName + " - " +
     4578                       mac1->getLabel());
     4579    if (!settings)
     4580    {
    43844581    mac1->addChild(MacGammaCorrect());
    43854582    mac1->addChild(MacScaleUp());
    43864583    mac1->addChild(MacFullSkip());
    4387     addChild(mac1);
     4584    }
     4585    if (base)
     4586        base->addChild(mac1);
     4587    else
     4588        addChild(mac1);
    43884589
    43894590    VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false);
    43904591    mac2->setLabel(QObject::tr("Mac OS X video settings") +
    43914592                   QString(" (%1/%2)").arg(++i).arg(total));
     4593    if (settings)
     4594        mac2->setLabel(QObject::tr("Playback group settings for ") +
     4595                       settings->mGroupName + " - " +
     4596                       mac2->getLabel());
     4597    if (!setings)
     4598    {
    43924599    mac2->addChild(new MacMainSettings());
    43934600    mac2->addChild(new MacFloatSettings());
    43944601
     
    43974604    row->addChild(new MacDockSettings());
    43984605    row->addChild(new MacDesktopSettings());
    43994606    mac2->addChild(row);
     4607    }
    44004608
    4401     addChild(mac2);
     4609    if (base)
     4610        base->addChild(mac2);
     4611    else
     4612        addChild(mac2);
    44024613#endif
    44034614}
    44044615
    4405 OSDSettings::OSDSettings()
     4616OSDSettings::OSDSettings(PlaySettings *settings,
     4617                         ConfigurationWizard *base)
    44064618{
    44074619    VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false);
    44084620    osd->setLabel(QObject::tr("On-screen display"));
     4621    if (settings)
     4622        osd->setLabel(QObject::tr("Playback group settings for ") +
     4623                      settings->mGroupName + " - " +
     4624                      osd->getLabel());
    44094625
    4410     osd->addChild(new ThemeSelector("OSDTheme"));
    4411     osd->addChild(OSDGeneralTimeout());
    4412     osd->addChild(OSDProgramInfoTimeout());
    4413     osd->addChild(OSDFont());
    4414     osd->addChild(OSDThemeFontSizeType());
    4415     osd->addChild(EnableMHEG());
    4416     osd->addChild(PersistentBrowseMode());
    4417     osd->addChild(BrowseAllTuners());
    4418     addChild(osd);
     4626    osd->addChild(ThemeSelector("OSDTheme", settings));
     4627    osd->addChild(OSDGeneralTimeout(settings));
     4628    osd->addChild(OSDProgramInfoTimeout(settings));
     4629    osd->addChild(OSDFont(settings));
     4630    osd->addChild(OSDThemeFontSizeType(settings));
     4631    osd->addChild(EnableMHEG(settings));
     4632    if (!settings)
     4633    {
     4634    osd->addChild(PersistentBrowseMode(settings));
     4635    osd->addChild(BrowseAllTuners(settings));
     4636    }
     4637    if (base)
     4638        base->addChild(osd);
     4639    else
     4640        addChild(osd);
    44194641
    44204642    VerticalConfigurationGroup *udp = new VerticalConfigurationGroup(false);
    44214643    udp->setLabel(QObject::tr("UDP OSD Notifications"));
    4422     udp->addChild(OSDNotifyTimeout());
    4423     udp->addChild(UDPNotifyPort());
    4424     addChild(udp);
     4644    if (settings)
     4645        udp->setLabel(QObject::tr("Playback group settings for ") +
     4646                      settings->mGroupName + " - " +
     4647                      udp->getLabel());
     4648    udp->addChild(OSDNotifyTimeout(settings));
     4649    udp->addChild(UDPNotifyPort(settings));
     4650    if (base)
     4651        base->addChild(udp);
     4652    else
     4653        addChild(udp);
    44254654
    44264655    VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false);
    44274656    cc->setLabel(QObject::tr("Analog Closed Captions"));
    4428     cc->addChild(OSDCCFont());
     4657    if (settings)
     4658        cc->setLabel(QObject::tr("Playback group settings for ") +
     4659                     settings->mGroupName + " - " +
     4660                     cc->getLabel());
     4661    cc->addChild(OSDCCFont(settings));
    44294662    //cc->addChild(DecodeVBIFormat());
    4430     cc->addChild(CCBackground());
    4431     cc->addChild(DefaultCCMode());
    4432     cc->addChild(PreferCC708());
    4433     addChild(cc);
     4663    cc->addChild(CCBackground(settings));
     4664    cc->addChild(DefaultCCMode(settings));
     4665    cc->addChild(PreferCC708(settings));
     4666    if (base)
     4667        base->addChild(cc);
     4668    else
     4669        addChild(cc);
    44344670
    4435     addChild(OSDCC708Settings());
    4436     addChild(OSDCC708Fonts());
    4437     addChild(ExternalSubtitleSettings());
     4671    if (base)
     4672    {
     4673        base->addChild(OSDCC708Settings(settings));
     4674        base->addChild(OSDCC708Fonts(settings));
     4675        base->addChild(ExternalSubtitleSettings(settings));
     4676    }
     4677    else
     4678    {
     4679        addChild(OSDCC708Settings(settings));
     4680        addChild(OSDCC708Fonts(settings));
     4681        addChild(ExternalSubtitleSettings(settings));
     4682    }
    44384683
    44394684#if CONFIG_DARWIN
    44404685    // Any Mac OS-specific OSD stuff would go here.
     
    45864831    VerticalConfigurationGroup* theme = new VerticalConfigurationGroup(false);
    45874832    theme->setLabel(QObject::tr("Theme"));
    45884833
    4589     theme->addChild(new ThemeSelector("Theme"));
     4834    theme->addChild(ThemeSelector("Theme"));
    45904835
    45914836    theme->addChild(ThemeCacheSize());
    45924837
  • 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"
     
    486487        delete statusbox;
    487488}
    488489
     490ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     491{
     492    return new PlaybackSettings(settings, base);
     493}
     494
     495ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     496{
     497    return new OSDSettings(settings, base);
     498}
     499
     500ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     501{
     502    return new MainGeneralSettings(settings, base);
     503}
     504
     505static PlayGroupEditor::SettingsLookup pbgroupSetup[] = {
     506    createPlaybackSettingsForPlaybackGroup,
     507    createOSDSettingsForPlaybackGroup,
     508    createMainGeneralSettingsForPlaybackGroup
     509};
     510
    489511void TVMenuCallback(void *data, QString &selection)
    490512{
    491513    (void)data;
     
    578600    }
    579601    else if (sel == "settings playgroup")
    580602    {
    581         PlayGroupEditor editor;
     603        PlayGroupEditor editor(pbgroupSetup,
     604                               sizeof(pbgroupSetup)/sizeof(*pbgroupSetup));
    582605        editor.exec();
    583606    }
    584607    else if (sel == "settings general")
     
    770793            }
    771794        }
    772795        delete tmprbuf;
     796        pginfo->SetPlaybackGroup("Videos");
    773797    }
    774798    else if (pginfo->IsVideo())
     799    {
    775800        pos = pginfo->QueryBookmark();
     801        pginfo->SetPlaybackGroup("Videos");
     802    }
    776803
    777804    if (pos > 0)
    778805    {
  • programs/mythfrontend/globalsettings.h

     
    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

     
    2121#include "mythuihelper.h"
    2222#include "dbcheck.h"
    2323#include "myththemebase.h"
     24#include "playsettings.h"
    2425
    2526static void *run_priv_thread(void *data)
    2627{
     
    182183   
    183184    GetMythUI()->LoadQtConfig();
    184185
    185 #if defined(Q_OS_MACX)
    186     // Mac OS X doesn't define the AudioOutputDevice setting
    187 #else
    188     QString auddevice = gCoreContext->GetSetting("AudioOutputDevice");
    189     if (auddevice.isEmpty())
    190     {
    191         VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "
    192                 "to run 'mythfrontend', not 'mythtv'.");
    193         return TV_EXIT_NO_AUDIO;
    194     }
    195 #endif
    196 
    197186    MythMainWindow *mainWindow = GetMythMainWindow();
    198187    mainWindow->Init();
    199188    MythThemeBase *theme = new MythThemeBase();
     
    207196        return GENERIC_EXIT_DB_OUTOFDATE;
    208197    }
    209198
    210     TV *tv = new TV();
     199    QString playgroup("");
     200    if (!filename.isEmpty())
     201    {
     202        ProgramInfo pg(filename);
     203        playgroup = pg.GetPlaybackGroup();
     204    }
     205    PlaySettings settings(playgroup);
     206
     207#if defined(Q_OS_MACX)
     208    // Mac OS X doesn't define the AudioOutputDevice setting
     209#else
     210    QString auddevice = settings.GetSetting("AudioOutputDevice", "");
     211    if (auddevice.isEmpty())
     212    {
     213        VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "
     214                "to run 'mythfrontend', not 'mythtv'.");
     215        return TV_EXIT_NO_AUDIO;
     216    }
     217#endif
     218
     219    TV *tv = new TV(&settings);
    211220    if (!tv->Init())
    212221    {
    213222        VERBOSE(VB_IMPORTANT, "Fatal Error: Could not initialize TV class.");