Index: libs/libmythtv/videoout_vdpau.h
===================================================================
--- libs/libmythtv/videoout_vdpau.h	(revision 27374)
+++ libs/libmythtv/videoout_vdpau.h	(working copy)
@@ -20,7 +20,7 @@
 {
   public:
     static void GetRenderOptions(render_opts &opts);
-    VideoOutputVDPAU();
+    VideoOutputVDPAU(PlaySettings *settings);
     ~VideoOutputVDPAU();
     bool Init(int width, int height, float aspect, WId winid,
               int winx, int winy, int winw, int winh,
@@ -54,7 +54,8 @@
                                     const QSize &video_dim);
     static MythCodecID GetBestSupportedCodec(uint width, uint height,
                                              uint stream_type,
-                                             bool no_acceleration);
+                                             bool no_acceleration,
+                                             PlaySettings *settings);
     virtual bool IsPIPSupported(void) const { return true; }
     virtual bool IsPBPSupported(void) const { return false; }
     virtual bool NeedExtraAudioDecode(void) const
Index: libs/libmythtv/subtitlereader.h
===================================================================
--- libs/libmythtv/subtitlereader.h	(revision 27374)
+++ libs/libmythtv/subtitlereader.h	(working copy)
@@ -44,7 +44,7 @@
 
     TextSubtitles* GetTextSubtitles(void) { return &m_TextSubtitles; }
     bool HasTextSubtitles(void);
-    bool LoadExternalSubtitles(const QString &videoFile);
+    bool LoadExternalSubtitles(const QString &videoFile, PlaySettings *settings);
 
     QStringList GetRawTextSubtitles(uint64_t &duration);
     void AddRawTextSubtitle(QStringList list, uint64_t duration);
Index: libs/libmythtv/videooutwindow.cpp
===================================================================
--- libs/libmythtv/videooutwindow.cpp	(revision 27374)
+++ libs/libmythtv/videooutwindow.cpp	(working copy)
@@ -29,6 +29,7 @@
 
 #include "videooutwindow.h"
 #include "osd.h"
+#include "playsettings.h"
 #include "mythplayer.h"
 #include "videodisplayprofile.h"
 #include "decoderbase.h"
@@ -53,7 +54,7 @@
 const float VideoOutWindow::kManualZoomMinVerticalZoom   = 0.5f;
 const int   VideoOutWindow::kManualZoomMaxMove           = 50;
 
-VideoOutWindow::VideoOutWindow() :
+VideoOutWindow::VideoOutWindow(PlaySettings *_settings) :
     // DB settings
     db_move(0, 0), db_scale_horiz(0.0f), db_scale_vert(0.0f),
     db_pip_size(26),
@@ -85,12 +86,14 @@
 
     // Various state variables
     embedding(false), needrepaint(false),
-    allowpreviewepg(true), pip_state(kPIPOff)
+    allowpreviewepg(true), pip_state(kPIPOff),
+
+    settings(_settings)
 {
     db_pip_size = gCoreContext->GetNumSetting("PIPSize", 26);
 
-    db_move = QPoint(gCoreContext->GetNumSetting("xScanDisplacement", 0),
-                     gCoreContext->GetNumSetting("yScanDisplacement", 0));
+    db_move = QPoint(settings->GetNumSetting("xScanDisplacement", 0),
+                     settings->GetNumSetting("yScanDisplacement", 0));
     db_use_gui_size = gCoreContext->GetNumSetting("GuiSizeForTV", 0);
 
     QDesktopWidget *desktop = NULL;
@@ -615,9 +618,9 @@
     if (change)
     {
         db_scale_vert =
-            gCoreContext->GetNumSetting("VertScanPercentage", 0) * 0.01f;
+            settings->GetNumSetting("VertScanPercentage", 0) * 0.01f;
         db_scale_horiz =
-            gCoreContext->GetNumSetting("HorizScanPercentage", 0) * 0.01f;
+            settings->GetNumSetting("HorizScanPercentage", 0) * 0.01f;
         db_scaling_allowed = true;
     }
     else
Index: libs/libmythtv/videoout_d3d.cpp
===================================================================
--- libs/libmythtv/videoout_d3d.cpp	(revision 27374)
+++ libs/libmythtv/videoout_d3d.cpp	(working copy)
@@ -52,8 +52,8 @@
     opts.priorities->insert("direct3d", 55);
 }
 
-VideoOutputD3D::VideoOutputD3D(void)
-  : VideoOutput(),         m_lock(QMutex::Recursive),
+VideoOutputD3D::VideoOutputD3D(PlaySettigns *settings)
+  : VideoOutput(settings), m_lock(QMutex::Recursive),
     m_hWnd(NULL),          m_render(NULL),
     m_video(NULL),
     m_render_valid(false), m_render_reset(false), m_pip_active(NULL),
Index: libs/libmythtv/DetectLetterbox.cpp
===================================================================
--- libs/libmythtv/DetectLetterbox.cpp	(revision 27374)
+++ libs/libmythtv/DetectLetterbox.cpp	(working copy)
@@ -5,10 +5,11 @@
 #include "mythplayer.h"
 #include "videoouttypes.h"
 #include "mythcorecontext.h"
+#include "playsettings.h"
 
 DetectLetterbox::DetectLetterbox(MythPlayer* const player)
 {
-    int dbAdjustFill = gCoreContext->GetNumSetting("AdjustFill", 0);
+    int dbAdjustFill = player->GetPlaySettings()->GetNumSetting("AdjustFill", 0);
     isDetectLetterbox = dbAdjustFill >= kAdjustFill_AutoDetect_DefaultOff;
     firstFrameChecked = 0;
     detectLetterboxDefaultMode = (AdjustFillMode) max((int) kAdjustFill_Off,
@@ -18,7 +19,8 @@
     detectLetterboxPossibleFullFrame = -1;
     detectLetterboxConsecutiveCounter = 0;
     detectLetterboxDetectedMode = player->GetAdjustFill();
-    detectLetterboxLimit = gCoreContext->GetNumSetting("DetectLeterboxLimit", 75);
+    detectLetterboxLimit =
+        player->GetPlaySettings()->GetNumSetting("DetectLeterboxLimit", 75);
     m_player = player;
 }
 
Index: libs/libmythtv/videoout_opengl.cpp
===================================================================
--- libs/libmythtv/videoout_opengl.cpp	(revision 27374)
+++ libs/libmythtv/videoout_opengl.cpp	(working copy)
@@ -39,8 +39,8 @@
     opts.priorities->insert("opengl", 65);
 }
 
-VideoOutputOpenGL::VideoOutputOpenGL()
-    : VideoOutput(),
+VideoOutputOpenGL::VideoOutputOpenGL(PlaySettings *settings)
+    : VideoOutput(settings),
     gl_context_lock(QMutex::Recursive),
     gl_context(NULL), gl_videochain(NULL), gl_pipchain_active(NULL),
     gl_parent_win(0), gl_embed_win(0), gl_painter(NULL)
Index: libs/libmythtv/videoout_quartz.cpp
===================================================================
--- libs/libmythtv/videoout_quartz.cpp	(revision 27374)
+++ libs/libmythtv/videoout_quartz.cpp	(working copy)
@@ -62,6 +62,8 @@
 #include "mythverbose.h"
 #include "videodisplayprofile.h"
 
+class PlaySettings;
+
 #define LOC     QString("VideoOutputQuartz::")
 #define LOC_ERR QString("VideoOutputQuartz Error: ")
 
@@ -1105,8 +1107,8 @@
 /** \class VideoOutputQuartz
  *  \brief Implementation of Quartz (Mac OS X windowing system) video output
  */
-VideoOutputQuartz::VideoOutputQuartz() :
-    VideoOutput(), Started(false), data(new QuartzData())
+VideoOutputQuartz::VideoOutputQuartz(PlaySettings *settings) :
+    VideoOutput(settings), Started(false), data(new QuartzData())
 {
     init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0);
 }
@@ -1756,12 +1758,12 @@
 MythCodecID VideoOutputQuartz::GetBestSupportedCodec(
     uint width, uint height,
     uint osd_width, uint osd_height,
-    uint stream_type, uint fourcc)
+    uint stream_type, uint fourcc, PlaySettings *settings)
 {
     (void) osd_width;
     (void) osd_height;
 
-    VideoDisplayProfile vdp;
+    VideoDisplayProfile vdp(settings);
     vdp.SetInput(QSize(width, height));
     QString dec = vdp.GetDecoder();
     if ((dec == "libmpeg2") || (dec == "ffmpeg"))
Index: libs/libmythtv/avformatdecoder.cpp
===================================================================
--- libs/libmythtv/avformatdecoder.cpp	(revision 27374)
+++ libs/libmythtv/avformatdecoder.cpp	(working copy)
@@ -33,6 +33,7 @@
 #include "BDRingBuffer.h"
 #include "videodisplayprofile.h"
 #include "mythuihelper.h"
+#include "playsettings.h"
 
 #include "lcddevice.h"
 
@@ -307,7 +308,7 @@
 
     cc608_build_parity_table(cc608_parity_table);
 
-    if (gCoreContext->GetNumSetting("CCBackground", 0))
+    if (GetPlayer()->GetPlaySettings()->GetNumSetting("CCBackground", 0))
         CC708Window::forceWhiteOnBlackText = true;
 
     no_dts_hack = false;
@@ -1244,7 +1245,7 @@
     if (selectedStream)
     {
         directrendering = true;
-        if (!gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&
+        if (!GetPlayer()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) &&
             !CODEC_IS_HWACCEL(codec, enc))
         {
             SetLowBuffers(false);
@@ -1777,7 +1778,7 @@
 
                 if (!is_db_ignored)
                 {
-                    VideoDisplayProfile vdp;
+                    VideoDisplayProfile vdp(GetPlayer()->GetPlaySettings());
                     vdp.SetInput(QSize(width, height));
                     dec = vdp.GetDecoder();
                     thread_count = vdp.GetMaxCPUs();
@@ -1805,7 +1806,8 @@
                     MythCodecID vdpau_mcid;
                     vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec(
                         width, height,
-                        mpeg_version(enc->codec_id), no_hardware_decoders);
+                        mpeg_version(enc->codec_id), no_hardware_decoders,
+                        GetPlayer()->GetPlaySettings());
 
                     if (vdpau_mcid >= video_codec_id)
                     {
@@ -1837,7 +1839,8 @@
                         /* mpeg type    */ mpeg_version(enc->codec_id),
                         /* xvmc pix fmt */ xvmc_pixel_format(enc->pix_fmt),
                         /* test surface */ codec_is_std(video_codec_id),
-                        /* force_xv     */ force_xv);
+                        /* force_xv     */ force_xv,
+                        GetPlayer()->GetPlaySettings());
 
                     if (mcid >= video_codec_id)
                     {
Index: libs/libmythtv/playgroup.cpp
===================================================================
--- libs/libmythtv/playgroup.cpp	(revision 27374)
+++ libs/libmythtv/playgroup.cpp	(working copy)
@@ -1,6 +1,7 @@
 #include "mythdb.h"
 #include "playgroup.h"
 #include "programinfo.h"
+#include "playsettings.h"
 
 // A parameter associated with the profile itself
 class PlayGroupDBStorage : public SimpleDBStorage
@@ -210,8 +211,9 @@
     return res;
 }
 
-PlayGroupEditor::PlayGroupEditor(void) :
-    listbox(new ListBoxSetting(this)), lastValue("Default")
+PlayGroupEditor::PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize) :
+    listbox(new ListBoxSetting(this)), lastValue("Default"),
+    getSettings(funcArray), getSettingsSize(funcArraySize)
 {
     listbox->setLabel(tr("Playback Groups"));
     addChild(listbox);
@@ -242,6 +244,9 @@
     }
 
     PlayGroup group(name);
+    PlaySettings *psettings = new PlaySettings(name);
+    for (int i=0; i<getSettingsSize; i++)
+        getSettings[i](psettings, &group);
     if (group.exec() == QDialog::Accepted || !created)
         lastValue = name;
     else
@@ -276,6 +281,7 @@
         query.bindValue(":NAME", name);
         if (!query.exec())
             MythDB::DBError("PlayGroupEditor::doDelete", query);
+        PlaySettings::deleteGroup(name);
 
         int lastIndex = listbox->getValueIndex(name);
         lastValue = "";
Index: libs/libmythtv/videoout_opengl.h
===================================================================
--- libs/libmythtv/videoout_opengl.h	(revision 27374)
+++ libs/libmythtv/videoout_opengl.h	(working copy)
@@ -10,7 +10,7 @@
 {
   public:
     static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
-    VideoOutputOpenGL();
+    VideoOutputOpenGL(PlaySettings *settings);
     virtual ~VideoOutputOpenGL();
 
     virtual bool Init(int width, int height, float aspect, WId winid,
Index: libs/libmythtv/tv_play.h
===================================================================
--- libs/libmythtv/tv_play.h	(revision 27374)
+++ libs/libmythtv/tv_play.h	(working copy)
@@ -60,6 +60,7 @@
 class OSDListTreeItemSelectedEvent;
 class TVBrowseHelper;
 struct osdInfo;
+class PlaySettings;
 
 typedef QMap<QString,InfoMap>    DDValueMap;
 typedef QMap<QString,DDValueMap> DDKeyMap;
@@ -184,10 +185,10 @@
         unsigned long seconds;
     };
 
-    TV(void);
+    TV(PlaySettings *settings);
    ~TV();
 
-    void InitFromDB(void);
+    void InitFromDB(PlaySettings *settings);
     bool Init(bool createWindow = true);
 
     // User input processing commands
@@ -211,7 +212,7 @@
 
     // Recording commands
     int  PlayFromRecorder(int recordernum);
-    int  Playback(const ProgramInfo &rcinfo);
+    int  Playback(const ProgramInfo &rcinfo, PlaySettings *settings);
 
     // Commands used by frontend playback box
     QString GetRecordingGroup(int player_idx) const;
Index: libs/libmythtv/playgroup.h
===================================================================
--- libs/libmythtv/playgroup.h	(revision 27374)
+++ libs/libmythtv/playgroup.h	(working copy)
@@ -7,6 +7,7 @@
 #include "mythwidgets.h"
 
 class ProgramInfo;
+class PlaySettings;
 
 class MPUBLIC PlayGroup: public ConfigurationWizard
 {
@@ -29,7 +30,9 @@
     Q_OBJECT
 
   public:
-    PlayGroupEditor(void);
+    typedef ConfigurationWizard *(*SettingsLookup)(PlaySettings *settings,
+                                                   ConfigurationWizard *base);
+    PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize);
     virtual DialogCode exec(void);
     virtual void Load(void);
     virtual void Save(void) { }
@@ -44,6 +47,8 @@
   protected:
     ListBoxSetting *listbox;
     QString         lastValue;
+    SettingsLookup *getSettings;
+    int             getSettingsSize;
 };
 
 #endif
Index: libs/libmythtv/dbcheck.cpp
===================================================================
--- libs/libmythtv/dbcheck.cpp	(revision 27374)
+++ libs/libmythtv/dbcheck.cpp	(working copy)
@@ -3555,7 +3555,8 @@
 
             VideoDisplayProfile::CreateNewProfiles(host);
             profiles = VideoDisplayProfile::GetProfiles(host);
-            QString profile = VideoDisplayProfile::GetDefaultProfileName(host);
+            QString profile =
+                VideoDisplayProfile::GetDefaultProfileName(host, NULL);
 
             if (profiles.contains("Normal") &&
                 (profile=="CPU++" || profile=="CPU+" || profile=="CPU--"))
@@ -5972,6 +5973,13 @@
 "  jump int(11) NOT NULL default '0',"
 "  PRIMARY KEY  (`name`)"
 ");",
+"CREATE TABLE playgroupsettings ("
+"  playgroupname varchar(64) NOT NULL,"
+"  `value` varchar(128) NOT NULL,"
+"  `data` text,"
+"  overridden tinyint(1) NOT NULL,"
+"  PRIMARY KEY (playgroupname, `value`)"
+");",
 "CREATE TABLE powerpriority ("
 "  priorityname varchar(64) collate utf8_bin NOT NULL,"
 "  recpriority int(10) NOT NULL default '0',"
Index: libs/libmythtv/videoout_vdpau.cpp
===================================================================
--- libs/libmythtv/videoout_vdpau.cpp	(revision 27374)
+++ libs/libmythtv/videoout_vdpau.cpp	(working copy)
@@ -49,8 +49,8 @@
     opts.deints->insert("vdpau", deints);
 }
 
