Ticket #8088: 8088_playgroups_v11.patch

File 8088_playgroups_v11.patch, 168.2 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));
     
    672659
    673660    if (using_null_videoout)
    674661    {
    675         videoOutput = new VideoOutputNull();
     662        videoOutput = new VideoOutputNull(GetPlaySettings());
    676663        if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(),
    677664                               video_aspect, 0, 0, 0, 0, 0, 0))
    678665        {
     
    720707            pipState,
    721708            video_disp_dim, video_aspect,
    722709            widget->winId(), display_rect, (video_frame_rate * play_speed),
    723             0 /*embedid*/);
     710            0 /*embedid*/, GetPlaySettings());
    724711
    725712        if (!videoOutput)
    726713        {
     
    742729        videoOutput->EmbedInWidget(embx, emby, embw, embh);
    743730    }
    744731
    745     SetCaptionsEnabled(gCoreContext->GetNumSetting("DefaultCCMode"), false);
     732    SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0),
     733                       false);
    746734
    747735    InitFilters();
    748736
     
    793781
    794782void NuppelVideoPlayer::ReinitVideo(void)
    795783{
    796     if (!videoOutput->IsPreferredRenderer(video_disp_dim))
     784    if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings()))
    797785    {
    798786        VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer."));
    799787        SetErrored(QObject::tr("Need to switch video renderer."));
     
    861849
    862850    if (!audioOutput && !using_null_videoout && player_ctx->IsAudioNeeded())
    863851    {
    864         bool setVolume = gCoreContext->GetNumSetting("MythControlsVolume", 1);
     852        bool setVolume =
     853            GetPlaySettings()->GetNumSetting("MythControlsVolume", 1);
    865854        audioOutput = AudioOutput::OpenAudio(audio_main_device,
    866855                                             audio_passthru_device,
    867856                                             audio_bits, audio_channels,
    868857                                             audio_codec, audio_samplerate,
    869858                                             AUDIOOUTPUT_VIDEO,
    870                                              setVolume, audio_passthru);
     859                                             setVolume, audio_passthru,
     860                                             GetPlaySettings());
    871861        if (!audioOutput)
    872862            errMsg = QObject::tr("Unable to create AudioOutput.");
    873863        else
     
    899889    if (audioOutput)
    900890    {
    901891        const AudioSettings settings(audio_bits, audio_channels, audio_codec,
    902                                      audio_samplerate, audio_passthru);
     892                                     audio_samplerate, audio_passthru,
     893                                     GetPlaySettings());
    903894        audioOutput->Reconfigure(settings);
    904895        if (audio_passthru)
    905896            audio_channels = 2;
     
    29372928        m_double_process = videoOutput->IsExtraProcessingRequired();
    29382929
    29392930        videosync = VideoSync::BestMethod(
    2940             videoOutput, fr_int, rf_int, m_double_framerate);
     2931            videoOutput, GetPlaySettings(),
     2932            fr_int, rf_int, m_double_framerate);
    29412933
    29422934        // Make sure video sync can do it
    29432935        if (videosync != NULL && m_double_framerate)
     
    34213413        QRect visible, total;
    34223414        float aspect, scaling;
    34233415
    3424         osd = new OSD();
     3416        osd = new OSD(GetPlaySettings());
    34253417
    34263418        osd->SetListener(m_tv);
    34273419
     
    35003492
    35013493        GetDecoder()->setExactSeeks(seeks);
    35023494
    3503         if (gCoreContext->GetNumSetting("ClearSavedPosition", 1) &&
     3495        if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) &&
    35043496            !player_ctx->IsPIP())
    35053497        {
    35063498            if (player_ctx->buffer->isDVD())
     
    37683760            ++deleteIter;
    37693761            if (deleteIter.key() == totalFrames)
    37703762            {
    3771                 if (!(gCoreContext->GetNumSetting("EndOfRecordingExitPrompt") == 1
     3763                if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1
    37723764                      && !player_ctx->IsPIP() &&
    37733765                      player_ctx->GetState() == kState_WatchingPreRecorded))
    37743766                {
     
    39423934
    39433935    if (sim_pip_players.isEmpty())
    39443936    {
    3945         return (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft);
     3937        return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation",
     3938                                                             kPIPTopLeft);
    39463939    }
    39473940
    39483941    // order of preference, could be stored in db if we want it configurable
     
    47334726    exactseeks   = frame_exact_seek;
    47344727    player_ctx   = ctx;
    47354728    livetv       = ctx->tvchain;
     4729
     4730    vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", ""));
     4731
     4732    // Playback (output) zoom control
     4733    detect_letter_box = new DetectLetterbox(this);
     4734
     4735    commrewindamount = GetPlaySettings()->GetNumSetting("CommRewindAmount", 0);
     4736    commnotifyamount = GetPlaySettings()->GetNumSetting("CommNotifyAmount", 0);
     4737    decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0);
     4738    itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0);
     4739    db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1);
     4740    autocommercialskip = (CommSkipMode)
     4741        GetPlaySettings()->GetNumSetting("AutoCommercialSkip", kCommSkipOff);
     4742    SetAudioInfo(GetPlaySettings()->GetSetting("AudioOutputDevice", ""),
     4743                 GetPlaySettings()->GetSetting("PassThruOutputDevice", ""),
     4744                 gCoreContext->GetNumSetting("AudioSampleRate", 44100));
    47364745}
    47374746
    47384747void NuppelVideoPlayer::SetDeleteIter(void)
     
    74047413{
    74057414    QMutexLocker locker(&subtitleLock);
    74067415    textSubtitles.Clear();
    7407     return TextSubtitleParser::LoadSubtitles(subtitleFileName, textSubtitles);
     7416    return TextSubtitleParser::LoadSubtitles(subtitleFileName, textSubtitles,
     7417                                             GetPlaySettings());
    74087418}
    74097419
    74107420void 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,
     
    1718    detectLetterboxPossibleHalfFrame = -1;
    1819    detectLetterboxPossibleFullFrame = -1;
    1920    detectLetterboxDetectedMode = nvp->GetAdjustFill();
    20     detectLetterboxLimit = gCoreContext->GetNumSetting("DetectLeterboxLimit", 75);
     21    detectLetterboxLimit =
     22        nvp->GetPlaySettings()->GetNumSetting("DetectLeterboxLimit", 75);
    2123    nupple_video_player = nvp;
    2224}
    2325
  • 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

     
    2727#include "DVDRingBuffer.h"
    2828#include "videodisplayprofile.h"
    2929#include "mythuihelper.h"
     30#include "playsettings.h"
    3031
    3132#include "lcddevice.h"
    3233
     
    517518    av_log_set_level((debug) ? AV_LOG_DEBUG : AV_LOG_ERROR);
    518519    av_log_set_callback(myth_av_log);
    519520
    520     max_channels = (uint) gCoreContext->GetNumSetting("MaxChannels", 2);
    521     allow_ac3_passthru = (max_channels > 2) ? gCoreContext->GetNumSetting("AC3PassThru", false) : false;
    522     allow_dts_passthru = (max_channels > 2) ? gCoreContext->GetNumSetting("DTSPassThru", false) : false;
    523     internal_vol = gCoreContext->GetNumSetting("MythControlsVolume", 0);
     521    max_channels =
     522        (uint) GetNVP()->GetPlaySettings()->GetNumSetting("MaxChannels", 2);
     523    allow_ac3_passthru = (max_channels > 2) ?
     524        GetNVP()->GetPlaySettings()->GetNumSetting("AC3PassThru", false) :
     525        false;
     526    allow_dts_passthru = (max_channels > 2) ?
     527        GetNVP()->GetPlaySettings()->GetNumSetting("DTSPassThru", false) :
     528        false;
     529    internal_vol =
     530        GetNVP()->GetPlaySettings()->GetNumSetting("MythControlsVolume", 0);
    524531
    525532    audioIn.sample_size = -32; // force SetupAudioStream to run once
    526533    itv = GetNVP()->GetInteractiveTV();
    527534
    528535    cc608_build_parity_table(cc608_parity_table);
    529536
    530     if (gCoreContext->GetNumSetting("CCBackground", 0))
     537    if (GetNVP()->GetPlaySettings()->GetNumSetting("CCBackground", 0))
    531538        CC708Window::forceWhiteOnBlackText = true;
    532539
    533540    no_dts_hack = false;
     
    14271434    {
    14281435        directrendering = true;
    14291436        if (
    1430         !gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&
     1437        !GetNVP()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) &&
    14311438        !CODEC_IS_HWACCEL(codec))
    14321439    {
    14331440        SetLowBuffers(false);
     
    19071914
    19081915                if (!is_db_ignored)
    19091916                {
    1910                     VideoDisplayProfile vdp;
     1917                    VideoDisplayProfile vdp(GetNVP()->GetPlaySettings());
    19111918                    vdp.SetInput(QSize(width, height));
    19121919                    dec = vdp.GetDecoder();
    19131920                    thread_count = vdp.GetMaxCPUs();
     
    19351942                    MythCodecID vdpau_mcid;
    19361943                    vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec(
    19371944                        width, height,
    1938                         mpeg_version(enc->codec_id), no_hardware_decoders);
     1945                        mpeg_version(enc->codec_id), no_hardware_decoders,
     1946                        GetNVP()->GetPlaySettings());
    19391947
    19401948                    if (vdpau_mcid >= video_codec_id)
    19411949                    {
     
    19671975                        /* mpeg type    */ mpeg_version(enc->codec_id),
    19681976                        /* xvmc pix fmt */ xvmc_pixel_format(enc->pix_fmt),
    19691977                        /* test surface */ codec_is_std(video_codec_id),
    1970                         /* force_xv     */ force_xv);
     1978                        /* force_xv     */ force_xv,
     1979                        GetNVP()->GetPlaySettings());
    19711980
    19721981                    if (mcid >= video_codec_id)
    19731982                    {
     
    20002009                        /* osd dim      */ 0, 0,
    20012010                        /* mpeg type    */ mpeg_version(enc->codec_id),
    20022011                        /* pixel format */
    2003                         (PIX_FMT_YUV420P == enc->pix_fmt) ? FOURCC_I420 : 0);
     2012                        (PIX_FMT_YUV420P == enc->pix_fmt) ? FOURCC_I420 : 0,
     2013                        GetNVP()->GetPlaySettings());
    20042014
    20052015                    if (quartz_mcid >= video_codec_id)
    20062016                    {
  • 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"
     
    23592360//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    23602361
    23612362OSDTypeCC::OSDTypeCC(const QString &name, TTFFont *font, int xoff, int yoff,
    2362                      int dispw, int disph, float wmult, float hmult)
     2363                     int dispw, int disph, float wmult, float hmult,
     2364                     PlaySettings *settings)
    23632365         : OSDType(name)
    23642366{
    23652367    m_font = font;
     
    23732375
    23742376    QRect rect = QRect(0, 0, 0, 0);
    23752377    m_box = new OSDTypeBox("cc_background", rect, wmult, hmult);
    2376     m_ccbackground = gCoreContext->GetNumSetting("CCBackground", 0);
     2378    m_ccbackground = settings->GetNumSetting("CCBackground", 0);
    23772379}
    23782380
    23792381OSDTypeCC::~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

     
    35663566
    35673567            VideoDisplayProfile::CreateNewProfiles(host);
    35683568            profiles = VideoDisplayProfile::GetProfiles(host);
    3569             QString profile = VideoDisplayProfile::GetDefaultProfileName(host);
     3569            QString profile =
     3570                VideoDisplayProfile::GetDefaultProfileName(host, NULL);
    35703571
    35713572            if (profiles.contains("Normal") &&
    35723573                (profile=="CPU++" || profile=="CPU+" || profile=="CPU--"))
     
    56685669"  jump int(11) NOT NULL default '0',"
    56695670"  PRIMARY KEY  (`name`)"
    56705671");",
     5672"CREATE TABLE playgroupsettings ("
     5673"  playgroupname varchar(64) NOT NULL,"
     5674"  `value` varchar(128) NOT NULL,"
     5675"  `data` text,"
     5676"  overridden tinyint(1) NOT NULL,"
     5677"  PRIMARY KEY (playgroupname, `value`)"
     5678");",
    56715679"CREATE TABLE powerpriority ("
    56725680"  priorityname varchar(64) collate utf8_bin NOT NULL,"
    56735681"  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    {
     
    450452        _nvp->DisableHardwareDecoders();
    451453
    452454    _nvp->SetPlayerInfo(tv, widget, exact_seeking, this);
    453     _nvp->SetAudioInfo(gCoreContext->GetSetting("AudioOutputDevice"),
    454                        gCoreContext->GetSetting("PassThruOutputDevice"),
    455                        gCoreContext->GetNumSetting("AudioSampleRate", 44100));
    456455    _nvp->SetAudioStretchFactor(ts_normal);
    457456    _nvp->SetLength(playingLen);
    458457
     
    913912/**
    914913 * \brief assign programinfo to the context
    915914 */
    916 void PlayerContext::SetPlayingInfo(const ProgramInfo *info)
     915void PlayerContext::SetPlayingInfo(const ProgramInfo *info,
     916                                   PlaySettings *_settings)
    917917{
    918918    bool ignoreDB = gCoreContext->IsDatabaseIgnored();
    919919
     
    925925            playingInfo->MarkAsInUse(false, recUsage);
    926926        delete playingInfo;
    927927        playingInfo = NULL;
     928        // XXX delete settings?
    928929    }
    929930
    930931    if (info)
     
    933934        if (!ignoreDB)
    934935            playingInfo->MarkAsInUse(true, recUsage);
    935936        playingLen = playingInfo->GetSecondsInRecording();
     937        settings = (_settings ? _settings :
     938                    new PlaySettings(playingInfo->GetPlaybackGroup()));
    936939    }
    937940}
    938941
  • libs/libmythtv/NuppelVideoPlayer.h

     
    196196    bool      GetAudioBufferStatus(uint &fill, uint &total) const;
    197197    PIPLocation GetNextPIPLocation(void) const;
    198198
     199    PlaySettings *GetPlaySettings(void) const {
     200        return player_ctx ? player_ctx->settings : NULL;
     201    }
     202
    199203    // Bool Gets
    200204    bool    GetRawAudioState(void) const;
    201205    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))
     
    193194    bool startInGuide = flags & kStartTVInGuide;
    194195    bool inPlaylist = flags & kStartTVInPlayList;
    195196    bool initByNetworkCommand = flags & kStartTVByNetworkCommand;
    196     TV *tv = new TV();
    197197    bool quitAll = false;
    198198    bool showDialogs = true;
    199199    bool playCompleted = false;
     
    208208        curProgram->SetIgnoreBookmark(flags & kStartTVIgnoreBookmark);
    209209    }
    210210
     211    PlaySettings settings(curProgram ? curProgram->GetPlaybackGroup() : "Default");
     212    TV *tv = new TV(&settings);
     213
    211214    // Initialize TV
    212215    if (!tv->Init())
    213216    {
     
    238241        if (curProgram)
    239242        {
    240243            VERBOSE(VB_PLAYBACK, LOC + "tv->Playback() -- begin");
    241             if (!tv->Playback(*curProgram))
     244            if (!tv->Playback(*curProgram, &settings))
    242245            {
    243246                quitAll = true;
    244247            }
     
    807810 *  \brief Performs instance initialiation not requiring access to database.
    808811 *  \sa Init(void)
    809812 */
    810 TV::TV(void)
     813TV::TV(PlaySettings *settings)
    811814    : // Configuration variables from database
    812815      baseFilters(""),
    813816      db_channel_format("<num> <sign>"),
     
    944947        kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]);
    945948
    946949    MythDB::getMythDB()->GetSettings(kv);
     950    settings->AddToMap(kv);
    947951
    948952    // convert from minutes to ms.
    949953    db_idle_timeout        = kv["LiveTVIdleTimeout"].toInt() * 60 * 1000;
     
    17381742}
    17391743
    17401744
    1741 int TV::Playback(const ProgramInfo &rcinfo)
     1745int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings)
    17421746{
    17431747    wantsToQuit   = false;
    17441748    jumpToProgram = false;
     
    17521756        return 0;
    17531757    }
    17541758
    1755     mctx->SetPlayingInfo(&rcinfo);
     1759    mctx->SetPlayingInfo(&rcinfo, settings);
    17561760    mctx->SetInitialTVState(false);
    17571761    ScheduleStateChange(mctx);
    17581762
     
    18351839
    18361840    if (fileexists)
    18371841    {
    1838         Playback(pginfo);
     1842        PlaySettings settings("Default");
     1843        Playback(pginfo, &settings);
    18391844        retval = 1;
    18401845    }
    18411846
     
    21812186        {
    21822187            OSD *osd = GetOSDLock(ctx);
    21832188            ctx->LockPlayingInfo(__FILE__, __LINE__);
    2184             if (osd && (PlayGroup::GetCount() > 0))
     2189            if (ctx->playingInfo->GetPlaybackGroup() != "Default" &&
     2190                ctx->playingInfo->GetPlaybackGroup() != "Videos" &&
     2191                osd && (PlayGroup::GetCount() > 0))
    21852192                osd->SetSettingsText(tr("%1 Settings")
    21862193                    .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup())), 3);
    21872194            ctx->UnlockPlayingInfo(__FILE__, __LINE__);
     
    51965203        return false;
    51975204    }
    51985205
    5199     InitUDPNotifyEvent();
     5206    InitUDPNotifyEvent(ctx->settings);
    52005207    bool ok = false;
    52015208    if (ctx->IsNullVideoDesired())
    52025209    {
     
    1190711914        GetMythUI()->RestoreScreensaver();
    1190811915}
    1190911916
    11910 void TV::InitUDPNotifyEvent(void)
     11917void TV::InitUDPNotifyEvent(PlaySettings *settings)
    1191111918{
    1191211919    if (db_udpnotify_port && !udpnotify)
    1191311920    {
    11914         udpnotify = new UDPNotify(db_udpnotify_port);
     11921        udpnotify = new UDPNotify(db_udpnotify_port, settings);
    1191511922        connect(udpnotify,
    1191611923                SIGNAL(AddUDPNotifyEvent(
    1191711924                        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),
     
    173175    drawSurface = new OSDSurface(osd_bounds.width(), osd_bounds.height());
    174176
    175177    if (!cc708_defaults_initialized)
    176         initialize_osd_fonts();
     178        initialize_osd_fonts(settings);
    177179
    178180    for (uint i = 0; i < 16; i++)
    179181        cc708fontnames[i] = cc708_default_font_names[i];
     
    186188    if (themepath.isEmpty())
    187189    {
    188190        VERBOSE(VB_IMPORTANT, "Couldn't find OSD theme: "
    189                 <<gCoreContext->GetSetting("OSDTheme"));
     191                <<settings->GetSetting("OSDTheme", ""));
    190192        InitDefaults();
    191193        return;
    192194    }
     
    195197    if (!LoadTheme())
    196198    {
    197199        VERBOSE(VB_IMPORTANT, "Couldn't load OSD theme: "
    198                 <<gCoreContext->GetSetting("OSDTheme")<<" at "<<themepath);
     200                <<settings->GetSetting("OSDTheme", "")<<" at "<<themepath);
    199201    }
    200202
    201203    InitDefaults();
     
    239241        QString name = "cc_font";
    240242        int fontsize = m_themeinfo->BaseRes()->height() / 27;
    241243
    242         ccfont = LoadFont(gCoreContext->GetSetting("OSDCCFont"), fontsize);
     244        ccfont = LoadFont(settings->GetSetting("OSDCCFont", ""), fontsize);
    243245
    244246        if (ccfont)
    245247            fontMap[name] = ccfont;
     
    275277
    276278    OSDTypeCC *ccpage =
    277279        new OSDTypeCC(name, ccfont, sub_xoff, sub_yoff,
    278                       sub_dispw, sub_disph, wmult, hmult);
     280                      sub_dispw, sub_disph, wmult, hmult, settings);
    279281    container->AddType(ccpage);
    280282    return true;
    281283}
     
    294296
    295297    // Create fonts...
    296298    TTFFont* ccfonts[48];
    297     uint z = gCoreContext->GetNumSetting("OSDCC708TextZoom", 100) *
     299    uint z = settings->GetNumSetting("OSDCC708TextZoom", 100) *
    298300                    m_themeinfo->BaseRes()->height();
    299301    uint fontsizes[3] = { z / 3600, z / 2900, z / 2200 };
    300302    for (uint i = 0; i < 48; i++)
     
    361363    if (!font)
    362364    {
    363365        int fontsize = (size->height() - (2 * safe_y)) / 26;
    364         font = LoadFont(gCoreContext->GetSetting("OSDCCFont"), fontsize);
     366        font = LoadFont(settings->GetSetting("OSDCCFont", ""), fontsize);
    365367
    366368        if (font)
    367369            fontMap[fontname] = font;
     
    469471    TTFFont *font = GetFont(fontname);
    470472    if (!font)
    471473    {
    472         font = LoadFont(gCoreContext->GetSetting("OSDCCFont"), SUBTITLE_FONT_SIZE);
     474        font = LoadFont(settings->GetSetting("OSDCCFont", ""),
     475                        SUBTITLE_FONT_SIZE);
    473476
    474477        if (font)
    475478        {
     
    537540
    538541    if (!actfont)
    539542    {
    540         actfont = LoadFont(gCoreContext->GetSetting("OSDFont"), 16);
     543        actfont = LoadFont(settings->GetSetting("OSDFont", ""), 16);
    541544
    542545        if (actfont)
    543546            fontMap["treemenulistfont"] = actfont;
     
    685688    if (dir.exists())
    686689    {
    687690        VERBOSE(VB_IMPORTANT, QString("Couldn't find OSD theme: %1. "
    688                 "Switching to default.").arg(gCoreContext->GetSetting("OSDTheme")));
    689         gCoreContext->OverrideSettingForSession("OSDTheme", "BlackCurves-OSD");
     691                                      "Switching to default.").arg(settings->GetSetting("OSDTheme", "")));
     692        settings->OverrideSetting/*ForSession*/("OSDTheme", "BlackCurves-OSD");
    690693        return testdir;
    691694    }
    692695
     
    853856void OSD::parseFont(QDomElement &element)
    854857{
    855858    QString name;
    856     QString fontfile = gCoreContext->GetSetting("OSDFont");
     859    QString fontfile = settings->GetSetting("OSDFont", "");
    857860    int size = -1;
    858861    int sizeSmall = -1;
    859862    int sizeBig = -1;
     
    931934        return;
    932935    }
    933936
    934     QString fontSizeType = gCoreContext->GetSetting("OSDThemeFontSizeType",
     937    QString fontSizeType = settings->GetSetting("OSDThemeFontSizeType",
    935938                                                "default");
    936939    if (fontSizeType == "small")
    937940    {
     
    31123115    return QRect(xoffset, yoffset, displaywidth, displayheight);
    31133116}
    31143117
    3115 #define OSD_STRDUP(X) strdup(gCoreContext->GetSetting(X).toLocal8Bit().constData())
     3118#define OSD_STRDUP(X) strdup(settings->GetSetting(X, "").toLocal8Bit().constData())
    31163119
    3117 static void initialize_osd_fonts(void)
     3120static void initialize_osd_fonts(PlaySettings *settings)
    31183121{
    31193122    QMutexLocker locker(&cc708_init_lock);
    31203123    if (cc708_defaults_initialized)
    31213124        return;
    31223125    cc708_defaults_initialized = true;
    31233126
    3124     QString default_font_type = gCoreContext->GetSetting(
     3127    QString default_font_type = settings->GetSetting(
    31253128        "OSDCC708DefaultFontType", "MonoSerif");
    31263129
    31273130    // 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/audiooutputbase.h

     
    155155    int orig_config_channels;
    156156    int src_quality;
    157157
     158    PlaySettings *psettings;
     159
    158160 private:
    159161    // software volume
    160162    template <class AudioDataType>
  • libs/libmyth/audiooutputalsa.cpp

     
    88
    99#include "mythcorecontext.h"
    1010#include "audiooutputalsa.h"
     11#include "playsettings.h"
    1112   
    1213#define LOC QString("ALSA: ")
    1314#define LOC_WARN QString("ALSA, Warning: ")
     
    753754{
    754755    int volume;
    755756
    756     mixer_control = gCoreContext->GetSetting("MixerControl", "PCM");
     757    mixer_control = psettings->GetSetting("MixerControl", "PCM");
    757758
    758759    SetupMixer();
    759760
    760761    if (mixer_handle != NULL && setstartingvolume)
    761762    {
    762         volume = gCoreContext->GetNumSetting("MasterMixerVolume", 80);
     763        volume = psettings->GetNumSetting("MasterMixerVolume", 80);
    763764        SetCurrentVolume("Master", 0, volume);
    764765        SetCurrentVolume("Master", 1, volume);
    765766
    766         volume = gCoreContext->GetNumSetting("PCMMixerVolume", 80);
     767        volume = psettings->GetNumSetting("PCMMixerVolume", 80);
    767768        SetCurrentVolume("PCM", 0, volume);
    768769        SetCurrentVolume("PCM", 1, volume);
    769770    }
     
    780781{
    781782    int err;
    782783
    783     QString alsadevice = gCoreContext->GetSetting("MixerDevice", "default");
     784    QString alsadevice = psettings->GetSetting("MixerDevice", "default");
    784785    QString device = alsadevice.remove(QString("ALSA:"));
    785786
    786787    if (mixer_handle != NULL)
  • libs/libmyth/volumebase.cpp

     
    88
    99#include "volumebase.h"
    1010#include "mythcorecontext.h"
     11#include "playsettings.h"
    1112
    12 VolumeBase::VolumeBase() :
     13VolumeBase::VolumeBase(PlaySettings *_settings) :
    1314    internal_vol(false), volume(80),
    14     current_mute_state(kMuteOff)
     15    current_mute_state(kMuteOff), settings(_settings)
    1516{
    1617    swvol = swvol_setting =
    17         (gCoreContext->GetSetting("MixerDevice", "default").toLower() == "software");
     18        (settings->GetSetting("MixerDevice", "default").toLower() == "software");
    1819}
    1920
    2021bool VolumeBase::SWVolume(void)
     
    3940    volume = max(min(value, 100), 0);
    4041    UpdateVolume();
    4142
    42     QString controlLabel = gCoreContext->GetSetting("MixerControl", "PCM");
     43    QString controlLabel = settings->GetSetting("MixerControl", "PCM");
    4344    controlLabel += "MixerVolume";
    4445    gCoreContext->SaveSetting(controlLabel, volume);   
    4546}
  • libs/libmyth/volumebase.h

     
    33
    44#include "mythexp.h"
    55
     6class PlaySettings;
     7
    68typedef enum {
    79    kMuteOff = 0,
    810    kMuteLeft,
     
    1315class MPUBLIC VolumeBase
    1416{
    1517  public:
    16     VolumeBase();   
     18    VolumeBase(PlaySettings *settings);   
    1719    virtual ~VolumeBase() {};
    1820
    1921    void SWVolume(bool set);
     
    4648    MuteState current_mute_state;
    4749    bool swvol;
    4850    bool swvol_setting;
     51    PlaySettings *settings;
    4952
    5053};
    5154
  • 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/audiooutputpulse.cpp

     
    1919#include <QString>
    2020
    2121#include "audiooutputpulse.h"
     22#include "playsettings.h"
    2223
    2324#define LOC     QString("PulseAudio: ")
    2425#define LOC_ERR QString("PulseAudio Error: ")
     
    547548                                     (char*)"under");
    548549    if (set_initial_vol)
    549550    {
    550         int volume = gCoreContext->GetNumSetting("MasterMixerVolume", 80);
     551        int volume = psettings->GetNumSetting("MasterMixerVolume", 80);
    551552        pa_cvolume_set(&volume_control, audio_channels,
    552553                       (float)volume * (float)PA_VOLUME_NORM / 100.0f);
    553554    }
  • libs/libmyth/audiosettings.cpp

     
    66 */
    77
    88#include "audiosettings.h"
     9#include "playsettings.h"
    910
    1011// startup_upmixer
    1112AudioSettings::AudioSettings() :
     
    1819    set_initial_vol(false),
    1920    use_passthru(false),
    2021    source(AUDIOOUTPUT_UNKNOWN),
     22    psettings(0),
    2123    upmixer(0)
    2224{
    2325}
     
    3234    set_initial_vol(other.set_initial_vol),
    3335    use_passthru(other.use_passthru),
    3436    source(other.source),
     37    psettings(other.psettings),
    3538    upmixer(other.upmixer)
    3639{
    3740}
     
    4649    AudioOutputSource audio_source,
    4750    bool audio_set_initial_vol,
    4851    bool audio_use_passthru,
     52    PlaySettings *_psettings,
    4953    int upmixer_startup) :
    5054    main_device(audio_main_device),
    5155    passthru_device(audio_passthru_device),
     
    5660    set_initial_vol(audio_set_initial_vol),
    5761    use_passthru(audio_use_passthru),
    5862    source(audio_source),
     63    psettings(_psettings),
    5964    upmixer(upmixer_startup)
    6065{
     66    if (!psettings)
     67    {
     68        QString name("Default");
     69        psettings = new PlaySettings(name);
     70    }
    6171}
    6272
    6373AudioSettings::AudioSettings(
     
    6676    int   audio_codec,
    6777    int   audio_samplerate,
    6878    bool  audio_use_passthru,
     79    PlaySettings *_psettings,
    6980    int   upmixer_startup) :
    7081    main_device(QString::null),
    7182    passthru_device(QString::null),
     
    7687    set_initial_vol(false),
    7788    use_passthru(audio_use_passthru),
    7889    source(AUDIOOUTPUT_UNKNOWN),
     90    psettings(_psettings),
    7991    upmixer(upmixer_startup)
    8092{
     93    if (!psettings)
     94    {
     95        QString name("Default");
     96        psettings = new PlaySettings(name);
     97    }
    8198}
    8299
     100AudioSettings::AudioSettings(
     101    int   audio_bits,
     102    int   audio_channels,
     103    int   audio_codec,
     104    int   audio_samplerate,
     105    bool  audio_use_passthru,
     106    int   upmixer_startup) :
     107    main_device(QString::null),
     108    passthru_device(QString::null),
     109    bits(audio_bits),
     110    channels(audio_channels),
     111    codec(audio_codec),
     112    samplerate(audio_samplerate),
     113    set_initial_vol(false),
     114    use_passthru(audio_use_passthru),
     115    source(AUDIOOUTPUT_UNKNOWN),
     116    psettings(NULL),
     117    upmixer(upmixer_startup)
     118{
     119    if (!psettings)
     120    {
     121        QString name("Default");
     122        psettings = new PlaySettings(name);
     123    }
     124}
     125
    83126void AudioSettings::FixPassThrough(void)
    84127{
    85128    if (passthru_device.isEmpty() || passthru_device.toLower() == "default")
  • libs/libmyth/audiooutputca.cpp

     
    246246
    247247    if (internal_vol && set_initial_vol)
    248248    {
    249         QString controlLabel = gCoreContext->GetSetting("MixerControl", "PCM");
     249        QString controlLabel = psettings->GetSetting("MixerControl", "PCM");
    250250        controlLabel += "MixerVolume";
    251251        SetCurrentVolume(gCoreContext->GetNumSetting(controlLabel, 80));
    252252    }
  • 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/audiooutputjack.cpp

     
    1414#include "mythcorecontext.h"
    1515#include "audiooutputjack.h"
    1616#include "util.h"
     17#include "playsettings.h"
    1718
    1819extern "C"
    1920{
     
    213214{
    214215    int volume = 100;
    215216    if (set_initial_vol)
    216         volume = gCoreContext->GetNumSetting("MasterMixerVolume", 80);
     217        volume = psettings->GetNumSetting("MasterMixerVolume", 80);
    217218
    218219    JACK_SetAllVolume(audioid, volume);
    219220}
  • libs/libmyth/audiooutputbase.cpp

     
    1515#include "audiooutputdigitalencoder.h"
    1616#include "SoundTouch.h"
    1717#include "freesurround.h"
     18#include "playsettings.h"
    1819
    1920#define LOC QString("AO: ")
    2021#define LOC_ERR QString("AO, ERROR: ")
    2122
    2223AudioOutputBase::AudioOutputBase(const AudioSettings &settings) :
     24    AudioOutput(settings.psettings),
    2325    // protected
    2426    effdsp(0),                  effdspstretched(0),
    2527    audio_channels(-1),         audio_codec(CODEC_ID_NONE),
     
    4042    set_initial_vol(settings.set_initial_vol),
    4143    buffer_output_data_for_use(false),
    4244
     45    psettings(settings.psettings),
     46
    4347    // private
    4448    need_resampler(false),
    4549
     
    8286    memset(tmp_buff,           0, sizeof(short) * kAudioTempBufSize);
    8387    memset(&audiotime_updated, 0, sizeof(audiotime_updated));
    8488    memset(audiobuffer,        0, sizeof(char)  * kAudioRingBufferSize);
    85     orig_config_channels = gCoreContext->GetNumSetting("MaxChannels", 2);
    86     src_quality = gCoreContext->GetNumSetting("AudioUpmixType", 2);
     89    orig_config_channels = psettings->GetNumSetting("MaxChannels", 2);
     90    src_quality = psettings->GetNumSetting("AudioUpmixType", 2);
    8791        //Set default upsampling quality to medium if using stereo
    8892    if (orig_config_channels == 2)
    8993        src_quality = 1;
    9094
    9195        // Handle override of SRC quality settings
    92     if (gCoreContext->GetNumSetting("AdvancedAudioSettings", false) &&
    93         gCoreContext->GetNumSetting("SRCQualityOverride", false))
     96    if (psettings->GetNumSetting("AdvancedAudioSettings", false) &&
     97        psettings->GetNumSetting("SRCQualityOverride", false))
    9498    {
    95         src_quality = gCoreContext->GetNumSetting("SRCQuality", 1);
     99        src_quality = psettings->GetNumSetting("SRCQuality", 1);
    96100            // Extra test to keep backward compatibility with earlier SRC code setting
    97101        if (src_quality > 2)
    98102            src_quality = 2;
     
    100104    }
    101105
    102106    if (!settings.upmixer)
    103         configured_audio_channels = gCoreContext->GetNumSetting("AudioDefaultUpmix", false) ? orig_config_channels : 2;
     107        configured_audio_channels =
     108            psettings->GetNumSetting("AudioDefaultUpmix", false) ?
     109            orig_config_channels : 2;
    104110    else
    105111        if (settings.upmixer == 1)
    106112            configured_audio_channels = 2;
    107113        else
    108114            configured_audio_channels = 6;
    109115
    110     allow_ac3_passthru = (orig_config_channels > 2) ? gCoreContext->GetNumSetting("AC3PassThru", false) : false;
     116    allow_ac3_passthru =
     117        (orig_config_channels > 2) ?
     118        psettings->GetNumSetting("AC3PassThru", false) : false;
    111119
    112120    // You need to call Reconfigure from your concrete class.
    113121    // Reconfigure(laudio_bits,       laudio_channels,
     
    192200
    193201    const AudioSettings settings(audio_bits, source_audio_channels,
    194202                                 audio_codec, source_audio_samplerate,
    195                                  audio_passthru);
     203                                 audio_passthru, psettings);
    196204    Reconfigure(settings);
    197205    return (configured_audio_channels == 6);
    198206}
     
    278286    killaudio = false;
    279287    pauseaudio = false;
    280288    was_paused = true;
    281     internal_vol = gCoreContext->GetNumSetting("MythControlsVolume", 0);
     289    internal_vol = settings.psettings->GetNumSetting("MythControlsVolume", 0);
    282290
    283291    numlowbuffer = 0;
    284292
     
    378386    // Only used for software volume
    379387    if (set_initial_vol && internal_vol)
    380388    {
    381         QString controlLabel = gCoreContext->GetSetting("MixerControl", "PCM");
     389        QString controlLabel =
     390            settings.psettings->GetSetting("MixerControl", "PCM");
    382391        controlLabel += "MixerVolume";
    383         volume = gCoreContext->GetNumSetting(controlLabel, 80);
     392        volume = settings.psettings->GetNumSetting(controlLabel, 80);
    384393    }
    385394
    386395    SyncVolume();
     
    392401    if (audio_buffer_unused < 0)
    393402        audio_buffer_unused = 0;
    394403
    395     if (!gCoreContext->GetNumSetting("AdvancedAudioSettings", false))
     404    if (!settings.psettings->GetNumSetting("AdvancedAudioSettings", false))
    396405        audio_buffer_unused = 0;
    397     else if (!gCoreContext->GetNumSetting("AggressiveSoundcardBuffer", false))
     406    else if (!settings.psettings->GetNumSetting("AggressiveSoundcardBuffer",
     407                                                false))
    398408        audio_buffer_unused = 0;
    399409
    400410    audbuf_timecode = 0;
     
    410420        VERBOSE(VB_AUDIO, LOC + QString("create upmixer"));
    411421        if (configured_audio_channels == 6)
    412422        {
    413             surround_mode = gCoreContext->GetNumSetting("AudioUpmixType", 2);
     423            surround_mode =
     424                settings.psettings->GetNumSetting("AudioUpmixType", 2);
    414425        }
    415426
    416427        upmixer = new FreeSurround(
     
    684695    volume = new_volume;
    685696    if (save)
    686697    {
    687         QString controlLabel = gCoreContext->GetSetting("MixerControl", "PCM");
     698        QString controlLabel = psettings->GetSetting("MixerControl", "PCM");
    688699        controlLabel += "MixerVolume";
    689700        gCoreContext->SaveSetting(controlLabel, volume);
    690701    }
  • libs/libmyth/audiooutput.cpp

     
    66#include "mythconfig.h"
    77#include "audiooutput.h"
    88#include "compat.h"
     9#include "playsettings.h"
    910
    1011#include "audiooutputnull.h"
    1112#ifdef USING_MINGW
     
    3738    bool set_initial_vol, bool audio_passthru,
    3839    int upmixer_startup)
    3940{
     41    QString str("Default");
     42    PlaySettings psettings(str);
     43    return OpenAudio(main_device, passthru_device, audio_bits,
     44                     audio_channels, audio_codec, audio_samplerate,
     45                     source, set_initial_vol, audio_passthru,
     46                     &psettings, upmixer_startup);
     47}
     48
     49AudioOutput *AudioOutput::OpenAudio(
     50    const QString &main_device,
     51    const QString &passthru_device,
     52    int audio_bits, int audio_channels,
     53    int audio_codec, int audio_samplerate,
     54    AudioOutputSource source,
     55    bool set_initial_vol, bool audio_passthru,
     56    PlaySettings *psettings,
     57    int upmixer_startup)
     58{
    4059    AudioSettings settings(
    4160        main_device, passthru_device, audio_bits,
    4261        audio_channels, audio_codec, audio_samplerate, source,
    43         set_initial_vol, audio_passthru, upmixer_startup);
     62        set_initial_vol, audio_passthru, psettings, upmixer_startup);
    4463
    4564    settings.FixPassThrough();
    4665
  • libs/libmyth/libmyth.pro

     
    6060SOURCES += mythrssmanager.cpp     netgrabbermanager.cpp
    6161SOURCES += rssparse.cpp           netutils.cpp
    6262
     63HEADERS += playsettings.h
     64SOURCES += playsettings.cpp
     65
    6366# remove when everything is switched to mythui
    6467SOURCES += virtualkeyboard_qt.cpp
    6568
  • libs/libmyth/audiosettings.h

     
    1212
    1313#include "mythexp.h"
    1414
     15class PlaySettings;
     16
    1517typedef enum {
    1618    AUDIOOUTPUT_UNKNOWN,
    1719    AUDIOOUTPUT_VIDEO,
     
    3436        AudioOutputSource audio_source,
    3537        bool              audio_set_initial_vol,
    3638        bool              audio_use_passthru,
     39        PlaySettings     *psettings,
    3740        int               upmixer_startup = 0);
    3841
    3942    AudioSettings(int   audio_bits,
     
    4144                  int   audio_codec,
    4245                  int   audio_samplerate,
    4346                  bool  audio_use_passthru,
     47                  PlaySettings *psettings,
    4448                  int   upmixer_startup = 0);
    4549
     50    AudioSettings(int   audio_bits,
     51                  int   audio_channels,
     52                  int   audio_codec,
     53                  int   audio_samplerate,
     54                  bool  audio_use_passthru,
     55                  int   upmixer_startup = 0);
     56
    4657    void FixPassThrough(void);
    4758    void TrimDeviceType(void);
    4859
     
    6172    bool    set_initial_vol;
    6273    bool    use_passthru;
    6374    AudioOutputSource source;
     75    PlaySettings *psettings;
    6476    int     upmixer;
    6577};
    6678
  • libs/libmyth/audiooutputoss.cpp

     
    2727#include "mythcorecontext.h"
    2828#include "audiooutputoss.h"
    2929#include "util.h"
     30#include "playsettings.h"
    3031
    3132AudioOutputOSS::AudioOutputOSS(const AudioSettings &settings) :
    3233    AudioOutputBase(settings),
     
    316317    mixerfd = -1;
    317318    int volume = 0;
    318319
    319     QString device = gCoreContext->GetSetting("MixerDevice", "/dev/mixer");
     320    QString device = psettings->GetSetting("MixerDevice", "/dev/mixer");
    320321    if (device.toLower() == "software")
    321322        return;
    322323
    323324    QByteArray dev = device.toAscii();
    324325    mixerfd = open(dev.constData(), O_RDONLY);
    325326
    326     QString controlLabel = gCoreContext->GetSetting("MixerControl", "PCM");
     327    QString controlLabel = psettings->GetSetting("MixerControl", "PCM");
    327328
    328329    if (controlLabel == "Master")
    329330    {
     
    344345    if (set_initial_vol)
    345346    {
    346347        int tmpVol;
    347         volume = gCoreContext->GetNumSetting("MasterMixerVolume", 80);
     348        volume = psettings->GetNumSetting("MasterMixerVolume", 80);
    348349        tmpVol = (volume << 8) + volume;
    349350        int ret = ioctl(mixerfd, MIXER_WRITE(SOUND_MIXER_VOLUME), &tmpVol);
    350351        if (ret < 0)
     
    353354                    QString("Error Setting initial Master Volume") + ENO);
    354355        }
    355356
    356         volume = gCoreContext->GetNumSetting("PCMMixerVolume", 80);
     357        volume = psettings->GetNumSetting("PCMMixerVolume", 80);
    357358        tmpVol = (volume << 8) + volume;
    358359        ret = ioctl(mixerfd, MIXER_WRITE(SOUND_MIXER_PCM), &tmpVol);
    359360        if (ret < 0)
  • libs/libmyth/audiooutput.h

     
    88#include "volumebase.h"
    99#include "output.h"
    1010
     11class PlaySettings;
     12
    1113class MPUBLIC AudioOutput : public VolumeBase, public OutputListeners
    1214{
    1315 public:
     
    1921        int audio_codec, int audio_samplerate,
    2022        AudioOutputSource source,
    2123        bool set_initial_vol, bool audio_passthru,
     24        PlaySettings *psettings,
    2225        int upmixer_startup = 0);
     26    static AudioOutput *OpenAudio(
     27        const QString &audiodevice,
     28        const QString &passthrudevice,
     29        int audio_bits, int audio_channels,
     30        int audio_codec, int audio_samplerate,
     31        AudioOutputSource source,
     32        bool set_initial_vol, bool audio_passthru,
     33        int upmixer_startup = 0);
    2334
    24     AudioOutput() :
    25         VolumeBase(),             OutputListeners(),
     35    AudioOutput(PlaySettings *psettings) :
     36        VolumeBase(psettings),    OutputListeners(),
    2637        lastError(QString::null), lastWarn(QString::null) {}
    2738
    2839    virtual ~AudioOutput() { };
  • 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
     160static QString getDefault(Setting *obj)
     161{
     162    PlaySettingsCombinedStorage *storage =
     163        dynamic_cast<PlaySettingsCombinedStorage *>(obj);
     164    if (storage)
     165        return storage->getDefault();
     166    else
     167        return "";
     168}
     169
    45170AudioOutputDevice::AudioOutputDevice() : HostComboBox("AudioOutputDevice", true)
    46171{
    47172    setLabel(QObject::tr("Audio output device"));
     
    103228    setHelpText(desc);
    104229}
    105230
    106 static HostComboBox *MaxAudioChannels()
     231static Setting *MaxAudioChannels(PlaySettings *settings)
    107232{
    108     HostComboBox *gc = new HostComboBox("MaxChannels",false);
     233    CREATE_COMBOBOX_SETTING(gc, "MaxChannels", settings);
    109234    gc->setLabel(QObject::tr("Speakers configuration"));
    110235    gc->addSelection(QObject::tr("Stereo"), "2", true); // default
    111236    gc->addSelection(QObject::tr("5.1"), "6");
    112237    gc->setHelpText(
    113238            QObject::tr(
    114239                "Set your audio configuration: Stereo or Surround."));
    115     return gc;
     240    return wrap(gc, settings);
    116241}
    117242
    118 static HostCheckBox *AudioUpmix()
     243static Setting *AudioUpmix(PlaySettings *settings)
    119244{
    120     HostCheckBox *gc = new HostCheckBox("AudioDefaultUpmix");
     245    CREATE_CHECKBOX_SETTING(gc, "AudioDefaultUpmix", settings);
    121246    gc->setLabel(QObject::tr("Upconvert stereo to 5.1 surround"));
    122247    gc->setValue(true);
    123248    gc->setHelpText(QObject::tr("MythTV can upconvert stereo to 5.1 audio. "
    124249                                "Set this option to enable it by default. "
    125250                                "You can enable or disable the upconversion during playback at anytime."));
    126     return gc;
     251    return wrap(gc, settings);
    127252}
    128253
    129 static HostComboBox *AudioUpmixType()
     254static Setting *AudioUpmixType(PlaySettings *settings)
    130255{
    131     HostComboBox *gc = new HostComboBox("AudioUpmixType",false);
     256    CREATE_COMBOBOX_SETTING(gc, "AudioUpmixType", settings);
    132257    gc->setLabel(QObject::tr("Upmix"));
    133258    gc->addSelection(QObject::tr("Fastest"), "0", true); // default
    134259    gc->addSelection(QObject::tr("Good"), "1");
     
    137262            QObject::tr(
    138263                "Set the audio surround upconversion quality. "
    139264                "'Fastest' is the least demanding on the CPU at the expense of quality."));
    140     return gc;
     265    return wrap(gc, settings);
    141266}
    142267
    143 static HostCheckBox *AdvancedAudioSettings()
     268static Setting *AdvancedAudioSettings(PlaySettings *settings)
    144269{
    145     HostCheckBox *gc = new HostCheckBox("AdvancedAudioSettings");
     270    CREATE_CHECKBOX_SETTING(gc, "AdvancedAudioSettings", settings);
    146271    gc->setLabel(QObject::tr("Advanced Audio Configuration"));
    147272    gc->setValue(false);
    148273    gc->setHelpText(QObject::tr("Enable extra audio settings."));
    149     return gc;
     274    return wrap(gc, settings);
    150275}
    151276
    152 static HostCheckBox *SRCQualityOverride()
     277static Setting *SRCQualityOverride(PlaySettings *settings)
    153278{
    154     HostCheckBox *gc = new HostCheckBox("SRCQualityOverride");
     279    CREATE_CHECKBOX_SETTING(gc, "SRCQualityOverride", settings);
    155280    gc->setLabel(QObject::tr("Override SRC quality"));
    156281    gc->setValue(false);
    157282    gc->setHelpText(QObject::tr("Override audio sample rate conversion quality"));
    158     return gc;
     283    return wrap(gc, settings);
    159284}
    160285
    161 static HostComboBox *SRCQuality()
     286static Setting *SRCQuality(PlaySettings *settings)
    162287{
    163     HostComboBox *gc = new HostComboBox("SRCQuality", false);
     288    CREATE_COMBOBOX_SETTING(gc, "SRCQuality", settings);
    164289    gc->setLabel(QObject::tr("Sample Rate Conversion"));
    165290    gc->addSelection(QObject::tr("Disabled"), "-1");
    166291    gc->addSelection(QObject::tr("Fastest"), "0");
     
    170295                                "\"Good\" (default) provides the best compromise between CPU usage "
    171296                                "and quality. \"Disabled\" let the audio card handle sample rate conversion. "
    172297                                "This only affects non 48kHz PCM audio."));
    173     return gc;
     298    return wrap(gc, settings);
    174299}
    175300
    176 static HostComboBox *PassThroughOutputDevice()
     301static Setting *PassThroughOutputDevice(PlaySettings *settings)
    177302{
    178     HostComboBox *gc = new HostComboBox("PassThruOutputDevice", true);
     303    CREATE_COMBOBOX1_SETTING(gc, "PassThruOutputDevice", settings, true);
    179304
    180305    gc->setLabel(QObject::tr("Digital output device"));
    181306    gc->addSelection(QObject::tr("Default"), "Default");
     
    193318    gc->setHelpText(QObject::tr("Audio output device to use for digital audio. Default is the same as Audio output "
    194319                    "device. This value is currently only used with ALSA "
    195320                    "and DirectX sound output."));
    196     return gc;
     321    return wrap(gc, settings);
    197322}
    198323
    199 static HostCheckBox *MythControlsVolume()
     324static Setting *MythControlsVolume(PlaySettings *settings)
    200325{
    201     HostCheckBox *gc = new HostCheckBox("MythControlsVolume");
     326    CREATE_CHECKBOX_SETTING(gc, "MythControlsVolume", settings);
    202327    gc->setLabel(QObject::tr("Use internal volume controls"));
    203328    gc->setValue(true);
    204329    gc->setHelpText(QObject::tr("MythTV can control the PCM and master "
    205330                    "mixer volume.  If you prefer to control the volume externally "
    206331                    "(like your amplifier) or use an external mixer "
    207332                    "program, disable this option."));
    208     return gc;
     333    return wrap(gc, settings);
    209334}
    210335
    211 static HostComboBox *MixerDevice()
     336static Setting *MixerDevice(PlaySettings *settings)
    212337{
    213     HostComboBox *gc = new HostComboBox("MixerDevice", true);
     338    CREATE_COMBOBOX1_SETTING(gc, "MixerDevice", settings, true);
    214339    gc->setLabel(QObject::tr("Mixer Device"));
    215340
    216341#ifdef USING_OSS
     
    236361                                "the volume of all audio at the expense of a slight quality loss."));
    237362#endif
    238363
    239     return gc;
     364    return wrap(gc, settings);
    240365}
    241366
    242367static const char* MixerControlControls[] = { "PCM",
    243368                                              "Master" };
    244369
    245 static HostComboBox *MixerControl()
     370static Setting *MixerControl(PlaySettings *settings)
    246371{
    247     HostComboBox *gc = new HostComboBox("MixerControl", true);
     372    CREATE_COMBOBOX1_SETTING(gc, "MixerControl", settings, true);
    248373    gc->setLabel(QObject::tr("Mixer Controls"));
    249374    for (unsigned int i = 0; i < sizeof(MixerControlControls) / sizeof(char*);
    250375         ++i)
     
    254379    }
    255380
    256381    gc->setHelpText(QObject::tr("Changing the volume adjusts the selected mixer."));
    257     return gc;
     382    return wrap(gc, settings);
    258383}
    259384
    260 static HostSlider *MixerVolume()
     385static Setting *MixerVolume(PlaySettings *settings)
    261386{
    262     HostSlider *gs = new HostSlider("MasterMixerVolume", 0, 100, 1);
     387    CREATE_SLIDER_SETTING(gs, "MasterMixerVolume", settings, 0, 100, 1);
    263388    gs->setLabel(QObject::tr("Master Mixer Volume"));
    264389    gs->setValue(70);
    265390    gs->setHelpText(QObject::tr("Initial volume for the Master Mixer.  "
    266391                    "This affects all sound created by the sound card.  "
    267392                    "Note: Do not set this too low."));
    268     return gs;
     393    return wrap(gs, settings);
    269394}
    270395
    271 static HostSlider *PCMVolume()
     396static Setting *PCMVolume(PlaySettings *settings)
    272397{
    273     HostSlider *gs = new HostSlider("PCMMixerVolume", 0, 100, 1);
     398    CREATE_SLIDER_SETTING(gs, "PCMMixerVolume", settings, 0, 100, 1);
    274399    gs->setLabel(QObject::tr("PCM Mixer Volume"));
    275400    gs->setValue(70);
    276401    gs->setHelpText(QObject::tr("Initial volume for PCM output.  Using the "
     
    278403    return gs;
    279404}
    280405
    281 static HostCheckBox *IndividualMuteControl()
     406static Setting *IndividualMuteControl(PlaySettings *settings)
    282407{
    283     HostCheckBox *gc = new HostCheckBox("IndividualMuteControl");
     408    CREATE_CHECKBOX_SETTING(gc, "IndividualMuteControl", settings);
    284409    gc->setLabel(QObject::tr("Independent Muting of Left and Right Audio "
    285410                 "Channels"));
    286411    gc->setValue(false);
     
    289414                    "original language on one channel, and a dubbed "
    290415                    "version of the program on the other one.  This "
    291416                    "modifies the behavior of the Mute key."));
    292     return gc;
     417    return wrap(gc, settings);
    293418}
    294419
    295 static HostCheckBox *AC3PassThrough()
     420static Setting *AC3PassThrough(PlaySettings *settings)
    296421{
    297     HostCheckBox *gc = new HostCheckBox("AC3PassThru");
     422    CREATE_CHECKBOX_SETTING(gc, "AC3PassThru", settings);
    298423    gc->setLabel(QObject::tr("Dolby Digital"));
    299424    gc->setValue(false);
    300425    gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder supports AC3/Dolby Digital. "
    301426                                "You must use a digital connection. Uncheck if using an analog connection."));
    302     return gc;
     427    return wrap(gc, settings);
    303428}
    304429
    305 static HostCheckBox *DTSPassThrough()
     430static Setting *DTSPassThrough(PlaySettings *settings)
    306431{
    307     HostCheckBox *gc = new HostCheckBox("DTSPassThru");
     432    CREATE_CHECKBOX_SETTING(gc, "DTSPassThru", settings);
    308433    gc->setLabel(QObject::tr("DTS"));
    309434    gc->setValue(false);
    310435    gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder supports DTS. "
    311436                                "You must use a digital connection. Uncheck if using an analog connection"));
    312     return gc;
     437    return wrap(gc, settings);
    313438}
    314439
    315 static HostCheckBox *AggressiveBuffer()
     440static Setting *AggressiveBuffer(PlaySettings *settings)
    316441{
    317     HostCheckBox *gc = new HostCheckBox("AggressiveSoundcardBuffer");
     442    CREATE_CHECKBOX_SETTING(gc, "AggressiveSoundcardBuffer", settings);
    318443    gc->setLabel(QObject::tr("Aggressive Sound card Buffering"));
    319444    gc->setValue(false);
    320445    gc->setHelpText(QObject::tr("If enabled, MythTV will pretend to have "
     
    324449    return gc;
    325450}
    326451
    327 static HostCheckBox *DecodeExtraAudio()
     452static Setting *DecodeExtraAudio(PlaySettings *settings)
    328453{
    329     HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");
     454    CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings);
    330455    gc->setLabel(QObject::tr("Extra audio buffering"));
    331456    gc->setValue(true);
    332457    gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing "
     
    335460                    "effect on framegrabbers (MPEG-4/RTJPEG).  MythTV will "
    336461                    "keep extra audio data in its internal buffers to workaround "
    337462                    "this bug."));
    338     return gc;
     463    return wrap(gc, settings);
    339464}
    340465
    341 static HostComboBox *PIPLocationComboBox()
     466static Setting *PIPLocationComboBox(PlaySettings *settings)
    342467{
    343     HostComboBox *gc = new HostComboBox("PIPLocation");
     468    CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings);
    344469    gc->setLabel(QObject::tr("PIP Video Location"));
    345470    for (uint loc = 0; loc < kPIP_END; ++loc)
    346471        gc->addSelection(toString((PIPLocation) loc), QString::number(loc));
    347472    gc->setHelpText(QObject::tr("Location of PIP Video window."));
    348     return gc;
     473    return wrap(gc, settings);
    349474}
    350475
    351476static GlobalLineEdit *AllRecGroupPassword()
     
    442567    return gc;
    443568}
    444569
    445 static HostCheckBox *SmartForward()
     570static Setting *SmartForward(PlaySettings *settings)
    446571{
    447     HostCheckBox *gc = new HostCheckBox("SmartForward");
     572    CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings);
    448573    gc->setLabel(QObject::tr("Smart Fast Forwarding"));
    449574    gc->setValue(false);
    450575    gc->setHelpText(QObject::tr("If enabled, then immediately after "
    451576                    "rewinding, only skip forward the same amount as "
    452577                    "skipping backwards."));
    453     return gc;
     578    return wrap(gc, settings);
    454579}
    455580
    456 static HostCheckBox *ExactSeeking()
     581static Setting *ExactSeeking(PlaySettings *settings)
    457582{
    458     HostCheckBox *gc = new HostCheckBox("ExactSeeking");
     583    CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings);
    459584    gc->setLabel(QObject::tr("Seek to exact frame"));
    460585    gc->setValue(false);
    461586    gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but "
    462587                    "slower."));
    463     return gc;
     588    return wrap(gc, settings);
    464589}
    465590
    466591static GlobalComboBox *CommercialSkipMethod()
     
    478603    return bc;
    479604}
    480605
    481 static HostComboBox *AutoCommercialSkip()
     606static Setting *AutoCommercialSkip(PlaySettings *settings)
    482607{
    483     HostComboBox *gc = new HostComboBox("AutoCommercialSkip");
     608    CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings);
    484609    gc->setLabel(QObject::tr("Automatically Skip Commercials"));
    485610    gc->addSelection(QObject::tr("Off"), "0");
    486611    gc->addSelection(QObject::tr("Notify, but do not skip"), "2");
     
    489614                    "have been flagged during Automatic Commercial Detection "
    490615                    "or by the mythcommflag program, or just notify that a "
    491616                    "commercial has been detected."));
    492     return gc;
     617    return wrap(gc, settings);
    493618}
    494619
    495620static GlobalCheckBox *AutoCommercialFlag()
     
    574699    return bc;
    575700}
    576701
    577 static HostSpinBox *CommRewindAmount()
     702static Setting *CommRewindAmount(PlaySettings *settings)
    578703{
    579     HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);
     704    CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false);
    580705    gs->setLabel(QObject::tr("Commercial Skip Auto-Rewind Amount"));
    581706    gs->setHelpText(QObject::tr("If set, MythTV will automatically rewind "
    582707                    "this many seconds after performing a commercial skip."));
    583708    gs->setValue(0);
    584     return gs;
     709    return wrap(gs, settings);
    585710}
    586711
    587 static HostSpinBox *CommNotifyAmount()
     712static Setting *CommNotifyAmount(PlaySettings *settings)
    588713{
    589     HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);
     714    CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false);
    590715    gs->setLabel(QObject::tr("Commercial Skip Notify Amount"));
    591716    gs->setHelpText(QObject::tr("If set, MythTV will act like a commercial "
    592717                    "begins this many seconds early.  This can be useful "
    593718                    "when commercial notification is used in place of "
    594719                    "automatic skipping."));
    595720    gs->setValue(0);
    596     return gs;
     721    return wrap(gs, settings);
    597722}
    598723
    599724static GlobalSpinBox *MaximumCommercialSkip()
     
    13951520    labels[j]->setValue(label_i);
    13961521}
    13971522
    1398 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) :
     1523PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str,
     1524                                               PlaySettings *settings) :
    13991525    TriggeredConfigurationGroup(false, true,  true, true,
    14001526                                false, false, true, true), grouptrigger(NULL)
    14011527{
    14021528    setLabel(QObject::tr("Playback Profiles") + str);
     1529    if (settings)
     1530        setLabel(QObject::tr("Playback group settings for ") +
     1531                 settings->mGroupName + " - " +
     1532                 getLabel());
    14031533
    14041534    QString host = gCoreContext->GetHostName();
    14051535    QStringList profiles = VideoDisplayProfile::GetProfiles(host);
     
    14271557        profiles = VideoDisplayProfile::GetProfiles(host);
    14281558    }
    14291559
    1430     QString profile = VideoDisplayProfile::GetDefaultProfileName(host);
     1560    QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings);
    14311561    if (!profiles.contains(profile))
    14321562    {
    14331563        profile = (profiles.contains("Normal")) ? "Normal" : profiles[0];
    14341564        VideoDisplayProfile::SetDefaultProfileName(profile, host);
    14351565    }
    14361566
    1437     grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile");
     1567    CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings);
     1568    grouptrigger = gs;
    14381569    grouptrigger->setLabel(QObject::tr("Current Video Playback Profile"));
    14391570    QStringList::const_iterator it;
    14401571    for (it = profiles.begin(); it != profiles.end(); ++it)
    14411572        grouptrigger->addSelection(ProgramInfo::i18n(*it), *it);
     1573    if (settings)
     1574    {
     1575        addChild(wrap(grouptrigger, settings));
     1576        return;
     1577    }
    14421578
    14431579    HorizontalConfigurationGroup *grp =
    14441580        new HorizontalConfigurationGroup(false, false, true, true);
     
    15711707    return gc;
    15721708}
    15731709
    1574 static HostSpinBox *FFRewReposTime()
     1710static Setting *FFRewReposTime(PlaySettings *settings)
    15751711{
    1576     HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);
     1712    CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false);
    15771713    gs->setLabel(QObject::tr("Fast forward/rewind reposition amount"));
    15781714    gs->setValue(100);
    15791715    gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind "
     
    15811717                    "resuming normal playback. This "
    15821718                    "compensates for the reaction time between seeing "
    15831719                    "where to resume playback and actually exiting seeking."));
    1584     return gs;
     1720    return wrap(gs, settings);
    15851721}
    15861722
    1587 static HostCheckBox *FFRewReverse()
     1723static Setting *FFRewReverse(PlaySettings *settings)
    15881724{
    1589     HostCheckBox *gc = new HostCheckBox("FFRewReverse");
     1725    CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings);
    15901726    gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind"));
    15911727    gc->setValue(true);
    15921728    gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key "
     
    15941730                    "vice versa.  If disabled, it will decrease the "
    15951731                    "current speed or switch to play mode if "
    15961732                    "the speed can't be decreased further."));
    1597     return gc;
     1733    return wrap(gc, settings);
    15981734}
    15991735
    1600 static HostSpinBox *OSDGeneralTimeout()
     1736static Setting *OSDGeneralTimeout(PlaySettings *settings)
    16011737{
    1602     HostSpinBox *gs = new HostSpinBox("OSDGeneralTimeout", 1, 30, 1);
     1738    CREATE_SPINBOX_SETTING(gs, "OSDGeneralTimeout", settings, 1, 30, 1, false);
    16031739    gs->setLabel(QObject::tr("General OSD time-out (sec)"));
    16041740    gs->setValue(2);
    16051741    gs->setHelpText(QObject::tr("Length of time an on-screen display "
    16061742                    "window will be visible."));
    1607     return gs;
     1743    return wrap(gs, settings);
    16081744}
    16091745
    1610 static HostSpinBox *OSDProgramInfoTimeout()
     1746static Setting *OSDProgramInfoTimeout(PlaySettings *settings)
    16111747{
    1612     HostSpinBox *gs = new HostSpinBox("OSDProgramInfoTimeout", 1, 30, 1);
     1748    CREATE_SPINBOX_SETTING(gs, "OSDProgramInfoTimeout", settings,
     1749                           1, 30, 1, false);
    16131750    gs->setLabel(QObject::tr("Program Info OSD time-out"));
    16141751    gs->setValue(3);
    16151752    gs->setHelpText(QObject::tr("Length of time the on-screen display "
    16161753                    "will display program information."));
    1617     return gs;
     1754    return wrap(gs, settings);
    16181755}
    16191756
    1620 static HostSpinBox *OSDNotifyTimeout()
     1757static Setting *OSDNotifyTimeout(PlaySettings *settings)
    16211758{
    1622     HostSpinBox *gs = new HostSpinBox("OSDNotifyTimeout", 1, 30, 1);
     1759    CREATE_SPINBOX_SETTING(gs, "OSDNotifyTimeout", settings, 1, 30, 1, false);
    16231760    gs->setLabel(QObject::tr("UDP Notify OSD time-out"));
    16241761    gs->setValue(5);
    16251762    gs->setHelpText(QObject::tr("How many seconds an on-screen display "
    16261763                    "will be active for UDP Notify events."));
    1627     return gs;
     1764    return wrap(gs, settings);
    16281765}
    16291766
    16301767static HostSpinBox *ThemeCacheSize()
     
    16681805    return gc;
    16691806}
    16701807
    1671 static HostComboBox *OSDFont()
     1808static Setting *OSDFont(PlaySettings *settings)
    16721809{
    1673     HostComboBox *gc = new HostComboBox("OSDFont");
     1810    CREATE_COMBOBOX_SETTING(gc, "OSDFont", settings);
    16741811    gc->setLabel(QObject::tr("OSD font"));
    16751812    QDir ttf(GetFontsDir(), GetFontsNameFilter());
    16761813    gc->fillSelectionsFromDir(ttf, false);
     
    16781815    if (gc->findSelection(defaultOSDFont) > -1)
    16791816        gc->setValue(defaultOSDFont);
    16801817
    1681     return gc;
     1818    return wrap(gc, settings);
    16821819}
    16831820
    1684 static HostComboBox *OSDCCFont()
     1821static Setting *OSDCCFont(PlaySettings *settings)
    16851822{
    1686     HostComboBox *gc = new HostComboBox("OSDCCFont");
     1823    CREATE_COMBOBOX_SETTING(gc, "OSDCCFont", settings);
    16871824    gc->setLabel(QObject::tr("CC font"));
    16881825    QDir ttf(GetFontsDir(), GetFontsNameFilter());
    16891826    gc->fillSelectionsFromDir(ttf, false);
    16901827    gc->setHelpText(QObject::tr("Closed Caption font"));
    16911828
    1692     return gc;
     1829    return wrap(gc, settings);
    16931830}
    16941831
    16951832static HostComboBox __attribute__ ((unused)) *DecodeVBIFormat()
     
    17101847    return gc;
    17111848}
    17121849
    1713 static HostSpinBox *OSDCC708TextZoomPercentage(void)
     1850static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings)
    17141851{
    1715     HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5);
     1852    CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings,
     1853                           50, 200, 5, false);
    17161854    gs->setLabel(QObject::tr("Text zoom percentage"));
    17171855    gs->setValue(100);
    17181856    gs->setHelpText(QObject::tr("Use this to enlarge or shrink captions."));
    17191857
    1720     return gs;
     1858    return wrap(gs, settings);
    17211859}
    17221860
    1723 static HostComboBox *OSDCC708DefaultFontType(void)
     1861static Setting *OSDCC708DefaultFontType(PlaySettings *settings)
    17241862{
    1725     HostComboBox *hc = new HostComboBox("OSDCC708DefaultFontType");
     1863    CREATE_COMBOBOX_SETTING(hc, "OSDCC708DefaultFontType", settings);
    17261864    hc->setLabel(QObject::tr("Default Caption Font Type"));
    17271865    hc->setHelpText(
    17281866        QObject::tr("This allows you to set which font type to use "
     
    17451883    };
    17461884    for (uint i = 0; i < 7; ++i)
    17471885        hc->addSelection(typeNames[i], types[i]);
    1748     return hc;
     1886    return wrap(hc, settings);
    17491887}
    17501888
    1751 static VerticalConfigurationGroup *OSDCC708Settings(void)
     1889static VerticalConfigurationGroup *OSDCC708Settings(PlaySettings *settings)
    17521890{
    17531891    VerticalConfigurationGroup *grp =
    17541892        new VerticalConfigurationGroup(false, true, true, true);
    17551893    grp->setLabel(QObject::tr("ATSC Caption Settings"));
     1894    if (settings)
     1895        grp->setLabel(QObject::tr("Playback group settings for ") +
     1896                      settings->mGroupName + " - " +
     1897                      grp->getLabel());
    17561898
    17571899// default text zoom 1.0
    1758     grp->addChild(OSDCC708TextZoomPercentage());
     1900    grp->addChild(OSDCC708TextZoomPercentage(settings));
    17591901
    17601902// force X lines of captions
    17611903// force caption character color
     
    17641906// force background opacity
    17651907
    17661908// set default font type
    1767     grp->addChild(OSDCC708DefaultFontType());
     1909    grp->addChild(OSDCC708DefaultFontType(settings));
    17681910
    17691911    return grp;
    17701912}
    17711913
    1772 static HostComboBox *OSDCC708Font(
     1914static Setting *OSDCC708Font(
    17731915    const QString &subtype, const QString &subtypeName,
    1774     const QString &subtypeNameForHelp)
     1916    const QString &subtypeNameForHelp, PlaySettings *settings)
    17751917{
    1776     HostComboBox *gc = new HostComboBox(
    1777         QString("OSDCC708%1Font").arg(subtype));
     1918    CREATE_COMBOBOX_SETTING(gc, QString("OSDCC708%1Font").arg(subtype),
     1919                            settings);
    17781920
    17791921    gc->setLabel(subtypeName);
    17801922    QDir ttf(GetFontsDir(), GetFontsNameFilter());
     
    17821924    gc->setHelpText(
    17831925        QObject::tr("ATSC %1 closed caption font.").arg(subtypeNameForHelp));
    17841926
    1785     return gc;
     1927    return wrap(gc, settings, (subtypeName.length() > 10));
    17861928}
    17871929
    1788 static HorizontalConfigurationGroup *OSDCC708Fonts(void)
     1930static HorizontalConfigurationGroup *OSDCC708Fonts(PlaySettings *settings)
    17891931{
    17901932    HorizontalConfigurationGroup *grpmain =
    17911933        new HorizontalConfigurationGroup(false, true, true, true);
    17921934    grpmain->setLabel(QObject::tr("ATSC Caption Fonts"));
     1935    if (settings)
     1936        grpmain->setLabel(QObject::tr("Playback group settings for ") +
     1937                          settings->mGroupName + " - " +
     1938                          grpmain->getLabel());
    17931939    VerticalConfigurationGroup *col[] =
    17941940    {
    17951941        new VerticalConfigurationGroup(false, false, true, true),
     
    18251971    for (uint j = 0; j < 7; ++j)
    18261972    {
    18271973        col[i]->addChild(OSDCC708Font(subtypes[i].arg(types[j]),
    1828                                       typeNames[j], typeNames[j]));
     1974                                      typeNames[j], typeNames[j],
     1975                                      settings));
    18291976    }
    18301977    grpmain->addChild(col[i]);
    18311978
    18321979    i = 1;
    18331980    for (uint j = 0; j < 7; ++j)
    18341981    {
    1835         col[i]->addChild(OSDCC708Font(
    1836                              subtypes[i].arg(types[j]), "",
    1837                              QObject::tr("Italic") + ' ' + typeNames[j]));
     1982        col[i]->addChild(OSDCC708Font(subtypes[i].arg(types[j]),
     1983                                      (settings ? typeNames[j] : ""),
     1984                                      QObject::tr("Italic") + ' ' + typeNames[j],
     1985                                      settings));
    18381986    }
    18391987
    18401988    grpmain->addChild(col[i]);
     
    18421990    return grpmain;
    18431991}
    18441992
    1845 static HostComboBox *SubtitleCodec()
     1993static Setting *SubtitleCodec(PlaySettings *settings)
    18461994{
    1847     HostComboBox *gc = new HostComboBox("SubtitleCodec");
     1995    CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings);
    18481996
    18491997    gc->setLabel(QObject::tr("Subtitle Codec"));
    18501998    QList<QByteArray> list = QTextCodec::availableCodecs();
     
    18542002        gc->addSelection(val, val, val.toLower() == "utf-8");
    18552003    }
    18562004
    1857     return gc;
     2005    return wrap(gc, settings);
    18582006}
    18592007
    1860 static HorizontalConfigurationGroup *ExternalSubtitleSettings()
     2008static HorizontalConfigurationGroup *ExternalSubtitleSettings(PlaySettings *settings)
    18612009{
    18622010    HorizontalConfigurationGroup *grpmain =
    18632011        new HorizontalConfigurationGroup(false, true, true, true);
    18642012
    18652013    grpmain->setLabel(QObject::tr("External Subtitle Settings"));
    18662014
    1867     grpmain->addChild(SubtitleCodec());
     2015    grpmain->addChild(SubtitleCodec(settings));
    18682016
    18692017    return grpmain;
    18702018}
    18712019
    1872 static HostComboBox *OSDThemeFontSizeType()
     2020static Setting *OSDThemeFontSizeType(PlaySettings *settings)
    18732021{
    1874     HostComboBox *gc = new HostComboBox("OSDThemeFontSizeType");
     2022    CREATE_COMBOBOX_SETTING(gc, "OSDThemeFontSizeType", settings);
    18752023    gc->setLabel(QObject::tr("Font size"));
    18762024    gc->addSelection(QObject::tr("default"), "default");
    18772025    gc->addSelection(QObject::tr("small"), "small");
    18782026    gc->addSelection(QObject::tr("big"), "big");
    18792027    gc->setHelpText(QObject::tr("default: TV, small: monitor, big:"));
    1880     return gc;
     2028    return wrap(gc, settings);
    18812029}
    18822030
    18832031static HostComboBox *ChannelOrdering()
     
    18892037    return gc;
    18902038}
    18912039
    1892 static HostSpinBox *VertScanPercentage()
     2040static Setting *VertScanPercentage(PlaySettings *settings)
    18932041{
    1894     HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1);
     2042    CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings,
     2043                           -100, 100, 1, false);
    18952044    gs->setLabel(QObject::tr("Vertical scaling"));
    18962045    gs->setValue(0);
    18972046    gs->setHelpText(QObject::tr(
    18982047                        "Adjust this if the image does not fill your "
    18992048                        "screen vertically. Range -100% to 100%"));
    1900     return gs;
     2049    return wrap(gs, settings);
    19012050}
    19022051
    1903 static HostSpinBox *HorizScanPercentage()
     2052static Setting *HorizScanPercentage(PlaySettings *settings)
    19042053{
    1905     HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1);
     2054    CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings,
     2055                           -100, 100, 1, false);
    19062056    gs->setLabel(QObject::tr("Horizontal scaling"));
    19072057    gs->setValue(0);
    19082058    gs->setHelpText(QObject::tr(
    19092059                        "Adjust this if the image does not fill your "
    19102060                        "screen horizontally. Range -100% to 100%"));
    1911     return gs;
     2061    return wrap(gs, settings);
    19122062};
    19132063
    1914 static HostSpinBox *XScanDisplacement()
     2064static Setting *XScanDisplacement(PlaySettings *settings)
    19152065{
    1916     HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1);
     2066    CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings,
     2067                           -50, 50, 1, false);
    19172068    gs->setLabel(QObject::tr("Scan displacement (X)"));
    19182069    gs->setValue(0);
    19192070    gs->setHelpText(QObject::tr("Adjust this to move the image horizontally."));
    1920     return gs;
     2071    return wrap(gs, settings);
    19212072}
    19222073
    1923 static HostSpinBox *YScanDisplacement()
     2074static Setting *YScanDisplacement(PlaySettings *settings)
    19242075{
    1925     HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1);
     2076    CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings,
     2077                           -50, 50, 1, false);
    19262078    gs->setLabel(QObject::tr("Scan displacement (Y)"));
    19272079    gs->setValue(0);
    19282080    gs->setHelpText(QObject::tr("Adjust this to move the image vertically."));
    1929     return gs;
     2081    return wrap(gs, settings);
    19302082};
    19312083
    19322084static HostCheckBox *AlwaysStreamFiles()
     
    19422094    return gc;
    19432095}
    19442096
    1945 static HostCheckBox *CCBackground()
     2097static Setting *CCBackground(PlaySettings *settings)
    19462098{
    1947     HostCheckBox *gc = new HostCheckBox("CCBackground");
     2099    CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings);
    19482100    gc->setLabel(QObject::tr("Black background for closed captioning"));
    19492101    gc->setValue(false);
    19502102    gc->setHelpText(QObject::tr(
    19512103                        "If enabled, captions will be displayed "
    19522104                        "as white text over a black background "
    19532105                        "for better contrast."));
    1954     return gc;
     2106    return wrap(gc, settings);
    19552107}
    19562108
    1957 static HostCheckBox *DefaultCCMode()
     2109static Setting *DefaultCCMode(PlaySettings *settings)
    19582110{
    1959     HostCheckBox *gc = new HostCheckBox("DefaultCCMode");
     2111    CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings);
    19602112    gc->setLabel(QObject::tr("Always display closed captioning or subtitles"));
    19612113    gc->setValue(false);
    19622114    gc->setHelpText(QObject::tr(
     
    19642116                        "when playing back recordings or watching "
    19652117                        "live TV.  Closed Captioning can be turned on or off "
    19662118                        "by pressing \"T\" during playback."));
    1967     return gc;
     2119    return wrap(gc, settings);
    19682120}
    19692121
    1970 static HostCheckBox *PreferCC708()
     2122static Setting *PreferCC708(PlaySettings *settings)
    19712123{
    1972     HostCheckBox *gc = new HostCheckBox("Prefer708Captions");
     2124    CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings);
    19732125    gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions"));
    19742126    gc->setValue(true);
    19752127    gc->setHelpText(
     
    19772129            "When enabled the new EIA-708 captions will be preferred over "
    19782130            "the old EIA-608 captions in ATSC streams."));
    19792131
    1980     return gc;
     2132    return wrap(gc, settings);
    19812133}
    19822134
    1983 static HostCheckBox *EnableMHEG()
     2135static Setting *EnableMHEG(PlaySettings *settings)
    19842136{
    1985     HostCheckBox *gc = new HostCheckBox("EnableMHEG");
     2137    CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings);
    19862138    gc->setLabel(QObject::tr("Enable Interactive TV"));
    19872139    gc->setValue(false);
    19882140    gc->setHelpText(QObject::tr(
    19892141                        "If enabled, interactive TV applications (MHEG) will "
    19902142                        "be activated.  This is used for teletext and logos for "
    19912143                        "radio and channels that are currently off-air."));
    1992     return gc;
     2144    return wrap(gc, settings);
    19932145}
    19942146
    1995 static HostCheckBox *PersistentBrowseMode()
     2147static Setting *PersistentBrowseMode(PlaySettings *settings)
    19962148{
    1997     HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");
     2149    CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings);
    19982150    gc->setLabel(QObject::tr("Always use Browse mode in LiveTV"));
    19992151    gc->setValue(true);
    20002152    gc->setHelpText(
    20012153        QObject::tr(
    20022154            "If enabled, Browse mode will automatically be activated "
    20032155            "whenever you use Channel UP/DOWN while watching Live TV."));
    2004     return gc;
     2156    return wrap(gc, settings);
    20052157}
    20062158
    2007 static HostCheckBox *BrowseAllTuners()
     2159static Setting *BrowseAllTuners(PlaySettings *settings)
    20082160{
    2009     HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");
     2161    CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings);
    20102162    gc->setLabel(QObject::tr("Browse all channels"));
    20112163    gc->setValue(false);
    20122164    gc->setHelpText(
     
    20142166            "If enabled, browse mode will shows channels on all "
    20152167            "available recording devices, instead of showing "
    20162168            "channels on just the current recorder."));
    2017     return gc;
     2169    return wrap(gc, settings);
    20182170}
    20192171
    2020 static HostCheckBox *ClearSavedPosition()
     2172static Setting *ClearSavedPosition(PlaySettings *settings)
    20212173{
    2022     HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");
     2174    CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings);
    20232175    gc->setLabel(QObject::tr("Clear bookmark on playback"));
    20242176    gc->setValue(true);
    20252177    gc->setHelpText(QObject::tr("Automatically clear the bookmark on a "
    20262178                    "recording when the recording is played back.  If "
    20272179                    "disabled, you can mark the beginning with rewind "
    20282180                    "then save position."));
    2029     return gc;
     2181    return wrap(gc, settings);
    20302182}
    20312183
    2032 static HostCheckBox *AltClearSavedPosition()
     2184static Setting *AltClearSavedPosition(PlaySettings *settings)
    20332185{
    2034     HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");
     2186    CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings);
    20352187    gc->setLabel(QObject::tr("Alternate clear and save bookmark"));
    20362188    gc->setValue(true);
    20372189    gc->setHelpText(QObject::tr("During playback the Select key "
     
    20392191                    "Saved\" and \"Bookmark Cleared\". If disabled, the "
    20402192                    "Select key will save the current position for each "
    20412193                    "keypress."));
    2042     return gc;
     2194    return wrap(gc, settings);
    20432195}
    20442196
    20452197#if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU)
    2046 static HostCheckBox *UsePicControls()
     2198static Setting *UsePicControls(PlaySettings *settings)
    20472199{
    2048     HostCheckBox *gc = new HostCheckBox("UseOutputPictureControls");
     2200    CREATE_CHECKBOX_SETTING(gc, "UseOutputPictureControls", settings);
    20492201    gc->setLabel(QObject::tr("Enable picture controls"));
    20502202    gc->setValue(false);
    20512203    gc->setHelpText(
    20522204        QObject::tr(
    20532205            "If enabled, MythTV attempts to initialize picture controls "
    20542206            "(brightness, contrast, etc.) that are applied during playback."));
    2055     return gc;
     2207    return wrap(gc, settings);
    20562208}
    20572209#endif
    20582210
    2059 static HostLineEdit *UDPNotifyPort()
     2211static Setting *UDPNotifyPort(PlaySettings *settings)
    20602212{
    2061     HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");
     2213    CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings);
    20622214    ge->setLabel(QObject::tr("UDP Notify Port"));
    20632215    ge->setValue("6948");
    20642216    ge->setHelpText(QObject::tr("During playback, MythTV will listen for "
    20652217                    "connections from the \"mythtvosd\" or \"mythudprelay\" "
    20662218                    "programs on this port.  See the README in "
    20672219                    "contrib/mythnotify/ for additional information."));
    2068     return ge;
     2220    return wrap(ge, settings);
    20692221}
    20702222
    2071 static HostComboBox *PlaybackExitPrompt()
     2223static Setting *PlaybackExitPrompt(PlaySettings *settings)
    20722224{
    2073     HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");
     2225    CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings);
    20742226    gc->setLabel(QObject::tr("Action on playback exit"));
    20752227    gc->addSelection(QObject::tr("Just exit"), "0");
    20762228    gc->addSelection(QObject::tr("Save position and exit"), "2");
     
    20812233                    "when you exit playback mode.  The options available will "
    20822234                    "allow you to save your position, delete the "
    20832235                    "recording, or continue watching."));
    2084     return gc;
     2236    return wrap(gc, settings);
    20852237}
    20862238
    2087 static HostCheckBox *EndOfRecordingExitPrompt()
     2239static Setting *EndOfRecordingExitPrompt(PlaySettings *settings)
    20882240{
    2089     HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");
     2241    CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings);
    20902242    gc->setLabel(QObject::tr("Prompt at end of recording"));
    20912243    gc->setValue(false);
    20922244    gc->setHelpText(QObject::tr("If set, a menu will be displayed allowing "
    20932245                    "you to delete the recording when it has finished "
    20942246                    "playing."));
    2095     return gc;
     2247    return wrap(gc, settings);
    20962248}
    20972249
    2098 static HostCheckBox *JumpToProgramOSD()
     2250static Setting *JumpToProgramOSD(PlaySettings *settings)
    20992251{
    2100     HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");
     2252    CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings);
    21012253    gc->setLabel(QObject::tr("Jump to Program OSD"));
    21022254    gc->setValue(true);
    21032255    gc->setHelpText(QObject::tr(
     
    21062258                        "'Watch Recording' screen when 'Jump to Program' "
    21072259                        "is activated. If set, the recordings are shown "
    21082260                        "in the OSD"));
    2109     return gc;
     2261    return wrap(gc, settings);
    21102262}
    21112263
    2112 static HostCheckBox *ContinueEmbeddedTVPlay()
     2264static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings)
    21132265{
    2114     HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");
     2266    CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings);
    21152267    gc->setLabel(QObject::tr("Continue Playback When Embedded"));
    21162268    gc->setValue(false);
    21172269    gc->setHelpText(QObject::tr(
     
    21192271                    "is embedded in the upcoming program list or recorded "
    21202272                    "list. The default is to pause the recorded show when "
    21212273                    "embedded."));
    2122     return gc;
     2274    return wrap(gc, settings);
    21232275}
    21242276
    2125 static HostCheckBox *AutomaticSetWatched()
     2277static Setting *AutomaticSetWatched(PlaySettings *settings)
    21262278{
    2127     HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");
     2279    CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings);
    21282280    gc->setLabel(QObject::tr("Automatically mark a recording as watched"));
    21292281    gc->setValue(false);
    21302282    gc->setHelpText(QObject::tr("If set, when you exit near the end of a "
     
    21322284                    "detection is not foolproof, so do not enable this "
    21332285                    "setting if you don't want an unwatched recording marked "
    21342286                    "as watched."));
    2135     return gc;
     2287    return wrap(gc, settings);
    21362288}
    21372289
    21382290static HostSpinBox *LiveTVIdleTimeout()
     
    23692521    return gc;
    23702522}
    23712523
    2372 static HostComboBox *LetterboxingColour()
     2524static Setting *LetterboxingColour(PlaySettings *settings)
    23732525{
    2374     HostComboBox *gc = new HostComboBox("LetterboxColour");
     2526    CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings);
    23752527    gc->setLabel(QObject::tr("Letterboxing Color"));
    23762528    for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
    23772529        gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
     
    23812533            "letterboxing, but those with plasma screens may prefer gray "
    23822534            "to minimize burn-in.") + " " +
    23832535        QObject::tr("Currently only works with XVideo video renderer."));
    2384     return gc;
     2536    return wrap(gc, settings);
    23852537}
    23862538
    2387 static HostComboBox *AspectOverride()
     2539static Setting *AspectOverride(PlaySettings *settings)
    23882540{
    2389     HostComboBox *gc = new HostComboBox("AspectOverride");
     2541    CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings);
    23902542    gc->setLabel(QObject::tr("Video Aspect Override"));
    23912543    for (int m = kAspect_Off; m < kAspect_END; ++m)
    23922544        gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
     
    23942546                        "When enabled, these will override the aspect "
    23952547                        "ratio specified by any broadcaster for all "
    23962548                        "video streams."));
    2397     return gc;
     2549    return wrap(gc, settings);
    23982550}
    23992551
    2400 static HostComboBox *AdjustFill()
     2552static Setting *AdjustFill(PlaySettings *settings)
    24012553{
    2402     HostComboBox *gc = new HostComboBox("AdjustFill");
     2554    CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings);
    24032555    gc->setLabel(QObject::tr("Zoom"));
    24042556    gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff),
    24052557                     QString::number(kAdjustFill_AutoDetect_DefaultOff));
     
    24102562    gc->setHelpText(QObject::tr(
    24112563                        "When enabled, these will apply a predefined "
    24122564                        "zoom to all video playback in MythTV."));
    2413     return gc;
     2565    return wrap(gc, settings);
    24142566}
    24152567
    24162568// Theme settings
     
    28292981    return gc;
    28302982}
    28312983
    2832 ThemeSelector::ThemeSelector(QString label):
    2833     HostImageSelect(label) {
    2834 
     2984static Setting *ThemeSelector(QString label, PlaySettings *settings=NULL)
     2985{
     2986    CREATE_IMAGESELECT_SETTING(gs, label, settings);
    28352987    ThemeType themetype = THEME_UI;
    28362988
    28372989    if (label == "Theme")
    28382990    {
    28392991        themetype = THEME_UI;
    2840         setLabel(QObject::tr("UI Theme"));
     2992        gs->setLabel(QObject::tr("UI Theme"));
    28412993    }
    28422994    else if (label == "OSDTheme")
    28432995    {
    28442996        themetype = THEME_OSD;
    2845         setLabel(QObject::tr("OSD Theme"));
     2997        gs->setLabel(QObject::tr("OSD Theme"));
    28462998    }
    28472999    else if (label == "MenuTheme")
    28483000    {
    28493001        themetype = THEME_MENU;
    2850         setLabel(QObject::tr("Menu Theme"));
     3002        gs->setLabel(QObject::tr("Menu Theme"));
    28513003    }
    28523004
    28533005    QDir themes(GetThemesParentDir());
     
    29113063            VERBOSE(VB_IMPORTANT, QString("Problem reading theme preview image"
    29123064                                          " %1").arg(preview.filePath()));
    29133065
    2914         addImageSelection(name, previewImage, theme.fileName());
     3066        gs->addImageSelection(name, previewImage, theme.fileName());
    29153067    }
    29163068
    29173069    if (themetype & THEME_UI)
    2918         setValue(DEFAULT_UI_THEME);
     3070        gs->setValue(DEFAULT_UI_THEME);
    29193071    else if (themetype & THEME_OSD)
    2920         setValue("BlackCurves-OSD");
     3072        gs->setValue("BlackCurves-OSD");
     3073
     3074    return wrap(gs, settings);
    29213075}
    29223076
    29233077static HostComboBox *ChannelFormat()
     
    34043558
    34053559        addTarget("6", group);
    34063560        addTarget("2", new VerticalConfigurationGroup(false, true));
     3561        QString dflt = getDefault(checkbox);
     3562        if (!dflt.isEmpty())
     3563            addTarget(dflt, group);
    34073564    }
    34083565};
    34093566
     
    34173574
    34183575        addTarget("1", group);
    34193576        addTarget("0", new VerticalConfigurationGroup(false, true));
     3577        QString dflt = getDefault(checkbox);
     3578        if (!dflt.isEmpty())
     3579            addTarget(dflt, group);
    34203580    }
    34213581};
    34223582
     
    34313591
    34323592        addTarget("1", setting);
    34333593        addTarget("0", new VerticalConfigurationGroup(false, false));
     3594        QString dflt = getDefault(checkbox);
     3595        if (!dflt.isEmpty())
     3596            addTarget(dflt, setting);
    34343597    }
    34353598};
    34363599
    3437 static ConfigurationGroup *AudioSystemSettingsGroup()
     3600static ConfigurationGroup *AudioSystemSettingsGroup(PlaySettings *settings)
    34383601{
    34393602    ConfigurationGroup *vcg = new VerticalConfigurationGroup(false, true, false, false);
    34403603
    34413604    vcg->setLabel(QObject::tr("Audio System"));
    34423605    vcg->setUseLabel(false);
    34433606
    3444     vcg->addChild(new AudioOutputDevice());
     3607    if (!settings)
     3608        vcg->addChild(new AudioOutputDevice());
    34453609
    3446     Setting *numchannels = MaxAudioChannels();
     3610    Setting *numchannels = MaxAudioChannels(settings);
    34473611    vcg->addChild(numchannels);
    34483612
    34493613    ConfigurationGroup *group1 =
    34503614        new VerticalConfigurationGroup(false, true, false, false);
    34513615
    3452     group1->addChild(AudioUpmix());
    3453     group1->addChild(AudioUpmixType());
    3454     group1->addChild(PassThroughOutputDevice());
     3616    group1->addChild(AudioUpmix(settings));
     3617    group1->addChild(AudioUpmixType(settings));
     3618    group1->addChild(PassThroughOutputDevice(settings));
    34553619
    34563620    ConfigurationGroup *settings1 =
    34573621        new HorizontalConfigurationGroup();
    34583622    settings1->setLabel(QObject::tr("Audio Processing Capabilities"));
    3459     settings1->addChild(AC3PassThrough());
    3460     settings1->addChild(DTSPassThrough());
     3623    settings1->addChild(AC3PassThrough(settings));
     3624    settings1->addChild(DTSPassThrough(settings));
    34613625
    34623626    group1->addChild(settings1);
    34633627
     
    34663630        new AudioSystemSurroundGroup(numchannels, group1);
    34673631    vcg->addChild(sub1);
    34683632
    3469     Setting *advancedsettings = AdvancedAudioSettings();
     3633    Setting *advancedsettings = AdvancedAudioSettings(settings);
    34703634    vcg->addChild(advancedsettings);
    34713635
    34723636    ConfigurationGroup *group2 =
     
    34793643    ConfigurationGroup *settings2 =
    34803644            new HorizontalConfigurationGroup(false, false, false, false);
    34813645
    3482     Setting *srcqualityoverride = SRCQualityOverride();
     3646    Setting *srcqualityoverride = SRCQualityOverride(settings);
    34833647
    34843648    AudioSystemAdvancedSettings *sub3 =
    3485         new AudioSystemAdvancedSettings(srcqualityoverride, SRCQuality());
     3649        new AudioSystemAdvancedSettings(srcqualityoverride,
     3650                                        SRCQuality(settings));
    34863651    settings2->addChild(srcqualityoverride);
    34873652    settings2->addChild(sub3);
    34883653
    34893654    group2->addChild(settings2);
    3490     group2->addChild(AggressiveBuffer());
     3655    group2->addChild(AggressiveBuffer(settings));
    34913656
    34923657    return vcg;
    34933658
     
    34963661class AudioMixerSettingsGroup : public TriggeredConfigurationGroup
    34973662{
    34983663  public:
    3499     AudioMixerSettingsGroup() :
     3664    AudioMixerSettingsGroup(PlaySettings *psettings) :
    35003665        TriggeredConfigurationGroup(false, true, false, false)
    35013666    {
    35023667        setLabel(QObject::tr("Audio Mixer"));
    35033668        setUseLabel(false);
    35043669
    3505         Setting *volumeControl = MythControlsVolume();
     3670        Setting *volumeControl = MythControlsVolume(psettings);
    35063671        addChild(volumeControl);
    35073672
    35083673        // Mixer settings
    35093674        ConfigurationGroup *settings =
    35103675            new VerticalConfigurationGroup(false, true, false, false);
    3511         settings->addChild(MixerDevice());
    3512         settings->addChild(MixerControl());
    3513         settings->addChild(MixerVolume());
    3514         settings->addChild(PCMVolume());
    3515         settings->addChild(IndividualMuteControl());
     3676        settings->addChild(MixerDevice(psettings));
     3677        settings->addChild(MixerControl(psettings));
     3678        settings->addChild(MixerVolume(psettings));
     3679        settings->addChild(PCMVolume(psettings));
     3680        settings->addChild(IndividualMuteControl(psettings));
    35163681
    35173682        ConfigurationGroup *dummy =
    35183683            new VerticalConfigurationGroup(false, true, false, false);
     
    35213686        setTrigger(volumeControl);
    35223687        addTarget("0", dummy);
    35233688        addTarget("1", settings);
     3689        QString dflt = getDefault(volumeControl);
     3690        if (!dflt.isEmpty())
     3691            addTarget(dflt, settings);
    35243692    }
    35253693};
    35263694
     
    35943762    return gs;
    35953763}
    35963764
    3597 static HostCheckBox *RealtimePriority()
     3765static Setting *RealtimePriority(PlaySettings *settings)
    35983766{
    3599     HostCheckBox *gc = new HostCheckBox("RealtimePriority");
     3767    CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings);
    36003768    gc->setLabel(QObject::tr("Enable realtime priority threads"));
    36013769    gc->setHelpText(QObject::tr("When running mythfrontend with root "
    36023770                    "privileges, some threads can be given enhanced priority. "
    36033771                    "Disable this if mythfrontend freezes during video "
    36043772                    "playback."));
    36053773    gc->setValue(true);
    3606     return gc;
     3774    return wrap(gc, settings, false);
    36073775}
    36083776
    36093777static HostCheckBox *EnableMediaMon()
     
    37593927};
    37603928
    37613929#ifdef USING_OPENGL_VSYNC
    3762 static HostCheckBox *UseOpenGLVSync()
     3930static Setting *UseOpenGLVSync(PlaySettings *settings)
    37633931{
    3764     HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");
     3932    CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings);
    37653933    gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing"));
    37663934    gc->setValue(false);
    37673935    gc->setHelpText(QObject::tr(
    37683936                        "If it is supported by your hardware/drivers, "
    37693937                        "MythTV will use OpenGL vertical syncing for "
    37703938                        "video timing, reducing frame jitter."));
    3771     return gc;
     3939    return wrap(gc, settings);
    37723940}
    37733941#endif
    37743942
     
    41944362    return gc;
    41954363}
    41964364
    4197 MainGeneralSettings::MainGeneralSettings()
     4365MainGeneralSettings::MainGeneralSettings(PlaySettings *settings,
     4366                                         ConfigurationWizard *base)
    41984367{
     4368    if (!settings)
     4369    {
    41994370    DatabaseSettings::addDatabaseSettings(this);
    42004371
    42014372    VerticalConfigurationGroup *pin =
     
    42044375    pin->addChild(SetupPinCodeRequired());
    42054376    pin->addChild(SetupPinCode());
    42064377    addChild(pin);
     4378    }
    42074379
    4208     addChild(AudioSystemSettingsGroup());
     4380    if (base)
     4381    {
     4382        base->addChild(AudioSystemSettingsGroup(settings));
     4383        base->addChild(new AudioMixerSettingsGroup(settings));
     4384    }
     4385    else
     4386    {
     4387        addChild(AudioSystemSettingsGroup(settings));
     4388        addChild(new AudioMixerSettingsGroup(settings));
     4389    }
    42094390
    4210     addChild(new AudioMixerSettingsGroup());
    42114391
     4392    if (!settings)
     4393    {
    42124394    VerticalConfigurationGroup *general =
    42134395        new VerticalConfigurationGroup(false, true, false, false);
    42144396    general->setLabel(QObject::tr("General"));
     
    42474429    remotecontrol->addChild(NetworkControlEnabled());
    42484430    remotecontrol->addChild(NetworkControlPort());
    42494431    addChild(remotecontrol);
     4432    }
    42504433}
    42514434
    4252 PlaybackSettings::PlaybackSettings()
     4435PlaybackSettings::PlaybackSettings(PlaySettings *settings,
     4436                                   ConfigurationWizard *base)
    42534437{
    42544438    uint i = 0, total = 8;
    42554439#if CONFIG_DARWIN
    42564440    total += 2;
    42574441#endif // USING_DARWIN
     4442    if (settings)
     4443        total -= 3;
    42584444
    42594445
    42604446    VerticalConfigurationGroup* general1 =
    42614447        new VerticalConfigurationGroup(false);
    42624448    general1->setLabel(QObject::tr("General Playback") +
    42634449                      QString(" (%1/%2)").arg(++i).arg(total));
     4450    if (settings)
     4451        general1->setLabel(QObject::tr("Playback group settings for ") +
     4452                           settings->mGroupName + " - " +
     4453                           general1->getLabel());
    42644454
    42654455    HorizontalConfigurationGroup *columns =
    42664456        new HorizontalConfigurationGroup(false, false, true, true);
    42674457
    42684458    VerticalConfigurationGroup *column1 =
    42694459        new VerticalConfigurationGroup(false, false, true, true);
    4270     column1->addChild(RealtimePriority());
    4271     column1->addChild(DecodeExtraAudio());
    4272     column1->addChild(JumpToProgramOSD());
     4460    if (!settings)
     4461        column1->addChild(RealtimePriority(settings));
     4462    column1->addChild(DecodeExtraAudio(settings));
     4463    column1->addChild(JumpToProgramOSD(settings));
    42734464    columns->addChild(column1);
    42744465
    42754466    VerticalConfigurationGroup *column2 =
    42764467        new VerticalConfigurationGroup(false, false, true, true);
    4277     column2->addChild(ClearSavedPosition());
    4278     column2->addChild(AltClearSavedPosition());
    4279     column2->addChild(AutomaticSetWatched());
    4280     column2->addChild(ContinueEmbeddedTVPlay());
     4468    column2->addChild(ClearSavedPosition(settings));
     4469    column2->addChild(AltClearSavedPosition(settings));
     4470    column2->addChild(AutomaticSetWatched(settings));
     4471    column2->addChild(ContinueEmbeddedTVPlay(settings));
    42814472    columns->addChild(column2);
    42824473
    42834474    general1->addChild(columns);
    4284     general1->addChild(LiveTVIdleTimeout());
    4285     general1->addChild(AlwaysStreamFiles());
     4475    if (!settings)
     4476        general1->addChild(LiveTVIdleTimeout());
     4477    if (!settings)
     4478        general1->addChild(AlwaysStreamFiles());
    42864479#ifdef USING_OPENGL_VSYNC
    4287     general1->addChild(UseOpenGLVSync());
     4480    general1->addChild(UseOpenGLVSync(settings));
    42884481#endif // USING_OPENGL_VSYNC
    42894482#if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU)
    4290     general1->addChild(UsePicControls());
     4483    general1->addChild(UsePicControls(settings));
    42914484#endif // USING_XV
    4292     addChild(general1);
     4485    if (base)
     4486        base->addChild(general1);
     4487    else
     4488        addChild(general1);
    42934489
    42944490    VerticalConfigurationGroup* general2 =
    42954491        new VerticalConfigurationGroup(false);
    42964492    general2->setLabel(QObject::tr("General Playback") +
    42974493                      QString(" (%1/%2)").arg(++i).arg(total));
     4494    if (settings)
     4495        general2->setLabel(QObject::tr("Playback group settings for ") +
     4496                           settings->mGroupName + " - " +
     4497                           general2->getLabel());
    42984498
    42994499    HorizontalConfigurationGroup* oscan =
    43004500        new HorizontalConfigurationGroup(false, false, true, true);
     
    43024502        new VerticalConfigurationGroup(false, false, true, true);
    43034503    VerticalConfigurationGroup *ocol2 =
    43044504        new VerticalConfigurationGroup(false, false, true, true);
    4305     ocol1->addChild(VertScanPercentage());
    4306     ocol1->addChild(YScanDisplacement());
    4307     ocol2->addChild(HorizScanPercentage());
    4308     ocol2->addChild(XScanDisplacement());
     4505    ocol1->addChild(VertScanPercentage(settings));
     4506    ocol1->addChild(YScanDisplacement(settings));
     4507    ocol2->addChild(HorizScanPercentage(settings));
     4508    ocol2->addChild(XScanDisplacement(settings));
    43094509    oscan->addChild(ocol1);
    43104510    oscan->addChild(ocol2);
    43114511
    43124512    HorizontalConfigurationGroup* aspect_fill =
    43134513        new HorizontalConfigurationGroup(false, false, true, true);
    4314     aspect_fill->addChild(AspectOverride());
    4315     aspect_fill->addChild(AdjustFill());
     4514    aspect_fill->addChild(AspectOverride(settings));
     4515    aspect_fill->addChild(AdjustFill(settings));
    43164516
    43174517    general2->addChild(oscan);
    43184518    general2->addChild(aspect_fill);
    4319     general2->addChild(LetterboxingColour());
    4320     general2->addChild(PIPLocationComboBox());
    4321     general2->addChild(PlaybackExitPrompt());
    4322     general2->addChild(EndOfRecordingExitPrompt());
    4323     addChild(general2);
     4519    general2->addChild(LetterboxingColour(settings));
     4520    general2->addChild(PIPLocationComboBox(settings));
     4521    general2->addChild(PlaybackExitPrompt(settings));
     4522    general2->addChild(EndOfRecordingExitPrompt(settings));
     4523    if (base)
     4524        base->addChild(general2);
     4525    else
     4526        addChild(general2);
    43244527
    43254528    QString tmp = QString(" (%1/%2)").arg(++i).arg(total);
    4326     addChild(new PlaybackProfileConfigs(tmp));
     4529    if (base)
     4530        base->addChild(new PlaybackProfileConfigs(tmp, settings));
     4531    else
     4532        addChild(new PlaybackProfileConfigs(tmp, settings));
    43274533
     4534    if (!settings)
     4535    {
    43284536    VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false);
    43294537    pbox->setLabel(QObject::tr("View Recordings") +
    43304538                   QString(" (%1/%2)").arg(++i).arg(total));
     
    43524560    pbox3->addChild(DisplayGroupTitleSort());
    43534561    pbox3->addChild(new WatchListSettings());
    43544562    addChild(pbox3);
     4563    }
    43554564
    43564565    VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false);
    43574566    seek->setLabel(QObject::tr("Seeking") +
    43584567                   QString(" (%1/%2)").arg(++i).arg(total));
    4359     seek->addChild(SmartForward());
    4360     seek->addChild(FFRewReposTime());
    4361     seek->addChild(FFRewReverse());
    4362     seek->addChild(ExactSeeking());
    4363     addChild(seek);
     4568    if (settings)
     4569        seek->setLabel(QObject::tr("Playback group settings for ") +
     4570                       settings->mGroupName + " - " +
     4571                       seek->getLabel());
     4572    seek->addChild(SmartForward(settings));
     4573    seek->addChild(FFRewReposTime(settings));
     4574    seek->addChild(FFRewReverse(settings));
     4575    seek->addChild(ExactSeeking(settings));
     4576    if (base)
     4577        base->addChild(seek);
     4578    else
     4579        addChild(seek);
    43644580
    43654581    VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false);
    43664582    comms->setLabel(QObject::tr("Commercial Skip") +
    43674583                    QString(" (%1/%2)").arg(++i).arg(total));
    4368     comms->addChild(AutoCommercialSkip());
    4369     comms->addChild(CommRewindAmount());
    4370     comms->addChild(CommNotifyAmount());
     4584    if (settings)
     4585        comms->setLabel(QObject::tr("Playback group settings for ") +
     4586                        settings->mGroupName + " - " +
     4587                        comms->getLabel());
     4588    comms->addChild(AutoCommercialSkip(settings));
     4589    comms->addChild(CommRewindAmount(settings));
     4590    comms->addChild(CommNotifyAmount(settings));
     4591    if (!settings) // these are global settings, not host-specific
     4592    {
    43714593    comms->addChild(MaximumCommercialSkip());
    43724594    comms->addChild(MergeShortCommBreaks());
    43734595    comms->addChild(CommSkipAllBlanks());
    4374     addChild(comms);
     4596    }
     4597    if (base)
     4598        base->addChild(comms);
     4599    else
     4600        addChild(comms);
    43754601
    43764602#if CONFIG_DARWIN
    43774603    VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false);
    43784604    mac1->setLabel(QObject::tr("Mac OS X video settings") +
    43794605                   QString(" (%1/%2)").arg(++i).arg(total));
     4606    if (settings)
     4607        mac1->setLabel(QObject::tr("Playback group settings for ") +
     4608                       settings->mGroupName + " - " +
     4609                       mac1->getLabel());
     4610    if (!settings)
     4611    {
    43804612    mac1->addChild(MacGammaCorrect());
    43814613    mac1->addChild(MacScaleUp());
    43824614    mac1->addChild(MacFullSkip());
    4383     addChild(mac1);
     4615    }
     4616    if (base)
     4617        base->addChild(mac1);
     4618    else
     4619        addChild(mac1);
    43844620
    43854621    VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false);
    43864622    mac2->setLabel(QObject::tr("Mac OS X video settings") +
    43874623                   QString(" (%1/%2)").arg(++i).arg(total));
     4624    if (settings)
     4625        mac2->setLabel(QObject::tr("Playback group settings for ") +
     4626                       settings->mGroupName + " - " +
     4627                       mac2->getLabel());
     4628    if (!setings)
     4629    {
    43884630    mac2->addChild(new MacMainSettings());
    43894631    mac2->addChild(new MacFloatSettings());
    43904632
     
    43934635    row->addChild(new MacDockSettings());
    43944636    row->addChild(new MacDesktopSettings());
    43954637    mac2->addChild(row);
     4638    }
    43964639
    4397     addChild(mac2);
     4640    if (base)
     4641        base->addChild(mac2);
     4642    else
     4643        addChild(mac2);
    43984644#endif
    43994645}
    44004646
    4401 OSDSettings::OSDSettings()
     4647OSDSettings::OSDSettings(PlaySettings *settings,
     4648                         ConfigurationWizard *base)
    44024649{
    44034650    VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false);
    44044651    osd->setLabel(QObject::tr("On-screen display"));
     4652    if (settings)
     4653        osd->setLabel(QObject::tr("Playback group settings for ") +
     4654                      settings->mGroupName + " - " +
     4655                      osd->getLabel());
    44054656
    4406     osd->addChild(new ThemeSelector("OSDTheme"));
    4407     osd->addChild(OSDGeneralTimeout());
    4408     osd->addChild(OSDProgramInfoTimeout());
    4409     osd->addChild(OSDFont());
    4410     osd->addChild(OSDThemeFontSizeType());
    4411     osd->addChild(EnableMHEG());
    4412     osd->addChild(PersistentBrowseMode());
    4413     osd->addChild(BrowseAllTuners());
    4414     addChild(osd);
     4657    osd->addChild(ThemeSelector("OSDTheme", settings));
     4658    osd->addChild(OSDGeneralTimeout(settings));
     4659    osd->addChild(OSDProgramInfoTimeout(settings));
     4660    osd->addChild(OSDFont(settings));
     4661    osd->addChild(OSDThemeFontSizeType(settings));
     4662    osd->addChild(EnableMHEG(settings));
     4663    if (!settings)
     4664    {
     4665    osd->addChild(PersistentBrowseMode(settings));
     4666    osd->addChild(BrowseAllTuners(settings));
     4667    }
     4668    if (base)
     4669        base->addChild(osd);
     4670    else
     4671        addChild(osd);
    44154672
    44164673    VerticalConfigurationGroup *udp = new VerticalConfigurationGroup(false);
    44174674    udp->setLabel(QObject::tr("UDP OSD Notifications"));
    4418     udp->addChild(OSDNotifyTimeout());
    4419     udp->addChild(UDPNotifyPort());
    4420     addChild(udp);
     4675    if (settings)
     4676        udp->setLabel(QObject::tr("Playback group settings for ") +
     4677                      settings->mGroupName + " - " +
     4678                      udp->getLabel());
     4679    udp->addChild(OSDNotifyTimeout(settings));
     4680    udp->addChild(UDPNotifyPort(settings));
     4681    if (base)
     4682        base->addChild(udp);
     4683    else
     4684        addChild(udp);
    44214685
    44224686    VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false);
    44234687    cc->setLabel(QObject::tr("Analog Closed Captions"));
    4424     cc->addChild(OSDCCFont());
     4688    if (settings)
     4689        cc->setLabel(QObject::tr("Playback group settings for ") +
     4690                     settings->mGroupName + " - " +
     4691                     cc->getLabel());
     4692    cc->addChild(OSDCCFont(settings));
    44254693    //cc->addChild(DecodeVBIFormat());
    4426     cc->addChild(CCBackground());
    4427     cc->addChild(DefaultCCMode());
    4428     cc->addChild(PreferCC708());
    4429     addChild(cc);
     4694    cc->addChild(CCBackground(settings));
     4695    cc->addChild(DefaultCCMode(settings));
     4696    cc->addChild(PreferCC708(settings));
     4697    if (base)
     4698        base->addChild(cc);
     4699    else
     4700        addChild(cc);
    44304701
    4431     addChild(OSDCC708Settings());
    4432     addChild(OSDCC708Fonts());
    4433     addChild(ExternalSubtitleSettings());
     4702    if (base)
     4703    {
     4704        base->addChild(OSDCC708Settings(settings));
     4705        base->addChild(OSDCC708Fonts(settings));
     4706        base->addChild(ExternalSubtitleSettings(settings));
     4707    }
     4708    else
     4709    {
     4710        addChild(OSDCC708Settings(settings));
     4711        addChild(OSDCC708Fonts(settings));
     4712        addChild(ExternalSubtitleSettings(settings));
     4713    }
    44344714
    44354715#if CONFIG_DARWIN
    44364716    // Any Mac OS-specific OSD stuff would go here.
     
    45824862    VerticalConfigurationGroup* theme = new VerticalConfigurationGroup(false);
    45834863    theme->setLabel(QObject::tr("Theme"));
    45844864
    4585     theme->addChild(new ThemeSelector("Theme"));
     4865    theme->addChild(ThemeSelector("Theme"));
    45864866
    45874867    theme->addChild(ThemeCacheSize());
    45884868
  • programs/mythfrontend/main.cpp

     
    3434#include "globalsettings.h"
    3535#include "profilegroup.h"
    3636#include "playgroup.h"
     37#include "playsettings.h"
    3738#include "networkcontrol.h"
    3839#include "DVDRingBuffer.h"
    3940#include "scheduledrecording.h"
     
    487488        delete statusbox;
    488489}
    489490
     491ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     492{
     493    return new PlaybackSettings(settings, base);
     494}
     495
     496ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     497{
     498    return new OSDSettings(settings, base);
     499}
     500
     501ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
     502{
     503    return new MainGeneralSettings(settings, base);
     504}
     505
     506static PlayGroupEditor::SettingsLookup pbgroupSetup[] = {
     507    createPlaybackSettingsForPlaybackGroup,
     508    createOSDSettingsForPlaybackGroup,
     509    createMainGeneralSettingsForPlaybackGroup
     510};
     511
    490512void TVMenuCallback(void *data, QString &selection)
    491513{
    492514    (void)data;
     
    579601    }
    580602    else if (sel == "settings playgroup")
    581603    {
    582         PlayGroupEditor editor;
     604        PlayGroupEditor editor(pbgroupSetup,
     605                               sizeof(pbgroupSetup)/sizeof(*pbgroupSetup));
    583606        editor.exec();
    584607    }
    585608    else if (sel == "settings general")
     
    771794            }
    772795        }
    773796        delete tmprbuf;
     797        pginfo->SetPlaybackGroup("Videos");
    774798    }
    775799    else if (pginfo->IsVideo())
     800    {
    776801        pos = pginfo->QueryBookmark();
     802        pginfo->SetPlaybackGroup("Videos");
     803    }
    777804
    778805    if (pos > 0)
    779806    {
  • programs/mythfrontend/globalsettings.h

     
    1010#include "themeinfo.h"
    1111
    1212class QFileInfo;
     13class PlaySettings;
    1314
    1415class AudioOutputDevice : public HostComboBox
    1516{
     
    3738class PlaybackSettings : public ConfigurationWizard
    3839{
    3940  public:
    40     PlaybackSettings();
     41    PlaybackSettings(PlaySettings *settings=NULL,
     42                     ConfigurationWizard *base=NULL);
    4143};
    4244
    4345class OSDSettings: virtual public ConfigurationWizard
    4446{
    4547  public:
    46     OSDSettings();
     48    OSDSettings(PlaySettings *settings=NULL,
     49                ConfigurationWizard *base=NULL);
    4750};
    4851
    4952class GeneralSettings : public ConfigurationWizard
     
    6770class MainGeneralSettings : public ConfigurationWizard
    6871{
    6972  public:
    70     MainGeneralSettings();
     73    MainGeneralSettings(PlaySettings *settings=NULL,
     74                        ConfigurationWizard *base=NULL);
    7175};
    7276
    7377class GeneralRecPrioritiesSettings : public ConfigurationWizard
     
    155159    Q_OBJECT
    156160
    157161  public:
    158     PlaybackProfileConfigs(const QString &str);
     162    PlaybackProfileConfigs(const QString &str, PlaySettings *settings);
    159163    virtual ~PlaybackProfileConfigs();
    160164
    161165  private:
     
    167171
    168172  private:
    169173    QStringList   profiles;
    170     HostComboBox *grouptrigger;
     174    ComboBoxSetting *grouptrigger;
    171175};
    172176
    173177#endif
  • programs/mythtranscode/transcode.cpp

     
    3636class AudioReencodeBuffer : public AudioOutput
    3737{
    3838 public:
    39     AudioReencodeBuffer(int audio_bits, int audio_channels)
     39    AudioReencodeBuffer(int audio_bits, int audio_channels,
     40                        PlaySettings *psettings)
     41        : AudioOutput(psettings)
    4042    {
    4143        Reset();
    42         const AudioSettings settings(audio_bits, audio_channels, 0, 0, false);
     44        const AudioSettings settings(audio_bits, audio_channels, 0, 0, false,
     45                                     psettings);
    4346        Reconfigure(settings);
    4447        bufsize = 512000;
    4548        audiobuffer = new unsigned char[bufsize];
     
    419422        statustime = statustime.addSecs(5);
    420423    }
    421424
    422     AudioOutput *audioOutput = new AudioReencodeBuffer(0, 0);
     425    AudioOutput *audioOutput =
     426        new AudioReencodeBuffer(0, 0, player_ctx->settings);
    423427    AudioReencodeBuffer *arb = ((AudioReencodeBuffer*)audioOutput);
    424428    nvp->SetAudioOutput(audioOutput);
    425429    nvp->SetTranscoding(true);
  • programs/mythavtest/main.cpp

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