Ticket #8088: 8088_playgroups_v12.patch
File 8088_playgroups_v12.patch, 130.8 KB (added by , 14 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
62 62 #include "mythverbose.h" 63 63 #include "myth_imgconvert.h" 64 64 #include "mythsystemevent.h" 65 #include "playsettings.h" 65 66 66 67 extern "C" { 67 68 #include "vbitext/vbi.h" … … 227 228 // Debugging variables 228 229 output_jmeter(NULL) 229 230 { 230 231 // Playback (output) zoom control232 detect_letter_box = new DetectLetterbox(this);233 234 vbimode = VBIMode::Parse(gCoreContext->GetSetting("VbiFormat"));235 236 commrewindamount = gCoreContext->GetNumSetting("CommRewindAmount",0);237 commnotifyamount = gCoreContext->GetNumSetting("CommNotifyAmount",0);238 decode_extra_audio=gCoreContext->GetNumSetting("DecodeExtraAudio", 0);239 itvEnabled = gCoreContext->GetNumSetting("EnableMHEG", 0);240 db_prefer708 = gCoreContext->GetNumSetting("Prefer708Captions", 1);241 autocommercialskip = (CommSkipMode)242 gCoreContext->GetNumSetting("AutoCommercialSkip", kCommSkipOff);243 244 231 lastIgnoredManualSkip = QDateTime::currentDateTime().addSecs(-10); 245 232 246 233 bzero(&txtbuffers, sizeof(txtbuffers)); … … 691 678 692 679 if (using_null_videoout) 693 680 { 694 videoOutput = new VideoOutputNull( );681 videoOutput = new VideoOutputNull(GetPlaySettings()); 695 682 if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(), 696 683 video_aspect, 0, 0, 0, 0, 0, 0)) 697 684 { … … 739 726 pipState, 740 727 video_disp_dim, video_aspect, 741 728 widget->winId(), display_rect, (video_frame_rate * play_speed), 742 0 /*embedid*/ );729 0 /*embedid*/, GetPlaySettings()); 743 730 744 731 if (!videoOutput) 745 732 { … … 761 748 videoOutput->EmbedInWidget(embx, emby, embw, embh); 762 749 } 763 750 764 SetCaptionsEnabled(gCoreContext->GetNumSetting("DefaultCCMode"), false); 751 SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0), 752 false); 765 753 766 754 InitFilters(); 767 755 … … 812 800 813 801 void NuppelVideoPlayer::ReinitVideo(void) 814 802 { 815 if (!videoOutput->IsPreferredRenderer(video_disp_dim ))803 if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings())) 816 804 { 817 805 VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer.")); 818 806 SetErrored(QObject::tr("Need to switch video renderer.")); … … 2957 2945 m_double_process = videoOutput->IsExtraProcessingRequired(); 2958 2946 2959 2947 videosync = VideoSync::BestMethod( 2960 videoOutput, fr_int, rf_int, m_double_framerate); 2948 videoOutput, GetPlaySettings(), 2949 fr_int, rf_int, m_double_framerate); 2961 2950 2962 2951 // Make sure video sync can do it 2963 2952 if (videosync != NULL && m_double_framerate) … … 3441 3430 QRect visible, total; 3442 3431 float aspect, scaling; 3443 3432 3444 osd = new OSD( );3433 osd = new OSD(GetPlaySettings()); 3445 3434 3446 3435 osd->SetListener(m_tv); 3447 3436 … … 3520 3509 3521 3510 GetDecoder()->setExactSeeks(seeks); 3522 3511 3523 if ( gCoreContext->GetNumSetting("ClearSavedPosition", 1) &&3512 if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) && 3524 3513 !player_ctx->IsPIP()) 3525 3514 { 3526 3515 if (player_ctx->buffer->isDVD()) … … 3788 3777 ++deleteIter; 3789 3778 if (deleteIter.key() == totalFrames) 3790 3779 { 3791 if (!( gCoreContext->GetNumSetting("EndOfRecordingExitPrompt") == 13780 if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1 3792 3781 && !player_ctx->IsPIP() && 3793 3782 player_ctx->GetState() == kState_WatchingPreRecorded)) 3794 3783 { … … 3962 3951 3963 3952 if (sim_pip_players.isEmpty()) 3964 3953 { 3965 return (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft); 3954 return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation", 3955 kPIPTopLeft); 3966 3956 } 3967 3957 3968 3958 // order of preference, could be stored in db if we want it configurable … … 4726 4716 exactseeks = frame_exact_seek; 4727 4717 player_ctx = ctx; 4728 4718 livetv = ctx->tvchain; 4719 4720 vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", "")); 4721 4722 // Playback (output) zoom control 4723 detect_letter_box = new DetectLetterbox(this); 4724 4725 commrewindamount = GetPlaySettings()->GetNumSetting("CommRewindAmount", 0); 4726 commnotifyamount = GetPlaySettings()->GetNumSetting("CommNotifyAmount", 0); 4727 decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0); 4728 itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0); 4729 db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1); 4730 autocommercialskip = (CommSkipMode) 4731 GetPlaySettings()->GetNumSetting("AutoCommercialSkip", kCommSkipOff); 4729 4732 } 4730 4733 4731 4734 void NuppelVideoPlayer::SetDeleteIter(void) … … 7397 7400 { 7398 7401 QMutexLocker locker(&subtitleLock); 7399 7402 textSubtitles.Clear(); 7400 return TextSubtitleParser::LoadSubtitles(subtitleFileName, textSubtitles); 7403 return TextSubtitleParser::LoadSubtitles(subtitleFileName, textSubtitles, 7404 GetPlaySettings()); 7401 7405 } 7402 7406 7403 7407 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 = gCoreContext->GetNumSetting("PIPSize", 26); 91 94 92 db_move = QPoint( gCoreContext->GetNumSetting("xScanDisplacement", 0),93 gCoreContext->GetNumSetting("yScanDisplacement", 0));95 db_move = QPoint(settings->GetNumSetting("xScanDisplacement", 0), 96 settings->GetNumSetting("yScanDisplacement", 0)); 94 97 db_use_gui_size = gCoreContext->GetNumSetting("GuiSizeForTV", 0); 95 98 96 99 QDesktopWidget *desktop = NULL; … … 613 616 if (change) 614 617 { 615 618 db_scale_vert = 616 gCoreContext->GetNumSetting("VertScanPercentage", 0) * 0.01f;619 settings->GetNumSetting("VertScanPercentage", 0) * 0.01f; 617 620 db_scale_horiz = 618 gCoreContext->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/DetectLetterbox.cpp
5 5 #include "NuppelVideoPlayer.h" 6 6 #include "videoouttypes.h" 7 7 #include "mythcorecontext.h" 8 #include "playsettings.h" 8 9 9 10 DetectLetterbox::DetectLetterbox(NuppelVideoPlayer* const nvp) 10 11 { 11 int dbAdjustFill = gCoreContext->GetNumSetting("AdjustFill", 0);12 int dbAdjustFill = nvp->GetPlaySettings()->GetNumSetting("AdjustFill", 0); 12 13 isDetectLetterbox = dbAdjustFill >= kAdjustFill_AutoDetect_DefaultOff; 13 14 firstFrameChecked = 0; 14 15 detectLetterboxDefaultMode = (AdjustFillMode) max((int) kAdjustFill_Off, … … 18 19 detectLetterboxPossibleFullFrame = -1; 19 20 detectLetterboxConsecutiveCounter = 0; 20 21 detectLetterboxDetectedMode = nvp->GetAdjustFill(); 21 detectLetterboxLimit = gCoreContext->GetNumSetting("DetectLeterboxLimit", 75); 22 detectLetterboxLimit = 23 nvp->GetPlaySettings()->GetNumSetting("DetectLeterboxLimit", 75); 22 24 nupple_video_player = nvp; 23 25 } 24 26 -
libs/libmythtv/videoout_opengl.cpp
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); … … 1816 1818 MythCodecID VideoOutputQuartz::GetBestSupportedCodec( 1817 1819 uint width, uint height, 1818 1820 uint osd_width, uint osd_height, 1819 uint stream_type, uint fourcc )1821 uint stream_type, uint fourcc, PlaySettings *settings) 1820 1822 { 1821 1823 (void) osd_width; 1822 1824 (void) osd_height; 1823 1825 1824 VideoDisplayProfile vdp ;1826 VideoDisplayProfile vdp(settings); 1825 1827 vdp.SetInput(QSize(width, height)); 1826 1828 QString dec = vdp.GetDecoder(); 1827 1829 if ((dec == "libmpeg2") || (dec == "ffmpeg")) -
libs/libmythtv/avformatdecoder.cpp
28 28 #include "DVDRingBuffer.h" 29 29 #include "videodisplayprofile.h" 30 30 #include "mythuihelper.h" 31 #include "playsettings.h" 31 32 32 33 #include "lcddevice.h" 33 34 … … 536 537 537 538 cc608_build_parity_table(cc608_parity_table); 538 539 539 if ( gCoreContext->GetNumSetting("CCBackground", 0))540 if (GetNVP()->GetPlaySettings()->GetNumSetting("CCBackground", 0)) 540 541 CC708Window::forceWhiteOnBlackText = true; 541 542 542 543 no_dts_hack = false; … … 1431 1432 { 1432 1433 directrendering = true; 1433 1434 if ( 1434 ! gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&1435 !GetNVP()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) && 1435 1436 !CODEC_IS_HWACCEL(codec)) 1436 1437 { 1437 1438 SetLowBuffers(false); … … 1911 1912 1912 1913 if (!is_db_ignored) 1913 1914 { 1914 VideoDisplayProfile vdp ;1915 VideoDisplayProfile vdp(GetNVP()->GetPlaySettings()); 1915 1916 vdp.SetInput(QSize(width, height)); 1916 1917 dec = vdp.GetDecoder(); 1917 1918 thread_count = vdp.GetMaxCPUs(); … … 1939 1940 MythCodecID vdpau_mcid; 1940 1941 vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec( 1941 1942 width, height, 1942 mpeg_version(enc->codec_id), no_hardware_decoders); 1943 mpeg_version(enc->codec_id), no_hardware_decoders, 1944 GetNVP()->GetPlaySettings()); 1943 1945 1944 1946 if (vdpau_mcid >= video_codec_id) 1945 1947 { … … 1971 1973 /* mpeg type */ mpeg_version(enc->codec_id), 1972 1974 /* xvmc pix fmt */ xvmc_pixel_format(enc->pix_fmt), 1973 1975 /* test surface */ codec_is_std(video_codec_id), 1974 /* force_xv */ force_xv); 1976 /* force_xv */ force_xv, 1977 GetNVP()->GetPlaySettings()); 1975 1978 1976 1979 if (mcid >= video_codec_id) 1977 1980 { … … 2004 2007 /* osd dim */ 0, 0, 2005 2008 /* mpeg type */ mpeg_version(enc->codec_id), 2006 2009 /* pixel format */ 2007 (PIX_FMT_YUV420P == enc->pix_fmt) ? FOURCC_I420 : 0); 2010 (PIX_FMT_YUV420P == enc->pix_fmt) ? FOURCC_I420 : 0, 2011 GetNVP()->GetPlaySettings()); 2008 2012 2009 2013 if (quartz_mcid >= video_codec_id) 2010 2014 { -
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" … … 2360 2361 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2361 2362 2362 2363 OSDTypeCC::OSDTypeCC(const QString &name, TTFFont *font, int xoff, int yoff, 2363 int dispw, int disph, float wmult, float hmult) 2364 int dispw, int disph, float wmult, float hmult, 2365 PlaySettings *settings) 2364 2366 : OSDType(name) 2365 2367 { 2366 2368 m_font = font; … … 2374 2376 2375 2377 QRect rect = QRect(0, 0, 0, 0); 2376 2378 m_box = new OSDTypeBox("cc_background", rect, wmult, hmult); 2377 m_ccbackground = gCoreContext->GetNumSetting("CCBackground", 0);2379 m_ccbackground = settings->GetNumSetting("CCBackground", 0); 2378 2380 } 2379 2381 2380 2382 OSDTypeCC::~OSDTypeCC() -
libs/libmythtv/playgroup.cpp
1 1 #include "mythdb.h" 2 2 #include "playgroup.h" 3 3 #include "programinfo.h" 4 #include "playsettings.h" 4 5 5 6 // A parameter associated with the profile itself 6 7 class PlayGroupDBStorage : public SimpleDBStorage … … 210 211 return res; 211 212 } 212 213 213 PlayGroupEditor::PlayGroupEditor(void) : 214 listbox(new ListBoxSetting(this)), lastValue("Default") 214 PlayGroupEditor::PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize) : 215 listbox(new ListBoxSetting(this)), lastValue("Default"), 216 getSettings(funcArray), getSettingsSize(funcArraySize) 215 217 { 216 218 listbox->setLabel(tr("Playback Groups")); 217 219 addChild(listbox); … … 242 244 } 243 245 244 246 PlayGroup group(name); 247 PlaySettings *psettings = new PlaySettings(name); 248 for (int i=0; i<getSettingsSize; i++) 249 getSettings[i](psettings, &group); 245 250 if (group.exec() == QDialog::Accepted || !created) 246 251 lastValue = name; 247 252 else … … 276 281 query.bindValue(":NAME", name); 277 282 if (!query.exec()) 278 283 MythDB::DBError("PlayGroupEditor::doDelete", query); 284 PlaySettings::deleteGroup(name); 279 285 280 286 int lastIndex = listbox->getValueIndex(name); 281 287 lastValue = ""; -
libs/libmythtv/videoout_opengl.h
10 10 { 11 11 public: 12 12 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 13 VideoOutputOpenGL( );13 VideoOutputOpenGL(PlaySettings *settings); 14 14 ~VideoOutputOpenGL(); 15 15 16 16 bool Init(int width, int height, float aspect, WId winid, -
libs/libmythtv/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
55 55 class TV; 56 56 class OSDListTreeItemEnteredEvent; 57 57 class OSDListTreeItemSelectedEvent; 58 class PlaySettings; 58 59 59 60 typedef QMap<QString,InfoMap> DDValueMap; 60 61 typedef QMap<QString,DDValueMap> DDKeyMap; … … 185 186 unsigned long seconds; 186 187 }; 187 188 188 TV( void);189 TV(PlaySettings *settings); 189 190 ~TV(); 190 191 191 192 bool Init(bool createWindow = true); … … 210 211 211 212 // Recording commands 212 213 int PlayFromRecorder(int recordernum); 213 int Playback(const ProgramInfo &rcinfo );214 int Playback(const ProgramInfo &rcinfo, PlaySettings *settings); 214 215 215 216 // Commands used by frontend playback box 216 217 QString GetRecordingGroup(int player_idx) const; … … 599 600 static TVState RemoveRecording(TVState state); 600 601 void RestoreScreenSaver(const PlayerContext*); 601 602 602 void InitUDPNotifyEvent( void);603 void InitUDPNotifyEvent(PlaySettings *settings); 603 604 604 605 /// true if dialog is either videoplayexit, playexit or askdelete dialog 605 606 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 *funcArray, int funcArraySize); 33 36 virtual DialogCode exec(void); 34 37 virtual void Load(void); 35 38 virtual void Save(void) { } … … 44 47 protected: 45 48 ListBoxSetting *listbox; 46 49 QString lastValue; 50 SettingsLookup *getSettings; 51 int getSettingsSize; 47 52 }; 48 53 49 54 #endif -
libs/libmythtv/dbcheck.cpp
3561 3561 3562 3562 VideoDisplayProfile::CreateNewProfiles(host); 3563 3563 profiles = VideoDisplayProfile::GetProfiles(host); 3564 QString profile = VideoDisplayProfile::GetDefaultProfileName(host); 3564 QString profile = 3565 VideoDisplayProfile::GetDefaultProfileName(host, NULL); 3565 3566 3566 3567 if (profiles.contains("Normal") && 3567 3568 (profile=="CPU++" || profile=="CPU+" || profile=="CPU--")) … … 5799 5800 " jump int(11) NOT NULL default '0'," 5800 5801 " PRIMARY KEY (`name`)" 5801 5802 ");", 5803 "CREATE TABLE playgroupsettings (" 5804 " playgroupname varchar(64) NOT NULL," 5805 " `value` varchar(128) NOT NULL," 5806 " `data` text," 5807 " overridden tinyint(1) NOT NULL," 5808 " PRIMARY KEY (playgroupname, `value`)" 5809 ");", 5802 5810 "CREATE TABLE powerpriority (" 5803 5811 " priorityname varchar(64) collate utf8_bin NOT NULL," 5804 5812 " recpriority int(10) NOT NULL default '0'," -
libs/libmythtv/videoout_vdpau.cpp
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), … … 858 858 859 859 MythCodecID VideoOutputVDPAU::GetBestSupportedCodec( 860 860 uint width, uint height, 861 uint stream_type, bool no_acceleration )861 uint stream_type, bool no_acceleration, PlaySettings *settings) 862 862 { 863 863 bool use_cpu = no_acceleration; 864 VideoDisplayProfile vdp ;864 VideoDisplayProfile vdp(settings); 865 865 vdp.SetInput(QSize(width, height)); 866 866 QString dec = vdp.GetDecoder(); 867 867 -
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
15 15 #include "storagegroup.h" 16 16 #include "mythcorecontext.h" 17 17 #include "videometadatautil.h" 18 #include "DetectLetterbox.h" 19 #include "playsettings.h" 18 20 19 21 #define LOC QString("playCtx: ") 20 22 #define LOC_ERR QString("playCtx, Error: ") … … 435 437 WId embedwinid, const QRect *embedbounds, 436 438 bool muted) 437 439 { 438 int exact_seeking = gCoreContext->GetNumSetting("ExactSeeking", 0);440 int exact_seeking = settings->GetNumSetting("ExactSeeking", 0); 439 441 440 442 if (HasNVP()) 441 443 { … … 917 919 /** 918 920 * \brief assign programinfo to the context 919 921 */ 920 void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 922 void PlayerContext::SetPlayingInfo(const ProgramInfo *info, 923 PlaySettings *_settings) 921 924 { 922 925 bool ignoreDB = gCoreContext->IsDatabaseIgnored(); 923 926 … … 929 932 playingInfo->MarkAsInUse(false, recUsage); 930 933 delete playingInfo; 931 934 playingInfo = NULL; 935 // XXX delete settings? 932 936 } 933 937 934 938 if (info) … … 937 941 if (!ignoreDB) 938 942 playingInfo->MarkAsInUse(true, recUsage); 939 943 playingLen = playingInfo->GetSecondsInRecording(); 944 settings = (_settings ? _settings : 945 new PlaySettings(playingInfo->GetPlaybackGroup())); 940 946 } 941 947 } 942 948 -
libs/libmythtv/NuppelVideoPlayer.h
197 197 bool GetAudioBufferStatus(uint &fill, uint &total) const; 198 198 PIPLocation GetNextPIPLocation(void) const; 199 199 200 PlaySettings *GetPlaySettings(void) const { 201 return player_ctx ? player_ctx->settings : NULL; 202 } 203 200 204 // Bool Gets 201 205 bool GetRawAudioState(void) const; 202 206 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
73 73 class TeletextViewer; 74 74 class QStringList; 75 75 class QDomElement; 76 class PlaySettings; 76 77 77 78 class OSD : public QObject 78 79 { 79 80 Q_OBJECT 80 81 public: 81 OSD( );82 OSD(PlaySettings *settings); 82 83 ~OSD(void); 83 84 84 85 void Init(const QRect &totalBounds, int frameRate, … … 236 237 237 238 QObject *m_listener; 238 239 240 PlaySettings *settings; 241 239 242 QRect osdBounds; 240 243 int frameint; 241 244 bool needPillarBox; -
libs/libmythtv/vsync.cpp
34 34 35 35 #include "mythcontext.h" 36 36 #include "mythmainwindow.h" 37 #include "playsettings.h" 37 38 38 39 #ifdef USING_XV 39 40 #include "videoout_xv.h" … … 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 = ( gCoreContext->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
61 61 #include "recordinginfo.h" 62 62 #include "mythsystemevent.h" 63 63 #include "videometadatautil.h" 64 #include "playsettings.h" 64 65 65 66 #if ! HAVE_ROUND 66 67 #define round(x) ((int) ((x) + 0.5)) … … 192 193 bool startInGuide = flags & kStartTVInGuide; 193 194 bool inPlaylist = flags & kStartTVInPlayList; 194 195 bool initByNetworkCommand = flags & kStartTVByNetworkCommand; 195 TV *tv = new TV();196 196 bool quitAll = false; 197 197 bool showDialogs = true; 198 198 bool playCompleted = false; … … 207 207 curProgram->SetIgnoreBookmark(flags & kStartTVIgnoreBookmark); 208 208 } 209 209 210 PlaySettings settings(curProgram ? curProgram->GetPlaybackGroup() : "Default"); 211 TV *tv = new TV(&settings); 212 210 213 // Initialize TV 211 214 if (!tv->Init()) 212 215 { … … 237 240 if (curProgram) 238 241 { 239 242 VERBOSE(VB_PLAYBACK, LOC + "tv->Playback() -- begin"); 240 if (!tv->Playback(*curProgram ))243 if (!tv->Playback(*curProgram, &settings)) 241 244 { 242 245 quitAll = true; 243 246 } … … 820 823 * \brief Performs instance initialiation not requiring access to database. 821 824 * \sa Init(void) 822 825 */ 823 TV::TV( void)826 TV::TV(PlaySettings *settings) 824 827 : // Configuration variables from database 825 828 baseFilters(""), 826 829 db_channel_format("<num> <sign>"), … … 956 959 kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]); 957 960 958 961 MythDB::getMythDB()->GetSettings(kv); 962 settings->AddToMap(kv); 959 963 960 964 // convert from minutes to ms. 961 965 db_idle_timeout = kv["LiveTVIdleTimeout"].toInt() * 60 * 1000; … … 1749 1753 } 1750 1754 1751 1755 1752 int TV::Playback(const ProgramInfo &rcinfo )1756 int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings) 1753 1757 { 1754 1758 wantsToQuit = false; 1755 1759 jumpToProgram = false; … … 1763 1767 return 0; 1764 1768 } 1765 1769 1766 mctx->SetPlayingInfo(&rcinfo );1770 mctx->SetPlayingInfo(&rcinfo, settings); 1767 1771 mctx->SetInitialTVState(false); 1768 1772 ScheduleStateChange(mctx); 1769 1773 … … 1846 1850 1847 1851 if (fileexists) 1848 1852 { 1849 Playback(pginfo); 1853 PlaySettings settings("Default"); 1854 Playback(pginfo, &settings); 1850 1855 retval = 1; 1851 1856 } 1852 1857 … … 2192 2197 { 2193 2198 OSD *osd = GetOSDLock(ctx); 2194 2199 ctx->LockPlayingInfo(__FILE__, __LINE__); 2195 if (osd && (PlayGroup::GetCount() > 0)) 2200 if (ctx->playingInfo->GetPlaybackGroup() != "Default" && 2201 ctx->playingInfo->GetPlaybackGroup() != "Videos" && 2202 osd && (PlayGroup::GetCount() > 0)) 2196 2203 osd->SetSettingsText(tr("%1 Settings") 2197 2204 .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup())), 3); 2198 2205 ctx->UnlockPlayingInfo(__FILE__, __LINE__); … … 5181 5188 return false; 5182 5189 } 5183 5190 5184 InitUDPNotifyEvent( );5191 InitUDPNotifyEvent(ctx->settings); 5185 5192 bool ok = false; 5186 5193 if (ctx->IsNullVideoDesired()) 5187 5194 { … … 11844 11851 GetMythUI()->RestoreScreensaver(); 11845 11852 } 11846 11853 11847 void TV::InitUDPNotifyEvent( void)11854 void TV::InitUDPNotifyEvent(PlaySettings *settings) 11848 11855 { 11849 11856 if (db_udpnotify_port && !udpnotify) 11850 11857 { 11851 udpnotify = new UDPNotify(db_udpnotify_port );11858 udpnotify = new UDPNotify(db_udpnotify_port, settings); 11852 11859 connect(udpnotify, 11853 11860 SIGNAL(AddUDPNotifyEvent( 11854 11861 const QString&,const UDPNotifyOSDSet*)), -
libs/libmythtv/videodisplayprofile.h
13 13 14 14 #include "mythcontext.h" 15 15 16 class PlaySettings; 17 16 18 typedef QMap<QString,QString> pref_map_t; 17 19 typedef QMap<QString,QStringList> safe_map_t; 18 20 typedef QStringList safe_list_t; … … 80 82 class MPUBLIC VideoDisplayProfile 81 83 { 82 84 public: 83 VideoDisplayProfile( );85 VideoDisplayProfile(PlaySettings *settings); 84 86 ~VideoDisplayProfile(); 85 87 86 88 void SetInput(const QSize &size); … … 124 126 static QString GetDecoderName(const QString &decoder); 125 127 static QString GetDecoderHelp(QString decoder = QString::null); 126 128 127 static QString GetDefaultProfileName(const QString &hostname); 129 static QString GetDefaultProfileName(const QString &hostname, 130 PlaySettings *settings); 128 131 static void SetDefaultProfileName(const QString &profilename, 129 132 const QString &hostname); 130 133 static uint GetProfileGroupID(const QString &profilename, -
libs/libmythtv/videoout_null.cpp
27 27 opts.priorities->insert("null", 10); 28 28 } 29 29 30 VideoOutputNull::VideoOutputNull( void) :31 VideoOutput( ), global_lock(QMutex::Recursive)30 VideoOutputNull::VideoOutputNull(PlaySettings *settings) : 31 VideoOutput(settings), global_lock(QMutex::Recursive) 32 32 { 33 33 VERBOSE(VB_PLAYBACK, "VideoOutputNull()"); 34 34 memset(&av_pause_frame, 0, sizeof(av_pause_frame)); -
libs/libmythtv/videooutbase.cpp
8 8 #include "NuppelVideoPlayer.h" 9 9 #include "videodisplayprofile.h" 10 10 #include "decoderbase.h" 11 #include "playsettings.h" 11 12 12 13 #include "mythcorecontext.h" 13 14 #include "mythverbose.h" … … 108 109 PIPState pipState, 109 110 const QSize &video_dim, float video_aspect, 110 111 WId win_id, const QRect &display_rect, 111 float video_prate, WId embed_id) 112 float video_prate, WId embed_id, 113 PlaySettings *settings) 112 114 { 113 115 (void) codec_priv; 114 116 … … 153 155 QString renderer = QString::null; 154 156 if (renderers.size() > 0) 155 157 { 156 VideoDisplayProfile vprof ;158 VideoDisplayProfile vprof(settings); 157 159 vprof.SetInput(video_dim); 158 160 159 161 QString tmp = vprof.GetVideoRenderer(); … … 181 183 182 184 #ifdef USING_DIRECTFB 183 185 if (renderer == "directfb") 184 vo = new VideoOutputDirectfb( );186 vo = new VideoOutputDirectfb(settings); 185 187 #endif // USING_DIRECTFB 186 188 187 189 #ifdef USING_MINGW 188 190 if (renderer == "direct3d") 189 vo = new VideoOutputD3D( );191 vo = new VideoOutputD3D(settings); 190 192 #endif // USING_MINGW 191 193 192 194 #ifdef Q_OS_MACX 193 195 if (osxlist.contains(renderer)) 194 vo = new VideoOutputQuartz( codec_id, codec_priv);196 vo = new VideoOutputQuartz(settings, codec_id, codec_priv); 195 197 #endif // Q_OS_MACX 196 198 197 199 #ifdef USING_OPENGL_VIDEO 198 200 if (renderer == "opengl") 199 vo = new VideoOutputOpenGL( );201 vo = new VideoOutputOpenGL(settings); 200 202 #endif // USING_OPENGL_VIDEO 201 203 202 204 #ifdef USING_VDPAU 203 205 if (renderer == "vdpau") 204 vo = new VideoOutputVDPAU( codec_id);206 vo = new VideoOutputVDPAU(settings, codec_id); 205 207 #endif // USING_VDPAU 206 208 207 209 #ifdef USING_XV 208 210 if (xvlist.contains(renderer)) 209 vo = new VideoOutputXv( codec_id);211 vo = new VideoOutputXv(settings, codec_id); 210 212 #endif // USING_XV 211 213 212 214 if (vo) … … 303 305 * \brief This constructor for VideoOutput must be followed by an 304 306 * Init(int,int,float,WId,int,int,int,int,WId) call. 305 307 */ 306 VideoOutput::VideoOutput( ) :308 VideoOutput::VideoOutput(PlaySettings *_settings) : 307 309 // DB Settings 308 310 db_display_dim(0,0), 309 311 db_aspectoverride(kAspect_Off), db_adjustfill(kAdjustFill_Off), … … 337 339 display_res(NULL), 338 340 339 341 // Physical display 340 monitor_sz(640,480), monitor_dim(400,300) 342 monitor_sz(640,480), monitor_dim(400,300), 341 343 344 settings(_settings) 345 342 346 { 343 347 bzero(&pip_tmp_image, sizeof(pip_tmp_image)); 344 db_display_dim = QSize( gCoreContext->GetNumSetting("DisplaySizeWidth", 0),345 gCoreContext->GetNumSetting("DisplaySizeHeight", 0));348 db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth", 0), 349 settings->GetNumSetting("DisplaySizeHeight", 0)); 346 350 347 351 db_pict_attr[kPictureAttribute_Brightness] = 348 gCoreContext->GetNumSetting("PlaybackBrightness", 50);352 settings->GetNumSetting("PlaybackBrightness", 50); 349 353 db_pict_attr[kPictureAttribute_Contrast] = 350 gCoreContext->GetNumSetting("PlaybackContrast", 50);354 settings->GetNumSetting("PlaybackContrast", 50); 351 355 db_pict_attr[kPictureAttribute_Colour] = 352 gCoreContext->GetNumSetting("PlaybackColour", 50);356 settings->GetNumSetting("PlaybackColour", 50); 353 357 db_pict_attr[kPictureAttribute_Hue] = 354 gCoreContext->GetNumSetting("PlaybackHue", 0);358 settings->GetNumSetting("PlaybackHue", 0); 355 359 356 360 db_aspectoverride = (AspectOverrideMode) 357 gCoreContext->GetNumSetting("AspectOverride", 0);361 settings->GetNumSetting("AspectOverride", 0); 358 362 db_adjustfill = (AdjustFillMode) 359 gCoreContext->GetNumSetting("AdjustFill", 0);363 settings->GetNumSetting("AdjustFill", 0); 360 364 db_letterbox_colour = (LetterBoxColour) 361 gCoreContext->GetNumSetting("LetterboxColour", 0);365 settings->GetNumSetting("LetterboxColour", 0); 362 366 db_use_picture_controls = 363 gCoreContext->GetNumSetting("UseOutputPictureControls", 0);367 settings->GetNumSetting("UseOutputPictureControls", 0); 364 368 365 369 if (!gCoreContext->IsDatabaseIgnored()) 366 db_vdisp_profile = new VideoDisplayProfile( );370 db_vdisp_profile = new VideoDisplayProfile(settings); 367 371 368 windows.push_back(VideoOutWindow( ));372 windows.push_back(VideoOutWindow(settings)); 369 373 } 370 374 371 375 /** … … 434 438 return QString::null; 435 439 } 436 440 437 bool VideoOutput::IsPreferredRenderer(QSize video_size )441 bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings) 438 442 { 439 443 if (!db_vdisp_profile || (video_size == windows[0].GetVideoDispDim())) 440 444 return true; 441 445 442 VideoDisplayProfile vdisp ;446 VideoDisplayProfile vdisp(settings); 443 447 vdisp.SetInput(video_size); 444 448 QString new_rend = vdisp.GetVideoRenderer(); 445 449 if (new_rend.isEmpty()) -
libs/libmythtv/videooutwindow.h
16 16 #include "videoouttypes.h" 17 17 18 18 class 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; } … … 146 147 LiveTVChain *tvchain; 147 148 RingBuffer *buffer; 148 149 ProgramInfo *playingInfo; ///< Currently playing info 150 PlaySettings *settings; // corresponding to playingInfo 149 151 long long playingLen; ///< Initial CalculateLength() 150 152 bool nohardwaredecoders; // < Disable use of VDPAU decoding 151 153 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, 1085 ret, width, height, 1083 1086 dummy, xvmc_chroma, &info); 1084 1087 if (port >= 0) 1085 1088 { -
libs/libmythtv/udpnotify.cpp
31 31 #include "udpnotify.h" 32 32 #include "mythcorecontext.h" 33 33 #include "mythverbose.h" 34 #include "playsettings.h" 34 35 35 36 UDPNotifyOSDSet::UDPNotifyOSDSet(const QString &name, uint timeout) 36 37 : m_name(name), m_timeout(timeout) … … 73 74 74 75 ///////////////////////////////////////////////////////////////////////// 75 76 76 UDPNotify::UDPNotify(uint udp_port ) :77 UDPNotify::UDPNotify(uint udp_port, PlaySettings *settings) : 77 78 m_socket(new QUdpSocket()), m_db_osd_udpnotify_timeout(5) 78 79 { 79 80 connect(m_socket, SIGNAL(readyRead()), … … 81 82 82 83 m_socket->bind(udp_port); 83 84 84 m_db_osd_udpnotify_timeout = gCoreContext->GetNumSetting("OSDNotifyTimeout", 5);85 m_db_osd_udpnotify_timeout = settings->GetNumSetting("OSDNotifyTimeout", 5); 85 86 } 86 87 87 88 void UDPNotify::deleteLater(void) -
libs/libmythtv/videooutbase.h
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 = gCoreContext->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: ") … … 59 60 const char *kOSDDialogInfo = "infobox"; 60 61 const char *kOSDDialogEditChannel = "channel_editor"; 61 62 62 OSD::OSD( ) :63 OSD::OSD(PlaySettings *_settings) : 63 64 QObject(), m_listener(NULL), 65 settings(_settings), 64 66 osdBounds(), frameint(0), 65 67 needPillarBox(false), 66 themepath(FindTheme( gCoreContext->GetSetting("OSDTheme"))),68 themepath(FindTheme(settings->GetSetting("OSDTheme", ""))), 67 69 wscale(1.0f), fscale(1.0f), 68 70 m_themeinfo(new ThemeInfo(themepath)), 69 71 m_themeaspect(4.0f/3.0f), … … 174 176 drawSurface = new OSDSurface(osd_bounds.width(), osd_bounds.height()); 175 177 176 178 if (!cc708_defaults_initialized) 177 initialize_osd_fonts( );179 initialize_osd_fonts(settings); 178 180 179 181 for (uint i = 0; i < 16; i++) 180 182 cc708fontnames[i] = cc708_default_font_names[i]; … … 187 189 if (themepath.isEmpty()) 188 190 { 189 191 VERBOSE(VB_IMPORTANT, "Couldn't find OSD theme: " 190 << gCoreContext->GetSetting("OSDTheme"));192 <<settings->GetSetting("OSDTheme", "")); 191 193 InitDefaults(); 192 194 return; 193 195 } … … 196 198 if (!LoadTheme()) 197 199 { 198 200 VERBOSE(VB_IMPORTANT, "Couldn't load OSD theme: " 199 << gCoreContext->GetSetting("OSDTheme")<<" at "<<themepath);201 <<settings->GetSetting("OSDTheme", "")<<" at "<<themepath); 200 202 } 201 203 202 204 InitDefaults(); … … 240 242 QString name = "cc_font"; 241 243 int fontsize = m_themeinfo->GetBaseRes()->height() / 27; 242 244 243 ccfont = LoadFont( gCoreContext->GetSetting("OSDCCFont"), fontsize);245 ccfont = LoadFont(settings->GetSetting("OSDCCFont", ""), fontsize); 244 246 245 247 if (ccfont) 246 248 fontMap[name] = ccfont; … … 276 278 277 279 OSDTypeCC *ccpage = 278 280 new OSDTypeCC(name, ccfont, sub_xoff, sub_yoff, 279 sub_dispw, sub_disph, wmult, hmult );281 sub_dispw, sub_disph, wmult, hmult, settings); 280 282 container->AddType(ccpage); 281 283 return true; 282 284 } … … 295 297 296 298 // Create fonts... 297 299 TTFFont* ccfonts[48]; 298 uint z = gCoreContext->GetNumSetting("OSDCC708TextZoom", 100) *300 uint z = settings->GetNumSetting("OSDCC708TextZoom", 100) * 299 301 m_themeinfo->GetBaseRes()->height(); 300 302 uint fontsizes[3] = { z / 3600, z / 2900, z / 2200 }; 301 303 for (uint i = 0; i < 48; i++) … … 362 364 if (!font) 363 365 { 364 366 int fontsize = (size->height() - (2 * safe_y)) / 26; 365 font = LoadFont( gCoreContext->GetSetting("OSDCCFont"), fontsize);367 font = LoadFont(settings->GetSetting("OSDCCFont", ""), fontsize); 366 368 367 369 if (font) 368 370 fontMap[fontname] = font; … … 470 472 TTFFont *font = GetFont(fontname); 471 473 if (!font) 472 474 { 473 font = LoadFont(gCoreContext->GetSetting("OSDCCFont"), SUBTITLE_FONT_SIZE); 475 font = LoadFont(settings->GetSetting("OSDCCFont", ""), 476 SUBTITLE_FONT_SIZE); 474 477 475 478 if (font) 476 479 { … … 538 541 539 542 if (!actfont) 540 543 { 541 actfont = LoadFont( gCoreContext->GetSetting("OSDFont"), 16);544 actfont = LoadFont(settings->GetSetting("OSDFont", ""), 16); 542 545 543 546 if (actfont) 544 547 fontMap["treemenulistfont"] = actfont; … … 687 690 if (dir.exists()) 688 691 { 689 692 VERBOSE(VB_IMPORTANT, QString("Couldn't find OSD theme: %1. " 690 "Switching to default.").arg(gCoreContext->GetSetting("OSDTheme")));691 gCoreContext->OverrideSettingForSession("OSDTheme", "BlackCurves-OSD");693 "Switching to default.").arg(settings->GetSetting("OSDTheme", ""))); 694 settings->OverrideSetting/*ForSession*/("OSDTheme", "BlackCurves-OSD"); 692 695 return testdir; 693 696 } 694 697 … … 855 858 void OSD::parseFont(QDomElement &element) 856 859 { 857 860 QString name; 858 QString fontfile = gCoreContext->GetSetting("OSDFont");861 QString fontfile = settings->GetSetting("OSDFont", ""); 859 862 int size = -1; 860 863 int sizeSmall = -1; 861 864 int sizeBig = -1; … … 933 936 return; 934 937 } 935 938 936 QString fontSizeType = gCoreContext->GetSetting("OSDThemeFontSizeType",939 QString fontSizeType = settings->GetSetting("OSDThemeFontSizeType", 937 940 "default"); 938 941 if (fontSizeType == "small") 939 942 { … … 3114 3117 return QRect(xoffset, yoffset, displaywidth, displayheight); 3115 3118 } 3116 3119 3117 #define OSD_STRDUP(X) strdup( gCoreContext->GetSetting(X).toLocal8Bit().constData())3120 #define OSD_STRDUP(X) strdup(settings->GetSetting(X, "").toLocal8Bit().constData()) 3118 3121 3119 static void initialize_osd_fonts( void)3122 static void initialize_osd_fonts(PlaySettings *settings) 3120 3123 { 3121 3124 QMutexLocker locker(&cc708_init_lock); 3122 3125 if (cc708_defaults_initialized) 3123 3126 return; 3124 3127 cc708_defaults_initialized = true; 3125 3128 3126 QString default_font_type = gCoreContext->GetSetting(3129 QString default_font_type = settings->GetSetting( 3127 3130 "OSDCC708DefaultFontType", "MonoSerif"); 3128 3131 3129 3132 // 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, 15 void *codec_priv); 14 16 ~VideoOutputQuartz(); 15 17 16 18 bool Init(int width, int height, float aspect, WId winid, … … 51 53 static MythCodecID GetBestSupportedCodec( 52 54 uint width, uint height, 53 55 uint osd_width, uint osd_height, 54 uint stream_type, uint fourcc );56 uint stream_type, uint fourcc, PlaySettings *settings); 55 57 virtual bool NeedExtraAudioDecode(void) const 56 58 { return !codec_is_std(myth_codec_id); } 57 59 -
libs/libmythtv/videodisplayprofile.cpp
8 8 #include "mythverbose.h" 9 9 #include "videooutbase.h" 10 10 #include "avformatdecoder.h" 11 #include "playsettings.h" 11 12 12 13 bool ProfileItem::IsMatch(const QSize &size, float rate) const 13 14 { … … 212 213 pref_map_t VideoDisplayProfile::dec_name; 213 214 safe_list_t VideoDisplayProfile::safe_decoders; 214 215 215 VideoDisplayProfile::VideoDisplayProfile( )216 VideoDisplayProfile::VideoDisplayProfile(PlaySettings *settings) 216 217 : lock(QMutex::Recursive), last_size(0,0), last_rate(0.0f), 217 218 last_video_renderer(QString::null) 218 219 { … … 220 221 init_statics(); 221 222 222 223 QString hostname = gCoreContext->GetHostName(); 223 QString cur_profile = GetDefaultProfileName(hostname );224 QString cur_profile = GetDefaultProfileName(hostname, settings); 224 225 uint groupid = GetProfileGroupID(cur_profile, hostname); 225 226 226 227 item_list_t items = LoadDB(groupid); … … 772 773 return list; 773 774 } 774 775 775 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname) 776 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname, 777 PlaySettings *settings) 776 778 { 777 779 QString tmp = 780 settings ? settings->GetSetting("DefaultVideoPlaybackProfile", "") : 778 781 gCoreContext->GetSettingOnHost("DefaultVideoPlaybackProfile", hostname); 779 782 780 783 QStringList profiles = GetProfiles(hostname); -
libs/libmythtv/udpnotify.h
20 20 class QByteArray; 21 21 class QUdpSocket; 22 22 class QDomElement; 23 class PlaySettings; 23 24 24 25 class UDPNotifyOSDSet 25 26 { … … 54 55 Q_OBJECT 55 56 56 57 public: 57 UDPNotify(uint udp_port );58 UDPNotify(uint udp_port, PlaySettings *settings); 58 59 59 60 signals: 60 61 void AddUDPNotifyEvent(const QString &name, const UDPNotifyOSDSet*); -
libs/libmythtv/videoout_null.h
9 9 { 10 10 public: 11 11 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 12 VideoOutputNull( );12 VideoOutputNull(PlaySettings *settings); 13 13 ~VideoOutputNull(); 14 14 15 15 bool Init(int width, int height, float aspect, WId winid, -
libs/libmyth/settings.cpp
235 235 return -1; 236 236 } 237 237 238 QString SelectSetting::GetValueLabel(const QString &value) 239 { 240 selectionList::const_iterator iterValues = values.begin(); 241 selectionList::const_iterator iterLabels = labels.begin(); 242 for (; iterValues != values.end() && iterLabels != labels.end(); 243 ++iterValues, ++iterLabels) 244 { 245 if (*iterValues == value) 246 return *iterLabels; 247 } 248 249 return "???"; 250 } 251 238 252 bool SelectSetting::ReplaceLabel(const QString &new_label, const QString &value) 239 253 { 240 254 int i = getValueIndex(value); … … 299 313 QLabel *label = new QLabel(); 300 314 label->setText(getLabel() + ": "); 301 315 layout->addWidget(label); 316 labelWidget = label; 302 317 } 303 318 304 319 bxwidget = widget; … … 327 342 328 343 widget->setLayout(layout); 329 344 345 setValue(getValue()); 346 330 347 return widget; 331 348 } 332 349 … … 336 353 { 337 354 bxwidget = NULL; 338 355 edit = NULL; 356 labelWidget = NULL; 339 357 } 340 358 } 341 359 … … 373 391 Setting::setHelpText(str); 374 392 } 375 393 394 static void adjustFont(QWidget *widget, bool isDefault) 395 { 396 if (widget) 397 { 398 QFont f = widget->font(); 399 f.setWeight(isDefault ? QFont::Light : QFont::Bold); 400 widget->setFont(f); 401 } 402 } 403 404 void LineEditSetting::setValue(const QString &newValue) 405 { 406 if (adjustOnBlank) 407 { 408 adjustFont(labelWidget, newValue.isEmpty()); 409 adjustFont(edit, newValue.isEmpty()); 410 } 411 Setting::setValue(newValue); 412 } 413 376 414 void BoundedIntegerSetting::setValue(int newValue) 377 415 { 378 416 newValue = std::max(std::min(newValue, max), min); … … 439 477 440 478 SpinBoxSetting::SpinBoxSetting( 441 479 Storage *_storage, int _min, int _max, int _step, 442 bool _allow_single_step, QString _special_value_text) : 480 bool _allow_single_step, QString _special_value_text, 481 bool change_style_on_special) : 443 482 BoundedIntegerSetting(_storage, _min, _max, _step), 444 483 spinbox(NULL), relayEnabled(true), 445 sstep(_allow_single_step), svtext("") 484 sstep(_allow_single_step), svtext(""), labelWidget(NULL), 485 changeOnSpecial(change_style_on_special) 446 486 { 447 487 if (!_special_value_text.isEmpty()) 448 488 svtext = _special_value_text; … … 476 516 QLabel *label = new QLabel(); 477 517 label->setText(getLabel() + ": "); 478 518 layout->addWidget(label); 519 labelWidget = label; 479 520 } 480 521 481 522 bxwidget = widget; … … 506 547 507 548 widget->setLayout(layout); 508 549 550 setValue(intValue()); 551 509 552 return widget; 510 553 } 511 554 … … 515 558 { 516 559 bxwidget = NULL; 517 560 spinbox = NULL; 561 labelWidget = NULL; 518 562 } 519 563 } 520 564 521 565 void SpinBoxSetting::setValue(int newValue) 522 566 { 523 567 newValue = std::max(std::min(newValue, max), min); 568 if (changeOnSpecial) 569 { 570 adjustFont(labelWidget, (newValue == min)); 571 adjustFont(spinbox, (newValue == min)); 572 } 524 573 if (spinbox && (spinbox->value() != newValue)) 525 574 { 526 575 //int old = intValue(); … … 631 680 QLabel *label = new QLabel(); 632 681 label->setText(getLabel() + ": "); 633 682 layout->addWidget(label); 683 labelWidget = label; 634 684 } 635 685 636 686 bxwidget = widget; … … 659 709 cbwidget, SLOT(clear())); 660 710 661 711 if (rw) 712 { 662 713 connect(cbwidget, SIGNAL(editTextChanged(const QString &)), 663 714 this, SLOT(editTextChanged(const QString &))); 715 connect(cbwidget, SIGNAL(editTextChanged(const QString &)), 716 this, SLOT(changeLabel(const QString &))); 717 } 664 718 665 719 if (cg) 666 720 connect(cbwidget, SIGNAL(changeHelpText(QString)), cg, … … 673 727 674 728 widget->setLayout(layout); 675 729 730 setValue(current); 731 676 732 return widget; 677 733 } 678 734 … … 682 738 { 683 739 bxwidget = NULL; 684 740 cbwidget = NULL; 741 labelWidget = NULL; 685 742 } 686 743 } 687 744 … … 717 774 718 775 if (rw) 719 776 { 777 changeLabel(newValue); 720 778 Setting::setValue(newValue); 721 779 if (cbwidget) 722 780 cbwidget->setCurrentIndex(current); … … 727 785 { 728 786 if (cbwidget) 729 787 cbwidget->setCurrentIndex(which); 788 changeLabel(labels[which]); 730 789 SelectSetting::setValue(which); 731 790 } 732 791 733 void ComboBoxSetting::addSelection( 734 const QString &label, QString value, bool select) 792 void ComboBoxSetting::changeLabel(const QString &newLabel) 735 793 { 794 if (changeOnSpecial) 795 { 796 adjustFont(labelWidget, specialLabel == newLabel); 797 adjustFont(cbwidget, specialLabel == newLabel); 798 } 799 } 800 801 void ComboBoxSetting::addSelection(const QString &label, QString value, 802 bool select, bool special_formatting) 803 { 736 804 if ((findSelection(label, value) < 0) && cbwidget) 737 805 { 738 806 cbwidget->insertItem(label); 739 807 } 740 808 809 if (special_formatting) 810 { 811 changeOnSpecial = true; 812 specialLabel = label; 813 } 814 741 815 SelectSetting::addSelection(label, value, select); 742 816 743 817 if (cbwidget && isSet) … … 934 1008 BooleanSetting::setHelpText(str); 935 1009 } 936 1010 1011 QWidget* TristateCheckBoxSetting::configWidget(ConfigurationGroup *cg, 1012 QWidget* parent, 1013 const char* widgetName) { 1014 widget = new MythCheckBox(parent, widgetName, true); 1015 connect(widget, SIGNAL(destroyed(QObject*)), 1016 this, SLOT(widgetDeleted(QObject*))); 1017 1018 widget->setHelpText(getHelpText()); 1019 widget->setText(getLabel()); 1020 widget->setCheckState(tristateValue()); 1021 setValue(tristateValue()); 1022 1023 connect(widget, SIGNAL(stateChanged(int)), 1024 this, SLOT(setValue(int))); 1025 connect(this, SIGNAL(valueChanged(int)), 1026 this, SLOT(relayValueChanged(int))); 1027 1028 if (cg) 1029 connect(widget, SIGNAL(changeHelpText(QString)), cg, 1030 SIGNAL(changeHelpText(QString))); 1031 1032 return widget; 1033 } 1034 1035 void TristateCheckBoxSetting::widgetInvalid(QObject *obj) 1036 { 1037 widget = (widget == obj) ? NULL : widget; 1038 } 1039 1040 void TristateCheckBoxSetting::setEnabled(bool fEnabled) 1041 { 1042 TristateSetting::setEnabled(fEnabled); 1043 if (widget) 1044 widget->setEnabled(fEnabled); 1045 } 1046 1047 void TristateCheckBoxSetting::setHelpText(const QString &str) 1048 { 1049 if (widget) 1050 widget->setHelpText(str); 1051 TristateSetting::setHelpText(str); 1052 } 1053 1054 const char *TristateSetting::kPartiallyCheckedString = "default"; 1055 1056 void TristateCheckBoxSetting::setValue(int check) 1057 { 1058 adjustFont(widget, (check != Qt::Checked && check != Qt::Unchecked)); 1059 TristateSetting::setValue(check); 1060 emit valueChanged(check); 1061 } 1062 1063 void TristateSetting::setValue(int check) 1064 { 1065 if (check == Qt::Checked) 1066 Setting::setValue("1"); 1067 else if (check == Qt::Unchecked) 1068 Setting::setValue("0"); 1069 else 1070 Setting::setValue(kPartiallyCheckedString); 1071 emit valueChanged(check); 1072 } 1073 937 1074 void AutoIncrementDBSetting::Save(QString table) 938 1075 { 939 1076 if (intValue() == 0) … … 1121 1258 addSelection(label, value, select); 1122 1259 } 1123 1260 1261 void ImageSelectSetting::addDefaultSelection(const QString label, 1262 const QString value, 1263 const QString defaultValue, 1264 bool select) 1265 { 1266 for (unsigned i=0; i<values.size(); i++) 1267 { 1268 if (values[i] == defaultValue) 1269 { 1270 changeOnSpecial = true; 1271 specialLabel = label; 1272 images.push_back(new QImage(*images[i])); 1273 addSelection(label, value, select); 1274 return; 1275 } 1276 } 1277 } 1278 1124 1279 ImageSelectSetting::~ImageSelectSetting() 1125 1280 { 1126 1281 Teardown(); … … 1143 1298 bxwidget = NULL; 1144 1299 imagelabel = NULL; 1145 1300 combo = NULL; 1301 labelWidget = NULL; 1146 1302 } 1147 1303 1148 1304 void ImageSelectSetting::imageSet(int num) … … 1190 1346 QLabel *label = new QLabel(); 1191 1347 label->setText(getLabel() + ":"); 1192 1348 layout->addWidget(label); 1349 labelWidget = label; 1193 1350 } 1194 1351 1195 1352 combo = new MythComboBox(false); … … 1236 1393 connect(combo, SIGNAL(highlighted(int)), this, SLOT(imageSet(int))); 1237 1394 connect(combo, SIGNAL(activated(int)), this, SLOT(setValue(int))); 1238 1395 connect(combo, SIGNAL(activated(int)), this, SLOT(imageSet(int))); 1396 connect(combo, SIGNAL(highlighted(const QString &)), 1397 this, SLOT(changeLabel(const QString &))); 1398 connect(combo, SIGNAL(activated(const QString &)), 1399 this, SLOT(changeLabel(const QString &))); 1239 1400 1240 1401 connect(this, SIGNAL(selectionsCleared()), 1241 1402 combo, SLOT(clear())); … … 1246 1407 1247 1408 bxwidget->setLayout(layout); 1248 1409 1410 changeLabel(GetLabel(current)); 1411 1249 1412 return bxwidget; 1250 1413 } 1251 1414 1415 void ImageSelectSetting::changeLabel(const QString &newLabel) 1416 { 1417 if (changeOnSpecial) 1418 { 1419 adjustFont(labelWidget, specialLabel == newLabel); 1420 adjustFont(combo, specialLabel == newLabel); 1421 } 1422 } 1423 1252 1424 void ImageSelectSetting::widgetInvalid(QObject *obj) 1253 1425 { 1254 1426 if (bxwidget == obj) -
libs/libmyth/mythwidgets.cpp
224 224 else if (action == "DOWN") 225 225 focusNextPrevChild(true); 226 226 else if (action == "LEFT" || action == "RIGHT" || action == "SELECT") 227 toggle(); 227 { 228 if (isTristate()) 229 { 230 Qt::CheckState newState = 231 (Qt::CheckState)(((int)checkState() + 1) % 3); 232 setCheckState(newState); 233 } 234 else 235 toggle(); 236 } 228 237 else 229 238 handled = false; 230 239 } -
libs/libmyth/settings.h
134 134 135 135 class MPUBLIC LineEditSetting : public Setting 136 136 { 137 Q_OBJECT 138 137 139 protected: 138 LineEditSetting(Storage *_storage, bool readwrite = true) : 140 LineEditSetting(Storage *_storage, bool readwrite = true, 141 bool adjust_on_blank = false) : 139 142 Setting(_storage), bxwidget(NULL), edit(NULL), 140 rw(readwrite), password_echo(false) { } 143 rw(readwrite), password_echo(false), 144 adjustOnBlank(adjust_on_blank), labelWidget(NULL) { } 141 145 142 146 public: 143 147 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, … … 159 163 160 164 virtual void setHelpText(const QString &str); 161 165 166 public slots: 167 virtual void setValue(const QString &newValue); 168 162 169 private: 163 170 QWidget *bxwidget; 164 171 MythLineEdit *edit; 165 172 bool rw; 166 173 bool password_echo; 174 bool adjustOnBlank; 175 QWidget *labelWidget; 167 176 }; 168 177 169 178 // TODO: set things up so that setting the value as a string emits … … 219 228 public: 220 229 SpinBoxSetting(Storage *_storage, int min, int max, int step, 221 230 bool allow_single_step = false, 222 QString special_value_text = ""); 231 QString special_value_text = "", 232 bool change_style_on_special = false); 223 233 224 234 virtual QWidget *configWidget(ConfigurationGroup *cg, QWidget *parent, 225 235 const char *widgetName = 0); … … 248 258 bool relayEnabled; 249 259 bool sstep; 250 260 QString svtext; 261 QLabel *labelWidget; 262 bool changeOnSpecial; 251 263 }; 252 264 253 265 class MPUBLIC SelectSetting : public Setting … … 277 289 { return (i < labels.size()) ? labels[i] : QString::null; } 278 290 virtual QString GetValue(uint i) const 279 291 { return (i < values.size()) ? values[i] : QString::null; } 292 virtual QString GetValueLabel(const QString &value); 280 293 281 294 signals: 282 295 void selectionAdded(const QString& label, QString value); … … 318 331 protected: 319 332 ComboBoxSetting(Storage *_storage, bool _rw = false, int _step = 1) : 320 333 SelectSetting(_storage), rw(_rw), 321 bxwidget(NULL), cbwidget(NULL), step(_step) { } 334 bxwidget(NULL), cbwidget(NULL), changeOnSpecial(false), 335 specialLabel(""), labelWidget(NULL), step(_step) { } 322 336 323 337 public: 324 338 virtual void setValue(QString newValue); … … 338 352 public slots: 339 353 void addSelection(const QString &label, 340 354 QString value = QString::null, 341 bool select = false); 355 bool select = false, 356 bool special_formatting = false); 342 357 bool removeSelection(const QString &label, 343 358 QString value = QString::null); 359 virtual void changeLabel(const QString &newValue); 344 360 void editTextChanged(const QString &newText); 345 361 346 362 private: 347 363 bool rw; 348 364 QWidget *bxwidget; 349 365 MythComboBox *cbwidget; 366 bool changeOnSpecial; 367 QString specialLabel; 368 QLabel *labelWidget; 350 369 351 370 protected: 352 371 int step; … … 415 434 ImageSelectSetting(Storage *_storage) : 416 435 SelectSetting(_storage), 417 436 bxwidget(NULL), imagelabel(NULL), combo(NULL), 418 m_hmult(1.0f), m_wmult(1.0f) { } 437 m_hmult(1.0f), m_wmult(1.0f), 438 changeOnSpecial(false), specialLabel(""), labelWidget(NULL) { } 419 439 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 420 440 const char* widgetName = 0); 421 441 virtual void widgetInvalid(QObject *obj); … … 426 446 QImage* image, 427 447 QString value=QString::null, 428 448 bool select=false); 449 virtual void addDefaultSelection(const QString label, 450 const QString value, 451 const QString defaultValue, 452 bool select); 429 453 430 454 protected slots: 431 455 void imageSet(int); 456 void changeLabel(const QString &newLabel); 432 457 433 458 protected: 434 459 void Teardown(void); … … 440 465 QLabel *imagelabel; 441 466 MythComboBox *combo; 442 467 float m_hmult, m_wmult; 468 bool changeOnSpecial; 469 QString specialLabel; 470 QLabel *labelWidget; 443 471 }; 444 472 445 473 class MPUBLIC BooleanSetting : public Setting … … 480 508 MythCheckBox *widget; 481 509 }; 482 510 511 class MPUBLIC TristateSetting : public BooleanSetting 512 { 513 Q_OBJECT 514 515 public: 516 TristateSetting(Storage *_storage) : BooleanSetting(_storage) {} 517 518 Qt::CheckState tristateValue(void) const { 519 if (getValue() == "0") 520 return Qt::Unchecked; 521 if (getValue() == "1") 522 return Qt::Checked; 523 return Qt::PartiallyChecked; 524 } 525 526 static const char *kPartiallyCheckedString; 527 528 public slots: 529 virtual void setValue(/*Qt::CheckState*/int check); 530 531 signals: 532 void valueChanged(int); 533 }; 534 535 class MPUBLIC TristateCheckBoxSetting: public TristateSetting { 536 Q_OBJECT 537 538 public: 539 TristateCheckBoxSetting(Storage *_storage) : 540 TristateSetting(_storage), widget(NULL) { } 541 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 542 const char* widgetName = 0); 543 virtual void widgetInvalid(QObject*); 544 545 virtual void setEnabled(bool b); 546 547 virtual void setHelpText(const QString &str); 548 549 550 public slots: 551 virtual void setValue(/*Qt::CheckState*/int check); 552 virtual void relayValueChanged(int state) { 553 if (widget) 554 widget->setCheckState((Qt::CheckState)state); 555 } 556 557 protected: 558 MythCheckBox *widget; 559 }; 560 483 561 class MPUBLIC PathSetting : public ComboBoxSetting 484 562 { 485 563 public: -
libs/libmyth/libmyth.pro
62 62 SOURCES += mythrssmanager.cpp netgrabbermanager.cpp 63 63 SOURCES += rssparse.cpp netutils.cpp 64 64 65 HEADERS += playsettings.h 66 SOURCES += playsettings.cpp 67 65 68 # remove when everything is switched to mythui 66 69 SOURCES += virtualkeyboard_qt.cpp 67 70 -
libs/libmyth/mythconfiggroups.cpp
475 475 Configurable *target) 476 476 { 477 477 VerifyLayout(); 478 bool isDuplicate = triggerMap.values().contains(target); 478 479 triggerMap[triggerValue] = target; 479 480 480 481 if (!configStack) … … 484 485 configStack->setSaveAll(isSaveAll); 485 486 } 486 487 487 configStack->addChild(target); 488 // Don't add a target as a child if it has already been added, 489 // otherwise something goes wrong with signals in the child. 490 if (!isDuplicate) 491 configStack->addChild(target); 488 492 } 489 493 490 494 Setting *TriggeredConfigurationGroup::byName(const QString &settingName) -
libs/libmyth/mythwidgets.h
329 329 Q_OBJECT 330 330 331 331 public: 332 MythCheckBox(QWidget *parent = 0, const char *name = "MythCheckBox") 333 : QCheckBox(parent) { setObjectName(name); }; 332 MythCheckBox(QWidget *parent = 0, const char *name = "MythCheckBox", 333 bool isTristate = false) : QCheckBox(parent) 334 { 335 setObjectName(name); 336 setTristate(isTristate); 337 } 334 338 MythCheckBox(const QString &text, 335 QWidget *parent = 0, const char *name = "MythCheckBox") 336 : QCheckBox(text, parent) { setObjectName(name); }; 339 QWidget *parent = 0, const char *name = "MythCheckBox", 340 bool isTristate = false) : QCheckBox(text, parent) 341 { 342 setObjectName(name); 343 setTristate(isTristate); 344 } 337 345 338 346 void setHelpText(const QString&); 339 347 -
programs/mythfrontend/globalsettings.cpp
41 41 #include "mythconfig.h" 42 42 #include "mythdirs.h" 43 43 #include "mythuihelper.h" 44 #include "playsettings.h" 44 45 46 #define CREATE_CHECKBOX_SETTING(var, name, settings) \ 47 BooleanSetting *var; \ 48 if ((settings)) \ 49 var = new PlaySettingsCheckBox((name), (settings)); \ 50 else \ 51 var = new HostCheckBox((name)) 52 53 #define CREATE_COMBOBOX_SETTING(var, name, settings) \ 54 ComboBoxSetting *var; \ 55 if ((settings)) \ 56 var = new PlaySettingsComboBox((name), (settings)); \ 57 else \ 58 var = new HostComboBox((name)) 59 60 #define CREATE_COMBOBOX1_SETTING(var, name, settings, arg1) \ 61 ComboBoxSetting *var; \ 62 if ((settings)) \ 63 var = new PlaySettingsComboBox((name), (settings), (arg1)); \ 64 else \ 65 var = new HostComboBox((name), (arg1)) 66 67 #define CREATE_SPINBOX_SETTING(var, name, settings, arg1, arg2, arg3, arg4) \ 68 SpinBoxSetting *var; \ 69 if ((settings)) \ 70 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3), (arg4)); \ 71 else \ 72 var = new HostSpinBox((name), (arg1), (arg2), (arg3), (arg4)) 73 74 #define CREATE_LINEEDIT_SETTING(var, name, settings) \ 75 LineEditSetting *var; \ 76 if ((settings)) \ 77 var = new PlaySettingsLineEdit((name), (settings), ""); \ 78 else \ 79 var = new HostLineEdit((name)) 80 81 // For PlaySettings, use a SpinBox instead of a Slider so that a 82 // default value can be easily used. 83 #define CREATE_SLIDER_SETTING(var, name, settings, arg1, arg2, arg3) \ 84 BoundedIntegerSetting *var; \ 85 if ((settings)) \ 86 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3)); \ 87 else \ 88 var = new HostSlider((name), (arg1), (arg2), (arg3)) 89 90 #define CREATE_IMAGESELECT_SETTING(var, name, settings) \ 91 ImageSelectSetting *var; \ 92 if ((settings)) \ 93 var = new PlaySettingsImageSelect((name), (settings)); \ 94 else \ 95 var = new HostImageSelect((name)) 96 97 static Setting *wrap(Setting *obj, PlaySettings *settings, 98 bool twoLineLabel=false) 99 { 100 if (!settings) 101 return obj; 102 103 // Get the setting name 104 PlaySettingsCombinedStorage *storage = 105 dynamic_cast<PlaySettingsCombinedStorage *>(obj); 106 const QString &name = storage->getName(); 107 108 // Get the default value and label. The label is different 109 // from the value for most object types. 110 QString defaultValue = settings->GetSetting(name, "", true); 111 QString defaultLabel(defaultValue); 112 if (dynamic_cast<BooleanSetting *>(obj)) 113 defaultLabel = (defaultValue == "0" || defaultValue.isEmpty() ? 114 QObject::tr("disabled") : QObject::tr("enabled")); 115 if (dynamic_cast<SpinBoxSetting *>(obj) && defaultValue.isEmpty()) 116 defaultLabel = "0"; 117 ComboBoxSetting *cb = dynamic_cast<ComboBoxSetting *>(obj); 118 if (cb) 119 { 120 defaultLabel = cb->GetValueLabel(defaultValue); 121 // Add the default selection to a ComboBox 122 cb->addSelection(QString("(") + QObject::tr("default") + ")", 123 storage->getDefault(), 124 !settings->IsOverridden(name), 125 true); 126 } 127 ImageSelectSetting *is = dynamic_cast<ImageSelectSetting *>(obj); 128 if (is) 129 { 130 defaultLabel = is->GetValueLabel(defaultValue); 131 // Add the default selection to a ImageSelect 132 is->addDefaultSelection(QString("(") + QObject::tr("default") + ")", 133 storage->getDefault(), 134 defaultValue, 135 !settings->IsOverridden(name)); 136 } 137 138 // Change the help text to include the default and its source. 139 QString helpPrefix; 140 if (dynamic_cast<LineEditSetting *>(obj)) 141 helpPrefix = QObject::tr("Leave blank to keep default value"); 142 else 143 helpPrefix = QObject::tr("Override default value"); 144 helpPrefix += " (" + defaultLabel + ") "; 145 QString inheritsFrom = settings->InheritsFrom(name); 146 if (inheritsFrom.isNull()) 147 helpPrefix += QObject::tr("from global settings"); 148 else 149 helpPrefix += QObject::tr("from group") + " " + inheritsFrom; 150 helpPrefix += ". " + obj->getHelpText(); 151 obj->setHelpText(helpPrefix); 152 153 // Change the label to include the default. 154 obj->setLabel(obj->getLabel() + (twoLineLabel ? "\n" : "") + 155 " (" + defaultLabel + ")"); 156 157 return obj; 158 } 159 45 160 AudioOutputDevice::AudioOutputDevice() : HostComboBox("AudioOutputDevice", true) 46 161 { 47 162 setLabel(QObject::tr("Audio output device")); … … 320 435 return gc; 321 436 } 322 437 323 static HostCheckBox *DecodeExtraAudio()438 static Setting *DecodeExtraAudio(PlaySettings *settings) 324 439 { 325 HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");440 CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings); 326 441 gc->setLabel(QObject::tr("Extra audio buffering")); 327 442 gc->setValue(true); 328 443 gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing " … … 331 446 "effect on framegrabbers (MPEG-4/RTJPEG). MythTV will " 332 447 "keep extra audio data in its internal buffers to workaround " 333 448 "this bug.")); 334 return gc;449 return wrap(gc, settings); 335 450 } 336 451 337 static HostComboBox *PIPLocationComboBox()452 static Setting *PIPLocationComboBox(PlaySettings *settings) 338 453 { 339 HostComboBox *gc = new HostComboBox("PIPLocation");454 CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings); 340 455 gc->setLabel(QObject::tr("PIP Video Location")); 341 456 for (uint loc = 0; loc < kPIP_END; ++loc) 342 457 gc->addSelection(toString((PIPLocation) loc), QString::number(loc)); 343 458 gc->setHelpText(QObject::tr("Location of PIP Video window.")); 344 return gc;459 return wrap(gc, settings); 345 460 } 346 461 347 462 static GlobalLineEdit *AllRecGroupPassword() … … 438 553 return gc; 439 554 } 440 555 441 static HostCheckBox *SmartForward()556 static Setting *SmartForward(PlaySettings *settings) 442 557 { 443 HostCheckBox *gc = new HostCheckBox("SmartForward");558 CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings); 444 559 gc->setLabel(QObject::tr("Smart Fast Forwarding")); 445 560 gc->setValue(false); 446 561 gc->setHelpText(QObject::tr("If enabled, then immediately after " 447 562 "rewinding, only skip forward the same amount as " 448 563 "skipping backwards.")); 449 return gc;564 return wrap(gc, settings); 450 565 } 451 566 452 static HostCheckBox *ExactSeeking()567 static Setting *ExactSeeking(PlaySettings *settings) 453 568 { 454 HostCheckBox *gc = new HostCheckBox("ExactSeeking");569 CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings); 455 570 gc->setLabel(QObject::tr("Seek to exact frame")); 456 571 gc->setValue(false); 457 572 gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but " 458 573 "slower.")); 459 return gc;574 return wrap(gc, settings); 460 575 } 461 576 462 577 static GlobalComboBox *CommercialSkipMethod() … … 474 589 return bc; 475 590 } 476 591 477 static HostComboBox *AutoCommercialSkip()592 static Setting *AutoCommercialSkip(PlaySettings *settings) 478 593 { 479 HostComboBox *gc = new HostComboBox("AutoCommercialSkip");594 CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings); 480 595 gc->setLabel(QObject::tr("Automatically Skip Commercials")); 481 596 gc->addSelection(QObject::tr("Off"), "0"); 482 597 gc->addSelection(QObject::tr("Notify, but do not skip"), "2"); … … 485 600 "have been flagged during Automatic Commercial Detection " 486 601 "or by the mythcommflag program, or just notify that a " 487 602 "commercial has been detected.")); 488 return gc;603 return wrap(gc, settings); 489 604 } 490 605 491 606 static GlobalCheckBox *AutoCommercialFlag() … … 570 685 return bc; 571 686 } 572 687 573 static HostSpinBox *CommRewindAmount()688 static Setting *CommRewindAmount(PlaySettings *settings) 574 689 { 575 HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);690 CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false); 576 691 gs->setLabel(QObject::tr("Commercial Skip Auto-Rewind Amount")); 577 692 gs->setHelpText(QObject::tr("If set, MythTV will automatically rewind " 578 693 "this many seconds after performing a commercial skip.")); 579 694 gs->setValue(0); 580 return gs;695 return wrap(gs, settings); 581 696 } 582 697 583 static HostSpinBox *CommNotifyAmount()698 static Setting *CommNotifyAmount(PlaySettings *settings) 584 699 { 585 HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);700 CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false); 586 701 gs->setLabel(QObject::tr("Commercial Skip Notify Amount")); 587 702 gs->setHelpText(QObject::tr("If set, MythTV will act like a commercial " 588 703 "begins this many seconds early. This can be useful " 589 704 "when commercial notification is used in place of " 590 705 "automatic skipping.")); 591 706 gs->setValue(0); 592 return gs;707 return wrap(gs, settings); 593 708 } 594 709 595 710 static GlobalSpinBox *MaximumCommercialSkip() … … 1391 1506 labels[j]->setValue(label_i); 1392 1507 } 1393 1508 1394 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) : 1509 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str, 1510 PlaySettings *settings) : 1395 1511 TriggeredConfigurationGroup(false, true, true, true, 1396 1512 false, false, true, true), grouptrigger(NULL) 1397 1513 { 1398 1514 setLabel(QObject::tr("Playback Profiles") + str); 1515 if (settings) 1516 setLabel(QObject::tr("Playback group settings for ") + 1517 settings->mGroupName + " - " + 1518 getLabel()); 1399 1519 1400 1520 QString host = gCoreContext->GetHostName(); 1401 1521 QStringList profiles = VideoDisplayProfile::GetProfiles(host); … … 1423 1543 profiles = VideoDisplayProfile::GetProfiles(host); 1424 1544 } 1425 1545 1426 QString profile = VideoDisplayProfile::GetDefaultProfileName(host );1546 QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings); 1427 1547 if (!profiles.contains(profile)) 1428 1548 { 1429 1549 profile = (profiles.contains("Normal")) ? "Normal" : profiles[0]; 1430 1550 VideoDisplayProfile::SetDefaultProfileName(profile, host); 1431 1551 } 1432 1552 1433 grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile"); 1553 CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings); 1554 grouptrigger = gs; 1434 1555 grouptrigger->setLabel(QObject::tr("Current Video Playback Profile")); 1435 1556 QStringList::const_iterator it; 1436 1557 for (it = profiles.begin(); it != profiles.end(); ++it) 1437 1558 grouptrigger->addSelection(ProgramInfo::i18n(*it), *it); 1559 if (settings) 1560 { 1561 addChild(wrap(grouptrigger, settings)); 1562 return; 1563 } 1438 1564 1439 1565 HorizontalConfigurationGroup *grp = 1440 1566 new HorizontalConfigurationGroup(false, false, true, true); … … 1567 1693 return gc; 1568 1694 } 1569 1695 1570 static HostSpinBox *FFRewReposTime()1696 static Setting *FFRewReposTime(PlaySettings *settings) 1571 1697 { 1572 HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);1698 CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false); 1573 1699 gs->setLabel(QObject::tr("Fast forward/rewind reposition amount")); 1574 1700 gs->setValue(100); 1575 1701 gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind " … … 1577 1703 "resuming normal playback. This " 1578 1704 "compensates for the reaction time between seeing " 1579 1705 "where to resume playback and actually exiting seeking.")); 1580 return gs;1706 return wrap(gs, settings); 1581 1707 } 1582 1708 1583 static HostCheckBox *FFRewReverse()1709 static Setting *FFRewReverse(PlaySettings *settings) 1584 1710 { 1585 HostCheckBox *gc = new HostCheckBox("FFRewReverse");1711 CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings); 1586 1712 gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind")); 1587 1713 gc->setValue(true); 1588 1714 gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key " … … 1590 1716 "vice versa. If disabled, it will decrease the " 1591 1717 "current speed or switch to play mode if " 1592 1718 "the speed can't be decreased further.")); 1593 return gc;1719 return wrap(gc, settings); 1594 1720 } 1595 1721 1596 static HostSpinBox *OSDGeneralTimeout()1722 static Setting *OSDGeneralTimeout(PlaySettings *settings) 1597 1723 { 1598 HostSpinBox *gs = new HostSpinBox("OSDGeneralTimeout", 1, 30, 1);1724 CREATE_SPINBOX_SETTING(gs, "OSDGeneralTimeout", settings, 1, 30, 1, false); 1599 1725 gs->setLabel(QObject::tr("General OSD time-out (sec)")); 1600 1726 gs->setValue(2); 1601 1727 gs->setHelpText(QObject::tr("Length of time an on-screen display " 1602 1728 "window will be visible.")); 1603 return gs;1729 return wrap(gs, settings); 1604 1730 } 1605 1731 1606 static HostSpinBox *OSDProgramInfoTimeout()1732 static Setting *OSDProgramInfoTimeout(PlaySettings *settings) 1607 1733 { 1608 HostSpinBox *gs = new HostSpinBox("OSDProgramInfoTimeout", 1, 30, 1); 1734 CREATE_SPINBOX_SETTING(gs, "OSDProgramInfoTimeout", settings, 1735 1, 30, 1, false); 1609 1736 gs->setLabel(QObject::tr("Program Info OSD time-out")); 1610 1737 gs->setValue(3); 1611 1738 gs->setHelpText(QObject::tr("Length of time the on-screen display " 1612 1739 "will display program information.")); 1613 return gs;1740 return wrap(gs, settings); 1614 1741 } 1615 1742 1616 static HostSpinBox *OSDNotifyTimeout()1743 static Setting *OSDNotifyTimeout(PlaySettings *settings) 1617 1744 { 1618 HostSpinBox *gs = new HostSpinBox("OSDNotifyTimeout", 1, 30, 1);1745 CREATE_SPINBOX_SETTING(gs, "OSDNotifyTimeout", settings, 1, 30, 1, false); 1619 1746 gs->setLabel(QObject::tr("UDP Notify OSD time-out")); 1620 1747 gs->setValue(5); 1621 1748 gs->setHelpText(QObject::tr("How many seconds an on-screen display " 1622 1749 "will be active for UDP Notify events.")); 1623 return gs;1750 return wrap(gs, settings); 1624 1751 } 1625 1752 1626 1753 static HostSpinBox *ThemeCacheSize() … … 1664 1791 return gc; 1665 1792 } 1666 1793 1667 static HostComboBox *OSDFont()1794 static Setting *OSDFont(PlaySettings *settings) 1668 1795 { 1669 HostComboBox *gc = new HostComboBox("OSDFont");1796 CREATE_COMBOBOX_SETTING(gc, "OSDFont", settings); 1670 1797 gc->setLabel(QObject::tr("OSD font")); 1671 1798 QDir ttf(GetFontsDir(), GetFontsNameFilter()); 1672 1799 gc->fillSelectionsFromDir(ttf, false); … … 1674 1801 if (gc->findSelection(defaultOSDFont) > -1) 1675 1802 gc->setValue(defaultOSDFont); 1676 1803 1677 return gc;1804 return wrap(gc, settings); 1678 1805 } 1679 1806 1680 static HostComboBox *OSDCCFont()1807 static Setting *OSDCCFont(PlaySettings *settings) 1681 1808 { 1682 HostComboBox *gc = new HostComboBox("OSDCCFont");1809 CREATE_COMBOBOX_SETTING(gc, "OSDCCFont", settings); 1683 1810 gc->setLabel(QObject::tr("CC font")); 1684 1811 QDir ttf(GetFontsDir(), GetFontsNameFilter()); 1685 1812 gc->fillSelectionsFromDir(ttf, false); 1686 1813 gc->setHelpText(QObject::tr("Closed Caption font")); 1687 1814 1688 return gc;1815 return wrap(gc, settings); 1689 1816 } 1690 1817 1691 1818 static HostComboBox __attribute__ ((unused)) *DecodeVBIFormat() … … 1706 1833 return gc; 1707 1834 } 1708 1835 1709 static HostSpinBox *OSDCC708TextZoomPercentage(void)1836 static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings) 1710 1837 { 1711 HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5); 1838 CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings, 1839 50, 200, 5, false); 1712 1840 gs->setLabel(QObject::tr("Text zoom percentage")); 1713 1841 gs->setValue(100); 1714 1842 gs->setHelpText(QObject::tr("Use this to enlarge or shrink captions.")); 1715 1843 1716 return gs;1844 return wrap(gs, settings); 1717 1845 } 1718 1846 1719 static HostComboBox *OSDCC708DefaultFontType(void)1847 static Setting *OSDCC708DefaultFontType(PlaySettings *settings) 1720 1848 { 1721 HostComboBox *hc = new HostComboBox("OSDCC708DefaultFontType");1849 CREATE_COMBOBOX_SETTING(hc, "OSDCC708DefaultFontType", settings); 1722 1850 hc->setLabel(QObject::tr("Default Caption Font Type")); 1723 1851 hc->setHelpText( 1724 1852 QObject::tr("This allows you to set which font type to use " … … 1741 1869 }; 1742 1870 for (uint i = 0; i < 7; ++i) 1743 1871 hc->addSelection(typeNames[i], types[i]); 1744 return hc;1872 return wrap(hc, settings); 1745 1873 } 1746 1874 1747 static VerticalConfigurationGroup *OSDCC708Settings( void)1875 static VerticalConfigurationGroup *OSDCC708Settings(PlaySettings *settings) 1748 1876 { 1749 1877 VerticalConfigurationGroup *grp = 1750 1878 new VerticalConfigurationGroup(false, true, true, true); 1751 1879 grp->setLabel(QObject::tr("ATSC Caption Settings")); 1880 if (settings) 1881 grp->setLabel(QObject::tr("Playback group settings for ") + 1882 settings->mGroupName + " - " + 1883 grp->getLabel()); 1752 1884 1753 1885 // default text zoom 1.0 1754 grp->addChild(OSDCC708TextZoomPercentage( ));1886 grp->addChild(OSDCC708TextZoomPercentage(settings)); 1755 1887 1756 1888 // force X lines of captions 1757 1889 // force caption character color … … 1760 1892 // force background opacity 1761 1893 1762 1894 // set default font type 1763 grp->addChild(OSDCC708DefaultFontType( ));1895 grp->addChild(OSDCC708DefaultFontType(settings)); 1764 1896 1765 1897 return grp; 1766 1898 } 1767 1899 1768 static HostComboBox*OSDCC708Font(1900 static Setting *OSDCC708Font( 1769 1901 const QString &subtype, const QString &subtypeName, 1770 const QString &subtypeNameForHelp )1902 const QString &subtypeNameForHelp, PlaySettings *settings) 1771 1903 { 1772 HostComboBox *gc = new HostComboBox(1773 QString("OSDCC708%1Font").arg(subtype));1904 CREATE_COMBOBOX_SETTING(gc, QString("OSDCC708%1Font").arg(subtype), 1905 settings); 1774 1906 1775 1907 gc->setLabel(subtypeName); 1776 1908 QDir ttf(GetFontsDir(), GetFontsNameFilter()); … … 1778 1910 gc->setHelpText( 1779 1911 QObject::tr("ATSC %1 closed caption font.").arg(subtypeNameForHelp)); 1780 1912 1781 return gc;1913 return wrap(gc, settings, (subtypeName.length() > 10)); 1782 1914 } 1783 1915 1784 static HorizontalConfigurationGroup *OSDCC708Fonts( void)1916 static HorizontalConfigurationGroup *OSDCC708Fonts(PlaySettings *settings) 1785 1917 { 1786 1918 HorizontalConfigurationGroup *grpmain = 1787 1919 new HorizontalConfigurationGroup(false, true, true, true); 1788 1920 grpmain->setLabel(QObject::tr("ATSC Caption Fonts")); 1921 if (settings) 1922 grpmain->setLabel(QObject::tr("Playback group settings for ") + 1923 settings->mGroupName + " - " + 1924 grpmain->getLabel()); 1789 1925 VerticalConfigurationGroup *col[] = 1790 1926 { 1791 1927 new VerticalConfigurationGroup(false, false, true, true), … … 1821 1957 for (uint j = 0; j < 7; ++j) 1822 1958 { 1823 1959 col[i]->addChild(OSDCC708Font(subtypes[i].arg(types[j]), 1824 typeNames[j], typeNames[j])); 1960 typeNames[j], typeNames[j], 1961 settings)); 1825 1962 } 1826 1963 grpmain->addChild(col[i]); 1827 1964 1828 1965 i = 1; 1829 1966 for (uint j = 0; j < 7; ++j) 1830 1967 { 1831 col[i]->addChild(OSDCC708Font( 1832 subtypes[i].arg(types[j]), "", 1833 QObject::tr("Italic") + ' ' + typeNames[j])); 1968 col[i]->addChild(OSDCC708Font(subtypes[i].arg(types[j]), 1969 (settings ? typeNames[j] : ""), 1970 QObject::tr("Italic") + ' ' + typeNames[j], 1971 settings)); 1834 1972 } 1835 1973 1836 1974 grpmain->addChild(col[i]); … … 1838 1976 return grpmain; 1839 1977 } 1840 1978 1841 static HostComboBox *SubtitleCodec()1979 static Setting *SubtitleCodec(PlaySettings *settings) 1842 1980 { 1843 HostComboBox *gc = new HostComboBox("SubtitleCodec");1981 CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings); 1844 1982 1845 1983 gc->setLabel(QObject::tr("Subtitle Codec")); 1846 1984 QList<QByteArray> list = QTextCodec::availableCodecs(); … … 1850 1988 gc->addSelection(val, val, val.toLower() == "utf-8"); 1851 1989 } 1852 1990 1853 return gc;1991 return wrap(gc, settings); 1854 1992 } 1855 1993 1856 static HorizontalConfigurationGroup *ExternalSubtitleSettings( )1994 static HorizontalConfigurationGroup *ExternalSubtitleSettings(PlaySettings *settings) 1857 1995 { 1858 1996 HorizontalConfigurationGroup *grpmain = 1859 1997 new HorizontalConfigurationGroup(false, true, true, true); 1860 1998 1861 1999 grpmain->setLabel(QObject::tr("External Subtitle Settings")); 1862 2000 1863 grpmain->addChild(SubtitleCodec( ));2001 grpmain->addChild(SubtitleCodec(settings)); 1864 2002 1865 2003 return grpmain; 1866 2004 } 1867 2005 1868 static HostComboBox *OSDThemeFontSizeType()2006 static Setting *OSDThemeFontSizeType(PlaySettings *settings) 1869 2007 { 1870 HostComboBox *gc = new HostComboBox("OSDThemeFontSizeType");2008 CREATE_COMBOBOX_SETTING(gc, "OSDThemeFontSizeType", settings); 1871 2009 gc->setLabel(QObject::tr("Font size")); 1872 2010 gc->addSelection(QObject::tr("default"), "default"); 1873 2011 gc->addSelection(QObject::tr("small"), "small"); 1874 2012 gc->addSelection(QObject::tr("big"), "big"); 1875 2013 gc->setHelpText(QObject::tr("default: TV, small: monitor, big:")); 1876 return gc;2014 return wrap(gc, settings); 1877 2015 } 1878 2016 1879 2017 static HostComboBox *ChannelOrdering() … … 1885 2023 return gc; 1886 2024 } 1887 2025 1888 static HostSpinBox *VertScanPercentage()2026 static Setting *VertScanPercentage(PlaySettings *settings) 1889 2027 { 1890 HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1); 2028 CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings, 2029 -100, 100, 1, false); 1891 2030 gs->setLabel(QObject::tr("Vertical scaling")); 1892 2031 gs->setValue(0); 1893 2032 gs->setHelpText(QObject::tr( 1894 2033 "Adjust this if the image does not fill your " 1895 2034 "screen vertically. Range -100% to 100%")); 1896 return gs;2035 return wrap(gs, settings); 1897 2036 } 1898 2037 1899 static HostSpinBox *HorizScanPercentage()2038 static Setting *HorizScanPercentage(PlaySettings *settings) 1900 2039 { 1901 HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1); 2040 CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings, 2041 -100, 100, 1, false); 1902 2042 gs->setLabel(QObject::tr("Horizontal scaling")); 1903 2043 gs->setValue(0); 1904 2044 gs->setHelpText(QObject::tr( 1905 2045 "Adjust this if the image does not fill your " 1906 2046 "screen horizontally. Range -100% to 100%")); 1907 return gs;2047 return wrap(gs, settings); 1908 2048 }; 1909 2049 1910 static HostSpinBox *XScanDisplacement()2050 static Setting *XScanDisplacement(PlaySettings *settings) 1911 2051 { 1912 HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1); 2052 CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings, 2053 -50, 50, 1, false); 1913 2054 gs->setLabel(QObject::tr("Scan displacement (X)")); 1914 2055 gs->setValue(0); 1915 2056 gs->setHelpText(QObject::tr("Adjust this to move the image horizontally.")); 1916 return gs;2057 return wrap(gs, settings); 1917 2058 } 1918 2059 1919 static HostSpinBox *YScanDisplacement()2060 static Setting *YScanDisplacement(PlaySettings *settings) 1920 2061 { 1921 HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1); 2062 CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings, 2063 -50, 50, 1, false); 1922 2064 gs->setLabel(QObject::tr("Scan displacement (Y)")); 1923 2065 gs->setValue(0); 1924 2066 gs->setHelpText(QObject::tr("Adjust this to move the image vertically.")); 1925 return gs;2067 return wrap(gs, settings); 1926 2068 }; 1927 2069 1928 2070 static HostCheckBox *AlwaysStreamFiles() … … 1938 2080 return gc; 1939 2081 } 1940 2082 1941 static HostCheckBox *CCBackground()2083 static Setting *CCBackground(PlaySettings *settings) 1942 2084 { 1943 HostCheckBox *gc = new HostCheckBox("CCBackground");2085 CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings); 1944 2086 gc->setLabel(QObject::tr("Black background for closed captioning")); 1945 2087 gc->setValue(false); 1946 2088 gc->setHelpText(QObject::tr( 1947 2089 "If enabled, captions will be displayed " 1948 2090 "as white text over a black background " 1949 2091 "for better contrast.")); 1950 return gc;2092 return wrap(gc, settings); 1951 2093 } 1952 2094 1953 static HostCheckBox *DefaultCCMode()2095 static Setting *DefaultCCMode(PlaySettings *settings) 1954 2096 { 1955 HostCheckBox *gc = new HostCheckBox("DefaultCCMode");2097 CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings); 1956 2098 gc->setLabel(QObject::tr("Always display closed captioning or subtitles")); 1957 2099 gc->setValue(false); 1958 2100 gc->setHelpText(QObject::tr( … … 1960 2102 "when playing back recordings or watching " 1961 2103 "live TV. Closed Captioning can be turned on or off " 1962 2104 "by pressing \"T\" during playback.")); 1963 return gc;2105 return wrap(gc, settings); 1964 2106 } 1965 2107 1966 static HostCheckBox *PreferCC708()2108 static Setting *PreferCC708(PlaySettings *settings) 1967 2109 { 1968 HostCheckBox *gc = new HostCheckBox("Prefer708Captions");2110 CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings); 1969 2111 gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions")); 1970 2112 gc->setValue(true); 1971 2113 gc->setHelpText( … … 1973 2115 "When enabled the new EIA-708 captions will be preferred over " 1974 2116 "the old EIA-608 captions in ATSC streams.")); 1975 2117 1976 return gc;2118 return wrap(gc, settings); 1977 2119 } 1978 2120 1979 static HostCheckBox *EnableMHEG()2121 static Setting *EnableMHEG(PlaySettings *settings) 1980 2122 { 1981 HostCheckBox *gc = new HostCheckBox("EnableMHEG");2123 CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings); 1982 2124 gc->setLabel(QObject::tr("Enable Interactive TV")); 1983 2125 gc->setValue(false); 1984 2126 gc->setHelpText(QObject::tr( 1985 2127 "If enabled, interactive TV applications (MHEG) will " 1986 2128 "be activated. This is used for teletext and logos for " 1987 2129 "radio and channels that are currently off-air.")); 1988 return gc;2130 return wrap(gc, settings); 1989 2131 } 1990 2132 1991 static HostCheckBox *PersistentBrowseMode()2133 static Setting *PersistentBrowseMode(PlaySettings *settings) 1992 2134 { 1993 HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");2135 CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings); 1994 2136 gc->setLabel(QObject::tr("Always use Browse mode in LiveTV")); 1995 2137 gc->setValue(true); 1996 2138 gc->setHelpText( 1997 2139 QObject::tr( 1998 2140 "If enabled, Browse mode will automatically be activated " 1999 2141 "whenever you use Channel UP/DOWN while watching Live TV.")); 2000 return gc;2142 return wrap(gc, settings); 2001 2143 } 2002 2144 2003 static HostCheckBox *BrowseAllTuners()2145 static Setting *BrowseAllTuners(PlaySettings *settings) 2004 2146 { 2005 HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");2147 CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings); 2006 2148 gc->setLabel(QObject::tr("Browse all channels")); 2007 2149 gc->setValue(false); 2008 2150 gc->setHelpText( … … 2010 2152 "If enabled, browse mode will shows channels on all " 2011 2153 "available recording devices, instead of showing " 2012 2154 "channels on just the current recorder.")); 2013 return gc;2155 return wrap(gc, settings); 2014 2156 } 2015 2157 2016 static HostCheckBox *ClearSavedPosition()2158 static Setting *ClearSavedPosition(PlaySettings *settings) 2017 2159 { 2018 HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");2160 CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings); 2019 2161 gc->setLabel(QObject::tr("Clear bookmark on playback")); 2020 2162 gc->setValue(true); 2021 2163 gc->setHelpText(QObject::tr("Automatically clear the bookmark on a " 2022 2164 "recording when the recording is played back. If " 2023 2165 "disabled, you can mark the beginning with rewind " 2024 2166 "then save position.")); 2025 return gc;2167 return wrap(gc, settings); 2026 2168 } 2027 2169 2028 static HostCheckBox *AltClearSavedPosition()2170 static Setting *AltClearSavedPosition(PlaySettings *settings) 2029 2171 { 2030 HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");2172 CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings); 2031 2173 gc->setLabel(QObject::tr("Alternate clear and save bookmark")); 2032 2174 gc->setValue(true); 2033 2175 gc->setHelpText(QObject::tr("During playback the Select key " … … 2035 2177 "Saved\" and \"Bookmark Cleared\". If disabled, the " 2036 2178 "Select key will save the current position for each " 2037 2179 "keypress.")); 2038 return gc;2180 return wrap(gc, settings); 2039 2181 } 2040 2182 2041 2183 #if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU) 2042 static HostCheckBox *UsePicControls()2184 static Setting *UsePicControls(PlaySettings *settings) 2043 2185 { 2044 HostCheckBox *gc = new HostCheckBox("UseOutputPictureControls");2186 CREATE_CHECKBOX_SETTING(gc, "UseOutputPictureControls", settings); 2045 2187 gc->setLabel(QObject::tr("Enable picture controls")); 2046 2188 gc->setValue(false); 2047 2189 gc->setHelpText( 2048 2190 QObject::tr( 2049 2191 "If enabled, MythTV attempts to initialize picture controls " 2050 2192 "(brightness, contrast, etc.) that are applied during playback.")); 2051 return gc;2193 return wrap(gc, settings); 2052 2194 } 2053 2195 #endif 2054 2196 2055 static HostLineEdit *UDPNotifyPort()2197 static Setting *UDPNotifyPort(PlaySettings *settings) 2056 2198 { 2057 HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");2199 CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings); 2058 2200 ge->setLabel(QObject::tr("UDP Notify Port")); 2059 2201 ge->setValue("6948"); 2060 2202 ge->setHelpText(QObject::tr("During playback, MythTV will listen for " 2061 2203 "connections from the \"mythtvosd\" or \"mythudprelay\" " 2062 2204 "programs on this port. See the README in " 2063 2205 "contrib/mythnotify/ for additional information.")); 2064 return ge;2206 return wrap(ge, settings); 2065 2207 } 2066 2208 2067 static HostComboBox *PlaybackExitPrompt()2209 static Setting *PlaybackExitPrompt(PlaySettings *settings) 2068 2210 { 2069 HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");2211 CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings); 2070 2212 gc->setLabel(QObject::tr("Action on playback exit")); 2071 2213 gc->addSelection(QObject::tr("Just exit"), "0"); 2072 2214 gc->addSelection(QObject::tr("Save position and exit"), "2"); … … 2077 2219 "when you exit playback mode. The options available will " 2078 2220 "allow you to save your position, delete the " 2079 2221 "recording, or continue watching.")); 2080 return gc;2222 return wrap(gc, settings); 2081 2223 } 2082 2224 2083 static HostCheckBox *EndOfRecordingExitPrompt()2225 static Setting *EndOfRecordingExitPrompt(PlaySettings *settings) 2084 2226 { 2085 HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");2227 CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings); 2086 2228 gc->setLabel(QObject::tr("Prompt at end of recording")); 2087 2229 gc->setValue(false); 2088 2230 gc->setHelpText(QObject::tr("If set, a menu will be displayed allowing " 2089 2231 "you to delete the recording when it has finished " 2090 2232 "playing.")); 2091 return gc;2233 return wrap(gc, settings); 2092 2234 } 2093 2235 2094 static HostCheckBox *JumpToProgramOSD()2236 static Setting *JumpToProgramOSD(PlaySettings *settings) 2095 2237 { 2096 HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");2238 CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings); 2097 2239 gc->setLabel(QObject::tr("Jump to Program OSD")); 2098 2240 gc->setValue(true); 2099 2241 gc->setHelpText(QObject::tr( … … 2102 2244 "'Watch Recording' screen when 'Jump to Program' " 2103 2245 "is activated. If set, the recordings are shown " 2104 2246 "in the OSD")); 2105 return gc;2247 return wrap(gc, settings); 2106 2248 } 2107 2249 2108 static HostCheckBox *ContinueEmbeddedTVPlay()2250 static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings) 2109 2251 { 2110 HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");2252 CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings); 2111 2253 gc->setLabel(QObject::tr("Continue Playback When Embedded")); 2112 2254 gc->setValue(false); 2113 2255 gc->setHelpText(QObject::tr( … … 2115 2257 "is embedded in the upcoming program list or recorded " 2116 2258 "list. The default is to pause the recorded show when " 2117 2259 "embedded.")); 2118 return gc;2260 return wrap(gc, settings); 2119 2261 } 2120 2262 2121 static HostCheckBox *AutomaticSetWatched()2263 static Setting *AutomaticSetWatched(PlaySettings *settings) 2122 2264 { 2123 HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");2265 CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings); 2124 2266 gc->setLabel(QObject::tr("Automatically mark a recording as watched")); 2125 2267 gc->setValue(false); 2126 2268 gc->setHelpText(QObject::tr("If set, when you exit near the end of a " … … 2128 2270 "detection is not foolproof, so do not enable this " 2129 2271 "setting if you don't want an unwatched recording marked " 2130 2272 "as watched.")); 2131 return gc;2273 return wrap(gc, settings); 2132 2274 } 2133 2275 2134 2276 static HostSpinBox *LiveTVIdleTimeout() … … 2365 2507 return gc; 2366 2508 } 2367 2509 2368 static HostComboBox *LetterboxingColour()2510 static Setting *LetterboxingColour(PlaySettings *settings) 2369 2511 { 2370 HostComboBox *gc = new HostComboBox("LetterboxColour");2512 CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings); 2371 2513 gc->setLabel(QObject::tr("Letterboxing Color")); 2372 2514 for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m) 2373 2515 gc->addSelection(toString((LetterBoxColour)m), QString::number(m)); … … 2377 2519 "letterboxing, but those with plasma screens may prefer gray " 2378 2520 "to minimize burn-in.") + " " + 2379 2521 QObject::tr("Currently only works with XVideo video renderer.")); 2380 return gc;2522 return wrap(gc, settings); 2381 2523 } 2382 2524 2383 static HostComboBox *AspectOverride()2525 static Setting *AspectOverride(PlaySettings *settings) 2384 2526 { 2385 HostComboBox *gc = new HostComboBox("AspectOverride");2527 CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings); 2386 2528 gc->setLabel(QObject::tr("Video Aspect Override")); 2387 2529 for (int m = kAspect_Off; m < kAspect_END; ++m) 2388 2530 gc->addSelection(toString((AspectOverrideMode)m), QString::number(m)); … … 2390 2532 "When enabled, these will override the aspect " 2391 2533 "ratio specified by any broadcaster for all " 2392 2534 "video streams.")); 2393 return gc;2535 return wrap(gc, settings); 2394 2536 } 2395 2537 2396 static HostComboBox *AdjustFill()2538 static Setting *AdjustFill(PlaySettings *settings) 2397 2539 { 2398 HostComboBox *gc = new HostComboBox("AdjustFill");2540 CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings); 2399 2541 gc->setLabel(QObject::tr("Zoom")); 2400 2542 gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff), 2401 2543 QString::number(kAdjustFill_AutoDetect_DefaultOff)); … … 2406 2548 gc->setHelpText(QObject::tr( 2407 2549 "When enabled, these will apply a predefined " 2408 2550 "zoom to all video playback in MythTV.")); 2409 return gc;2551 return wrap(gc, settings); 2410 2552 } 2411 2553 2412 2554 // Theme settings … … 2825 2967 return gc; 2826 2968 } 2827 2969 2828 ThemeSelector::ThemeSelector(QString label): 2829 HostImageSelect(label){2830 2970 static Setting *ThemeSelector(QString label, PlaySettings *settings=NULL) 2971 { 2972 CREATE_IMAGESELECT_SETTING(gs, label, settings); 2831 2973 ThemeType themetype = THEME_UI; 2832 2974 2833 2975 if (label == "Theme") 2834 2976 { 2835 2977 themetype = THEME_UI; 2836 setLabel(QObject::tr("UI Theme"));2978 gs->setLabel(QObject::tr("UI Theme")); 2837 2979 } 2838 2980 else if (label == "OSDTheme") 2839 2981 { 2840 2982 themetype = THEME_OSD; 2841 setLabel(QObject::tr("OSD Theme"));2983 gs->setLabel(QObject::tr("OSD Theme")); 2842 2984 } 2843 2985 else if (label == "MenuTheme") 2844 2986 { 2845 2987 themetype = THEME_MENU; 2846 setLabel(QObject::tr("Menu Theme"));2988 gs->setLabel(QObject::tr("Menu Theme")); 2847 2989 } 2848 2990 2849 2991 QDir themes(GetThemesParentDir()); … … 2907 3049 VERBOSE(VB_IMPORTANT, QString("Problem reading theme preview image" 2908 3050 " %1").arg(preview.filePath())); 2909 3051 2910 addImageSelection(name, previewImage, theme.fileName());3052 gs->addImageSelection(name, previewImage, theme.fileName()); 2911 3053 } 2912 3054 2913 3055 if (themetype & THEME_UI) 2914 setValue(DEFAULT_UI_THEME);3056 gs->setValue(DEFAULT_UI_THEME); 2915 3057 else if (themetype & THEME_OSD) 2916 setValue("BlackCurves-OSD"); 3058 gs->setValue("BlackCurves-OSD"); 3059 3060 return wrap(gs, settings); 2917 3061 } 2918 3062 2919 3063 static HostComboBox *ChannelFormat() … … 3598 3742 return gs; 3599 3743 } 3600 3744 3601 static HostCheckBox *RealtimePriority()3745 static Setting *RealtimePriority(PlaySettings *settings) 3602 3746 { 3603 HostCheckBox *gc = new HostCheckBox("RealtimePriority");3747 CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings); 3604 3748 gc->setLabel(QObject::tr("Enable realtime priority threads")); 3605 3749 gc->setHelpText(QObject::tr("When running mythfrontend with root " 3606 3750 "privileges, some threads can be given enhanced priority. " 3607 3751 "Disable this if mythfrontend freezes during video " 3608 3752 "playback.")); 3609 3753 gc->setValue(true); 3610 return gc;3754 return wrap(gc, settings, false); 3611 3755 } 3612 3756 3613 3757 static HostCheckBox *EnableMediaMon() … … 3763 3907 }; 3764 3908 3765 3909 #ifdef USING_OPENGL_VSYNC 3766 static HostCheckBox *UseOpenGLVSync()3910 static Setting *UseOpenGLVSync(PlaySettings *settings) 3767 3911 { 3768 HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");3912 CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings); 3769 3913 gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing")); 3770 3914 gc->setValue(false); 3771 3915 gc->setHelpText(QObject::tr( 3772 3916 "If it is supported by your hardware/drivers, " 3773 3917 "MythTV will use OpenGL vertical syncing for " 3774 3918 "video timing, reducing frame jitter.")); 3775 return gc;3919 return wrap(gc, settings); 3776 3920 } 3777 3921 #endif 3778 3922 … … 4198 4342 return gc; 4199 4343 } 4200 4344 4201 MainGeneralSettings::MainGeneralSettings() 4345 MainGeneralSettings::MainGeneralSettings(PlaySettings *settings, 4346 ConfigurationWizard *base) 4202 4347 { 4348 if (!settings) 4349 { 4203 4350 DatabaseSettings::addDatabaseSettings(this); 4204 4351 4205 4352 VerticalConfigurationGroup *pin = … … 4251 4398 remotecontrol->addChild(NetworkControlEnabled()); 4252 4399 remotecontrol->addChild(NetworkControlPort()); 4253 4400 addChild(remotecontrol); 4401 } 4254 4402 } 4255 4403 4256 PlaybackSettings::PlaybackSettings() 4404 PlaybackSettings::PlaybackSettings(PlaySettings *settings, 4405 ConfigurationWizard *base) 4257 4406 { 4258 4407 uint i = 0, total = 8; 4259 4408 #if CONFIG_DARWIN 4260 4409 total += 2; 4261 4410 #endif // USING_DARWIN 4411 if (settings) 4412 total -= 3; 4262 4413 4263 4414 4264 4415 VerticalConfigurationGroup* general1 = 4265 4416 new VerticalConfigurationGroup(false); 4266 4417 general1->setLabel(QObject::tr("General Playback") + 4267 4418 QString(" (%1/%2)").arg(++i).arg(total)); 4419 if (settings) 4420 general1->setLabel(QObject::tr("Playback group settings for ") + 4421 settings->mGroupName + " - " + 4422 general1->getLabel()); 4268 4423 4269 4424 HorizontalConfigurationGroup *columns = 4270 4425 new HorizontalConfigurationGroup(false, false, true, true); 4271 4426 4272 4427 VerticalConfigurationGroup *column1 = 4273 4428 new VerticalConfigurationGroup(false, false, true, true); 4274 column1->addChild(RealtimePriority()); 4275 column1->addChild(DecodeExtraAudio()); 4276 column1->addChild(JumpToProgramOSD()); 4429 if (!settings) 4430 column1->addChild(RealtimePriority(settings)); 4431 column1->addChild(DecodeExtraAudio(settings)); 4432 column1->addChild(JumpToProgramOSD(settings)); 4277 4433 columns->addChild(column1); 4278 4434 4279 4435 VerticalConfigurationGroup *column2 = 4280 4436 new VerticalConfigurationGroup(false, false, true, true); 4281 column2->addChild(ClearSavedPosition( ));4282 column2->addChild(AltClearSavedPosition( ));4283 column2->addChild(AutomaticSetWatched( ));4284 column2->addChild(ContinueEmbeddedTVPlay( ));4437 column2->addChild(ClearSavedPosition(settings)); 4438 column2->addChild(AltClearSavedPosition(settings)); 4439 column2->addChild(AutomaticSetWatched(settings)); 4440 column2->addChild(ContinueEmbeddedTVPlay(settings)); 4285 4441 columns->addChild(column2); 4286 4442 4287 4443 general1->addChild(columns); 4288 general1->addChild(LiveTVIdleTimeout()); 4289 general1->addChild(AlwaysStreamFiles()); 4444 if (!settings) 4445 general1->addChild(LiveTVIdleTimeout()); 4446 if (!settings) 4447 general1->addChild(AlwaysStreamFiles()); 4290 4448 #ifdef USING_OPENGL_VSYNC 4291 general1->addChild(UseOpenGLVSync( ));4449 general1->addChild(UseOpenGLVSync(settings)); 4292 4450 #endif // USING_OPENGL_VSYNC 4293 4451 #if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU) 4294 general1->addChild(UsePicControls( ));4452 general1->addChild(UsePicControls(settings)); 4295 4453 #endif // USING_XV 4296 addChild(general1); 4454 if (base) 4455 base->addChild(general1); 4456 else 4457 addChild(general1); 4297 4458 4298 4459 VerticalConfigurationGroup* general2 = 4299 4460 new VerticalConfigurationGroup(false); 4300 4461 general2->setLabel(QObject::tr("General Playback") + 4301 4462 QString(" (%1/%2)").arg(++i).arg(total)); 4463 if (settings) 4464 general2->setLabel(QObject::tr("Playback group settings for ") + 4465 settings->mGroupName + " - " + 4466 general2->getLabel()); 4302 4467 4303 4468 HorizontalConfigurationGroup* oscan = 4304 4469 new HorizontalConfigurationGroup(false, false, true, true); … … 4306 4471 new VerticalConfigurationGroup(false, false, true, true); 4307 4472 VerticalConfigurationGroup *ocol2 = 4308 4473 new VerticalConfigurationGroup(false, false, true, true); 4309 ocol1->addChild(VertScanPercentage( ));4310 ocol1->addChild(YScanDisplacement( ));4311 ocol2->addChild(HorizScanPercentage( ));4312 ocol2->addChild(XScanDisplacement( ));4474 ocol1->addChild(VertScanPercentage(settings)); 4475 ocol1->addChild(YScanDisplacement(settings)); 4476 ocol2->addChild(HorizScanPercentage(settings)); 4477 ocol2->addChild(XScanDisplacement(settings)); 4313 4478 oscan->addChild(ocol1); 4314 4479 oscan->addChild(ocol2); 4315 4480 4316 4481 HorizontalConfigurationGroup* aspect_fill = 4317 4482 new HorizontalConfigurationGroup(false, false, true, true); 4318 aspect_fill->addChild(AspectOverride( ));4319 aspect_fill->addChild(AdjustFill( ));4483 aspect_fill->addChild(AspectOverride(settings)); 4484 aspect_fill->addChild(AdjustFill(settings)); 4320 4485 4321 4486 general2->addChild(oscan); 4322 4487 general2->addChild(aspect_fill); 4323 general2->addChild(LetterboxingColour()); 4324 general2->addChild(PIPLocationComboBox()); 4325 general2->addChild(PlaybackExitPrompt()); 4326 general2->addChild(EndOfRecordingExitPrompt()); 4327 addChild(general2); 4488 general2->addChild(LetterboxingColour(settings)); 4489 general2->addChild(PIPLocationComboBox(settings)); 4490 general2->addChild(PlaybackExitPrompt(settings)); 4491 general2->addChild(EndOfRecordingExitPrompt(settings)); 4492 if (base) 4493 base->addChild(general2); 4494 else 4495 addChild(general2); 4328 4496 4329 4497 QString tmp = QString(" (%1/%2)").arg(++i).arg(total); 4330 addChild(new PlaybackProfileConfigs(tmp)); 4498 if (base) 4499 base->addChild(new PlaybackProfileConfigs(tmp, settings)); 4500 else 4501 addChild(new PlaybackProfileConfigs(tmp, settings)); 4331 4502 4503 if (!settings) 4504 { 4332 4505 VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false); 4333 4506 pbox->setLabel(QObject::tr("View Recordings") + 4334 4507 QString(" (%1/%2)").arg(++i).arg(total)); … … 4356 4529 pbox3->addChild(DisplayGroupTitleSort()); 4357 4530 pbox3->addChild(new WatchListSettings()); 4358 4531 addChild(pbox3); 4532 } 4359 4533 4360 4534 VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false); 4361 4535 seek->setLabel(QObject::tr("Seeking") + 4362 4536 QString(" (%1/%2)").arg(++i).arg(total)); 4363 seek->addChild(SmartForward()); 4364 seek->addChild(FFRewReposTime()); 4365 seek->addChild(FFRewReverse()); 4366 seek->addChild(ExactSeeking()); 4367 addChild(seek); 4537 if (settings) 4538 seek->setLabel(QObject::tr("Playback group settings for ") + 4539 settings->mGroupName + " - " + 4540 seek->getLabel()); 4541 seek->addChild(SmartForward(settings)); 4542 seek->addChild(FFRewReposTime(settings)); 4543 seek->addChild(FFRewReverse(settings)); 4544 seek->addChild(ExactSeeking(settings)); 4545 if (base) 4546 base->addChild(seek); 4547 else 4548 addChild(seek); 4368 4549 4369 4550 VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false); 4370 4551 comms->setLabel(QObject::tr("Commercial Skip") + 4371 4552 QString(" (%1/%2)").arg(++i).arg(total)); 4372 comms->addChild(AutoCommercialSkip()); 4373 comms->addChild(CommRewindAmount()); 4374 comms->addChild(CommNotifyAmount()); 4553 if (settings) 4554 comms->setLabel(QObject::tr("Playback group settings for ") + 4555 settings->mGroupName + " - " + 4556 comms->getLabel()); 4557 comms->addChild(AutoCommercialSkip(settings)); 4558 comms->addChild(CommRewindAmount(settings)); 4559 comms->addChild(CommNotifyAmount(settings)); 4560 if (!settings) // these are global settings, not host-specific 4561 { 4375 4562 comms->addChild(MaximumCommercialSkip()); 4376 4563 comms->addChild(MergeShortCommBreaks()); 4377 4564 comms->addChild(CommSkipAllBlanks()); 4378 addChild(comms); 4565 } 4566 if (base) 4567 base->addChild(comms); 4568 else 4569 addChild(comms); 4379 4570 4380 4571 #if CONFIG_DARWIN 4381 4572 VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false); 4382 4573 mac1->setLabel(QObject::tr("Mac OS X video settings") + 4383 4574 QString(" (%1/%2)").arg(++i).arg(total)); 4575 if (settings) 4576 mac1->setLabel(QObject::tr("Playback group settings for ") + 4577 settings->mGroupName + " - " + 4578 mac1->getLabel()); 4579 if (!settings) 4580 { 4384 4581 mac1->addChild(MacGammaCorrect()); 4385 4582 mac1->addChild(MacScaleUp()); 4386 4583 mac1->addChild(MacFullSkip()); 4387 addChild(mac1); 4584 } 4585 if (base) 4586 base->addChild(mac1); 4587 else 4588 addChild(mac1); 4388 4589 4389 4590 VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false); 4390 4591 mac2->setLabel(QObject::tr("Mac OS X video settings") + 4391 4592 QString(" (%1/%2)").arg(++i).arg(total)); 4593 if (settings) 4594 mac2->setLabel(QObject::tr("Playback group settings for ") + 4595 settings->mGroupName + " - " + 4596 mac2->getLabel()); 4597 if (!setings) 4598 { 4392 4599 mac2->addChild(new MacMainSettings()); 4393 4600 mac2->addChild(new MacFloatSettings()); 4394 4601 … … 4397 4604 row->addChild(new MacDockSettings()); 4398 4605 row->addChild(new MacDesktopSettings()); 4399 4606 mac2->addChild(row); 4607 } 4400 4608 4401 addChild(mac2); 4609 if (base) 4610 base->addChild(mac2); 4611 else 4612 addChild(mac2); 4402 4613 #endif 4403 4614 } 4404 4615 4405 OSDSettings::OSDSettings() 4616 OSDSettings::OSDSettings(PlaySettings *settings, 4617 ConfigurationWizard *base) 4406 4618 { 4407 4619 VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false); 4408 4620 osd->setLabel(QObject::tr("On-screen display")); 4621 if (settings) 4622 osd->setLabel(QObject::tr("Playback group settings for ") + 4623 settings->mGroupName + " - " + 4624 osd->getLabel()); 4409 4625 4410 osd->addChild(new ThemeSelector("OSDTheme")); 4411 osd->addChild(OSDGeneralTimeout()); 4412 osd->addChild(OSDProgramInfoTimeout()); 4413 osd->addChild(OSDFont()); 4414 osd->addChild(OSDThemeFontSizeType()); 4415 osd->addChild(EnableMHEG()); 4416 osd->addChild(PersistentBrowseMode()); 4417 osd->addChild(BrowseAllTuners()); 4418 addChild(osd); 4626 osd->addChild(ThemeSelector("OSDTheme", settings)); 4627 osd->addChild(OSDGeneralTimeout(settings)); 4628 osd->addChild(OSDProgramInfoTimeout(settings)); 4629 osd->addChild(OSDFont(settings)); 4630 osd->addChild(OSDThemeFontSizeType(settings)); 4631 osd->addChild(EnableMHEG(settings)); 4632 if (!settings) 4633 { 4634 osd->addChild(PersistentBrowseMode(settings)); 4635 osd->addChild(BrowseAllTuners(settings)); 4636 } 4637 if (base) 4638 base->addChild(osd); 4639 else 4640 addChild(osd); 4419 4641 4420 4642 VerticalConfigurationGroup *udp = new VerticalConfigurationGroup(false); 4421 4643 udp->setLabel(QObject::tr("UDP OSD Notifications")); 4422 udp->addChild(OSDNotifyTimeout()); 4423 udp->addChild(UDPNotifyPort()); 4424 addChild(udp); 4644 if (settings) 4645 udp->setLabel(QObject::tr("Playback group settings for ") + 4646 settings->mGroupName + " - " + 4647 udp->getLabel()); 4648 udp->addChild(OSDNotifyTimeout(settings)); 4649 udp->addChild(UDPNotifyPort(settings)); 4650 if (base) 4651 base->addChild(udp); 4652 else 4653 addChild(udp); 4425 4654 4426 4655 VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false); 4427 4656 cc->setLabel(QObject::tr("Analog Closed Captions")); 4428 cc->addChild(OSDCCFont()); 4657 if (settings) 4658 cc->setLabel(QObject::tr("Playback group settings for ") + 4659 settings->mGroupName + " - " + 4660 cc->getLabel()); 4661 cc->addChild(OSDCCFont(settings)); 4429 4662 //cc->addChild(DecodeVBIFormat()); 4430 cc->addChild(CCBackground()); 4431 cc->addChild(DefaultCCMode()); 4432 cc->addChild(PreferCC708()); 4433 addChild(cc); 4663 cc->addChild(CCBackground(settings)); 4664 cc->addChild(DefaultCCMode(settings)); 4665 cc->addChild(PreferCC708(settings)); 4666 if (base) 4667 base->addChild(cc); 4668 else 4669 addChild(cc); 4434 4670 4435 addChild(OSDCC708Settings()); 4436 addChild(OSDCC708Fonts()); 4437 addChild(ExternalSubtitleSettings()); 4671 if (base) 4672 { 4673 base->addChild(OSDCC708Settings(settings)); 4674 base->addChild(OSDCC708Fonts(settings)); 4675 base->addChild(ExternalSubtitleSettings(settings)); 4676 } 4677 else 4678 { 4679 addChild(OSDCC708Settings(settings)); 4680 addChild(OSDCC708Fonts(settings)); 4681 addChild(ExternalSubtitleSettings(settings)); 4682 } 4438 4683 4439 4684 #if CONFIG_DARWIN 4440 4685 // Any Mac OS-specific OSD stuff would go here. … … 4586 4831 VerticalConfigurationGroup* theme = new VerticalConfigurationGroup(false); 4587 4832 theme->setLabel(QObject::tr("Theme")); 4588 4833 4589 theme->addChild( newThemeSelector("Theme"));4834 theme->addChild(ThemeSelector("Theme")); 4590 4835 4591 4836 theme->addChild(ThemeCacheSize()); 4592 4837 -
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" … … 486 487 delete statusbox; 487 488 } 488 489 490 ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 491 { 492 return new PlaybackSettings(settings, base); 493 } 494 495 ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 496 { 497 return new OSDSettings(settings, base); 498 } 499 500 ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 501 { 502 return new MainGeneralSettings(settings, base); 503 } 504 505 static PlayGroupEditor::SettingsLookup pbgroupSetup[] = { 506 createPlaybackSettingsForPlaybackGroup, 507 createOSDSettingsForPlaybackGroup, 508 createMainGeneralSettingsForPlaybackGroup 509 }; 510 489 511 void TVMenuCallback(void *data, QString &selection) 490 512 { 491 513 (void)data; … … 578 600 } 579 601 else if (sel == "settings playgroup") 580 602 { 581 PlayGroupEditor editor; 603 PlayGroupEditor editor(pbgroupSetup, 604 sizeof(pbgroupSetup)/sizeof(*pbgroupSetup)); 582 605 editor.exec(); 583 606 } 584 607 else if (sel == "settings general") … … 770 793 } 771 794 } 772 795 delete tmprbuf; 796 pginfo->SetPlaybackGroup("Videos"); 773 797 } 774 798 else if (pginfo->IsVideo()) 799 { 775 800 pos = pginfo->QueryBookmark(); 801 pginfo->SetPlaybackGroup("Videos"); 802 } 776 803 777 804 if (pos > 0) 778 805 { -
programs/mythfrontend/globalsettings.h
9 9 #include "videodisplayprofile.h" 10 10 11 11 class QFileInfo; 12 class PlaySettings; 12 13 13 14 class AudioOutputDevice : public HostComboBox 14 15 { … … 36 37 class PlaybackSettings : public ConfigurationWizard 37 38 { 38 39 public: 39 PlaybackSettings(); 40 PlaybackSettings(PlaySettings *settings=NULL, 41 ConfigurationWizard *base=NULL); 40 42 }; 41 43 42 44 class OSDSettings: virtual public ConfigurationWizard 43 45 { 44 46 public: 45 OSDSettings(); 47 OSDSettings(PlaySettings *settings=NULL, 48 ConfigurationWizard *base=NULL); 46 49 }; 47 50 48 51 class GeneralSettings : public ConfigurationWizard … … 66 69 class MainGeneralSettings : public ConfigurationWizard 67 70 { 68 71 public: 69 MainGeneralSettings(); 72 MainGeneralSettings(PlaySettings *settings=NULL, 73 ConfigurationWizard *base=NULL); 70 74 }; 71 75 72 76 class GeneralRecPrioritiesSettings : public ConfigurationWizard … … 154 158 Q_OBJECT 155 159 156 160 public: 157 PlaybackProfileConfigs(const QString &str );161 PlaybackProfileConfigs(const QString &str, PlaySettings *settings); 158 162 virtual ~PlaybackProfileConfigs(); 159 163 160 164 private: … … 166 170 167 171 private: 168 172 QStringList profiles; 169 HostComboBox*grouptrigger;173 ComboBoxSetting *grouptrigger; 170 174 }; 171 175 172 176 #endif -
programs/mythavtest/main.cpp
21 21 #include "mythuihelper.h" 22 22 #include "dbcheck.h" 23 23 #include "myththemebase.h" 24 #include "playsettings.h" 24 25 25 26 static void *run_priv_thread(void *data) 26 27 { … … 182 183 183 184 GetMythUI()->LoadQtConfig(); 184 185 185 #if defined(Q_OS_MACX)186 // Mac OS X doesn't define the AudioOutputDevice setting187 #else188 QString auddevice = gCoreContext->GetSetting("AudioOutputDevice");189 if (auddevice.isEmpty())190 {191 VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "192 "to run 'mythfrontend', not 'mythtv'.");193 return TV_EXIT_NO_AUDIO;194 }195 #endif196 197 186 MythMainWindow *mainWindow = GetMythMainWindow(); 198 187 mainWindow->Init(); 199 188 MythThemeBase *theme = new MythThemeBase(); … … 207 196 return GENERIC_EXIT_DB_OUTOFDATE; 208 197 } 209 198 210 TV *tv = new TV(); 199 QString playgroup(""); 200 if (!filename.isEmpty()) 201 { 202 ProgramInfo pg(filename); 203 playgroup = pg.GetPlaybackGroup(); 204 } 205 PlaySettings settings(playgroup); 206 207 #if defined(Q_OS_MACX) 208 // Mac OS X doesn't define the AudioOutputDevice setting 209 #else 210 QString auddevice = settings.GetSetting("AudioOutputDevice", ""); 211 if (auddevice.isEmpty()) 212 { 213 VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need " 214 "to run 'mythfrontend', not 'mythtv'."); 215 return TV_EXIT_NO_AUDIO; 216 } 217 #endif 218 219 TV *tv = new TV(&settings); 211 220 if (!tv->Init()) 212 221 { 213 222 VERBOSE(VB_IMPORTANT, "Fatal Error: Could not initialize TV class.");