-VideoOutputVDPAU::VideoOutputVDPAU()
-  : m_win(0),                m_render(NULL),
+VideoOutputVDPAU::VideoOutputVDPAU(PlaySettings *settings)
+  : VideoOutput(settings), m_win(0),           m_render(NULL),
     m_buffer_size(NUM_VDPAU_BUFFERS),          m_pause_surface(0),
     m_need_deintrefs(false), m_video_mixer(0), m_mixer_features(kVDPFeatNone),
     m_checked_surface_ownership(false),
@@ -850,10 +850,10 @@
 
 MythCodecID VideoOutputVDPAU::GetBestSupportedCodec(
     uint width,       uint height,
-    uint stream_type, bool no_acceleration)
+    uint stream_type, bool no_acceleration, PlaySettings *settings)
 {
     bool use_cpu = no_acceleration;
-    VideoDisplayProfile vdp;
+    VideoDisplayProfile vdp(settings);
     vdp.SetInput(QSize(width, height));
     QString dec = vdp.GetDecoder();
 
Index: libs/libmythtv/videoout_directfb.cpp
===================================================================
--- libs/libmythtv/videoout_directfb.cpp	(revision 27374)
+++ libs/libmythtv/videoout_directfb.cpp	(working copy)
@@ -277,8 +277,8 @@
     opts.priorities->insert("directfb", 60);
 }
 
-VideoOutputDirectfb::VideoOutputDirectfb()
-    : VideoOutput(), XJ_started(false), widget(NULL),
+VideoOutputDirectfb::VideoOutputDirectfb(PlaySettings *settings)
+    : VideoOutput(settings), XJ_started(false), widget(NULL),
       data(new DirectfbData())
 {
     init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0);
Index: libs/libmythtv/mythplayer.h
===================================================================
--- libs/libmythtv/mythplayer.h	(revision 27374)
+++ libs/libmythtv/mythplayer.h	(working copy)
@@ -186,6 +186,10 @@
     QString   GetXDS(const QString &key) const;
     PIPLocation GetNextPIPLocation(void) const;
 
+    PlaySettings *GetPlaySettings(void) const {
+        return player_ctx ? player_ctx->settings : NULL;
+    }
+
     // Bool Gets
     bool    GetRawAudioState(void) const;
     bool    GetLimitKeyRepeat(void) const     { return limitKeyRepeat; }
Index: libs/libmythtv/videoout_d3d.h
===================================================================
--- libs/libmythtv/videoout_d3d.h	(revision 27374)
+++ libs/libmythtv/videoout_d3d.h	(working copy)
@@ -12,7 +12,7 @@
 {
   public:
     static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
-    VideoOutputD3D();
+    VideoOutputD3D(PlaySettings *settings);
    ~VideoOutputD3D();
 
     bool Init(int width, int height, float aspect, WId winid,
Index: libs/libmythtv/playercontext.cpp
===================================================================
--- libs/libmythtv/playercontext.cpp	(revision 27374)
+++ libs/libmythtv/playercontext.cpp	(working copy)
@@ -16,6 +16,8 @@
 #include "storagegroup.h"
 #include "mythcorecontext.h"
 #include "videometadatautil.h"
+#include "DetectLetterbox.h"
+#include "playsettings.h"
 
 #define LOC QString("playCtx: ")
 #define LOC_ERR QString("playCtx, Error: ")
@@ -405,7 +407,7 @@
                                  WId embedwinid, const QRect *embedbounds,
                                  bool muted)
 {
-    int exact_seeking = gCoreContext->GetNumSetting("ExactSeeking", 0);
+    int exact_seeking = settings->GetNumSetting("ExactSeeking", 0);
 
     if (HasPlayer())
     {
@@ -448,7 +450,7 @@
     {
         QString subfn = buffer->GetSubtitleFilename();
         if (!subfn.isEmpty() && player->GetSubReader())
-            player->GetSubReader()->LoadExternalSubtitles(subfn);
+            player->GetSubReader()->LoadExternalSubtitles(subfn, settings);
     }
 
     if ((embedwinid > 0) && embedbounds)
@@ -915,7 +917,8 @@
 /**
  * \brief assign programinfo to the context
  */
-void PlayerContext::SetPlayingInfo(const ProgramInfo *info)
+void PlayerContext::SetPlayingInfo(const ProgramInfo *info,
+                                   PlaySettings *_settings)
 {
     bool ignoreDB = gCoreContext->IsDatabaseIgnored();
 
@@ -927,6 +930,7 @@
             playingInfo->MarkAsInUse(false, recUsage);
         delete playingInfo;
         playingInfo = NULL;
+        // XXX delete settings?
     }
 
     if (info)
@@ -935,6 +939,8 @@
         if (!ignoreDB)
             playingInfo->MarkAsInUse(true, recUsage);
         playingLen = playingInfo->GetSecondsInRecording();
+        settings = (_settings ? _settings :
+                    new PlaySettings(playingInfo->GetPlaybackGroup()));
     }
 }
 
Index: libs/libmythtv/subtitlereader.cpp
===================================================================
--- libs/libmythtv/subtitlereader.cpp	(revision 27374)
+++ libs/libmythtv/subtitlereader.cpp	(working copy)
@@ -65,10 +65,12 @@
         av_free(subtitle.rects);
 }
 
-bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName)
+bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName,
+                                           PlaySettings *settings)
 {
     m_TextSubtitles.Clear();
-    return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles);
+    return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles,
+                                             settings);
 }
 
 bool SubtitleReader::HasTextSubtitles(void)
Index: libs/libmythtv/textsubtitleparser.h
===================================================================
--- libs/libmythtv/textsubtitleparser.h	(revision 27374)
+++ libs/libmythtv/textsubtitleparser.h	(working copy)
@@ -17,6 +17,8 @@
 // Qt headers
 #include <QStringList>
 
+class PlaySettings;
+
 class text_subtitle_t
 {
   public:
@@ -79,7 +81,8 @@
 class TextSubtitleParser
 {
   public:
-    static bool LoadSubtitles(QString fileName, TextSubtitles &target);
+    static bool LoadSubtitles(QString fileName, TextSubtitles &target,
+                              PlaySettings *settings);
 };
 
 #endif
Index: libs/libmythtv/vsync.cpp
===================================================================
--- libs/libmythtv/vsync.cpp	(revision 27374)
+++ libs/libmythtv/vsync.cpp	(working copy)
@@ -34,6 +34,7 @@
 
 #include "mythcontext.h"
 #include "mythmainwindow.h"
+#include "playsettings.h"
 
 #ifdef USING_XV
 #include "videoout_xv.h"
@@ -78,6 +79,7 @@
  *  \brief Returns the most sophisticated video sync method available.
  */
 VideoSync *VideoSync::BestMethod(VideoOutput *video_output,
+                                 PlaySettings *settings,
                                  uint frame_interval, uint refresh_interval,
                                  bool halve_frame_interval)
 {
@@ -103,7 +105,7 @@
     TESTVIDEOSYNC(DRMVideoSync);
 #ifdef USING_OPENGL_VSYNC
 /*
-    if (gCoreContext->GetNumSetting("UseOpenGLVSync", 1) &&
+    if (settings->GetNumSetting("UseOpenGLVSync", 1) &&
        (getenv("NO_OPENGL_VSYNC") == NULL))
     {
         TESTVIDEOSYNC(OpenGLVideoSync);
Index: libs/libmythtv/tv_play.cpp
===================================================================
--- libs/libmythtv/tv_play.cpp	(revision 27374)
+++ libs/libmythtv/tv_play.cpp	(working copy)
@@ -60,6 +60,7 @@
 #include "mythdialogbox.h"
 #include "mythdirs.h"
 #include "tvbrowsehelper.h"
+#include "playsettings.h"
 
 #if ! HAVE_ROUND
 #define round(x) ((int) ((x) + 0.5))
@@ -210,7 +211,6 @@
     bool startInGuide = flags & kStartTVInGuide;
     bool inPlaylist = flags & kStartTVInPlayList;
     bool initByNetworkCommand = flags & kStartTVByNetworkCommand;
-    TV *tv = new TV();
     bool quitAll = false;
     bool showDialogs = true;
     bool playCompleted = false;
@@ -224,6 +224,9 @@
         curProgram->SetIgnoreBookmark(flags & kStartTVIgnoreBookmark);
     }
 
+    PlaySettings settings(curProgram ? curProgram->GetPlaybackGroup() : "Default");
+    TV *tv = new TV(&settings);
+
     // Initialize TV
     if (!tv->Init())
     {
@@ -254,7 +257,7 @@
         if (curProgram)
         {
             VERBOSE(VB_PLAYBACK, LOC + "tv->Playback() -- begin");
-            if (!tv->Playback(*curProgram))
+            if (!tv->Playback(*curProgram, &settings))
             {
                 quitAll = true;
             }
@@ -848,15 +851,17 @@
 class TVInitRunnable : public QRunnable
 {
   public:
-    TVInitRunnable(TV *ourTV) : tv(ourTV) {}
-    virtual void run(void) { tv->InitFromDB(); }
+    TVInitRunnable(TV *ourTV, PlaySettings *ourSettings) :
+        tv(ourTV), settings(ourSettings) {}
+    virtual void run(void) { tv->InitFromDB(settings); }
     TV *tv;
+    PlaySettings *settings;
 };
 
 /** \fn TV::TV(void)
  *  \sa Init(void)
  */
-TV::TV(void)
+TV::TV(PlaySettings *settings)
     : // Configuration variables from database
       baseFilters(""),
       db_channel_format("<num> <sign>"),
@@ -954,12 +959,12 @@
     playerActive = 0;
     playerLock.unlock();
 
-    QThreadPool::globalInstance()->start(new TVInitRunnable(this), 99);
+    QThreadPool::globalInstance()->start(new TVInitRunnable(this, settings), 99);
 
     VERBOSE(VB_PLAYBACK, LOC + "ctor -- end");
 }
 
-void TV::InitFromDB(void)
+void TV::InitFromDB(PlaySettings *settings)
 {
     QMap<QString,QString> kv;
     kv["LiveTVIdleTimeout"]        = "0";
@@ -1006,6 +1011,7 @@
         kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]);
 
     MythDB::getMythDB()->GetSettings(kv);
+    settings->AddToMap(kv);
 
     QString db_time_format;
     QString db_short_date_format;
@@ -1749,7 +1755,7 @@
     askAllowLock.unlock();
 }
 
-int TV::Playback(const ProgramInfo &rcinfo)
+int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings)
 {
     wantsToQuit   = false;
     jumpToProgram = false;
@@ -1763,7 +1769,7 @@
         return 0;
     }
 
-    mctx->SetPlayingInfo(&rcinfo);
+    mctx->SetPlayingInfo(&rcinfo, settings);
     mctx->SetInitialTVState(false);
     ScheduleStateChange(mctx);
 
@@ -1846,7 +1852,8 @@
 
     if (fileexists)
     {
-        Playback(pginfo);
+        PlaySettings settings("Default");
+        Playback(pginfo, &settings);
         retval = 1;
     }
 
@@ -2234,7 +2241,9 @@
             QString msg = tr("%1 Settings")
                     .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup()));
             ctx->UnlockPlayingInfo(__FILE__, __LINE__);
-            if (count > 0)
+            if (count > 0 &&
+                ctx->playingInfo->GetPlaybackGroup() != "Default" &&
+                ctx->playingInfo->GetPlaybackGroup() != "Videos")
                 SetOSDMessage(ctx, msg);
             ITVRestart(ctx, false);
         }
Index: libs/libmythtv/videodisplayprofile.h
===================================================================
--- libs/libmythtv/videodisplayprofile.h	(revision 27374)
+++ libs/libmythtv/videodisplayprofile.h	(working copy)
@@ -13,6 +13,8 @@
 
 #include "mythcontext.h"
 
