Ticket #8088: 8088_playgroups_v1.patch
File 8088_playgroups_v1.patch, 108.2 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/videoout_vdpau.h
16 16 { 17 17 public: 18 18 static void GetRenderOptions(render_opts &opts); 19 VideoOutputVDPAU( MythCodecID codec_id);19 VideoOutputVDPAU(PlaySettings *settings, MythCodecID codec_id); 20 20 ~VideoOutputVDPAU(); 21 21 bool Init(int width, int height, float aspect, WId winid, 22 22 int winx, int winy, int winw, int winh, WId embedid = 0); … … 49 49 const QSize &video_dim); 50 50 static MythCodecID GetBestSupportedCodec(uint width, uint height, 51 51 uint stream_type, 52 bool no_acceleration); 52 bool no_acceleration, 53 PlaySettings *settings); 53 54 DisplayInfo GetDisplayInfo(void); 54 55 virtual bool IsPIPSupported(void) const { return true; } 55 56 virtual bool IsPBPSupported(void) const { return false; } -
libs/libmythtv/NuppelVideoPlayer.cpp
59 59 #include "util-osx-cocoa.h" 60 60 #include "mythverbose.h" 61 61 #include "myth_imgconvert.h" 62 #include "playsettings.h" 62 63 63 64 extern "C" { 64 65 #include "vbitext/vbi.h" … … 231 232 // Playback (output) zoom control 232 233 detect_letter_box = new DetectLetterbox(this); 233 234 234 vbimode = VBIMode::Parse(gContext->GetSetting("VbiFormat"));235 236 commrewindamount = gContext->GetNumSetting("CommRewindAmount",0);237 commnotifyamount = gContext->GetNumSetting("CommNotifyAmount",0);238 decode_extra_audio=gContext->GetNumSetting("DecodeExtraAudio", 0);239 itvEnabled = gContext->GetNumSetting("EnableMHEG", 0);240 db_prefer708 = gContext->GetNumSetting("Prefer708Captions", 1);241 autocommercialskip = (CommSkipMode)242 gContext->GetNumSetting("AutoCommercialSkip", kCommSkipOff);243 244 235 lastIgnoredManualSkip = QDateTime::currentDateTime().addSecs(-10); 245 236 246 237 bzero(&txtbuffers, sizeof(txtbuffers)); … … 666 657 667 658 if (using_null_videoout) 668 659 { 669 videoOutput = new VideoOutputNull( );660 videoOutput = new VideoOutputNull(GetPlaySettings()); 670 661 if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(), 671 662 video_aspect, 0, 0, 0, 0, 0, 0)) 672 663 { … … 715 706 pipState, 716 707 video_disp_dim, video_aspect, 717 708 widget->winId(), display_rect, (video_frame_rate * play_speed), 718 0 /*embedid*/ );709 0 /*embedid*/, GetPlaySettings()); 719 710 720 711 if (!videoOutput) 721 712 { … … 737 728 videoOutput->EmbedInWidget(embx, emby, embw, embh); 738 729 } 739 730 740 SetCaptionsEnabled( gContext->GetNumSetting("DefaultCCMode"), false);731 SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0), false); 741 732 742 733 InitFilters(); 743 734 … … 788 779 789 780 void NuppelVideoPlayer::ReinitVideo(void) 790 781 { 791 if (!videoOutput->IsPreferredRenderer(video_disp_dim ))782 if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings())) 792 783 { 793 784 VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer.")); 794 785 SetErrored(QObject::tr("Need to switch video renderer.")); … … 2920 2911 refreshrate = 0; 2921 2912 lastsync = false; 2922 2913 2923 usevideotimebase = gContext->GetNumSetting("UseVideoTimebase", 0);2914 usevideotimebase = GetPlaySettings()->GetNumSetting("UseVideoTimebase", 0); 2924 2915 2925 2916 if (VERBOSE_LEVEL_CHECK(VB_PLAYBACK)) 2926 2917 output_jmeter = new Jitterometer("video_output", 100); … … 2959 2950 m_double_process = videoOutput->IsExtraProcessingRequired(); 2960 2951 2961 2952 videosync = VideoSync::BestMethod( 2962 videoOutput, fr_int, rf_int, m_double_framerate);2953 videoOutput, GetPlaySettings(), fr_int, rf_int, m_double_framerate); 2963 2954 2964 2955 // Make sure video sync can do it 2965 2956 if (videosync != NULL && m_double_framerate) … … 3448 3439 osd->SetListener(m_tv); 3449 3440 3450 3441 videoOutput->GetOSDBounds(total, visible, aspect, scaling, osd->GetThemeAspect()); 3451 osd->Init( total, frame_interval, visible, aspect, scaling);3442 osd->Init(GetPlaySettings(), total, frame_interval, visible, aspect, scaling); 3452 3443 3453 3444 videoOutput->InitOSD(osd); 3454 3445 … … 3522 3513 3523 3514 GetDecoder()->setExactSeeks(seeks); 3524 3515 3525 if ( gContext->GetNumSetting("ClearSavedPosition", 1) &&3516 if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) && 3526 3517 !player_ctx->IsPIP()) 3527 3518 { 3528 3519 if (player_ctx->buffer->isDVD()) … … 3790 3781 ++deleteIter; 3791 3782 if (deleteIter.key() == totalFrames) 3792 3783 { 3793 if (!( gContext->GetNumSetting("EndOfRecordingExitPrompt") == 13784 if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1 3794 3785 && !player_ctx->IsPIP() && 3795 3786 player_ctx->GetState() == kState_WatchingPreRecorded)) 3796 3787 { … … 3964 3955 3965 3956 if (sim_pip_players.isEmpty()) 3966 3957 { 3967 return (PIPLocation) gContext->GetNumSetting("PIPLocation", kPIPTopLeft);3958 return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation", kPIPTopLeft); 3968 3959 } 3969 3960 3970 3961 // order of preference, could be stored in db if we want it configurable … … 4821 4812 exactseeks = frame_exact_seek; 4822 4813 player_ctx = ctx; 4823 4814 livetv = ctx->tvchain; 4815 4816 vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", "")); 4824 4817 } 4825 4818 4826 4819 void NuppelVideoPlayer::SetDeleteIter(void) … … 7483 7476 { 7484 7477 QMutexLocker locker(&subtitleLock); 7485 7478 textSubtitles.Clear(); 7486 return TextSubtitleParser::LoadSubtitles(subtitleFileName, textSubtitles); 7479 return TextSubtitleParser::LoadSubtitles(subtitleFileName, textSubtitles, 7480 GetPlaySettings()); 7487 7481 } 7488 7482 7489 7483 void NuppelVideoPlayer::ChangeDVDTrack(bool ffw) -
libs/libmythtv/videooutwindow.cpp
30 30 #include "videooutwindow.h" 31 31 #include "osd.h" 32 32 #include "osdsurface.h" 33 #include "playsettings.h" 33 34 #include "NuppelVideoPlayer.h" 34 35 #include "videodisplayprofile.h" 35 36 #include "decoderbase.h" … … 54 55 const float VideoOutWindow::kManualZoomMinVerticalZoom = 0.5f; 55 56 const int VideoOutWindow::kManualZoomMaxMove = 50; 56 57 57 VideoOutWindow::VideoOutWindow( ) :58 VideoOutWindow::VideoOutWindow(PlaySettings *_settings) : 58 59 // DB settings 59 60 db_move(0, 0), db_scale_horiz(0.0f), db_scale_vert(0.0f), 60 61 db_pip_size(26), … … 85 86 86 87 // Various state variables 87 88 embedding(false), needrepaint(false), 88 allowpreviewepg(true), pip_state(kPIPOff) 89 allowpreviewepg(true), pip_state(kPIPOff), 90 91 settings(_settings) 89 92 { 90 93 db_pip_size = gContext->GetNumSetting("PIPSize", 26); 91 94 92 db_move = QPoint( gContext->GetNumSetting("xScanDisplacement", 0),93 gContext->GetNumSetting("yScanDisplacement", 0));95 db_move = QPoint(settings->GetNumSetting("xScanDisplacement", 0), 96 settings->GetNumSetting("yScanDisplacement", 0)); 94 97 db_use_gui_size = gContext->GetNumSetting("GuiSizeForTV", 0); 95 98 96 99 QDesktopWidget *desktop = NULL; … … 613 616 if (change) 614 617 { 615 618 db_scale_vert = 616 gContext->GetNumSetting("VertScanPercentage", 0) * 0.01f;619 settings->GetNumSetting("VertScanPercentage", 0) * 0.01f; 617 620 db_scale_horiz = 618 gContext->GetNumSetting("HorizScanPercentage", 0) * 0.01f;621 settings->GetNumSetting("HorizScanPercentage", 0) * 0.01f; 619 622 db_scaling_allowed = true; 620 623 } 621 624 else -
libs/libmythtv/videoout_d3d.cpp
948 948 opts.priorities->insert("direct3d", 55); 949 949 } 950 950 951 VideoOutputD3D::VideoOutputD3D( void)952 : VideoOutput( ), m_lock(QMutex::Recursive),951 VideoOutputD3D::VideoOutputD3D(PlaySettings *settings) 952 : VideoOutput(settings), m_lock(QMutex::Recursive), 953 953 m_hWnd(NULL), m_ctx(NULL), 954 954 m_video(NULL), m_osd(NULL), 955 955 m_d3d_osd(false), m_osd_ready(false), -
libs/libmythtv/videoout_opengl.cpp
38 38 opts.priorities->insert("opengl", 65); 39 39 } 40 40 41 VideoOutputOpenGL::VideoOutputOpenGL( void)42 : VideoOutput( ),41 VideoOutputOpenGL::VideoOutputOpenGL(PlaySettings *settings) 42 : VideoOutput(settings), 43 43 gl_context_lock(QMutex::Recursive), 44 44 gl_context(NULL), gl_videochain(NULL), 45 45 gl_osdchain(NULL), gl_pipchain_active(NULL), -
libs/libmythtv/videoout_quartz.cpp
65 65 #include "videodisplayprofile.h" 66 66 #include "videoout_dvdv.h" 67 67 68 class PlaySettings; 69 68 70 #define LOC QString("VideoOutputQuartz::") 69 71 #define LOC_ERR QString("VideoOutputQuartz Error: ") 70 72 … … 1108 1110 /** \class VideoOutputQuartz 1109 1111 * \brief Implementation of Quartz (Mac OS X windowing system) video output 1110 1112 */ 1111 VideoOutputQuartz::VideoOutputQuartz( 1113 VideoOutputQuartz::VideoOutputQuartz(PlaySettings *settings 1112 1114 MythCodecID _myth_codec_id, void *codec_priv) : 1113 VideoOutput( ), Started(false), data(new QuartzData()),1115 VideoOutput(settings), Started(false), data(new QuartzData()), 1114 1116 myth_codec_id(_myth_codec_id) 1115 1117 { 1116 1118 init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0); … … 1815 1817 MythCodecID VideoOutputQuartz::GetBestSupportedCodec( 1816 1818 uint width, uint height, 1817 1819 uint osd_width, uint osd_height, 1818 uint stream_type, uint fourcc )1820 uint stream_type, uint fourcc, PlaySettings *settings) 1819 1821 { 1820 1822 (void) osd_width; 1821 1823 (void) osd_height; 1822 1824 1823 VideoDisplayProfile vdp ;1825 VideoDisplayProfile vdp(settings); 1824 1826 vdp.SetInput(QSize(width, height)); 1825 1827 QString dec = vdp.GetDecoder(); 1826 1828 if ((dec == "libmpeg2") || (dec == "ffmpeg")) -
libs/libmythtv/avformatdecoder.cpp
28 28 #include "videodisplayprofile.h" 29 29 #include "mythuihelper.h" 30 30 #include "myth_imgconvert.h" 31 #include "playsettings.h" 31 32 32 33 #include "lcddevice.h" 33 34 … … 498 499 allow_ac3_passthru(false), allow_dts_passthru(false), 499 500 internal_vol(false), 500 501 disable_passthru(false), max_channels(2), 501 last_ac3_channels(0), 502 last_ac3_channels(0), dummy_frame(NULL), 502 503 // DVD 503 504 lastdvdtitle(-1), 504 505 decodeStillFrame(false), … … 526 527 527 528 cc608_build_parity_table(cc608_parity_table); 528 529 529 if ( gContext->GetNumSetting("CCBackground", 0))530 if (GetNVP()->GetPlaySettings()->GetNumSetting("CCBackground", 0)) 530 531 CC708Window::forceWhiteOnBlackText = true; 531 532 532 533 no_dts_hack = false; … … 1377 1378 codec = find_vdpau_decoder(codec, enc->codec_id); 1378 1379 1379 1380 if (selectedStream && 1380 ! gContext->GetNumSetting("DecodeExtraAudio", 0) &&1381 !GetNVP()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) && 1381 1382 !CODEC_IS_HWACCEL(codec)) 1382 1383 { 1383 1384 SetLowBuffers(false); … … 1812 1813 1813 1814 if (!is_db_ignored) 1814 1815 { 1815 VideoDisplayProfile vdp ;1816 VideoDisplayProfile vdp(GetNVP()->GetPlaySettings()); 1816 1817 vdp.SetInput(QSize(width, height)); 1817 1818 dec = vdp.GetDecoder(); 1818 1819 thread_count = vdp.GetMaxCPUs(); … … 1835 1836 MythCodecID vdpau_mcid; 1836 1837 vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec( 1837 1838 width, height, 1838 mpeg_version(enc->codec_id), no_hardware_decoders); 1839 mpeg_version(enc->codec_id), no_hardware_decoders, 1840 GetNVP()->GetPlaySettings()); 1839 1841 1840 1842 if (vdpau_mcid >= video_codec_id) 1841 1843 { … … 1867 1869 /* mpeg type */ mpeg_version(enc->codec_id), 1868 1870 /* xvmc pix fmt */ xvmc_pixel_format(enc->pix_fmt), 1869 1871 /* test surface */ codec_is_std(video_codec_id), 1870 /* force_xv */ force_xv); 1872 /* force_xv */ force_xv, 1873 GetNVP()->GetPlaySettings()); 1871 1874 1872 1875 if (mcid >= video_codec_id) 1873 1876 { … … 1900 1903 /* osd dim */ 0, 0, 1901 1904 /* mpeg type */ mpeg_version(enc->codec_id), 1902 1905 /* pixel format */ 1903 (PIX_FMT_YUV420P == enc->pix_fmt) ? FOURCC_I420 : 0); 1906 (PIX_FMT_YUV420P == enc->pix_fmt) ? FOURCC_I420 : 0, 1907 GetNVP()->GetPlaySettings()); 1904 1908 1905 1909 if (quartz_mcid >= video_codec_id) 1906 1910 { -
libs/libmythtv/osdtypes.cpp
18 18 #include "mythcontext.h" 19 19 #include "mythdialogs.h" 20 20 #include "mythverbose.h" 21 #include "playsettings.h" 21 22 22 23 #ifdef USING_FRIBIDI 23 24 #include "fribidi/fribidi.h" … … 2359 2360 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2360 2361 2361 2362 OSDTypeCC::OSDTypeCC(const QString &name, TTFFont *font, int xoff, int yoff, 2362 int dispw, int disph, float wmult, float hmult) 2363 int dispw, int disph, float wmult, float hmult, 2364 PlaySettings *settings) 2363 2365 : OSDType(name) 2364 2366 { 2365 2367 m_font = font; … … 2373 2375 2374 2376 QRect rect = QRect(0, 0, 0, 0); 2375 2377 m_box = new OSDTypeBox("cc_background", rect, wmult, hmult); 2376 m_ccbackground = gContext->GetNumSetting("CCBackground", 0);2378 m_ccbackground = settings->GetNumSetting("CCBackground", 0); 2377 2379 } 2378 2380 2379 2381 OSDTypeCC::~OSDTypeCC() … … 2603 2605 } 2604 2606 2605 2607 OSDType708CC::OSDType708CC(const QString &name, TTFFont *fonts[48], 2606 2608 int xoff, int yoff, int dispw, int disph) : 2607 2609 OSDType(name) 2608 2610 { 2609 2611 xoffset = xoff; -
libs/libmythtv/playgroup.cpp
2 2 #include "mythdb.h" 3 3 #include "playgroup.h" 4 4 #include "programinfo.h" 5 #include "playsettings.h" 5 6 6 7 // A parameter associated with the profile itself 7 8 class PlayGroupDBStorage : public SimpleDBStorage … … 211 212 return res; 212 213 } 213 214 214 PlayGroupEditor::PlayGroupEditor(void) : 215 listbox(new ListBoxSetting(this)), lastValue("Default") 215 PlayGroupEditor::PlayGroupEditor(SettingsLookup pbfunc, SettingsLookup osdfunc) : 216 listbox(new ListBoxSetting(this)), lastValue("Default"), 217 getPbSettings(pbfunc), getOsdSettings(osdfunc) 216 218 { 217 219 listbox->setLabel(tr("Playback Groups")); 218 220 addChild(listbox); … … 243 245 } 244 246 245 247 PlayGroup group(name); 248 if (getPbSettings || getOsdSettings) 249 { 250 PlaySettings *psettings = new PlaySettings(name); 251 if (getPbSettings) 252 getPbSettings(psettings, &group); 253 if (getOsdSettings) 254 getOsdSettings(psettings, &group); 255 } 246 256 if (group.exec() == QDialog::Accepted || !created) 247 257 lastValue = name; 248 258 else … … 277 287 query.bindValue(":NAME", name); 278 288 if (!query.exec()) 279 289 MythDB::DBError("PlayGroupEditor::doDelete", query); 290 PlaySettings::deleteGroup(name); 280 291 281 292 int lastIndex = listbox->getValueIndex(name); 282 293 lastValue = ""; -
libs/libmythtv/libmythtv.pro
179 179 SOURCES += iso639.cpp 180 180 SOURCES += mythsystemevent.cpp 181 181 182 HEADERS += playsettings.h 183 SOURCES += playsettings.cpp 184 182 185 # DiSEqC 183 186 HEADERS += diseqc.h diseqcsettings.h 184 187 SOURCES += diseqc.cpp diseqcsettings.cpp -
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/osdtypes.h
31 31 class OSDTypeText; 32 32 class OSDSurface; 33 33 class TV; 34 class PlaySettings; 34 35 35 36 typedef QHash<QString,QString> InfoMap; 36 37 typedef QMap<int,uint> HotKeyMap; … … 573 574 { 574 575 public: 575 576 OSDTypeCC(const QString &name, TTFFont *font, int xoff, int yoff, 576 int dispw, int disph, float wmult, float hmult); 577 int dispw, int disph, float wmult, float hmult, 578 PlaySettings *settings); 577 579 ~OSDTypeCC(); 578 580 579 581 void Reinit(float wmult, float hmult); -
libs/libmythtv/tv_play.h
56 56 class TV; 57 57 class OSDListTreeItemEnteredEvent; 58 58 class OSDListTreeItemSelectedEvent; 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; … … 593 594 static TVState RemoveRecording(TVState state); 594 595 void RestoreScreenSaver(const PlayerContext*); 595 596 596 void InitUDPNotifyEvent( void);597 void InitUDPNotifyEvent(PlaySettings *settings); 597 598 598 599 /// true if dialog is either videoplayexit, playexit or askdelete dialog 599 600 bool IsVideoExitDialog(const QString &dialog_name); -
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 pbfunc=0, SettingsLookup osdfunc=0); 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 getPbSettings; 51 SettingsLookup getOsdSettings; 47 52 }; 48 53 49 54 #endif -
libs/libmythtv/dbcheck.cpp
3569 3569 3570 3570 VideoDisplayProfile::CreateNewProfiles(host); 3571 3571 profiles = VideoDisplayProfile::GetProfiles(host); 3572 QString profile = VideoDisplayProfile::GetDefaultProfileName(host );3572 QString profile = VideoDisplayProfile::GetDefaultProfileName(host, NULL); 3573 3573 3574 3574 if (profiles.contains("Normal") && 3575 3575 (profile=="CPU++" || profile=="CPU+" || profile=="CPU--")) … … 5637 5637 " jump int(11) NOT NULL default '0'," 5638 5638 " PRIMARY KEY (`name`)" 5639 5639 ");", 5640 "CREATE TABLE playgroupsettings (" 5641 " playgroupname varchar(64) NOT NULL," 5642 " `value` varchar(128) NOT NULL," 5643 " `data` text," 5644 " overridden tinyint(1) NOT NULL," 5645 " PRIMARY KEY (playgroupname, `value`)" 5646 ");", 5640 5647 "CREATE TABLE powerpriority (" 5641 5648 " priorityname varchar(64) collate utf8_bin NOT NULL," 5642 5649 " recpriority int(10) NOT NULL default '0'," -
libs/libmythtv/videoout_vdpau.cpp
46 46 opts.deints->insert("vdpau", deints); 47 47 } 48 48 49 VideoOutputVDPAU::VideoOutputVDPAU( MythCodecID codec_id)50 : VideoOutput( ),49 VideoOutputVDPAU::VideoOutputVDPAU(PlaySettings *settings, MythCodecID codec_id) 50 : VideoOutput(settings), 51 51 m_codec_id(codec_id), m_win(0), m_render(NULL), 52 52 m_buffer_size(NUM_VDPAU_BUFFERS), m_pause_surface(0), 53 53 m_need_deintrefs(false), m_video_mixer(0), m_mixer_features(kVDPFeatNone), … … 857 857 858 858 MythCodecID VideoOutputVDPAU::GetBestSupportedCodec( 859 859 uint width, uint height, 860 uint stream_type, bool no_acceleration )860 uint stream_type, bool no_acceleration, PlaySettings *settings) 861 861 { 862 862 bool use_cpu = no_acceleration; 863 VideoDisplayProfile vdp ;863 VideoDisplayProfile vdp(settings); 864 864 vdp.SetInput(QSize(width, height)); 865 865 QString dec = vdp.GetDecoder(); 866 866 -
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
93 93 { 94 94 public: 95 95 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 96 VideoOutputD3D( );96 VideoOutputD3D(PlaySettings *settings); 97 97 ~VideoOutputD3D(); 98 98 99 99 bool Init(int width, int height, float aspect, WId winid, -
libs/libmythtv/playercontext.cpp
14 14 #include "videoouttypes.h" 15 15 #include "storagegroup.h" 16 16 #include "mythcontext.h" 17 #include "playsettings.h" 17 18 18 19 #define LOC QString("playCtx: ") 19 20 #define LOC_ERR QString("playCtx, Error: ") … … 435 436 WId embedwinid, const QRect *embedbounds, 436 437 bool muted) 437 438 { 438 int exact_seeking = gContext->GetNumSetting("ExactSeeking", 0);439 int exact_seeking = settings->GetNumSetting("ExactSeeking", 0); 439 440 440 441 if (HasNVP()) 441 442 { … … 450 451 _nvp->DisableHardwareDecoders(); 451 452 452 453 _nvp->SetPlayerInfo(tv, widget, exact_seeking, this); 454 _nvp->commrewindamount = settings->GetNumSetting("CommRewindAmount", 0); 455 _nvp->commnotifyamount = settings->GetNumSetting("CommNotifyAmount", 0); 456 _nvp->decode_extra_audio = settings->GetNumSetting("DecodeExtraAudio", 0); 457 _nvp->itvEnabled = settings->GetNumSetting("EnableMHEG", 0); 458 _nvp->db_prefer708 = settings->GetNumSetting("Prefer708Captions", 1); 453 459 _nvp->SetAudioInfo(gContext->GetSetting("AudioOutputDevice"), 454 460 gContext->GetSetting("PassThruOutputDevice"), 455 461 gContext->GetNumSetting("AudioSampleRate", 44100)); … … 888 894 /** 889 895 * \brief assign programinfo to the context 890 896 */ 891 void PlayerContext::SetPlayingInfo(const ProgramInfo *info )897 void PlayerContext::SetPlayingInfo(const ProgramInfo *info, PlaySettings *_settings) 892 898 { 893 899 bool ignoreDB = gContext->IsDatabaseIgnored(); 894 900 … … 900 906 playingInfo->MarkAsInUse(false); 901 907 delete playingInfo; 902 908 playingInfo = NULL; 909 // XXX delete settings? 903 910 } 904 911 905 912 if (info) … … 908 915 if (!ignoreDB) 909 916 playingInfo->MarkAsInUse(true, recUsage); 910 917 playingLen = playingInfo->CalculateLength(); 918 settings = (_settings ? _settings : new PlaySettings(playingInfo->playgroup)); 911 919 } 912 920 } 913 921 -
libs/libmythtv/NuppelVideoPlayer.h
196 196 bool GetAudioBufferStatus(uint &fill, uint &total) const; 197 197 PIPLocation GetNextPIPLocation(void) const; 198 198 199 PlaySettings *GetPlaySettings(void) const { 200 return player_ctx ? player_ctx->settings : NULL; 201 } 202 199 203 // Bool Gets 200 204 bool GetRawAudioState(void) const; 201 205 bool GetLimitKeyRepeat(void) const { return limitKeyRepeat; } -
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: … … 75 77 class TextSubtitleParser 76 78 { 77 79 public: 78 static bool LoadSubtitles(QString fileName, TextSubtitles &target); 80 static bool LoadSubtitles(QString fileName, TextSubtitles &target, 81 PlaySettings *settings); 79 82 }; 80 83 81 84 #endif -
libs/libmythtv/osd.h
70 70 class TeletextViewer; 71 71 class QStringList; 72 72 class QDomElement; 73 class PlaySettings; 73 74 74 75 class OSD : public QObject 75 76 { … … 78 79 OSD(); 79 80 ~OSD(void); 80 81 81 void Init( const QRect &totalBounds, int frameRate,82 void Init(PlaySettings *settings, const QRect &totalBounds, int frameRate, 82 83 const QRect &visibleBounds, float visibleAspect, float fontScaling); 83 84 84 85 OSDSurface *Display(void); … … 278 279 OSDListTreeType *runningTreeMenu; 279 280 QString treeMenuContainer; 280 281 282 PlaySettings *settings; 283 281 284 // EIA-708 captions 282 285 QString fontname; 283 286 QString ccfontname; -
libs/libmythtv/vsync.cpp
34 34 #include "mythcontext.h" 35 35 #include "mythverbose.h" 36 36 #include "mythmainwindow.h" 37 #include "playsettings.h" 37 38 38 39 #ifdef USING_XV 39 40 #include "videoout_xv.h" … … 76 77 * \brief Returns the most sophisticated video sync method available. 77 78 */ 78 79 VideoSync *VideoSync::BestMethod(VideoOutput *video_output, 80 PlaySettings *settings, 79 81 uint frame_interval, uint refresh_interval, 80 82 bool halve_frame_interval) 81 83 { 82 84 VideoSync *trial = NULL; 83 85 tryingVideoSync = true; 84 bool tryOpenGL = ( gContext->GetNumSetting("UseOpenGLVSync", 1) &&86 bool tryOpenGL = (settings->GetNumSetting("UseOpenGLVSync", 1) && 85 87 (getenv("NO_OPENGL_VSYNC") == NULL)); 86 88 87 89 // m_forceskip allows for skipping one sync method -
libs/libmythtv/tv_play.cpp
60 60 #include "tv_play_win.h" 61 61 #include "recordinginfo.h" 62 62 #include "mythsystemevent.h" 63 #include "playsettings.h" 63 64 64 65 #if ! HAVE_ROUND 65 66 #define round(x) ((int) ((x) + 0.5)) … … 190 191 bool inPlaylist, bool initByNetworkCommand) 191 192 { 192 193 VERBOSE(VB_PLAYBACK, LOC + "StartTV() -- begin"); 193 TV *tv = new TV();194 194 bool quitAll = false; 195 195 bool showDialogs = true; 196 196 bool playCompleted = false; … … 201 201 if (tvrec) 202 202 curProgram = new ProgramInfo(*tvrec); 203 203 204 PlaySettings settings(curProgram ? curProgram->playgroup : "Default"); 205 TV *tv = new TV(&settings); 206 204 207 // Initialize TV 205 208 if (!tv->Init()) 206 209 { … … 231 234 if (curProgram) 232 235 { 233 236 VERBOSE(VB_PLAYBACK, LOC + "tv->Playback() -- begin"); 234 if (!tv->Playback(*curProgram ))237 if (!tv->Playback(*curProgram, &settings)) 235 238 { 236 239 quitAll = true; 237 240 } … … 783 786 * \brief Performs instance initialiation not requiring access to database. 784 787 * \sa Init(void) 785 788 */ 786 TV::TV( void)789 TV::TV(PlaySettings *settings) 787 790 : // Configuration variables from database 788 791 baseFilters(""), 789 792 db_channel_format("<num> <sign>"), … … 921 924 kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]); 922 925 923 926 MythDB::getMythDB()->GetSettings(kv); 927 settings->AddToMap(kv); 924 928 925 929 // convert from minutes to ms. 926 930 db_idle_timeout = kv["LiveTVIdleTimeout"].toInt() * 60 * 1000; … … 934 938 db_use_gui_size_for_tv = kv["GuiSizeForTV"].toInt(); 935 939 db_start_in_guide = kv["WatchTVGuide"].toInt(); 936 940 db_toggle_bookmark = kv["AltClearSavedPosition"].toInt(); 941 VERBOSE(VB_GENERAL, QString("db_toggle_bookmark=%1").arg(db_toggle_bookmark)); 937 942 db_run_jobs_on_remote = kv["JobsRunOnRecordHost"].toInt(); 938 943 db_use_dvd_bookmark = kv["EnableDVDBookmark"].toInt(); 939 944 db_continue_embedded = kv["ContinueEmbeddedTVPlay"].toInt(); … … 1711 1716 } 1712 1717 1713 1718 1714 int TV::Playback(const ProgramInfo &rcinfo )1719 int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings) 1715 1720 { 1716 1721 wantsToQuit = false; 1717 1722 jumpToProgram = false; … … 1725 1730 return 0; 1726 1731 } 1727 1732 1728 mctx->SetPlayingInfo(&rcinfo );1733 mctx->SetPlayingInfo(&rcinfo, settings); 1729 1734 mctx->SetInitialTVState(false); 1730 1735 ScheduleStateChange(mctx); 1731 1736 … … 1808 1813 1809 1814 if (fileexists) 1810 1815 { 1811 Playback(pginfo); 1816 PlaySettings settings("Default"); 1817 Playback(pginfo, &settings); 1812 1818 retval = 1; 1813 1819 } 1814 1820 … … 2153 2159 { 2154 2160 OSD *osd = GetOSDLock(ctx); 2155 2161 ctx->LockPlayingInfo(__FILE__, __LINE__); 2156 if ( osd && (PlayGroup::GetCount() > 0))2162 if (ctx->playingInfo->playgroup != "Default" && osd && (PlayGroup::GetCount() > 0)) 2157 2163 osd->SetSettingsText(tr("%1 Settings") 2158 2164 .arg(tv_i18n(ctx->playingInfo->playgroup)), 3); 2159 2165 ctx->UnlockPlayingInfo(__FILE__, __LINE__); … … 5165 5171 return false; 5166 5172 } 5167 5173 5168 InitUDPNotifyEvent( );5174 InitUDPNotifyEvent(ctx->settings); 5169 5175 bool ok = false; 5170 5176 if (ctx->IsNullVideoDesired()) 5171 5177 { … … 11817 11823 GetMythUI()->RestoreScreensaver(); 11818 11824 } 11819 11825 11820 void TV::InitUDPNotifyEvent( void)11826 void TV::InitUDPNotifyEvent(PlaySettings *settings) 11821 11827 { 11822 11828 if (db_udpnotify_port && !udpnotify) 11823 11829 { 11824 udpnotify = new UDPNotify(db_udpnotify_port );11830 udpnotify = new UDPNotify(db_udpnotify_port, settings); 11825 11831 connect(udpnotify, 11826 11832 SIGNAL(AddUDPNotifyEvent( 11827 11833 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); … … 121 123 static QString GetDecoderName(const QString &decoder); 122 124 static QString GetDecoderHelp(QString decoder = QString::null); 123 125 124 static QString GetDefaultProfileName(const QString &hostname); 126 static QString GetDefaultProfileName(const QString &hostname, 127 PlaySettings *settings); 125 128 static void SetDefaultProfileName(const QString &profilename, 126 129 const QString &hostname); 127 130 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 "mythcontext.h" 12 13 #include "mythverbose.h" … … 107 108 PIPState pipState, 108 109 const QSize &video_dim, float video_aspect, 109 110 WId win_id, const QRect &display_rect, 110 float video_prate, WId embed_id) 111 float video_prate, WId embed_id, 112 PlaySettings *settings) 111 113 { 112 114 (void) codec_priv; 113 115 … … 152 154 QString renderer = QString::null; 153 155 if (renderers.size() > 0) 154 156 { 155 VideoDisplayProfile vprof ;157 VideoDisplayProfile vprof(settings); 156 158 vprof.SetInput(video_dim); 157 159 158 160 QString tmp = vprof.GetVideoRenderer(); … … 180 182 181 183 #ifdef USING_DIRECTFB 182 184 if (renderer == "directfb") 183 vo = new VideoOutputDirectfb( );185 vo = new VideoOutputDirectfb(settings); 184 186 #endif // USING_DIRECTFB 185 187 186 188 #ifdef USING_MINGW 187 189 if (renderer == "direct3d") 188 vo = new VideoOutputD3D( );190 vo = new VideoOutputD3D(settings); 189 191 #endif // USING_MINGW 190 192 191 193 #ifdef Q_OS_MACX 192 194 if (osxlist.contains(renderer)) 193 vo = new VideoOutputQuartz( codec_id, codec_priv);195 vo = new VideoOutputQuartz(settings, codec_id, codec_priv); 194 196 #endif // Q_OS_MACX 195 197 196 198 #ifdef USING_OPENGL_VIDEO 197 199 if (renderer == "opengl") 198 vo = new VideoOutputOpenGL( );200 vo = new VideoOutputOpenGL(settings); 199 201 #endif // USING_OPENGL_VIDEO 200 202 201 203 #ifdef USING_VDPAU 202 204 if (renderer == "vdpau") 203 vo = new VideoOutputVDPAU( codec_id);205 vo = new VideoOutputVDPAU(settings, codec_id); 204 206 #endif // USING_VDPAU 205 207 206 208 #ifdef USING_XV 207 209 if (xvlist.contains(renderer)) 208 vo = new VideoOutputXv( codec_id);210 vo = new VideoOutputXv(settings, codec_id); 209 211 #endif // USING_XV 210 212 211 213 if (vo) … … 302 304 * \brief This constructor for VideoOutput must be followed by an 303 305 * Init(int,int,float,WId,int,int,int,int,WId) call. 304 306 */ 305 VideoOutput::VideoOutput( ) :307 VideoOutput::VideoOutput(PlaySettings *_settings) : 306 308 // DB Settings 307 309 db_display_dim(0,0), 308 310 db_aspectoverride(kAspect_Off), db_adjustfill(kAdjustFill_Off), … … 336 338 display_res(NULL), 337 339 338 340 // Physical display 339 monitor_sz(640,480), monitor_dim(400,300) 341 monitor_sz(640,480), monitor_dim(400,300), 340 342 343 settings(_settings) 344 341 345 { 342 346 bzero(&pip_tmp_image, sizeof(pip_tmp_image)); 343 db_display_dim = QSize( gContext->GetNumSetting("DisplaySizeWidth", 0),344 gContext->GetNumSetting("DisplaySizeHeight", 0));347 db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth", 0), 348 settings->GetNumSetting("DisplaySizeHeight", 0)); 345 349 346 350 db_pict_attr[kPictureAttribute_Brightness] = 347 gContext->GetNumSetting("PlaybackBrightness", 50);351 settings->GetNumSetting("PlaybackBrightness", 50); 348 352 db_pict_attr[kPictureAttribute_Contrast] = 349 gContext->GetNumSetting("PlaybackContrast", 50);353 settings->GetNumSetting("PlaybackContrast", 50); 350 354 db_pict_attr[kPictureAttribute_Colour] = 351 gContext->GetNumSetting("PlaybackColour", 50);355 settings->GetNumSetting("PlaybackColour", 50); 352 356 db_pict_attr[kPictureAttribute_Hue] = 353 gContext->GetNumSetting("PlaybackHue", 0);357 settings->GetNumSetting("PlaybackHue", 0); 354 358 355 359 db_aspectoverride = (AspectOverrideMode) 356 gContext->GetNumSetting("AspectOverride", 0);360 settings->GetNumSetting("AspectOverride", 0); 357 361 db_adjustfill = (AdjustFillMode) 358 gContext->GetNumSetting("AdjustFill", 0);362 settings->GetNumSetting("AdjustFill", 0); 359 363 db_letterbox_colour = (LetterBoxColour) 360 gContext->GetNumSetting("LetterboxColour", 0);364 settings->GetNumSetting("LetterboxColour", 0); 361 365 db_use_picture_controls = 362 gContext->GetNumSetting("UseOutputPictureControls", 0);366 settings->GetNumSetting("UseOutputPictureControls", 0); 363 367 364 368 if (!gContext->IsDatabaseIgnored()) 365 db_vdisp_profile = new VideoDisplayProfile( );369 db_vdisp_profile = new VideoDisplayProfile(settings); 366 370 367 windows.push_back(VideoOutWindow( ));371 windows.push_back(VideoOutWindow(settings)); 368 372 } 369 373 370 374 /** … … 433 437 return QString::null; 434 438 } 435 439 436 bool VideoOutput::IsPreferredRenderer(QSize video_size )440 bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings) 437 441 { 438 442 if (!db_vdisp_profile || (video_size == windows[0].GetVideoDispDim())) 439 443 return true; 440 444 441 VideoDisplayProfile vdisp ;445 VideoDisplayProfile vdisp(settings); 442 446 vdisp.SetInput(video_size); 443 447 QString new_rend = vdisp.GetVideoRenderer(); 444 448 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
27 27 class LiveTVChain; 28 28 class MythDialog; 29 29 class QPainter; 30 class PlaySettings; 30 31 31 32 typedef enum 32 33 { … … 90 91 void SetRecorder(RemoteEncoder *rec); 91 92 void SetTVChain(LiveTVChain *chain); 92 93 void SetRingBuffer(RingBuffer *buf); 93 void SetPlayingInfo(const ProgramInfo *info );94 void SetPlayingInfo(const ProgramInfo *info, PlaySettings *settings=NULL); 94 95 void SetPlayGroup(const QString &group); 95 96 void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state); 96 97 void SetPIPLocation(int loc) { pipLocation = loc; } … … 145 146 LiveTVChain *tvchain; 146 147 RingBuffer *buffer; 147 148 ProgramInfo *playingInfo; ///< Currently playing info 149 PlaySettings *settings; // corresponding to playingInfo 148 150 long long playingLen; ///< Initial CalculateLength() 149 151 bool nohardwaredecoders; // < Disable use of VDPAU decoding 150 152 bool decoding; ///< Video decoder thread started -
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
166 166 * \see VideoOutput, VideoBuffers 167 167 * 168 168 */ 169 VideoOutputXv::VideoOutputXv( MythCodecID codec_id)170 : VideoOutput( ),169 VideoOutputXv::VideoOutputXv(PlaySettings *settings, MythCodecID codec_id) 170 : VideoOutput(settings), 171 171 myth_codec_id(codec_id), video_output_subtype(XVUnknown), 172 172 global_lock(QMutex::Recursive), 173 173 … … 408 408 * \return port number if it succeeds, else -1. 409 409 */ 410 410 int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root, 411 PlaySettings *settings, 411 412 MythCodecID mcodecid, 412 413 uint width, uint height, 413 414 bool &xvsetdefaults, … … 492 493 } 493 494 494 495 // figure out if we want chromakeying.. 495 VideoDisplayProfile vdp ;496 VideoDisplayProfile vdp(settings); 496 497 vdp.SetInput(QSize(width, height)); 497 498 bool check_for_colorkey = (vdp.GetOSDRenderer() == "chromakey"); 498 499 … … 785 786 disp->StartLog(); 786 787 QString adaptor_name = QString::null; 787 788 const QSize video_dim = windows[0].GetVideoDim(); 788 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), mcodecid,789 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, mcodecid, 789 790 video_dim.width(), video_dim.height(), 790 791 xv_set_defaults, 791 792 xvmc_chroma, &xvmc_surf_info, &adaptor_name); … … 864 865 disp->StartLog(); 865 866 QString adaptor_name = QString::null; 866 867 const QSize video_dim = windows[0].GetVideoDim(); 867 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), kCodec_MPEG2,868 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, kCodec_MPEG2, 868 869 video_dim.width(), video_dim.height(), 869 870 xv_set_defaults, 0, NULL, &adaptor_name); 870 871 if (xv_port == -1) … … 1018 1019 uint width, uint height, 1019 1020 uint osd_width, uint osd_height, 1020 1021 uint stream_type, int xvmc_chroma, 1021 bool test_surface, bool force_xv) 1022 bool test_surface, bool force_xv, 1023 PlaySettings *settings) 1022 1024 { 1023 1025 (void)width, (void)height, (void)osd_width, (void)osd_height; 1024 1026 (void)stream_type, (void)xvmc_chroma, (void)test_surface; … … 1029 1031 return ret; 1030 1032 1031 1033 #ifdef USING_XVMC 1032 VideoDisplayProfile vdp ;1034 VideoDisplayProfile vdp(settings); 1033 1035 vdp.SetInput(QSize(width, height)); 1034 1036 QString dec = vdp.GetDecoder(); 1035 1037 if ((dec == "libmpeg2") || (dec == "ffmpeg")) … … 1079 1081 1080 1082 ok = false; 1081 1083 bool dummy; 1082 int port = GrabSuitableXvPort(disp, disp->GetRoot(), ret, width, height,1084 int port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, ret, width, height, 1083 1085 dummy, xvmc_chroma, &info); 1084 1086 if (port >= 0) 1085 1087 { -
libs/libmythtv/udpnotify.cpp
31 31 #include "udpnotify.h" 32 32 #include "mythcontext.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 = gContext->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
29 29 class FilterChain; 30 30 class FilterManager; 31 31 class OpenGLContextGLX; 32 class PlaySettings; 32 33 33 34 typedef QMap<NuppelVideoPlayer*,PIPLocation> PIPMap; 34 35 … … 49 50 PIPState pipState, 50 51 const QSize &video_dim, float video_aspect, 51 52 WId win_id, const QRect &display_rect, 52 float video_prate, WId embed_id); 53 float video_prate, WId embed_id, 54 PlaySettings *settings); 53 55 54 VideoOutput( );56 VideoOutput(PlaySettings *settings); 55 57 virtual ~VideoOutput(); 56 58 57 59 virtual bool Init(int width, int height, float aspect, … … 59 61 int winh, WId embedid = 0); 60 62 virtual void InitOSD(OSD *osd); 61 63 virtual void SetVideoFrameRate(float); 62 virtual bool IsPreferredRenderer(QSize video_size );64 virtual bool IsPreferredRenderer(QSize video_size, PlaySettings *settings); 63 65 virtual bool SetDeinterlacingEnabled(bool); 64 66 virtual bool SetupDeinterlace(bool i, const QString& ovrf=""); 65 67 virtual void FallbackDeint(void); … … 328 330 // Display information 329 331 QSize monitor_sz; 330 332 QSize monitor_dim; 333 334 PlaySettings *settings; 331 335 }; 332 336 333 337 #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) … … 112 113 m_subtitles.clear(); 113 114 } 114 115 115 bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target) 116 bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target, 117 PlaySettings *settings) 116 118 { 117 119 demux_sputext_t sub_data; 118 120 sub_data.rbuffer = new RingBuffer(fileName, 0, false); … … 130 132 target.SetFrameBasedTiming(!sub_data.uses_time); 131 133 132 134 QTextCodec *textCodec = NULL; 133 QString codec = gContext->GetSetting("SubtitleCodec", "");135 QString codec = settings->GetSetting("SubtitleCodec", ""); 134 136 if (!codec.isEmpty()) 135 137 textCodec = QTextCodec::codecForName(codec.toLatin1()); 136 138 if (!textCodec) -
libs/libmythtv/osd.cpp
32 32 #include "mythverbose.h" 33 33 #include "util.h" 34 34 #include "channelutil.h" 35 #include "playsettings.h" 35 36 36 37 #include "x11colors.h" 37 38 #include "mythdirs.h" … … 42 43 static char *cc708_default_font_names[16]; 43 44 static bool cc708_defaults_initialized = false; 44 45 static QMutex cc708_init_lock; 45 static void initialize_osd_fonts( void);46 static void initialize_osd_fonts(PlaySettings *settings); 46 47 47 48 #define LOC QString("OSD: ") 48 49 #define LOC_ERR QString("OSD, Error: ") … … 76 77 editarrowRect(), drawSurface(NULL), 77 78 changed(false), runningTreeMenu(NULL), 78 79 treeMenuContainer(""), 80 settings(NULL), 79 81 // EIA-608 captions 80 82 fontname(""), ccfontname(""), 81 83 fontSizeType(""), … … 155 157 } 156 158 } 157 159 158 void OSD::Init( const QRect &osd_bounds, int frameRate,160 void OSD::Init(PlaySettings *_settings, const QRect &osd_bounds, int frameRate, 159 161 const QRect &vis_bounds, float visibleAspect, float fontScaling) 160 162 { 163 settings = _settings; 161 164 removeHTML.setMinimal(true); 162 165 163 166 fscale = fontScaling; … … 172 175 drawSurface = new OSDSurface(osd_bounds.width(), osd_bounds.height()); 173 176 174 177 if (!cc708_defaults_initialized) 175 initialize_osd_fonts( );178 initialize_osd_fonts(settings); 176 179 177 180 for (uint i = 0; i < 16; i++) 178 181 cc708fontnames[i] = cc708_default_font_names[i]; … … 238 241 QString name = "cc_font"; 239 242 int fontsize = m_themeinfo->BaseRes()->height() / 27; 240 243 241 ccfont = LoadFont( gContext->GetSetting("OSDCCFont"), fontsize);244 ccfont = LoadFont(settings->GetSetting("OSDCCFont", ""), fontsize); 242 245 243 246 if (ccfont) 244 247 fontMap[name] = ccfont; … … 274 277 275 278 OSDTypeCC *ccpage = 276 279 new OSDTypeCC(name, ccfont, sub_xoff, sub_yoff, 277 sub_dispw, sub_disph, wmult, hmult );280 sub_dispw, sub_disph, wmult, hmult, settings); 278 281 container->AddType(ccpage); 279 282 return true; 280 283 } … … 293 296 294 297 // Create fonts... 295 298 TTFFont* ccfonts[48]; 296 uint z = gContext->GetNumSetting("OSDCC708TextZoom", 100) *299 uint z = settings->GetNumSetting("OSDCC708TextZoom", 100) * 297 300 m_themeinfo->BaseRes()->height(); 298 301 uint fontsizes[3] = { z / 3600, z / 2900, z / 2200 }; 299 302 for (uint i = 0; i < 48; i++) … … 356 359 if (!font) 357 360 { 358 361 int fontsize = 440 / 26; 359 font = LoadFont( gContext->GetSetting("OSDCCFont"), fontsize);362 font = LoadFont(settings->GetSetting("OSDCCFont", ""), fontsize); 360 363 361 364 if (font) 362 365 fontMap[fontname] = font; … … 464 467 TTFFont *font = GetFont(fontname); 465 468 if (!font) 466 469 { 467 font = LoadFont( gContext->GetSetting("OSDCCFont"), SUBTITLE_FONT_SIZE);470 font = LoadFont(settings->GetSetting("OSDCCFont", ""), SUBTITLE_FONT_SIZE); 468 471 469 472 if (font) 470 473 { … … 532 535 533 536 if (!actfont) 534 537 { 535 actfont = LoadFont( gContext->GetSetting("OSDFont"), 16);538 actfont = LoadFont(settings->GetSetting("OSDFont", ""), 16); 536 539 537 540 if (actfont) 538 541 fontMap["treemenulistfont"] = actfont; … … 848 851 void OSD::parseFont(QDomElement &element) 849 852 { 850 853 QString name; 851 QString fontfile = gContext->GetSetting("OSDFont");854 QString fontfile = settings->GetSetting("OSDFont", ""); 852 855 int size = -1; 853 856 int sizeSmall = -1; 854 857 int sizeBig = -1; … … 926 929 return; 927 930 } 928 931 929 QString fontSizeType = gContext->GetSetting("OSDThemeFontSizeType",932 QString fontSizeType = settings->GetSetting("OSDThemeFontSizeType", 930 933 "default"); 931 934 if (fontSizeType == "small") 932 935 { … … 3107 3110 return QRect(xoffset, yoffset, displaywidth, displayheight); 3108 3111 } 3109 3112 3110 #define OSD_STRDUP(X) strdup( gContext->GetSetting(X).toLocal8Bit().constData())3113 #define OSD_STRDUP(X) strdup(settings->GetSetting(X, "").toLocal8Bit().constData()) 3111 3114 3112 static void initialize_osd_fonts( void)3115 static void initialize_osd_fonts(PlaySettings *settings) 3113 3116 { 3114 3117 QMutexLocker locker(&cc708_init_lock); 3115 3118 if (cc708_defaults_initialized) 3116 3119 return; 3117 3120 cc708_defaults_initialized = true; 3118 3121 3119 QString default_font_type = gContext->GetSetting(3122 QString default_font_type = settings->GetSetting( 3120 3123 "OSDCC708DefaultFontType", "MonoSerif"); 3121 3124 3122 3125 // 0 -
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, void *codec_priv); 14 15 ~VideoOutputQuartz(); 15 16 16 17 bool Init(int width, int height, float aspect, WId winid, … … 51 52 static MythCodecID GetBestSupportedCodec( 52 53 uint width, uint height, 53 54 uint osd_width, uint osd_height, 54 uint stream_type, uint fourcc );55 uint stream_type, uint fourcc, PlaySettings *settings); 55 56 virtual bool NeedExtraAudioDecode(void) const 56 57 { return !codec_is_std(myth_codec_id); } 57 58 -
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 { … … 211 212 pref_map_t VideoDisplayProfile::dec_name; 212 213 safe_list_t VideoDisplayProfile::safe_decoders; 213 214 214 VideoDisplayProfile::VideoDisplayProfile( )215 VideoDisplayProfile::VideoDisplayProfile(PlaySettings *settings) 215 216 : lock(QMutex::Recursive), last_size(0,0), last_rate(0.0f), 216 217 last_video_renderer(QString::null) 217 218 { … … 219 220 init_statics(); 220 221 221 222 QString hostname = gContext->GetHostName(); 222 QString cur_profile = GetDefaultProfileName(hostname );223 QString cur_profile = GetDefaultProfileName(hostname, settings); 223 224 uint groupid = GetProfileGroupID(cur_profile, hostname); 224 225 225 226 item_list_t items = LoadDB(groupid); … … 771 772 return list; 772 773 } 773 774 774 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname )775 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname, PlaySettings *settings) 775 776 { 776 QString tmp = 777 QString tmp = settings ? settings->GetSetting("DefaultVideoPlaybackProfile", "") : 777 778 gContext->GetSettingOnHost("DefaultVideoPlaybackProfile", hostname); 778 779 779 780 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(); ++iterValues, ++iterLabels) 243 { 244 if (*iterValues == value) 245 return *iterLabels; 246 } 247 248 return "???"; 249 } 250 238 251 bool SelectSetting::ReplaceLabel(const QString &new_label, const QString &value) 239 252 { 240 253 int i = getValueIndex(value); -
libs/libmyth/settings.h
290 290 291 291 virtual QString getSelectionLabel(void) const; 292 292 virtual int getValueIndex(QString value); 293 virtual QString getValueLabel(const QString &value); 293 294 294 295 protected: 295 296 virtual bool ReplaceLabel( -
programs/mythfrontend/globalsettings.cpp
37 37 #include "mythconfig.h" 38 38 #include "mythdirs.h" 39 39 #include "mythuihelper.h" 40 #include "playsettings.h" 40 41 42 // This macro is for type={CheckBox,ComboBox} 43 #define CREATE_SETTING(var, type, name, settings) \ 44 type##Setting *var; \ 45 if ((settings)) \ 46 var = new PlaySettings##type((name), (settings)); \ 47 else \ 48 var = new Host##type((name)) 49 50 #define CREATE_SPINBOX_SETTING(var, name, settings, arg1, arg2, arg3, arg4) \ 51 SpinBoxSetting *var; \ 52 if ((settings)) \ 53 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3), (arg4)); \ 54 else \ 55 var = new HostSpinBox((name), (arg1), (arg2), (arg3), (arg4)) 56 57 static Configurable *wrap(Configurable *obj, PlaySettings *settings, 58 bool twoLineLabel=false) 59 { 60 if (!settings) 61 return obj; 62 const QString &name = dynamic_cast<PlaySettingsStorage *>(obj)->getName(); 63 TriggeredConfigurationGroup *box = new TriggeredConfigurationGroup(false, false, true, true/*, false, false, true, true*/); 64 box->SetVertical(false); 65 PlaySettingsCheckBox *override = new PlaySettingsCheckBox(name, settings, true); 66 // Get the label for the default value, which requires some lookup for a ComboBox. 67 QString defaultLabel = settings->GetSetting(name, "", true); 68 ComboBoxSetting *cb = dynamic_cast<ComboBoxSetting *>(obj); 69 if (cb) 70 defaultLabel = cb->getValueLabel(defaultLabel); 71 // Pretty-print the 0/1 value for a checkbox. 72 if (dynamic_cast<CheckBoxSetting *>(obj)) 73 defaultLabel = (defaultLabel == "0" || defaultLabel == "" ? 74 QObject::tr("disabled") : QObject::tr("enabled")); 75 if (dynamic_cast<SpinBoxSetting *>(obj) && defaultLabel == "") 76 defaultLabel = "0"; 77 override->setLabel(obj->getLabel() + //"\n " + 78 //QObject::tr("Change default") + 79 (twoLineLabel ? "\n" : "") + 80 " (" + defaultLabel + ")"); 81 obj->setLabel(""); 82 override->setHelpText(QObject::tr("Check the box to override default value") 83 + " (" + defaultLabel + "). " + obj->getHelpText()); 84 box->addChild(override); 85 box->setTrigger(override); 86 box->addTarget("1", obj); 87 box->addTarget("0", new HorizontalConfigurationGroup(true)); 88 return box; 89 } 90 41 91 static HostComboBox *AudioOutputDevice() 42 92 { 43 93 HostComboBox *gc = new HostComboBox("AudioOutputDevice", true); … … 309 359 return gc; 310 360 } 311 361 312 static HostCheckBox *DecodeExtraAudio()362 static Configurable *DecodeExtraAudio(PlaySettings *settings) 313 363 { 314 HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");364 CREATE_SETTING(gc, CheckBox, "DecodeExtraAudio", settings); 315 365 gc->setLabel(QObject::tr("Extra audio buffering")); 316 366 gc->setValue(true); 317 367 gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing " … … 320 370 "effect on framegrabbers (MPEG-4/RTJPEG). MythTV will " 321 371 "keep extra audio data in its internal buffers to workaround " 322 372 "this bug.")); 323 return gc;373 return wrap(gc, settings); 324 374 } 325 375 326 static HostComboBox *PIPLocationComboBox()376 static Configurable *PIPLocationComboBox(PlaySettings *settings) 327 377 { 328 HostComboBox *gc = new HostComboBox("PIPLocation");378 CREATE_SETTING(gc, ComboBox, "PIPLocation", settings); 329 379 gc->setLabel(QObject::tr("PIP Video Location")); 330 380 for (uint loc = 0; loc < kPIP_END; ++loc) 331 381 gc->addSelection(toString((PIPLocation) loc), QString::number(loc)); 332 382 gc->setHelpText(QObject::tr("Location of PIP Video window.")); 333 return gc;383 return wrap(gc, settings); 334 384 } 335 385 336 386 static GlobalLineEdit *AllRecGroupPassword() … … 427 477 return gc; 428 478 } 429 479 430 static HostCheckBox *SmartForward()480 static Configurable *SmartForward(PlaySettings *settings) 431 481 { 432 HostCheckBox *gc = new HostCheckBox("SmartForward");482 CREATE_SETTING(gc, CheckBox, "SmartForward", settings); 433 483 gc->setLabel(QObject::tr("Smart Fast Forwarding")); 434 484 gc->setValue(false); 435 485 gc->setHelpText(QObject::tr("If enabled, then immediately after " 436 486 "rewinding, only skip forward the same amount as " 437 487 "skipping backwards.")); 438 return gc;488 return wrap(gc, settings); 439 489 } 440 490 441 static HostCheckBox *ExactSeeking()491 static Configurable *ExactSeeking(PlaySettings *settings) 442 492 { 443 HostCheckBox *gc = new HostCheckBox("ExactSeeking");493 CREATE_SETTING(gc, CheckBox, "ExactSeeking", settings); 444 494 gc->setLabel(QObject::tr("Seek to exact frame")); 445 495 gc->setValue(false); 446 496 gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but " 447 497 "slower.")); 448 return gc;498 return wrap(gc, settings); 449 499 } 450 500 451 501 static GlobalComboBox *CommercialSkipMethod() … … 463 513 return bc; 464 514 } 465 515 466 static HostComboBox *AutoCommercialSkip()516 static Configurable *AutoCommercialSkip(PlaySettings *settings) 467 517 { 468 HostComboBox *gc = new HostComboBox("AutoCommercialSkip");518 CREATE_SETTING(gc, ComboBox, "AutoCommercialSkip", settings); 469 519 gc->setLabel(QObject::tr("Automatically Skip Commercials")); 470 520 gc->addSelection(QObject::tr("Off"), "0"); 471 521 gc->addSelection(QObject::tr("Notify, but do not skip"), "2"); … … 474 524 "have been flagged during Automatic Commercial Flagging " 475 525 "or by the mythcommflag program, or just notify that a " 476 526 "commercial has been detected.")); 477 return gc;527 return wrap(gc, settings); 478 528 } 479 529 480 530 static GlobalCheckBox *AutoCommercialFlag() … … 559 609 return bc; 560 610 } 561 611 562 static HostSpinBox *CommRewindAmount()612 static Configurable *CommRewindAmount(PlaySettings *settings) 563 613 { 564 HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);614 CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false); 565 615 gs->setLabel(QObject::tr("Commercial Skip Auto-Rewind Amount")); 566 616 gs->setHelpText(QObject::tr("If set, MythTV will automatically rewind " 567 617 "this many seconds after performing a commercial skip.")); 568 618 gs->setValue(0); 569 return gs;619 return wrap(gs, settings); 570 620 } 571 621 572 static HostSpinBox *CommNotifyAmount()622 static Configurable *CommNotifyAmount(PlaySettings *settings) 573 623 { 574 HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);624 CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false); 575 625 gs->setLabel(QObject::tr("Commercial Skip Notify Amount")); 576 626 gs->setHelpText(QObject::tr("If set, MythTV will act like a commercial " 577 627 "begins this many seconds early. This can be useful " 578 628 "when commercial notification is used in place of " 579 629 "automatic skipping.")); 580 630 gs->setValue(0); 581 return gs;631 return wrap(gs, settings); 582 632 } 583 633 584 634 static GlobalSpinBox *MaximumCommercialSkip() … … 1368 1418 labels[j]->setValue(label_i); 1369 1419 } 1370 1420 1371 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str ) :1421 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str, PlaySettings *settings) : 1372 1422 TriggeredConfigurationGroup(false, true, true, true, 1373 1423 false, false, true, true), grouptrigger(NULL) 1374 1424 { 1375 1425 setLabel(QObject::tr("Playback Profiles") + str); 1426 if (settings) 1427 setLabel(QObject::tr("Playback group settings for ") + 1428 settings->mGroupName + " - " + 1429 getLabel()); 1376 1430 1377 1431 QString host = gContext->GetHostName(); 1378 1432 QStringList profiles = VideoDisplayProfile::GetProfiles(host); … … 1400 1454 profiles = VideoDisplayProfile::GetProfiles(host); 1401 1455 } 1402 1456 1403 QString profile = VideoDisplayProfile::GetDefaultProfileName(host );1457 QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings); 1404 1458 if (!profiles.contains(profile)) 1405 1459 { 1406 1460 profile = (profiles.contains("Normal")) ? "Normal" : profiles[0]; 1407 1461 VideoDisplayProfile::SetDefaultProfileName(profile, host); 1408 1462 } 1409 1463 1410 grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile"); 1464 CREATE_SETTING(gs, ComboBox, "DefaultVideoPlaybackProfile", settings); 1465 grouptrigger = gs; 1411 1466 grouptrigger->setLabel(QObject::tr("Current Video Playback Profile")); 1412 1467 QStringList::const_iterator it; 1413 1468 for (it = profiles.begin(); it != profiles.end(); ++it) 1414 1469 grouptrigger->addSelection(ProgramInfo::i18n(*it), *it); 1470 if (settings) 1471 { 1472 addChild(wrap(grouptrigger, settings)); 1473 return; 1474 } 1415 1475 1416 1476 HorizontalConfigurationGroup *grp = 1417 1477 new HorizontalConfigurationGroup(false, false, true, true); … … 1544 1604 return gc; 1545 1605 } 1546 1606 1547 static HostSpinBox *FFRewReposTime()1607 static Configurable *FFRewReposTime(PlaySettings *settings) 1548 1608 { 1549 HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);1609 CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false); 1550 1610 gs->setLabel(QObject::tr("Fast forward/rewind reposition amount")); 1551 1611 gs->setValue(100); 1552 1612 gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind " … … 1554 1614 "resuming normal playback. This " 1555 1615 "compensates for the reaction time between seeing " 1556 1616 "where to resume playback and actually exiting seeking.")); 1557 return gs;1617 return wrap(gs, settings); 1558 1618 } 1559 1619 1560 static HostCheckBox *FFRewReverse()1620 static Configurable *FFRewReverse(PlaySettings *settings) 1561 1621 { 1562 HostCheckBox *gc = new HostCheckBox("FFRewReverse");1622 CREATE_SETTING(gc, CheckBox, "FFRewReverse", settings); 1563 1623 gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind")); 1564 1624 gc->setValue(true); 1565 1625 gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key " … … 1567 1627 "vice versa. If disabled, it will decrease the " 1568 1628 "current speed or switch to play mode if " 1569 1629 "the speed can't be decreased further.")); 1570 return gc;1630 return wrap(gc, settings); 1571 1631 } 1572 1632 1573 static HostSpinBox *OSDGeneralTimeout()1633 static Configurable *OSDGeneralTimeout(PlaySettings *settings) 1574 1634 { 1575 HostSpinBox *gs = new HostSpinBox("OSDGeneralTimeout", 1, 30, 1);1635 CREATE_SPINBOX_SETTING(gs, "OSDGeneralTimeout", settings, 1, 30, 1, false); 1576 1636 gs->setLabel(QObject::tr("General OSD time-out (sec)")); 1577 1637 gs->setValue(2); 1578 1638 gs->setHelpText(QObject::tr("Length of time an on-screen display " 1579 1639 "window will be visible.")); 1580 return gs;1640 return wrap(gs, settings); 1581 1641 } 1582 1642 1583 static HostSpinBox *OSDProgramInfoTimeout()1643 static Configurable *OSDProgramInfoTimeout(PlaySettings *settings) 1584 1644 { 1585 HostSpinBox *gs = new HostSpinBox("OSDProgramInfoTimeout", 1, 30, 1);1645 CREATE_SPINBOX_SETTING(gs, "OSDProgramInfoTimeout", settings, 1, 30, 1, false); 1586 1646 gs->setLabel(QObject::tr("Program Info OSD time-out")); 1587 1647 gs->setValue(3); 1588 1648 gs->setHelpText(QObject::tr("Length of time the on-screen display " 1589 1649 "will display program information.")); 1590 return gs;1650 return wrap(gs, settings); 1591 1651 } 1592 1652 1593 static HostSpinBox *OSDNotifyTimeout()1653 static Configurable *OSDNotifyTimeout(PlaySettings *settings) 1594 1654 { 1595 HostSpinBox *gs = new HostSpinBox("OSDNotifyTimeout", 1, 30, 1);1655 CREATE_SPINBOX_SETTING(gs, "OSDNotifyTimeout", settings, 1, 30, 1, false); 1596 1656 gs->setLabel(QObject::tr("UDP Notify OSD time-out")); 1597 1657 gs->setValue(5); 1598 1658 gs->setHelpText(QObject::tr("How many seconds an on-screen display " 1599 1659 "will be active for UDP Notify events.")); 1600 return gs;1660 return wrap(gs, settings); 1601 1661 } 1602 1662 1603 1663 static HostSpinBox *ThemeCacheSize() … … 1641 1701 return gc; 1642 1702 } 1643 1703 1644 static HostComboBox *OSDFont()1704 static Configurable *OSDFont(PlaySettings *settings) 1645 1705 { 1646 HostComboBox *gc = new HostComboBox("OSDFont");1706 CREATE_SETTING(gc, ComboBox, "OSDFont", settings); 1647 1707 gc->setLabel(QObject::tr("OSD font")); 1648 1708 QDir ttf(GetFontsDir(), GetFontsNameFilter()); 1649 1709 gc->fillSelectionsFromDir(ttf, false); … … 1651 1711 if (gc->findSelection(defaultOSDFont) > -1) 1652 1712 gc->setValue(defaultOSDFont); 1653 1713 1654 return gc;1714 return wrap(gc, settings); 1655 1715 } 1656 1716 1657 static HostComboBox *OSDCCFont()1717 static Configurable *OSDCCFont(PlaySettings *settings) 1658 1718 { 1659 HostComboBox *gc = new HostComboBox("OSDCCFont");1719 CREATE_SETTING(gc, ComboBox, "OSDCCFont", settings); 1660 1720 gc->setLabel(QObject::tr("CC font")); 1661 1721 QDir ttf(GetFontsDir(), GetFontsNameFilter()); 1662 1722 gc->fillSelectionsFromDir(ttf, false); 1663 1723 gc->setHelpText(QObject::tr("Closed Caption font")); 1664 1724 1665 return gc;1725 return wrap(gc, settings); 1666 1726 } 1667 1727 1668 1728 static HostComboBox __attribute__ ((unused)) *DecodeVBIFormat() … … 1683 1743 return gc; 1684 1744 } 1685 1745 1686 static HostSpinBox *OSDCC708TextZoomPercentage(void)1746 static Configurable *OSDCC708TextZoomPercentage(PlaySettings *settings) 1687 1747 { 1688 HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5);1748 CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings, 50, 200, 5, false); 1689 1749 gs->setLabel(QObject::tr("Text zoom percentage")); 1690 1750 gs->setValue(100); 1691 1751 gs->setHelpText(QObject::tr("Use this to enlarge or shrink captions.")); 1692 1752 1693 return gs;1753 return wrap(gs, settings); 1694 1754 } 1695 1755 1696 static HostComboBox *OSDCC708DefaultFontType(void)1756 static Configurable *OSDCC708DefaultFontType(PlaySettings *settings) 1697 1757 { 1698 HostComboBox *hc = new HostComboBox("OSDCC708DefaultFontType");1758 CREATE_SETTING(hc, ComboBox, "OSDCC708DefaultFontType", settings); 1699 1759 hc->setLabel(QObject::tr("Default Caption Font Type")); 1700 1760 hc->setHelpText( 1701 1761 QObject::tr("This allows you to set which font type to use " … … 1718 1778 }; 1719 1779 for (uint i = 0; i < 7; ++i) 1720 1780 hc->addSelection(typeNames[i], types[i]); 1721 return hc;1781 return wrap(hc, settings); 1722 1782 } 1723 1783 1724 static VerticalConfigurationGroup *OSDCC708Settings( void)1784 static VerticalConfigurationGroup *OSDCC708Settings(PlaySettings *settings) 1725 1785 { 1726 1786 VerticalConfigurationGroup *grp = 1727 1787 new VerticalConfigurationGroup(false, true, true, true); 1728 1788 grp->setLabel(QObject::tr("ATSC Caption Settings")); 1789 if (settings) 1790 grp->setLabel(QObject::tr("Playback group settings for ") + 1791 settings->mGroupName + " - " + 1792 grp->getLabel()); 1729 1793 1730 1794 // default text zoom 1.0 1731 grp->addChild(OSDCC708TextZoomPercentage( ));1795 grp->addChild(OSDCC708TextZoomPercentage(settings)); 1732 1796 1733 1797 // force X lines of captions 1734 1798 // force caption character color … … 1737 1801 // force background opacity 1738 1802 1739 1803 // set default font type 1740 grp->addChild(OSDCC708DefaultFontType( ));1804 grp->addChild(OSDCC708DefaultFontType(settings)); 1741 1805 1742 1806 return grp; 1743 1807 } 1744 1808 1745 static HostComboBox*OSDCC708Font(1809 static Configurable *OSDCC708Font( 1746 1810 const QString &subtype, const QString &subtypeName, 1747 const QString &subtypeNameForHelp )1811 const QString &subtypeNameForHelp, PlaySettings *settings) 1748 1812 { 1749 HostComboBox *gc = new HostComboBox( 1750 QString("OSDCC708%1Font").arg(subtype)); 1813 CREATE_SETTING(gc, ComboBox, QString("OSDCC708%1Font").arg(subtype), settings); 1751 1814 1752 1815 gc->setLabel(subtypeName); 1753 1816 QDir ttf(GetFontsDir(), GetFontsNameFilter()); … … 1755 1818 gc->setHelpText( 1756 1819 QObject::tr("ATSC %1 closed caption font.").arg(subtypeNameForHelp)); 1757 1820 1758 return gc;1821 return wrap(gc, settings, (subtypeName.length() > 10)); 1759 1822 } 1760 1823 1761 static HorizontalConfigurationGroup *OSDCC708Fonts( void)1824 static HorizontalConfigurationGroup *OSDCC708Fonts(PlaySettings *settings) 1762 1825 { 1763 1826 HorizontalConfigurationGroup *grpmain = 1764 1827 new HorizontalConfigurationGroup(false, true, true, true); 1765 1828 grpmain->setLabel(QObject::tr("ATSC Caption Fonts")); 1829 if (settings) 1830 grpmain->setLabel(QObject::tr("Playback group settings for ") + 1831 settings->mGroupName + " - " + 1832 grpmain->getLabel()); 1766 1833 VerticalConfigurationGroup *col[] = 1767 1834 { 1768 1835 new VerticalConfigurationGroup(false, false, true, true), … … 1798 1865 for (uint j = 0; j < 7; ++j) 1799 1866 { 1800 1867 col[i]->addChild(OSDCC708Font(subtypes[i].arg(types[j]), 1801 typeNames[j], typeNames[j])); 1868 typeNames[j], typeNames[j], 1869 settings)); 1802 1870 } 1803 1871 grpmain->addChild(col[i]); 1804 1872 … … 1806 1874 for (uint j = 0; j < 7; ++j) 1807 1875 { 1808 1876 col[i]->addChild(OSDCC708Font( 1809 subtypes[i].arg(types[j]), "", 1810 QObject::tr("Italic") + ' ' + typeNames[j])); 1877 subtypes[i].arg(types[j]), (settings ? typeNames[j] : ""), 1878 QObject::tr("Italic") + ' ' + typeNames[j], 1879 settings)); 1811 1880 } 1812 1881 1813 1882 grpmain->addChild(col[i]); … … 1815 1884 return grpmain; 1816 1885 } 1817 1886 1818 static HostComboBox *SubtitleCodec()1887 static Configurable *SubtitleCodec(PlaySettings *settings) 1819 1888 { 1820 HostComboBox *gc = new HostComboBox("SubtitleCodec");1889 CREATE_SETTING(gc, ComboBox, "SubtitleCodec", settings); 1821 1890 1822 1891 gc->setLabel(QObject::tr("Subtitle Codec")); 1823 1892 QList<QByteArray> list = QTextCodec::availableCodecs(); … … 1827 1896 gc->addSelection(val, val, val.toLower() == "utf-8"); 1828 1897 } 1829 1898 1830 return gc;1899 return wrap(gc, settings); 1831 1900 } 1832 1901 1833 static HorizontalConfigurationGroup *ExternalSubtitleSettings( )1902 static HorizontalConfigurationGroup *ExternalSubtitleSettings(PlaySettings *settings) 1834 1903 { 1835 1904 HorizontalConfigurationGroup *grpmain = 1836 1905 new HorizontalConfigurationGroup(false, true, true, true); 1837 1906 1838 1907 grpmain->setLabel(QObject::tr("External Subtitle Settings")); 1839 1908 1840 grpmain->addChild(SubtitleCodec( ));1909 grpmain->addChild(SubtitleCodec(settings)); 1841 1910 1842 1911 return grpmain; 1843 1912 } 1844 1913 1845 static HostComboBox *OSDThemeFontSizeType()1914 static Configurable *OSDThemeFontSizeType(PlaySettings *settings) 1846 1915 { 1847 HostComboBox *gc = new HostComboBox("OSDThemeFontSizeType");1916 CREATE_SETTING(gc, ComboBox, "OSDThemeFontSizeType", settings); 1848 1917 gc->setLabel(QObject::tr("Font size")); 1849 1918 gc->addSelection(QObject::tr("default"), "default"); 1850 1919 gc->addSelection(QObject::tr("small"), "small"); 1851 1920 gc->addSelection(QObject::tr("big"), "big"); 1852 1921 gc->setHelpText(QObject::tr("default: TV, small: monitor, big:")); 1853 return gc;1922 return wrap(gc, settings); 1854 1923 } 1855 1924 1856 1925 static HostComboBox *ChannelOrdering() … … 1862 1931 return gc; 1863 1932 } 1864 1933 1865 static HostSpinBox *VertScanPercentage()1934 static Configurable *VertScanPercentage(PlaySettings *settings) 1866 1935 { 1867 HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1);1936 CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings, -100, 100, 1, false); 1868 1937 gs->setLabel(QObject::tr("Vertical scaling")); 1869 1938 gs->setValue(0); 1870 1939 gs->setHelpText(QObject::tr( 1871 1940 "Adjust this if the image does not fill your " 1872 1941 "screen vertically. Range -100% to 100%")); 1873 return gs;1942 return wrap(gs, settings); 1874 1943 } 1875 1944 1876 static HostSpinBox *HorizScanPercentage()1945 static Configurable *HorizScanPercentage(PlaySettings *settings) 1877 1946 { 1878 HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1);1947 CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings, -100, 100, 1, false); 1879 1948 gs->setLabel(QObject::tr("Horizontal scaling")); 1880 1949 gs->setValue(0); 1881 1950 gs->setHelpText(QObject::tr( 1882 1951 "Adjust this if the image does not fill your " 1883 1952 "screen horizontally. Range -100% to 100%")); 1884 return gs;1953 return wrap(gs, settings); 1885 1954 }; 1886 1955 1887 static HostSpinBox *XScanDisplacement()1956 static Configurable *XScanDisplacement(PlaySettings *settings) 1888 1957 { 1889 HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1);1958 CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings, -50, 50, 1, false); 1890 1959 gs->setLabel(QObject::tr("Scan displacement (X)")); 1891 1960 gs->setValue(0); 1892 1961 gs->setHelpText(QObject::tr("Adjust this to move the image horizontally.")); 1893 return gs;1962 return wrap(gs, settings); 1894 1963 } 1895 1964 1896 static HostSpinBox *YScanDisplacement()1965 static Configurable *YScanDisplacement(PlaySettings *settings) 1897 1966 { 1898 HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1);1967 CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings, -50, 50, 1, false); 1899 1968 gs->setLabel(QObject::tr("Scan displacement (Y)")); 1900 1969 gs->setValue(0); 1901 1970 gs->setHelpText(QObject::tr("Adjust this to move the image vertically.")); 1902 return gs;1971 return wrap(gs, settings); 1903 1972 }; 1904 1973 1905 1974 static HostCheckBox *AlwaysStreamFiles() … … 1915 1984 return gc; 1916 1985 } 1917 1986 1918 static HostCheckBox *UseVideoTimebase()1987 static Configurable *UseVideoTimebase(PlaySettings *settings) 1919 1988 { 1920 HostCheckBox *gc = new HostCheckBox("UseVideoTimebase");1989 CREATE_SETTING(gc, CheckBox, "UseVideoTimebase", settings); 1921 1990 gc->setLabel(QObject::tr("Use video as timebase")); 1922 1991 gc->setValue(false); 1923 1992 gc->setHelpText(QObject::tr("Use the video as the timebase and warp " 1924 1993 "the audio to keep it in sync. (Experimental)")); 1925 return gc;1994 return wrap(gc, settings); 1926 1995 } 1927 1996 1928 static HostCheckBox *CCBackground()1997 static Configurable *CCBackground(PlaySettings *settings) 1929 1998 { 1930 HostCheckBox *gc = new HostCheckBox("CCBackground");1999 CREATE_SETTING(gc, CheckBox, "CCBackground", settings); 1931 2000 gc->setLabel(QObject::tr("Black background for closed captioning")); 1932 2001 gc->setValue(false); 1933 2002 gc->setHelpText(QObject::tr( 1934 2003 "If enabled, captions will be displayed " 1935 2004 "as white text over a black background " 1936 2005 "for better contrast.")); 1937 return gc;2006 return wrap(gc, settings); 1938 2007 } 1939 2008 1940 static HostCheckBox *DefaultCCMode()2009 static Configurable *DefaultCCMode(PlaySettings *settings) 1941 2010 { 1942 HostCheckBox *gc = new HostCheckBox("DefaultCCMode");2011 CREATE_SETTING(gc, CheckBox, "DefaultCCMode", settings); 1943 2012 gc->setLabel(QObject::tr("Always display closed captioning or subtitles")); 1944 2013 gc->setValue(false); 1945 2014 gc->setHelpText(QObject::tr( … … 1947 2016 "when playing back recordings or watching " 1948 2017 "live TV. Closed Captioning can be turned on or off " 1949 2018 "by pressing \"T\" during playback.")); 1950 return gc;2019 return wrap(gc, settings); 1951 2020 } 1952 2021 1953 static HostCheckBox *PreferCC708()2022 static Configurable *PreferCC708(PlaySettings *settings) 1954 2023 { 1955 HostCheckBox *gc = new HostCheckBox("Prefer708Captions");2024 CREATE_SETTING(gc, CheckBox, "Prefer708Captions", settings); 1956 2025 gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions")); 1957 2026 gc->setValue(true); 1958 2027 gc->setHelpText( … … 1960 2029 "When enabled the new EIA-708 captions will be preferred over " 1961 2030 "the old EIA-608 captions in ATSC streams.")); 1962 2031 1963 return gc;2032 return wrap(gc, settings); 1964 2033 } 1965 2034 1966 static HostCheckBox *EnableMHEG()2035 static Configurable *EnableMHEG(PlaySettings *settings) 1967 2036 { 1968 HostCheckBox *gc = new HostCheckBox("EnableMHEG");2037 CREATE_SETTING(gc, CheckBox, "EnableMHEG", settings); 1969 2038 gc->setLabel(QObject::tr("Enable Interactive TV")); 1970 2039 gc->setValue(false); 1971 2040 gc->setHelpText(QObject::tr( 1972 2041 "If enabled, interactive TV applications (MHEG) will " 1973 2042 "be activated. This is used for teletext and logos for " 1974 2043 "radio and channels that are currently off-air.")); 1975 return gc;2044 return wrap(gc, settings); 1976 2045 } 1977 2046 1978 static HostCheckBox *PersistentBrowseMode()2047 static Configurable *PersistentBrowseMode(PlaySettings *settings) 1979 2048 { 1980 HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");2049 CREATE_SETTING(gc, CheckBox, "PersistentBrowseMode", settings); 1981 2050 gc->setLabel(QObject::tr("Always use Browse mode in LiveTV")); 1982 2051 gc->setValue(true); 1983 2052 gc->setHelpText( 1984 2053 QObject::tr( 1985 2054 "If enabled, Browse mode will automatically be activated " 1986 2055 "whenever you use Channel UP/DOWN while watching Live TV.")); 1987 return gc;2056 return wrap(gc, settings); 1988 2057 } 1989 2058 1990 static HostCheckBox *BrowseAllTuners()2059 static Configurable *BrowseAllTuners(PlaySettings *settings) 1991 2060 { 1992 HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");2061 CREATE_SETTING(gc, CheckBox, "BrowseAllTuners", settings); 1993 2062 gc->setLabel(QObject::tr("Browse all channels")); 1994 2063 gc->setValue(false); 1995 2064 gc->setHelpText( … … 1997 2066 "If enabled, browse mode will shows channels on all " 1998 2067 "available recording devices, instead of showing " 1999 2068 "channels on just the current recorder.")); 2000 return gc;2069 return wrap(gc, settings); 2001 2070 } 2002 2071 2003 static HostCheckBox *ClearSavedPosition()2072 static Configurable *ClearSavedPosition(PlaySettings *settings) 2004 2073 { 2005 HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");2074 CREATE_SETTING(gc, CheckBox, "ClearSavedPosition", settings); 2006 2075 gc->setLabel(QObject::tr("Clear bookmark on playback")); 2007 2076 gc->setValue(true); 2008 2077 gc->setHelpText(QObject::tr("Automatically clear the bookmark on a " 2009 2078 "recording when the recording is played back. If " 2010 2079 "disabled, you can mark the beginning with rewind " 2011 2080 "then save position.")); 2012 return gc;2081 return wrap(gc, settings); 2013 2082 } 2014 2083 2015 static HostCheckBox *AltClearSavedPosition()2084 static Configurable *AltClearSavedPosition(PlaySettings *settings) 2016 2085 { 2017 HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");2086 CREATE_SETTING(gc, CheckBox, "AltClearSavedPosition", settings); 2018 2087 gc->setLabel(QObject::tr("Alternate clear and save bookmark")); 2019 2088 gc->setValue(true); 2020 2089 gc->setHelpText(QObject::tr("During playback the Select key " … … 2022 2091 "Saved\" and \"Bookmark Cleared\". If disabled, the " 2023 2092 "Select key will save the current position for each " 2024 2093 "keypress.")); 2025 return gc;2094 return wrap(gc, settings); 2026 2095 } 2027 2096 2028 2097 #if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU) 2029 static HostCheckBox *UsePicControls()2098 static Configurable *UsePicControls(PlaySettings *settings) 2030 2099 { 2031 HostCheckBox *gc = new HostCheckBox("UseOutputPictureControls");2100 CREATE_SETTING(gc, CheckBox, "UseOutputPictureControls", settings); 2032 2101 gc->setLabel(QObject::tr("Enable picture controls")); 2033 2102 gc->setValue(false); 2034 2103 gc->setHelpText( 2035 2104 QObject::tr( 2036 2105 "If enabled, MythTV attempts to initialize picture controls " 2037 2106 "(brightness, contrast, etc.) that are applied during playback.")); 2038 return gc;2107 return wrap(gc, settings); 2039 2108 } 2040 2109 #endif 2041 2110 2042 static HostLineEdit *UDPNotifyPort()2111 static Configurable *UDPNotifyPort(PlaySettings *settings) 2043 2112 { 2044 HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");2113 CREATE_SETTING(ge, LineEdit, "UDPNotifyPort", settings); 2045 2114 ge->setLabel(QObject::tr("UDP Notify Port")); 2046 2115 ge->setValue("6948"); 2047 2116 ge->setHelpText(QObject::tr("During playback, MythTV will listen for " 2048 2117 "connections from the \"mythtvosd\" or \"mythudprelay\" " 2049 2118 "programs on this port. See the README in " 2050 2119 "contrib/mythnotify/ for additional information.")); 2051 return ge;2120 return wrap(ge, settings); 2052 2121 } 2053 2122 2054 static HostComboBox *PlaybackExitPrompt()2123 static Configurable *PlaybackExitPrompt(PlaySettings *settings) 2055 2124 { 2056 HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");2125 CREATE_SETTING(gc, ComboBox, "PlaybackExitPrompt", settings); 2057 2126 gc->setLabel(QObject::tr("Action on playback exit")); 2058 2127 gc->addSelection(QObject::tr("Just exit"), "0"); 2059 2128 gc->addSelection(QObject::tr("Save position and exit"), "2"); … … 2064 2133 "when you exit playback mode. The options available will " 2065 2134 "allow you to save your position, delete the " 2066 2135 "recording, or continue watching.")); 2067 return gc;2136 return wrap(gc, settings); 2068 2137 } 2069 2138 2070 static HostCheckBox *EndOfRecordingExitPrompt()2139 static Configurable *EndOfRecordingExitPrompt(PlaySettings *settings) 2071 2140 { 2072 HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");2141 CREATE_SETTING(gc, CheckBox, "EndOfRecordingExitPrompt", settings); 2073 2142 gc->setLabel(QObject::tr("Prompt at end of recording")); 2074 2143 gc->setValue(false); 2075 2144 gc->setHelpText(QObject::tr("If set, a menu will be displayed allowing " 2076 2145 "you to delete the recording when it has finished " 2077 2146 "playing.")); 2078 return gc;2147 return wrap(gc, settings); 2079 2148 } 2080 2149 2081 static HostCheckBox *JumpToProgramOSD()2150 static Configurable *JumpToProgramOSD(PlaySettings *settings) 2082 2151 { 2083 HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");2152 CREATE_SETTING(gc, CheckBox, "JumpToProgramOSD", settings); 2084 2153 gc->setLabel(QObject::tr("Jump to Program OSD")); 2085 2154 gc->setValue(true); 2086 2155 gc->setHelpText(QObject::tr( … … 2089 2158 "'Watch Recording' screen when 'Jump to Program' " 2090 2159 "is activated. If set, the recordings are shown " 2091 2160 "in the OSD")); 2092 return gc;2161 return wrap(gc, settings); 2093 2162 } 2094 2163 2095 static HostCheckBox *ContinueEmbeddedTVPlay()2164 static Configurable *ContinueEmbeddedTVPlay(PlaySettings *settings) 2096 2165 { 2097 HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");2166 CREATE_SETTING(gc, CheckBox, "ContinueEmbeddedTVPlay", settings); 2098 2167 gc->setLabel(QObject::tr("Continue Playback When Embedded")); 2099 2168 gc->setValue(false); 2100 2169 gc->setHelpText(QObject::tr( … … 2102 2171 "is embedded in the upcoming program list or recorded " 2103 2172 "list. The default is to pause the recorded show when " 2104 2173 "embedded.")); 2105 return gc;2174 return wrap(gc, settings); 2106 2175 } 2107 2176 2108 static HostCheckBox *AutomaticSetWatched()2177 static Configurable *AutomaticSetWatched(PlaySettings *settings) 2109 2178 { 2110 HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");2179 CREATE_SETTING(gc, CheckBox, "AutomaticSetWatched", settings); 2111 2180 gc->setLabel(QObject::tr("Automatically mark a recording as watched")); 2112 2181 gc->setValue(false); 2113 2182 gc->setHelpText(QObject::tr("If set, when you exit near the end of a " … … 2115 2184 "detection is not foolproof, so do not enable this " 2116 2185 "setting if you don't want an unwatched recording marked " 2117 2186 "as watched.")); 2118 return gc;2187 return wrap(gc, settings); 2119 2188 } 2120 2189 2121 2190 static HostSpinBox *LiveTVIdleTimeout() … … 2380 2449 return gc; 2381 2450 } 2382 2451 2383 static HostComboBox *LetterboxingColour()2452 static Configurable *LetterboxingColour(PlaySettings *settings) 2384 2453 { 2385 HostComboBox *gc = new HostComboBox("LetterboxColour");2454 CREATE_SETTING(gc, ComboBox, "LetterboxColour", settings); 2386 2455 gc->setLabel(QObject::tr("Letterboxing Color")); 2387 2456 for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m) 2388 2457 gc->addSelection(toString((LetterBoxColour)m), QString::number(m)); … … 2392 2461 "letterboxing, but those with plasma screens may prefer gray " 2393 2462 "to minimize burn-in.") + " " + 2394 2463 QObject::tr("Currently only works with XVideo video renderer.")); 2395 return gc;2464 return wrap(gc, settings); 2396 2465 } 2397 2466 2398 static HostComboBox *AspectOverride()2467 static Configurable *AspectOverride(PlaySettings *settings) 2399 2468 { 2400 HostComboBox *gc = new HostComboBox("AspectOverride");2469 CREATE_SETTING(gc, ComboBox, "AspectOverride", settings); 2401 2470 gc->setLabel(QObject::tr("Video Aspect Override")); 2402 2471 for (int m = kAspect_Off; m < kAspect_END; ++m) 2403 2472 gc->addSelection(toString((AspectOverrideMode)m), QString::number(m)); … … 2405 2474 "When enabled, these will override the aspect " 2406 2475 "ratio specified by any broadcaster for all " 2407 2476 "video streams.")); 2408 return gc;2477 return wrap(gc, settings); 2409 2478 } 2410 2479 2411 static HostComboBox *AdjustFill()2480 static Configurable *AdjustFill(PlaySettings *settings) 2412 2481 { 2413 HostComboBox *gc = new HostComboBox("AdjustFill");2482 CREATE_SETTING(gc, ComboBox, "AdjustFill", settings); 2414 2483 gc->setLabel(QObject::tr("Zoom")); 2415 2484 gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff), 2416 2485 QString::number(kAdjustFill_AutoDetect_DefaultOff)); … … 2421 2490 gc->setHelpText(QObject::tr( 2422 2491 "When enabled, these will apply a predefined " 2423 2492 "zoom to all video playback in MythTV.")); 2424 return gc;2493 return wrap(gc, settings); 2425 2494 } 2426 2495 2427 2496 // Theme settings … … 3603 3672 return gs; 3604 3673 } 3605 3674 3606 static HostCheckBox *RealtimePriority()3675 static Configurable *RealtimePriority(PlaySettings *settings) 3607 3676 { 3608 HostCheckBox *gc = new HostCheckBox("RealtimePriority");3677 CREATE_SETTING(gc, CheckBox, "RealtimePriority", settings); 3609 3678 gc->setLabel(QObject::tr("Enable realtime priority threads")); 3610 3679 gc->setHelpText(QObject::tr("When running mythfrontend with root " 3611 3680 "privileges, some threads can be given enhanced priority. " 3612 3681 "Disable this if mythfrontend freezes during video " 3613 3682 "playback.")); 3614 3683 gc->setValue(true); 3615 return gc;3684 return wrap(gc, settings); 3616 3685 } 3617 3686 3618 3687 static HostCheckBox *EnableMediaMon() … … 3768 3837 }; 3769 3838 3770 3839 #ifdef USING_OPENGL_VSYNC 3771 static HostCheckBox *UseOpenGLVSync()3840 static Configurable *UseOpenGLVSync(PlaySettings *settings) 3772 3841 { 3773 HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");3842 CREATE_SETTING(gc, CheckBox, "UseOpenGLVSync", settings); 3774 3843 gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing")); 3775 3844 gc->setValue(false); 3776 3845 gc->setHelpText(QObject::tr( 3777 3846 "If it is supported by your hardware/drivers, " 3778 3847 "MythTV will use OpenGL vertical syncing for " 3779 3848 "video timing, reducing frame jitter.")); 3780 return gc;3849 return wrap(gc, settings); 3781 3850 } 3782 3851 #endif 3783 3852 … … 4259 4328 addChild(remotecontrol); 4260 4329 } 4261 4330 4262 PlaybackSettings::PlaybackSettings() 4331 PlaybackSettings::PlaybackSettings(PlaySettings *settings, 4332 ConfigurationWizard *base) 4263 4333 { 4264 4334 uint i = 0, total = 8; 4265 4335 #if CONFIG_DARWIN 4266 4336 total += 2; 4267 4337 #endif // USING_DARWIN 4338 if (settings) 4339 total -= 3; 4268 4340 4269 4341 4270 4342 VerticalConfigurationGroup* general1 = 4271 4343 new VerticalConfigurationGroup(false); 4272 4344 general1->setLabel(QObject::tr("General Playback") + 4273 4345 QString(" (%1/%2)").arg(++i).arg(total)); 4346 if (settings) 4347 general1->setLabel(QObject::tr("Playback group settings for ") + 4348 settings->mGroupName + " - " + 4349 general1->getLabel()); 4274 4350 4275 4351 HorizontalConfigurationGroup *columns = 4276 4352 new HorizontalConfigurationGroup(false, false, true, true); 4277 4353 4278 4354 VerticalConfigurationGroup *column1 = 4279 4355 new VerticalConfigurationGroup(false, false, true, true); 4280 column1->addChild(RealtimePriority()); 4281 column1->addChild(DecodeExtraAudio()); 4282 column1->addChild(UseVideoTimebase()); 4283 column1->addChild(JumpToProgramOSD()); 4356 if (!settings) 4357 column1->addChild(RealtimePriority(settings)); 4358 column1->addChild(DecodeExtraAudio(settings)); 4359 column1->addChild(UseVideoTimebase(settings)); 4360 column1->addChild(JumpToProgramOSD(settings)); 4284 4361 columns->addChild(column1); 4285 4362 4286 4363 VerticalConfigurationGroup *column2 = 4287 4364 new VerticalConfigurationGroup(false, false, true, true); 4288 column2->addChild(ClearSavedPosition( ));4289 column2->addChild(AltClearSavedPosition( ));4290 column2->addChild(AutomaticSetWatched( ));4291 column2->addChild(ContinueEmbeddedTVPlay( ));4365 column2->addChild(ClearSavedPosition(settings)); 4366 column2->addChild(AltClearSavedPosition(settings)); 4367 column2->addChild(AutomaticSetWatched(settings)); 4368 column2->addChild(ContinueEmbeddedTVPlay(settings)); 4292 4369 columns->addChild(column2); 4293 4370 4294 4371 general1->addChild(columns); 4295 general1->addChild(LiveTVIdleTimeout()); 4296 general1->addChild(AlwaysStreamFiles()); 4372 if (!settings) 4373 general1->addChild(LiveTVIdleTimeout()); 4374 if (!settings) 4375 general1->addChild(AlwaysStreamFiles()); 4297 4376 #ifdef USING_OPENGL_VSYNC 4298 general1->addChild(UseOpenGLVSync( ));4377 general1->addChild(UseOpenGLVSync(settings)); 4299 4378 #endif // USING_OPENGL_VSYNC 4300 4379 #if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU) 4301 general1->addChild(UsePicControls( ));4380 general1->addChild(UsePicControls(settings)); 4302 4381 #endif // USING_XV 4303 addChild(general1); 4382 if (base) 4383 base->addChild(general1); 4384 else 4385 addChild(general1); 4304 4386 4305 4387 VerticalConfigurationGroup* general2 = 4306 4388 new VerticalConfigurationGroup(false); 4307 4389 general2->setLabel(QObject::tr("General Playback") + 4308 4390 QString(" (%1/%2)").arg(++i).arg(total)); 4391 if (settings) 4392 general2->setLabel(QObject::tr("Playback group settings for ") + 4393 settings->mGroupName + " - " + 4394 general2->getLabel()); 4309 4395 4310 4396 HorizontalConfigurationGroup* oscan = 4311 4397 new HorizontalConfigurationGroup(false, false, true, true); … … 4313 4399 new VerticalConfigurationGroup(false, false, true, true); 4314 4400 VerticalConfigurationGroup *ocol2 = 4315 4401 new VerticalConfigurationGroup(false, false, true, true); 4316 ocol1->addChild(VertScanPercentage( ));4317 ocol1->addChild(YScanDisplacement( ));4318 ocol2->addChild(HorizScanPercentage( ));4319 ocol2->addChild(XScanDisplacement( ));4402 ocol1->addChild(VertScanPercentage(settings)); 4403 ocol1->addChild(YScanDisplacement(settings)); 4404 ocol2->addChild(HorizScanPercentage(settings)); 4405 ocol2->addChild(XScanDisplacement(settings)); 4320 4406 oscan->addChild(ocol1); 4321 4407 oscan->addChild(ocol2); 4322 4408 4323 4409 HorizontalConfigurationGroup* aspect_fill = 4324 4410 new HorizontalConfigurationGroup(false, false, true, true); 4325 aspect_fill->addChild(AspectOverride( ));4326 aspect_fill->addChild(AdjustFill( ));4411 aspect_fill->addChild(AspectOverride(settings)); 4412 aspect_fill->addChild(AdjustFill(settings)); 4327 4413 4328 4414 general2->addChild(oscan); 4329 4415 general2->addChild(aspect_fill); 4330 general2->addChild(LetterboxingColour()); 4331 general2->addChild(PIPLocationComboBox()); 4332 general2->addChild(PlaybackExitPrompt()); 4333 general2->addChild(EndOfRecordingExitPrompt()); 4334 addChild(general2); 4416 general2->addChild(LetterboxingColour(settings)); 4417 general2->addChild(PIPLocationComboBox(settings)); 4418 general2->addChild(PlaybackExitPrompt(settings)); 4419 general2->addChild(EndOfRecordingExitPrompt(settings)); 4420 if (base) 4421 base->addChild(general2); 4422 else 4423 addChild(general2); 4335 4424 4336 4425 QString tmp = QString(" (%1/%2)").arg(++i).arg(total); 4337 addChild(new PlaybackProfileConfigs(tmp)); 4426 if (base) 4427 base->addChild(new PlaybackProfileConfigs(tmp, settings)); 4428 else 4429 addChild(new PlaybackProfileConfigs(tmp, settings)); 4338 4430 4431 if (!settings) 4432 { 4339 4433 VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false); 4340 4434 pbox->setLabel(QObject::tr("View Recordings") + 4341 4435 QString(" (%1/%2)").arg(++i).arg(total)); … … 4364 4458 pbox3->addChild(DisplayGroupTitleSort()); 4365 4459 pbox3->addChild(new WatchListSettings()); 4366 4460 addChild(pbox3); 4461 } 4367 4462 4368 4463 VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false); 4369 4464 seek->setLabel(QObject::tr("Seeking") + 4370 4465 QString(" (%1/%2)").arg(++i).arg(total)); 4371 seek->addChild(SmartForward()); 4372 seek->addChild(FFRewReposTime()); 4373 seek->addChild(FFRewReverse()); 4374 seek->addChild(ExactSeeking()); 4375 addChild(seek); 4466 if (settings) 4467 seek->setLabel(QObject::tr("Playback group settings for ") + 4468 settings->mGroupName + " - " + 4469 seek->getLabel()); 4470 seek->addChild(SmartForward(settings)); 4471 seek->addChild(FFRewReposTime(settings)); 4472 seek->addChild(FFRewReverse(settings)); 4473 seek->addChild(ExactSeeking(settings)); 4474 if (base) 4475 base->addChild(seek); 4476 else 4477 addChild(seek); 4376 4478 4377 4479 VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false); 4378 4480 comms->setLabel(QObject::tr("Commercial Skip") + 4379 4481 QString(" (%1/%2)").arg(++i).arg(total)); 4380 comms->addChild(AutoCommercialSkip()); 4381 comms->addChild(CommRewindAmount()); 4382 comms->addChild(CommNotifyAmount()); 4482 if (settings) 4483 comms->setLabel(QObject::tr("Playback group settings for ") + 4484 settings->mGroupName + " - " + 4485 comms->getLabel()); 4486 comms->addChild(AutoCommercialSkip(settings)); 4487 comms->addChild(CommRewindAmount(settings)); 4488 comms->addChild(CommNotifyAmount(settings)); 4489 if (!settings) // these are global settings, not host-specific 4490 { 4383 4491 comms->addChild(MaximumCommercialSkip()); 4384 4492 comms->addChild(MergeShortCommBreaks()); 4385 4493 comms->addChild(CommSkipAllBlanks()); 4386 addChild(comms); 4494 } 4495 if (base) 4496 base->addChild(comms); 4497 else 4498 addChild(comms); 4387 4499 4388 4500 #if CONFIG_DARWIN 4389 4501 VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false); 4390 4502 mac1->setLabel(QObject::tr("Mac OS X video settings") + 4391 4503 QString(" (%1/%2)").arg(++i).arg(total)); 4504 if (settings) 4505 mac1->setLabel(QObject::tr("Playback group settings for ") + 4506 settings->mGroupName + " - " + 4507 mac1->getLabel()); 4508 if (!settings) 4509 { 4392 4510 mac1->addChild(MacGammaCorrect()); 4393 4511 mac1->addChild(MacScaleUp()); 4394 4512 mac1->addChild(MacFullSkip()); 4395 addChild(mac1); 4513 } 4514 if (base) 4515 base->addChild(mac1); 4516 else 4517 addChild(mac1); 4396 4518 4397 4519 VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false); 4398 4520 mac2->setLabel(QObject::tr("Mac OS X video settings") + 4399 4521 QString(" (%1/%2)").arg(++i).arg(total)); 4522 if (settings) 4523 mac2->setLabel(QObject::tr("Playback group settings for ") + 4524 settings->mGroupName + " - " + 4525 mac2->getLabel()); 4526 if (!setings) 4527 { 4400 4528 mac2->addChild(new MacMainSettings()); 4401 4529 mac2->addChild(new MacFloatSettings()); 4402 4530 … … 4405 4533 row->addChild(new MacDockSettings()); 4406 4534 row->addChild(new MacDesktopSettings()); 4407 4535 mac2->addChild(row); 4536 } 4408 4537 4409 addChild(mac2); 4538 if (base) 4539 base->addChild(mac2); 4540 else 4541 addChild(mac2); 4410 4542 #endif 4411 4543 } 4412 4544 4413 OSDSettings::OSDSettings() 4545 OSDSettings::OSDSettings(PlaySettings *settings, 4546 ConfigurationWizard *base) 4414 4547 { 4415 4548 VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false); 4416 4549 osd->setLabel(QObject::tr("On-screen display")); 4550 if (settings) 4551 osd->setLabel(QObject::tr("Playback group settings for ") + 4552 settings->mGroupName + " - " + 4553 osd->getLabel()); 4417 4554 4555 if (!settings) 4418 4556 osd->addChild(new ThemeSelector("OSDTheme")); 4419 osd->addChild(OSDGeneralTimeout()); 4420 osd->addChild(OSDProgramInfoTimeout()); 4421 osd->addChild(OSDFont()); 4422 osd->addChild(OSDThemeFontSizeType()); 4423 osd->addChild(EnableMHEG()); 4424 osd->addChild(PersistentBrowseMode()); 4425 osd->addChild(BrowseAllTuners()); 4426 addChild(osd); 4557 osd->addChild(OSDGeneralTimeout(settings)); 4558 osd->addChild(OSDProgramInfoTimeout(settings)); 4559 osd->addChild(OSDFont(settings)); 4560 osd->addChild(OSDThemeFontSizeType(settings)); 4561 osd->addChild(EnableMHEG(settings)); 4562 if (!settings) 4563 { 4564 osd->addChild(PersistentBrowseMode(settings)); 4565 osd->addChild(BrowseAllTuners(settings)); 4566 } 4567 if (base) 4568 base->addChild(osd); 4569 else 4570 addChild(osd); 4427 4571 4428 4572 VerticalConfigurationGroup *udp = new VerticalConfigurationGroup(false); 4429 4573 udp->setLabel(QObject::tr("UDP OSD Notifications")); 4430 udp->addChild(OSDNotifyTimeout()); 4431 udp->addChild(UDPNotifyPort()); 4432 addChild(udp); 4574 if (settings) 4575 udp->setLabel(QObject::tr("Playback group settings for ") + 4576 settings->mGroupName + " - " + 4577 udp->getLabel()); 4578 udp->addChild(OSDNotifyTimeout(settings)); 4579 udp->addChild(UDPNotifyPort(settings)); 4580 if (base) 4581 base->addChild(udp); 4582 else 4583 addChild(udp); 4433 4584 4434 4585 VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false); 4435 4586 cc->setLabel(QObject::tr("Analog Closed Captions")); 4436 cc->addChild(OSDCCFont()); 4587 if (settings) 4588 cc->setLabel(QObject::tr("Playback group settings for ") + 4589 settings->mGroupName + " - " + 4590 cc->getLabel()); 4591 cc->addChild(OSDCCFont(settings)); 4437 4592 //cc->addChild(DecodeVBIFormat()); 4438 cc->addChild(CCBackground()); 4439 cc->addChild(DefaultCCMode()); 4440 cc->addChild(PreferCC708()); 4441 addChild(cc); 4593 cc->addChild(CCBackground(settings)); 4594 cc->addChild(DefaultCCMode(settings)); 4595 cc->addChild(PreferCC708(settings)); 4596 if (base) 4597 base->addChild(cc); 4598 else 4599 addChild(cc); 4442 4600 4443 addChild(OSDCC708Settings()); 4444 addChild(OSDCC708Fonts()); 4445 addChild(ExternalSubtitleSettings()); 4601 if (base) 4602 { 4603 base->addChild(OSDCC708Settings(settings)); 4604 base->addChild(OSDCC708Fonts(settings)); 4605 base->addChild(ExternalSubtitleSettings(settings)); 4606 } 4607 else 4608 { 4609 addChild(OSDCC708Settings(settings)); 4610 addChild(OSDCC708Fonts(settings)); 4611 addChild(ExternalSubtitleSettings(settings)); 4612 } 4446 4613 4447 4614 #if CONFIG_DARWIN 4448 4615 // Any Mac OS-specific OSD stuff would go here. -
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" … … 485 486 delete statusbox; 486 487 } 487 488 489 ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 490 { 491 return new PlaybackSettings(settings, base); 492 } 493 494 ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 495 { 496 return new OSDSettings(settings, base); 497 } 498 488 499 void TVMenuCallback(void *data, QString &selection) 489 500 { 490 501 (void)data; … … 577 588 } 578 589 else if (sel == "settings playgroup") 579 590 { 580 PlayGroupEditor editor; 591 PlayGroupEditor editor(createPlaybackSettingsForPlaybackGroup, 592 createOSDSettingsForPlaybackGroup); 581 593 editor.exec(); 582 594 } 583 595 else if (sel == "settings general") -
programs/mythfrontend/globalsettings.h
10 10 #include "themeinfo.h" 11 11 12 12 class QFileInfo; 13 class PlaySettings; 13 14 14 15 class ThemeSelector : public HostImageSelect 15 16 { … … 23 24 class PlaybackSettings : public ConfigurationWizard 24 25 { 25 26 public: 26 PlaybackSettings(); 27 PlaybackSettings(PlaySettings *settings=NULL, 28 ConfigurationWizard *base=NULL); 27 29 }; 28 30 29 31 class OSDSettings: virtual public ConfigurationWizard 30 32 { 31 33 public: 32 OSDSettings(); 34 OSDSettings(PlaySettings *settings=NULL, 35 ConfigurationWizard *base=NULL); 33 36 }; 34 37 35 38 class GeneralSettings : public ConfigurationWizard … … 140 143 Q_OBJECT 141 144 142 145 public: 143 PlaybackProfileConfigs(const QString &str );146 PlaybackProfileConfigs(const QString &str, PlaySettings *settings); 144 147 virtual ~PlaybackProfileConfigs(); 145 148 146 149 private: … … 152 155 153 156 private: 154 157 QStringList profiles; 155 HostComboBox*grouptrigger;158 ComboBoxSetting *grouptrigger; 156 159 }; 157 160 158 161 #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 27 28 static void *run_priv_thread(void *data) … … 215 216 return GENERIC_EXIT_DB_OUTOFDATE; 216 217 } 217 218 218 TV *tv = new TV();219 if (!tv->Init())220 {221 VERBOSE(VB_IMPORTANT, "Fatal Error: Could not initialize TV class.");222 return TV_EXIT_NO_TV;223 }224 225 219 ProgramInfo *pginfo = NULL; 226 220 227 221 if (!filename.isEmpty() && … … 240 234 241 235 } 242 236 237 PlaySettings settings(pginfo->playgroup); 238 TV *tv = new TV(&settings); 239 if (!tv->Init()) 240 { 241 VERBOSE(VB_IMPORTANT, "Fatal Error: Could not initialize TV class."); 242 return TV_EXIT_NO_TV; 243 } 244 243 245 TV::StartTV(pginfo, false); 244 246 245 247 if (pginfo)