Ticket #8088: 8088_playgroups_v13.patch
File 8088_playgroups_v13.patch, 125.0 KB (added by , 14 years ago) |
---|
-
libs/libmythtv/videoout_vdpau.h
20 20 { 21 21 public: 22 22 static void GetRenderOptions(render_opts &opts); 23 VideoOutputVDPAU( MythCodecID codec_id);23 VideoOutputVDPAU(PlaySettings *settings, MythCodecID codec_id); 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, WId embedid = 0); … … 53 53 const QSize &video_dim); 54 54 static MythCodecID GetBestSupportedCodec(uint width, uint height, 55 55 uint stream_type, 56 bool no_acceleration); 56 bool no_acceleration, 57 PlaySettings *settings); 57 58 DisplayInfo GetDisplayInfo(void); 58 59 virtual bool IsPIPSupported(void) const { return true; } 59 60 virtual bool IsPBPSupported(void) const { return false; } -
libs/libmythtv/NuppelVideoPlayer.cpp
61 61 #include "mythpainter.h" 62 62 #include "mythimage.h" 63 63 #include "mythuiimage.h" 64 #include "playsettings.h" 64 65 65 66 extern "C" { 66 67 #include "vbitext/vbi.h" … … 243 244 output_jmeter(NULL) 244 245 { 245 246 playerThread = QThread::currentThread(); 246 // Playback (output) zoom control247 detect_letter_box = new DetectLetterbox(this);248 247 249 vbimode = VBIMode::Parse(gCoreContext->GetSetting("VbiFormat"));250 decode_extra_audio = gCoreContext->GetNumSetting("DecodeExtraAudio", 0);251 itvEnabled = gCoreContext->GetNumSetting("EnableMHEG", 0);252 db_prefer708 = gCoreContext->GetNumSetting("Prefer708Captions", 1);253 254 248 bzero(&tc_lastval, sizeof(tc_lastval)); 255 249 bzero(&tc_wrap, sizeof(tc_wrap)); 256 250 … … 476 470 477 471 if (using_null_videoout) 478 472 { 479 videoOutput = new VideoOutputNull( );473 videoOutput = new VideoOutputNull(GetPlaySettings()); 480 474 if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(), 481 475 video_aspect, 0, 0, 0, 0, 0, 0)) 482 476 { … … 526 520 pipState, 527 521 video_disp_dim, video_aspect, 528 522 widget->winId(), display_rect, (video_frame_rate * play_speed), 529 0 /*embedid*/ );523 0 /*embedid*/, GetPlaySettings()); 530 524 } 531 525 532 526 if (!videoOutput) … … 609 603 610 604 void NuppelVideoPlayer::ReinitVideo(void) 611 605 { 612 if (!videoOutput->IsPreferredRenderer(video_disp_dim ))606 if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings())) 613 607 { 614 608 VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer.")); 615 609 SetErrored(QObject::tr("Need to switch video renderer.")); … … 1934 1928 } 1935 1929 #endif // USING_MHEG 1936 1930 1937 SetCaptionsEnabled(gCoreContext->GetNumSetting("DefaultCCMode"), false); 1931 SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0), 1932 false); 1938 1933 } 1939 1934 1940 1935 SetPlaying(true); … … 1982 1977 m_double_process = videoOutput->IsExtraProcessingRequired(); 1983 1978 1984 1979 videosync = VideoSync::BestMethod( 1985 videoOutput, fr_int, rf_int, m_double_framerate); 1980 videoOutput, GetPlaySettings(), 1981 fr_int, rf_int, m_double_framerate); 1986 1982 1987 1983 // Make sure video sync can do it 1988 1984 if (videosync != NULL && m_double_framerate) … … 2528 2524 { 2529 2525 if (jumpto == totalFrames) 2530 2526 { 2531 if (!( gCoreContext->GetNumSetting("EndOfRecordingExitPrompt") == 12527 if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1 2532 2528 && !player_ctx->IsPIP() && 2533 2529 player_ctx->GetState() == kState_WatchingPreRecorded)) 2534 2530 { … … 2605 2601 if (bookmarkseek > 30) 2606 2602 { 2607 2603 DoFastForward(bookmarkseek, true, false); 2608 if ( gCoreContext->GetNumSetting("ClearSavedPosition", 1) &&2604 if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) && 2609 2605 !player_ctx->IsPIP()) 2610 2606 { 2611 2607 ClearBookmark(false); … … 2796 2792 return kPIP_END; 2797 2793 2798 2794 if (pip_players.isEmpty()) 2799 return (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft); 2795 return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation", 2796 kPIPTopLeft); 2800 2797 2801 2798 // order of preference, could be stored in db if we want it configurable 2802 2799 PIPLocation ols[] = … … 3305 3302 exactseeks = frame_exact_seek; 3306 3303 player_ctx = ctx; 3307 3304 livetv = ctx->tvchain; 3305 3306 vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", "")); 3307 3308 // Playback (output) zoom control 3309 detect_letter_box = new DetectLetterbox(this); 3310 3311 decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0); 3312 itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0); 3313 db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1); 3308 3314 } 3309 3315 3310 3316 bool NuppelVideoPlayer::EnableEdit(void) -
libs/libmythtv/subtitlereader.h
32 32 33 33 TextSubtitles* GetTextSubtitles(void) { return &m_TextSubtitles; } 34 34 bool HasTextSubtitles(void); 35 bool LoadExternalSubtitles(const QString &videoFile );35 bool LoadExternalSubtitles(const QString &videoFile, PlaySettings *settings); 36 36 37 37 private: 38 38 AVSubtitles m_AVSubtitles; -
libs/libmythtv/videooutwindow.cpp
29 29 30 30 #include "videooutwindow.h" 31 31 #include "osd.h" 32 #include "playsettings.h" 32 33 #include "NuppelVideoPlayer.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), … … 84 85 85 86 // Various state variables 86 87 embedding(false), needrepaint(false), 87 allowpreviewepg(true), pip_state(kPIPOff) 88 allowpreviewepg(true), pip_state(kPIPOff), 89 90 settings(_settings) 88 91 { 89 92 db_pip_size = gCoreContext->GetNumSetting("PIPSize", 26); 90 93 91 db_move = QPoint( gCoreContext->GetNumSetting("xScanDisplacement", 0),92 gCoreContext->GetNumSetting("yScanDisplacement", 0));94 db_move = QPoint(settings->GetNumSetting("xScanDisplacement", 0), 95 settings->GetNumSetting("yScanDisplacement", 0)); 93 96 db_use_gui_size = gCoreContext->GetNumSetting("GuiSizeForTV", 0); 94 97 95 98 QDesktopWidget *desktop = NULL; … … 612 615 if (change) 613 616 { 614 617 db_scale_vert = 615 gCoreContext->GetNumSetting("VertScanPercentage", 0) * 0.01f;618 settings->GetNumSetting("VertScanPercentage", 0) * 0.01f; 616 619 db_scale_horiz = 617 gCoreContext->GetNumSetting("HorizScanPercentage", 0) * 0.01f;620 settings->GetNumSetting("HorizScanPercentage", 0) * 0.01f; 618 621 db_scaling_allowed = true; 619 622 } 620 623 else -
libs/libmythtv/videoout_d3d.cpp
51 51 opts.priorities->insert("direct3d", 55); 52 52 } 53 53 54 VideoOutputD3D::VideoOutputD3D( void)55 : VideoOutput( ),m_lock(QMutex::Recursive),54 VideoOutputD3D::VideoOutputD3D(PlaySettigns *settings) 55 : VideoOutput(settings), m_lock(QMutex::Recursive), 56 56 m_hWnd(NULL), m_render(NULL), 57 57 m_video(NULL), 58 58 m_render_valid(false), m_render_reset(false), -
libs/libmythtv/DetectLetterbox.cpp
5 5 #include "NuppelVideoPlayer.h" 6 6 #include "videoouttypes.h" 7 7 #include "mythcorecontext.h" 8 #include "playsettings.h" 8 9 9 10 DetectLetterbox::DetectLetterbox(NuppelVideoPlayer* const nvp) 10 11 { 11 int dbAdjustFill = gCoreContext->GetNumSetting("AdjustFill", 0);12 int dbAdjustFill = nvp->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 = nvp->GetAdjustFill(); 21 detectLetterboxLimit = gCoreContext->GetNumSetting("DetectLeterboxLimit", 75); 22 detectLetterboxLimit = 23 nvp->GetPlaySettings()->GetNumSetting("DetectLeterboxLimit", 75); 22 24 nupple_video_player = nvp; 23 25 } 24 26 -
libs/libmythtv/videoout_opengl.cpp
37 37 opts.priorities->insert("opengl", 65); 38 38 } 39 39 40 VideoOutputOpenGL::VideoOutputOpenGL( void)41 : VideoOutput( ),40 VideoOutputOpenGL::VideoOutputOpenGL(PlaySettings *settings) 41 : VideoOutput(settings), 42 42 gl_context_lock(QMutex::Recursive), 43 43 gl_context(NULL), gl_videochain(NULL), gl_pipchain_active(NULL), 44 44 gl_parent_win(0), gl_embed_win(0), gl_painter(NULL) -
libs/libmythtv/videoout_quartz.cpp
64 64 #include "videodisplayprofile.h" 65 65 #include "videoout_dvdv.h" 66 66 67 class PlaySettings; 68 67 69 #define LOC QString("VideoOutputQuartz::") 68 70 #define LOC_ERR QString("VideoOutputQuartz Error: ") 69 71 … … 1107 1109 /** \class VideoOutputQuartz 1108 1110 * \brief Implementation of Quartz (Mac OS X windowing system) video output 1109 1111 */ 1110 VideoOutputQuartz::VideoOutputQuartz( 1112 VideoOutputQuartz::VideoOutputQuartz(PlaySettings *settings 1111 1113 MythCodecID _myth_codec_id, void *codec_priv) : 1112 VideoOutput( ), Started(false), data(new QuartzData()),1114 VideoOutput(settings), Started(false), data(new QuartzData()), 1113 1115 myth_codec_id(_myth_codec_id) 1114 1116 { 1115 1117 init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0); … … 1817 1819 MythCodecID VideoOutputQuartz::GetBestSupportedCodec( 1818 1820 uint width, uint height, 1819 1821 uint osd_width, uint osd_height, 1820 uint stream_type, uint fourcc )1822 uint stream_type, uint fourcc, PlaySettings *settings) 1821 1823 { 1822 1824 (void) osd_width; 1823 1825 (void) osd_height; 1824 1826 1825 VideoDisplayProfile vdp ;1827 VideoDisplayProfile vdp(settings); 1826 1828 vdp.SetInput(QSize(width, height)); 1827 1829 QString dec = vdp.GetDecoder(); 1828 1830 if ((dec == "libmpeg2") || (dec == "ffmpeg")) -
libs/libmythtv/avformatdecoder.cpp
29 29 #include "DVDRingBuffer.h" 30 30 #include "videodisplayprofile.h" 31 31 #include "mythuihelper.h" 32 #include "playsettings.h" 32 33 33 34 #include "lcddevice.h" 34 35 … … 536 537 537 538 cc608_build_parity_table(cc608_parity_table); 538 539 539 if ( gCoreContext->GetNumSetting("CCBackground", 0))540 if (GetNVP()->GetPlaySettings()->GetNumSetting("CCBackground", 0)) 540 541 CC708Window::forceWhiteOnBlackText = true; 541 542 542 543 no_dts_hack = false; … … 1438 1439 { 1439 1440 directrendering = true; 1440 1441 if ( 1441 ! gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&1442 !GetNVP()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) && 1442 1443 !CODEC_IS_HWACCEL(codec)) 1443 1444 { 1444 1445 SetLowBuffers(false); … … 1918 1919 1919 1920 if (!is_db_ignored) 1920 1921 { 1921 VideoDisplayProfile vdp ;1922 VideoDisplayProfile vdp(GetNVP()->GetPlaySettings()); 1922 1923 vdp.SetInput(QSize(width, height)); 1923 1924 dec = vdp.GetDecoder(); 1924 1925 thread_count = vdp.GetMaxCPUs(); … … 1946 1947 MythCodecID vdpau_mcid; 1947 1948 vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec( 1948 1949 width, height, 1949 mpeg_version(enc->codec_id), no_hardware_decoders); 1950 mpeg_version(enc->codec_id), no_hardware_decoders, 1951 GetNVP()->GetPlaySettings()); 1950 1952 1951 1953 if (vdpau_mcid >= video_codec_id) 1952 1954 { … … 1978 1980 /* mpeg type */ mpeg_version(enc->codec_id), 1979 1981 /* xvmc pix fmt */ xvmc_pixel_format(enc->pix_fmt), 1980 1982 /* test surface */ codec_is_std(video_codec_id), 1981 /* force_xv */ force_xv); 1983 /* force_xv */ force_xv, 1984 GetNVP()->GetPlaySettings()); 1982 1985 1983 1986 if (mcid >= video_codec_id) 1984 1987 { … … 2011 2014 /* osd dim */ 0, 0, 2012 2015 /* mpeg type */ mpeg_version(enc->codec_id), 2013 2016 /* pixel format */ 2014 (PIX_FMT_YUV420P == enc->pix_fmt) ? FOURCC_I420 : 0); 2017 (PIX_FMT_YUV420P == enc->pix_fmt) ? FOURCC_I420 : 0, 2018 GetNVP()->GetPlaySettings()); 2015 2019 2016 2020 if (quartz_mcid >= video_codec_id) 2017 2021 { -
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 ~VideoOutputOpenGL(); 15 15 16 16 bool Init(int width, int height, float aspect, WId winid, -
libs/libmythtv/tv_play.h
56 56 class OSDListTreeItemEnteredEvent; 57 57 class OSDListTreeItemSelectedEvent; 58 58 struct osdInfo; 59 class PlaySettings; 59 60 60 61 typedef QMap<QString,InfoMap> DDValueMap; 61 62 typedef QMap<QString,DDValueMap> DDKeyMap; … … 179 180 unsigned long seconds; 180 181 }; 181 182 182 TV( void);183 TV(PlaySettings *settings); 183 184 ~TV(); 184 185 185 186 bool Init(bool createWindow = true); … … 204 205 205 206 // Recording commands 206 207 int PlayFromRecorder(int recordernum); 207 int Playback(const ProgramInfo &rcinfo );208 int Playback(const ProgramInfo &rcinfo, PlaySettings *settings); 208 209 209 210 // Commands used by frontend playback box 210 211 QString GetRecordingGroup(int player_idx) const; … … 644 645 static TVState RemoveRecording(TVState state); 645 646 void RestoreScreenSaver(const PlayerContext*); 646 647 647 void InitUDPNotifyEvent( void);648 void InitUDPNotifyEvent(PlaySettings *settings); 648 649 649 650 // for temp debugging only.. 650 651 int find_player_index(const PlayerContext*) 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
3561 3561 3562 3562 VideoDisplayProfile::CreateNewProfiles(host); 3563 3563 profiles = VideoDisplayProfile::GetProfiles(host); 3564 QString profile = VideoDisplayProfile::GetDefaultProfileName(host); 3564 QString profile = 3565 VideoDisplayProfile::GetDefaultProfileName(host, NULL); 3565 3566 3566 3567 if (profiles.contains("Normal") && 3567 3568 (profile=="CPU++" || profile=="CPU+" || profile=="CPU--")) … … 5799 5800 " jump int(11) NOT NULL default '0'," 5800 5801 " PRIMARY KEY (`name`)" 5801 5802 ");", 5803 "CREATE TABLE playgroupsettings (" 5804 " playgroupname varchar(64) NOT NULL," 5805 " `value` varchar(128) NOT NULL," 5806 " `data` text," 5807 " overridden tinyint(1) NOT NULL," 5808 " PRIMARY KEY (playgroupname, `value`)" 5809 ");", 5802 5810 "CREATE TABLE powerpriority (" 5803 5811 " priorityname varchar(64) collate utf8_bin NOT NULL," 5804 5812 " recpriority int(10) NOT NULL default '0'," -
libs/libmythtv/videoout_vdpau.cpp
48 48 opts.deints->insert("vdpau", deints); 49 49 } 50 50 51 VideoOutputVDPAU::VideoOutputVDPAU( MythCodecID codec_id)52 : VideoOutput( ),51 VideoOutputVDPAU::VideoOutputVDPAU(PlaySettings *settings, MythCodecID codec_id) 52 : VideoOutput(settings), 53 53 m_codec_id(codec_id), 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), … … 870 870 871 871 MythCodecID VideoOutputVDPAU::GetBestSupportedCodec( 872 872 uint width, uint height, 873 uint stream_type, bool no_acceleration )873 uint stream_type, bool no_acceleration, PlaySettings *settings) 874 874 { 875 875 bool use_cpu = no_acceleration; 876 VideoDisplayProfile vdp ;876 VideoDisplayProfile vdp(settings); 877 877 vdp.SetInput(QSize(width, height)); 878 878 QString dec = vdp.GetDecoder(); 879 879 -
libs/libmythtv/videoout_directfb.cpp
274 274 opts.priorities->insert("directfb", 60); 275 275 } 276 276 277 VideoOutputDirectfb::VideoOutputDirectfb( void)278 : VideoOutput( ), XJ_started(false), widget(NULL),277 VideoOutputDirectfb::VideoOutputDirectfb(PlaySettings *settings) 278 : VideoOutput(settings), XJ_started(false), widget(NULL), 279 279 data(new DirectfbData()) 280 280 { 281 281 init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0); -
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
17 17 #include "storagegroup.h" 18 18 #include "mythcorecontext.h" 19 19 #include "videometadatautil.h" 20 #include "DetectLetterbox.h" 21 #include "playsettings.h" 20 22 21 23 #define LOC QString("playCtx: ") 22 24 #define LOC_ERR QString("playCtx, Error: ") … … 404 406 WId embedwinid, const QRect *embedbounds, 405 407 bool muted) 406 408 { 407 int exact_seeking = gCoreContext->GetNumSetting("ExactSeeking", 0);409 int exact_seeking = settings->GetNumSetting("ExactSeeking", 0); 408 410 409 411 if (HasNVP()) 410 412 { … … 447 449 { 448 450 QString subfn = buffer->GetSubtitleFilename(); 449 451 if (!subfn.isEmpty() && _nvp->GetSubReader()) 450 _nvp->GetSubReader()->LoadExternalSubtitles(subfn );452 _nvp->GetSubReader()->LoadExternalSubtitles(subfn, settings); 451 453 } 452 454 453 455 if ((embedwinid > 0) && embedbounds) … … 888 890 /** 889 891 * \brief assign programinfo to the context 890 892 */ 891 void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 893 void PlayerContext::SetPlayingInfo(const ProgramInfo *info, 894 PlaySettings *_settings) 892 895 { 893 896 bool ignoreDB = gCoreContext->IsDatabaseIgnored(); 894 897 … … 900 903 playingInfo->MarkAsInUse(false, recUsage); 901 904 delete playingInfo; 902 905 playingInfo = NULL; 906 // XXX delete settings? 903 907 } 904 908 905 909 if (info) … … 908 912 if (!ignoreDB) 909 913 playingInfo->MarkAsInUse(true, recUsage); 910 914 playingLen = playingInfo->GetSecondsInRecording(); 915 settings = (_settings ? _settings : 916 new PlaySettings(playingInfo->GetPlaybackGroup())); 911 917 } 912 918 } 913 919 -
libs/libmythtv/NuppelVideoPlayer.h
213 213 QString GetXDS(const QString &key) const; 214 214 PIPLocation GetNextPIPLocation(void) const; 215 215 216 PlaySettings *GetPlaySettings(void) const { 217 return player_ctx ? player_ctx->settings : NULL; 218 } 219 216 220 // Bool Gets 217 221 bool GetRawAudioState(void) const; 218 222 bool GetLimitKeyRepeat(void) const { return limitKeyRepeat; } -
libs/libmythtv/subtitlereader.cpp
50 50 m_AVSubtitles.lock.unlock(); 51 51 } 52 52 53 bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName) 53 bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName, 54 PlaySettings *settings) 54 55 { 55 56 m_TextSubtitles.Clear(); 56 return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles); 57 return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles, 58 settings); 57 59 } 58 60 59 61 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 { 84 86 VideoSync *trial = NULL; 85 87 tryingVideoSync = true; 86 bool tryOpenGL = ( gCoreContext->GetNumSetting("UseOpenGLVSync", 1) &&88 bool tryOpenGL = (settings->GetNumSetting("UseOpenGLVSync", 1) && 87 89 (getenv("NO_OPENGL_VSYNC") == NULL)); 88 90 89 91 // m_forceskip allows for skipping one sync method -
libs/libmythtv/tv_play.cpp
59 59 #include "mythsystemevent.h" 60 60 #include "videometadatautil.h" 61 61 #include "mythdialogbox.h" 62 #include "playsettings.h" 62 63 63 64 #if ! HAVE_ROUND 64 65 #define round(x) ((int) ((x) + 0.5)) … … 209 210 bool startInGuide = flags & kStartTVInGuide; 210 211 bool inPlaylist = flags & kStartTVInPlayList; 211 212 bool initByNetworkCommand = flags & kStartTVByNetworkCommand; 212 TV *tv = new TV();213 213 bool quitAll = false; 214 214 bool showDialogs = true; 215 215 bool playCompleted = false; … … 223 223 curProgram->SetIgnoreBookmark(flags & kStartTVIgnoreBookmark); 224 224 } 225 225 226 PlaySettings settings(curProgram ? curProgram->GetPlaybackGroup() : "Default"); 227 TV *tv = new TV(&settings); 228 226 229 // Initialize TV 227 230 if (!tv->Init()) 228 231 { … … 253 256 if (curProgram) 254 257 { 255 258 VERBOSE(VB_PLAYBACK, LOC + "tv->Playback() -- begin"); 256 if (!tv->Playback(*curProgram ))259 if (!tv->Playback(*curProgram, &settings)) 257 260 { 258 261 quitAll = true; 259 262 } … … 838 841 * \brief Performs instance initialiation not requiring access to database. 839 842 * \sa Init(void) 840 843 */ 841 TV::TV( void)844 TV::TV(PlaySettings *settings) 842 845 : // Configuration variables from database 843 846 baseFilters(""), 844 847 db_channel_format("<num> <sign>"), … … 974 977 kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]); 975 978 976 979 MythDB::getMythDB()->GetSettings(kv); 980 settings->AddToMap(kv); 977 981 978 982 // convert from minutes to ms. 979 983 db_idle_timeout = kv["LiveTVIdleTimeout"].toInt() * 60 * 1000; … … 1711 1715 askAllowLock.unlock(); 1712 1716 } 1713 1717 1714 int TV::Playback(const ProgramInfo &rcinfo )1718 int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings) 1715 1719 { 1716 1720 wantsToQuit = false; 1717 1721 jumpToProgram = false; … … 1725 1729 return 0; 1726 1730 } 1727 1731 1728 mctx->SetPlayingInfo(&rcinfo );1732 mctx->SetPlayingInfo(&rcinfo, settings); 1729 1733 mctx->SetInitialTVState(false); 1730 1734 ScheduleStateChange(mctx); 1731 1735 … … 1808 1812 1809 1813 if (fileexists) 1810 1814 { 1811 Playback(pginfo); 1815 PlaySettings settings("Default"); 1816 Playback(pginfo, &settings); 1812 1817 retval = 1; 1813 1818 } 1814 1819 … … 2139 2144 QString msg = tr("%1 Settings") 2140 2145 .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup())); 2141 2146 ctx->UnlockPlayingInfo(__FILE__, __LINE__); 2142 if (count > 0) 2147 if (count > 0 && 2148 ctx->playingInfo->GetPlaybackGroup() != "Default" && 2149 ctx->playingInfo->GetPlaybackGroup() != "Videos") 2143 2150 SetOSDMessage(ctx, msg); 2144 2151 ITVRestart(ctx, false); 2145 2152 } … … 4880 4887 return false; 4881 4888 } 4882 4889 4883 InitUDPNotifyEvent( );4890 InitUDPNotifyEvent(ctx->settings); 4884 4891 bool ok = false; 4885 4892 if (ctx->IsNullVideoDesired()) 4886 4893 { … … 11715 11722 GetMythUI()->RestoreScreensaver(); 11716 11723 } 11717 11724 11718 void TV::InitUDPNotifyEvent( void)11725 void TV::InitUDPNotifyEvent(PlaySettings *settings) 11719 11726 { 11720 11727 if (db_udpnotify_port && !udpnotify) 11721 11728 { 11722 udpnotify = new UDPNotify(db_udpnotify_port );11729 udpnotify = new UDPNotify(db_udpnotify_port, settings); 11723 11730 connect(udpnotify, 11724 11731 SIGNAL(AddUDPNotifyEvent( 11725 11732 const QString&,const UDPNotifyOSDSet*)), -
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
27 27 opts.priorities->insert("null", 10); 28 28 } 29 29 30 VideoOutputNull::VideoOutputNull( void) :31 VideoOutput( ), global_lock(QMutex::Recursive)30 VideoOutputNull::VideoOutputNull(PlaySettings *settings) : 31 VideoOutput(settings), global_lock(QMutex::Recursive) 32 32 { 33 33 VERBOSE(VB_PLAYBACK, "VideoOutputNull()"); 34 34 memset(&av_pause_frame, 0, sizeof(av_pause_frame)); -
libs/libmythtv/videooutbase.cpp
7 7 #include "NuppelVideoPlayer.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 Q_OS_MACX 194 196 if (osxlist.contains(renderer)) 195 vo = new VideoOutputQuartz( codec_id, codec_priv);197 vo = new VideoOutputQuartz(settings, codec_id, codec_priv); 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( codec_id);207 vo = new VideoOutputVDPAU(settings, codec_id); 206 208 #endif // USING_VDPAU 207 209 208 210 #ifdef USING_XV 209 211 if (xvlist.contains(renderer)) 210 vo = new VideoOutputXv( codec_id);212 vo = new VideoOutputXv(settings, codec_id); 211 213 #endif // USING_XV 212 214 213 215 if (vo) … … 304 306 * \brief This constructor for VideoOutput must be followed by an 305 307 * Init(int,int,float,WId,int,int,int,int,WId) call. 306 308 */ 307 VideoOutput::VideoOutput( ) :309 VideoOutput::VideoOutput(PlaySettings *_settings) : 308 310 // DB Settings 309 311 db_display_dim(0,0), 310 312 db_aspectoverride(kAspect_Off), db_adjustfill(kAdjustFill_Off), … … 341 343 monitor_sz(640,480), monitor_dim(400,300), 342 344 343 345 // OSD 344 osd_painter(NULL), osd_image(NULL) 346 osd_painter(NULL), osd_image(NULL), 347 settings(_settings) 345 348 346 349 { 347 350 bzero(&pip_tmp_image, sizeof(pip_tmp_image)); 348 db_display_dim = QSize( gCoreContext->GetNumSetting("DisplaySizeWidth", 0),349 gCoreContext->GetNumSetting("DisplaySizeHeight", 0));351 db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth", 0), 352 settings->GetNumSetting("DisplaySizeHeight", 0)); 350 353 351 354 db_pict_attr[kPictureAttribute_Brightness] = 352 gCoreContext->GetNumSetting("PlaybackBrightness", 50);355 settings->GetNumSetting("PlaybackBrightness", 50); 353 356 db_pict_attr[kPictureAttribute_Contrast] = 354 gCoreContext->GetNumSetting("PlaybackContrast", 50);357 settings->GetNumSetting("PlaybackContrast", 50); 355 358 db_pict_attr[kPictureAttribute_Colour] = 356 gCoreContext->GetNumSetting("PlaybackColour", 50);359 settings->GetNumSetting("PlaybackColour", 50); 357 360 db_pict_attr[kPictureAttribute_Hue] = 358 gCoreContext->GetNumSetting("PlaybackHue", 0);361 settings->GetNumSetting("PlaybackHue", 0); 359 362 360 363 db_aspectoverride = (AspectOverrideMode) 361 gCoreContext->GetNumSetting("AspectOverride", 0);364 settings->GetNumSetting("AspectOverride", 0); 362 365 db_adjustfill = (AdjustFillMode) 363 gCoreContext->GetNumSetting("AdjustFill", 0);366 settings->GetNumSetting("AdjustFill", 0); 364 367 db_letterbox_colour = (LetterBoxColour) 365 gCoreContext->GetNumSetting("LetterboxColour", 0);368 settings->GetNumSetting("LetterboxColour", 0); 366 369 db_use_picture_controls = 367 gCoreContext->GetNumSetting("UseOutputPictureControls", 0);370 settings->GetNumSetting("UseOutputPictureControls", 0); 368 371 369 372 if (!gCoreContext->IsDatabaseIgnored()) 370 db_vdisp_profile = new VideoDisplayProfile( );373 db_vdisp_profile = new VideoDisplayProfile(settings); 371 374 372 windows.push_back(VideoOutWindow( ));375 windows.push_back(VideoOutWindow(settings)); 373 376 } 374 377 375 378 /** … … 443 446 return QString::null; 444 447 } 445 448 446 bool VideoOutput::IsPreferredRenderer(QSize video_size )449 bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings) 447 450 { 448 451 if (!db_vdisp_profile || (video_size == windows[0].GetVideoDispDim())) 449 452 return true; 450 453 451 VideoDisplayProfile vdisp ;454 VideoDisplayProfile vdisp(settings); 452 455 vdisp.SetInput(video_size); 453 456 QString new_rend = vdisp.GetVideoRenderer(); 454 457 if (new_rend.isEmpty()) -
libs/libmythtv/videooutwindow.h
16 16 #include "videoouttypes.h" 17 17 18 18 class NuppelVideoPlayer; 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, … … 162 163 bool allowpreviewepg; 163 164 PIPState pip_state; 164 165 166 PlaySettings *settings; 167 165 168 // Constants 166 169 static const float kManualZoomMaxHorizontalZoom; 167 170 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 { … … 112 113 void SetRecorder(RemoteEncoder *rec); 113 114 void SetTVChain(LiveTVChain *chain); 114 115 void SetRingBuffer(RingBuffer *buf); 115 void SetPlayingInfo(const ProgramInfo *info );116 void SetPlayingInfo(const ProgramInfo *info, PlaySettings *settings=NULL); 116 117 void SetPlayGroup(const QString &group); 117 118 void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state); 118 119 void SetPIPLocation(int loc) { pipLocation = loc; } … … 168 169 LiveTVChain *tvchain; 169 170 RingBuffer *buffer; 170 171 ProgramInfo *playingInfo; ///< Currently playing info 172 PlaySettings *settings; // corresponding to playingInfo 171 173 long long playingLen; ///< Initial CalculateLength() 172 174 bool nohardwaredecoders; // < Disable use of VDPAU decoding 173 175 int last_cardid; ///< CardID of current/last recorder -
libs/libmythtv/vsync.h
101 101 102 102 // documented in vsync.cpp 103 103 static VideoSync *BestMethod(VideoOutput*, 104 PlaySettings *settings, 104 105 uint frame_interval, uint refresh_interval, 105 106 bool interlaced); 106 107 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( MythCodecID av_codec_id);54 VideoOutputXv(PlaySettings *settings, MythCodecID av_codec_id); 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
165 165 * \see VideoOutput, VideoBuffers 166 166 * 167 167 */ 168 VideoOutputXv::VideoOutputXv( MythCodecID codec_id)169 : VideoOutput( ),168 VideoOutputXv::VideoOutputXv(PlaySettings *settings, MythCodecID codec_id) 169 : VideoOutput(settings), 170 170 myth_codec_id(codec_id), video_output_subtype(XVUnknown), 171 171 global_lock(QMutex::Recursive), 172 172 … … 404 404 * \return port number if it succeeds, else -1. 405 405 */ 406 406 int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root, 407 PlaySettings *settings, 407 408 MythCodecID mcodecid, 408 409 uint width, uint height, 409 410 bool &xvsetdefaults, … … 488 489 } 489 490 490 491 // figure out if we want chromakeying.. 491 VideoDisplayProfile vdp ;492 VideoDisplayProfile vdp(settings); 492 493 vdp.SetInput(QSize(width, height)); 493 494 bool check_for_colorkey = (vdp.GetOSDRenderer() == "chromakey"); 494 495 … … 781 782 disp->StartLog(); 782 783 QString adaptor_name = QString::null; 783 784 const QSize video_dim = windows[0].GetVideoDim(); 784 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), mcodecid,785 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, mcodecid, 785 786 video_dim.width(), video_dim.height(), 786 787 xv_set_defaults, 787 788 xvmc_chroma, &xvmc_surf_info, &adaptor_name); … … 860 861 disp->StartLog(); 861 862 QString adaptor_name = QString::null; 862 863 const QSize video_dim = windows[0].GetVideoDim(); 863 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), kCodec_MPEG2,864 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, kCodec_MPEG2, 864 865 video_dim.width(), video_dim.height(), 865 866 xv_set_defaults, 0, NULL, &adaptor_name); 866 867 if (xv_port == -1) … … 1014 1015 uint width, uint height, 1015 1016 uint osd_width, uint osd_height, 1016 1017 uint stream_type, int xvmc_chroma, 1017 bool test_surface, bool force_xv) 1018 bool test_surface, bool force_xv, 1019 PlaySettings *settings) 1018 1020 { 1019 1021 (void)width, (void)height, (void)osd_width, (void)osd_height; 1020 1022 (void)stream_type, (void)xvmc_chroma, (void)test_surface; … … 1025 1027 return ret; 1026 1028 1027 1029 #ifdef USING_XVMC 1028 VideoDisplayProfile vdp ;1030 VideoDisplayProfile vdp(settings); 1029 1031 vdp.SetInput(QSize(width, height)); 1030 1032 QString dec = vdp.GetDecoder(); 1031 1033 if ((dec == "libmpeg2") || (dec == "ffmpeg")) … … 1075 1077 1076 1078 ok = false; 1077 1079 bool dummy; 1078 int port = GrabSuitableXvPort(disp, disp->GetRoot(), ret, width, height, 1080 int port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, 1081 ret, width, height, 1079 1082 dummy, xvmc_chroma, &info); 1080 1083 if (port >= 0) 1081 1084 { -
libs/libmythtv/udpnotify.cpp
31 31 #include "udpnotify.h" 32 32 #include "mythcorecontext.h" 33 33 #include "mythverbose.h" 34 #include "playsettings.h" 34 35 35 36 UDPNotifyOSDSet::UDPNotifyOSDSet(const QString &name, uint timeout) 36 37 : m_name(name), m_timeout(timeout) … … 73 74 74 75 ///////////////////////////////////////////////////////////////////////// 75 76 76 UDPNotify::UDPNotify(uint udp_port ) :77 UDPNotify::UDPNotify(uint udp_port, PlaySettings *settings) : 77 78 m_socket(new QUdpSocket()), m_db_osd_udpnotify_timeout(5) 78 79 { 79 80 connect(m_socket, SIGNAL(readyRead()), … … 81 82 82 83 m_socket->bind(udp_port); 83 84 84 m_db_osd_udpnotify_timeout = gCoreContext->GetNumSetting("OSDNotifyTimeout", 5);85 m_db_osd_udpnotify_timeout = settings->GetNumSetting("OSDNotifyTimeout", 5); 85 86 } 86 87 87 88 void UDPNotify::deleteLater(void) -
libs/libmythtv/videooutbase.h
31 31 class FilterChain; 32 32 class FilterManager; 33 33 class OpenGLContextGLX; 34 class PlaySettings; 34 35 35 36 typedef QMap<NuppelVideoPlayer*,PIPLocation> PIPMap; 36 37 … … 51 52 PIPState pipState, 52 53 const QSize &video_dim, float video_aspect, 53 54 WId win_id, const QRect &display_rect, 54 float video_prate, WId embed_id); 55 float video_prate, WId embed_id, 56 PlaySettings *settings); 55 57 56 VideoOutput( );58 VideoOutput(PlaySettings *settings); 57 59 virtual ~VideoOutput(); 58 60 59 61 virtual bool Init(int width, int height, float aspect, … … 61 63 int winh, WId embedid = 0); 62 64 virtual void InitOSD(OSD *osd); 63 65 virtual void SetVideoFrameRate(float); 64 virtual bool IsPreferredRenderer(QSize video_size );66 virtual bool IsPreferredRenderer(QSize video_size, PlaySettings *settings); 65 67 virtual bool SetDeinterlacingEnabled(bool); 66 68 virtual bool SetupDeinterlace(bool i, const QString& ovrf=""); 67 69 virtual void FallbackDeint(void); … … 337 339 // OSD painter and surface 338 340 MythYUVAPainter *osd_painter; 339 341 MythImage *osd_image; 342 343 PlaySettings *settings; 340 344 }; 341 345 342 346 #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 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: ") … … 62 63 VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-608 reader."); 63 64 if (!m_708reader) 64 65 VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-708 reader."); 65 m_useBackground = (bool) gCoreContext->GetNumSetting("CCBackground", 0);66 m_708fontZoom = gCoreContext->GetNumSetting("OSDCC708TextZoom", 100);66 m_useBackground = (bool)m_player->GetPlaySettings()->GetNumSetting("CCBackground", 0); 67 m_708fontZoom = m_player->GetPlaySettings()->GetNumSetting("OSDCC708TextZoom", 100); 67 68 return true; 68 69 } 69 70 … … 803 804 if (initialised) 804 805 return gTextSubFont; 805 806 807 // XXX JMS: InitialiseFont() is a static method and this code is 808 // executed only once per program execution. Needs some attention 809 // for PlayGroups. 806 810 QString font = gCoreContext->GetSetting("OSDCCFont"); 807 811 808 812 MythFontProperties *mythfont = new MythFontProperties(); … … 829 833 830 834 initialised = true; 831 835 836 // XXX JMS: Initialise708Fonts() is a static method and this code 837 // is executed only once per program execution. Needs some 838 // attention for PlayGroups. 839 832 840 // TODO remove extra fonts from settings page 833 841 QString def = gCoreContext->GetSetting("OSDCC708DefaultFontType", "MonoSerif"); 834 842 QStringList fonts; -
libs/libmythtv/videoout_quartz.h
3 3 4 4 class DVDV; 5 5 struct QuartzData; 6 class PlaySettings; 6 7 7 8 #include "videooutbase.h" 8 9 … … 10 11 { 11 12 public: 12 13 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 13 VideoOutputQuartz(MythCodecID av_codec_id, void *codec_priv); 14 VideoOutputQuartz(PlaySettings *settings, MythCodecID av_codec_id, 15 void *codec_priv); 14 16 ~VideoOutputQuartz(); 15 17 16 18 bool Init(int width, int height, float aspect, WId winid, … … 51 53 static MythCodecID GetBestSupportedCodec( 52 54 uint width, uint height, 53 55 uint osd_width, uint osd_height, 54 uint stream_type, uint fourcc );56 uint stream_type, uint fourcc, PlaySettings *settings); 55 57 virtual bool NeedExtraAudioDecode(void) const 56 58 { return !codec_is_std(myth_codec_id); } 57 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/udpnotify.h
20 20 class QByteArray; 21 21 class QUdpSocket; 22 22 class QDomElement; 23 class PlaySettings; 23 24 24 25 class UDPNotifyOSDSet 25 26 { … … 54 55 Q_OBJECT 55 56 56 57 public: 57 UDPNotify(uint udp_port );58 UDPNotify(uint udp_port, PlaySettings *settings); 58 59 59 60 signals: 60 61 void AddUDPNotifyEvent(const QString &name, const UDPNotifyOSDSet*); -
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 cbwidget->insertItem(label); 739 807 } 740 808 809 if (special_formatting) 810 { 811 changeOnSpecial = true; 812 specialLabel = label; 813 } 814 741 815 SelectSetting::addSelection(label, value, select); 742 816 743 817 if (cbwidget && isSet) … … 934 1008 BooleanSetting::setHelpText(str); 935 1009 } 936 1010 1011 QWidget* TristateCheckBoxSetting::configWidget(ConfigurationGroup *cg, 1012 QWidget* parent, 1013 const char* widgetName) { 1014 widget = new MythCheckBox(parent, widgetName, true); 1015 connect(widget, SIGNAL(destroyed(QObject*)), 1016 this, SLOT(widgetDeleted(QObject*))); 1017 1018 widget->setHelpText(getHelpText()); 1019 widget->setText(getLabel()); 1020 widget->setCheckState(tristateValue()); 1021 setValue(tristateValue()); 1022 1023 connect(widget, SIGNAL(stateChanged(int)), 1024 this, SLOT(setValue(int))); 1025 connect(this, SIGNAL(valueChanged(int)), 1026 this, SLOT(relayValueChanged(int))); 1027 1028 if (cg) 1029 connect(widget, SIGNAL(changeHelpText(QString)), cg, 1030 SIGNAL(changeHelpText(QString))); 1031 1032 return widget; 1033 } 1034 1035 void TristateCheckBoxSetting::widgetInvalid(QObject *obj) 1036 { 1037 widget = (widget == obj) ? NULL : widget; 1038 } 1039 1040 void TristateCheckBoxSetting::setEnabled(bool fEnabled) 1041 { 1042 TristateSetting::setEnabled(fEnabled); 1043 if (widget) 1044 widget->setEnabled(fEnabled); 1045 } 1046 1047 void TristateCheckBoxSetting::setHelpText(const QString &str) 1048 { 1049 if (widget) 1050 widget->setHelpText(str); 1051 TristateSetting::setHelpText(str); 1052 } 1053 1054 const char *TristateSetting::kPartiallyCheckedString = "default"; 1055 1056 void TristateCheckBoxSetting::setValue(int check) 1057 { 1058 adjustFont(widget, (check != Qt::Checked && check != Qt::Unchecked)); 1059 TristateSetting::setValue(check); 1060 emit valueChanged(check); 1061 } 1062 1063 void TristateSetting::setValue(int check) 1064 { 1065 if (check == Qt::Checked) 1066 Setting::setValue("1"); 1067 else if (check == Qt::Unchecked) 1068 Setting::setValue("0"); 1069 else 1070 Setting::setValue(kPartiallyCheckedString); 1071 emit valueChanged(check); 1072 } 1073 937 1074 void AutoIncrementDBSetting::Save(QString table) 938 1075 { 939 1076 if (intValue() == 0) … … 1121 1258 addSelection(label, value, select); 1122 1259 } 1123 1260 1261 void ImageSelectSetting::addDefaultSelection(const QString label, 1262 const QString value, 1263 const QString defaultValue, 1264 bool select) 1265 { 1266 for (unsigned i=0; i<values.size(); i++) 1267 { 1268 if (values[i] == defaultValue) 1269 { 1270 changeOnSpecial = true; 1271 specialLabel = label; 1272 images.push_back(new QImage(*images[i])); 1273 addSelection(label, value, select); 1274 return; 1275 } 1276 } 1277 } 1278 1124 1279 ImageSelectSetting::~ImageSelectSetting() 1125 1280 { 1126 1281 Teardown(); … … 1143 1298 bxwidget = NULL; 1144 1299 imagelabel = NULL; 1145 1300 combo = NULL; 1301 labelWidget = NULL; 1146 1302 } 1147 1303 1148 1304 void ImageSelectSetting::imageSet(int num) … … 1190 1346 QLabel *label = new QLabel(); 1191 1347 label->setText(getLabel() + ":"); 1192 1348 layout->addWidget(label); 1349 labelWidget = label; 1193 1350 } 1194 1351 1195 1352 combo = new MythComboBox(false); … … 1236 1393 connect(combo, SIGNAL(highlighted(int)), this, SLOT(imageSet(int))); 1237 1394 connect(combo, SIGNAL(activated(int)), this, SLOT(setValue(int))); 1238 1395 connect(combo, SIGNAL(activated(int)), this, SLOT(imageSet(int))); 1396 connect(combo, SIGNAL(highlighted(const QString &)), 1397 this, SLOT(changeLabel(const QString &))); 1398 connect(combo, SIGNAL(activated(const QString &)), 1399 this, SLOT(changeLabel(const QString &))); 1239 1400 1240 1401 connect(this, SIGNAL(selectionsCleared()), 1241 1402 combo, SLOT(clear())); … … 1246 1407 1247 1408 bxwidget->setLayout(layout); 1248 1409 1410 changeLabel(GetLabel(current)); 1411 1249 1412 return bxwidget; 1250 1413 } 1251 1414 1415 void ImageSelectSetting::changeLabel(const QString &newLabel) 1416 { 1417 if (changeOnSpecial) 1418 { 1419 adjustFont(labelWidget, specialLabel == newLabel); 1420 adjustFont(combo, specialLabel == newLabel); 1421 } 1422 } 1423 1252 1424 void ImageSelectSetting::widgetInvalid(QObject *obj) 1253 1425 { 1254 1426 if (bxwidget == obj) -
libs/libmyth/mythwidgets.cpp
224 224 else if (action == "DOWN") 225 225 focusNextPrevChild(true); 226 226 else if (action == "LEFT" || action == "RIGHT" || action == "SELECT") 227 toggle(); 227 { 228 if (isTristate()) 229 { 230 Qt::CheckState newState = 231 (Qt::CheckState)(((int)checkState() + 1) % 3); 232 setCheckState(newState); 233 } 234 else 235 toggle(); 236 } 228 237 else 229 238 handled = false; 230 239 } -
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); … … 338 352 public slots: 339 353 void addSelection(const QString &label, 340 354 QString value = QString::null, 341 bool select = false); 355 bool select = false, 356 bool special_formatting = false); 342 357 bool removeSelection(const QString &label, 343 358 QString value = QString::null); 359 virtual void changeLabel(const QString &newValue); 344 360 void editTextChanged(const QString &newText); 345 361 346 362 private: 347 363 bool rw; 348 364 QWidget *bxwidget; 349 365 MythComboBox *cbwidget; 366 bool changeOnSpecial; 367 QString specialLabel; 368 QLabel *labelWidget; 350 369 351 370 protected: 352 371 int step; … … 415 434 ImageSelectSetting(Storage *_storage) : 416 435 SelectSetting(_storage), 417 436 bxwidget(NULL), imagelabel(NULL), combo(NULL), 418 m_hmult(1.0f), m_wmult(1.0f) { } 437 m_hmult(1.0f), m_wmult(1.0f), 438 changeOnSpecial(false), specialLabel(""), labelWidget(NULL) { } 419 439 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 420 440 const char* widgetName = 0); 421 441 virtual void widgetInvalid(QObject *obj); … … 426 446 QImage* image, 427 447 QString value=QString::null, 428 448 bool select=false); 449 virtual void addDefaultSelection(const QString label, 450 const QString value, 451 const QString defaultValue, 452 bool select); 429 453 430 454 protected slots: 431 455 void imageSet(int); 456 void changeLabel(const QString &newLabel); 432 457 433 458 protected: 434 459 void Teardown(void); … … 440 465 QLabel *imagelabel; 441 466 MythComboBox *combo; 442 467 float m_hmult, m_wmult; 468 bool changeOnSpecial; 469 QString specialLabel; 470 QLabel *labelWidget; 443 471 }; 444 472 445 473 class MPUBLIC BooleanSetting : public Setting … … 480 508 MythCheckBox *widget; 481 509 }; 482 510 511 class MPUBLIC TristateSetting : public BooleanSetting 512 { 513 Q_OBJECT 514 515 public: 516 TristateSetting(Storage *_storage) : BooleanSetting(_storage) {} 517 518 Qt::CheckState tristateValue(void) const { 519 if (getValue() == "0") 520 return Qt::Unchecked; 521 if (getValue() == "1") 522 return Qt::Checked; 523 return Qt::PartiallyChecked; 524 } 525 526 static const char *kPartiallyCheckedString; 527 528 public slots: 529 virtual void setValue(/*Qt::CheckState*/int check); 530 531 signals: 532 void valueChanged(int); 533 }; 534 535 class MPUBLIC TristateCheckBoxSetting: public TristateSetting { 536 Q_OBJECT 537 538 public: 539 TristateCheckBoxSetting(Storage *_storage) : 540 TristateSetting(_storage), widget(NULL) { } 541 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 542 const char* widgetName = 0); 543 virtual void widgetInvalid(QObject*); 544 545 virtual void setEnabled(bool b); 546 547 virtual void setHelpText(const QString &str); 548 549 550 public slots: 551 virtual void setValue(/*Qt::CheckState*/int check); 552 virtual void relayValueChanged(int state) { 553 if (widget) 554 widget->setCheckState((Qt::CheckState)state); 555 } 556 557 protected: 558 MythCheckBox *widget; 559 }; 560 483 561 class MPUBLIC PathSetting : public ComboBoxSetting 484 562 { 485 563 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
475 475 Configurable *target) 476 476 { 477 477 VerifyLayout(); 478 bool isDuplicate = triggerMap.values().contains(target); 478 479 triggerMap[triggerValue] = target; 479 480 480 481 if (!configStack) … … 484 485 configStack->setSaveAll(isSaveAll); 485 486 } 486 487 487 configStack->addChild(target); 488 // Don't add a target as a child if it has already been added, 489 // otherwise something goes wrong with signals in the child. 490 if (!isDuplicate) 491 configStack->addChild(target); 488 492 } 489 493 490 494 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
41 41 #include "mythconfig.h" 42 42 #include "mythdirs.h" 43 43 #include "mythuihelper.h" 44 #include "playsettings.h" 44 45 46 #define CREATE_CHECKBOX_SETTING(var, name, settings) \ 47 BooleanSetting *var; \ 48 if ((settings)) \ 49 var = new PlaySettingsCheckBox((name), (settings)); \ 50 else \ 51 var = new HostCheckBox((name)) 52 53 #define CREATE_COMBOBOX_SETTING(var, name, settings) \ 54 ComboBoxSetting *var; \ 55 if ((settings)) \ 56 var = new PlaySettingsComboBox((name), (settings)); \ 57 else \ 58 var = new HostComboBox((name)) 59 60 #define CREATE_COMBOBOX1_SETTING(var, name, settings, arg1) \ 61 ComboBoxSetting *var; \ 62 if ((settings)) \ 63 var = new PlaySettingsComboBox((name), (settings), (arg1)); \ 64 else \ 65 var = new HostComboBox((name), (arg1)) 66 67 #define CREATE_SPINBOX_SETTING(var, name, settings, arg1, arg2, arg3, arg4) \ 68 SpinBoxSetting *var; \ 69 if ((settings)) \ 70 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3), (arg4)); \ 71 else \ 72 var = new HostSpinBox((name), (arg1), (arg2), (arg3), (arg4)) 73 74 #define CREATE_LINEEDIT_SETTING(var, name, settings) \ 75 LineEditSetting *var; \ 76 if ((settings)) \ 77 var = new PlaySettingsLineEdit((name), (settings), ""); \ 78 else \ 79 var = new HostLineEdit((name)) 80 81 // For PlaySettings, use a SpinBox instead of a Slider so that a 82 // default value can be easily used. 83 #define CREATE_SLIDER_SETTING(var, name, settings, arg1, arg2, arg3) \ 84 BoundedIntegerSetting *var; \ 85 if ((settings)) \ 86 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3)); \ 87 else \ 88 var = new HostSlider((name), (arg1), (arg2), (arg3)) 89 90 #define CREATE_IMAGESELECT_SETTING(var, name, settings) \ 91 ImageSelectSetting *var; \ 92 if ((settings)) \ 93 var = new PlaySettingsImageSelect((name), (settings)); \ 94 else \ 95 var = new HostImageSelect((name)) 96 97 static Setting *wrap(Setting *obj, PlaySettings *settings, 98 bool twoLineLabel=false) 99 { 100 if (!settings) 101 return obj; 102 103 // Get the setting name 104 PlaySettingsCombinedStorage *storage = 105 dynamic_cast<PlaySettingsCombinedStorage *>(obj); 106 const QString &name = storage->getName(); 107 108 // Get the default value and label. The label is different 109 // from the value for most object types. 110 QString defaultValue = settings->GetSetting(name, "", true); 111 QString defaultLabel(defaultValue); 112 if (dynamic_cast<BooleanSetting *>(obj)) 113 defaultLabel = (defaultValue == "0" || defaultValue.isEmpty() ? 114 QObject::tr("disabled") : QObject::tr("enabled")); 115 if (dynamic_cast<SpinBoxSetting *>(obj) && defaultValue.isEmpty()) 116 defaultLabel = "0"; 117 ComboBoxSetting *cb = dynamic_cast<ComboBoxSetting *>(obj); 118 if (cb) 119 { 120 defaultLabel = cb->GetValueLabel(defaultValue); 121 // Add the default selection to a ComboBox 122 cb->addSelection(QString("(") + QObject::tr("default") + ")", 123 storage->getDefault(), 124 !settings->IsOverridden(name), 125 true); 126 } 127 ImageSelectSetting *is = dynamic_cast<ImageSelectSetting *>(obj); 128 if (is) 129 { 130 defaultLabel = is->GetValueLabel(defaultValue); 131 // Add the default selection to a ImageSelect 132 is->addDefaultSelection(QString("(") + QObject::tr("default") + ")", 133 storage->getDefault(), 134 defaultValue, 135 !settings->IsOverridden(name)); 136 } 137 138 // Change the help text to include the default and its source. 139 QString helpPrefix; 140 if (dynamic_cast<LineEditSetting *>(obj)) 141 helpPrefix = QObject::tr("Leave blank to keep default value"); 142 else 143 helpPrefix = QObject::tr("Override default value"); 144 helpPrefix += " (" + defaultLabel + ") "; 145 QString inheritsFrom = settings->InheritsFrom(name); 146 if (inheritsFrom.isNull()) 147 helpPrefix += QObject::tr("from global settings"); 148 else 149 helpPrefix += QObject::tr("from group") + " " + inheritsFrom; 150 helpPrefix += ". " + obj->getHelpText(); 151 obj->setHelpText(helpPrefix); 152 153 // Change the label to include the default. 154 obj->setLabel(obj->getLabel() + (twoLineLabel ? "\n" : "") + 155 " (" + defaultLabel + ")"); 156 157 return obj; 158 } 159 45 160 AudioOutputDevice::AudioOutputDevice() : HostComboBox("AudioOutputDevice", true) 46 161 { 47 162 setLabel(QObject::tr("Audio output device")); … … 336 451 return gc; 337 452 } 338 453 339 static HostCheckBox *DecodeExtraAudio()454 static Setting *DecodeExtraAudio(PlaySettings *settings) 340 455 { 341 HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");456 CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings); 342 457 gc->setLabel(QObject::tr("Extra audio buffering")); 343 458 gc->setValue(true); 344 459 gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing " … … 347 462 "effect on framegrabbers (MPEG-4/RTJPEG). MythTV will " 348 463 "keep extra audio data in its internal buffers to " 349 464 "workaround this bug.")); 350 return gc;465 return wrap(gc, settings); 351 466 } 352 467 353 static HostComboBox *PIPLocationComboBox()468 static Setting *PIPLocationComboBox(PlaySettings *settings) 354 469 { 355 HostComboBox *gc = new HostComboBox("PIPLocation");470 CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings); 356 471 gc->setLabel(QObject::tr("PIP video location")); 357 472 for (uint loc = 0; loc < kPIP_END; ++loc) 358 473 gc->addSelection(toString((PIPLocation) loc), QString::number(loc)); 359 474 gc->setHelpText(QObject::tr("Location of PIP Video window.")); 360 return gc;475 return wrap(gc, settings); 361 476 } 362 477 363 478 static GlobalLineEdit *AllRecGroupPassword() … … 454 569 return gc; 455 570 } 456 571 457 static HostCheckBox *SmartForward()572 static Setting *SmartForward(PlaySettings *settings) 458 573 { 459 HostCheckBox *gc = new HostCheckBox("SmartForward");574 CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings); 460 575 gc->setLabel(QObject::tr("Smart fast forwarding")); 461 576 gc->setValue(false); 462 577 gc->setHelpText(QObject::tr("If enabled, then immediately after " 463 578 "rewinding, only skip forward the same amount as " 464 579 "skipping backwards.")); 465 return gc;580 return wrap(gc, settings); 466 581 } 467 582 468 static HostCheckBox *ExactSeeking()583 static Setting *ExactSeeking(PlaySettings *settings) 469 584 { 470 HostCheckBox *gc = new HostCheckBox("ExactSeeking");585 CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings); 471 586 gc->setLabel(QObject::tr("Seek to exact frame")); 472 587 gc->setValue(false); 473 588 gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but " 474 589 "slower.")); 475 return gc;590 return wrap(gc, settings); 476 591 } 477 592 478 593 static GlobalComboBox *CommercialSkipMethod() … … 490 605 return bc; 491 606 } 492 607 493 static HostComboBox *AutoCommercialSkip()608 static Setting *AutoCommercialSkip(PlaySettings *settings) 494 609 { 495 HostComboBox *gc = new HostComboBox("AutoCommercialSkip");610 CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings); 496 611 gc->setLabel(QObject::tr("Automatically skip commercials")); 497 612 gc->addSelection(QObject::tr("Off"), "0"); 498 613 gc->addSelection(QObject::tr("Notify, but do not skip"), "2"); … … 501 616 "have been flagged during automatic commercial detection " 502 617 "or by the mythcommflag program, or just notify that a " 503 618 "commercial has been detected.")); 504 return gc;619 return wrap(gc, settings); 505 620 } 506 621 507 622 static GlobalCheckBox *AutoCommercialFlag() … … 586 701 return bc; 587 702 } 588 703 589 static HostSpinBox *CommRewindAmount()704 static Setting *CommRewindAmount(PlaySettings *settings) 590 705 { 591 HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);706 CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false); 592 707 gs->setLabel(QObject::tr("Commercial skip automatic rewind amount")); 593 708 gs->setHelpText(QObject::tr("If set, MythTV will automatically rewind " 594 709 "this many seconds after performing a commercial skip.")); 595 710 gs->setValue(0); 596 return gs;711 return wrap(gs, settings); 597 712 } 598 713 599 static HostSpinBox *CommNotifyAmount()714 static Setting *CommNotifyAmount(PlaySettings *settings) 600 715 { 601 HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);716 CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false); 602 717 gs->setLabel(QObject::tr("Commercial skip notify amount")); 603 718 gs->setHelpText(QObject::tr("If set, MythTV will act like a commercial " 604 719 "begins this many seconds early. This can be useful " 605 720 "when commercial notification is used in place of " 606 721 "automatic skipping.")); 607 722 gs->setValue(0); 608 return gs;723 return wrap(gs, settings); 609 724 } 610 725 611 726 static GlobalSpinBox *MaximumCommercialSkip() … … 1407 1522 labels[j]->setValue(label_i); 1408 1523 } 1409 1524 1410 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) : 1525 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str, 1526 PlaySettings *settings) : 1411 1527 TriggeredConfigurationGroup(false, true, true, true, 1412 1528 false, false, true, true), grouptrigger(NULL) 1413 1529 { 1414 1530 setLabel(QObject::tr("Playback Profiles") + str); 1531 if (settings) 1532 setLabel(QObject::tr("Playback group settings for ") + 1533 settings->mGroupName + " - " + 1534 getLabel()); 1415 1535 1416 1536 QString host = gCoreContext->GetHostName(); 1417 1537 QStringList profiles = VideoDisplayProfile::GetProfiles(host); … … 1439 1559 profiles = VideoDisplayProfile::GetProfiles(host); 1440 1560 } 1441 1561 1442 QString profile = VideoDisplayProfile::GetDefaultProfileName(host );1562 QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings); 1443 1563 if (!profiles.contains(profile)) 1444 1564 { 1445 1565 profile = (profiles.contains("Normal")) ? "Normal" : profiles[0]; 1446 1566 VideoDisplayProfile::SetDefaultProfileName(profile, host); 1447 1567 } 1448 1568 1449 grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile"); 1569 CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings); 1570 grouptrigger = gs; 1450 1571 grouptrigger->setLabel(QObject::tr("Current Video Playback Profile")); 1451 1572 QStringList::const_iterator it; 1452 1573 for (it = profiles.begin(); it != profiles.end(); ++it) 1453 1574 grouptrigger->addSelection(ProgramInfo::i18n(*it), *it); 1575 if (settings) 1576 { 1577 addChild(wrap(grouptrigger, settings)); 1578 return; 1579 } 1454 1580 1455 1581 HorizontalConfigurationGroup *grp = 1456 1582 new HorizontalConfigurationGroup(false, false, true, true); … … 1583 1709 return gc; 1584 1710 } 1585 1711 1586 static HostSpinBox *FFRewReposTime()1712 static Setting *FFRewReposTime(PlaySettings *settings) 1587 1713 { 1588 HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);1714 CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false); 1589 1715 gs->setLabel(QObject::tr("Fast forward/rewind reposition amount")); 1590 1716 gs->setValue(100); 1591 1717 gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind " … … 1593 1719 "resuming normal playback. This " 1594 1720 "compensates for the reaction time between seeing " 1595 1721 "where to resume playback and actually exiting seeking.")); 1596 return gs;1722 return wrap(gs, settings); 1597 1723 } 1598 1724 1599 static HostCheckBox *FFRewReverse()1725 static Setting *FFRewReverse(PlaySettings *settings) 1600 1726 { 1601 HostCheckBox *gc = new HostCheckBox("FFRewReverse");1727 CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings); 1602 1728 gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind")); 1603 1729 gc->setValue(true); 1604 1730 gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key " … … 1606 1732 "vice versa. If disabled, it will decrease the " 1607 1733 "current speed or switch to play mode if " 1608 1734 "the speed can't be decreased further.")); 1609 return gc;1735 return wrap(gc, settings); 1610 1736 } 1611 1737 1612 static HostSpinBox *OSDGeneralTimeout()1738 static Setting *OSDGeneralTimeout(PlaySettings *settings) 1613 1739 { 1614 HostSpinBox *gs = new HostSpinBox("OSDGeneralTimeout", 1, 30, 1);1740 CREATE_SPINBOX_SETTING(gs, "OSDGeneralTimeout", settings, 1, 30, 1, false); 1615 1741 gs->setLabel(QObject::tr("General OSD time-out (sec)")); 1616 1742 gs->setValue(2); 1617 1743 gs->setHelpText(QObject::tr("Length of time an on-screen display " 1618 1744 "window will be visible.")); 1619 return gs;1745 return wrap(gs, settings); 1620 1746 } 1621 1747 1622 static HostSpinBox *OSDProgramInfoTimeout()1748 static Setting *OSDProgramInfoTimeout(PlaySettings *settings) 1623 1749 { 1624 HostSpinBox *gs = new HostSpinBox("OSDProgramInfoTimeout", 1, 30, 1); 1750 CREATE_SPINBOX_SETTING(gs, "OSDProgramInfoTimeout", settings, 1751 1, 30, 1, false); 1625 1752 gs->setLabel(QObject::tr("Program info OSD time-out")); 1626 1753 gs->setValue(3); 1627 1754 gs->setHelpText(QObject::tr("Length of time the on-screen display " 1628 1755 "will display program information.")); 1629 return gs;1756 return wrap(gs, settings); 1630 1757 } 1631 1758 1632 static HostSpinBox *OSDNotifyTimeout()1759 static Setting *OSDNotifyTimeout(PlaySettings *settings) 1633 1760 { 1634 HostSpinBox *gs = new HostSpinBox("OSDNotifyTimeout", 1, 30, 1);1761 CREATE_SPINBOX_SETTING(gs, "OSDNotifyTimeout", settings, 1, 30, 1, false); 1635 1762 gs->setLabel(QObject::tr("UDP notify OSD time-out")); 1636 1763 gs->setValue(5); 1637 1764 gs->setHelpText(QObject::tr("How many seconds an on-screen display " 1638 1765 "will be active for UDP Notify events.")); 1639 return gs;1766 return wrap(gs, settings); 1640 1767 } 1641 1768 1642 1769 static HostSpinBox *ThemeCacheSize() … … 1680 1807 return gc; 1681 1808 } 1682 1809 1683 static HostComboBox *OSDFont()1810 static Setting *OSDFont(PlaySettings *settings) 1684 1811 { 1685 HostComboBox *gc = new HostComboBox("OSDFont");1812 CREATE_COMBOBOX_SETTING(gc, "OSDFont", settings); 1686 1813 gc->setLabel(QObject::tr("OSD font")); 1687 1814 QDir ttf(GetFontsDir(), GetFontsNameFilter()); 1688 1815 gc->fillSelectionsFromDir(ttf, false); … … 1690 1817 if (gc->findSelection(defaultOSDFont) > -1) 1691 1818 gc->setValue(defaultOSDFont); 1692 1819 1693 return gc;1820 return wrap(gc, settings); 1694 1821 } 1695 1822 1696 static HostComboBox *OSDCCFont()1823 static Setting *OSDCCFont(PlaySettings *settings) 1697 1824 { 1698 HostComboBox *gc = new HostComboBox("OSDCCFont");1825 CREATE_COMBOBOX_SETTING(gc, "OSDCCFont", settings); 1699 1826 gc->setLabel(QObject::tr("CC font")); 1700 1827 QDir ttf(GetFontsDir(), GetFontsNameFilter()); 1701 1828 gc->fillSelectionsFromDir(ttf, false); 1702 1829 gc->setHelpText(QObject::tr("Closed Caption font")); 1703 1830 1704 return gc;1831 return wrap(gc, settings); 1705 1832 } 1706 1833 1707 1834 static HostComboBox __attribute__ ((unused)) *DecodeVBIFormat() … … 1722 1849 return gc; 1723 1850 } 1724 1851 1725 static HostSpinBox *OSDCC708TextZoomPercentage(void)1852 static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings) 1726 1853 { 1727 HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5); 1854 CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings, 1855 50, 200, 5, false); 1728 1856 gs->setLabel(QObject::tr("Text zoom percentage")); 1729 1857 gs->setValue(100); 1730 1858 gs->setHelpText(QObject::tr("Use this to enlarge or shrink captions.")); 1731 1859 1732 return gs;1860 return wrap(gs, settings); 1733 1861 } 1734 1862 1735 static HostComboBox *OSDCC708DefaultFontType(void)1863 static Setting *OSDCC708DefaultFontType(PlaySettings *settings) 1736 1864 { 1737 HostComboBox *hc = new HostComboBox("OSDCC708DefaultFontType");1865 CREATE_COMBOBOX_SETTING(hc, "OSDCC708DefaultFontType", settings); 1738 1866 hc->setLabel(QObject::tr("Default caption font type")); 1739 1867 hc->setHelpText( 1740 1868 QObject::tr("This allows you to set which font type to use " … … 1757 1885 }; 1758 1886 for (uint i = 0; i < 7; ++i) 1759 1887 hc->addSelection(typeNames[i], types[i]); 1760 return hc;1888 return wrap(hc, settings); 1761 1889 } 1762 1890 1763 static VerticalConfigurationGroup *OSDCC708Settings( void)1891 static VerticalConfigurationGroup *OSDCC708Settings(PlaySettings *settings) 1764 1892 { 1765 1893 VerticalConfigurationGroup *grp = 1766 1894 new VerticalConfigurationGroup(false, true, true, true); 1767 1895 grp->setLabel(QObject::tr("ATSC Caption Settings")); 1896 if (settings) 1897 grp->setLabel(QObject::tr("Playback group settings for ") + 1898 settings->mGroupName + " - " + 1899 grp->getLabel()); 1768 1900 1769 1901 // default text zoom 1.0 1770 grp->addChild(OSDCC708TextZoomPercentage( ));1902 grp->addChild(OSDCC708TextZoomPercentage(settings)); 1771 1903 1772 1904 // force X lines of captions 1773 1905 // force caption character color … … 1776 1908 // force background opacity 1777 1909 1778 1910 // set default font type 1779 grp->addChild(OSDCC708DefaultFontType( ));1911 grp->addChild(OSDCC708DefaultFontType(settings)); 1780 1912 1781 1913 return grp; 1782 1914 } 1783 1915 1784 static HostComboBox*OSDCC708Font(1916 static Setting *OSDCC708Font( 1785 1917 const QString &subtype, const QString &subtypeName, 1786 const QString &subtypeNameForHelp )1918 const QString &subtypeNameForHelp, PlaySettings *settings) 1787 1919 { 1788 HostComboBox *gc = new HostComboBox(1789 QString("OSDCC708%1Font").arg(subtype));1920 CREATE_COMBOBOX_SETTING(gc, QString("OSDCC708%1Font").arg(subtype), 1921 settings); 1790 1922 1791 1923 gc->setLabel(subtypeName); 1792 1924 QDir ttf(GetFontsDir(), GetFontsNameFilter()); … … 1794 1926 gc->setHelpText( 1795 1927 QObject::tr("ATSC %1 closed caption font.").arg(subtypeNameForHelp)); 1796 1928 1797 return gc;1929 return wrap(gc, settings, (subtypeName.length() > 10)); 1798 1930 } 1799 1931 1800 static HorizontalConfigurationGroup *OSDCC708Fonts( void)1932 static HorizontalConfigurationGroup *OSDCC708Fonts(PlaySettings *settings) 1801 1933 { 1802 1934 HorizontalConfigurationGroup *grpmain = 1803 1935 new HorizontalConfigurationGroup(false, true, true, true); 1804 1936 grpmain->setLabel(QObject::tr("ATSC Caption Fonts")); 1937 if (settings) 1938 grpmain->setLabel(QObject::tr("Playback group settings for ") + 1939 settings->mGroupName + " - " + 1940 grpmain->getLabel()); 1805 1941 VerticalConfigurationGroup *col[] = 1806 1942 { 1807 1943 new VerticalConfigurationGroup(false, false, true, true), … … 1837 1973 for (uint j = 0; j < 7; ++j) 1838 1974 { 1839 1975 col[i]->addChild(OSDCC708Font(subtypes[i].arg(types[j]), 1840 typeNames[j], typeNames[j])); 1976 typeNames[j], typeNames[j], 1977 settings)); 1841 1978 } 1842 1979 grpmain->addChild(col[i]); 1843 1980 1844 1981 i = 1; 1845 1982 for (uint j = 0; j < 7; ++j) 1846 1983 { 1847 col[i]->addChild(OSDCC708Font( 1848 subtypes[i].arg(types[j]), "", 1849 QObject::tr("Italic") + ' ' + typeNames[j])); 1984 col[i]->addChild(OSDCC708Font(subtypes[i].arg(types[j]), 1985 (settings ? typeNames[j] : ""), 1986 QObject::tr("Italic") + ' ' + typeNames[j], 1987 settings)); 1850 1988 } 1851 1989 1852 1990 grpmain->addChild(col[i]); … … 1854 1992 return grpmain; 1855 1993 } 1856 1994 1857 static HostComboBox *SubtitleCodec()1995 static Setting *SubtitleCodec(PlaySettings *settings) 1858 1996 { 1859 HostComboBox *gc = new HostComboBox("SubtitleCodec");1997 CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings); 1860 1998 1861 1999 gc->setLabel(QObject::tr("Subtitle Codec")); 1862 2000 QList<QByteArray> list = QTextCodec::availableCodecs(); … … 1866 2004 gc->addSelection(val, val, val.toLower() == "utf-8"); 1867 2005 } 1868 2006 1869 return gc;2007 return wrap(gc, settings); 1870 2008 } 1871 2009 1872 static HorizontalConfigurationGroup *ExternalSubtitleSettings( )2010 static HorizontalConfigurationGroup *ExternalSubtitleSettings(PlaySettings *settings) 1873 2011 { 1874 2012 HorizontalConfigurationGroup *grpmain = 1875 2013 new HorizontalConfigurationGroup(false, true, true, true); 1876 2014 1877 2015 grpmain->setLabel(QObject::tr("External subtitle settings")); 1878 2016 1879 grpmain->addChild(SubtitleCodec( ));2017 grpmain->addChild(SubtitleCodec(settings)); 1880 2018 1881 2019 return grpmain; 1882 2020 } 1883 2021 1884 static HostComboBox *OSDThemeFontSizeType()2022 static Setting *OSDThemeFontSizeType(PlaySettings *settings) 1885 2023 { 1886 HostComboBox *gc = new HostComboBox("OSDThemeFontSizeType");2024 CREATE_COMBOBOX_SETTING(gc, "OSDThemeFontSizeType", settings); 1887 2025 gc->setLabel(QObject::tr("Font size")); 1888 2026 gc->addSelection(QObject::tr("default"), "default"); 1889 2027 gc->addSelection(QObject::tr("small"), "small"); 1890 2028 gc->addSelection(QObject::tr("big"), "big"); 1891 2029 gc->setHelpText(QObject::tr("default: TV, small: monitor, big:")); 1892 return gc;2030 return wrap(gc, settings); 1893 2031 } 1894 2032 1895 2033 static HostComboBox *ChannelOrdering() … … 1901 2039 return gc; 1902 2040 } 1903 2041 1904 static HostSpinBox *VertScanPercentage()2042 static Setting *VertScanPercentage(PlaySettings *settings) 1905 2043 { 1906 HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1); 2044 CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings, 2045 -100, 100, 1, false); 1907 2046 gs->setLabel(QObject::tr("Vertical scaling")); 1908 2047 gs->setValue(0); 1909 2048 gs->setHelpText(QObject::tr( 1910 2049 "Adjust this if the image does not fill your " 1911 2050 "screen vertically. Range -100% to 100%")); 1912 return gs;2051 return wrap(gs, settings); 1913 2052 } 1914 2053 1915 static HostSpinBox *HorizScanPercentage()2054 static Setting *HorizScanPercentage(PlaySettings *settings) 1916 2055 { 1917 HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1); 2056 CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings, 2057 -100, 100, 1, false); 1918 2058 gs->setLabel(QObject::tr("Horizontal scaling")); 1919 2059 gs->setValue(0); 1920 2060 gs->setHelpText(QObject::tr( 1921 2061 "Adjust this if the image does not fill your " 1922 2062 "screen horizontally. Range -100% to 100%")); 1923 return gs;2063 return wrap(gs, settings); 1924 2064 }; 1925 2065 1926 static HostSpinBox *XScanDisplacement()2066 static Setting *XScanDisplacement(PlaySettings *settings) 1927 2067 { 1928 HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1); 2068 CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings, 2069 -50, 50, 1, false); 1929 2070 gs->setLabel(QObject::tr("Scan displacement (X)")); 1930 2071 gs->setValue(0); 1931 2072 gs->setHelpText(QObject::tr("Adjust this to move the image horizontally.")); 1932 return gs;2073 return wrap(gs, settings); 1933 2074 } 1934 2075 1935 static HostSpinBox *YScanDisplacement()2076 static Setting *YScanDisplacement(PlaySettings *settings) 1936 2077 { 1937 HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1); 2078 CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings, 2079 -50, 50, 1, false); 1938 2080 gs->setLabel(QObject::tr("Scan displacement (Y)")); 1939 2081 gs->setValue(0); 1940 2082 gs->setHelpText(QObject::tr("Adjust this to move the image vertically.")); 1941 return gs;2083 return wrap(gs, settings); 1942 2084 }; 1943 2085 1944 2086 static HostCheckBox *AlwaysStreamFiles() … … 1954 2096 return gc; 1955 2097 } 1956 2098 1957 static HostCheckBox *CCBackground()2099 static Setting *CCBackground(PlaySettings *settings) 1958 2100 { 1959 HostCheckBox *gc = new HostCheckBox("CCBackground");2101 CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings); 1960 2102 gc->setLabel(QObject::tr("Black background for closed captioning")); 1961 2103 gc->setValue(false); 1962 2104 gc->setHelpText(QObject::tr( 1963 2105 "If enabled, captions will be displayed " 1964 2106 "as white text over a black background " 1965 2107 "for better contrast.")); 1966 return gc;2108 return wrap(gc, settings); 1967 2109 } 1968 2110 1969 static HostCheckBox *DefaultCCMode()2111 static Setting *DefaultCCMode(PlaySettings *settings) 1970 2112 { 1971 HostCheckBox *gc = new HostCheckBox("DefaultCCMode");2113 CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings); 1972 2114 gc->setLabel(QObject::tr("Always display closed captioning or subtitles")); 1973 2115 gc->setValue(false); 1974 2116 gc->setHelpText(QObject::tr( … … 1976 2118 "when playing back recordings or watching " 1977 2119 "Live TV. Closed Captioning can be turned on or off " 1978 2120 "by pressing \"T\" during playback.")); 1979 return gc;2121 return wrap(gc, settings); 1980 2122 } 1981 2123 1982 static HostCheckBox *PreferCC708()2124 static Setting *PreferCC708(PlaySettings *settings) 1983 2125 { 1984 HostCheckBox *gc = new HostCheckBox("Prefer708Captions");2126 CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings); 1985 2127 gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions")); 1986 2128 gc->setValue(true); 1987 2129 gc->setHelpText( … … 1989 2131 "When enabled the new EIA-708 captions will be preferred over " 1990 2132 "the old EIA-608 captions in ATSC streams.")); 1991 2133 1992 return gc;2134 return wrap(gc, settings); 1993 2135 } 1994 2136 1995 static HostCheckBox *EnableMHEG()2137 static Setting *EnableMHEG(PlaySettings *settings) 1996 2138 { 1997 HostCheckBox *gc = new HostCheckBox("EnableMHEG");2139 CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings); 1998 2140 gc->setLabel(QObject::tr("Enable interactive TV")); 1999 2141 gc->setValue(false); 2000 2142 gc->setHelpText(QObject::tr( 2001 2143 "If enabled, interactive TV applications (MHEG) will " 2002 2144 "be activated. This is used for teletext and logos for " 2003 2145 "radio and channels that are currently off-air.")); 2004 return gc;2146 return wrap(gc, settings); 2005 2147 } 2006 2148 2007 static HostCheckBox *PersistentBrowseMode()2149 static Setting *PersistentBrowseMode(PlaySettings *settings) 2008 2150 { 2009 HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");2151 CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings); 2010 2152 gc->setLabel(QObject::tr("Always use browse mode in Live TV")); 2011 2153 gc->setValue(true); 2012 2154 gc->setHelpText( 2013 2155 QObject::tr( 2014 2156 "If enabled, browse mode will automatically be activated " 2015 2157 "whenever you use channel up/down while watching Live TV.")); 2016 return gc;2158 return wrap(gc, settings); 2017 2159 } 2018 2160 2019 static HostCheckBox *BrowseAllTuners()2161 static Setting *BrowseAllTuners(PlaySettings *settings) 2020 2162 { 2021 HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");2163 CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings); 2022 2164 gc->setLabel(QObject::tr("Browse all channels")); 2023 2165 gc->setValue(false); 2024 2166 gc->setHelpText( … … 2026 2168 "If enabled, browse mode will shows channels on all " 2027 2169 "available recording devices, instead of showing " 2028 2170 "channels on just the current recorder.")); 2029 return gc;2171 return wrap(gc, settings); 2030 2172 } 2031 2173 2032 static HostCheckBox *ClearSavedPosition()2174 static Setting *ClearSavedPosition(PlaySettings *settings) 2033 2175 { 2034 HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");2176 CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings); 2035 2177 gc->setLabel(QObject::tr("Clear bookmark on playback")); 2036 2178 gc->setValue(true); 2037 2179 gc->setHelpText(QObject::tr("Automatically clear the bookmark on a " 2038 2180 "recording when the recording is played back. If " 2039 2181 "disabled, you can mark the beginning with rewind " 2040 2182 "then save position.")); 2041 return gc;2183 return wrap(gc, settings); 2042 2184 } 2043 2185 2044 static HostCheckBox *AltClearSavedPosition()2186 static Setting *AltClearSavedPosition(PlaySettings *settings) 2045 2187 { 2046 HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");2188 CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings); 2047 2189 gc->setLabel(QObject::tr("Alternate clear and save bookmark")); 2048 2190 gc->setValue(true); 2049 2191 gc->setHelpText(QObject::tr("During playback the SELECT key " … … 2051 2193 "Saved\" and \"Bookmark Cleared\". If disabled, the " 2052 2194 "SELECT key will save the current position for each " 2053 2195 "keypress.")); 2054 return gc;2196 return wrap(gc, settings); 2055 2197 } 2056 2198 2057 2199 #if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU) 2058 static HostCheckBox *UsePicControls()2200 static Setting *UsePicControls(PlaySettings *settings) 2059 2201 { 2060 HostCheckBox *gc = new HostCheckBox("UseOutputPictureControls");2202 CREATE_CHECKBOX_SETTING(gc, "UseOutputPictureControls", settings); 2061 2203 gc->setLabel(QObject::tr("Enable picture controls")); 2062 2204 gc->setValue(false); 2063 2205 gc->setHelpText( 2064 2206 QObject::tr( 2065 2207 "If enabled, MythTV attempts to initialize picture controls " 2066 2208 "(brightness, contrast, etc.) that are applied during playback.")); 2067 return gc;2209 return wrap(gc, settings); 2068 2210 } 2069 2211 #endif 2070 2212 2071 static HostLineEdit *UDPNotifyPort()2213 static Setting *UDPNotifyPort(PlaySettings *settings) 2072 2214 { 2073 HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");2215 CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings); 2074 2216 ge->setLabel(QObject::tr("UDP notify port")); 2075 2217 ge->setValue("6948"); 2076 2218 ge->setHelpText(QObject::tr("During playback, MythTV will listen for " 2077 2219 "connections from the \"mythtvosd\" or \"mythudprelay\" " 2078 2220 "programs on this port. For additional information, see " 2079 2221 "http://www.mythtv.org/wiki/MythNotify .")); 2080 return ge;2222 return wrap(ge, settings); 2081 2223 } 2082 2224 2083 static HostComboBox *PlaybackExitPrompt()2225 static Setting *PlaybackExitPrompt(PlaySettings *settings) 2084 2226 { 2085 HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");2227 CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings); 2086 2228 gc->setLabel(QObject::tr("Action on playback exit")); 2087 2229 gc->addSelection(QObject::tr("Just exit"), "0"); 2088 2230 gc->addSelection(QObject::tr("Save position and exit"), "2"); … … 2093 2235 "when you exit playback mode. The options available will " 2094 2236 "allow you to save your position, delete the " 2095 2237 "recording, or continue watching.")); 2096 return gc;2238 return wrap(gc, settings); 2097 2239 } 2098 2240 2099 static HostCheckBox *EndOfRecordingExitPrompt()2241 static Setting *EndOfRecordingExitPrompt(PlaySettings *settings) 2100 2242 { 2101 HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");2243 CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings); 2102 2244 gc->setLabel(QObject::tr("Prompt at end of recording")); 2103 2245 gc->setValue(false); 2104 2246 gc->setHelpText(QObject::tr("If set, a menu will be displayed allowing " 2105 2247 "you to delete the recording when it has finished " 2106 2248 "playing.")); 2107 return gc;2249 return wrap(gc, settings); 2108 2250 } 2109 2251 2110 static HostCheckBox *JumpToProgramOSD()2252 static Setting *JumpToProgramOSD(PlaySettings *settings) 2111 2253 { 2112 HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");2254 CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings); 2113 2255 gc->setLabel(QObject::tr("Jump to program OSD")); 2114 2256 gc->setValue(true); 2115 2257 gc->setHelpText(QObject::tr( … … 2118 2260 "'Watch Recording' screen when 'Jump to Program' " 2119 2261 "is activated. If set, the recordings are shown " 2120 2262 "in the OSD")); 2121 return gc;2263 return wrap(gc, settings); 2122 2264 } 2123 2265 2124 static HostCheckBox *ContinueEmbeddedTVPlay()2266 static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings) 2125 2267 { 2126 HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");2268 CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings); 2127 2269 gc->setLabel(QObject::tr("Continue playback when embedded")); 2128 2270 gc->setValue(false); 2129 2271 gc->setHelpText(QObject::tr( … … 2131 2273 "is embedded in the upcoming program list or recorded " 2132 2274 "list. The default is to pause the recorded show when " 2133 2275 "embedded.")); 2134 return gc;2276 return wrap(gc, settings); 2135 2277 } 2136 2278 2137 static HostCheckBox *AutomaticSetWatched()2279 static Setting *AutomaticSetWatched(PlaySettings *settings) 2138 2280 { 2139 HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");2281 CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings); 2140 2282 gc->setLabel(QObject::tr("Automatically mark a recording as watched")); 2141 2283 gc->setValue(false); 2142 2284 gc->setHelpText(QObject::tr("If set, when you exit near the end of a " … … 2144 2286 "detection is not foolproof, so do not enable this " 2145 2287 "setting if you don't want an unwatched recording marked " 2146 2288 "as watched.")); 2147 return gc;2289 return wrap(gc, settings); 2148 2290 } 2149 2291 2150 2292 static HostSpinBox *LiveTVIdleTimeout() … … 2381 2523 return gc; 2382 2524 } 2383 2525 2384 static HostComboBox *LetterboxingColour()2526 static Setting *LetterboxingColour(PlaySettings *settings) 2385 2527 { 2386 HostComboBox *gc = new HostComboBox("LetterboxColour");2528 CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings); 2387 2529 gc->setLabel(QObject::tr("Letterboxing color")); 2388 2530 for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m) 2389 2531 gc->addSelection(toString((LetterBoxColour)m), QString::number(m)); … … 2393 2535 "letterboxing, but those with plasma screens may prefer gray " 2394 2536 "to minimize burn-in.") + " " + 2395 2537 QObject::tr("Currently only works with XVideo video renderer.")); 2396 return gc;2538 return wrap(gc, settings); 2397 2539 } 2398 2540 2399 static HostComboBox *AspectOverride()2541 static Setting *AspectOverride(PlaySettings *settings) 2400 2542 { 2401 HostComboBox *gc = new HostComboBox("AspectOverride");2543 CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings); 2402 2544 gc->setLabel(QObject::tr("Video aspect override")); 2403 2545 for (int m = kAspect_Off; m < kAspect_END; ++m) 2404 2546 gc->addSelection(toString((AspectOverrideMode)m), QString::number(m)); … … 2406 2548 "When enabled, these will override the aspect " 2407 2549 "ratio specified by any broadcaster for all " 2408 2550 "video streams.")); 2409 return gc;2551 return wrap(gc, settings); 2410 2552 } 2411 2553 2412 static HostComboBox *AdjustFill()2554 static Setting *AdjustFill(PlaySettings *settings) 2413 2555 { 2414 HostComboBox *gc = new HostComboBox("AdjustFill");2556 CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings); 2415 2557 gc->setLabel(QObject::tr("Zoom")); 2416 2558 gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff), 2417 2559 QString::number(kAdjustFill_AutoDetect_DefaultOff)); … … 2422 2564 gc->setHelpText(QObject::tr( 2423 2565 "When enabled, these will apply a predefined " 2424 2566 "zoom to all video playback in MythTV.")); 2425 return gc;2567 return wrap(gc, settings); 2426 2568 } 2427 2569 2428 2570 // Theme settings … … 2841 2983 return gc; 2842 2984 } 2843 2985 2844 ThemeSelector::ThemeSelector(QString label): 2845 HostImageSelect(label){2846 2986 static Setting *ThemeSelector(QString label, PlaySettings *settings=NULL) 2987 { 2988 CREATE_IMAGESELECT_SETTING(gs, label, settings); 2847 2989 ThemeType themetype = THEME_UI; 2848 2990 2849 2991 if (label == "Theme") 2850 2992 { 2851 2993 themetype = THEME_UI; 2852 setLabel(QObject::tr("UI theme"));2994 gs->setLabel(QObject::tr("UI theme")); 2853 2995 } 2854 2996 else if (label == "OSDTheme") 2855 2997 { 2856 2998 themetype = THEME_OSD; 2857 setLabel(QObject::tr("OSD theme"));2999 gs->setLabel(QObject::tr("OSD theme")); 2858 3000 } 2859 3001 else if (label == "MenuTheme") 2860 3002 { 2861 3003 themetype = THEME_MENU; 2862 setLabel(QObject::tr("Menu theme"));3004 gs->setLabel(QObject::tr("Menu theme")); 2863 3005 } 2864 3006 2865 3007 QDir themes(GetThemesParentDir()); … … 2923 3065 VERBOSE(VB_IMPORTANT, QString("Problem reading theme preview image" 2924 3066 " %1").arg(preview.filePath())); 2925 3067 2926 addImageSelection(name, previewImage, theme.fileName());3068 gs->addImageSelection(name, previewImage, theme.fileName()); 2927 3069 } 2928 3070 2929 3071 if (themetype & THEME_UI) 2930 setValue(DEFAULT_UI_THEME);3072 gs->setValue(DEFAULT_UI_THEME); 2931 3073 else if (themetype & THEME_OSD) 2932 setValue("BlackCurves-OSD"); 3074 gs->setValue("BlackCurves-OSD"); 3075 3076 return wrap(gs, settings); 2933 3077 } 2934 3078 2935 3079 static HostComboBox *ChannelFormat() … … 3615 3759 return gs; 3616 3760 } 3617 3761 3618 static HostCheckBox *RealtimePriority()3762 static Setting *RealtimePriority(PlaySettings *settings) 3619 3763 { 3620 HostCheckBox *gc = new HostCheckBox("RealtimePriority");3764 CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings); 3621 3765 gc->setLabel(QObject::tr("Enable realtime priority threads")); 3622 3766 gc->setHelpText(QObject::tr("When running mythfrontend with root " 3623 3767 "privileges, some threads can be given enhanced priority. " 3624 3768 "Disable this if mythfrontend freezes during video " 3625 3769 "playback.")); 3626 3770 gc->setValue(true); 3627 return gc;3771 return wrap(gc, settings, false); 3628 3772 } 3629 3773 3630 3774 static HostCheckBox *EnableMediaMon() … … 3780 3924 }; 3781 3925 3782 3926 #ifdef USING_OPENGL_VSYNC 3783 static HostCheckBox *UseOpenGLVSync()3927 static Setting *UseOpenGLVSync(PlaySettings *settings) 3784 3928 { 3785 HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");3929 CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings); 3786 3930 gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing")); 3787 3931 gc->setValue(false); 3788 3932 gc->setHelpText(QObject::tr( 3789 3933 "If it is supported by your hardware/drivers, " 3790 3934 "MythTV will use OpenGL vertical syncing for " 3791 3935 "video timing, reducing frame jitter.")); 3792 return gc;3936 return wrap(gc, settings); 3793 3937 } 3794 3938 #endif 3795 3939 … … 4215 4359 return gc; 4216 4360 } 4217 4361 4218 MainGeneralSettings::MainGeneralSettings() 4362 MainGeneralSettings::MainGeneralSettings(PlaySettings *settings, 4363 ConfigurationWizard *base) 4219 4364 { 4365 if (!settings) 4366 { 4220 4367 DatabaseSettings::addDatabaseSettings(this); 4221 4368 4222 4369 VerticalConfigurationGroup *pin = … … 4268 4415 remotecontrol->addChild(NetworkControlEnabled()); 4269 4416 remotecontrol->addChild(NetworkControlPort()); 4270 4417 addChild(remotecontrol); 4418 } 4271 4419 } 4272 4420 4273 PlaybackSettings::PlaybackSettings() 4421 PlaybackSettings::PlaybackSettings(PlaySettings *settings, 4422 ConfigurationWizard *base) 4274 4423 { 4275 4424 uint i = 0, total = 8; 4276 4425 #if CONFIG_DARWIN 4277 4426 total += 2; 4278 4427 #endif // USING_DARWIN 4428 if (settings) 4429 total -= 3; 4279 4430 4280 4431 4281 4432 VerticalConfigurationGroup* general1 = 4282 4433 new VerticalConfigurationGroup(false); 4283 4434 general1->setLabel(QObject::tr("General Playback") + 4284 4435 QString(" (%1/%2)").arg(++i).arg(total)); 4436 if (settings) 4437 general1->setLabel(QObject::tr("Playback group settings for ") + 4438 settings->mGroupName + " - " + 4439 general1->getLabel()); 4285 4440 4286 4441 HorizontalConfigurationGroup *columns = 4287 4442 new HorizontalConfigurationGroup(false, false, true, true); 4288 4443 4289 4444 VerticalConfigurationGroup *column1 = 4290 4445 new VerticalConfigurationGroup(false, false, true, true); 4291 column1->addChild(RealtimePriority()); 4292 column1->addChild(DecodeExtraAudio()); 4293 column1->addChild(JumpToProgramOSD()); 4446 if (!settings) 4447 column1->addChild(RealtimePriority(settings)); 4448 column1->addChild(DecodeExtraAudio(settings)); 4449 column1->addChild(JumpToProgramOSD(settings)); 4294 4450 columns->addChild(column1); 4295 4451 4296 4452 VerticalConfigurationGroup *column2 = 4297 4453 new VerticalConfigurationGroup(false, false, true, true); 4298 column2->addChild(ClearSavedPosition( ));4299 column2->addChild(AltClearSavedPosition( ));4300 column2->addChild(AutomaticSetWatched( ));4301 column2->addChild(ContinueEmbeddedTVPlay( ));4454 column2->addChild(ClearSavedPosition(settings)); 4455 column2->addChild(AltClearSavedPosition(settings)); 4456 column2->addChild(AutomaticSetWatched(settings)); 4457 column2->addChild(ContinueEmbeddedTVPlay(settings)); 4302 4458 columns->addChild(column2); 4303 4459 4304 4460 general1->addChild(columns); 4305 general1->addChild(LiveTVIdleTimeout()); 4306 general1->addChild(AlwaysStreamFiles()); 4461 if (!settings) 4462 general1->addChild(LiveTVIdleTimeout()); 4463 if (!settings) 4464 general1->addChild(AlwaysStreamFiles()); 4307 4465 #ifdef USING_OPENGL_VSYNC 4308 general1->addChild(UseOpenGLVSync( ));4466 general1->addChild(UseOpenGLVSync(settings)); 4309 4467 #endif // USING_OPENGL_VSYNC 4310 4468 #if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU) 4311 general1->addChild(UsePicControls( ));4469 general1->addChild(UsePicControls(settings)); 4312 4470 #endif // USING_XV 4313 addChild(general1); 4471 if (base) 4472 base->addChild(general1); 4473 else 4474 addChild(general1); 4314 4475 4315 4476 VerticalConfigurationGroup* general2 = 4316 4477 new VerticalConfigurationGroup(false); 4317 4478 general2->setLabel(QObject::tr("General Playback") + 4318 4479 QString(" (%1/%2)").arg(++i).arg(total)); 4480 if (settings) 4481 general2->setLabel(QObject::tr("Playback group settings for ") + 4482 settings->mGroupName + " - " + 4483 general2->getLabel()); 4319 4484 4320 4485 HorizontalConfigurationGroup* oscan = 4321 4486 new HorizontalConfigurationGroup(false, false, true, true); … … 4323 4488 new VerticalConfigurationGroup(false, false, true, true); 4324 4489 VerticalConfigurationGroup *ocol2 = 4325 4490 new VerticalConfigurationGroup(false, false, true, true); 4326 ocol1->addChild(VertScanPercentage( ));4327 ocol1->addChild(YScanDisplacement( ));4328 ocol2->addChild(HorizScanPercentage( ));4329 ocol2->addChild(XScanDisplacement( ));4491 ocol1->addChild(VertScanPercentage(settings)); 4492 ocol1->addChild(YScanDisplacement(settings)); 4493 ocol2->addChild(HorizScanPercentage(settings)); 4494 ocol2->addChild(XScanDisplacement(settings)); 4330 4495 oscan->addChild(ocol1); 4331 4496 oscan->addChild(ocol2); 4332 4497 4333 4498 HorizontalConfigurationGroup* aspect_fill = 4334 4499 new HorizontalConfigurationGroup(false, false, true, true); 4335 aspect_fill->addChild(AspectOverride( ));4336 aspect_fill->addChild(AdjustFill( ));4500 aspect_fill->addChild(AspectOverride(settings)); 4501 aspect_fill->addChild(AdjustFill(settings)); 4337 4502 4338 4503 general2->addChild(oscan); 4339 4504 general2->addChild(aspect_fill); 4340 general2->addChild(LetterboxingColour()); 4341 general2->addChild(PIPLocationComboBox()); 4342 general2->addChild(PlaybackExitPrompt()); 4343 general2->addChild(EndOfRecordingExitPrompt()); 4344 addChild(general2); 4505 general2->addChild(LetterboxingColour(settings)); 4506 general2->addChild(PIPLocationComboBox(settings)); 4507 general2->addChild(PlaybackExitPrompt(settings)); 4508 general2->addChild(EndOfRecordingExitPrompt(settings)); 4509 if (base) 4510 base->addChild(general2); 4511 else 4512 addChild(general2); 4345 4513 4346 4514 QString tmp = QString(" (%1/%2)").arg(++i).arg(total); 4347 addChild(new PlaybackProfileConfigs(tmp)); 4515 if (base) 4516 base->addChild(new PlaybackProfileConfigs(tmp, settings)); 4517 else 4518 addChild(new PlaybackProfileConfigs(tmp, settings)); 4348 4519 4520 if (!settings) 4521 { 4349 4522 VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false); 4350 4523 pbox->setLabel(QObject::tr("View Recordings") + 4351 4524 QString(" (%1/%2)").arg(++i).arg(total)); … … 4373 4546 pbox3->addChild(DisplayGroupTitleSort()); 4374 4547 pbox3->addChild(new WatchListSettings()); 4375 4548 addChild(pbox3); 4549 } 4376 4550 4377 4551 VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false); 4378 4552 seek->setLabel(QObject::tr("Seeking") + 4379 4553 QString(" (%1/%2)").arg(++i).arg(total)); 4380 seek->addChild(SmartForward()); 4381 seek->addChild(FFRewReposTime()); 4382 seek->addChild(FFRewReverse()); 4383 seek->addChild(ExactSeeking()); 4384 addChild(seek); 4554 if (settings) 4555 seek->setLabel(QObject::tr("Playback group settings for ") + 4556 settings->mGroupName + " - " + 4557 seek->getLabel()); 4558 seek->addChild(SmartForward(settings)); 4559 seek->addChild(FFRewReposTime(settings)); 4560 seek->addChild(FFRewReverse(settings)); 4561 seek->addChild(ExactSeeking(settings)); 4562 if (base) 4563 base->addChild(seek); 4564 else 4565 addChild(seek); 4385 4566 4386 4567 VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false); 4387 4568 comms->setLabel(QObject::tr("Commercial Skip") + 4388 4569 QString(" (%1/%2)").arg(++i).arg(total)); 4389 comms->addChild(AutoCommercialSkip()); 4390 comms->addChild(CommRewindAmount()); 4391 comms->addChild(CommNotifyAmount()); 4570 if (settings) 4571 comms->setLabel(QObject::tr("Playback group settings for ") + 4572 settings->mGroupName + " - " + 4573 comms->getLabel()); 4574 comms->addChild(AutoCommercialSkip(settings)); 4575 comms->addChild(CommRewindAmount(settings)); 4576 comms->addChild(CommNotifyAmount(settings)); 4577 if (!settings) // these are global settings, not host-specific 4578 { 4392 4579 comms->addChild(MaximumCommercialSkip()); 4393 4580 comms->addChild(MergeShortCommBreaks()); 4394 4581 comms->addChild(CommSkipAllBlanks()); 4395 addChild(comms); 4582 } 4583 if (base) 4584 base->addChild(comms); 4585 else 4586 addChild(comms); 4396 4587 4397 4588 #if CONFIG_DARWIN 4398 4589 VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false); 4399 4590 mac1->setLabel(QObject::tr("Mac OS X Video Settings") + 4400 4591 QString(" (%1/%2)").arg(++i).arg(total)); 4592 if (settings) 4593 mac1->setLabel(QObject::tr("Playback group settings for ") + 4594 settings->mGroupName + " - " + 4595 mac1->getLabel()); 4596 if (!settings) 4597 { 4401 4598 mac1->addChild(MacGammaCorrect()); 4402 4599 mac1->addChild(MacScaleUp()); 4403 4600 mac1->addChild(MacFullSkip()); 4404 addChild(mac1); 4601 } 4602 if (base) 4603 base->addChild(mac1); 4604 else 4605 addChild(mac1); 4405 4606 4406 4607 VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false); 4407 4608 mac2->setLabel(QObject::tr("Mac OS X Video Settings") + 4408 4609 QString(" (%1/%2)").arg(++i).arg(total)); 4610 if (settings) 4611 mac2->setLabel(QObject::tr("Playback group settings for ") + 4612 settings->mGroupName + " - " + 4613 mac2->getLabel()); 4614 if (!setings) 4615 { 4409 4616 mac2->addChild(new MacMainSettings()); 4410 4617 mac2->addChild(new MacFloatSettings()); 4411 4618 … … 4414 4621 row->addChild(new MacDockSettings()); 4415 4622 row->addChild(new MacDesktopSettings()); 4416 4623 mac2->addChild(row); 4624 } 4417 4625 4418 addChild(mac2); 4626 if (base) 4627 base->addChild(mac2); 4628 else 4629 addChild(mac2); 4419 4630 #endif 4420 4631 } 4421 4632 4422 OSDSettings::OSDSettings() 4633 OSDSettings::OSDSettings(PlaySettings *settings, 4634 ConfigurationWizard *base) 4423 4635 { 4424 4636 VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false); 4425 4637 osd->setLabel(QObject::tr("On-screen Display")); 4638 if (settings) 4639 osd->setLabel(QObject::tr("Playback group settings for ") + 4640 settings->mGroupName + " - " + 4641 osd->getLabel()); 4426 4642 4427 osd->addChild(new ThemeSelector("OSDTheme")); 4428 osd->addChild(OSDGeneralTimeout()); 4429 osd->addChild(OSDProgramInfoTimeout()); 4430 osd->addChild(OSDFont()); 4431 osd->addChild(OSDThemeFontSizeType()); 4432 osd->addChild(EnableMHEG()); 4433 osd->addChild(PersistentBrowseMode()); 4434 osd->addChild(BrowseAllTuners()); 4435 addChild(osd); 4643 osd->addChild(ThemeSelector("OSDTheme", settings)); 4644 osd->addChild(OSDGeneralTimeout(settings)); 4645 osd->addChild(OSDProgramInfoTimeout(settings)); 4646 osd->addChild(OSDFont(settings)); 4647 osd->addChild(OSDThemeFontSizeType(settings)); 4648 osd->addChild(EnableMHEG(settings)); 4649 if (!settings) 4650 { 4651 osd->addChild(PersistentBrowseMode(settings)); 4652 osd->addChild(BrowseAllTuners(settings)); 4653 } 4654 if (base) 4655 base->addChild(osd); 4656 else 4657 addChild(osd); 4436 4658 4437 4659 VerticalConfigurationGroup *udp = new VerticalConfigurationGroup(false); 4438 4660 udp->setLabel(QObject::tr("UDP OSD Notifications")); 4439 udp->addChild(OSDNotifyTimeout()); 4440 udp->addChild(UDPNotifyPort()); 4441 addChild(udp); 4661 if (settings) 4662 udp->setLabel(QObject::tr("Playback group settings for ") + 4663 settings->mGroupName + " - " + 4664 udp->getLabel()); 4665 udp->addChild(OSDNotifyTimeout(settings)); 4666 udp->addChild(UDPNotifyPort(settings)); 4667 if (base) 4668 base->addChild(udp); 4669 else 4670 addChild(udp); 4442 4671 4443 4672 VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false); 4444 4673 cc->setLabel(QObject::tr("Analog Closed Captions")); 4445 cc->addChild(OSDCCFont()); 4674 if (settings) 4675 cc->setLabel(QObject::tr("Playback group settings for ") + 4676 settings->mGroupName + " - " + 4677 cc->getLabel()); 4678 cc->addChild(OSDCCFont(settings)); 4446 4679 //cc->addChild(DecodeVBIFormat()); 4447 cc->addChild(CCBackground()); 4448 cc->addChild(DefaultCCMode()); 4449 cc->addChild(PreferCC708()); 4450 addChild(cc); 4680 cc->addChild(CCBackground(settings)); 4681 cc->addChild(DefaultCCMode(settings)); 4682 cc->addChild(PreferCC708(settings)); 4683 if (base) 4684 base->addChild(cc); 4685 else 4686 addChild(cc); 4451 4687 4452 addChild(OSDCC708Settings()); 4453 addChild(OSDCC708Fonts()); 4454 addChild(ExternalSubtitleSettings()); 4688 if (base) 4689 { 4690 base->addChild(OSDCC708Settings(settings)); 4691 base->addChild(OSDCC708Fonts(settings)); 4692 base->addChild(ExternalSubtitleSettings(settings)); 4693 } 4694 else 4695 { 4696 addChild(OSDCC708Settings(settings)); 4697 addChild(OSDCC708Fonts(settings)); 4698 addChild(ExternalSubtitleSettings(settings)); 4699 } 4455 4700 4456 4701 #if CONFIG_DARWIN 4457 4702 // Any Mac OS-specific OSD stuff would go here. … … 4603 4848 VerticalConfigurationGroup* theme = new VerticalConfigurationGroup(false); 4604 4849 theme->setLabel(QObject::tr("Theme")); 4605 4850 4606 theme->addChild( newThemeSelector("Theme"));4851 theme->addChild(ThemeSelector("Theme")); 4607 4852 4608 4853 theme->addChild(ThemeCacheSize()); 4609 4854 -
programs/mythfrontend/main.cpp
34 34 #include "globalsettings.h" 35 35 #include "profilegroup.h" 36 36 #include "playgroup.h" 37 #include "playsettings.h" 37 38 #include "networkcontrol.h" 38 39 #include "DVDRingBuffer.h" 39 40 #include "scheduledrecording.h" … … 487 488 delete statusbox; 488 489 } 489 490 491 ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 492 { 493 return new PlaybackSettings(settings, base); 494 } 495 496 ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 497 { 498 return new OSDSettings(settings, base); 499 } 500 501 ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 502 { 503 return new MainGeneralSettings(settings, base); 504 } 505 506 static PlayGroupEditor::SettingsLookup pbgroupSetup[] = { 507 createPlaybackSettingsForPlaybackGroup, 508 createOSDSettingsForPlaybackGroup, 509 createMainGeneralSettingsForPlaybackGroup 510 }; 511 490 512 void TVMenuCallback(void *data, QString &selection) 491 513 { 492 514 (void)data; … … 579 601 } 580 602 else if (sel == "settings playgroup") 581 603 { 582 PlayGroupEditor editor; 604 PlayGroupEditor editor(pbgroupSetup, 605 sizeof(pbgroupSetup)/sizeof(*pbgroupSetup)); 583 606 editor.exec(); 584 607 } 585 608 else if (sel == "settings general") … … 771 794 } 772 795 } 773 796 delete tmprbuf; 797 pginfo->SetPlaybackGroup("Videos"); 774 798 } 775 799 else if (pginfo->IsVideo()) 800 { 776 801 pos = pginfo->QueryBookmark(); 802 pginfo->SetPlaybackGroup("Videos"); 803 } 777 804 778 805 if (pos > 0) 779 806 { -
programs/mythfrontend/globalsettings.h
9 9 #include "videodisplayprofile.h" 10 10 11 11 class QFileInfo; 12 class PlaySettings; 12 13 13 14 class AudioOutputDevice : public HostComboBox 14 15 { … … 36 37 class PlaybackSettings : public ConfigurationWizard 37 38 { 38 39 public: 39 PlaybackSettings(); 40 PlaybackSettings(PlaySettings *settings=NULL, 41 ConfigurationWizard *base=NULL); 40 42 }; 41 43 42 44 class OSDSettings: virtual public ConfigurationWizard 43 45 { 44 46 public: 45 OSDSettings(); 47 OSDSettings(PlaySettings *settings=NULL, 48 ConfigurationWizard *base=NULL); 46 49 }; 47 50 48 51 class GeneralSettings : public ConfigurationWizard … … 66 69 class MainGeneralSettings : public ConfigurationWizard 67 70 { 68 71 public: 69 MainGeneralSettings(); 72 MainGeneralSettings(PlaySettings *settings=NULL, 73 ConfigurationWizard *base=NULL); 70 74 }; 71 75 72 76 class GeneralRecPrioritiesSettings : public ConfigurationWizard … … 154 158 Q_OBJECT 155 159 156 160 public: 157 PlaybackProfileConfigs(const QString &str );161 PlaybackProfileConfigs(const QString &str, PlaySettings *settings); 158 162 virtual ~PlaybackProfileConfigs(); 159 163 160 164 private: … … 166 170 167 171 private: 168 172 QStringList profiles; 169 HostComboBox*grouptrigger;173 ComboBoxSetting *grouptrigger; 170 174 }; 171 175 172 176 #endif -
programs/mythavtest/main.cpp
22 22 #include "dbcheck.h" 23 23 #include "myththemebase.h" 24 24 #include "audiopulseutil.h" 25 #include "playsettings.h" 25 26 26 27 static void *run_priv_thread(void *data) 27 28 { … … 187 188 if (pa_ret != GENERIC_EXIT_OK) 188 189 return pa_ret; 189 190 190 #if defined(Q_OS_MACX)191 // Mac OS X doesn't define the AudioOutputDevice setting192 #else193 QString auddevice = gCoreContext->GetSetting("AudioOutputDevice");194 if (auddevice.isEmpty())195 {196 VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "197 "to run 'mythfrontend', not 'mythtv'.");198 return TV_EXIT_NO_AUDIO;199 }200 #endif201 202 191 MythMainWindow *mainWindow = GetMythMainWindow(); 203 192 mainWindow->Init(); 204 193 MythThemeBase *theme = new MythThemeBase(); … … 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.");