+class PlaySettings;
+
 typedef QMap<QString,QString>     pref_map_t;
 typedef QMap<QString,QStringList> safe_map_t;
 typedef QStringList               safe_list_t;
@@ -80,7 +82,7 @@
 class MPUBLIC VideoDisplayProfile
 {
   public:
-    VideoDisplayProfile();
+    VideoDisplayProfile(PlaySettings *settings);
     ~VideoDisplayProfile();
 
     void SetInput(const QSize &size);
@@ -124,7 +126,8 @@
     static QString     GetDecoderName(const QString &decoder);
     static QString     GetDecoderHelp(QString decoder = QString::null);
 
-    static QString     GetDefaultProfileName(const QString &hostname);
+    static QString     GetDefaultProfileName(const QString &hostname,
+                                             PlaySettings *settings);
     static void        SetDefaultProfileName(const QString &profilename,
                                              const QString &hostname);
     static uint        GetProfileGroupID(const QString &profilename,
Index: libs/libmythtv/videoout_null.cpp
===================================================================
--- libs/libmythtv/videoout_null.cpp	(revision 27374)
+++ libs/libmythtv/videoout_null.cpp	(working copy)
@@ -30,8 +30,8 @@
     opts.priorities->insert("null", 10);
 }
 
-VideoOutputNull::VideoOutputNull() :
-    VideoOutput(), global_lock(QMutex::Recursive)
+VideoOutputNull::VideoOutputNull(PlaySettings *settings) :
+    VideoOutput(settings), global_lock(QMutex::Recursive)
 {
     VERBOSE(VB_PLAYBACK, "VideoOutputNull()");
     memset(&av_pause_frame, 0, sizeof(av_pause_frame));
Index: libs/libmythtv/videooutbase.cpp
===================================================================
--- libs/libmythtv/videooutbase.cpp	(revision 27374)
+++ libs/libmythtv/videooutbase.cpp	(working copy)
@@ -7,6 +7,7 @@
 #include "mythplayer.h"
 #include "videodisplayprofile.h"
 #include "decoderbase.h"
+#include "playsettings.h"
 
 #include "mythcorecontext.h"
 #include "mythverbose.h"
@@ -109,7 +110,8 @@
         PIPState pipState,
         const QSize   &video_dim, float        video_aspect,
         WId            win_id,    const QRect &display_rect,
-        float          video_prate,     WId    embed_id)
+        float          video_prate,     WId    embed_id,
+        PlaySettings *settings)
 {
     (void) codec_priv;
 
@@ -154,7 +156,7 @@
     QString renderer = QString::null;
     if (renderers.size() > 0)
     {
-        VideoDisplayProfile vprof;
+        VideoDisplayProfile vprof(settings);
         vprof.SetInput(video_dim);
 
         QString tmp = vprof.GetVideoRenderer();
@@ -182,32 +184,32 @@
 
 #ifdef USING_DIRECTFB
         if (renderer == "directfb")
-            vo = new VideoOutputDirectfb();
+            vo = new VideoOutputDirectfb(settings);
 #endif // USING_DIRECTFB
 
 #ifdef USING_MINGW
         if (renderer == "direct3d")
-            vo = new VideoOutputD3D();
+            vo = new VideoOutputD3D(settings);
 #endif // USING_MINGW
 
 #ifdef USING_QUARTZ_VIDEO
         if (osxlist.contains(renderer))
-            vo = new VideoOutputQuartz();
+            vo = new VideoOutputQuartz(settings);
 #endif // Q_OS_MACX
 
 #ifdef USING_OPENGL_VIDEO
         if (renderer == "opengl")
-            vo = new VideoOutputOpenGL();
+            vo = new VideoOutputOpenGL(settings);
 #endif // USING_OPENGL_VIDEO
 
 #ifdef USING_VDPAU
         if (renderer == "vdpau")
-            vo = new VideoOutputVDPAU();
+            vo = new VideoOutputVDPAU(settings);
 #endif // USING_VDPAU
 
 #ifdef USING_XV
         if (xvlist.contains(renderer))
-            vo = new VideoOutputXv();
+            vo = new VideoOutputXv(settings);
 #endif // USING_XV
 
         if (vo)
@@ -305,8 +307,9 @@
  * \brief This constructor for VideoOutput must be followed by an
  *        Init(int,int,float,WId,int,int,int,int,WId) call.
  */
-VideoOutput::VideoOutput() :
+VideoOutput::VideoOutput(PlaySettings *_settings) :
     // DB Settings
+    window(_settings),
     db_display_dim(0,0),
     db_aspectoverride(kAspect_Off), db_adjustfill(kAdjustFill_Off),
     db_letterbox_colour(kLetterBoxColour_Black),
@@ -343,22 +346,23 @@
     monitor_sz(640,480),                monitor_dim(400,300),
 
     // OSD
-    osd_painter(NULL),                  osd_image(NULL)
+    osd_painter(NULL),                  osd_image(NULL),
+    settings(_settings)
 
 {
     bzero(&pip_tmp_image, sizeof(pip_tmp_image));
-    db_display_dim = QSize(gCoreContext->GetNumSetting("DisplaySizeWidth",  0),
-                           gCoreContext->GetNumSetting("DisplaySizeHeight", 0));
+    db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth",  0),
+                           settings->GetNumSetting("DisplaySizeHeight", 0));
 
     db_aspectoverride = (AspectOverrideMode)
-        gCoreContext->GetNumSetting("AspectOverride",      0);
+        settings->GetNumSetting("AspectOverride",      0);
     db_adjustfill = (AdjustFillMode)
-        gCoreContext->GetNumSetting("AdjustFill",          0);
+        settings->GetNumSetting("AdjustFill",          0);
     db_letterbox_colour = (LetterBoxColour)
-        gCoreContext->GetNumSetting("LetterboxColour",     0);
+        settings->GetNumSetting("LetterboxColour",     0);
 
     if (!gCoreContext->IsDatabaseIgnored())
-        db_vdisp_profile = new VideoDisplayProfile();
+        db_vdisp_profile = new VideoDisplayProfile(settings);
 }
 
 /**
@@ -434,12 +438,12 @@
     return QString::null;
 }
 
-bool VideoOutput::IsPreferredRenderer(QSize video_size)
+bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings)
 {
     if (!db_vdisp_profile || (video_size == window.GetVideoDispDim()))
         return true;
 
-    VideoDisplayProfile vdisp;
+    VideoDisplayProfile vdisp(settings);
     vdisp.SetInput(video_size);
     QString new_rend = vdisp.GetVideoRenderer();
     if (new_rend.isEmpty())
Index: libs/libmythtv/videooutwindow.h
===================================================================
--- libs/libmythtv/videooutwindow.h	(revision 27374)
+++ libs/libmythtv/videooutwindow.h	(working copy)
@@ -16,11 +16,12 @@
 #include "videoouttypes.h"
 
 class MythPlayer;
+class PlaySettings;
 
 class VideoOutWindow
 {
   public:
-    VideoOutWindow();
+    VideoOutWindow(PlaySettings *settings);
 
     bool Init(const QSize &new_video_dim, float aspect,
               const QRect &new_display_visible_rect,
@@ -164,6 +165,8 @@
     bool     allowpreviewepg;
     PIPState pip_state;
 
+    PlaySettings *settings;
+
     // Constants
     static const float kManualZoomMaxHorizontalZoom;
     static const float kManualZoomMaxVerticalZoom;
Index: libs/libmythtv/videoout_directfb.h
===================================================================
--- libs/libmythtv/videoout_directfb.h	(revision 27374)
+++ libs/libmythtv/videoout_directfb.h	(working copy)
@@ -12,7 +12,7 @@
 {
   public:
     static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
-    VideoOutputDirectfb();
+    VideoOutputDirectfb(PlaySettings *settings);
     ~VideoOutputDirectfb();
 
     bool Init(int width, int height, float aspect, WId winid,
Index: libs/libmythtv/playercontext.h
===================================================================
--- libs/libmythtv/playercontext.h	(revision 27374)
+++ libs/libmythtv/playercontext.h	(working copy)
@@ -28,6 +28,7 @@
 class LiveTVChain;
 class MythDialog;
 class QPainter;
+class PlaySettings;
 
 struct osdInfo
 {
@@ -115,7 +116,7 @@
     void SetRecorder(RemoteEncoder *rec);
     void SetTVChain(LiveTVChain *chain);
     void SetRingBuffer(RingBuffer *buf);
-    void SetPlayingInfo(const ProgramInfo *info);
+    void SetPlayingInfo(const ProgramInfo *info, PlaySettings *settings=NULL);
     void SetPlayGroup(const QString &group);
     void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state);
     void SetPIPLocation(int loc) { pipLocation = loc; }
@@ -173,6 +174,7 @@
     LiveTVChain        *tvchain;
     RingBuffer         *buffer;
     ProgramInfo        *playingInfo; ///< Currently playing info
+    PlaySettings       *settings; // corresponding to playingInfo
     long long           playingLen;  ///< Initial CalculateLength()
     AVSpecialDecode     specialDecode;
     bool                nohardwaredecoders; // < Disable use of VDPAU decoding
Index: libs/libmythtv/vsync.h
===================================================================
--- libs/libmythtv/vsync.h	(revision 27374)
+++ libs/libmythtv/vsync.h	(working copy)
@@ -89,6 +89,7 @@
 
     // documented in vsync.cpp
     static VideoSync *BestMethod(VideoOutput*,
+                                 PlaySettings *settings,
                                  uint frame_interval, uint refresh_interval,
                                  bool interlaced);
   protected:
Index: libs/libmythtv/videoout_xv.h
===================================================================
--- libs/libmythtv/videoout_xv.h	(revision 27374)
+++ libs/libmythtv/videoout_xv.h	(working copy)
@@ -51,7 +51,7 @@
     friend class XvMCOSD;
   public:
     static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
-    VideoOutputXv();
+    VideoOutputXv(PlaySettings *settings);
    ~VideoOutputXv();
 
     bool Init(int width, int height, float aspect, WId winid,
@@ -109,9 +109,11 @@
     static MythCodecID GetBestSupportedCodec(uint width, uint height,
                                              uint osd_width, uint osd_height,
                                              uint stream_type, int xvmc_chroma,
-                                             bool test_surface, bool force_xv);
+                                             bool test_surface, bool force_xv,
+                                             PlaySettings *settings);
 
     static int GrabSuitableXvPort(MythXDisplay* disp, Window root,
+                                  PlaySettings *settings,
                                   MythCodecID type,
                                   uint width, uint height,
                                   bool &xvsetdefaults,
Index: libs/libmythtv/videoout_xv.cpp
===================================================================
--- libs/libmythtv/videoout_xv.cpp	(revision 27374)
+++ libs/libmythtv/videoout_xv.cpp	(working copy)
@@ -170,8 +170,8 @@
  * \see VideoOutput, VideoBuffers
  *
  */
-VideoOutputXv::VideoOutputXv()
-    : VideoOutput(),
+VideoOutputXv::VideoOutputXv(PlaySettings *settings)
+    : VideoOutput(settings),
       video_output_subtype(XVUnknown),
       global_lock(QMutex::Recursive),
 
@@ -401,6 +401,7 @@
  * \return port number if it succeeds, else -1.
  */
 int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root,
+                                      PlaySettings *settings,
                                       MythCodecID mcodecid,
                                       uint width, uint height,
                                       bool &xvsetdefaults,
@@ -485,7 +486,7 @@
     }
 
     // figure out if we want chromakeying..
-    VideoDisplayProfile vdp;
+    VideoDisplayProfile vdp(settings);
     vdp.SetInput(QSize(width, height));
     bool check_for_colorkey = (vdp.GetOSDRenderer() == "chromakey");
 
@@ -785,7 +786,7 @@
     disp->StartLog();
     QString adaptor_name = QString::null;
     const QSize video_dim = window.GetVideoDim();
-    xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), video_codec_id,
+    xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, video_codec_id,
                                  video_dim.width(), video_dim.height(),
                                  xv_set_defaults,
                                  xvmc_chroma, &xvmc_surf_info, &adaptor_name);
@@ -864,7 +865,7 @@
     disp->StartLog();
     QString adaptor_name = QString::null;
     const QSize video_dim = window.GetVideoDim();
-    xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), kCodec_MPEG2,
+    xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, kCodec_MPEG2,
                                  video_dim.width(), video_dim.height(),
                                  xv_set_defaults, 0, NULL, &adaptor_name);
     if (xv_port == -1)
@@ -1018,7 +1019,8 @@
     uint width,       uint height,
     uint osd_width,   uint osd_height,
     uint stream_type, int xvmc_chroma,
