Ticket #8088: 8088_playgroups_v20.patch
File 8088_playgroups_v20.patch, 109.2 KB (added by , 15 years ago) |
---|
-
libs/libmythtv/videoout_vdpau.h
20 20 { 21 21 public: 22 22 static void GetRenderOptions(render_opts &opts); 23 VideoOutputVDPAU( );23 VideoOutputVDPAU(PlaySettings *settings); 24 24 ~VideoOutputVDPAU(); 25 25 bool Init(int width, int height, float aspect, WId winid, 26 26 int winx, int winy, int winw, int winh, … … 54 54 const QSize &video_dim); 55 55 static MythCodecID GetBestSupportedCodec(uint width, uint height, 56 56 uint stream_type, 57 bool no_acceleration); 57 bool no_acceleration, 58 PlaySettings *settings); 58 59 virtual bool IsPIPSupported(void) const { return true; } 59 60 virtual bool IsPBPSupported(void) const { return false; } 60 61 virtual bool NeedExtraAudioDecode(void) const -
libs/libmythtv/subtitlereader.h
44 44 45 45 TextSubtitles* GetTextSubtitles(void) { return &m_TextSubtitles; } 46 46 bool HasTextSubtitles(void); 47 bool LoadExternalSubtitles(const QString &videoFile );47 bool LoadExternalSubtitles(const QString &videoFile, PlaySettings *settings); 48 48 49 49 QStringList GetRawTextSubtitles(uint64_t &duration); 50 50 void AddRawTextSubtitle(QStringList list, uint64_t duration); -
libs/libmythtv/videooutwindow.cpp
29 29 30 30 #include "videooutwindow.h" 31 31 #include "osd.h" 32 #include "playsettings.h" 32 33 #include "mythplayer.h" 33 34 #include "videodisplayprofile.h" 34 35 #include "decoderbase.h" … … 53 54 const float VideoOutWindow::kManualZoomMinVerticalZoom = 0.5f; 54 55 const int VideoOutWindow::kManualZoomMaxMove = 50; 55 56 56 VideoOutWindow::VideoOutWindow( ) :57 VideoOutWindow::VideoOutWindow(PlaySettings *_settings) : 57 58 // DB settings 58 59 db_move(0, 0), db_scale_horiz(0.0f), db_scale_vert(0.0f), 59 60 db_pip_size(26), … … 85 86 86 87 // Various state variables 87 88 embedding(false), needrepaint(false), 88 allowpreviewepg(true), pip_state(kPIPOff) 89 allowpreviewepg(true), pip_state(kPIPOff), 90 91 settings(_settings) 89 92 { 90 93 db_pip_size = gCoreContext->GetNumSetting("PIPSize", 26); 91 94 92 db_move = QPoint( gCoreContext->GetNumSetting("xScanDisplacement", 0),93 gCoreContext->GetNumSetting("yScanDisplacement", 0));95 db_move = QPoint(settings->GetNumSetting("xScanDisplacement", 0), 96 settings->GetNumSetting("yScanDisplacement", 0)); 94 97 db_use_gui_size = gCoreContext->GetNumSetting("GuiSizeForTV", 0); 95 98 96 99 QDesktopWidget *desktop = NULL; … … 615 618 if (change) 616 619 { 617 620 db_scale_vert = 618 gCoreContext->GetNumSetting("VertScanPercentage", 0) * 0.01f;621 settings->GetNumSetting("VertScanPercentage", 0) * 0.01f; 619 622 db_scale_horiz = 620 gCoreContext->GetNumSetting("HorizScanPercentage", 0) * 0.01f;623 settings->GetNumSetting("HorizScanPercentage", 0) * 0.01f; 621 624 db_scaling_allowed = true; 622 625 } 623 626 else -
libs/libmythtv/videoout_d3d.cpp
52 52 opts.priorities->insert("direct3d", 55); 53 53 } 54 54 55 VideoOutputD3D::VideoOutputD3D( void)56 : VideoOutput( ),m_lock(QMutex::Recursive),55 VideoOutputD3D::VideoOutputD3D(PlaySettigns *settings) 56 : VideoOutput(settings), m_lock(QMutex::Recursive), 57 57 m_hWnd(NULL), m_render(NULL), 58 58 m_video(NULL), 59 59 m_render_valid(false), m_render_reset(false), m_pip_active(NULL), -
libs/libmythtv/DetectLetterbox.cpp
5 5 #include "mythplayer.h" 6 6 #include "videoouttypes.h" 7 7 #include "mythcorecontext.h" 8 #include "playsettings.h" 8 9 9 10 DetectLetterbox::DetectLetterbox(MythPlayer* const player) 10 11 { 11 int dbAdjustFill = gCoreContext->GetNumSetting("AdjustFill", 0);12 int dbAdjustFill = player->GetPlaySettings()->GetNumSetting("AdjustFill", 0); 12 13 isDetectLetterbox = dbAdjustFill >= kAdjustFill_AutoDetect_DefaultOff; 13 14 firstFrameChecked = 0; 14 15 detectLetterboxDefaultMode = (AdjustFillMode) max((int) kAdjustFill_Off, … … 18 19 detectLetterboxPossibleFullFrame = -1; 19 20 detectLetterboxConsecutiveCounter = 0; 20 21 detectLetterboxDetectedMode = player->GetAdjustFill(); 21 detectLetterboxLimit = gCoreContext->GetNumSetting("DetectLeterboxLimit", 75); 22 detectLetterboxLimit = 23 player->GetPlaySettings()->GetNumSetting("DetectLeterboxLimit", 75); 22 24 m_player = player; 23 25 } 24 26 -
libs/libmythtv/videoout_opengl.cpp
39 39 opts.priorities->insert("opengl", 65); 40 40 } 41 41 42 VideoOutputOpenGL::VideoOutputOpenGL( )43 : VideoOutput( ),42 VideoOutputOpenGL::VideoOutputOpenGL(PlaySettings *settings) 43 : VideoOutput(settings), 44 44 gl_context_lock(QMutex::Recursive), 45 45 gl_context(NULL), gl_videochain(NULL), gl_pipchain_active(NULL), 46 46 gl_parent_win(0), gl_embed_win(0), gl_painter(NULL) -
libs/libmythtv/videoout_quartz.cpp
62 62 #include "mythverbose.h" 63 63 #include "videodisplayprofile.h" 64 64 65 class PlaySettings; 66 65 67 #define LOC QString("VideoOutputQuartz::") 66 68 #define LOC_ERR QString("VideoOutputQuartz Error: ") 67 69 … … 1105 1107 /** \class VideoOutputQuartz 1106 1108 * \brief Implementation of Quartz (Mac OS X windowing system) video output 1107 1109 */ 1108 VideoOutputQuartz::VideoOutputQuartz( ) :1109 VideoOutput( ), Started(false), data(new QuartzData())1110 VideoOutputQuartz::VideoOutputQuartz(PlaySettings *settings) : 1111 VideoOutput(settings), Started(false), data(new QuartzData()) 1110 1112 { 1111 1113 init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0); 1112 1114 } … … 1756 1758 MythCodecID VideoOutputQuartz::GetBestSupportedCodec( 1757 1759 uint width, uint height, 1758 1760 uint osd_width, uint osd_height, 1759 uint stream_type, uint fourcc )1761 uint stream_type, uint fourcc, PlaySettings *settings) 1760 1762 { 1761 1763 (void) osd_width; 1762 1764 (void) osd_height; 1763 1765 1764 VideoDisplayProfile vdp ;1766 VideoDisplayProfile vdp(settings); 1765 1767 vdp.SetInput(QSize(width, height)); 1766 1768 QString dec = vdp.GetDecoder(); 1767 1769 if ((dec == "libmpeg2") || (dec == "ffmpeg")) -
libs/libmythtv/avformatdecoder.cpp
33 33 #include "BDRingBuffer.h" 34 34 #include "videodisplayprofile.h" 35 35 #include "mythuihelper.h" 36 #include "playsettings.h" 36 37 37 38 #include "lcddevice.h" 38 39 … … 307 308 308 309 cc608_build_parity_table(cc608_parity_table); 309 310 310 if ( gCoreContext->GetNumSetting("CCBackground", 0))311 if (GetPlayer()->GetPlaySettings()->GetNumSetting("CCBackground", 0)) 311 312 CC708Window::forceWhiteOnBlackText = true; 312 313 313 314 no_dts_hack = false; … … 1244 1245 if (selectedStream) 1245 1246 { 1246 1247 directrendering = true; 1247 if (! gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&1248 if (!GetPlayer()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) && 1248 1249 !CODEC_IS_HWACCEL(codec, enc)) 1249 1250 { 1250 1251 SetLowBuffers(false); … … 1777 1778 1778 1779 if (!is_db_ignored) 1779 1780 { 1780 VideoDisplayProfile vdp ;1781 VideoDisplayProfile vdp(GetPlayer()->GetPlaySettings()); 1781 1782 vdp.SetInput(QSize(width, height)); 1782 1783 dec = vdp.GetDecoder(); 1783 1784 thread_count = vdp.GetMaxCPUs(); … … 1805 1806 MythCodecID vdpau_mcid; 1806 1807 vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec( 1807 1808 width, height, 1808 mpeg_version(enc->codec_id), no_hardware_decoders); 1809 mpeg_version(enc->codec_id), no_hardware_decoders, 1810 GetPlayer()->GetPlaySettings()); 1809 1811 1810 1812 if (vdpau_mcid >= video_codec_id) 1811 1813 { … … 1837 1839 /* mpeg type */ mpeg_version(enc->codec_id), 1838 1840 /* xvmc pix fmt */ xvmc_pixel_format(enc->pix_fmt), 1839 1841 /* test surface */ codec_is_std(video_codec_id), 1840 /* force_xv */ force_xv); 1842 /* force_xv */ force_xv, 1843 GetPlayer()->GetPlaySettings()); 1841 1844 1842 1845 if (mcid >= video_codec_id) 1843 1846 { -
libs/libmythtv/playgroup.cpp
1 1 #include "mythdb.h" 2 2 #include "playgroup.h" 3 3 #include "programinfo.h" 4 #include "playsettings.h" 4 5 5 6 // A parameter associated with the profile itself 6 7 class PlayGroupDBStorage : public SimpleDBStorage … … 210 211 return res; 211 212 } 212 213 213 PlayGroupEditor::PlayGroupEditor(void) : 214 listbox(new ListBoxSetting(this)), lastValue("Default") 214 PlayGroupEditor::PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize) : 215 listbox(new ListBoxSetting(this)), lastValue("Default"), 216 getSettings(funcArray), getSettingsSize(funcArraySize) 215 217 { 216 218 listbox->setLabel(tr("Playback Groups")); 217 219 addChild(listbox); … … 242 244 } 243 245 244 246 PlayGroup group(name); 247 PlaySettings *psettings = new PlaySettings(name); 248 for (int i=0; i<getSettingsSize; i++) 249 getSettings[i](psettings, &group); 245 250 if (group.exec() == QDialog::Accepted || !created) 246 251 lastValue = name; 247 252 else … … 276 281 query.bindValue(":NAME", name); 277 282 if (!query.exec()) 278 283 MythDB::DBError("PlayGroupEditor::doDelete", query); 284 PlaySettings::deleteGroup(name); 279 285 280 286 int lastIndex = listbox->getValueIndex(name); 281 287 lastValue = ""; -
libs/libmythtv/videoout_opengl.h
10 10 { 11 11 public: 12 12 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 13 VideoOutputOpenGL( );13 VideoOutputOpenGL(PlaySettings *settings); 14 14 virtual ~VideoOutputOpenGL(); 15 15 16 16 virtual bool Init(int width, int height, float aspect, WId winid, -
libs/libmythtv/tv_play.h
60 60 class OSDListTreeItemSelectedEvent; 61 61 class TVBrowseHelper; 62 62 struct osdInfo; 63 class PlaySettings; 63 64 64 65 typedef QMap<QString,InfoMap> DDValueMap; 65 66 typedef QMap<QString,DDValueMap> DDKeyMap; … … 184 185 unsigned long seconds; 185 186 }; 186 187 187 TV( void);188 TV(PlaySettings *settings); 188 189 ~TV(); 189 190 190 void InitFromDB( void);191 void InitFromDB(PlaySettings *settings); 191 192 bool Init(bool createWindow = true); 192 193 193 194 // User input processing commands … … 211 212 212 213 // Recording commands 213 214 int PlayFromRecorder(int recordernum); 214 int Playback(const ProgramInfo &rcinfo );215 int Playback(const ProgramInfo &rcinfo, PlaySettings *settings); 215 216 216 217 // Commands used by frontend playback box 217 218 QString GetRecordingGroup(int player_idx) const; -
libs/libmythtv/playgroup.h
7 7 #include "mythwidgets.h" 8 8 9 9 class ProgramInfo; 10 class PlaySettings; 10 11 11 12 class MPUBLIC PlayGroup: public ConfigurationWizard 12 13 { … … 29 30 Q_OBJECT 30 31 31 32 public: 32 PlayGroupEditor(void); 33 typedef ConfigurationWizard *(*SettingsLookup)(PlaySettings *settings, 34 ConfigurationWizard *base); 35 PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize); 33 36 virtual DialogCode exec(void); 34 37 virtual void Load(void); 35 38 virtual void Save(void) { } … … 44 47 protected: 45 48 ListBoxSetting *listbox; 46 49 QString lastValue; 50 SettingsLookup *getSettings; 51 int getSettingsSize; 47 52 }; 48 53 49 54 #endif -
libs/libmythtv/dbcheck.cpp
3555 3555 3556 3556 VideoDisplayProfile::CreateNewProfiles(host); 3557 3557 profiles = VideoDisplayProfile::GetProfiles(host); 3558 QString profile = VideoDisplayProfile::GetDefaultProfileName(host); 3558 QString profile = 3559 VideoDisplayProfile::GetDefaultProfileName(host, NULL); 3559 3560 3560 3561 if (profiles.contains("Normal") && 3561 3562 (profile=="CPU++" || profile=="CPU+" || profile=="CPU--")) … … 5972 5973 " jump int(11) NOT NULL default '0'," 5973 5974 " PRIMARY KEY (`name`)" 5974 5975 ");", 5976 "CREATE TABLE playgroupsettings (" 5977 " playgroupname varchar(64) NOT NULL," 5978 " `value` varchar(128) NOT NULL," 5979 " `data` text," 5980 " overridden tinyint(1) NOT NULL," 5981 " PRIMARY KEY (playgroupname, `value`)" 5982 ");", 5975 5983 "CREATE TABLE powerpriority (" 5976 5984 " priorityname varchar(64) collate utf8_bin NOT NULL," 5977 5985 " recpriority int(10) NOT NULL default '0'," -
libs/libmythtv/videoout_vdpau.cpp
49 49 opts.deints->insert("vdpau", deints); 50 50 } 51 51 52 VideoOutputVDPAU::VideoOutputVDPAU( )53 : m_win(0),m_render(NULL),52 VideoOutputVDPAU::VideoOutputVDPAU(PlaySettings *settings) 53 : VideoOutput(settings), m_win(0), m_render(NULL), 54 54 m_buffer_size(NUM_VDPAU_BUFFERS), m_pause_surface(0), 55 55 m_need_deintrefs(false), m_video_mixer(0), m_mixer_features(kVDPFeatNone), 56 56 m_checked_surface_ownership(false), … … 850 850 851 851 MythCodecID VideoOutputVDPAU::GetBestSupportedCodec( 852 852 uint width, uint height, 853 uint stream_type, bool no_acceleration )853 uint stream_type, bool no_acceleration, PlaySettings *settings) 854 854 { 855 855 bool use_cpu = no_acceleration; 856 VideoDisplayProfile vdp ;856 VideoDisplayProfile vdp(settings); 857 857 vdp.SetInput(QSize(width, height)); 858 858 QString dec = vdp.GetDecoder(); 859 859 -
libs/libmythtv/videoout_directfb.cpp
277 277 opts.priorities->insert("directfb", 60); 278 278 } 279 279 280 VideoOutputDirectfb::VideoOutputDirectfb( )281 : VideoOutput( ), XJ_started(false), widget(NULL),280 VideoOutputDirectfb::VideoOutputDirectfb(PlaySettings *settings) 281 : VideoOutput(settings), XJ_started(false), widget(NULL), 282 282 data(new DirectfbData()) 283 283 { 284 284 init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0); -
libs/libmythtv/mythplayer.h
186 186 QString GetXDS(const QString &key) const; 187 187 PIPLocation GetNextPIPLocation(void) const; 188 188 189 PlaySettings *GetPlaySettings(void) const { 190 return player_ctx ? player_ctx->settings : NULL; 191 } 192 189 193 // Bool Gets 190 194 bool GetRawAudioState(void) const; 191 195 bool GetLimitKeyRepeat(void) const { return limitKeyRepeat; } -
libs/libmythtv/videoout_d3d.h
12 12 { 13 13 public: 14 14 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 15 VideoOutputD3D( );15 VideoOutputD3D(PlaySettings *settings); 16 16 ~VideoOutputD3D(); 17 17 18 18 bool Init(int width, int height, float aspect, WId winid, -
libs/libmythtv/playercontext.cpp
16 16 #include "storagegroup.h" 17 17 #include "mythcorecontext.h" 18 18 #include "videometadatautil.h" 19 #include "DetectLetterbox.h" 20 #include "playsettings.h" 19 21 20 22 #define LOC QString("playCtx: ") 21 23 #define LOC_ERR QString("playCtx, Error: ") … … 405 407 WId embedwinid, const QRect *embedbounds, 406 408 bool muted) 407 409 { 408 int exact_seeking = gCoreContext->GetNumSetting("ExactSeeking", 0);410 int exact_seeking = settings->GetNumSetting("ExactSeeking", 0); 409 411 410 412 if (HasPlayer()) 411 413 { … … 448 450 { 449 451 QString subfn = buffer->GetSubtitleFilename(); 450 452 if (!subfn.isEmpty() && player->GetSubReader()) 451 player->GetSubReader()->LoadExternalSubtitles(subfn );453 player->GetSubReader()->LoadExternalSubtitles(subfn, settings); 452 454 } 453 455 454 456 if ((embedwinid > 0) && embedbounds) … … 915 917 /** 916 918 * \brief assign programinfo to the context 917 919 */ 918 void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 920 void PlayerContext::SetPlayingInfo(const ProgramInfo *info, 921 PlaySettings *_settings) 919 922 { 920 923 bool ignoreDB = gCoreContext->IsDatabaseIgnored(); 921 924 … … 927 930 playingInfo->MarkAsInUse(false, recUsage); 928 931 delete playingInfo; 929 932 playingInfo = NULL; 933 // XXX delete settings? 930 934 } 931 935 932 936 if (info) … … 935 939 if (!ignoreDB) 936 940 playingInfo->MarkAsInUse(true, recUsage); 937 941 playingLen = playingInfo->GetSecondsInRecording(); 942 settings = (_settings ? _settings : 943 new PlaySettings(playingInfo->GetPlaybackGroup())); 938 944 } 939 945 } 940 946 -
libs/libmythtv/subtitlereader.cpp
65 65 av_free(subtitle.rects); 66 66 } 67 67 68 bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName) 68 bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName, 69 PlaySettings *settings) 69 70 { 70 71 m_TextSubtitles.Clear(); 71 return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles); 72 return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles, 73 settings); 72 74 } 73 75 74 76 bool SubtitleReader::HasTextSubtitles(void) -
libs/libmythtv/textsubtitleparser.h
17 17 // Qt headers 18 18 #include <QStringList> 19 19 20 class PlaySettings; 21 20 22 class text_subtitle_t 21 23 { 22 24 public: … … 79 81 class TextSubtitleParser 80 82 { 81 83 public: 82 static bool LoadSubtitles(QString fileName, TextSubtitles &target); 84 static bool LoadSubtitles(QString fileName, TextSubtitles &target, 85 PlaySettings *settings); 83 86 }; 84 87 85 88 #endif -
libs/libmythtv/vsync.cpp
34 34 35 35 #include "mythcontext.h" 36 36 #include "mythmainwindow.h" 37 #include "playsettings.h" 37 38 38 39 #ifdef USING_XV 39 40 #include "videoout_xv.h" … … 78 79 * \brief Returns the most sophisticated video sync method available. 79 80 */ 80 81 VideoSync *VideoSync::BestMethod(VideoOutput *video_output, 82 PlaySettings *settings, 81 83 uint frame_interval, uint refresh_interval, 82 84 bool halve_frame_interval) 83 85 { … … 103 105 TESTVIDEOSYNC(DRMVideoSync); 104 106 #ifdef USING_OPENGL_VSYNC 105 107 /* 106 if ( gCoreContext->GetNumSetting("UseOpenGLVSync", 1) &&108 if (settings->GetNumSetting("UseOpenGLVSync", 1) && 107 109 (getenv("NO_OPENGL_VSYNC") == NULL)) 108 110 { 109 111 TESTVIDEOSYNC(OpenGLVideoSync); -
libs/libmythtv/tv_play.cpp
60 60 #include "mythdialogbox.h" 61 61 #include "mythdirs.h" 62 62 #include "tvbrowsehelper.h" 63 #include "playsettings.h" 63 64 64 65 #if ! HAVE_ROUND 65 66 #define round(x) ((int) ((x) + 0.5)) … … 210 211 bool startInGuide = flags & kStartTVInGuide; 211 212 bool inPlaylist = flags & kStartTVInPlayList; 212 213 bool initByNetworkCommand = flags & kStartTVByNetworkCommand; 213 TV *tv = new TV();214 214 bool quitAll = false; 215 215 bool showDialogs = true; 216 216 bool playCompleted = false; … … 224 224 curProgram->SetIgnoreBookmark(flags & kStartTVIgnoreBookmark); 225 225 } 226 226 227 PlaySettings settings(curProgram ? curProgram->GetPlaybackGroup() : "Default"); 228 TV *tv = new TV(&settings); 229 227 230 // Initialize TV 228 231 if (!tv->Init()) 229 232 { … … 254 257 if (curProgram) 255 258 { 256 259 VERBOSE(VB_PLAYBACK, LOC + "tv->Playback() -- begin"); 257 if (!tv->Playback(*curProgram ))260 if (!tv->Playback(*curProgram, &settings)) 258 261 { 259 262 quitAll = true; 260 263 } … … 848 851 class TVInitRunnable : public QRunnable 849 852 { 850 853 public: 851 TVInitRunnable(TV *ourTV) : tv(ourTV) {} 852 virtual void run(void) { tv->InitFromDB(); } 854 TVInitRunnable(TV *ourTV, PlaySettings *ourSettings) : 855 tv(ourTV), settings(ourSettings) {} 856 virtual void run(void) { tv->InitFromDB(settings); } 853 857 TV *tv; 858 PlaySettings *settings; 854 859 }; 855 860 856 861 /** \fn TV::TV(void) 857 862 * \sa Init(void) 858 863 */ 859 TV::TV( void)864 TV::TV(PlaySettings *settings) 860 865 : // Configuration variables from database 861 866 baseFilters(""), 862 867 db_channel_format("<num> <sign>"), … … 954 959 playerActive = 0; 955 960 playerLock.unlock(); 956 961 957 QThreadPool::globalInstance()->start(new TVInitRunnable(this ), 99);962 QThreadPool::globalInstance()->start(new TVInitRunnable(this, settings), 99); 958 963 959 964 VERBOSE(VB_PLAYBACK, LOC + "ctor -- end"); 960 965 } 961 966 962 void TV::InitFromDB( void)967 void TV::InitFromDB(PlaySettings *settings) 963 968 { 964 969 QMap<QString,QString> kv; 965 970 kv["LiveTVIdleTimeout"] = "0"; … … 1006 1011 kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]); 1007 1012 1008 1013 MythDB::getMythDB()->GetSettings(kv); 1014 settings->AddToMap(kv); 1009 1015 1010 1016 QString db_time_format; 1011 1017 QString db_short_date_format; … … 1749 1755 askAllowLock.unlock(); 1750 1756 } 1751 1757 1752 int TV::Playback(const ProgramInfo &rcinfo )1758 int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings) 1753 1759 { 1754 1760 wantsToQuit = false; 1755 1761 jumpToProgram = false; … … 1763 1769 return 0; 1764 1770 } 1765 1771 1766 mctx->SetPlayingInfo(&rcinfo );1772 mctx->SetPlayingInfo(&rcinfo, settings); 1767 1773 mctx->SetInitialTVState(false); 1768 1774 ScheduleStateChange(mctx); 1769 1775 … … 1846 1852 1847 1853 if (fileexists) 1848 1854 { 1849 Playback(pginfo); 1855 PlaySettings settings("Default"); 1856 Playback(pginfo, &settings); 1850 1857 retval = 1; 1851 1858 } 1852 1859 … … 2234 2241 QString msg = tr("%1 Settings") 2235 2242 .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup())); 2236 2243 ctx->UnlockPlayingInfo(__FILE__, __LINE__); 2237 if (count > 0) 2244 if (count > 0 && 2245 ctx->playingInfo->GetPlaybackGroup() != "Default" && 2246 ctx->playingInfo->GetPlaybackGroup() != "Videos") 2238 2247 SetOSDMessage(ctx, msg); 2239 2248 ITVRestart(ctx, false); 2240 2249 } -
libs/libmythtv/videodisplayprofile.h
13 13 14 14 #include "mythcontext.h" 15 15 16 class PlaySettings; 17 16 18 typedef QMap<QString,QString> pref_map_t; 17 19 typedef QMap<QString,QStringList> safe_map_t; 18 20 typedef QStringList safe_list_t; … … 80 82 class MPUBLIC VideoDisplayProfile 81 83 { 82 84 public: 83 VideoDisplayProfile( );85 VideoDisplayProfile(PlaySettings *settings); 84 86 ~VideoDisplayProfile(); 85 87 86 88 void SetInput(const QSize &size); … … 124 126 static QString GetDecoderName(const QString &decoder); 125 127 static QString GetDecoderHelp(QString decoder = QString::null); 126 128 127 static QString GetDefaultProfileName(const QString &hostname); 129 static QString GetDefaultProfileName(const QString &hostname, 130 PlaySettings *settings); 128 131 static void SetDefaultProfileName(const QString &profilename, 129 132 const QString &hostname); 130 133 static uint GetProfileGroupID(const QString &profilename, -
libs/libmythtv/videoout_null.cpp
30 30 opts.priorities->insert("null", 10); 31 31 } 32 32 33 VideoOutputNull::VideoOutputNull( ) :34 VideoOutput( ), global_lock(QMutex::Recursive)33 VideoOutputNull::VideoOutputNull(PlaySettings *settings) : 34 VideoOutput(settings), global_lock(QMutex::Recursive) 35 35 { 36 36 VERBOSE(VB_PLAYBACK, "VideoOutputNull()"); 37 37 memset(&av_pause_frame, 0, sizeof(av_pause_frame)); -
libs/libmythtv/videooutbase.cpp
7 7 #include "mythplayer.h" 8 8 #include "videodisplayprofile.h" 9 9 #include "decoderbase.h" 10 #include "playsettings.h" 10 11 11 12 #include "mythcorecontext.h" 12 13 #include "mythverbose.h" … … 109 110 PIPState pipState, 110 111 const QSize &video_dim, float video_aspect, 111 112 WId win_id, const QRect &display_rect, 112 float video_prate, WId embed_id) 113 float video_prate, WId embed_id, 114 PlaySettings *settings) 113 115 { 114 116 (void) codec_priv; 115 117 … … 154 156 QString renderer = QString::null; 155 157 if (renderers.size() > 0) 156 158 { 157 VideoDisplayProfile vprof ;159 VideoDisplayProfile vprof(settings); 158 160 vprof.SetInput(video_dim); 159 161 160 162 QString tmp = vprof.GetVideoRenderer(); … … 182 184 183 185 #ifdef USING_DIRECTFB 184 186 if (renderer == "directfb") 185 vo = new VideoOutputDirectfb( );187 vo = new VideoOutputDirectfb(settings); 186 188 #endif // USING_DIRECTFB 187 189 188 190 #ifdef USING_MINGW 189 191 if (renderer == "direct3d") 190 vo = new VideoOutputD3D( );192 vo = new VideoOutputD3D(settings); 191 193 #endif // USING_MINGW 192 194 193 195 #ifdef USING_QUARTZ_VIDEO 194 196 if (osxlist.contains(renderer)) 195 vo = new VideoOutputQuartz( );197 vo = new VideoOutputQuartz(settings); 196 198 #endif // Q_OS_MACX 197 199 198 200 #ifdef USING_OPENGL_VIDEO 199 201 if (renderer == "opengl") 200 vo = new VideoOutputOpenGL( );202 vo = new VideoOutputOpenGL(settings); 201 203 #endif // USING_OPENGL_VIDEO 202 204 203 205 #ifdef USING_VDPAU 204 206 if (renderer == "vdpau") 205 vo = new VideoOutputVDPAU( );207 vo = new VideoOutputVDPAU(settings); 206 208 #endif // USING_VDPAU 207 209 208 210 #ifdef USING_XV 209 211 if (xvlist.contains(renderer)) 210 vo = new VideoOutputXv( );212 vo = new VideoOutputXv(settings); 211 213 #endif // USING_XV 212 214 213 215 if (vo) … … 305 307 * \brief This constructor for VideoOutput must be followed by an 306 308 * Init(int,int,float,WId,int,int,int,int,WId) call. 307 309 */ 308 VideoOutput::VideoOutput( ) :310 VideoOutput::VideoOutput(PlaySettings *_settings) : 309 311 // DB Settings 312 window(_settings), 310 313 db_display_dim(0,0), 311 314 db_aspectoverride(kAspect_Off), db_adjustfill(kAdjustFill_Off), 312 315 db_letterbox_colour(kLetterBoxColour_Black), … … 343 346 monitor_sz(640,480), monitor_dim(400,300), 344 347 345 348 // OSD 346 osd_painter(NULL), osd_image(NULL) 349 osd_painter(NULL), osd_image(NULL), 350 settings(_settings) 347 351 348 352 { 349 353 bzero(&pip_tmp_image, sizeof(pip_tmp_image)); 350 db_display_dim = QSize( gCoreContext->GetNumSetting("DisplaySizeWidth", 0),351 gCoreContext->GetNumSetting("DisplaySizeHeight", 0));354 db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth", 0), 355 settings->GetNumSetting("DisplaySizeHeight", 0)); 352 356 353 357 db_aspectoverride = (AspectOverrideMode) 354 gCoreContext->GetNumSetting("AspectOverride", 0);358 settings->GetNumSetting("AspectOverride", 0); 355 359 db_adjustfill = (AdjustFillMode) 356 gCoreContext->GetNumSetting("AdjustFill", 0);360 settings->GetNumSetting("AdjustFill", 0); 357 361 db_letterbox_colour = (LetterBoxColour) 358 gCoreContext->GetNumSetting("LetterboxColour", 0);362 settings->GetNumSetting("LetterboxColour", 0); 359 363 360 364 if (!gCoreContext->IsDatabaseIgnored()) 361 db_vdisp_profile = new VideoDisplayProfile( );365 db_vdisp_profile = new VideoDisplayProfile(settings); 362 366 } 363 367 364 368 /** … … 434 438 return QString::null; 435 439 } 436 440 437 bool VideoOutput::IsPreferredRenderer(QSize video_size )441 bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings) 438 442 { 439 443 if (!db_vdisp_profile || (video_size == window.GetVideoDispDim())) 440 444 return true; 441 445 442 VideoDisplayProfile vdisp ;446 VideoDisplayProfile vdisp(settings); 443 447 vdisp.SetInput(video_size); 444 448 QString new_rend = vdisp.GetVideoRenderer(); 445 449 if (new_rend.isEmpty()) -
libs/libmythtv/videooutwindow.h
16 16 #include "videoouttypes.h" 17 17 18 18 class MythPlayer; 19 class PlaySettings; 19 20 20 21 class VideoOutWindow 21 22 { 22 23 public: 23 VideoOutWindow( );24 VideoOutWindow(PlaySettings *settings); 24 25 25 26 bool Init(const QSize &new_video_dim, float aspect, 26 27 const QRect &new_display_visible_rect, … … 164 165 bool allowpreviewepg; 165 166 PIPState pip_state; 166 167 168 PlaySettings *settings; 169 167 170 // Constants 168 171 static const float kManualZoomMaxHorizontalZoom; 169 172 static const float kManualZoomMaxVerticalZoom; -
libs/libmythtv/videoout_directfb.h
12 12 { 13 13 public: 14 14 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 15 VideoOutputDirectfb( );15 VideoOutputDirectfb(PlaySettings *settings); 16 16 ~VideoOutputDirectfb(); 17 17 18 18 bool Init(int width, int height, float aspect, WId winid, -
libs/libmythtv/playercontext.h
28 28 class LiveTVChain; 29 29 class MythDialog; 30 30 class QPainter; 31 class PlaySettings; 31 32 32 33 struct osdInfo 33 34 { … … 115 116 void SetRecorder(RemoteEncoder *rec); 116 117 void SetTVChain(LiveTVChain *chain); 117 118 void SetRingBuffer(RingBuffer *buf); 118 void SetPlayingInfo(const ProgramInfo *info );119 void SetPlayingInfo(const ProgramInfo *info, PlaySettings *settings=NULL); 119 120 void SetPlayGroup(const QString &group); 120 121 void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state); 121 122 void SetPIPLocation(int loc) { pipLocation = loc; } … … 173 174 LiveTVChain *tvchain; 174 175 RingBuffer *buffer; 175 176 ProgramInfo *playingInfo; ///< Currently playing info 177 PlaySettings *settings; // corresponding to playingInfo 176 178 long long playingLen; ///< Initial CalculateLength() 177 179 AVSpecialDecode specialDecode; 178 180 bool nohardwaredecoders; // < Disable use of VDPAU decoding -
libs/libmythtv/vsync.h
89 89 90 90 // documented in vsync.cpp 91 91 static VideoSync *BestMethod(VideoOutput*, 92 PlaySettings *settings, 92 93 uint frame_interval, uint refresh_interval, 93 94 bool interlaced); 94 95 protected: -
libs/libmythtv/videoout_xv.h
51 51 friend class XvMCOSD; 52 52 public: 53 53 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 54 VideoOutputXv( );54 VideoOutputXv(PlaySettings *settings); 55 55 ~VideoOutputXv(); 56 56 57 57 bool Init(int width, int height, float aspect, WId winid, … … 109 109 static MythCodecID GetBestSupportedCodec(uint width, uint height, 110 110 uint osd_width, uint osd_height, 111 111 uint stream_type, int xvmc_chroma, 112 bool test_surface, bool force_xv); 112 bool test_surface, bool force_xv, 113 PlaySettings *settings); 113 114 114 115 static int GrabSuitableXvPort(MythXDisplay* disp, Window root, 116 PlaySettings *settings, 115 117 MythCodecID type, 116 118 uint width, uint height, 117 119 bool &xvsetdefaults, -
libs/libmythtv/videoout_xv.cpp
170 170 * \see VideoOutput, VideoBuffers 171 171 * 172 172 */ 173 VideoOutputXv::VideoOutputXv( )174 : VideoOutput( ),173 VideoOutputXv::VideoOutputXv(PlaySettings *settings) 174 : VideoOutput(settings), 175 175 video_output_subtype(XVUnknown), 176 176 global_lock(QMutex::Recursive), 177 177 … … 401 401 * \return port number if it succeeds, else -1. 402 402 */ 403 403 int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root, 404 PlaySettings *settings, 404 405 MythCodecID mcodecid, 405 406 uint width, uint height, 406 407 bool &xvsetdefaults, … … 485 486 } 486 487 487 488 // figure out if we want chromakeying.. 488 VideoDisplayProfile vdp ;489 VideoDisplayProfile vdp(settings); 489 490 vdp.SetInput(QSize(width, height)); 490 491 bool check_for_colorkey = (vdp.GetOSDRenderer() == "chromakey"); 491 492 … … 785 786 disp->StartLog(); 786 787 QString adaptor_name = QString::null; 787 788 const QSize video_dim = window.GetVideoDim(); 788 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), video_codec_id,789 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, video_codec_id, 789 790 video_dim.width(), video_dim.height(), 790 791 xv_set_defaults, 791 792 xvmc_chroma, &xvmc_surf_info, &adaptor_name); … … 864 865 disp->StartLog(); 865 866 QString adaptor_name = QString::null; 866 867 const QSize video_dim = window.GetVideoDim(); 867 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), kCodec_MPEG2,868 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, kCodec_MPEG2, 868 869 video_dim.width(), video_dim.height(), 869 870 xv_set_defaults, 0, NULL, &adaptor_name); 870 871 if (xv_port == -1) … … 1018 1019 uint width, uint height, 1019 1020 uint osd_width, uint osd_height, 1020 1021 uint stream_type, int xvmc_chroma, 1021 bool test_surface, bool force_xv) 1022 bool test_surface, bool force_xv, 1023 PlaySettings *settings) 1022 1024 { 1023 1025 (void)width, (void)height, (void)osd_width, (void)osd_height; 1024 1026 (void)stream_type, (void)xvmc_chroma, (void)test_surface; … … 1029 1031 return ret; 1030 1032 1031 1033 #ifdef USING_XVMC 1032 VideoDisplayProfile vdp ;1034 VideoDisplayProfile vdp(settings); 1033 1035 vdp.SetInput(QSize(width, height)); 1034 1036 QString dec = vdp.GetDecoder(); 1035 1037 if ((dec == "libmpeg2") || (dec == "ffmpeg")) … … 1079 1081 1080 1082 ok = false; 1081 1083 bool dummy; 1082 int port = GrabSuitableXvPort(disp, disp->GetRoot(), ret, width, height, 1084 int port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, 1085 ret, width, height, 1083 1086 dummy, xvmc_chroma, &info); 1084 1087 if (port >= 0) 1085 1088 { -
libs/libmythtv/mythplayer.cpp
60 60 #include "mythpainter.h" 61 61 #include "mythimage.h" 62 62 #include "mythuiimage.h" 63 #include "playsettings.h" 63 64 64 65 extern "C" { 65 66 #include "vbitext/vbi.h" … … 250 251 output_jmeter(NULL) 251 252 { 252 253 playerThread = QThread::currentThread(); 253 // Playback (output) zoom control254 detect_letter_box = new DetectLetterbox(this);255 254 256 vbimode = VBIMode::Parse(gCoreContext->GetSetting("VbiFormat"));257 decode_extra_audio = gCoreContext->GetNumSetting("DecodeExtraAudio", 0);258 itvEnabled = gCoreContext->GetNumSetting("EnableMHEG", 0);259 db_prefer708 = gCoreContext->GetNumSetting("Prefer708Captions", 1);260 261 255 bzero(&tc_lastval, sizeof(tc_lastval)); 262 256 bzero(&tc_wrap, sizeof(tc_wrap)); 263 257 tc_wrap[TC_AUDIO] = gCoreContext->GetNumSetting("AudioSyncOffset", 0); … … 496 490 if (using_null_videoout && decoder) 497 491 { 498 492 MythCodecID codec = decoder->GetVideoCodecID(); 499 videoOutput = new VideoOutputNull( );493 videoOutput = new VideoOutputNull(GetPlaySettings()); 500 494 if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(), 501 495 video_aspect, 0, 0, 0, 0, 0, codec, 0)) 502 496 { … … 546 540 pipState, 547 541 video_disp_dim, video_aspect, 548 542 widget->winId(), display_rect, (video_frame_rate * play_speed), 549 0 /*embedid*/ );543 0 /*embedid*/, GetPlaySettings()); 550 544 } 551 545 552 546 if (videoOutput) … … 638 632 639 633 void MythPlayer::ReinitVideo(void) 640 634 { 641 if (!videoOutput->IsPreferredRenderer(video_disp_dim ))635 if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings())) 642 636 { 643 637 VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer.")); 644 638 SetErrored(QObject::tr("Need to switch video renderer.")); … … 2062 2056 } 2063 2057 #endif // USING_MHEG 2064 2058 2065 SetCaptionsEnabled(gCoreContext->GetNumSetting("DefaultCCMode"), false); 2059 SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0), 2060 false); 2066 2061 osdLock.unlock(); 2067 2062 } 2068 2063 … … 2109 2104 m_double_process = videoOutput->IsExtraProcessingRequired(); 2110 2105 2111 2106 videosync = VideoSync::BestMethod( 2112 videoOutput, fr_int, rf_int, m_double_framerate); 2107 videoOutput, GetPlaySettings(), 2108 fr_int, rf_int, m_double_framerate); 2113 2109 2114 2110 // Make sure video sync can do it 2115 2111 if (videosync != NULL && m_double_framerate) … … 2492 2488 if (bookmarkseek > 30) 2493 2489 { 2494 2490 DoFastForward(bookmarkseek, true, false); 2495 if ( gCoreContext->GetNumSetting("ClearSavedPosition", 1) &&2491 if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) && 2496 2492 !player_ctx->IsPIP()) 2497 2493 { 2498 2494 ClearBookmark(false); … … 2724 2720 { 2725 2721 if (jumpto == totalFrames) 2726 2722 { 2727 if (!( gCoreContext->GetNumSetting("EndOfRecordingExitPrompt") == 12723 if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1 2728 2724 && !player_ctx->IsPIP() && 2729 2725 player_ctx->GetState() == kState_WatchingPreRecorded)) 2730 2726 { … … 3007 3003 return kPIP_END; 3008 3004 3009 3005 if (pip_players.isEmpty()) 3010 return (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft); 3006 return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation", 3007 kPIPTopLeft); 3011 3008 3012 3009 // order of preference, could be stored in db if we want it configurable 3013 3010 PIPLocation ols[] = … … 3515 3512 exactseeks = frame_exact_seek; 3516 3513 player_ctx = ctx; 3517 3514 livetv = ctx->tvchain; 3515 3516 vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", "")); 3517 3518 // Playback (output) zoom control 3519 detect_letter_box = new DetectLetterbox(this); 3520 3521 decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0); 3522 itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0); 3523 db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1); 3518 3524 } 3519 3525 3520 3526 bool MythPlayer::EnableEdit(void) -
libs/libmythtv/videooutbase.h
34 34 class FilterChain; 35 35 class FilterManager; 36 36 class OpenGLContextGLX; 37 class PlaySettings; 37 38 38 39 typedef QMap<MythPlayer*,PIPLocation> PIPMap; 39 40 … … 54 55 PIPState pipState, 55 56 const QSize &video_dim, float video_aspect, 56 57 WId win_id, const QRect &display_rect, 57 float video_prate, WId embed_id); 58 float video_prate, WId embed_id, 59 PlaySettings *settings); 58 60 59 VideoOutput( );61 VideoOutput(PlaySettings *settings); 60 62 virtual ~VideoOutput(); 61 63 62 64 virtual bool Init(int width, int height, float aspect, … … 64 66 int winh, MythCodecID codec_id, WId embedid = 0); 65 67 virtual void InitOSD(OSD *osd); 66 68 virtual void SetVideoFrameRate(float); 67 virtual bool IsPreferredRenderer(QSize video_size );69 virtual bool IsPreferredRenderer(QSize video_size, PlaySettings *settings); 68 70 virtual bool SetDeinterlacingEnabled(bool); 69 71 virtual bool SetupDeinterlace(bool i, const QString& ovrf=""); 70 72 virtual void FallbackDeint(void); … … 331 333 // OSD painter and surface 332 334 MythYUVAPainter *osd_painter; 333 335 MythImage *osd_image; 336 337 PlaySettings *settings; 334 338 }; 335 339 336 340 #endif -
libs/libmythtv/textsubtitleparser.cpp
21 21 #include "RingBuffer.h" 22 22 #include "textsubtitleparser.h" 23 23 #include "xine_demux_sputext.h" 24 #include "playsettings.h" 24 25 25 26 static bool operator<(const text_subtitle_t& left, 26 27 const text_subtitle_t& right) … … 116 117 m_lock.unlock(); 117 118 } 118 119 119 bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target) 120 bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target, 121 PlaySettings *settings) 120 122 { 121 123 demux_sputext_t sub_data; 122 124 sub_data.rbuffer = new RingBuffer(fileName, 0, false); … … 134 136 target.SetFrameBasedTiming(!sub_data.uses_time); 135 137 136 138 QTextCodec *textCodec = NULL; 137 QString codec = gCoreContext->GetSetting("SubtitleCodec", "");139 QString codec = settings->GetSetting("SubtitleCodec", ""); 138 140 if (!codec.isEmpty()) 139 141 textCodec = QTextCodec::codecForName(codec.toLatin1()); 140 142 if (!textCodec) -
libs/libmythtv/subtitlescreen.cpp
7 7 #include "mythuiimage.h" 8 8 #include "mythpainter.h" 9 9 #include "subtitlescreen.h" 10 #include "playsettings.h" 10 11 11 12 #define LOC QString("Subtitles: ") 12 13 #define LOC_WARN QString("Subtitles Warning: ") … … 68 69 VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-608 reader."); 69 70 if (!m_708reader) 70 71 VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-708 reader."); 71 m_useBackground = (bool) gCoreContext->GetNumSetting("CCBackground", 0);72 m_textFontZoom = gCoreContext->GetNumSetting("OSDCC708TextZoom", 100);72 m_useBackground = (bool)m_player->GetPlaySettings()->GetNumSetting("CCBackground", 0); 73 m_textFontZoom = m_player->GetPlaySettings()->GetNumSetting("OSDCC708TextZoom", 100); 73 74 return true; 74 75 } 75 76 -
libs/libmythtv/videoout_quartz.h
2 2 #define VIDEOOUT_QUARTZ_H_ 3 3 4 4 struct QuartzData; 5 class PlaySettings; 5 6 6 7 #include "videooutbase.h" 7 8 … … 9 10 { 10 11 public: 11 12 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 12 VideoOutputQuartz( );13 VideoOutputQuartz(PlaySettings *settings); 13 14 ~VideoOutputQuartz(); 14 15 15 16 bool Init(int width, int height, float aspect, WId winid, … … 52 53 static MythCodecID GetBestSupportedCodec( 53 54 uint width, uint height, 54 55 uint osd_width, uint osd_height, 55 uint stream_type, uint fourcc );56 uint stream_type, uint fourcc, PlaySettings *settings); 56 57 virtual bool NeedExtraAudioDecode(void) const 57 58 { return !codec_is_std(video_codec_id); } 58 59 -
libs/libmythtv/videodisplayprofile.cpp
8 8 #include "mythverbose.h" 9 9 #include "videooutbase.h" 10 10 #include "avformatdecoder.h" 11 #include "playsettings.h" 11 12 12 13 bool ProfileItem::IsMatch(const QSize &size, float rate) const 13 14 { … … 212 213 pref_map_t VideoDisplayProfile::dec_name; 213 214 safe_list_t VideoDisplayProfile::safe_decoders; 214 215 215 VideoDisplayProfile::VideoDisplayProfile( )216 VideoDisplayProfile::VideoDisplayProfile(PlaySettings *settings) 216 217 : lock(QMutex::Recursive), last_size(0,0), last_rate(0.0f), 217 218 last_video_renderer(QString::null) 218 219 { … … 220 221 init_statics(); 221 222 222 223 QString hostname = gCoreContext->GetHostName(); 223 QString cur_profile = GetDefaultProfileName(hostname );224 QString cur_profile = GetDefaultProfileName(hostname, settings); 224 225 uint groupid = GetProfileGroupID(cur_profile, hostname); 225 226 226 227 item_list_t items = LoadDB(groupid); … … 772 773 return list; 773 774 } 774 775 775 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname) 776 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname, 777 PlaySettings *settings) 776 778 { 777 779 QString tmp = 780 settings ? settings->GetSetting("DefaultVideoPlaybackProfile", "") : 778 781 gCoreContext->GetSettingOnHost("DefaultVideoPlaybackProfile", hostname); 779 782 780 783 QStringList profiles = GetProfiles(hostname); -
libs/libmythtv/videoout_null.h
9 9 { 10 10 public: 11 11 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 12 VideoOutputNull( );12 VideoOutputNull(PlaySettings *settings); 13 13 ~VideoOutputNull(); 14 14 15 15 bool Init(int width, int height, float aspect, WId winid, -
libs/libmyth/settings.cpp
235 235 return -1; 236 236 } 237 237 238 QString SelectSetting::GetValueLabel(const QString &value) 239 { 240 selectionList::const_iterator iterValues = values.begin(); 241 selectionList::const_iterator iterLabels = labels.begin(); 242 for (; iterValues != values.end() && iterLabels != labels.end(); 243 ++iterValues, ++iterLabels) 244 { 245 if (*iterValues == value) 246 return *iterLabels; 247 } 248 249 return "???"; 250 } 251 238 252 bool SelectSetting::ReplaceLabel(const QString &new_label, const QString &value) 239 253 { 240 254 int i = getValueIndex(value); … … 299 313 QLabel *label = new QLabel(); 300 314 label->setText(getLabel() + ": "); 301 315 layout->addWidget(label); 316 labelWidget = label; 302 317 } 303 318 304 319 bxwidget = widget; … … 327 342 328 343 widget->setLayout(layout); 329 344 345 setValue(getValue()); 346 330 347 return widget; 331 348 } 332 349 … … 336 353 { 337 354 bxwidget = NULL; 338 355 edit = NULL; 356 labelWidget = NULL; 339 357 } 340 358 } 341 359 … … 373 391 Setting::setHelpText(str); 374 392 } 375 393 394 static void adjustFont(QWidget *widget, bool isDefault) 395 { 396 if (widget) 397 { 398 QFont f = widget->font(); 399 f.setWeight(isDefault ? QFont::Light : QFont::Bold); 400 widget->setFont(f); 401 } 402 } 403 404 void LineEditSetting::setValue(const QString &newValue) 405 { 406 if (adjustOnBlank) 407 { 408 adjustFont(labelWidget, newValue.isEmpty()); 409 adjustFont(edit, newValue.isEmpty()); 410 } 411 Setting::setValue(newValue); 412 } 413 376 414 void BoundedIntegerSetting::setValue(int newValue) 377 415 { 378 416 newValue = std::max(std::min(newValue, max), min); … … 439 477 440 478 SpinBoxSetting::SpinBoxSetting( 441 479 Storage *_storage, int _min, int _max, int _step, 442 bool _allow_single_step, QString _special_value_text) : 480 bool _allow_single_step, QString _special_value_text, 481 bool change_style_on_special) : 443 482 BoundedIntegerSetting(_storage, _min, _max, _step), 444 483 spinbox(NULL), relayEnabled(true), 445 sstep(_allow_single_step), svtext("") 484 sstep(_allow_single_step), svtext(""), labelWidget(NULL), 485 changeOnSpecial(change_style_on_special) 446 486 { 447 487 if (!_special_value_text.isEmpty()) 448 488 svtext = _special_value_text; … … 476 516 QLabel *label = new QLabel(); 477 517 label->setText(getLabel() + ": "); 478 518 layout->addWidget(label); 519 labelWidget = label; 479 520 } 480 521 481 522 bxwidget = widget; … … 506 547 507 548 widget->setLayout(layout); 508 549 550 setValue(intValue()); 551 509 552 return widget; 510 553 } 511 554 … … 515 558 { 516 559 bxwidget = NULL; 517 560 spinbox = NULL; 561 labelWidget = NULL; 518 562 } 519 563 } 520 564 521 565 void SpinBoxSetting::setValue(int newValue) 522 566 { 523 567 newValue = std::max(std::min(newValue, max), min); 568 if (changeOnSpecial) 569 { 570 adjustFont(labelWidget, (newValue == min)); 571 adjustFont(spinbox, (newValue == min)); 572 } 524 573 if (spinbox && (spinbox->value() != newValue)) 525 574 { 526 575 //int old = intValue(); … … 631 680 QLabel *label = new QLabel(); 632 681 label->setText(getLabel() + ": "); 633 682 layout->addWidget(label); 683 labelWidget = label; 634 684 } 635 685 636 686 bxwidget = widget; … … 659 709 cbwidget, SLOT(clear())); 660 710 661 711 if (rw) 712 { 662 713 connect(cbwidget, SIGNAL(editTextChanged(const QString &)), 663 714 this, SLOT(editTextChanged(const QString &))); 715 connect(cbwidget, SIGNAL(editTextChanged(const QString &)), 716 this, SLOT(changeLabel(const QString &))); 717 } 664 718 665 719 if (cg) 666 720 connect(cbwidget, SIGNAL(changeHelpText(QString)), cg, … … 673 727 674 728 widget->setLayout(layout); 675 729 730 setValue(current); 731 676 732 return widget; 677 733 } 678 734 … … 682 738 { 683 739 bxwidget = NULL; 684 740 cbwidget = NULL; 741 labelWidget = NULL; 685 742 } 686 743 } 687 744 … … 717 774 718 775 if (rw) 719 776 { 777 changeLabel(newValue); 720 778 Setting::setValue(newValue); 721 779 if (cbwidget) 722 780 cbwidget->setCurrentIndex(current); … … 727 785 { 728 786 if (cbwidget) 729 787 cbwidget->setCurrentIndex(which); 788 changeLabel(labels[which]); 730 789 SelectSetting::setValue(which); 731 790 } 732 791 733 void ComboBoxSetting::addSelection( 734 const QString &label, QString value, bool select) 792 void ComboBoxSetting::changeLabel(const QString &newLabel) 735 793 { 794 if (changeOnSpecial) 795 { 796 adjustFont(labelWidget, specialLabel == newLabel); 797 adjustFont(cbwidget, specialLabel == newLabel); 798 } 799 } 800 801 void ComboBoxSetting::addSelection(const QString &label, QString value, 802 bool select, bool special_formatting) 803 { 736 804 if ((findSelection(label, value) < 0) && cbwidget) 737 805 { 738 806 resetMaxCount(cbwidget->count()+1); 739 807 cbwidget->insertItem(label); 740 808 } 741 809 810 if (special_formatting) 811 { 812 changeOnSpecial = true; 813 specialLabel = label; 814 } 815 742 816 SelectSetting::addSelection(label, value, select); 743 817 744 818 if (cbwidget && isSet) … … 955 1029 BooleanSetting::setHelpText(str); 956 1030 } 957 1031 1032 QWidget* TristateCheckBoxSetting::configWidget(ConfigurationGroup *cg, 1033 QWidget* parent, 1034 const char* widgetName) { 1035 widget = new MythCheckBox(parent, widgetName, true); 1036 connect(widget, SIGNAL(destroyed(QObject*)), 1037 this, SLOT(widgetDeleted(QObject*))); 1038 1039 widget->setHelpText(getHelpText()); 1040 widget->setText(getLabel()); 1041 widget->setCheckState(tristateValue()); 1042 setValue(tristateValue()); 1043 1044 connect(widget, SIGNAL(stateChanged(int)), 1045 this, SLOT(setValue(int))); 1046 connect(this, SIGNAL(valueChanged(int)), 1047 this, SLOT(relayValueChanged(int))); 1048 1049 if (cg) 1050 connect(widget, SIGNAL(changeHelpText(QString)), cg, 1051 SIGNAL(changeHelpText(QString))); 1052 1053 return widget; 1054 } 1055 1056 void TristateCheckBoxSetting::widgetInvalid(QObject *obj) 1057 { 1058 widget = (widget == obj) ? NULL : widget; 1059 } 1060 1061 void TristateCheckBoxSetting::setEnabled(bool fEnabled) 1062 { 1063 TristateSetting::setEnabled(fEnabled); 1064 if (widget) 1065 widget->setEnabled(fEnabled); 1066 } 1067 1068 void TristateCheckBoxSetting::setHelpText(const QString &str) 1069 { 1070 if (widget) 1071 widget->setHelpText(str); 1072 TristateSetting::setHelpText(str); 1073 } 1074 1075 const char *TristateSetting::kPartiallyCheckedString = "default"; 1076 1077 void TristateCheckBoxSetting::setValue(int check) 1078 { 1079 adjustFont(widget, (check != Qt::Checked && check != Qt::Unchecked)); 1080 TristateSetting::setValue(check); 1081 emit valueChanged(check); 1082 } 1083 1084 void TristateSetting::setValue(int check) 1085 { 1086 if (check == Qt::Checked) 1087 Setting::setValue("1"); 1088 else if (check == Qt::Unchecked) 1089 Setting::setValue("0"); 1090 else 1091 Setting::setValue(kPartiallyCheckedString); 1092 emit valueChanged(check); 1093 } 1094 958 1095 void AutoIncrementDBSetting::Save(QString table) 959 1096 { 960 1097 if (intValue() == 0) … … 1142 1279 addSelection(label, value, select); 1143 1280 } 1144 1281 1282 void ImageSelectSetting::addDefaultSelection(const QString label, 1283 const QString value, 1284 const QString defaultValue, 1285 bool select) 1286 { 1287 for (unsigned i=0; i<values.size(); i++) 1288 { 1289 if (values[i] == defaultValue) 1290 { 1291 changeOnSpecial = true; 1292 specialLabel = label; 1293 images.push_back(new QImage(*images[i])); 1294 addSelection(label, value, select); 1295 return; 1296 } 1297 } 1298 } 1299 1145 1300 ImageSelectSetting::~ImageSelectSetting() 1146 1301 { 1147 1302 Teardown(); … … 1164 1319 bxwidget = NULL; 1165 1320 imagelabel = NULL; 1166 1321 combo = NULL; 1322 labelWidget = NULL; 1167 1323 } 1168 1324 1169 1325 void ImageSelectSetting::imageSet(int num) … … 1211 1367 QLabel *label = new QLabel(); 1212 1368 label->setText(getLabel() + ":"); 1213 1369 layout->addWidget(label); 1370 labelWidget = label; 1214 1371 } 1215 1372 1216 1373 combo = new MythComboBox(false); … … 1257 1414 connect(combo, SIGNAL(highlighted(int)), this, SLOT(imageSet(int))); 1258 1415 connect(combo, SIGNAL(activated(int)), this, SLOT(setValue(int))); 1259 1416 connect(combo, SIGNAL(activated(int)), this, SLOT(imageSet(int))); 1417 connect(combo, SIGNAL(highlighted(const QString &)), 1418 this, SLOT(changeLabel(const QString &))); 1419 connect(combo, SIGNAL(activated(const QString &)), 1420 this, SLOT(changeLabel(const QString &))); 1260 1421 1261 1422 connect(this, SIGNAL(selectionsCleared()), 1262 1423 combo, SLOT(clear())); … … 1267 1428 1268 1429 bxwidget->setLayout(layout); 1269 1430 1431 changeLabel(GetLabel(current)); 1432 1270 1433 return bxwidget; 1271 1434 } 1272 1435 1436 void ImageSelectSetting::changeLabel(const QString &newLabel) 1437 { 1438 if (changeOnSpecial) 1439 { 1440 adjustFont(labelWidget, specialLabel == newLabel); 1441 adjustFont(combo, specialLabel == newLabel); 1442 } 1443 } 1444 1273 1445 void ImageSelectSetting::widgetInvalid(QObject *obj) 1274 1446 { 1275 1447 if (bxwidget == obj) -
libs/libmyth/mythwidgets.cpp
223 223 else if (action == "DOWN") 224 224 focusNextPrevChild(true); 225 225 else if (action == "LEFT" || action == "RIGHT" || action == "SELECT") 226 toggle(); 226 { 227 if (isTristate()) 228 { 229 Qt::CheckState newState = 230 (Qt::CheckState)(((int)checkState() + 1) % 3); 231 setCheckState(newState); 232 } 233 else 234 toggle(); 235 } 227 236 else 228 237 handled = false; 229 238 } -
libs/libmyth/settings.h
134 134 135 135 class MPUBLIC LineEditSetting : public Setting 136 136 { 137 Q_OBJECT 138 137 139 protected: 138 LineEditSetting(Storage *_storage, bool readwrite = true) : 140 LineEditSetting(Storage *_storage, bool readwrite = true, 141 bool adjust_on_blank = false) : 139 142 Setting(_storage), bxwidget(NULL), edit(NULL), 140 rw(readwrite), password_echo(false) { } 143 rw(readwrite), password_echo(false), 144 adjustOnBlank(adjust_on_blank), labelWidget(NULL) { } 141 145 142 146 public: 143 147 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, … … 159 163 160 164 virtual void setHelpText(const QString &str); 161 165 166 public slots: 167 virtual void setValue(const QString &newValue); 168 162 169 private: 163 170 QWidget *bxwidget; 164 171 MythLineEdit *edit; 165 172 bool rw; 166 173 bool password_echo; 174 bool adjustOnBlank; 175 QWidget *labelWidget; 167 176 }; 168 177 169 178 // TODO: set things up so that setting the value as a string emits … … 219 228 public: 220 229 SpinBoxSetting(Storage *_storage, int min, int max, int step, 221 230 bool allow_single_step = false, 222 QString special_value_text = ""); 231 QString special_value_text = "", 232 bool change_style_on_special = false); 223 233 224 234 virtual QWidget *configWidget(ConfigurationGroup *cg, QWidget *parent, 225 235 const char *widgetName = 0); … … 248 258 bool relayEnabled; 249 259 bool sstep; 250 260 QString svtext; 261 QLabel *labelWidget; 262 bool changeOnSpecial; 251 263 }; 252 264 253 265 class MPUBLIC SelectSetting : public Setting … … 277 289 { return (i < labels.size()) ? labels[i] : QString::null; } 278 290 virtual QString GetValue(uint i) const 279 291 { return (i < values.size()) ? values[i] : QString::null; } 292 virtual QString GetValueLabel(const QString &value); 280 293 281 294 signals: 282 295 void selectionAdded(const QString& label, QString value); … … 318 331 protected: 319 332 ComboBoxSetting(Storage *_storage, bool _rw = false, int _step = 1) : 320 333 SelectSetting(_storage), rw(_rw), 321 bxwidget(NULL), cbwidget(NULL), step(_step) { } 334 bxwidget(NULL), cbwidget(NULL), changeOnSpecial(false), 335 specialLabel(""), labelWidget(NULL), step(_step) { } 322 336 323 337 public: 324 338 virtual void setValue(QString newValue); … … 340 354 public slots: 341 355 void addSelection(const QString &label, 342 356 QString value = QString::null, 343 bool select = false); 357 bool select = false, 358 bool special_formatting = false); 344 359 bool removeSelection(const QString &label, 345 360 QString value = QString::null); 361 virtual void changeLabel(const QString &newValue); 346 362 void editTextChanged(const QString &newText); 347 363 348 364 private: 349 365 bool rw; 350 366 QWidget *bxwidget; 351 367 MythComboBox *cbwidget; 368 bool changeOnSpecial; 369 QString specialLabel; 370 QLabel *labelWidget; 352 371 353 372 protected: 354 373 int step; … … 417 436 ImageSelectSetting(Storage *_storage) : 418 437 SelectSetting(_storage), 419 438 bxwidget(NULL), imagelabel(NULL), combo(NULL), 420 m_hmult(1.0f), m_wmult(1.0f) { } 439 m_hmult(1.0f), m_wmult(1.0f), 440 changeOnSpecial(false), specialLabel(""), labelWidget(NULL) { } 421 441 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 422 442 const char* widgetName = 0); 423 443 virtual void widgetInvalid(QObject *obj); … … 428 448 QImage* image, 429 449 QString value=QString::null, 430 450 bool select=false); 451 virtual void addDefaultSelection(const QString label, 452 const QString value, 453 const QString defaultValue, 454 bool select); 431 455 432 456 protected slots: 433 457 void imageSet(int); 458 void changeLabel(const QString &newLabel); 434 459 435 460 protected: 436 461 void Teardown(void); … … 442 467 QLabel *imagelabel; 443 468 MythComboBox *combo; 444 469 float m_hmult, m_wmult; 470 bool changeOnSpecial; 471 QString specialLabel; 472 QLabel *labelWidget; 445 473 }; 446 474 447 475 class MPUBLIC BooleanSetting : public Setting … … 484 512 MythCheckBox *widget; 485 513 }; 486 514 515 class MPUBLIC TristateSetting : public BooleanSetting 516 { 517 Q_OBJECT 518 519 public: 520 TristateSetting(Storage *_storage) : BooleanSetting(_storage) {} 521 522 Qt::CheckState tristateValue(void) const { 523 if (getValue() == "0") 524 return Qt::Unchecked; 525 if (getValue() == "1") 526 return Qt::Checked; 527 return Qt::PartiallyChecked; 528 } 529 530 static const char *kPartiallyCheckedString; 531 532 public slots: 533 virtual void setValue(/*Qt::CheckState*/int check); 534 535 signals: 536 void valueChanged(int); 537 }; 538 539 class MPUBLIC TristateCheckBoxSetting: public TristateSetting { 540 Q_OBJECT 541 542 public: 543 TristateCheckBoxSetting(Storage *_storage) : 544 TristateSetting(_storage), widget(NULL) { } 545 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 546 const char* widgetName = 0); 547 virtual void widgetInvalid(QObject*); 548 549 virtual void setEnabled(bool b); 550 551 virtual void setHelpText(const QString &str); 552 553 554 public slots: 555 virtual void setValue(/*Qt::CheckState*/int check); 556 virtual void relayValueChanged(int state) { 557 if (widget) 558 widget->setCheckState((Qt::CheckState)state); 559 } 560 561 protected: 562 MythCheckBox *widget; 563 }; 564 487 565 class MPUBLIC PathSetting : public ComboBoxSetting 488 566 { 489 567 public: -
libs/libmyth/libmyth.pro
62 62 SOURCES += mythrssmanager.cpp netgrabbermanager.cpp 63 63 SOURCES += rssparse.cpp netutils.cpp 64 64 65 HEADERS += playsettings.h 66 SOURCES += playsettings.cpp 67 65 68 # remove when everything is switched to mythui 66 69 SOURCES += virtualkeyboard_qt.cpp 67 70 -
libs/libmyth/mythconfiggroups.cpp
476 476 Configurable *target) 477 477 { 478 478 VerifyLayout(); 479 bool isDuplicate = triggerMap.values().contains(target); 479 480 triggerMap[triggerValue] = target; 480 481 481 482 if (!configStack) … … 485 486 configStack->setSaveAll(isSaveAll); 486 487 } 487 488 488 configStack->addChild(target); 489 // Don't add a target as a child if it has already been added, 490 // otherwise something goes wrong with signals in the child. 491 if (!isDuplicate) 492 configStack->addChild(target); 489 493 } 490 494 491 495 Setting *TriggeredConfigurationGroup::byName(const QString &settingName) -
libs/libmyth/mythwidgets.h
329 329 Q_OBJECT 330 330 331 331 public: 332 MythCheckBox(QWidget *parent = 0, const char *name = "MythCheckBox") 333 : QCheckBox(parent) { setObjectName(name); }; 332 MythCheckBox(QWidget *parent = 0, const char *name = "MythCheckBox", 333 bool isTristate = false) : QCheckBox(parent) 334 { 335 setObjectName(name); 336 setTristate(isTristate); 337 } 334 338 MythCheckBox(const QString &text, 335 QWidget *parent = 0, const char *name = "MythCheckBox") 336 : QCheckBox(text, parent) { setObjectName(name); }; 339 QWidget *parent = 0, const char *name = "MythCheckBox", 340 bool isTristate = false) : QCheckBox(text, parent) 341 { 342 setObjectName(name); 343 setTristate(isTristate); 344 } 337 345 338 346 void setHelpText(const QString&); 339 347 -
programs/mythfrontend/globalsettings.cpp
38 38 #include "mythconfig.h" 39 39 #include "mythdirs.h" 40 40 #include "mythuihelper.h" 41 #include "playsettings.h" 41 42 43 #define CREATE_CHECKBOX_SETTING(var, name, settings) \ 44 BooleanSetting *var; \ 45 if ((settings)) \ 46 var = new PlaySettingsCheckBox((name), (settings)); \ 47 else \ 48 var = new HostCheckBox((name)) 49 50 #define CREATE_COMBOBOX_SETTING(var, name, settings) \ 51 ComboBoxSetting *var; \ 52 if ((settings)) \ 53 var = new PlaySettingsComboBox((name), (settings)); \ 54 else \ 55 var = new HostComboBox((name)) 56 57 #define CREATE_COMBOBOX1_SETTING(var, name, settings, arg1) \ 58 ComboBoxSetting *var; \ 59 if ((settings)) \ 60 var = new PlaySettingsComboBox((name), (settings), (arg1)); \ 61 else \ 62 var = new HostComboBox((name), (arg1)) 63 64 #define CREATE_SPINBOX_SETTING(var, name, settings, arg1, arg2, arg3, arg4) \ 65 SpinBoxSetting *var; \ 66 if ((settings)) \ 67 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3), (arg4)); \ 68 else \ 69 var = new HostSpinBox((name), (arg1), (arg2), (arg3), (arg4)) 70 71 #define CREATE_LINEEDIT_SETTING(var, name, settings) \ 72 LineEditSetting *var; \ 73 if ((settings)) \ 74 var = new PlaySettingsLineEdit((name), (settings), ""); \ 75 else \ 76 var = new HostLineEdit((name)) 77 78 // For PlaySettings, use a SpinBox instead of a Slider so that a 79 // default value can be easily used. 80 #define CREATE_SLIDER_SETTING(var, name, settings, arg1, arg2, arg3) \ 81 BoundedIntegerSetting *var; \ 82 if ((settings)) \ 83 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3)); \ 84 else \ 85 var = new HostSlider((name), (arg1), (arg2), (arg3)) 86 87 #define CREATE_IMAGESELECT_SETTING(var, name, settings) \ 88 ImageSelectSetting *var; \ 89 if ((settings)) \ 90 var = new PlaySettingsImageSelect((name), (settings)); \ 91 else \ 92 var = new HostImageSelect((name)) 93 94 static Setting *wrap(Setting *obj, PlaySettings *settings, 95 bool twoLineLabel=false) 96 { 97 if (!settings) 98 return obj; 99 100 // Get the setting name 101 PlaySettingsCombinedStorage *storage = 102 dynamic_cast<PlaySettingsCombinedStorage *>(obj); 103 const QString &name = storage->getName(); 104 105 // Get the default value and label. The label is different 106 // from the value for most object types. 107 QString defaultValue = settings->GetSetting(name, "", true); 108 QString defaultLabel(defaultValue); 109 if (dynamic_cast<BooleanSetting *>(obj)) 110 defaultLabel = (defaultValue == "0" || defaultValue.isEmpty() ? 111 QObject::tr("disabled") : QObject::tr("enabled")); 112 if (dynamic_cast<SpinBoxSetting *>(obj) && defaultValue.isEmpty()) 113 defaultLabel = "0"; 114 ComboBoxSetting *cb = dynamic_cast<ComboBoxSetting *>(obj); 115 if (cb) 116 { 117 defaultLabel = cb->GetValueLabel(defaultValue); 118 // Add the default selection to a ComboBox 119 cb->addSelection(QString("(") + QObject::tr("default") + ")", 120 storage->getDefault(), 121 !settings->IsOverridden(name), 122 true); 123 } 124 ImageSelectSetting *is = dynamic_cast<ImageSelectSetting *>(obj); 125 if (is) 126 { 127 defaultLabel = is->GetValueLabel(defaultValue); 128 // Add the default selection to a ImageSelect 129 is->addDefaultSelection(QString("(") + QObject::tr("default") + ")", 130 storage->getDefault(), 131 defaultValue, 132 !settings->IsOverridden(name)); 133 } 134 135 // Change the help text to include the default and its source. 136 QString helpPrefix; 137 if (dynamic_cast<LineEditSetting *>(obj)) 138 helpPrefix = QObject::tr("Leave blank to keep default value"); 139 else 140 helpPrefix = QObject::tr("Override default value"); 141 helpPrefix += " (" + defaultLabel + ") "; 142 QString inheritsFrom = settings->InheritsFrom(name); 143 if (inheritsFrom.isNull()) 144 helpPrefix += QObject::tr("from global settings"); 145 else 146 helpPrefix += QObject::tr("from group") + " " + inheritsFrom; 147 helpPrefix += ". " + obj->getHelpText(); 148 obj->setHelpText(helpPrefix); 149 150 // Change the label to include the default. 151 obj->setLabel(obj->getLabel() + (twoLineLabel ? "\n" : "") + 152 " (" + defaultLabel + ")"); 153 154 return obj; 155 } 156 42 157 class TriggeredItem : public TriggeredConfigurationGroup 43 158 { 44 159 public: … … 603 718 return gs; 604 719 } 605 720 606 static HostCheckBox *DecodeExtraAudio()721 static Setting *DecodeExtraAudio(PlaySettings *settings) 607 722 { 608 HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");723 CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings); 609 724 gc->setLabel(QObject::tr("Extra audio buffering")); 610 725 gc->setValue(true); 611 726 gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing " … … 614 729 "effect on framegrabbers (MPEG-4/RTJPEG). MythTV will " 615 730 "keep extra audio data in its internal buffers to " 616 731 "workaround this bug.")); 617 return gc;732 return wrap(gc, settings); 618 733 } 619 734 620 static HostComboBox *PIPLocationComboBox()735 static Setting *PIPLocationComboBox(PlaySettings *settings) 621 736 { 622 HostComboBox *gc = new HostComboBox("PIPLocation");737 CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings); 623 738 gc->setLabel(QObject::tr("PIP video location")); 624 739 for (uint loc = 0; loc < kPIP_END; ++loc) 625 740 gc->addSelection(toString((PIPLocation) loc), QString::number(loc)); 626 741 gc->setHelpText(QObject::tr("Location of PIP Video window.")); 627 return gc;742 return wrap(gc, settings); 628 743 } 629 744 630 745 static HostComboBox *DisplayRecGroup() … … 710 825 return gc; 711 826 } 712 827 713 static HostCheckBox *SmartForward()828 static Setting *SmartForward(PlaySettings *settings) 714 829 { 715 HostCheckBox *gc = new HostCheckBox("SmartForward");830 CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings); 716 831 gc->setLabel(QObject::tr("Smart fast forwarding")); 717 832 gc->setValue(false); 718 833 gc->setHelpText(QObject::tr("If enabled, then immediately after " 719 834 "rewinding, only skip forward the same amount as " 720 835 "skipping backwards.")); 721 return gc;836 return wrap(gc, settings); 722 837 } 723 838 724 static HostCheckBox *ExactSeeking()839 static Setting *ExactSeeking(PlaySettings *settings) 725 840 { 726 HostCheckBox *gc = new HostCheckBox("ExactSeeking");841 CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings); 727 842 gc->setLabel(QObject::tr("Seek to exact frame")); 728 843 gc->setValue(false); 729 844 gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but " 730 845 "slower.")); 731 return gc;846 return wrap(gc, settings); 732 847 } 733 848 734 849 static GlobalComboBox *CommercialSkipMethod() … … 756 871 return gc; 757 872 } 758 873 759 static HostComboBox *AutoCommercialSkip()874 static Setting *AutoCommercialSkip(PlaySettings *settings) 760 875 { 761 HostComboBox *gc = new HostComboBox("AutoCommercialSkip");876 CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings); 762 877 gc->setLabel(QObject::tr("Automatically skip commercials")); 763 878 gc->addSelection(QObject::tr("Off"), "0"); 764 879 gc->addSelection(QObject::tr("Notify, but do not skip"), "2"); … … 767 882 "have been flagged during automatic commercial detection " 768 883 "or by the mythcommflag program, or just notify that a " 769 884 "commercial has been detected.")); 770 return gc;885 return wrap(gc, settings); 771 886 } 772 887 773 888 static GlobalCheckBox *AutoCommercialFlag() … … 853 968 return bc; 854 969 } 855 970 856 static HostSpinBox *CommRewindAmount()971 static Setting *CommRewindAmount(PlaySettings *settings) 857 972 { 858 HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);973 CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false); 859 974 gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)")); 860 975 gs->setHelpText(QObject::tr("MythTV will automatically rewind " 861 976 "this many seconds after performing a commercial skip.")); 862 977 gs->setValue(0); 863 return gs;978 return wrap(gs, settings); 864 979 } 865 980 866 static HostSpinBox *CommNotifyAmount()981 static Setting *CommNotifyAmount(PlaySettings *settings) 867 982 { 868 HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);983 CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false); 869 984 gs->setLabel(QObject::tr("Commercial skip notify amount (secs)")); 870 985 gs->setHelpText(QObject::tr("MythTV will act like a commercial " 871 986 "begins this many seconds early. This can be useful " 872 987 "when commercial notification is used in place of " 873 988 "automatic skipping.")); 874 989 gs->setValue(0); 875 return gs;990 return wrap(gs, settings); 876 991 } 877 992 878 993 static GlobalSpinBox *MaximumCommercialSkip() … … 1674 1789 labels[j]->setValue(label_i); 1675 1790 } 1676 1791 1677 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) : 1792 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str, 1793 PlaySettings *settings) : 1678 1794 TriggeredConfigurationGroup(false, true, true, true, 1679 1795 false, false, true, true), grouptrigger(NULL) 1680 1796 { 1681 1797 setLabel(QObject::tr("Playback Profiles") + str); 1798 if (settings) 1799 setLabel(QObject::tr("Playback group settings for ") + 1800 settings->mGroupName + " - " + 1801 getLabel()); 1682 1802 1683 1803 QString host = gCoreContext->GetHostName(); 1684 1804 QStringList profiles = VideoDisplayProfile::GetProfiles(host); … … 1706 1826 profiles = VideoDisplayProfile::GetProfiles(host); 1707 1827 } 1708 1828 1709 QString profile = VideoDisplayProfile::GetDefaultProfileName(host );1829 QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings); 1710 1830 if (!profiles.contains(profile)) 1711 1831 { 1712 1832 profile = (profiles.contains("Normal")) ? "Normal" : profiles[0]; 1713 1833 VideoDisplayProfile::SetDefaultProfileName(profile, host); 1714 1834 } 1715 1835 1716 grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile"); 1836 CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings); 1837 grouptrigger = gs; 1717 1838 grouptrigger->setLabel(QObject::tr("Current Video Playback Profile")); 1718 1839 QStringList::const_iterator it; 1719 1840 for (it = profiles.begin(); it != profiles.end(); ++it) 1720 1841 grouptrigger->addSelection(ProgramInfo::i18n(*it), *it); 1842 if (settings) 1843 { 1844 addChild(wrap(grouptrigger, settings)); 1845 return; 1846 } 1721 1847 1722 1848 HorizontalConfigurationGroup *grp = 1723 1849 new HorizontalConfigurationGroup(false, false, true, true); … … 1850 1976 return gc; 1851 1977 } 1852 1978 1853 static HostSpinBox *FFRewReposTime()1979 static Setting *FFRewReposTime(PlaySettings *settings) 1854 1980 { 1855 HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);1981 CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false); 1856 1982 gs->setLabel(QObject::tr("Fast forward/rewind reposition amount")); 1857 1983 gs->setValue(100); 1858 1984 gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind " … … 1860 1986 "resuming normal playback. This " 1861 1987 "compensates for the reaction time between seeing " 1862 1988 "where to resume playback and actually exiting seeking.")); 1863 return gs;1989 return wrap(gs, settings); 1864 1990 } 1865 1991 1866 static HostCheckBox *FFRewReverse()1992 static Setting *FFRewReverse(PlaySettings *settings) 1867 1993 { 1868 HostCheckBox *gc = new HostCheckBox("FFRewReverse");1994 CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings); 1869 1995 gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind")); 1870 1996 gc->setValue(true); 1871 1997 gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key " … … 1873 1999 "vice versa. If disabled, it will decrease the " 1874 2000 "current speed or switch to play mode if " 1875 2001 "the speed can't be decreased further.")); 1876 return gc;2002 return wrap(gc, settings); 1877 2003 } 1878 2004 1879 2005 static HostComboBox *MenuTheme() … … 1910 2036 return gc; 1911 2037 } 1912 2038 1913 static HostSpinBox *OSDCC708TextZoomPercentage(void)2039 static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings) 1914 2040 { 1915 HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5); 2041 CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings, 2042 50, 200, 5, false); 1916 2043 gs->setLabel(QObject::tr("Subtitle text zoom percentage")); 1917 2044 gs->setValue(100); 1918 2045 gs->setHelpText(QObject::tr("Use this to enlarge or shrink text based subtitles.")); 1919 2046 1920 return gs;2047 return wrap(gs, settings); 1921 2048 } 1922 2049 1923 2050 static HostComboBox *SubtitleFont() … … 1937 2064 return hcb; 1938 2065 } 1939 2066 1940 static HostComboBox *SubtitleCodec()2067 static Setting *SubtitleCodec(PlaySettings *settings) 1941 2068 { 1942 HostComboBox *gc = new HostComboBox("SubtitleCodec");2069 CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings); 1943 2070 1944 2071 gc->setLabel(QObject::tr("Subtitle Codec")); 1945 2072 QList<QByteArray> list = QTextCodec::availableCodecs(); … … 1949 2076 gc->addSelection(val, val, val.toLower() == "utf-8"); 1950 2077 } 1951 2078 1952 return gc;2079 return wrap(gc, settings); 1953 2080 } 1954 2081 1955 2082 static HostComboBox *ChannelOrdering() … … 1961 2088 return gc; 1962 2089 } 1963 2090 1964 static HostSpinBox *VertScanPercentage()2091 static Setting *VertScanPercentage(PlaySettings *settings) 1965 2092 { 1966 HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1); 2093 CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings, 2094 -100, 100, 1, false); 1967 2095 gs->setLabel(QObject::tr("Vertical scaling")); 1968 2096 gs->setValue(0); 1969 2097 gs->setHelpText(QObject::tr( 1970 2098 "Adjust this if the image does not fill your " 1971 2099 "screen vertically. Range -100% to 100%")); 1972 return gs;2100 return wrap(gs, settings); 1973 2101 } 1974 2102 1975 static HostSpinBox *HorizScanPercentage()2103 static Setting *HorizScanPercentage(PlaySettings *settings) 1976 2104 { 1977 HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1); 2105 CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings, 2106 -100, 100, 1, false); 1978 2107 gs->setLabel(QObject::tr("Horizontal scaling")); 1979 2108 gs->setValue(0); 1980 2109 gs->setHelpText(QObject::tr( 1981 2110 "Adjust this if the image does not fill your " 1982 2111 "screen horizontally. Range -100% to 100%")); 1983 return gs;2112 return wrap(gs, settings); 1984 2113 }; 1985 2114 1986 static HostSpinBox *XScanDisplacement()2115 static Setting *XScanDisplacement(PlaySettings *settings) 1987 2116 { 1988 HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1); 2117 CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings, 2118 -50, 50, 1, false); 1989 2119 gs->setLabel(QObject::tr("Scan displacement (X)")); 1990 2120 gs->setValue(0); 1991 2121 gs->setHelpText(QObject::tr("Adjust this to move the image horizontally.")); 1992 return gs;2122 return wrap(gs, settings); 1993 2123 } 1994 2124 1995 static HostSpinBox *YScanDisplacement()2125 static Setting *YScanDisplacement(PlaySettings *settings) 1996 2126 { 1997 HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1); 2127 CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings, 2128 -50, 50, 1, false); 1998 2129 gs->setLabel(QObject::tr("Scan displacement (Y)")); 1999 2130 gs->setValue(0); 2000 2131 gs->setHelpText(QObject::tr("Adjust this to move the image vertically.")); 2001 return gs;2132 return wrap(gs, settings); 2002 2133 }; 2003 2134 2004 static HostCheckBox *CCBackground()2135 static Setting *CCBackground(PlaySettings *settings) 2005 2136 { 2006 HostCheckBox *gc = new HostCheckBox("CCBackground");2137 CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings); 2007 2138 gc->setLabel(QObject::tr("Black background for closed captioning")); 2008 2139 gc->setValue(false); 2009 2140 gc->setHelpText(QObject::tr( 2010 2141 "If enabled, captions will be displayed " 2011 2142 "as white text over a black background " 2012 2143 "for better contrast.")); 2013 return gc;2144 return wrap(gc, settings); 2014 2145 } 2015 2146 2016 static HostCheckBox *DefaultCCMode()2147 static Setting *DefaultCCMode(PlaySettings *settings) 2017 2148 { 2018 HostCheckBox *gc = new HostCheckBox("DefaultCCMode");2149 CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings); 2019 2150 gc->setLabel(QObject::tr("Always display closed captioning or subtitles")); 2020 2151 gc->setValue(false); 2021 2152 gc->setHelpText(QObject::tr( … … 2023 2154 "when playing back recordings or watching " 2024 2155 "Live TV. Closed Captioning can be turned on or off " 2025 2156 "by pressing \"T\" during playback.")); 2026 return gc;2157 return wrap(gc, settings); 2027 2158 } 2028 2159 2029 static HostCheckBox *PreferCC708()2160 static Setting *PreferCC708(PlaySettings *settings) 2030 2161 { 2031 HostCheckBox *gc = new HostCheckBox("Prefer708Captions");2162 CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings); 2032 2163 gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions")); 2033 2164 gc->setValue(true); 2034 2165 gc->setHelpText( … … 2036 2167 "If enabled, the newer EIA-708 captions will be preferred over " 2037 2168 "the older EIA-608 captions in ATSC streams.")); 2038 2169 2039 return gc;2170 return wrap(gc, settings); 2040 2171 } 2041 2172 2042 static HostCheckBox *EnableMHEG()2173 static Setting *EnableMHEG(PlaySettings *settings) 2043 2174 { 2044 HostCheckBox *gc = new HostCheckBox("EnableMHEG");2175 CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings); 2045 2176 gc->setLabel(QObject::tr("Enable interactive TV")); 2046 2177 gc->setValue(false); 2047 2178 gc->setHelpText(QObject::tr( 2048 2179 "If enabled, interactive TV applications (MHEG) will " 2049 2180 "be activated. This is used for teletext and logos for " 2050 2181 "radio and channels that are currently off-air.")); 2051 return gc;2182 return wrap(gc, settings); 2052 2183 } 2053 2184 2054 static HostCheckBox *PersistentBrowseMode()2185 static Setting *PersistentBrowseMode(PlaySettings *settings) 2055 2186 { 2056 HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");2187 CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings); 2057 2188 gc->setLabel(QObject::tr("Always use browse mode in Live TV")); 2058 2189 gc->setValue(true); 2059 2190 gc->setHelpText( 2060 2191 QObject::tr( 2061 2192 "If enabled, browse mode will automatically be activated " 2062 2193 "whenever you use channel up/down while watching Live TV.")); 2063 return gc;2194 return wrap(gc, settings); 2064 2195 } 2065 2196 2066 static HostCheckBox *BrowseAllTuners()2197 static Setting *BrowseAllTuners(PlaySettings *settings) 2067 2198 { 2068 HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");2199 CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings); 2069 2200 gc->setLabel(QObject::tr("Browse all channels")); 2070 2201 gc->setValue(false); 2071 2202 gc->setHelpText( … … 2073 2204 "If enabled, browse mode will shows channels on all " 2074 2205 "available recording devices, instead of showing " 2075 2206 "channels on just the current recorder.")); 2076 return gc;2207 return wrap(gc, settings); 2077 2208 } 2078 2209 2079 static HostCheckBox *ClearSavedPosition()2210 static Setting *ClearSavedPosition(PlaySettings *settings) 2080 2211 { 2081 HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");2212 CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings); 2082 2213 gc->setLabel(QObject::tr("Clear bookmark on playback")); 2083 2214 gc->setValue(true); 2084 2215 gc->setHelpText(QObject::tr("If enabled, automatically clear the " 2085 2216 "bookmark on a recording when the recording is played " 2086 2217 "back. If disabled, you can mark the beginning with " 2087 2218 "rewind then save position.")); 2088 return gc;2219 return wrap(gc, settings); 2089 2220 } 2090 2221 2091 static HostCheckBox *AltClearSavedPosition()2222 static Setting *AltClearSavedPosition(PlaySettings *settings) 2092 2223 { 2093 HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");2224 CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings); 2094 2225 gc->setLabel(QObject::tr("Alternate clear and save bookmark")); 2095 2226 gc->setValue(true); 2096 2227 gc->setHelpText(QObject::tr("During playback the SELECT key " … … 2098 2229 "Saved\" and \"Bookmark Cleared\". If disabled, the " 2099 2230 "SELECT key will save the current position for each " 2100 2231 "keypress.")); 2101 return gc;2232 return wrap(gc, settings); 2102 2233 } 2103 2234 2104 2235 // This currently does not work 2105 2236 /* 2106 static HostLineEdit *UDPNotifyPort()2237 static Setting *UDPNotifyPort(PlaySettings *settings) 2107 2238 { 2108 HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");2239 CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings); 2109 2240 ge->setLabel(QObject::tr("UDP notify port")); 2110 2241 ge->setValue("6948"); 2111 2242 ge->setHelpText(QObject::tr("During playback, MythTV will listen for " 2112 2243 "connections from the \"mythtvosd\" or \"mythudprelay\" " 2113 2244 "programs on this port. For additional information, see " 2114 2245 "http://www.mythtv.org/wiki/MythNotify .")); 2115 return ge;2246 return wrap(ge, settings); 2116 2247 } 2117 2248 */ 2118 2249 2119 static HostComboBox *PlaybackExitPrompt()2250 static Setting *PlaybackExitPrompt(PlaySettings *settings) 2120 2251 { 2121 HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");2252 CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings); 2122 2253 gc->setLabel(QObject::tr("Action on playback exit")); 2123 2254 gc->addSelection(QObject::tr("Just exit"), "0"); 2124 2255 gc->addSelection(QObject::tr("Save position and exit"), "2"); … … 2129 2260 "when you exit playback mode. The options available will " 2130 2261 "allow you to save your position, delete the " 2131 2262 "recording, or continue watching.")); 2132 return gc;2263 return wrap(gc, settings); 2133 2264 } 2134 2265 2135 static HostCheckBox *EndOfRecordingExitPrompt()2266 static Setting *EndOfRecordingExitPrompt(PlaySettings *settings) 2136 2267 { 2137 HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");2268 CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings); 2138 2269 gc->setLabel(QObject::tr("Prompt at end of recording")); 2139 2270 gc->setValue(false); 2140 2271 gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing " 2141 2272 "you to delete the recording when it has finished " 2142 2273 "playing.")); 2143 return gc;2274 return wrap(gc, settings); 2144 2275 } 2145 2276 2146 static HostCheckBox *JumpToProgramOSD()2277 static Setting *JumpToProgramOSD(PlaySettings *settings) 2147 2278 { 2148 HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");2279 CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings); 2149 2280 gc->setLabel(QObject::tr("Jump to program OSD")); 2150 2281 gc->setValue(true); 2151 2282 gc->setHelpText(QObject::tr( … … 2154 2285 "'Watch Recording' screen when 'Jump to Program' " 2155 2286 "is activated. If enabled, the recordings are shown " 2156 2287 "in the OSD")); 2157 return gc;2288 return wrap(gc, settings); 2158 2289 } 2159 2290 2160 static HostCheckBox *ContinueEmbeddedTVPlay()2291 static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings) 2161 2292 { 2162 HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");2293 CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings); 2163 2294 gc->setLabel(QObject::tr("Continue playback when embedded")); 2164 2295 gc->setValue(false); 2165 2296 gc->setHelpText(QObject::tr( … … 2167 2298 "is embedded in the upcoming program list or recorded " 2168 2299 "list. The default is to pause the recorded show when " 2169 2300 "embedded.")); 2170 return gc;2301 return wrap(gc, settings); 2171 2302 } 2172 2303 2173 static HostCheckBox *AutomaticSetWatched()2304 static Setting *AutomaticSetWatched(PlaySettings *settings) 2174 2305 { 2175 HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");2306 CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings); 2176 2307 gc->setLabel(QObject::tr("Automatically mark a recording as watched")); 2177 2308 gc->setValue(false); 2178 2309 gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a " … … 2180 2311 "detection is not foolproof, so do not enable this " 2181 2312 "setting if you don't want an unwatched recording marked " 2182 2313 "as watched.")); 2183 return gc;2314 return wrap(gc, settings); 2184 2315 } 2185 2316 2186 2317 static HostSpinBox *LiveTVIdleTimeout() … … 2370 2501 return gc; 2371 2502 } 2372 2503 2373 static HostComboBox *LetterboxingColour()2504 static Setting *LetterboxingColour(PlaySettings *settings) 2374 2505 { 2375 HostComboBox *gc = new HostComboBox("LetterboxColour");2506 CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings); 2376 2507 gc->setLabel(QObject::tr("Letterboxing color")); 2377 2508 for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m) 2378 2509 gc->addSelection(toString((LetterBoxColour)m), QString::number(m)); … … 2382 2513 "letterboxing, but those with plasma screens may prefer gray " 2383 2514 "to minimize burn-in.") + " " + 2384 2515 QObject::tr("Currently only works with XVideo video renderer.")); 2385 return gc;2516 return wrap(gc, settings); 2386 2517 } 2387 2518 2388 static HostComboBox *AspectOverride()2519 static Setting *AspectOverride(PlaySettings *settings) 2389 2520 { 2390 HostComboBox *gc = new HostComboBox("AspectOverride");2521 CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings); 2391 2522 gc->setLabel(QObject::tr("Video aspect override")); 2392 2523 for (int m = kAspect_Off; m < kAspect_END; ++m) 2393 2524 gc->addSelection(toString((AspectOverrideMode)m), QString::number(m)); … … 2395 2526 "When enabled, these will override the aspect " 2396 2527 "ratio specified by any broadcaster for all " 2397 2528 "video streams.")); 2398 return gc;2529 return wrap(gc, settings); 2399 2530 } 2400 2531 2401 static HostComboBox *AdjustFill()2532 static Setting *AdjustFill(PlaySettings *settings) 2402 2533 { 2403 HostComboBox *gc = new HostComboBox("AdjustFill");2534 CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings); 2404 2535 gc->setLabel(QObject::tr("Zoom")); 2405 2536 gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff), 2406 2537 QString::number(kAdjustFill_AutoDetect_DefaultOff)); … … 2411 2542 gc->setHelpText(QObject::tr( 2412 2543 "When enabled, these will apply a predefined " 2413 2544 "zoom to all video playback in MythTV.")); 2414 return gc;2545 return wrap(gc, settings); 2415 2546 } 2416 2547 2417 2548 // Theme settings … … 3336 3467 return gs; 3337 3468 } 3338 3469 3339 static HostCheckBox *RealtimePriority()3470 static Setting *RealtimePriority(PlaySettings *settings) 3340 3471 { 3341 HostCheckBox *gc = new HostCheckBox("RealtimePriority");3472 CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings); 3342 3473 gc->setLabel(QObject::tr("Enable realtime priority threads")); 3343 3474 gc->setHelpText(QObject::tr("When running mythfrontend with root " 3344 3475 "privileges, some threads can be given enhanced priority. " 3345 3476 "Disable this if mythfrontend freezes during video " 3346 3477 "playback.")); 3347 3478 gc->setValue(true); 3348 return gc;3479 return wrap(gc, settings, false); 3349 3480 } 3350 3481 3351 3482 static HostCheckBox *EnableMediaMon() … … 3502 3633 3503 3634 #ifdef USING_OPENGL_VSYNC 3504 3635 /* 3505 static HostCheckBox *UseOpenGLVSync()3636 static Setting *UseOpenGLVSync(PlaySettings *settings) 3506 3637 { 3507 HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");3638 CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings); 3508 3639 gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing")); 3509 3640 gc->setValue(false); 3510 3641 gc->setHelpText(QObject::tr( 3511 3642 "If supported by your hardware/drivers, " 3512 3643 "MythTV will use OpenGL vertical syncing for " 3513 3644 "video timing, reducing frame jitter.")); 3514 return gc;3645 return wrap(gc, settings); 3515 3646 } 3516 3647 */ 3517 3648 #endif … … 3938 4069 return gc; 3939 4070 } 3940 4071 3941 MainGeneralSettings::MainGeneralSettings() 4072 MainGeneralSettings::MainGeneralSettings(PlaySettings *settings, 4073 ConfigurationWizard *base) 3942 4074 { 4075 if (!settings) 4076 { 3943 4077 DatabaseSettings::addDatabaseSettings(this); 3944 4078 3945 4079 VerticalConfigurationGroup *pin = … … 3991 4125 remotecontrol->addChild(NetworkControlEnabled()); 3992 4126 remotecontrol->addChild(NetworkControlPort()); 3993 4127 addChild(remotecontrol); 4128 } 3994 4129 } 3995 4130 3996 PlaybackSettings::PlaybackSettings() 4131 PlaybackSettings::PlaybackSettings(PlaySettings *settings, 4132 ConfigurationWizard *base) 3997 4133 { 3998 4134 uint i = 0, total = 8; 3999 4135 #if CONFIG_DARWIN 4000 4136 total += 2; 4001 4137 #endif // USING_DARWIN 4138 if (settings) 4139 total -= 3; 4002 4140 4003 4141 4004 4142 VerticalConfigurationGroup* general1 = 4005 4143 new VerticalConfigurationGroup(false); 4006 4144 general1->setLabel(QObject::tr("General Playback") + 4007 4145 QString(" (%1/%2)").arg(++i).arg(total)); 4146 if (settings) 4147 general1->setLabel(QObject::tr("Playback group settings for ") + 4148 settings->mGroupName + " - " + 4149 general1->getLabel()); 4008 4150 4009 4151 HorizontalConfigurationGroup *columns = 4010 4152 new HorizontalConfigurationGroup(false, false, true, true); 4011 4153 4012 4154 VerticalConfigurationGroup *column1 = 4013 4155 new VerticalConfigurationGroup(false, false, true, true); 4014 column1->addChild(RealtimePriority()); 4015 column1->addChild(DecodeExtraAudio()); 4016 column1->addChild(JumpToProgramOSD()); 4156 if (!settings) 4157 column1->addChild(RealtimePriority(settings)); 4158 column1->addChild(DecodeExtraAudio(settings)); 4159 column1->addChild(JumpToProgramOSD(settings)); 4017 4160 columns->addChild(column1); 4018 4161 4019 4162 VerticalConfigurationGroup *column2 = 4020 4163 new VerticalConfigurationGroup(false, false, true, true); 4021 column2->addChild(ClearSavedPosition( ));4022 column2->addChild(AltClearSavedPosition( ));4023 column2->addChild(AutomaticSetWatched( ));4024 column2->addChild(ContinueEmbeddedTVPlay( ));4164 column2->addChild(ClearSavedPosition(settings)); 4165 column2->addChild(AltClearSavedPosition(settings)); 4166 column2->addChild(AutomaticSetWatched(settings)); 4167 column2->addChild(ContinueEmbeddedTVPlay(settings)); 4025 4168 columns->addChild(column2); 4026 4169 4027 4170 general1->addChild(columns); 4028 general1->addChild(LiveTVIdleTimeout()); 4171 if (!settings) 4172 general1->addChild(LiveTVIdleTimeout()); 4029 4173 #ifdef USING_OPENGL_VSYNC 4030 //general1->addChild(UseOpenGLVSync( ));4174 //general1->addChild(UseOpenGLVSync(settings)); 4031 4175 #endif // USING_OPENGL_VSYNC 4032 addChild(general1); 4176 if (base) 4177 base->addChild(general1); 4178 else 4179 addChild(general1); 4033 4180 4034 4181 VerticalConfigurationGroup* general2 = 4035 4182 new VerticalConfigurationGroup(false); 4036 4183 general2->setLabel(QObject::tr("General Playback") + 4037 4184 QString(" (%1/%2)").arg(++i).arg(total)); 4185 if (settings) 4186 general2->setLabel(QObject::tr("Playback group settings for ") + 4187 settings->mGroupName + " - " + 4188 general2->getLabel()); 4038 4189 4039 4190 HorizontalConfigurationGroup* oscan = 4040 4191 new HorizontalConfigurationGroup(false, false, true, true); … … 4042 4193 new VerticalConfigurationGroup(false, false, true, true); 4043 4194 VerticalConfigurationGroup *ocol2 = 4044 4195 new VerticalConfigurationGroup(false, false, true, true); 4045 ocol1->addChild(VertScanPercentage( ));4046 ocol1->addChild(YScanDisplacement( ));4047 ocol2->addChild(HorizScanPercentage( ));4048 ocol2->addChild(XScanDisplacement( ));4196 ocol1->addChild(VertScanPercentage(settings)); 4197 ocol1->addChild(YScanDisplacement(settings)); 4198 ocol2->addChild(HorizScanPercentage(settings)); 4199 ocol2->addChild(XScanDisplacement(settings)); 4049 4200 oscan->addChild(ocol1); 4050 4201 oscan->addChild(ocol2); 4051 4202 4052 4203 HorizontalConfigurationGroup* aspect_fill = 4053 4204 new HorizontalConfigurationGroup(false, false, true, true); 4054 aspect_fill->addChild(AspectOverride( ));4055 aspect_fill->addChild(AdjustFill( ));4205 aspect_fill->addChild(AspectOverride(settings)); 4206 aspect_fill->addChild(AdjustFill(settings)); 4056 4207 4057 4208 general2->addChild(oscan); 4058 4209 general2->addChild(aspect_fill); 4059 general2->addChild(LetterboxingColour()); 4060 general2->addChild(PIPLocationComboBox()); 4061 general2->addChild(PlaybackExitPrompt()); 4062 general2->addChild(EndOfRecordingExitPrompt()); 4063 addChild(general2); 4210 general2->addChild(LetterboxingColour(settings)); 4211 general2->addChild(PIPLocationComboBox(settings)); 4212 general2->addChild(PlaybackExitPrompt(settings)); 4213 general2->addChild(EndOfRecordingExitPrompt(settings)); 4214 if (base) 4215 base->addChild(general2); 4216 else 4217 addChild(general2); 4064 4218 4065 4219 QString tmp = QString(" (%1/%2)").arg(++i).arg(total); 4066 addChild(new PlaybackProfileConfigs(tmp)); 4220 if (base) 4221 base->addChild(new PlaybackProfileConfigs(tmp, settings)); 4222 else 4223 addChild(new PlaybackProfileConfigs(tmp, settings)); 4067 4224 4225 if (!settings) 4226 { 4068 4227 VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false); 4069 4228 pbox->setLabel(QObject::tr("View Recordings") + 4070 4229 QString(" (%1/%2)").arg(++i).arg(total)); … … 4091 4250 pbox3->addChild(DisplayGroupTitleSort()); 4092 4251 pbox3->addChild(new WatchListSettings()); 4093 4252 addChild(pbox3); 4253 } 4094 4254 4095 4255 VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false); 4096 4256 seek->setLabel(QObject::tr("Seeking") + 4097 4257 QString(" (%1/%2)").arg(++i).arg(total)); 4098 seek->addChild(SmartForward()); 4099 seek->addChild(FFRewReposTime()); 4100 seek->addChild(FFRewReverse()); 4101 seek->addChild(ExactSeeking()); 4102 addChild(seek); 4258 if (settings) 4259 seek->setLabel(QObject::tr("Playback group settings for ") + 4260 settings->mGroupName + " - " + 4261 seek->getLabel()); 4262 seek->addChild(SmartForward(settings)); 4263 seek->addChild(FFRewReposTime(settings)); 4264 seek->addChild(FFRewReverse(settings)); 4265 seek->addChild(ExactSeeking(settings)); 4266 if (base) 4267 base->addChild(seek); 4268 else 4269 addChild(seek); 4103 4270 4104 4271 VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false); 4105 4272 comms->setLabel(QObject::tr("Commercial Skip") + 4106 4273 QString(" (%1/%2)").arg(++i).arg(total)); 4107 comms->addChild(AutoCommercialSkip()); 4108 comms->addChild(CommRewindAmount()); 4109 comms->addChild(CommNotifyAmount()); 4274 if (settings) 4275 comms->setLabel(QObject::tr("Playback group settings for ") + 4276 settings->mGroupName + " - " + 4277 comms->getLabel()); 4278 comms->addChild(AutoCommercialSkip(settings)); 4279 comms->addChild(CommRewindAmount(settings)); 4280 comms->addChild(CommNotifyAmount(settings)); 4281 if (!settings) // these are global settings, not host-specific 4282 { 4110 4283 comms->addChild(MaximumCommercialSkip()); 4111 4284 comms->addChild(MergeShortCommBreaks()); 4112 4285 comms->addChild(CommSkipAllBlanks()); 4113 addChild(comms); 4286 } 4287 if (base) 4288 base->addChild(comms); 4289 else 4290 addChild(comms); 4114 4291 4115 4292 #if CONFIG_DARWIN 4116 4293 VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false); 4117 4294 mac1->setLabel(QObject::tr("Mac OS X Video Settings") + 4118 4295 QString(" (%1/%2)").arg(++i).arg(total)); 4296 if (settings) 4297 mac1->setLabel(QObject::tr("Playback group settings for ") + 4298 settings->mGroupName + " - " + 4299 mac1->getLabel()); 4300 if (!settings) 4301 { 4119 4302 mac1->addChild(MacGammaCorrect()); 4120 4303 mac1->addChild(MacScaleUp()); 4121 4304 mac1->addChild(MacFullSkip()); 4122 addChild(mac1); 4305 } 4306 if (base) 4307 base->addChild(mac1); 4308 else 4309 addChild(mac1); 4123 4310 4124 4311 VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false); 4125 4312 mac2->setLabel(QObject::tr("Mac OS X Video Settings") + 4126 4313 QString(" (%1/%2)").arg(++i).arg(total)); 4314 if (settings) 4315 mac2->setLabel(QObject::tr("Playback group settings for ") + 4316 settings->mGroupName + " - " + 4317 mac2->getLabel()); 4318 if (!setings) 4319 { 4127 4320 mac2->addChild(new MacMainSettings()); 4128 4321 mac2->addChild(new MacFloatSettings()); 4129 4322 … … 4137 4330 #endif 4138 4331 } 4139 4332 4140 OSDSettings::OSDSettings() 4333 OSDSettings::OSDSettings(PlaySettings *settings, 4334 ConfigurationWizard *base) 4141 4335 { 4142 4336 VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false); 4143 4337 osd->setLabel(QObject::tr("On-screen Display")); 4338 if (settings) 4339 osd->setLabel(QObject::tr("Playback group settings for ") + 4340 settings->mGroupName + " - " + 4341 osd->getLabel()); 4144 4342 4145 osd->addChild(EnableMHEG()); 4146 osd->addChild(PersistentBrowseMode()); 4147 osd->addChild(BrowseAllTuners()); 4148 osd->addChild(CCBackground()); 4149 osd->addChild(DefaultCCMode()); 4150 osd->addChild(PreferCC708()); 4343 if (!settings) 4344 { 4345 osd->addChild(EnableMHEG(settings)); 4346 osd->addChild(PersistentBrowseMode(settings)); 4347 osd->addChild(BrowseAllTuners(settings)); 4348 } 4349 osd->addChild(CCBackground(settings)); 4350 osd->addChild(DefaultCCMode(settings)); 4351 osd->addChild(PreferCC708(settings)); 4352 if (!settings) 4151 4353 osd->addChild(SubtitleFont()); 4152 osd->addChild(OSDCC708TextZoomPercentage()); 4153 osd->addChild(SubtitleCodec()); 4154 //osd->addChild(UDPNotifyPort()); 4155 addChild(osd); 4354 osd->addChild(OSDCC708TextZoomPercentage(settings)); 4355 osd->addChild(SubtitleCodec(settings)); 4356 //osd->addChild(UDPNotifyPort(settings)); 4357 if (base) 4358 base->addChild(osd); 4359 else 4360 addChild(osd); 4156 4361 4157 4362 //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false); 4158 4363 //cc->setLabel(QObject::tr("Closed Captions")); -
programs/mythfrontend/main.cpp
36 36 #include "globalsettings.h" 37 37 #include "profilegroup.h" 38 38 #include "playgroup.h" 39 #include "playsettings.h" 39 40 #include "networkcontrol.h" 40 41 #include "DVDRingBuffer.h" 41 42 #include "scheduledrecording.h" … … 480 481 delete statusbox; 481 482 } 482 483 484 ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 485 { 486 return new PlaybackSettings(settings, base); 487 } 488 489 ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 490 { 491 return new OSDSettings(settings, base); 492 } 493 494 ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 495 { 496 return new MainGeneralSettings(settings, base); 497 } 498 499 static PlayGroupEditor::SettingsLookup pbgroupSetup[] = { 500 createPlaybackSettingsForPlaybackGroup, 501 createOSDSettingsForPlaybackGroup, 502 createMainGeneralSettingsForPlaybackGroup 503 }; 504 483 505 static void TVMenuCallback(void *data, QString &selection) 484 506 { 485 507 (void)data; … … 578 600 } 579 601 else if (sel == "settings playgroup") 580 602 { 581 PlayGroupEditor editor; 603 PlayGroupEditor editor(pbgroupSetup, 604 sizeof(pbgroupSetup)/sizeof(*pbgroupSetup)); 582 605 editor.exec(); 583 606 } 584 607 else if (sel == "settings general") … … 770 793 } 771 794 } 772 795 delete tmprbuf; 796 pginfo->SetPlaybackGroup("Videos"); 773 797 } 774 798 else if (pginfo->IsVideo()) 799 { 775 800 pos = pginfo->QueryBookmark(); 801 pginfo->SetPlaybackGroup("Videos"); 802 } 776 803 777 804 if (pos > 0) 778 805 { -
programs/mythfrontend/globalsettings.h
13 13 14 14 class QFileInfo; 15 15 class AudioDeviceComboBox; 16 class PlaySettings; 16 17 17 18 class AudioConfigSettings : public VerticalConfigurationGroup 18 19 { … … 90 91 class PlaybackSettings : public ConfigurationWizard 91 92 { 92 93 public: 93 PlaybackSettings(); 94 PlaybackSettings(PlaySettings *settings=NULL, 95 ConfigurationWizard *base=NULL); 94 96 }; 95 97 96 98 class OSDSettings: virtual public ConfigurationWizard 97 99 { 98 100 public: 99 OSDSettings(); 101 OSDSettings(PlaySettings *settings=NULL, 102 ConfigurationWizard *base=NULL); 100 103 }; 101 104 102 105 class GeneralSettings : public ConfigurationWizard … … 120 123 class MainGeneralSettings : public ConfigurationWizard 121 124 { 122 125 public: 123 MainGeneralSettings(); 126 MainGeneralSettings(PlaySettings *settings=NULL, 127 ConfigurationWizard *base=NULL); 124 128 }; 125 129 126 130 class GeneralRecPrioritiesSettings : public ConfigurationWizard … … 208 212 Q_OBJECT 209 213 210 214 public: 211 PlaybackProfileConfigs(const QString &str );215 PlaybackProfileConfigs(const QString &str, PlaySettings *settings); 212 216 virtual ~PlaybackProfileConfigs(); 213 217 214 218 private: … … 220 224 221 225 private: 222 226 QStringList profiles; 223 HostComboBox*grouptrigger;227 ComboBoxSetting *grouptrigger; 224 228 }; 225 229 226 230 #endif -
programs/mythavtest/main.cpp
18 18 #include "mythdbcon.h" 19 19 #include "compat.h" 20 20 #include "dbcheck.h" 21 #include "playsettings.h" 21 22 22 23 // libmythui 23 24 #include "mythuihelper.h" … … 188 189 189 190 GetMythUI()->LoadQtConfig(); 190 191 191 #if defined(Q_OS_MACX)192 // Mac OS X doesn't define the AudioOutputDevice setting193 #else194 QString auddevice = gCoreContext->GetSetting("AudioOutputDevice");195 if (auddevice.isEmpty())196 {197 VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "198 "to run 'mythfrontend', not 'mythtv'.");199 return TV_EXIT_NO_AUDIO;200 }201 #endif202 203 192 MythMainWindow *mainWindow = GetMythMainWindow(); 204 193 mainWindow->Init(); 205 194 … … 212 201 return GENERIC_EXIT_DB_OUTOFDATE; 213 202 } 214 203 215 TV *tv = new TV(); 204 QString playgroup(""); 205 if (!filename.isEmpty()) 206 { 207 ProgramInfo pg(filename); 208 playgroup = pg.GetPlaybackGroup(); 209 } 210 PlaySettings settings(playgroup); 211 212 #if defined(Q_OS_MACX) 213 // Mac OS X doesn't define the AudioOutputDevice setting 214 #else 215 QString auddevice = settings.GetSetting("AudioOutputDevice", ""); 216 if (auddevice.isEmpty()) 217 { 218 VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need " 219 "to run 'mythfrontend', not 'mythtv'."); 220 return TV_EXIT_NO_AUDIO; 221 } 222 #endif 223 224 TV *tv = new TV(&settings); 216 225 if (!tv->Init()) 217 226 { 218 227 VERBOSE(VB_IMPORTANT, "Fatal Error: Could not initialize TV class.");