-    bool test_surface, bool force_xv)
+    bool test_surface, bool force_xv,
+    PlaySettings *settings)
 {
     (void)width, (void)height, (void)osd_width, (void)osd_height;
     (void)stream_type, (void)xvmc_chroma, (void)test_surface;
@@ -1029,7 +1031,7 @@
         return ret;
 
 #ifdef USING_XVMC
-    VideoDisplayProfile vdp;
+    VideoDisplayProfile vdp(settings);
     vdp.SetInput(QSize(width, height));
     QString dec = vdp.GetDecoder();
     if ((dec == "libmpeg2") || (dec == "ffmpeg"))
@@ -1079,7 +1081,8 @@
 
         ok = false;
         bool dummy;
-        int port = GrabSuitableXvPort(disp, disp->GetRoot(), ret, width, height,
+        int port = GrabSuitableXvPort(disp, disp->GetRoot(), settings,
+                                      ret, width, height,
                                       dummy, xvmc_chroma, &info);
         if (port >= 0)
         {
Index: libs/libmythtv/mythplayer.cpp
===================================================================
--- libs/libmythtv/mythplayer.cpp	(revision 27374)
+++ libs/libmythtv/mythplayer.cpp	(working copy)
@@ -60,6 +60,7 @@
 #include "mythpainter.h"
 #include "mythimage.h"
 #include "mythuiimage.h"
+#include "playsettings.h"
 
 extern "C" {
 #include "vbitext/vbi.h"
@@ -250,14 +251,7 @@
       output_jmeter(NULL)
 {
     playerThread = QThread::currentThread();
-    // Playback (output) zoom control
-    detect_letter_box = new DetectLetterbox(this);
 
-    vbimode = VBIMode::Parse(gCoreContext->GetSetting("VbiFormat"));
-    decode_extra_audio = gCoreContext->GetNumSetting("DecodeExtraAudio", 0);
-    itvEnabled         = gCoreContext->GetNumSetting("EnableMHEG", 0);
-    db_prefer708       = gCoreContext->GetNumSetting("Prefer708Captions", 1);
-
     bzero(&tc_lastval, sizeof(tc_lastval));
     bzero(&tc_wrap,    sizeof(tc_wrap));
     tc_wrap[TC_AUDIO] = gCoreContext->GetNumSetting("AudioSyncOffset", 0);
@@ -496,7 +490,7 @@
     if (using_null_videoout && decoder)
     {
         MythCodecID codec = decoder->GetVideoCodecID();
-        videoOutput = new VideoOutputNull();
+        videoOutput = new VideoOutputNull(GetPlaySettings());
         if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(),
                                video_aspect, 0, 0, 0, 0, 0, codec, 0))
         {
@@ -546,7 +540,7 @@
                 pipState,
                 video_disp_dim, video_aspect,
                 widget->winId(), display_rect, (video_frame_rate * play_speed),
-                0 /*embedid*/);
+                0 /*embedid*/, GetPlaySettings());
         }
 
         if (videoOutput)
@@ -638,7 +632,7 @@
 
 void MythPlayer::ReinitVideo(void)
 {
-    if (!videoOutput->IsPreferredRenderer(video_disp_dim))
+    if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings()))
     {
         VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer."));
         SetErrored(QObject::tr("Need to switch video renderer."));
@@ -2062,7 +2056,8 @@
         }
 #endif // USING_MHEG
 
-        SetCaptionsEnabled(gCoreContext->GetNumSetting("DefaultCCMode"), false);
+        SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0),
+                           false);
         osdLock.unlock();
     }
 
@@ -2109,7 +2104,8 @@
         m_double_process = videoOutput->IsExtraProcessingRequired();
 
         videosync = VideoSync::BestMethod(
-            videoOutput, fr_int, rf_int, m_double_framerate);
+            videoOutput, GetPlaySettings(),
+            fr_int, rf_int, m_double_framerate);
 
         // Make sure video sync can do it
         if (videosync != NULL && m_double_framerate)
@@ -2492,7 +2488,7 @@
     if (bookmarkseek > 30)
     {
         DoFastForward(bookmarkseek, true, false);
-        if (gCoreContext->GetNumSetting("ClearSavedPosition", 1) &&
+        if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) &&
             !player_ctx->IsPIP())
         {
             ClearBookmark(false);
@@ -2724,7 +2720,7 @@
     {
         if (jumpto == totalFrames)
         {
-            if (!(gCoreContext->GetNumSetting("EndOfRecordingExitPrompt") == 1
+            if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1
                   && !player_ctx->IsPIP() &&
                   player_ctx->GetState() == kState_WatchingPreRecorded))
             {
@@ -3007,7 +3003,8 @@
         return kPIP_END;
 
     if (pip_players.isEmpty())
-        return (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft);
+        return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation",
+                                                             kPIPTopLeft);
 
     // order of preference, could be stored in db if we want it configurable
     PIPLocation ols[] =
@@ -3515,6 +3512,15 @@
     exactseeks   = frame_exact_seek;
     player_ctx   = ctx;
     livetv       = ctx->tvchain;
+
+    vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", ""));
+
+    // Playback (output) zoom control
+    detect_letter_box = new DetectLetterbox(this);
+
+    decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0);
+    itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0);
+    db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1);
 }
 
 bool MythPlayer::EnableEdit(void)
Index: libs/libmythtv/videooutbase.h
===================================================================
--- libs/libmythtv/videooutbase.h	(revision 27374)
+++ libs/libmythtv/videooutbase.h	(working copy)
@@ -34,6 +34,7 @@
 class FilterChain;
 class FilterManager;
 class OpenGLContextGLX;
+class PlaySettings;
 
 typedef QMap<MythPlayer*,PIPLocation> PIPMap;
 
@@ -54,9 +55,10 @@
         PIPState       pipState,
         const QSize   &video_dim, float        video_aspect,
         WId            win_id,    const QRect &display_rect,
-        float video_prate,        WId          embed_id);
+        float video_prate,        WId          embed_id,
+        PlaySettings *settings);
 
-    VideoOutput();
+    VideoOutput(PlaySettings *settings);
     virtual ~VideoOutput();
 
     virtual bool Init(int width, int height, float aspect,
@@ -64,7 +66,7 @@
                       int winh, MythCodecID codec_id, WId embedid = 0);
     virtual void InitOSD(OSD *osd);
     virtual void SetVideoFrameRate(float);
-    virtual bool IsPreferredRenderer(QSize video_size);
+    virtual bool IsPreferredRenderer(QSize video_size, PlaySettings *settings);
     virtual bool SetDeinterlacingEnabled(bool);
     virtual bool SetupDeinterlace(bool i, const QString& ovrf="");
     virtual void FallbackDeint(void);
@@ -331,6 +333,8 @@
     // OSD painter and surface
     MythYUVAPainter *osd_painter;
     MythImage       *osd_image;
+
+    PlaySettings *settings;
 };
 
 #endif
Index: libs/libmythtv/textsubtitleparser.cpp
===================================================================
--- libs/libmythtv/textsubtitleparser.cpp	(revision 27374)
+++ libs/libmythtv/textsubtitleparser.cpp	(working copy)
@@ -21,6 +21,7 @@
 #include "RingBuffer.h"
 #include "textsubtitleparser.h"
 #include "xine_demux_sputext.h"
+#include "playsettings.h"
 
 static bool operator<(const text_subtitle_t& left,
                       const text_subtitle_t& right)
@@ -116,7 +117,8 @@
     m_lock.unlock();
 }
 
-bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target)
+bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target,
+                                       PlaySettings *settings)
 {
     demux_sputext_t sub_data;
     sub_data.rbuffer = new RingBuffer(fileName, 0, false);
@@ -134,7 +136,7 @@
     target.SetFrameBasedTiming(!sub_data.uses_time);
 
     QTextCodec *textCodec = NULL;
-    QString codec = gCoreContext->GetSetting("SubtitleCodec", "");
+    QString codec = settings->GetSetting("SubtitleCodec", "");
     if (!codec.isEmpty())
         textCodec = QTextCodec::codecForName(codec.toLatin1());
     if (!textCodec)
Index: libs/libmythtv/subtitlescreen.cpp
===================================================================
--- libs/libmythtv/subtitlescreen.cpp	(revision 27374)
+++ libs/libmythtv/subtitlescreen.cpp	(working copy)
@@ -7,6 +7,7 @@
 #include "mythuiimage.h"
 #include "mythpainter.h"
 #include "subtitlescreen.h"
+#include "playsettings.h"
 
 #define LOC      QString("Subtitles: ")
 #define LOC_WARN QString("Subtitles Warning: ")
@@ -68,8 +69,8 @@
         VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-608 reader.");
     if (!m_708reader)
         VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-708 reader.");
-    m_useBackground = (bool)gCoreContext->GetNumSetting("CCBackground", 0);
-    m_textFontZoom  = gCoreContext->GetNumSetting("OSDCC708TextZoom", 100);
+    m_useBackground = (bool)m_player->GetPlaySettings()->GetNumSetting("CCBackground", 0);
+    m_textFontZoom   = m_player->GetPlaySettings()->GetNumSetting("OSDCC708TextZoom", 100);
     return true;
 }
 
Index: libs/libmythtv/videoout_quartz.h
===================================================================
--- libs/libmythtv/videoout_quartz.h	(revision 27374)
+++ libs/libmythtv/videoout_quartz.h	(working copy)
@@ -2,6 +2,7 @@
 #define VIDEOOUT_QUARTZ_H_
 
 struct QuartzData;
+class PlaySettings;
 
 #include "videooutbase.h"
 
@@ -9,7 +10,7 @@
 {
   public:
     static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
-    VideoOutputQuartz();
+    VideoOutputQuartz(PlaySettings *settings);
    ~VideoOutputQuartz();
 
     bool Init(int width, int height, float aspect, WId winid,
@@ -52,7 +53,7 @@
     static MythCodecID GetBestSupportedCodec(
         uint width, uint height,
         uint osd_width, uint osd_height,
-        uint stream_type, uint fourcc);
+        uint stream_type, uint fourcc, PlaySettings *settings);
     virtual bool NeedExtraAudioDecode(void) const
         { return !codec_is_std(video_codec_id); }
 
Index: libs/libmythtv/videodisplayprofile.cpp
===================================================================
--- libs/libmythtv/videodisplayprofile.cpp	(revision 27374)
+++ libs/libmythtv/videodisplayprofile.cpp	(working copy)
@@ -8,6 +8,7 @@
 #include "mythverbose.h"
 #include "videooutbase.h"
 #include "avformatdecoder.h"
+#include "playsettings.h"
 
 bool ProfileItem::IsMatch(const QSize &size, float rate) const
 {
@@ -212,7 +213,7 @@
 pref_map_t  VideoDisplayProfile::dec_name;
 safe_list_t VideoDisplayProfile::safe_decoders;
 
-VideoDisplayProfile::VideoDisplayProfile()
+VideoDisplayProfile::VideoDisplayProfile(PlaySettings *settings)
     : lock(QMutex::Recursive), last_size(0,0), last_rate(0.0f),
       last_video_renderer(QString::null)
 {
@@ -220,7 +221,7 @@
     init_statics();
 
     QString hostname    = gCoreContext->GetHostName();
-    QString cur_profile = GetDefaultProfileName(hostname);
+    QString cur_profile = GetDefaultProfileName(hostname, settings);
     uint    groupid     = GetProfileGroupID(cur_profile, hostname);
 
     item_list_t items = LoadDB(groupid);
@@ -772,9 +773,11 @@
     return list;
 }
 
-QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname)
+QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname,
+                                                   PlaySettings *settings)
 {
     QString tmp =
+        settings ? settings->GetSetting("DefaultVideoPlaybackProfile", "") :
         gCoreContext->GetSettingOnHost("DefaultVideoPlaybackProfile", hostname);
 
     QStringList profiles = GetProfiles(hostname);
Index: libs/libmythtv/videoout_null.h
===================================================================
--- libs/libmythtv/videoout_null.h	(revision 27374)
+++ libs/libmythtv/videoout_null.h	(working copy)
@@ -9,7 +9,7 @@
 {
   public:
     static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
-    VideoOutputNull();
+    VideoOutputNull(PlaySettings *settings);
    ~VideoOutputNull();
 
     bool Init(int width, int height, float aspect, WId winid,
Index: libs/libmyth/settings.cpp
===================================================================
--- libs/libmyth/settings.cpp	(revision 27374)
+++ libs/libmyth/settings.cpp	(working copy)
@@ -235,6 +235,20 @@
     return -1;
 }
 
+QString SelectSetting::GetValueLabel(const QString &value)
+{
+    selectionList::const_iterator iterValues = values.begin();
+    selectionList::const_iterator iterLabels = labels.begin();
+    for (; iterValues != values.end() && iterLabels != labels.end();
+         ++iterValues, ++iterLabels)
+    {
+        if (*iterValues == value)
+            return *iterLabels;
+    }
+
+    return "???";
+}
+
 bool SelectSetting::ReplaceLabel(const QString &new_label, const QString &value)
 {
     int i = getValueIndex(value);
@@ -299,6 +313,7 @@
         QLabel *label = new QLabel();
         label->setText(getLabel() + ":     ");
         layout->addWidget(label);
+        labelWidget = label;
     }
 
     bxwidget = widget;
@@ -327,6 +342,8 @@
 
     widget->setLayout(layout);
 
+    setValue(getValue());
+
     return widget;
 }
 
@@ -336,6 +353,7 @@
     {
         bxwidget = NULL;
         edit     = NULL;
+        labelWidget = NULL;
     }
 }
 
@@ -373,6 +391,26 @@
     Setting::setHelpText(str);
 }
 
+static void adjustFont(QWidget *widget, bool isDefault)
+{
+    if (widget)
+    {
+        QFont f = widget->font();
+        f.setWeight(isDefault ? QFont::Light : QFont::Bold);
+        widget->setFont(f);
+    }
+}
+
+void LineEditSetting::setValue(const QString &newValue)
+{
+    if (adjustOnBlank)
+    {
+        adjustFont(labelWidget, newValue.isEmpty());
+        adjustFont(edit,        newValue.isEmpty());
+    }
+    Setting::setValue(newValue);
+}
+
 void BoundedIntegerSetting::setValue(int newValue)
 {
     newValue = std::max(std::min(newValue, max), min);
@@ -439,10 +477,12 @@
 
 SpinBoxSetting::SpinBoxSetting(
     Storage *_storage, int _min, int _max, int _step, 
-    bool _allow_single_step, QString _special_value_text) :
+    bool _allow_single_step, QString _special_value_text,
+    bool change_style_on_special) :
     BoundedIntegerSetting(_storage, _min, _max, _step),
     spinbox(NULL), relayEnabled(true),
-    sstep(_allow_single_step), svtext("")
+    sstep(_allow_single_step), svtext(""), labelWidget(NULL),
+    changeOnSpecial(change_style_on_special)
 {
     if (!_special_value_text.isEmpty())
         svtext = _special_value_text;
@@ -476,6 +516,7 @@
         QLabel *label = new QLabel();
         label->setText(getLabel() + ":     ");
         layout->addWidget(label);
+        labelWidget = label;
     }
 
     bxwidget = widget;
@@ -506,6 +547,8 @@
 
     widget->setLayout(layout);
 
+    setValue(intValue());
+
     return widget;
 }
 
@@ -515,12 +558,18 @@
     {
         bxwidget = NULL;
         spinbox  = NULL;
+        labelWidget = NULL;
     }
 }
 
 void SpinBoxSetting::setValue(int newValue)
 {
     newValue = std::max(std::min(newValue, max), min);
+    if (changeOnSpecial)
+    {
+        adjustFont(labelWidget, (newValue == min));
+        adjustFont(spinbox,     (newValue == min));
+    }
     if (spinbox && (spinbox->value() != newValue))
     {
         //int old = intValue();
@@ -631,6 +680,7 @@
         QLabel *label = new QLabel();
         label->setText(getLabel() + ":     ");
         layout->addWidget(label);
+        labelWidget = label;
     }
 
     bxwidget = widget;
@@ -659,8 +709,12 @@
             cbwidget, SLOT(clear()));
 
     if (rw)
+    {
         connect(cbwidget, SIGNAL(editTextChanged(const QString &)),
                 this, SLOT(editTextChanged(const QString &)));
+        connect(cbwidget, SIGNAL(editTextChanged(const QString &)),
+                this, SLOT(changeLabel(const QString &)));
+    }
 
     if (cg)
         connect(cbwidget, SIGNAL(changeHelpText(QString)), cg,
@@ -673,6 +727,8 @@
 
     widget->setLayout(layout);
 
+    setValue(current);
+
     return widget;
 }
 
@@ -682,6 +738,7 @@
     {
         bxwidget = NULL;
         cbwidget = NULL;
+        labelWidget = NULL;
     }
 }
 
@@ -717,6 +774,7 @@
 
     if (rw)
     {
+        changeLabel(newValue);
         Setting::setValue(newValue);
         if (cbwidget)
             cbwidget->setCurrentIndex(current);
@@ -727,18 +785,34 @@
 {
     if (cbwidget)
         cbwidget->setCurrentIndex(which);
+    changeLabel(labels[which]);
     SelectSetting::setValue(which);
 }
 
-void ComboBoxSetting::addSelection(
-    const QString &label, QString value, bool select)
+void ComboBoxSetting::changeLabel(const QString &newLabel)
 {
+    if (changeOnSpecial)
+    {
+        adjustFont(labelWidget, specialLabel == newLabel);
+        adjustFont(cbwidget,    specialLabel == newLabel);
+    }
+}
+
+void ComboBoxSetting::addSelection(const QString &label, QString value,
+                                   bool select, bool special_formatting)
+{
     if ((findSelection(label, value) < 0) && cbwidget)
     {
         resetMaxCount(cbwidget->count()+1);
         cbwidget->insertItem(label);
     }
 
+    if (special_formatting)
+    {
+        changeOnSpecial = true;
+        specialLabel = label;
+    }
+
     SelectSetting::addSelection(label, value, select);
 
     if (cbwidget && isSet)
@@ -955,6 +1029,69 @@
     BooleanSetting::setHelpText(str);
 }
 
+QWidget* TristateCheckBoxSetting::configWidget(ConfigurationGroup *cg,
+                                               QWidget* parent,
+                                               const char* widgetName) {
+    widget = new MythCheckBox(parent, widgetName, true);
+    connect(widget, SIGNAL(destroyed(QObject*)),
+            this,   SLOT(widgetDeleted(QObject*)));
+
+    widget->setHelpText(getHelpText());
+    widget->setText(getLabel());
+    widget->setCheckState(tristateValue());
+    setValue(tristateValue());
+
+    connect(widget, SIGNAL(stateChanged(int)),
+            this, SLOT(setValue(int)));
+    connect(this, SIGNAL(valueChanged(int)),
+            this, SLOT(relayValueChanged(int)));
+
+    if (cg)
+        connect(widget, SIGNAL(changeHelpText(QString)), cg,
+                SIGNAL(changeHelpText(QString)));
+
+    return widget;
+}
+
+void TristateCheckBoxSetting::widgetInvalid(QObject *obj)
+{
+    widget = (widget == obj) ? NULL : widget;
+}
+
+void TristateCheckBoxSetting::setEnabled(bool fEnabled)
+{
+    TristateSetting::setEnabled(fEnabled);
+    if (widget)
+        widget->setEnabled(fEnabled);
+}
+
+void TristateCheckBoxSetting::setHelpText(const QString &str)
+{
+    if (widget)
+        widget->setHelpText(str);
+    TristateSetting::setHelpText(str);
+}
+
+const char *TristateSetting::kPartiallyCheckedString = "default";
+
+void TristateCheckBoxSetting::setValue(int check)
+{
+    adjustFont(widget, (check != Qt::Checked && check != Qt::Unchecked));
+    TristateSetting::setValue(check);
+    emit valueChanged(check);
+}
+
+void TristateSetting::setValue(int check)
+{
+    if (check == Qt::Checked)
+        Setting::setValue("1");
+    else if (check == Qt::Unchecked)
+        Setting::setValue("0");
+    else
+        Setting::setValue(kPartiallyCheckedString);
+    emit valueChanged(check);
+}
+
 void AutoIncrementDBSetting::Save(QString table)
 {
     if (intValue() == 0) 
@@ -1142,6 +1279,24 @@
     addSelection(label, value, select);
 }
 
+void ImageSelectSetting::addDefaultSelection(const QString label,
+                                             const QString value,
+                                             const QString defaultValue,
+                                             bool select)
+{
+    for (unsigned i=0; i<values.size(); i++)
+    {
+        if (values[i] == defaultValue)
+        {
+            changeOnSpecial = true;
+            specialLabel = label;
+            images.push_back(new QImage(*images[i]));
+            addSelection(label, value, select);
+            return;
+        }
+    }
+}
+
 ImageSelectSetting::~ImageSelectSetting()
 {
     Teardown();
@@ -1164,6 +1319,7 @@
     bxwidget   = NULL;
     imagelabel = NULL;
     combo      = NULL;
+    labelWidget = NULL;
 }
 
 void ImageSelectSetting::imageSet(int num)
@@ -1211,6 +1367,7 @@
         QLabel *label = new QLabel();
         label->setText(getLabel() + ":");
         layout->addWidget(label);
+        labelWidget = label;
     }
 
     combo = new MythComboBox(false);
@@ -1257,6 +1414,10 @@
     connect(combo, SIGNAL(highlighted(int)), this, SLOT(imageSet(int)));
     connect(combo, SIGNAL(activated(int)), this, SLOT(setValue(int)));
     connect(combo, SIGNAL(activated(int)), this, SLOT(imageSet(int)));
+    connect(combo, SIGNAL(highlighted(const QString &)),
+            this, SLOT(changeLabel(const QString &)));
+    connect(combo, SIGNAL(activated(const QString &)),
+            this, SLOT(changeLabel(const QString &)));
 
     connect(this, SIGNAL(selectionsCleared()),
             combo, SLOT(clear()));
@@ -1267,9 +1428,20 @@
 
     bxwidget->setLayout(layout);
 
+    changeLabel(GetLabel(current));
+
     return bxwidget;
 }
 
+void ImageSelectSetting::changeLabel(const QString &newLabel)
+{
+    if (changeOnSpecial)
+    {
+        adjustFont(labelWidget, specialLabel == newLabel);
+        adjustFont(combo,       specialLabel == newLabel);
+    }
+}
+
 void ImageSelectSetting::widgetInvalid(QObject *obj)
 {
     if (bxwidget == obj)
Index: libs/libmyth/mythwidgets.cpp
===================================================================
--- libs/libmyth/mythwidgets.cpp	(revision 27374)
+++ libs/libmyth/mythwidgets.cpp	(working copy)
@@ -223,7 +223,16 @@
         else if (action == "DOWN")
             focusNextPrevChild(true);
         else if (action == "LEFT" || action == "RIGHT" || action == "SELECT")
-            toggle();
+        {
+            if (isTristate())
+            {
+                Qt::CheckState newState =
+                    (Qt::CheckState)(((int)checkState() + 1) % 3);
+                setCheckState(newState);
+            }
+            else
+                toggle();
+        }
         else
             handled = false;
     }
Index: libs/libmyth/settings.h
===================================================================
--- libs/libmyth/settings.h	(revision 27374)
+++ libs/libmyth/settings.h	(working copy)
@@ -134,10 +134,14 @@
 
 class MPUBLIC LineEditSetting : public Setting
 {
+    Q_OBJECT
+
   protected:
-    LineEditSetting(Storage *_storage, bool readwrite = true) :
+    LineEditSetting(Storage *_storage, bool readwrite = true,
+                    bool adjust_on_blank = false) :
         Setting(_storage), bxwidget(NULL), edit(NULL),
-        rw(readwrite), password_echo(false) { }
+        rw(readwrite), password_echo(false),
+        adjustOnBlank(adjust_on_blank), labelWidget(NULL) { }
 
   public:
     virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 
@@ -159,11 +163,16 @@
 
     virtual void setHelpText(const QString &str);
 
+  public slots:
+    virtual void setValue(const QString &newValue);
+
   private:
     QWidget      *bxwidget;
     MythLineEdit *edit;
     bool rw;
     bool password_echo;
+    bool adjustOnBlank;
+    QWidget *labelWidget;
 };
 
 // TODO: set things up so that setting the value as a string emits
@@ -219,7 +228,8 @@
   public:
     SpinBoxSetting(Storage *_storage, int min, int max, int step, 
                    bool allow_single_step = false,
-                   QString special_value_text = "");
+                   QString special_value_text = "",
+                   bool change_style_on_special = false);
 
     virtual QWidget *configWidget(ConfigurationGroup *cg, QWidget *parent, 
                                   const char *widgetName = 0);
@@ -248,6 +258,8 @@
     bool         relayEnabled;
     bool         sstep;
     QString      svtext;
+    QLabel      *labelWidget;
+    bool         changeOnSpecial;
 };
 
 class MPUBLIC SelectSetting : public Setting
@@ -277,6 +289,7 @@
         { return (i < labels.size()) ? labels[i] : QString::null; }
     virtual QString GetValue(uint i) const
         { return (i < values.size()) ? values[i] : QString::null; }
+    virtual QString GetValueLabel(const QString &value);
 
 signals:
     void selectionAdded(const QString& label, QString value);
@@ -318,7 +331,8 @@
 protected:
     ComboBoxSetting(Storage *_storage, bool _rw = false, int _step = 1) :
         SelectSetting(_storage), rw(_rw),
-        bxwidget(NULL), cbwidget(NULL), step(_step) { }
+        bxwidget(NULL), cbwidget(NULL), changeOnSpecial(false),
+        specialLabel(""), labelWidget(NULL), step(_step) { }
 
 public:
     virtual void setValue(QString newValue);
@@ -340,15 +354,20 @@
 public slots:
     void addSelection(const QString &label,
                       QString value = QString::null,
-                      bool select = false);
+                      bool select = false,
+                      bool special_formatting = false);
     bool removeSelection(const QString &label,
                          QString value = QString::null);
+    virtual void changeLabel(const QString &newValue);
     void editTextChanged(const QString &newText);
 
 private:
     bool rw;
     QWidget      *bxwidget;
     MythComboBox *cbwidget;
+    bool          changeOnSpecial;
+    QString       specialLabel;
+    QLabel       *labelWidget;
 
 protected:
     int step;
@@ -417,7 +436,8 @@
     ImageSelectSetting(Storage *_storage) :
         SelectSetting(_storage),
         bxwidget(NULL), imagelabel(NULL), combo(NULL),
-        m_hmult(1.0f), m_wmult(1.0f) { }
+        m_hmult(1.0f), m_wmult(1.0f),
+        changeOnSpecial(false), specialLabel(""), labelWidget(NULL) { }
     virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 
                                   const char* widgetName = 0);
     virtual void widgetInvalid(QObject *obj);
@@ -428,9 +448,14 @@
                                    QImage* image,
                                    QString value=QString::null,
                                    bool select=false);
+    virtual void addDefaultSelection(const QString label,
+                                     const QString value,
+                                     const QString defaultValue,
+                                     bool select);
 
 protected slots:
     void imageSet(int);
+    void changeLabel(const QString &newLabel);
 
   protected:
     void Teardown(void);
@@ -442,6 +467,9 @@
     QLabel *imagelabel;
     MythComboBox *combo;
     float m_hmult, m_wmult;
+    bool          changeOnSpecial;
+    QString       specialLabel;
+    QLabel       *labelWidget;
 };
 
 class MPUBLIC BooleanSetting : public Setting
@@ -484,6 +512,56 @@
     MythCheckBox *widget;
 };
 
+class MPUBLIC TristateSetting : public BooleanSetting
+{
+    Q_OBJECT
+
+  public:
+    TristateSetting(Storage *_storage) : BooleanSetting(_storage) {}
+
+    Qt::CheckState tristateValue(void) const {
+        if (getValue() == "0")
+            return Qt::Unchecked;
+        if (getValue() == "1")
+            return Qt::Checked;
+        return Qt::PartiallyChecked;
+    }
+
+    static const char *kPartiallyCheckedString;
+
+public slots:
+    virtual void setValue(/*Qt::CheckState*/int check);
+
+signals:
+    void valueChanged(int);
+};
+
+class MPUBLIC TristateCheckBoxSetting: public TristateSetting {
+    Q_OBJECT
+
+public:
+    TristateCheckBoxSetting(Storage *_storage) :
+        TristateSetting(_storage), widget(NULL) { }
+    virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent,
+                                  const char* widgetName = 0);
+    virtual void widgetInvalid(QObject*);
+
+    virtual void setEnabled(bool b);
+
+    virtual void setHelpText(const QString &str);
+
+
+public slots:
+    virtual void setValue(/*Qt::CheckState*/int check);
+    virtual void relayValueChanged(int state) {
+        if (widget)
+            widget->setCheckState((Qt::CheckState)state);
+    }
+
+protected:
+    MythCheckBox *widget;
+};
+
 class MPUBLIC PathSetting : public ComboBoxSetting
 {
 public:
Index: libs/libmyth/libmyth.pro
===================================================================
--- libs/libmyth/libmyth.pro	(revision 27374)
+++ libs/libmyth/libmyth.pro	(working copy)
@@ -62,6 +62,9 @@
 SOURCES += mythrssmanager.cpp     netgrabbermanager.cpp
 SOURCES += rssparse.cpp           netutils.cpp
 
+HEADERS += playsettings.h
+SOURCES += playsettings.cpp
+
 # remove when everything is switched to mythui
 SOURCES += virtualkeyboard_qt.cpp
 
Index: libs/libmyth/mythconfiggroups.cpp
===================================================================
--- libs/libmyth/mythconfiggroups.cpp	(revision 27374)
+++ libs/libmyth/mythconfiggroups.cpp	(working copy)
@@ -476,6 +476,7 @@
                                             Configurable *target)
 {
     VerifyLayout();
+    bool isDuplicate = triggerMap.values().contains(target);
     triggerMap[triggerValue] = target;
 
     if (!configStack)
@@ -485,7 +486,10 @@
         configStack->setSaveAll(isSaveAll);
     }
 
-    configStack->addChild(target);
+    // Don't add a target as a child if it has already been added,
+    // otherwise something goes wrong with signals in the child.
+    if (!isDuplicate)
+        configStack->addChild(target);
 }
 
 Setting *TriggeredConfigurationGroup::byName(const QString &settingName)
Index: libs/libmyth/mythwidgets.h
===================================================================
--- libs/libmyth/mythwidgets.h	(revision 27374)
+++ libs/libmyth/mythwidgets.h	(working copy)
@@ -329,11 +329,19 @@
     Q_OBJECT
 
   public:
-    MythCheckBox(QWidget *parent = 0, const char *name = "MythCheckBox")
-        : QCheckBox(parent)       { setObjectName(name); };
+    MythCheckBox(QWidget *parent = 0, const char *name = "MythCheckBox",
+                 bool isTristate = false) : QCheckBox(parent)
+    {
+        setObjectName(name);
+        setTristate(isTristate);
+    }
     MythCheckBox(const QString &text,
-                 QWidget *parent = 0, const char *name = "MythCheckBox")
-        : QCheckBox(text, parent) { setObjectName(name); };
+                 QWidget *parent = 0, const char *name = "MythCheckBox",
+                 bool isTristate = false) : QCheckBox(text, parent)
+    {
+        setObjectName(name);
+        setTristate(isTristate);
+    }
 
     void setHelpText(const QString&);
 
Index: programs/mythfrontend/globalsettings.cpp
===================================================================
--- programs/mythfrontend/globalsettings.cpp	(revision 27374)
+++ programs/mythfrontend/globalsettings.cpp	(working copy)
@@ -38,7 +38,122 @@
 #include "mythconfig.h"
 #include "mythdirs.h"
 #include "mythuihelper.h"
+#include "playsettings.h"
 
+#define CREATE_CHECKBOX_SETTING(var, name, settings) \
+    BooleanSetting *var; \
+    if ((settings)) \
+        var = new PlaySettingsCheckBox((name), (settings)); \
+    else \
+        var = new HostCheckBox((name))
+
+#define CREATE_COMBOBOX_SETTING(var, name, settings) \
+    ComboBoxSetting *var; \
+    if ((settings)) \
+        var = new PlaySettingsComboBox((name), (settings)); \
+    else \
+        var = new HostComboBox((name))
+
+#define CREATE_COMBOBOX1_SETTING(var, name, settings, arg1) \
+    ComboBoxSetting *var; \
+    if ((settings)) \
+        var = new PlaySettingsComboBox((name), (settings), (arg1)); \
+    else \
+        var = new HostComboBox((name), (arg1))
+
+#define CREATE_SPINBOX_SETTING(var, name, settings, arg1, arg2, arg3, arg4) \
+    SpinBoxSetting *var; \
+    if ((settings)) \
+        var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3), (arg4)); \
+    else \
+        var = new HostSpinBox((name), (arg1), (arg2), (arg3), (arg4))
+
+#define CREATE_LINEEDIT_SETTING(var, name, settings) \
+    LineEditSetting *var; \
+    if ((settings)) \
+        var = new PlaySettingsLineEdit((name), (settings), ""); \
+    else \
+        var = new HostLineEdit((name))
+
+// For PlaySettings, use a SpinBox instead of a Slider so that a
+// default value can be easily used.
+#define CREATE_SLIDER_SETTING(var, name, settings, arg1, arg2, arg3) \
+    BoundedIntegerSetting *var; \
+    if ((settings)) \
+        var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3)); \
+    else \
+        var = new HostSlider((name), (arg1), (arg2), (arg3))
+
+#define CREATE_IMAGESELECT_SETTING(var, name, settings) \
+    ImageSelectSetting *var; \
+    if ((settings)) \
+        var = new PlaySettingsImageSelect((name), (settings)); \
+    else \
+        var = new HostImageSelect((name))
+
+static Setting *wrap(Setting *obj, PlaySettings *settings,
+                     bool twoLineLabel=false)
+{
+    if (!settings)
+        return obj;
+
+    // Get the setting name
+    PlaySettingsCombinedStorage *storage =
+        dynamic_cast<PlaySettingsCombinedStorage *>(obj);
+    const QString &name = storage->getName();
+
+    // Get the default value and label.  The label is  different
+    // from the value for most object types.
+    QString defaultValue = settings->GetSetting(name, "", true);
+    QString defaultLabel(defaultValue);
+    if (dynamic_cast<BooleanSetting *>(obj))
+        defaultLabel = (defaultValue == "0" || defaultValue.isEmpty() ?
+                        QObject::tr("disabled") : QObject::tr("enabled"));
+    if (dynamic_cast<SpinBoxSetting *>(obj) && defaultValue.isEmpty())
+        defaultLabel = "0";
+    ComboBoxSetting *cb = dynamic_cast<ComboBoxSetting *>(obj);
+    if (cb)
+    {
+        defaultLabel = cb->GetValueLabel(defaultValue);
+        // Add the default selection to a ComboBox
+        cb->addSelection(QString("(") + QObject::tr("default") + ")",
+                         storage->getDefault(),
+                         !settings->IsOverridden(name),
+                         true);
+    }
+    ImageSelectSetting *is = dynamic_cast<ImageSelectSetting *>(obj);
+    if (is)
+    {
+        defaultLabel = is->GetValueLabel(defaultValue);
+        // Add the default selection to a ImageSelect
+        is->addDefaultSelection(QString("(") + QObject::tr("default") + ")",
+                                storage->getDefault(),
+                                defaultValue,
+                                !settings->IsOverridden(name));
+    }
+    
+    // Change the help text to include the default and its source.
+    QString helpPrefix;
+    if (dynamic_cast<LineEditSetting *>(obj))
+        helpPrefix = QObject::tr("Leave blank to keep default value");
+    else
+        helpPrefix = QObject::tr("Override default value");
+    helpPrefix += " (" + defaultLabel + ") ";
+    QString inheritsFrom = settings->InheritsFrom(name);
+    if (inheritsFrom.isNull())
+        helpPrefix += QObject::tr("from global settings");
+    else
+        helpPrefix += QObject::tr("from group") + " " + inheritsFrom;
+    helpPrefix += ". " + obj->getHelpText();
+    obj->setHelpText(helpPrefix);
+
+    // Change the label to include the default.
+    obj->setLabel(obj->getLabel() + (twoLineLabel ? "\n" : "") +
+                  " (" + defaultLabel + ")");
+
+    return obj;
+}
+
 class TriggeredItem : public TriggeredConfigurationGroup
 {
   public:
@@ -603,9 +718,9 @@
     return gs;
 }
 
-static HostCheckBox *DecodeExtraAudio()
+static Setting *DecodeExtraAudio(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");
+    CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings);
     gc->setLabel(QObject::tr("Extra audio buffering"));
     gc->setValue(true);
     gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing "
@@ -614,17 +729,17 @@
                     "effect on framegrabbers (MPEG-4/RTJPEG). MythTV will "
                     "keep extra audio data in its internal buffers to "
                     "workaround this bug."));
-    return gc;
+    return wrap(gc, settings);
 }
 
-static HostComboBox *PIPLocationComboBox()
+static Setting *PIPLocationComboBox(PlaySettings *settings)
 {
-    HostComboBox *gc = new HostComboBox("PIPLocation");
+    CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings);
     gc->setLabel(QObject::tr("PIP video location"));
     for (uint loc = 0; loc < kPIP_END; ++loc)
         gc->addSelection(toString((PIPLocation) loc), QString::number(loc));
     gc->setHelpText(QObject::tr("Location of PIP Video window."));
-    return gc;
+    return wrap(gc, settings);
 }
 
 static HostComboBox *DisplayRecGroup()
@@ -710,25 +825,25 @@
     return gc;
 }
 
-static HostCheckBox *SmartForward()
+static Setting *SmartForward(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("SmartForward");
+    CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings);
     gc->setLabel(QObject::tr("Smart fast forwarding"));
     gc->setValue(false);
     gc->setHelpText(QObject::tr("If enabled, then immediately after "
                     "rewinding, only skip forward the same amount as "
                     "skipping backwards."));
-    return gc;
+    return wrap(gc, settings);
 }
 
-static HostCheckBox *ExactSeeking()
+static Setting *ExactSeeking(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("ExactSeeking");
+    CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings);
     gc->setLabel(QObject::tr("Seek to exact frame"));
     gc->setValue(false);
     gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but "
                     "slower."));
-    return gc;
+    return wrap(gc, settings);
 }
 
 static GlobalComboBox *CommercialSkipMethod()
@@ -756,9 +871,9 @@
     return gc;
 }
 
-static HostComboBox *AutoCommercialSkip()
+static Setting *AutoCommercialSkip(PlaySettings *settings)
 {
-    HostComboBox *gc = new HostComboBox("AutoCommercialSkip");
+    CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings);
     gc->setLabel(QObject::tr("Automatically skip commercials"));
     gc->addSelection(QObject::tr("Off"), "0");
     gc->addSelection(QObject::tr("Notify, but do not skip"), "2");
@@ -767,7 +882,7 @@
                     "have been flagged during automatic commercial detection "
                     "or by the mythcommflag program, or just notify that a "
                     "commercial has been detected."));
-    return gc;
+    return wrap(gc, settings);
 }
 
 static GlobalCheckBox *AutoCommercialFlag()
@@ -853,26 +968,26 @@
     return bc;
 }
 
-static HostSpinBox *CommRewindAmount()
+static Setting *CommRewindAmount(PlaySettings *settings)
 {
-    HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);
+    CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false);
     gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)"));
     gs->setHelpText(QObject::tr("MythTV will automatically rewind "
                     "this many seconds after performing a commercial skip."));
     gs->setValue(0);
-    return gs;
+    return wrap(gs, settings);
 }
 
-static HostSpinBox *CommNotifyAmount()
+static Setting *CommNotifyAmount(PlaySettings *settings)
 {
-    HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);
+    CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false);
     gs->setLabel(QObject::tr("Commercial skip notify amount (secs)"));
     gs->setHelpText(QObject::tr("MythTV will act like a commercial "
                     "begins this many seconds early. This can be useful "
                     "when commercial notification is used in place of "
                     "automatic skipping."));
     gs->setValue(0);
-    return gs;
+    return wrap(gs, settings);
 }
 
 static GlobalSpinBox *MaximumCommercialSkip()
@@ -1674,11 +1789,16 @@
     labels[j]->setValue(label_i);
 }
 
-PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) :
+PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str,
+                                               PlaySettings *settings) :
     TriggeredConfigurationGroup(false, true,  true, true,
                                 false, false, true, true), grouptrigger(NULL)
 {
     setLabel(QObject::tr("Playback Profiles") + str);
+    if (settings)
+        setLabel(QObject::tr("Playback group settings for ") +
+                 settings->mGroupName + " - " +
+                 getLabel());
 
     QString host = gCoreContext->GetHostName();
     QStringList profiles = VideoDisplayProfile::GetProfiles(host);
@@ -1706,18 +1826,24 @@
         profiles = VideoDisplayProfile::GetProfiles(host);
     }
 
-    QString profile = VideoDisplayProfile::GetDefaultProfileName(host);
+    QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings);
     if (!profiles.contains(profile))
     {
         profile = (profiles.contains("Normal")) ? "Normal" : profiles[0];
         VideoDisplayProfile::SetDefaultProfileName(profile, host);
     }
 
-    grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile");
+    CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings);
+    grouptrigger = gs;
     grouptrigger->setLabel(QObject::tr("Current Video Playback Profile"));
     QStringList::const_iterator it;
     for (it = profiles.begin(); it != profiles.end(); ++it)
         grouptrigger->addSelection(ProgramInfo::i18n(*it), *it);
+    if (settings)
+    {
+        addChild(wrap(grouptrigger, settings));
+        return;
+    }
 
     HorizontalConfigurationGroup *grp =
         new HorizontalConfigurationGroup(false, false, true, true);
@@ -1850,9 +1976,9 @@
     return gc;
 }
 
-static HostSpinBox *FFRewReposTime()
+static Setting *FFRewReposTime(PlaySettings *settings)
 {
-    HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);
+    CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false);
     gs->setLabel(QObject::tr("Fast forward/rewind reposition amount"));
     gs->setValue(100);
     gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind "
@@ -1860,12 +1986,12 @@
                     "resuming normal playback. This "
                     "compensates for the reaction time between seeing "
                     "where to resume playback and actually exiting seeking."));
-    return gs;
+    return wrap(gs, settings);
 }
 
-static HostCheckBox *FFRewReverse()
+static Setting *FFRewReverse(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("FFRewReverse");
+    CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings);
     gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind"));
     gc->setValue(true);
     gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key "
@@ -1873,7 +1999,7 @@
                     "vice versa. If disabled, it will decrease the "
                     "current speed or switch to play mode if "
                     "the speed can't be decreased further."));
-    return gc;
+    return wrap(gc, settings);
 }
 
 static HostComboBox *MenuTheme()
@@ -1910,14 +2036,15 @@
     return gc;
 }
 
-static HostSpinBox *OSDCC708TextZoomPercentage(void)
+static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings)
 {
-    HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5);
+    CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings,
+                           50, 200, 5, false);
     gs->setLabel(QObject::tr("Subtitle text zoom percentage"));
     gs->setValue(100);
     gs->setHelpText(QObject::tr("Use this to enlarge or shrink text based subtitles."));
 
-    return gs;
+    return wrap(gs, settings);
 }
 
 static HostComboBox *SubtitleFont()
@@ -1937,9 +2064,9 @@
     return hcb;
 }
 
-static HostComboBox *SubtitleCodec()
+static Setting *SubtitleCodec(PlaySettings *settings)
 {
-    HostComboBox *gc = new HostComboBox("SubtitleCodec");
+    CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings);
 
     gc->setLabel(QObject::tr("Subtitle Codec"));
     QList<QByteArray> list = QTextCodec::availableCodecs();
@@ -1949,7 +2076,7 @@
         gc->addSelection(val, val, val.toLower() == "utf-8");
     }
 
-    return gc;
+    return wrap(gc, settings);
 }
 
 static HostComboBox *ChannelOrdering()
@@ -1961,61 +2088,65 @@
     return gc;
 }
 
-static HostSpinBox *VertScanPercentage()
+static Setting *VertScanPercentage(PlaySettings *settings)
 {
-    HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1);
+    CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings,
+                           -100, 100, 1, false);
     gs->setLabel(QObject::tr("Vertical scaling"));
     gs->setValue(0);
     gs->setHelpText(QObject::tr(
                         "Adjust this if the image does not fill your "
                         "screen vertically. Range -100% to 100%"));
-    return gs;
+    return wrap(gs, settings);
 }
 
-static HostSpinBox *HorizScanPercentage()
+static Setting *HorizScanPercentage(PlaySettings *settings)
 {
-    HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1);
+    CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings,
+                           -100, 100, 1, false);
     gs->setLabel(QObject::tr("Horizontal scaling"));
     gs->setValue(0);
     gs->setHelpText(QObject::tr(
                         "Adjust this if the image does not fill your "
                         "screen horizontally. Range -100% to 100%"));
-    return gs;
+    return wrap(gs, settings);
 };
 
-static HostSpinBox *XScanDisplacement()
+static Setting *XScanDisplacement(PlaySettings *settings)
 {
-    HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1);
+    CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings,
+                           -50, 50, 1, false);
     gs->setLabel(QObject::tr("Scan displacement (X)"));
     gs->setValue(0);
     gs->setHelpText(QObject::tr("Adjust this to move the image horizontally."));
-    return gs;
+    return wrap(gs, settings);
 }
 
-static HostSpinBox *YScanDisplacement()
+static Setting *YScanDisplacement(PlaySettings *settings)
 {
-    HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1);
+    CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings,
+                           -50, 50, 1, false);
     gs->setLabel(QObject::tr("Scan displacement (Y)"));
     gs->setValue(0);
     gs->setHelpText(QObject::tr("Adjust this to move the image vertically."));
-    return gs;
+    return wrap(gs, settings);
 };
 
-static HostCheckBox *CCBackground()
+static Setting *CCBackground(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("CCBackground");
+    CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings);
     gc->setLabel(QObject::tr("Black background for closed captioning"));
     gc->setValue(false);
     gc->setHelpText(QObject::tr(
                         "If enabled, captions will be displayed "
                         "as white text over a black background "
                         "for better contrast."));
-    return gc;
+    return wrap(gc, settings);
 }
 
-static HostCheckBox *DefaultCCMode()
+static Setting *DefaultCCMode(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("DefaultCCMode");
+    CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings);
     gc->setLabel(QObject::tr("Always display closed captioning or subtitles"));
     gc->setValue(false);
     gc->setHelpText(QObject::tr(
@@ -2023,12 +2154,12 @@
                         "when playing back recordings or watching "
                         "Live TV. Closed Captioning can be turned on or off "
                         "by pressing \"T\" during playback."));
-    return gc;
+    return wrap(gc, settings);
 }
 
-static HostCheckBox *PreferCC708()
+static Setting *PreferCC708(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("Prefer708Captions");
+    CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings);
     gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions"));
     gc->setValue(true);
     gc->setHelpText(
@@ -2036,36 +2167,36 @@
             "If enabled, the newer EIA-708 captions will be preferred over "
             "the older EIA-608 captions in ATSC streams."));
 
-    return gc;
+    return wrap(gc, settings);
 }
 
-static HostCheckBox *EnableMHEG()
+static Setting *EnableMHEG(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("EnableMHEG");
+    CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings);
     gc->setLabel(QObject::tr("Enable interactive TV"));
     gc->setValue(false);
     gc->setHelpText(QObject::tr(
                         "If enabled, interactive TV applications (MHEG) will "
                         "be activated. This is used for teletext and logos for "
                         "radio and channels that are currently off-air."));
-    return gc;
+    return wrap(gc, settings);
 }
 
-static HostCheckBox *PersistentBrowseMode()
+static Setting *PersistentBrowseMode(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");
+    CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings);
     gc->setLabel(QObject::tr("Always use browse mode in Live TV"));
     gc->setValue(true);
     gc->setHelpText(
         QObject::tr(
             "If enabled, browse mode will automatically be activated "
             "whenever you use channel up/down while watching Live TV."));
-    return gc;
+    return wrap(gc, settings);
 }
 
-static HostCheckBox *BrowseAllTuners()
+static Setting *BrowseAllTuners(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");
+    CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings);
     gc->setLabel(QObject::tr("Browse all channels"));
     gc->setValue(false);
     gc->setHelpText(
@@ -2073,24 +2204,24 @@
             "If enabled, browse mode will shows channels on all "
             "available recording devices, instead of showing "
             "channels on just the current recorder."));
-    return gc;
+    return wrap(gc, settings);
 }
 
-static HostCheckBox *ClearSavedPosition()
+static Setting *ClearSavedPosition(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");
+    CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings);
     gc->setLabel(QObject::tr("Clear bookmark on playback"));
     gc->setValue(true);
     gc->setHelpText(QObject::tr("If enabled, automatically clear the "
                     "bookmark on a recording when the recording is played "
                     "back. If disabled, you can mark the beginning with "
                     "rewind then save position."));
-    return gc;
+    return wrap(gc, settings);
 }
 
-static HostCheckBox *AltClearSavedPosition()
+static Setting *AltClearSavedPosition(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");
+    CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings);
     gc->setLabel(QObject::tr("Alternate clear and save bookmark"));
     gc->setValue(true);
     gc->setHelpText(QObject::tr("During playback the SELECT key "
@@ -2098,27 +2229,27 @@
                     "Saved\" and \"Bookmark Cleared\". If disabled, the "
                     "SELECT key will save the current position for each "
                     "keypress."));
-    return gc;
+    return wrap(gc, settings);
 }
 
 // This currently does not work
 /*
-static HostLineEdit *UDPNotifyPort()
+static Setting *UDPNotifyPort(PlaySettings *settings)
 {
-    HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");
+    CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings);
     ge->setLabel(QObject::tr("UDP notify port"));
     ge->setValue("6948");
     ge->setHelpText(QObject::tr("During playback, MythTV will listen for "
                     "connections from the \"mythtvosd\" or \"mythudprelay\" "
                     "programs on this port. For additional information, see "
                     "http://www.mythtv.org/wiki/MythNotify ."));
-    return ge;
+    return wrap(ge, settings);
 }
 */
 
-static HostComboBox *PlaybackExitPrompt()
+static Setting *PlaybackExitPrompt(PlaySettings *settings)
 {
-    HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");
+    CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings);
     gc->setLabel(QObject::tr("Action on playback exit"));
     gc->addSelection(QObject::tr("Just exit"), "0");
     gc->addSelection(QObject::tr("Save position and exit"), "2");
@@ -2129,23 +2260,23 @@
                     "when you exit playback mode. The options available will "
                     "allow you to save your position, delete the "
                     "recording, or continue watching."));
-    return gc;
+    return wrap(gc, settings);
 }
 
-static HostCheckBox *EndOfRecordingExitPrompt()
+static Setting *EndOfRecordingExitPrompt(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");
+    CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings);
     gc->setLabel(QObject::tr("Prompt at end of recording"));
     gc->setValue(false);
     gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing "
                     "you to delete the recording when it has finished "
                     "playing."));
-    return gc;
+    return wrap(gc, settings);
 }
 
-static HostCheckBox *JumpToProgramOSD()
+static Setting *JumpToProgramOSD(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");
+    CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings);
     gc->setLabel(QObject::tr("Jump to program OSD"));
     gc->setValue(true);
     gc->setHelpText(QObject::tr(
@@ -2154,12 +2285,12 @@
                         "'Watch Recording' screen when 'Jump to Program' "
                         "is activated. If enabled, the recordings are shown "
                         "in the OSD"));
-    return gc;
+    return wrap(gc, settings);
 }
 
-static HostCheckBox *ContinueEmbeddedTVPlay()
+static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");
+    CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings);
     gc->setLabel(QObject::tr("Continue playback when embedded"));
     gc->setValue(false);
     gc->setHelpText(QObject::tr(
@@ -2167,12 +2298,12 @@
                     "is embedded in the upcoming program list or recorded "
                     "list. The default is to pause the recorded show when "
                     "embedded."));
-    return gc;
+    return wrap(gc, settings);
 }
 
-static HostCheckBox *AutomaticSetWatched()
+static Setting *AutomaticSetWatched(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");
+    CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings);
     gc->setLabel(QObject::tr("Automatically mark a recording as watched"));
     gc->setValue(false);
     gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a "
@@ -2180,7 +2311,7 @@
                     "detection is not foolproof, so do not enable this "
                     "setting if you don't want an unwatched recording marked "
                     "as watched."));
-    return gc;
+    return wrap(gc, settings);
 }
 
 static HostSpinBox *LiveTVIdleTimeout()
@@ -2370,9 +2501,9 @@
     return gc;
 }
 
-static HostComboBox *LetterboxingColour()
+static Setting *LetterboxingColour(PlaySettings *settings)
 {
-    HostComboBox *gc = new HostComboBox("LetterboxColour");
+    CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings);
     gc->setLabel(QObject::tr("Letterboxing color"));
     for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
         gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
@@ -2382,12 +2513,12 @@
             "letterboxing, but those with plasma screens may prefer gray "
             "to minimize burn-in.") + " " +
         QObject::tr("Currently only works with XVideo video renderer."));
-    return gc;
+    return wrap(gc, settings);
 }
 
-static HostComboBox *AspectOverride()
+static Setting *AspectOverride(PlaySettings *settings)
 {
-    HostComboBox *gc = new HostComboBox("AspectOverride");
+    CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings);
     gc->setLabel(QObject::tr("Video aspect override"));
     for (int m = kAspect_Off; m < kAspect_END; ++m)
         gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
@@ -2395,12 +2526,12 @@
                         "When enabled, these will override the aspect "
                         "ratio specified by any broadcaster for all "
                         "video streams."));
-    return gc;
+    return wrap(gc, settings);
 }
 
-static HostComboBox *AdjustFill()
+static Setting *AdjustFill(PlaySettings *settings)
 {
-    HostComboBox *gc = new HostComboBox("AdjustFill");
+    CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings);
     gc->setLabel(QObject::tr("Zoom"));
     gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff),
                      QString::number(kAdjustFill_AutoDetect_DefaultOff));
@@ -2411,7 +2542,7 @@
     gc->setHelpText(QObject::tr(
                         "When enabled, these will apply a predefined "
                         "zoom to all video playback in MythTV."));
-    return gc;
+    return wrap(gc, settings);
 }
 
 // Theme settings
@@ -3336,16 +3467,16 @@
     return gs;
 }
 
-static HostCheckBox *RealtimePriority()
+static Setting *RealtimePriority(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("RealtimePriority");
+    CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings);
     gc->setLabel(QObject::tr("Enable realtime priority threads"));
     gc->setHelpText(QObject::tr("When running mythfrontend with root "
                     "privileges, some threads can be given enhanced priority. "
                     "Disable this if mythfrontend freezes during video "
                     "playback."));
     gc->setValue(true);
-    return gc;
+    return wrap(gc, settings, false);
 }
 
 static HostCheckBox *EnableMediaMon()
@@ -3502,16 +3633,16 @@
 
 #ifdef USING_OPENGL_VSYNC
 /*
-static HostCheckBox *UseOpenGLVSync()
+static Setting *UseOpenGLVSync(PlaySettings *settings)
 {
-    HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");
+    CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings);
     gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing"));
     gc->setValue(false);
     gc->setHelpText(QObject::tr(
                         "If supported by your hardware/drivers, "
                         "MythTV will use OpenGL vertical syncing for "
                         "video timing, reducing frame jitter."));
-    return gc;
+    return wrap(gc, settings);
 }
 */
 #endif
@@ -3938,8 +4069,11 @@
     return gc;
 }
 
-MainGeneralSettings::MainGeneralSettings()
+MainGeneralSettings::MainGeneralSettings(PlaySettings *settings,
+                                         ConfigurationWizard *base)
 {
+    if (!settings)
+    {
     DatabaseSettings::addDatabaseSettings(this);
 
     VerticalConfigurationGroup *pin =
@@ -3991,50 +4125,67 @@
     remotecontrol->addChild(NetworkControlEnabled());
     remotecontrol->addChild(NetworkControlPort());
     addChild(remotecontrol);
+    }
 }
 
-PlaybackSettings::PlaybackSettings()
+PlaybackSettings::PlaybackSettings(PlaySettings *settings,
+                                   ConfigurationWizard *base)
 {
     uint i = 0, total = 8;
 #if CONFIG_DARWIN
     total += 2;
 #endif // USING_DARWIN
+    if (settings)
+        total -= 3;
 
 
     VerticalConfigurationGroup* general1 =
         new VerticalConfigurationGroup(false);
     general1->setLabel(QObject::tr("General Playback") +
                       QString(" (%1/%2)").arg(++i).arg(total));
+    if (settings)
+        general1->setLabel(QObject::tr("Playback group settings for ") +
+                           settings->mGroupName + " - " +
+                           general1->getLabel());
 
     HorizontalConfigurationGroup *columns =
         new HorizontalConfigurationGroup(false, false, true, true);
 
     VerticalConfigurationGroup *column1 =
         new VerticalConfigurationGroup(false, false, true, true);
-    column1->addChild(RealtimePriority());
-    column1->addChild(DecodeExtraAudio());
-    column1->addChild(JumpToProgramOSD());
+    if (!settings)
+        column1->addChild(RealtimePriority(settings));
+    column1->addChild(DecodeExtraAudio(settings));
+    column1->addChild(JumpToProgramOSD(settings));
     columns->addChild(column1);
 
     VerticalConfigurationGroup *column2 =
         new VerticalConfigurationGroup(false, false, true, true);
-    column2->addChild(ClearSavedPosition());
-    column2->addChild(AltClearSavedPosition());
-    column2->addChild(AutomaticSetWatched());
-    column2->addChild(ContinueEmbeddedTVPlay());
+    column2->addChild(ClearSavedPosition(settings));
+    column2->addChild(AltClearSavedPosition(settings));
+    column2->addChild(AutomaticSetWatched(settings));
+    column2->addChild(ContinueEmbeddedTVPlay(settings));
     columns->addChild(column2);
 
     general1->addChild(columns);
-    general1->addChild(LiveTVIdleTimeout());
+    if (!settings)
+        general1->addChild(LiveTVIdleTimeout());
 #ifdef USING_OPENGL_VSYNC
-    //general1->addChild(UseOpenGLVSync());
+    //general1->addChild(UseOpenGLVSync(settings));
 #endif // USING_OPENGL_VSYNC
-    addChild(general1);
+    if (base)
+        base->addChild(general1);
+    else
+        addChild(general1);
 
     VerticalConfigurationGroup* general2 =
         new VerticalConfigurationGroup(false);
     general2->setLabel(QObject::tr("General Playback") +
                       QString(" (%1/%2)").arg(++i).arg(total));
+    if (settings)
+        general2->setLabel(QObject::tr("Playback group settings for ") +
+                           settings->mGroupName + " - " +
+                           general2->getLabel());
 
     HorizontalConfigurationGroup* oscan =
         new HorizontalConfigurationGroup(false, false, true, true);
@@ -4042,29 +4193,37 @@
         new VerticalConfigurationGroup(false, false, true, true);
     VerticalConfigurationGroup *ocol2 =
         new VerticalConfigurationGroup(false, false, true, true);
-    ocol1->addChild(VertScanPercentage());
-    ocol1->addChild(YScanDisplacement());
-    ocol2->addChild(HorizScanPercentage());
-    ocol2->addChild(XScanDisplacement());
+    ocol1->addChild(VertScanPercentage(settings));
+    ocol1->addChild(YScanDisplacement(settings));
+    ocol2->addChild(HorizScanPercentage(settings));
+    ocol2->addChild(XScanDisplacement(settings));
     oscan->addChild(ocol1);
     oscan->addChild(ocol2);
 
     HorizontalConfigurationGroup* aspect_fill =
         new HorizontalConfigurationGroup(false, false, true, true);
-    aspect_fill->addChild(AspectOverride());
-    aspect_fill->addChild(AdjustFill());
+    aspect_fill->addChild(AspectOverride(settings));
+    aspect_fill->addChild(AdjustFill(settings));
 
     general2->addChild(oscan);
     general2->addChild(aspect_fill);
-    general2->addChild(LetterboxingColour());
-    general2->addChild(PIPLocationComboBox());
-    general2->addChild(PlaybackExitPrompt());
-    general2->addChild(EndOfRecordingExitPrompt());
-    addChild(general2);
+    general2->addChild(LetterboxingColour(settings));
+    general2->addChild(PIPLocationComboBox(settings));
+    general2->addChild(PlaybackExitPrompt(settings));
+    general2->addChild(EndOfRecordingExitPrompt(settings));
+    if (base)
+        base->addChild(general2);
+    else
+        addChild(general2);
 
     QString tmp = QString(" (%1/%2)").arg(++i).arg(total);
-    addChild(new PlaybackProfileConfigs(tmp));
+    if (base)
+        base->addChild(new PlaybackProfileConfigs(tmp, settings));
+    else
+        addChild(new PlaybackProfileConfigs(tmp, settings));
 
+    if (!settings)
+    {
     VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false);
     pbox->setLabel(QObject::tr("View Recordings") +
                    QString(" (%1/%2)").arg(++i).arg(total));
@@ -4091,39 +4250,73 @@
     pbox3->addChild(DisplayGroupTitleSort());
     pbox3->addChild(new WatchListSettings());
     addChild(pbox3);
+    }
 
     VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false);
     seek->setLabel(QObject::tr("Seeking") +
                    QString(" (%1/%2)").arg(++i).arg(total));
-    seek->addChild(SmartForward());
-    seek->addChild(FFRewReposTime());
-    seek->addChild(FFRewReverse());
-    seek->addChild(ExactSeeking());
-    addChild(seek);
+    if (settings)
+        seek->setLabel(QObject::tr("Playback group settings for ") +
+                       settings->mGroupName + " - " +
+                       seek->getLabel());
+    seek->addChild(SmartForward(settings));
+    seek->addChild(FFRewReposTime(settings));
+    seek->addChild(FFRewReverse(settings));
+    seek->addChild(ExactSeeking(settings));
+    if (base)
+        base->addChild(seek);
+    else
+        addChild(seek);
 
     VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false);
     comms->setLabel(QObject::tr("Commercial Skip") +
                     QString(" (%1/%2)").arg(++i).arg(total));
-    comms->addChild(AutoCommercialSkip());
-    comms->addChild(CommRewindAmount());
-    comms->addChild(CommNotifyAmount());
+    if (settings)
+        comms->setLabel(QObject::tr("Playback group settings for ") +
+                        settings->mGroupName + " - " +
+                        comms->getLabel());
+    comms->addChild(AutoCommercialSkip(settings));
+    comms->addChild(CommRewindAmount(settings));
+    comms->addChild(CommNotifyAmount(settings));
+    if (!settings) // these are global settings, not host-specific
+    {
     comms->addChild(MaximumCommercialSkip());
     comms->addChild(MergeShortCommBreaks());
     comms->addChild(CommSkipAllBlanks());
-    addChild(comms);
+    }
+    if (base)
+        base->addChild(comms);
+    else
+        addChild(comms);
 
 #if CONFIG_DARWIN
     VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false);
     mac1->setLabel(QObject::tr("Mac OS X Video Settings") +
                    QString(" (%1/%2)").arg(++i).arg(total));
+    if (settings)
+        mac1->setLabel(QObject::tr("Playback group settings for ") +
+                       settings->mGroupName + " - " +
+                       mac1->getLabel());
+    if (!settings)
+    {
     mac1->addChild(MacGammaCorrect());
     mac1->addChild(MacScaleUp());
     mac1->addChild(MacFullSkip());
-    addChild(mac1);
+    }
+    if (base)
+        base->addChild(mac1);
+    else
+        addChild(mac1);
 
     VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false);
     mac2->setLabel(QObject::tr("Mac OS X Video Settings") +
                    QString(" (%1/%2)").arg(++i).arg(total));
+    if (settings)
+        mac2->setLabel(QObject::tr("Playback group settings for ") +
+                       settings->mGroupName + " - " +
+                       mac2->getLabel());
+    if (!setings)
+    {
     mac2->addChild(new MacMainSettings());
     mac2->addChild(new MacFloatSettings());
 
@@ -4137,22 +4330,34 @@
 #endif
 }
 
-OSDSettings::OSDSettings()
+OSDSettings::OSDSettings(PlaySettings *settings,
+                         ConfigurationWizard *base)
 {
     VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false);
     osd->setLabel(QObject::tr("On-screen Display"));
+    if (settings)
+        osd->setLabel(QObject::tr("Playback group settings for ") +
+                      settings->mGroupName + " - " +
+                      osd->getLabel());
 
-    osd->addChild(EnableMHEG());
-    osd->addChild(PersistentBrowseMode());
-    osd->addChild(BrowseAllTuners());
-    osd->addChild(CCBackground());
-    osd->addChild(DefaultCCMode());
-    osd->addChild(PreferCC708());
+    if (!settings)
+    {
+    osd->addChild(EnableMHEG(settings));
+    osd->addChild(PersistentBrowseMode(settings));
+    osd->addChild(BrowseAllTuners(settings));
+    }
+    osd->addChild(CCBackground(settings));
+    osd->addChild(DefaultCCMode(settings));
+    osd->addChild(PreferCC708(settings));
+    if (!settings)
     osd->addChild(SubtitleFont());
-    osd->addChild(OSDCC708TextZoomPercentage());
-    osd->addChild(SubtitleCodec());
-    //osd->addChild(UDPNotifyPort());
-    addChild(osd);
+    osd->addChild(OSDCC708TextZoomPercentage(settings));
+    osd->addChild(SubtitleCodec(settings));
+    //osd->addChild(UDPNotifyPort(settings));
+    if (base)
+        base->addChild(osd);
+    else
+        addChild(osd);
 
     //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false);
     //cc->setLabel(QObject::tr("Closed Captions"));
Index: programs/mythfrontend/main.cpp
===================================================================
--- programs/mythfrontend/main.cpp	(revision 27374)
+++ programs/mythfrontend/main.cpp	(working copy)
@@ -36,6 +36,7 @@
 #include "globalsettings.h"
 #include "profilegroup.h"
 #include "playgroup.h"
+#include "playsettings.h"
 #include "networkcontrol.h"
 #include "DVDRingBuffer.h"
 #include "scheduledrecording.h"
@@ -480,6 +481,27 @@
         delete statusbox;
 }
 
+ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
+{
+    return new PlaybackSettings(settings, base);
+}
+
+ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
+{
+    return new OSDSettings(settings, base);
+}
+
+ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base)
+{
+    return new MainGeneralSettings(settings, base);
+}
+
+static PlayGroupEditor::SettingsLookup pbgroupSetup[] = {
+    createPlaybackSettingsForPlaybackGroup,
+    createOSDSettingsForPlaybackGroup,
+    createMainGeneralSettingsForPlaybackGroup
+};
+
 static void TVMenuCallback(void *data, QString &selection)
 {
     (void)data;
@@ -578,7 +600,8 @@
     }
     else if (sel == "settings playgroup")
     {
-        PlayGroupEditor editor;
+        PlayGroupEditor editor(pbgroupSetup,
+                               sizeof(pbgroupSetup)/sizeof(*pbgroupSetup));
         editor.exec();
     }
     else if (sel == "settings general")
@@ -770,9 +793,13 @@
             }
         }
         delete tmprbuf;
+        pginfo->SetPlaybackGroup("Videos");
     }
     else if (pginfo->IsVideo())
+    {
         pos = pginfo->QueryBookmark();
+        pginfo->SetPlaybackGroup("Videos");
+    }
 
     if (pos > 0)
     {
Index: programs/mythfrontend/globalsettings.h
===================================================================
--- programs/mythfrontend/globalsettings.h	(revision 27374)
+++ programs/mythfrontend/globalsettings.h	(working copy)
@@ -13,6 +13,7 @@
 
 class QFileInfo;
 class AudioDeviceComboBox;
+class PlaySettings;
 
 class AudioConfigSettings : public VerticalConfigurationGroup
 {
@@ -90,13 +91,15 @@
 class PlaybackSettings : public ConfigurationWizard
 {
   public:
-    PlaybackSettings();
+    PlaybackSettings(PlaySettings *settings=NULL,
+                     ConfigurationWizard *base=NULL);
 };
 
 class OSDSettings: virtual public ConfigurationWizard
 {
   public:
-    OSDSettings();
+    OSDSettings(PlaySettings *settings=NULL,
+                ConfigurationWizard *base=NULL);
 };
 
 class GeneralSettings : public ConfigurationWizard
@@ -120,7 +123,8 @@
 class MainGeneralSettings : public ConfigurationWizard
 {
   public:
-    MainGeneralSettings();
+    MainGeneralSettings(PlaySettings *settings=NULL,
+                        ConfigurationWizard *base=NULL);
 };
 
 class GeneralRecPrioritiesSettings : public ConfigurationWizard
@@ -208,7 +212,7 @@
     Q_OBJECT
 
   public:
-    PlaybackProfileConfigs(const QString &str);
+    PlaybackProfileConfigs(const QString &str, PlaySettings *settings);
     virtual ~PlaybackProfileConfigs();
 
   private:
@@ -220,7 +224,7 @@
 
   private:
     QStringList   profiles;
-    HostComboBox *grouptrigger;
+    ComboBoxSetting *grouptrigger;
 };
 
 #endif
Index: programs/mythavtest/main.cpp
===================================================================
--- programs/mythavtest/main.cpp	(revision 27374)
+++ programs/mythavtest/main.cpp	(working copy)
@@ -18,6 +18,7 @@
 #include "mythdbcon.h"
 #include "compat.h"
 #include "dbcheck.h"
+#include "playsettings.h"
 
 // libmythui
 #include "mythuihelper.h"
@@ -188,18 +189,6 @@
 
     GetMythUI()->LoadQtConfig();
 
-#if defined(Q_OS_MACX)
-    // Mac OS X doesn't define the AudioOutputDevice setting
-#else
-    QString auddevice = gCoreContext->GetSetting("AudioOutputDevice");
-    if (auddevice.isEmpty())
-    {
-        VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "
-                "to run 'mythfrontend', not 'mythtv'.");
-        return TV_EXIT_NO_AUDIO;
-    }
-#endif
-
     MythMainWindow *mainWindow = GetMythMainWindow();
     mainWindow->Init();
 
@@ -212,7 +201,27 @@
         return GENERIC_EXIT_DB_OUTOFDATE;
     }
 
-    TV *tv = new TV();
+    QString playgroup("");
+    if (!filename.isEmpty())
+    {
+        ProgramInfo pg(filename);
+        playgroup = pg.GetPlaybackGroup();
+    }
+    PlaySettings settings(playgroup);
+
+#if defined(Q_OS_MACX)
+    // Mac OS X doesn't define the AudioOutputDevice setting
+#else
+    QString auddevice = settings.GetSetting("AudioOutputDevice", "");
+    if (auddevice.isEmpty())
+    {
+        VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "
+                "to run 'mythfrontend', not 'mythtv'.");
+        return TV_EXIT_NO_AUDIO;
+    }
+#endif
+
+    TV *tv = new TV(&settings);
     if (!tv->Init())
     {
         VERBOSE(VB_IMPORTANT, "Fatal Error: Could not initialize TV class.");
