Ticket #8088: 8088_playgroups_v5.patch
File 8088_playgroups_v5.patch, 167.6 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/videoout_vdpau.h
16 16 { 17 17 public: 18 18 static void GetRenderOptions(render_opts &opts); 19 VideoOutputVDPAU( MythCodecID codec_id);19 VideoOutputVDPAU(PlaySettings *settings, MythCodecID codec_id); 20 20 ~VideoOutputVDPAU(); 21 21 bool Init(int width, int height, float aspect, WId winid, 22 22 int winx, int winy, int winw, int winh, WId embedid = 0); … … 49 49 const QSize &video_dim); 50 50 static MythCodecID GetBestSupportedCodec(uint width, uint height, 51 51 uint stream_type, 52 bool no_acceleration); 52 bool no_acceleration, 53 PlaySettings *settings); 53 54 DisplayInfo GetDisplayInfo(void); 54 55 virtual bool IsPIPSupported(void) const { return true; } 55 56 virtual bool IsPBPSupported(void) const { return false; } -
libs/libmythtv/NuppelVideoPlayer.cpp
59 59 #include "util-osx-cocoa.h" 60 60 #include "mythverbose.h" 61 61 #include "myth_imgconvert.h" 62 #include "playsettings.h" 62 63 63 64 extern "C" { 64 65 #include "vbitext/vbi.h" … … 231 232 // Playback (output) zoom control 232 233 detect_letter_box = new DetectLetterbox(this); 233 234 234 vbimode = VBIMode::Parse(gContext->GetSetting("VbiFormat"));235 236 commrewindamount = gContext->GetNumSetting("CommRewindAmount",0);237 commnotifyamount = gContext->GetNumSetting("CommNotifyAmount",0);238 decode_extra_audio=gContext->GetNumSetting("DecodeExtraAudio", 0);239 itvEnabled = gContext->GetNumSetting("EnableMHEG", 0);240 db_prefer708 = gContext->GetNumSetting("Prefer708Captions", 1);241 autocommercialskip = (CommSkipMode)242 gContext->GetNumSetting("AutoCommercialSkip", kCommSkipOff);243 244 235 lastIgnoredManualSkip = QDateTime::currentDateTime().addSecs(-10); 245 236 246 237 bzero(&txtbuffers, sizeof(txtbuffers)); … … 666 657 667 658 if (using_null_videoout) 668 659 { 669 videoOutput = new VideoOutputNull( );660 videoOutput = new VideoOutputNull(GetPlaySettings()); 670 661 if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(), 671 662 video_aspect, 0, 0, 0, 0, 0, 0)) 672 663 { … … 715 706 pipState, 716 707 video_disp_dim, video_aspect, 717 708 widget->winId(), display_rect, (video_frame_rate * play_speed), 718 0 /*embedid*/ );709 0 /*embedid*/, GetPlaySettings()); 719 710 720 711 if (!videoOutput) 721 712 { … … 737 728 videoOutput->EmbedInWidget(embx, emby, embw, embh); 738 729 } 739 730 740 SetCaptionsEnabled(gContext->GetNumSetting("DefaultCCMode"), false); 731 SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0), 732 false); 741 733 742 734 InitFilters(); 743 735 … … 788 780 789 781 void NuppelVideoPlayer::ReinitVideo(void) 790 782 { 791 if (!videoOutput->IsPreferredRenderer(video_disp_dim ))783 if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings())) 792 784 { 793 785 VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer.")); 794 786 SetErrored(QObject::tr("Need to switch video renderer.")); … … 859 851 860 852 if (!audioOutput && !using_null_videoout && player_ctx->IsAudioNeeded()) 861 853 { 862 bool setVolume = gContext->GetNumSetting("MythControlsVolume", 1); 854 bool setVolume = 855 GetPlaySettings()->GetNumSetting("MythControlsVolume", 1); 863 856 audioOutput = AudioOutput::OpenAudio(audio_main_device, 864 857 audio_passthru_device, 865 858 audio_bits, audio_channels, 866 859 audio_codec, audio_samplerate, 867 860 AUDIOOUTPUT_VIDEO, 868 setVolume, audio_passthru); 861 setVolume, audio_passthru, 862 GetPlaySettings()); 869 863 if (!audioOutput) 870 864 errMsg = QObject::tr("Unable to create AudioOutput."); 871 865 else … … 897 891 if (audioOutput) 898 892 { 899 893 const AudioSettings settings(audio_bits, audio_channels, audio_codec, 900 audio_samplerate, audio_passthru); 894 audio_samplerate, audio_passthru, 895 GetPlaySettings()); 901 896 audioOutput->Reconfigure(settings); 902 897 if (audio_passthru) 903 898 audio_channels = 2; … … 2920 2915 refreshrate = 0; 2921 2916 lastsync = false; 2922 2917 2923 usevideotimebase = gContext->GetNumSetting("UseVideoTimebase", 0);2918 usevideotimebase = GetPlaySettings()->GetNumSetting("UseVideoTimebase", 0); 2924 2919 2925 2920 if (VERBOSE_LEVEL_CHECK(VB_PLAYBACK)) 2926 2921 output_jmeter = new Jitterometer("video_output", 100); … … 2959 2954 m_double_process = videoOutput->IsExtraProcessingRequired(); 2960 2955 2961 2956 videosync = VideoSync::BestMethod( 2962 videoOutput, fr_int, rf_int, m_double_framerate); 2957 videoOutput, GetPlaySettings(), 2958 fr_int, rf_int, m_double_framerate); 2963 2959 2964 2960 // Make sure video sync can do it 2965 2961 if (videosync != NULL && m_double_framerate) … … 3443 3439 QRect visible, total; 3444 3440 float aspect, scaling; 3445 3441 3446 osd = new OSD( );3442 osd = new OSD(GetPlaySettings()); 3447 3443 3448 3444 osd->SetListener(m_tv); 3449 3445 … … 3522 3518 3523 3519 GetDecoder()->setExactSeeks(seeks); 3524 3520 3525 if ( gContext->GetNumSetting("ClearSavedPosition", 1) &&3521 if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) && 3526 3522 !player_ctx->IsPIP()) 3527 3523 { 3528 3524 if (player_ctx->buffer->isDVD()) … … 3790 3786 ++deleteIter; 3791 3787 if (deleteIter.key() == totalFrames) 3792 3788 { 3793 if (!( gContext->GetNumSetting("EndOfRecordingExitPrompt") == 13789 if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1 3794 3790 && !player_ctx->IsPIP() && 3795 3791 player_ctx->GetState() == kState_WatchingPreRecorded)) 3796 3792 { … … 3964 3960 3965 3961 if (sim_pip_players.isEmpty()) 3966 3962 { 3967 return (PIPLocation)gContext->GetNumSetting("PIPLocation", kPIPTopLeft); 3963 return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation", 3964 kPIPTopLeft); 3968 3965 } 3969 3966 3970 3967 // order of preference, could be stored in db if we want it configurable … … 4821 4818 exactseeks = frame_exact_seek; 4822 4819 player_ctx = ctx; 4823 4820 livetv = ctx->tvchain; 4821 4822 vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", "")); 4824 4823 } 4825 4824 4826 4825 void NuppelVideoPlayer::SetDeleteIter(void) … … 7483 7482 { 7484 7483 QMutexLocker locker(&subtitleLock); 7485 7484 textSubtitles.Clear(); 7486 return TextSubtitleParser::LoadSubtitles(subtitleFileName, textSubtitles); 7485 return TextSubtitleParser::LoadSubtitles(subtitleFileName, textSubtitles, 7486 GetPlaySettings()); 7487 7487 } 7488 7488 7489 7489 void NuppelVideoPlayer::ChangeDVDTrack(bool ffw) -
libs/libmythtv/videooutwindow.cpp
30 30 #include "videooutwindow.h" 31 31 #include "osd.h" 32 32 #include "osdsurface.h" 33 #include "playsettings.h" 33 34 #include "NuppelVideoPlayer.h" 34 35 #include "videodisplayprofile.h" 35 36 #include "decoderbase.h" … … 54 55 const float VideoOutWindow::kManualZoomMinVerticalZoom = 0.5f; 55 56 const int VideoOutWindow::kManualZoomMaxMove = 50; 56 57 57 VideoOutWindow::VideoOutWindow( ) :58 VideoOutWindow::VideoOutWindow(PlaySettings *_settings) : 58 59 // DB settings 59 60 db_move(0, 0), db_scale_horiz(0.0f), db_scale_vert(0.0f), 60 61 db_pip_size(26), … … 85 86 86 87 // Various state variables 87 88 embedding(false), needrepaint(false), 88 allowpreviewepg(true), pip_state(kPIPOff) 89 allowpreviewepg(true), pip_state(kPIPOff), 90 91 settings(_settings) 89 92 { 90 93 db_pip_size = gContext->GetNumSetting("PIPSize", 26); 91 94 92 db_move = QPoint( gContext->GetNumSetting("xScanDisplacement", 0),93 gContext->GetNumSetting("yScanDisplacement", 0));95 db_move = QPoint(settings->GetNumSetting("xScanDisplacement", 0), 96 settings->GetNumSetting("yScanDisplacement", 0)); 94 97 db_use_gui_size = gContext->GetNumSetting("GuiSizeForTV", 0); 95 98 96 99 QDesktopWidget *desktop = NULL; … … 613 616 if (change) 614 617 { 615 618 db_scale_vert = 616 gContext->GetNumSetting("VertScanPercentage", 0) * 0.01f;619 settings->GetNumSetting("VertScanPercentage", 0) * 0.01f; 617 620 db_scale_horiz = 618 gContext->GetNumSetting("HorizScanPercentage", 0) * 0.01f;621 settings->GetNumSetting("HorizScanPercentage", 0) * 0.01f; 619 622 db_scaling_allowed = true; 620 623 } 621 624 else -
libs/libmythtv/videoout_d3d.cpp
948 948 opts.priorities->insert("direct3d", 55); 949 949 } 950 950 951 VideoOutputD3D::VideoOutputD3D( void)952 : VideoOutput( ), m_lock(QMutex::Recursive),951 VideoOutputD3D::VideoOutputD3D(PlaySettings *settings) 952 : VideoOutput(settings), m_lock(QMutex::Recursive), 953 953 m_hWnd(NULL), m_ctx(NULL), 954 954 m_video(NULL), m_osd(NULL), 955 955 m_d3d_osd(false), m_osd_ready(false), -
libs/libmythtv/videoout_opengl.cpp
38 38 opts.priorities->insert("opengl", 65); 39 39 } 40 40 41 VideoOutputOpenGL::VideoOutputOpenGL( void)42 : VideoOutput( ),41 VideoOutputOpenGL::VideoOutputOpenGL(PlaySettings *settings) 42 : VideoOutput(settings), 43 43 gl_context_lock(QMutex::Recursive), 44 44 gl_context(NULL), gl_videochain(NULL), 45 45 gl_osdchain(NULL), gl_pipchain_active(NULL), -
libs/libmythtv/videoout_quartz.cpp
65 65 #include "videodisplayprofile.h" 66 66 #include "videoout_dvdv.h" 67 67 68 class PlaySettings; 69 68 70 #define LOC QString("VideoOutputQuartz::") 69 71 #define LOC_ERR QString("VideoOutputQuartz Error: ") 70 72 … … 1108 1110 /** \class VideoOutputQuartz 1109 1111 * \brief Implementation of Quartz (Mac OS X windowing system) video output 1110 1112 */ 1111 VideoOutputQuartz::VideoOutputQuartz( 1113 VideoOutputQuartz::VideoOutputQuartz(PlaySettings *settings 1112 1114 MythCodecID _myth_codec_id, void *codec_priv) : 1113 VideoOutput( ), Started(false), data(new QuartzData()),1115 VideoOutput(settings), Started(false), data(new QuartzData()), 1114 1116 myth_codec_id(_myth_codec_id) 1115 1117 { 1116 1118 init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0); … … 1815 1817 MythCodecID VideoOutputQuartz::GetBestSupportedCodec( 1816 1818 uint width, uint height, 1817 1819 uint osd_width, uint osd_height, 1818 uint stream_type, uint fourcc )1820 uint stream_type, uint fourcc, PlaySettings *settings) 1819 1821 { 1820 1822 (void) osd_width; 1821 1823 (void) osd_height; 1822 1824 1823 VideoDisplayProfile vdp ;1825 VideoDisplayProfile vdp(settings); 1824 1826 vdp.SetInput(QSize(width, height)); 1825 1827 QString dec = vdp.GetDecoder(); 1826 1828 if ((dec == "libmpeg2") || (dec == "ffmpeg")) -
libs/libmythtv/avformatdecoder.cpp
28 28 #include "videodisplayprofile.h" 29 29 #include "mythuihelper.h" 30 30 #include "myth_imgconvert.h" 31 #include "playsettings.h" 31 32 32 33 #include "lcddevice.h" 33 34 … … 517 518 av_log_set_level((debug) ? AV_LOG_DEBUG : AV_LOG_ERROR); 518 519 av_log_set_callback(myth_av_log); 519 520 520 max_channels = (uint) gContext->GetNumSetting("MaxChannels", 2); 521 allow_ac3_passthru = (max_channels > 2) ? gContext->GetNumSetting("AC3PassThru", false) : false; 522 allow_dts_passthru = (max_channels > 2) ? gContext->GetNumSetting("DTSPassThru", false) : false; 523 internal_vol = gContext->GetNumSetting("MythControlsVolume", 0); 521 max_channels = 522 (uint) GetNVP()->GetPlaySettings()->GetNumSetting("MaxChannels", 2); 523 allow_ac3_passthru = (max_channels > 2) ? 524 GetNVP()->GetPlaySettings()->GetNumSetting("AC3PassThru", false) : 525 false; 526 allow_dts_passthru = (max_channels > 2) ? 527 GetNVP()->GetPlaySettings()->GetNumSetting("DTSPassThru", false) : 528 false; 529 internal_vol = 530 GetNVP()->GetPlaySettings()->GetNumSetting("MythControlsVolume", 0); 524 531 525 532 audioIn.sample_size = -32; // force SetupAudioStream to run once 526 533 itv = GetNVP()->GetInteractiveTV(); 527 534 528 535 cc608_build_parity_table(cc608_parity_table); 529 536 530 if ( gContext->GetNumSetting("CCBackground", 0))537 if (GetNVP()->GetPlaySettings()->GetNumSetting("CCBackground", 0)) 531 538 CC708Window::forceWhiteOnBlackText = true; 532 539 533 540 no_dts_hack = false; … … 1378 1385 codec = find_vdpau_decoder(codec, enc->codec_id); 1379 1386 1380 1387 if (selectedStream && 1381 ! gContext->GetNumSetting("DecodeExtraAudio", 0) &&1388 !GetNVP()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) && 1382 1389 !CODEC_IS_HWACCEL(codec)) 1383 1390 { 1384 1391 SetLowBuffers(false); … … 1813 1820 1814 1821 if (!is_db_ignored) 1815 1822 { 1816 VideoDisplayProfile vdp ;1823 VideoDisplayProfile vdp(GetNVP()->GetPlaySettings()); 1817 1824 vdp.SetInput(QSize(width, height)); 1818 1825 dec = vdp.GetDecoder(); 1819 1826 thread_count = vdp.GetMaxCPUs(); … … 1836 1843 MythCodecID vdpau_mcid; 1837 1844 vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec( 1838 1845 width, height, 1839 mpeg_version(enc->codec_id), no_hardware_decoders); 1846 mpeg_version(enc->codec_id), no_hardware_decoders, 1847 GetNVP()->GetPlaySettings()); 1840 1848 1841 1849 if (vdpau_mcid >= video_codec_id) 1842 1850 { … … 1868 1876 /* mpeg type */ mpeg_version(enc->codec_id), 1869 1877 /* xvmc pix fmt */ xvmc_pixel_format(enc->pix_fmt), 1870 1878 /* test surface */ codec_is_std(video_codec_id), 1871 /* force_xv */ force_xv); 1879 /* force_xv */ force_xv, 1880 GetNVP()->GetPlaySettings()); 1872 1881 1873 1882 if (mcid >= video_codec_id) 1874 1883 { … … 1901 1910 /* osd dim */ 0, 0, 1902 1911 /* mpeg type */ mpeg_version(enc->codec_id), 1903 1912 /* pixel format */ 1904 (PIX_FMT_YUV420P == enc->pix_fmt) ? FOURCC_I420 : 0); 1913 (PIX_FMT_YUV420P == enc->pix_fmt) ? FOURCC_I420 : 0, 1914 GetNVP()->GetPlaySettings()); 1905 1915 1906 1916 if (quartz_mcid >= video_codec_id) 1907 1917 { -
libs/libmythtv/osdtypes.cpp
18 18 #include "mythcontext.h" 19 19 #include "mythdialogs.h" 20 20 #include "mythverbose.h" 21 #include "playsettings.h" 21 22 22 23 #ifdef USING_FRIBIDI 23 24 #include "fribidi/fribidi.h" … … 2359 2360 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2360 2361 2361 2362 OSDTypeCC::OSDTypeCC(const QString &name, TTFFont *font, int xoff, int yoff, 2362 int dispw, int disph, float wmult, float hmult) 2363 int dispw, int disph, float wmult, float hmult, 2364 PlaySettings *settings) 2363 2365 : OSDType(name) 2364 2366 { 2365 2367 m_font = font; … … 2373 2375 2374 2376 QRect rect = QRect(0, 0, 0, 0); 2375 2377 m_box = new OSDTypeBox("cc_background", rect, wmult, hmult); 2376 m_ccbackground = gContext->GetNumSetting("CCBackground", 0);2378 m_ccbackground = settings->GetNumSetting("CCBackground", 0); 2377 2379 } 2378 2380 2379 2381 OSDTypeCC::~OSDTypeCC() … … 2603 2605 } 2604 2606 2605 2607 OSDType708CC::OSDType708CC(const QString &name, TTFFont *fonts[48], 2606 2608 int xoff, int yoff, int dispw, int disph) : 2607 2609 OSDType(name) 2608 2610 { 2609 2611 xoffset = xoff; -
libs/libmythtv/playgroup.cpp
2 2 #include "mythdb.h" 3 3 #include "playgroup.h" 4 4 #include "programinfo.h" 5 #include "playsettings.h" 5 6 6 7 // A parameter associated with the profile itself 7 8 class PlayGroupDBStorage : public SimpleDBStorage … … 211 212 return res; 212 213 } 213 214 214 PlayGroupEditor::PlayGroupEditor(void) : 215 listbox(new ListBoxSetting(this)), lastValue("Default") 215 PlayGroupEditor::PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize) : 216 listbox(new ListBoxSetting(this)), lastValue("Default"), 217 getSettings(funcArray), getSettingsSize(funcArraySize) 216 218 { 217 219 listbox->setLabel(tr("Playback Groups")); 218 220 addChild(listbox); … … 243 245 } 244 246 245 247 PlayGroup group(name); 248 PlaySettings *psettings = new PlaySettings(name); 249 for (int i=0; i<getSettingsSize; i++) 250 getSettings[i](psettings, &group); 246 251 if (group.exec() == QDialog::Accepted || !created) 247 252 lastValue = name; 248 253 else … … 277 282 query.bindValue(":NAME", name); 278 283 if (!query.exec()) 279 284 MythDB::DBError("PlayGroupEditor::doDelete", query); 285 PlaySettings::deleteGroup(name); 280 286 281 287 int lastIndex = listbox->getValueIndex(name); 282 288 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
56 56 class TV; 57 57 class OSDListTreeItemEnteredEvent; 58 58 class OSDListTreeItemSelectedEvent; 59 class PlaySettings; 59 60 60 61 typedef QMap<QString,InfoMap> DDValueMap; 61 62 typedef QMap<QString,DDValueMap> DDKeyMap; … … 179 180 unsigned long seconds; 180 181 }; 181 182 182 TV( void);183 TV(PlaySettings *settings); 183 184 ~TV(); 184 185 185 186 bool Init(bool createWindow = true); … … 204 205 205 206 // Recording commands 206 207 int PlayFromRecorder(int recordernum); 207 int Playback(const ProgramInfo &rcinfo );208 int Playback(const ProgramInfo &rcinfo, PlaySettings *settings); 208 209 209 210 // Commands used by frontend playback box 210 211 QString GetRecordingGroup(int player_idx) const; … … 593 594 static TVState RemoveRecording(TVState state); 594 595 void RestoreScreenSaver(const PlayerContext*); 595 596 596 void InitUDPNotifyEvent( void);597 void InitUDPNotifyEvent(PlaySettings *settings); 597 598 598 599 /// true if dialog is either videoplayexit, playexit or askdelete dialog 599 600 bool IsVideoExitDialog(const QString &dialog_name); -
libs/libmythtv/playgroup.h
7 7 #include "mythwidgets.h" 8 8 9 9 class ProgramInfo; 10 class PlaySettings; 10 11 11 12 class MPUBLIC PlayGroup: public ConfigurationWizard 12 13 { … … 29 30 Q_OBJECT 30 31 31 32 public: 32 PlayGroupEditor(void); 33 typedef ConfigurationWizard *(*SettingsLookup)(PlaySettings *settings, 34 ConfigurationWizard *base); 35 PlayGroupEditor(SettingsLookup *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
3569 3569 3570 3570 VideoDisplayProfile::CreateNewProfiles(host); 3571 3571 profiles = VideoDisplayProfile::GetProfiles(host); 3572 QString profile = VideoDisplayProfile::GetDefaultProfileName(host); 3572 QString profile = 3573 VideoDisplayProfile::GetDefaultProfileName(host, NULL); 3573 3574 3574 3575 if (profiles.contains("Normal") && 3575 3576 (profile=="CPU++" || profile=="CPU+" || profile=="CPU--")) … … 5637 5638 " jump int(11) NOT NULL default '0'," 5638 5639 " PRIMARY KEY (`name`)" 5639 5640 ");", 5641 "CREATE TABLE playgroupsettings (" 5642 " playgroupname varchar(64) NOT NULL," 5643 " `value` varchar(128) NOT NULL," 5644 " `data` text," 5645 " overridden tinyint(1) NOT NULL," 5646 " PRIMARY KEY (playgroupname, `value`)" 5647 ");", 5640 5648 "CREATE TABLE powerpriority (" 5641 5649 " priorityname varchar(64) collate utf8_bin NOT NULL," 5642 5650 " 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
14 14 #include "videoouttypes.h" 15 15 #include "storagegroup.h" 16 16 #include "mythcontext.h" 17 #include "playsettings.h" 17 18 18 19 #define LOC QString("playCtx: ") 19 20 #define LOC_ERR QString("playCtx, Error: ") … … 435 436 WId embedwinid, const QRect *embedbounds, 436 437 bool muted) 437 438 { 438 int exact_seeking = gContext->GetNumSetting("ExactSeeking", 0);439 int exact_seeking = settings->GetNumSetting("ExactSeeking", 0); 439 440 440 441 if (HasNVP()) 441 442 { … … 450 451 _nvp->DisableHardwareDecoders(); 451 452 452 453 _nvp->SetPlayerInfo(tv, widget, exact_seeking, this); 453 _nvp->SetAudioInfo(gContext->GetSetting("AudioOutputDevice"), 454 gContext->GetSetting("PassThruOutputDevice"), 454 _nvp->commrewindamount = settings->GetNumSetting("CommRewindAmount", 0); 455 _nvp->commnotifyamount = settings->GetNumSetting("CommNotifyAmount", 0); 456 _nvp->decode_extra_audio = settings->GetNumSetting("DecodeExtraAudio", 0); 457 _nvp->itvEnabled = settings->GetNumSetting("EnableMHEG", 0); 458 _nvp->db_prefer708 = settings->GetNumSetting("Prefer708Captions", 1); 459 _nvp->autocommercialskip = (CommSkipMode) 460 settings->GetNumSetting("AutoCommercialSkip", kCommSkipOff); 461 _nvp->SetAudioInfo(settings->GetSetting("AudioOutputDevice", ""), 462 settings->GetSetting("PassThruOutputDevice", ""), 455 463 gContext->GetNumSetting("AudioSampleRate", 44100)); 456 464 _nvp->SetAudioStretchFactor(ts_normal); 457 465 _nvp->SetLength(playingLen); … … 888 896 /** 889 897 * \brief assign programinfo to the context 890 898 */ 891 void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 899 void PlayerContext::SetPlayingInfo(const ProgramInfo *info, 900 PlaySettings *_settings) 892 901 { 893 902 bool ignoreDB = gContext->IsDatabaseIgnored(); 894 903 … … 900 909 playingInfo->MarkAsInUse(false); 901 910 delete playingInfo; 902 911 playingInfo = NULL; 912 // XXX delete settings? 903 913 } 904 914 905 915 if (info) … … 908 918 if (!ignoreDB) 909 919 playingInfo->MarkAsInUse(true, recUsage); 910 920 playingLen = playingInfo->CalculateLength(); 921 settings = (_settings ? _settings : 922 new PlaySettings(playingInfo->playgroup)); 911 923 } 912 924 } 913 925 -
libs/libmythtv/NuppelVideoPlayer.h
196 196 bool GetAudioBufferStatus(uint &fill, uint &total) const; 197 197 PIPLocation GetNextPIPLocation(void) const; 198 198 199 PlaySettings *GetPlaySettings(void) const { 200 return player_ctx ? player_ctx->settings : NULL; 201 } 202 199 203 // Bool Gets 200 204 bool GetRawAudioState(void) const; 201 205 bool GetLimitKeyRepeat(void) const { return limitKeyRepeat; } -
libs/libmythtv/textsubtitleparser.h
17 17 // Qt headers 18 18 #include <QStringList> 19 19 20 class PlaySettings; 21 20 22 class text_subtitle_t 21 23 { 22 24 public: … … 75 77 class TextSubtitleParser 76 78 { 77 79 public: 78 static bool LoadSubtitles(QString fileName, TextSubtitles &target); 80 static bool LoadSubtitles(QString fileName, TextSubtitles &target, 81 PlaySettings *settings); 79 82 }; 80 83 81 84 #endif -
libs/libmythtv/osd.h
70 70 class TeletextViewer; 71 71 class QStringList; 72 72 class QDomElement; 73 class PlaySettings; 73 74 74 75 class OSD : public QObject 75 76 { 76 77 Q_OBJECT 77 78 public: 78 OSD( );79 OSD(PlaySettings *settings); 79 80 ~OSD(void); 80 81 81 82 void Init(const QRect &totalBounds, int frameRate, … … 233 234 234 235 QObject *m_listener; 235 236 237 PlaySettings *settings; 238 236 239 QRect osdBounds; 237 240 int frameint; 238 241 bool needPillarBox; -
libs/libmythtv/vsync.cpp
34 34 #include "mythcontext.h" 35 35 #include "mythverbose.h" 36 36 #include "mythmainwindow.h" 37 #include "playsettings.h" 37 38 38 39 #ifdef USING_XV 39 40 #include "videoout_xv.h" … … 76 77 * \brief Returns the most sophisticated video sync method available. 77 78 */ 78 79 VideoSync *VideoSync::BestMethod(VideoOutput *video_output, 80 PlaySettings *settings, 79 81 uint frame_interval, uint refresh_interval, 80 82 bool halve_frame_interval) 81 83 { 82 84 VideoSync *trial = NULL; 83 85 tryingVideoSync = true; 84 bool tryOpenGL = ( gContext->GetNumSetting("UseOpenGLVSync", 1) &&86 bool tryOpenGL = (settings->GetNumSetting("UseOpenGLVSync", 1) && 85 87 (getenv("NO_OPENGL_VSYNC") == NULL)); 86 88 87 89 // m_forceskip allows for skipping one sync method -
libs/libmythtv/tv_play.cpp
60 60 #include "tv_play_win.h" 61 61 #include "recordinginfo.h" 62 62 #include "mythsystemevent.h" 63 #include "playsettings.h" 63 64 64 65 #if ! HAVE_ROUND 65 66 #define round(x) ((int) ((x) + 0.5)) … … 190 191 bool inPlaylist, bool initByNetworkCommand) 191 192 { 192 193 VERBOSE(VB_PLAYBACK, LOC + "StartTV() -- begin"); 193 TV *tv = new TV();194 194 bool quitAll = false; 195 195 bool showDialogs = true; 196 196 bool playCompleted = false; … … 201 201 if (tvrec) 202 202 curProgram = new ProgramInfo(*tvrec); 203 203 204 PlaySettings settings(curProgram ? curProgram->playgroup : "Default"); 205 TV *tv = new TV(&settings); 206 204 207 // Initialize TV 205 208 if (!tv->Init()) 206 209 { … … 231 234 if (curProgram) 232 235 { 233 236 VERBOSE(VB_PLAYBACK, LOC + "tv->Playback() -- begin"); 234 if (!tv->Playback(*curProgram ))237 if (!tv->Playback(*curProgram, &settings)) 235 238 { 236 239 quitAll = true; 237 240 } … … 783 786 * \brief Performs instance initialiation not requiring access to database. 784 787 * \sa Init(void) 785 788 */ 786 TV::TV( void)789 TV::TV(PlaySettings *settings) 787 790 : // Configuration variables from database 788 791 baseFilters(""), 789 792 db_channel_format("<num> <sign>"), … … 921 924 kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]); 922 925 923 926 MythDB::getMythDB()->GetSettings(kv); 927 settings->AddToMap(kv); 924 928 925 929 // convert from minutes to ms. 926 930 db_idle_timeout = kv["LiveTVIdleTimeout"].toInt() * 60 * 1000; … … 1711 1715 } 1712 1716 1713 1717 1714 int TV::Playback(const ProgramInfo &rcinfo )1718 int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings) 1715 1719 { 1716 1720 wantsToQuit = false; 1717 1721 jumpToProgram = false; … … 1725 1729 return 0; 1726 1730 } 1727 1731 1728 mctx->SetPlayingInfo(&rcinfo );1732 mctx->SetPlayingInfo(&rcinfo, settings); 1729 1733 mctx->SetInitialTVState(false); 1730 1734 ScheduleStateChange(mctx); 1731 1735 … … 1808 1812 1809 1813 if (fileexists) 1810 1814 { 1811 Playback(pginfo); 1815 PlaySettings settings("Default"); 1816 Playback(pginfo, &settings); 1812 1817 retval = 1; 1813 1818 } 1814 1819 … … 2153 2158 { 2154 2159 OSD *osd = GetOSDLock(ctx); 2155 2160 ctx->LockPlayingInfo(__FILE__, __LINE__); 2156 if (osd && (PlayGroup::GetCount() > 0)) 2161 if (ctx->playingInfo->playgroup != "Default" && 2162 ctx->playingInfo->playgroup != "Videos" && 2163 osd && (PlayGroup::GetCount() > 0)) 2157 2164 osd->SetSettingsText(tr("%1 Settings") 2158 2165 .arg(tv_i18n(ctx->playingInfo->playgroup)), 3); 2159 2166 ctx->UnlockPlayingInfo(__FILE__, __LINE__); … … 5165 5172 return false; 5166 5173 } 5167 5174 5168 InitUDPNotifyEvent( );5175 InitUDPNotifyEvent(ctx->settings); 5169 5176 bool ok = false; 5170 5177 if (ctx->IsNullVideoDesired()) 5171 5178 { … … 11817 11824 GetMythUI()->RestoreScreensaver(); 11818 11825 } 11819 11826 11820 void TV::InitUDPNotifyEvent( void)11827 void TV::InitUDPNotifyEvent(PlaySettings *settings) 11821 11828 { 11822 11829 if (db_udpnotify_port && !udpnotify) 11823 11830 { 11824 udpnotify = new UDPNotify(db_udpnotify_port );11831 udpnotify = new UDPNotify(db_udpnotify_port, settings); 11825 11832 connect(udpnotify, 11826 11833 SIGNAL(AddUDPNotifyEvent( 11827 11834 const QString&,const UDPNotifyOSDSet*)), -
libs/libmythtv/videodisplayprofile.h
13 13 14 14 #include "mythcontext.h" 15 15 16 class PlaySettings; 17 16 18 typedef QMap<QString,QString> pref_map_t; 17 19 typedef QMap<QString,QStringList> safe_map_t; 18 20 typedef QStringList safe_list_t; … … 80 82 class MPUBLIC VideoDisplayProfile 81 83 { 82 84 public: 83 VideoDisplayProfile( );85 VideoDisplayProfile(PlaySettings *settings); 84 86 ~VideoDisplayProfile(); 85 87 86 88 void SetInput(const QSize &size); … … 121 123 static QString GetDecoderName(const QString &decoder); 122 124 static QString GetDecoderHelp(QString decoder = QString::null); 123 125 124 static QString GetDefaultProfileName(const QString &hostname); 126 static QString GetDefaultProfileName(const QString &hostname, 127 PlaySettings *settings); 125 128 static void SetDefaultProfileName(const QString &profilename, 126 129 const QString &hostname); 127 130 static uint GetProfileGroupID(const QString &profilename, -
libs/libmythtv/videoout_null.cpp
27 27 opts.priorities->insert("null", 10); 28 28 } 29 29 30 VideoOutputNull::VideoOutputNull( void) :31 VideoOutput( ), global_lock(QMutex::Recursive)30 VideoOutputNull::VideoOutputNull(PlaySettings *settings) : 31 VideoOutput(settings), global_lock(QMutex::Recursive) 32 32 { 33 33 VERBOSE(VB_PLAYBACK, "VideoOutputNull()"); 34 34 memset(&av_pause_frame, 0, sizeof(av_pause_frame)); -
libs/libmythtv/videooutbase.cpp
7 7 #include "NuppelVideoPlayer.h" 8 8 #include "videodisplayprofile.h" 9 9 #include "decoderbase.h" 10 #include "playsettings.h" 10 11 11 12 #include "mythcontext.h" 12 13 #include "mythverbose.h" … … 107 108 PIPState pipState, 108 109 const QSize &video_dim, float video_aspect, 109 110 WId win_id, const QRect &display_rect, 110 float video_prate, WId embed_id) 111 float video_prate, WId embed_id, 112 PlaySettings *settings) 111 113 { 112 114 (void) codec_priv; 113 115 … … 152 154 QString renderer = QString::null; 153 155 if (renderers.size() > 0) 154 156 { 155 VideoDisplayProfile vprof ;157 VideoDisplayProfile vprof(settings); 156 158 vprof.SetInput(video_dim); 157 159 158 160 QString tmp = vprof.GetVideoRenderer(); … … 180 182 181 183 #ifdef USING_DIRECTFB 182 184 if (renderer == "directfb") 183 vo = new VideoOutputDirectfb( );185 vo = new VideoOutputDirectfb(settings); 184 186 #endif // USING_DIRECTFB 185 187 186 188 #ifdef USING_MINGW 187 189 if (renderer == "direct3d") 188 vo = new VideoOutputD3D( );190 vo = new VideoOutputD3D(settings); 189 191 #endif // USING_MINGW 190 192 191 193 #ifdef Q_OS_MACX 192 194 if (osxlist.contains(renderer)) 193 vo = new VideoOutputQuartz( codec_id, codec_priv);195 vo = new VideoOutputQuartz(settings, codec_id, codec_priv); 194 196 #endif // Q_OS_MACX 195 197 196 198 #ifdef USING_OPENGL_VIDEO 197 199 if (renderer == "opengl") 198 vo = new VideoOutputOpenGL( );200 vo = new VideoOutputOpenGL(settings); 199 201 #endif // USING_OPENGL_VIDEO 200 202 201 203 #ifdef USING_VDPAU 202 204 if (renderer == "vdpau") 203 vo = new VideoOutputVDPAU( codec_id);205 vo = new VideoOutputVDPAU(settings, codec_id); 204 206 #endif // USING_VDPAU 205 207 206 208 #ifdef USING_XV 207 209 if (xvlist.contains(renderer)) 208 vo = new VideoOutputXv( codec_id);210 vo = new VideoOutputXv(settings, codec_id); 209 211 #endif // USING_XV 210 212 211 213 if (vo) … … 302 304 * \brief This constructor for VideoOutput must be followed by an 303 305 * Init(int,int,float,WId,int,int,int,int,WId) call. 304 306 */ 305 VideoOutput::VideoOutput( ) :307 VideoOutput::VideoOutput(PlaySettings *_settings) : 306 308 // DB Settings 307 309 db_display_dim(0,0), 308 310 db_aspectoverride(kAspect_Off), db_adjustfill(kAdjustFill_Off), … … 336 338 display_res(NULL), 337 339 338 340 // Physical display 339 monitor_sz(640,480), monitor_dim(400,300) 341 monitor_sz(640,480), monitor_dim(400,300), 340 342 343 settings(_settings) 344 341 345 { 342 346 bzero(&pip_tmp_image, sizeof(pip_tmp_image)); 343 db_display_dim = QSize( gContext->GetNumSetting("DisplaySizeWidth", 0),344 gContext->GetNumSetting("DisplaySizeHeight", 0));347 db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth", 0), 348 settings->GetNumSetting("DisplaySizeHeight", 0)); 345 349 346 350 db_pict_attr[kPictureAttribute_Brightness] = 347 gContext->GetNumSetting("PlaybackBrightness", 50);351 settings->GetNumSetting("PlaybackBrightness", 50); 348 352 db_pict_attr[kPictureAttribute_Contrast] = 349 gContext->GetNumSetting("PlaybackContrast", 50);353 settings->GetNumSetting("PlaybackContrast", 50); 350 354 db_pict_attr[kPictureAttribute_Colour] = 351 gContext->GetNumSetting("PlaybackColour", 50);355 settings->GetNumSetting("PlaybackColour", 50); 352 356 db_pict_attr[kPictureAttribute_Hue] = 353 gContext->GetNumSetting("PlaybackHue", 0);357 settings->GetNumSetting("PlaybackHue", 0); 354 358 355 359 db_aspectoverride = (AspectOverrideMode) 356 gContext->GetNumSetting("AspectOverride", 0);360 settings->GetNumSetting("AspectOverride", 0); 357 361 db_adjustfill = (AdjustFillMode) 358 gContext->GetNumSetting("AdjustFill", 0);362 settings->GetNumSetting("AdjustFill", 0); 359 363 db_letterbox_colour = (LetterBoxColour) 360 gContext->GetNumSetting("LetterboxColour", 0);364 settings->GetNumSetting("LetterboxColour", 0); 361 365 db_use_picture_controls = 362 gContext->GetNumSetting("UseOutputPictureControls", 0);366 settings->GetNumSetting("UseOutputPictureControls", 0); 363 367 364 368 if (!gContext->IsDatabaseIgnored()) 365 db_vdisp_profile = new VideoDisplayProfile( );369 db_vdisp_profile = new VideoDisplayProfile(settings); 366 370 367 windows.push_back(VideoOutWindow( ));371 windows.push_back(VideoOutWindow(settings)); 368 372 } 369 373 370 374 /** … … 433 437 return QString::null; 434 438 } 435 439 436 bool VideoOutput::IsPreferredRenderer(QSize video_size )440 bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings) 437 441 { 438 442 if (!db_vdisp_profile || (video_size == windows[0].GetVideoDispDim())) 439 443 return true; 440 444 441 VideoDisplayProfile vdisp ;445 VideoDisplayProfile vdisp(settings); 442 446 vdisp.SetInput(video_size); 443 447 QString new_rend = vdisp.GetVideoRenderer(); 444 448 if (new_rend.isEmpty()) -
libs/libmythtv/videooutwindow.h
16 16 #include "videoouttypes.h" 17 17 18 18 class NuppelVideoPlayer; 19 class PlaySettings; 19 20 20 21 class VideoOutWindow 21 22 { 22 23 public: 23 VideoOutWindow( );24 VideoOutWindow(PlaySettings *settings); 24 25 25 26 bool Init(const QSize &new_video_dim, float aspect, 26 27 const QRect &new_display_visible_rect, … … 162 163 bool allowpreviewepg; 163 164 PIPState pip_state; 164 165 166 PlaySettings *settings; 167 165 168 // Constants 166 169 static const float kManualZoomMaxHorizontalZoom; 167 170 static const float kManualZoomMaxVerticalZoom; -
libs/libmythtv/videoout_directfb.h
12 12 { 13 13 public: 14 14 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 15 VideoOutputDirectfb( );15 VideoOutputDirectfb(PlaySettings *settings); 16 16 ~VideoOutputDirectfb(); 17 17 18 18 bool Init(int width, int height, float aspect, WId winid, -
libs/libmythtv/playercontext.h
27 27 class LiveTVChain; 28 28 class MythDialog; 29 29 class QPainter; 30 class PlaySettings; 30 31 31 32 typedef enum 32 33 { … … 90 91 void SetRecorder(RemoteEncoder *rec); 91 92 void SetTVChain(LiveTVChain *chain); 92 93 void SetRingBuffer(RingBuffer *buf); 93 void SetPlayingInfo(const ProgramInfo *info );94 void SetPlayingInfo(const ProgramInfo *info, PlaySettings *settings=NULL); 94 95 void SetPlayGroup(const QString &group); 95 96 void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state); 96 97 void SetPIPLocation(int loc) { pipLocation = loc; } … … 145 146 LiveTVChain *tvchain; 146 147 RingBuffer *buffer; 147 148 ProgramInfo *playingInfo; ///< Currently playing info 149 PlaySettings *settings; // corresponding to playingInfo 148 150 long long playingLen; ///< Initial CalculateLength() 149 151 bool nohardwaredecoders; // < Disable use of VDPAU decoding 150 152 bool decoding; ///< Video decoder thread started -
libs/libmythtv/vsync.h
101 101 102 102 // documented in vsync.cpp 103 103 static VideoSync *BestMethod(VideoOutput*, 104 PlaySettings *settings, 104 105 uint frame_interval, uint refresh_interval, 105 106 bool interlaced); 106 107 protected: -
libs/libmythtv/videoout_xv.h
51 51 friend class XvMCOSD; 52 52 public: 53 53 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 54 VideoOutputXv( MythCodecID av_codec_id);54 VideoOutputXv(PlaySettings *settings, MythCodecID av_codec_id); 55 55 ~VideoOutputXv(); 56 56 57 57 bool Init(int width, int height, float aspect, WId winid, … … 109 109 static MythCodecID GetBestSupportedCodec(uint width, uint height, 110 110 uint osd_width, uint osd_height, 111 111 uint stream_type, int xvmc_chroma, 112 bool test_surface, bool force_xv); 112 bool test_surface, bool force_xv, 113 PlaySettings *settings); 113 114 114 115 static int GrabSuitableXvPort(MythXDisplay* disp, Window root, 116 PlaySettings *settings, 115 117 MythCodecID type, 116 118 uint width, uint height, 117 119 bool &xvsetdefaults, -
libs/libmythtv/videoout_xv.cpp
166 166 * \see VideoOutput, VideoBuffers 167 167 * 168 168 */ 169 VideoOutputXv::VideoOutputXv( MythCodecID codec_id)170 : VideoOutput( ),169 VideoOutputXv::VideoOutputXv(PlaySettings *settings, MythCodecID codec_id) 170 : VideoOutput(settings), 171 171 myth_codec_id(codec_id), video_output_subtype(XVUnknown), 172 172 global_lock(QMutex::Recursive), 173 173 … … 408 408 * \return port number if it succeeds, else -1. 409 409 */ 410 410 int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root, 411 PlaySettings *settings, 411 412 MythCodecID mcodecid, 412 413 uint width, uint height, 413 414 bool &xvsetdefaults, … … 492 493 } 493 494 494 495 // figure out if we want chromakeying.. 495 VideoDisplayProfile vdp ;496 VideoDisplayProfile vdp(settings); 496 497 vdp.SetInput(QSize(width, height)); 497 498 bool check_for_colorkey = (vdp.GetOSDRenderer() == "chromakey"); 498 499 … … 785 786 disp->StartLog(); 786 787 QString adaptor_name = QString::null; 787 788 const QSize video_dim = windows[0].GetVideoDim(); 788 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), mcodecid,789 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, mcodecid, 789 790 video_dim.width(), video_dim.height(), 790 791 xv_set_defaults, 791 792 xvmc_chroma, &xvmc_surf_info, &adaptor_name); … … 864 865 disp->StartLog(); 865 866 QString adaptor_name = QString::null; 866 867 const QSize video_dim = windows[0].GetVideoDim(); 867 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), kCodec_MPEG2,868 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, kCodec_MPEG2, 868 869 video_dim.width(), video_dim.height(), 869 870 xv_set_defaults, 0, NULL, &adaptor_name); 870 871 if (xv_port == -1) … … 1018 1019 uint width, uint height, 1019 1020 uint osd_width, uint osd_height, 1020 1021 uint stream_type, int xvmc_chroma, 1021 bool test_surface, bool force_xv) 1022 bool test_surface, bool force_xv, 1023 PlaySettings *settings) 1022 1024 { 1023 1025 (void)width, (void)height, (void)osd_width, (void)osd_height; 1024 1026 (void)stream_type, (void)xvmc_chroma, (void)test_surface; … … 1029 1031 return ret; 1030 1032 1031 1033 #ifdef USING_XVMC 1032 VideoDisplayProfile vdp ;1034 VideoDisplayProfile vdp(settings); 1033 1035 vdp.SetInput(QSize(width, height)); 1034 1036 QString dec = vdp.GetDecoder(); 1035 1037 if ((dec == "libmpeg2") || (dec == "ffmpeg")) … … 1079 1081 1080 1082 ok = false; 1081 1083 bool dummy; 1082 int port = GrabSuitableXvPort(disp, disp->GetRoot(), ret, width, height, 1084 int port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, 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 "mythcontext.h" 33 33 #include "mythverbose.h" 34 #include "playsettings.h" 34 35 35 36 UDPNotifyOSDSet::UDPNotifyOSDSet(const QString &name, uint timeout) 36 37 : m_name(name), m_timeout(timeout) … … 73 74 74 75 ///////////////////////////////////////////////////////////////////////// 75 76 76 UDPNotify::UDPNotify(uint udp_port ) :77 UDPNotify::UDPNotify(uint udp_port, PlaySettings *settings) : 77 78 m_socket(new QUdpSocket()), m_db_osd_udpnotify_timeout(5) 78 79 { 79 80 connect(m_socket, SIGNAL(readyRead()), … … 81 82 82 83 m_socket->bind(udp_port); 83 84 84 m_db_osd_udpnotify_timeout = gContext->GetNumSetting("OSDNotifyTimeout", 5);85 m_db_osd_udpnotify_timeout = settings->GetNumSetting("OSDNotifyTimeout", 5); 85 86 } 86 87 87 88 void UDPNotify::deleteLater(void) -
libs/libmythtv/videooutbase.h
29 29 class FilterChain; 30 30 class FilterManager; 31 31 class OpenGLContextGLX; 32 class PlaySettings; 32 33 33 34 typedef QMap<NuppelVideoPlayer*,PIPLocation> PIPMap; 34 35 … … 49 50 PIPState pipState, 50 51 const QSize &video_dim, float video_aspect, 51 52 WId win_id, const QRect &display_rect, 52 float video_prate, WId embed_id); 53 float video_prate, WId embed_id, 54 PlaySettings *settings); 53 55 54 VideoOutput( );56 VideoOutput(PlaySettings *settings); 55 57 virtual ~VideoOutput(); 56 58 57 59 virtual bool Init(int width, int height, float aspect, … … 59 61 int winh, WId embedid = 0); 60 62 virtual void InitOSD(OSD *osd); 61 63 virtual void SetVideoFrameRate(float); 62 virtual bool IsPreferredRenderer(QSize video_size );64 virtual bool IsPreferredRenderer(QSize video_size, PlaySettings *settings); 63 65 virtual bool SetDeinterlacingEnabled(bool); 64 66 virtual bool SetupDeinterlace(bool i, const QString& ovrf=""); 65 67 virtual void FallbackDeint(void); … … 328 330 // Display information 329 331 QSize monitor_sz; 330 332 QSize monitor_dim; 333 334 PlaySettings *settings; 331 335 }; 332 336 333 337 #endif -
libs/libmythtv/textsubtitleparser.cpp
21 21 #include "RingBuffer.h" 22 22 #include "textsubtitleparser.h" 23 23 #include "xine_demux_sputext.h" 24 #include "playsettings.h" 24 25 25 26 bool operator<(const text_subtitle_t& left, 26 27 const text_subtitle_t& right) … … 112 113 m_subtitles.clear(); 113 114 } 114 115 115 bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target) 116 bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target, 117 PlaySettings *settings) 116 118 { 117 119 demux_sputext_t sub_data; 118 120 sub_data.rbuffer = new RingBuffer(fileName, 0, false); … … 130 132 target.SetFrameBasedTiming(!sub_data.uses_time); 131 133 132 134 QTextCodec *textCodec = NULL; 133 QString codec = gContext->GetSetting("SubtitleCodec", "");135 QString codec = settings->GetSetting("SubtitleCodec", ""); 134 136 if (!codec.isEmpty()) 135 137 textCodec = QTextCodec::codecForName(codec.toLatin1()); 136 138 if (!textCodec) -
libs/libmythtv/osd.cpp
32 32 #include "mythverbose.h" 33 33 #include "util.h" 34 34 #include "channelutil.h" 35 #include "playsettings.h" 35 36 36 37 #include "x11colors.h" 37 38 #include "mythdirs.h" … … 42 43 static char *cc708_default_font_names[16]; 43 44 static bool cc708_defaults_initialized = false; 44 45 static QMutex cc708_init_lock; 45 static void initialize_osd_fonts( void);46 static void initialize_osd_fonts(PlaySettings *settings); 46 47 47 48 #define LOC QString("OSD: ") 48 49 #define LOC_ERR QString("OSD, Error: ") … … 58 59 const char *kOSDDialogInfo = "infobox"; 59 60 const char *kOSDDialogEditChannel = "channel_editor"; 60 61 61 OSD::OSD( ) :62 OSD::OSD(PlaySettings *_settings) : 62 63 QObject(), m_listener(NULL), 64 settings(_settings), 63 65 osdBounds(), frameint(0), 64 66 needPillarBox(false), 65 themepath(FindTheme( gContext->GetSetting("OSDTheme"))),67 themepath(FindTheme(settings->GetSetting("OSDTheme", ""))), 66 68 wscale(1.0f), fscale(1.0f), 67 69 m_themeinfo(new ThemeInfo(themepath)), 68 70 m_themeaspect(4.0f/3.0f), … … 172 174 drawSurface = new OSDSurface(osd_bounds.width(), osd_bounds.height()); 173 175 174 176 if (!cc708_defaults_initialized) 175 initialize_osd_fonts( );177 initialize_osd_fonts(settings); 176 178 177 179 for (uint i = 0; i < 16; i++) 178 180 cc708fontnames[i] = cc708_default_font_names[i]; … … 185 187 if (themepath.isEmpty()) 186 188 { 187 189 VERBOSE(VB_IMPORTANT, "Couldn't find OSD theme: " 188 << gContext->GetSetting("OSDTheme"));190 <<settings->GetSetting("OSDTheme", "")); 189 191 InitDefaults(); 190 192 return; 191 193 } … … 194 196 if (!LoadTheme()) 195 197 { 196 198 VERBOSE(VB_IMPORTANT, "Couldn't load OSD theme: " 197 << gContext->GetSetting("OSDTheme")<<" at "<<themepath);199 <<settings->GetSetting("OSDTheme", "")<<" at "<<themepath); 198 200 } 199 201 200 202 InitDefaults(); … … 238 240 QString name = "cc_font"; 239 241 int fontsize = m_themeinfo->BaseRes()->height() / 27; 240 242 241 ccfont = LoadFont( gContext->GetSetting("OSDCCFont"), fontsize);243 ccfont = LoadFont(settings->GetSetting("OSDCCFont", ""), fontsize); 242 244 243 245 if (ccfont) 244 246 fontMap[name] = ccfont; … … 274 276 275 277 OSDTypeCC *ccpage = 276 278 new OSDTypeCC(name, ccfont, sub_xoff, sub_yoff, 277 sub_dispw, sub_disph, wmult, hmult );279 sub_dispw, sub_disph, wmult, hmult, settings); 278 280 container->AddType(ccpage); 279 281 return true; 280 282 } … … 293 295 294 296 // Create fonts... 295 297 TTFFont* ccfonts[48]; 296 uint z = gContext->GetNumSetting("OSDCC708TextZoom", 100) *298 uint z = settings->GetNumSetting("OSDCC708TextZoom", 100) * 297 299 m_themeinfo->BaseRes()->height(); 298 300 uint fontsizes[3] = { z / 3600, z / 2900, z / 2200 }; 299 301 for (uint i = 0; i < 48; i++) … … 356 358 if (!font) 357 359 { 358 360 int fontsize = 440 / 26; 359 font = LoadFont( gContext->GetSetting("OSDCCFont"), fontsize);361 font = LoadFont(settings->GetSetting("OSDCCFont", ""), fontsize); 360 362 361 363 if (font) 362 364 fontMap[fontname] = font; … … 464 466 TTFFont *font = GetFont(fontname); 465 467 if (!font) 466 468 { 467 font = LoadFont(gContext->GetSetting("OSDCCFont"), SUBTITLE_FONT_SIZE); 469 font = LoadFont(settings->GetSetting("OSDCCFont", ""), 470 SUBTITLE_FONT_SIZE); 468 471 469 472 if (font) 470 473 { … … 532 535 533 536 if (!actfont) 534 537 { 535 actfont = LoadFont( gContext->GetSetting("OSDFont"), 16);538 actfont = LoadFont(settings->GetSetting("OSDFont", ""), 16); 536 539 537 540 if (actfont) 538 541 fontMap["treemenulistfont"] = actfont; … … 680 683 if (dir.exists()) 681 684 { 682 685 VERBOSE(VB_IMPORTANT, QString("Couldn't find OSD theme: %1. " 683 "Switching to default.").arg(gContext->GetSetting("OSDTheme")));684 gContext->OverrideSettingForSession("OSDTheme", "BlackCurves-OSD");686 "Switching to default.").arg(settings->GetSetting("OSDTheme", ""))); 687 settings->OverrideSetting/*ForSession*/("OSDTheme", "BlackCurves-OSD"); 685 688 return testdir; 686 689 } 687 690 … … 848 851 void OSD::parseFont(QDomElement &element) 849 852 { 850 853 QString name; 851 QString fontfile = gContext->GetSetting("OSDFont");854 QString fontfile = settings->GetSetting("OSDFont", ""); 852 855 int size = -1; 853 856 int sizeSmall = -1; 854 857 int sizeBig = -1; … … 926 929 return; 927 930 } 928 931 929 QString fontSizeType = gContext->GetSetting("OSDThemeFontSizeType",932 QString fontSizeType = settings->GetSetting("OSDThemeFontSizeType", 930 933 "default"); 931 934 if (fontSizeType == "small") 932 935 { … … 3107 3110 return QRect(xoffset, yoffset, displaywidth, displayheight); 3108 3111 } 3109 3112 3110 #define OSD_STRDUP(X) strdup( gContext->GetSetting(X).toLocal8Bit().constData())3113 #define OSD_STRDUP(X) strdup(settings->GetSetting(X, "").toLocal8Bit().constData()) 3111 3114 3112 static void initialize_osd_fonts( void)3115 static void initialize_osd_fonts(PlaySettings *settings) 3113 3116 { 3114 3117 QMutexLocker locker(&cc708_init_lock); 3115 3118 if (cc708_defaults_initialized) 3116 3119 return; 3117 3120 cc708_defaults_initialized = true; 3118 3121 3119 QString default_font_type = gContext->GetSetting(3122 QString default_font_type = settings->GetSetting( 3120 3123 "OSDCC708DefaultFontType", "MonoSerif"); 3121 3124 3122 3125 // 0 -
libs/libmythtv/videoout_quartz.h
3 3 4 4 class DVDV; 5 5 struct QuartzData; 6 class PlaySettings; 6 7 7 8 #include "videooutbase.h" 8 9 … … 10 11 { 11 12 public: 12 13 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 13 VideoOutputQuartz(MythCodecID av_codec_id, void *codec_priv); 14 VideoOutputQuartz(PlaySettings *settings, MythCodecID av_codec_id, 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 { … … 211 212 pref_map_t VideoDisplayProfile::dec_name; 212 213 safe_list_t VideoDisplayProfile::safe_decoders; 213 214 214 VideoDisplayProfile::VideoDisplayProfile( )215 VideoDisplayProfile::VideoDisplayProfile(PlaySettings *settings) 215 216 : lock(QMutex::Recursive), last_size(0,0), last_rate(0.0f), 216 217 last_video_renderer(QString::null) 217 218 { … … 219 220 init_statics(); 220 221 221 222 QString hostname = gContext->GetHostName(); 222 QString cur_profile = GetDefaultProfileName(hostname );223 QString cur_profile = GetDefaultProfileName(hostname, settings); 223 224 uint groupid = GetProfileGroupID(cur_profile, hostname); 224 225 225 226 item_list_t items = LoadDB(groupid); … … 771 772 return list; 772 773 } 773 774 774 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname) 775 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname, 776 PlaySettings *settings) 775 777 { 776 778 QString tmp = 779 settings ? settings->GetSetting("DefaultVideoPlaybackProfile", "") : 777 780 gContext->GetSettingOnHost("DefaultVideoPlaybackProfile", hostname); 778 781 779 782 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; … … 657 707 this, SLOT(setValue(const QString &))); 658 708 connect(cbwidget, SIGNAL(editTextChanged(const QString &)), 659 709 this, SLOT(setValue(const QString &))); 710 connect(cbwidget, SIGNAL(editTextChanged(const QString &)), 711 this, SLOT(changeLabel(const QString &))); 660 712 } 661 713 else 662 714 { … … 680 732 681 733 widget->setLayout(layout); 682 734 735 setValue(current); 736 683 737 return widget; 684 738 } 685 739 … … 689 743 { 690 744 bxwidget = NULL; 691 745 cbwidget = NULL; 746 labelWidget = NULL; 692 747 } 693 748 } 694 749 … … 724 779 725 780 if (rw) 726 781 { 782 changeLabel(newValue); 727 783 Setting::setValue(newValue); 728 784 if (cbwidget) 729 785 cbwidget->setCurrentIndex(current); … … 734 790 { 735 791 if (cbwidget) 736 792 cbwidget->setCurrentIndex(which); 793 changeLabel(labels[which]); 737 794 SelectSetting::setValue(which); 738 795 }; 739 796 740 void ComboBoxSetting::addSelection( 741 const QString &label, QString value, bool select) 797 void ComboBoxSetting::changeLabel(const QString &newLabel) 742 798 { 799 if (changeOnSpecial) 800 { 801 adjustFont(labelWidget, specialLabel == newLabel); 802 adjustFont(cbwidget, specialLabel == newLabel); 803 } 804 } 805 806 void ComboBoxSetting::addSelection(const QString &label, QString value, 807 bool select, bool special_formatting) 808 { 743 809 if ((findSelection(label, value) < 0) && cbwidget) 744 810 { 745 811 cbwidget->insertItem(label); 746 812 } 747 813 814 if (special_formatting) 815 { 816 changeOnSpecial = true; 817 specialLabel = label; 818 } 819 748 820 SelectSetting::addSelection(label, value, select); 749 821 750 822 if (cbwidget && isSet) … … 917 989 BooleanSetting::setHelpText(str); 918 990 } 919 991 992 QWidget* TristateCheckBoxSetting::configWidget(ConfigurationGroup *cg, 993 QWidget* parent, 994 const char* widgetName) { 995 widget = new MythCheckBox(parent, widgetName, true); 996 connect(widget, SIGNAL(destroyed(QObject*)), 997 this, SLOT(widgetDeleted(QObject*))); 998 999 widget->setHelpText(getHelpText()); 1000 widget->setText(getLabel()); 1001 widget->setCheckState(tristateValue()); 1002 setValue(tristateValue()); 1003 1004 connect(widget, SIGNAL(stateChanged(int)), 1005 this, SLOT(setValue(int))); 1006 connect(this, SIGNAL(valueChanged(int)), 1007 this, SLOT(relayValueChanged(int))); 1008 1009 if (cg) 1010 connect(widget, SIGNAL(changeHelpText(QString)), cg, 1011 SIGNAL(changeHelpText(QString))); 1012 1013 return widget; 1014 } 1015 1016 void TristateCheckBoxSetting::widgetInvalid(QObject *obj) 1017 { 1018 widget = (widget == obj) ? NULL : widget; 1019 } 1020 1021 void TristateCheckBoxSetting::setEnabled(bool fEnabled) 1022 { 1023 TristateSetting::setEnabled(fEnabled); 1024 if (widget) 1025 widget->setEnabled(fEnabled); 1026 } 1027 1028 void TristateCheckBoxSetting::setHelpText(const QString &str) 1029 { 1030 if (widget) 1031 widget->setHelpText(str); 1032 TristateSetting::setHelpText(str); 1033 } 1034 1035 const char *TristateSetting::kPartiallyCheckedString = "default"; 1036 1037 void TristateCheckBoxSetting::setValue(int check) 1038 { 1039 adjustFont(widget, (check != Qt::Checked && check != Qt::Unchecked)); 1040 TristateSetting::setValue(check); 1041 emit valueChanged(check); 1042 } 1043 1044 void TristateSetting::setValue(int check) 1045 { 1046 if (check == Qt::Checked) 1047 Setting::setValue("1"); 1048 else if (check == Qt::Unchecked) 1049 Setting::setValue("0"); 1050 else 1051 Setting::setValue(kPartiallyCheckedString); 1052 emit valueChanged(check); 1053 } 1054 920 1055 void AutoIncrementDBSetting::Save(QString table) 921 1056 { 922 1057 if (intValue() == 0) … … 1104 1239 addSelection(label, value, select); 1105 1240 } 1106 1241 1242 void ImageSelectSetting::addDefaultSelection(const QString label, 1243 const QString value, 1244 const QString defaultValue, 1245 bool select) 1246 { 1247 for (unsigned i=0; i<values.size(); i++) 1248 { 1249 if (values[i] == defaultValue) 1250 { 1251 changeOnSpecial = true; 1252 specialLabel = label; 1253 images.push_back(new QImage(*images[i])); 1254 addSelection(label, value, select); 1255 return; 1256 } 1257 } 1258 } 1259 1107 1260 ImageSelectSetting::~ImageSelectSetting() 1108 1261 { 1109 1262 Teardown(); … … 1126 1279 bxwidget = NULL; 1127 1280 imagelabel = NULL; 1128 1281 combo = NULL; 1282 labelWidget = NULL; 1129 1283 } 1130 1284 1131 1285 void ImageSelectSetting::imageSet(int num) … … 1173 1327 QLabel *label = new QLabel(); 1174 1328 label->setText(getLabel() + ":"); 1175 1329 layout->addWidget(label); 1330 labelWidget = label; 1176 1331 } 1177 1332 1178 1333 combo = new MythComboBox(false); … … 1219 1374 connect(combo, SIGNAL(highlighted(int)), this, SLOT(imageSet(int))); 1220 1375 connect(combo, SIGNAL(activated(int)), this, SLOT(setValue(int))); 1221 1376 connect(combo, SIGNAL(activated(int)), this, SLOT(imageSet(int))); 1377 connect(combo, SIGNAL(highlighted(const QString &)), 1378 this, SLOT(changeLabel(const QString &))); 1379 connect(combo, SIGNAL(activated(const QString &)), 1380 this, SLOT(changeLabel(const QString &))); 1222 1381 1223 1382 connect(this, SIGNAL(selectionsCleared()), 1224 1383 combo, SLOT(clear())); … … 1229 1388 1230 1389 bxwidget->setLayout(layout); 1231 1390 1391 changeLabel(GetLabel(current)); 1392 1232 1393 return bxwidget; 1233 1394 } 1234 1395 1396 void ImageSelectSetting::changeLabel(const QString &newLabel) 1397 { 1398 if (changeOnSpecial) 1399 { 1400 adjustFont(labelWidget, specialLabel == newLabel); 1401 adjustFont(combo, specialLabel == newLabel); 1402 } 1403 } 1404 1235 1405 void ImageSelectSetting::widgetInvalid(QObject *obj) 1236 1406 { 1237 1407 if (bxwidget == obj) -
libs/libmyth/audiosettings.cpp
6 6 */ 7 7 8 8 #include "audiosettings.h" 9 #include "playsettings.h" 9 10 10 11 // startup_upmixer 11 12 AudioSettings::AudioSettings() : … … 18 19 set_initial_vol(false), 19 20 use_passthru(false), 20 21 source(AUDIOOUTPUT_UNKNOWN), 22 psettings(0), 21 23 upmixer(0) 22 24 { 23 25 } … … 32 34 set_initial_vol(other.set_initial_vol), 33 35 use_passthru(other.use_passthru), 34 36 source(other.source), 37 psettings(other.psettings), 35 38 upmixer(other.upmixer) 36 39 { 37 40 } … … 46 49 AudioOutputSource audio_source, 47 50 bool audio_set_initial_vol, 48 51 bool audio_use_passthru, 52 PlaySettings *_psettings, 49 53 int upmixer_startup) : 50 54 main_device(audio_main_device), 51 55 passthru_device(audio_passthru_device), … … 56 60 set_initial_vol(audio_set_initial_vol), 57 61 use_passthru(audio_use_passthru), 58 62 source(audio_source), 63 psettings(_psettings), 59 64 upmixer(upmixer_startup) 60 65 { 66 if (!psettings) 67 { 68 QString name("Default"); 69 psettings = new PlaySettings(name); 70 } 61 71 } 62 72 63 73 AudioSettings::AudioSettings( … … 66 76 int audio_codec, 67 77 int audio_samplerate, 68 78 bool audio_use_passthru, 79 PlaySettings *_psettings, 69 80 int upmixer_startup) : 70 81 main_device(QString::null), 71 82 passthru_device(QString::null), … … 76 87 set_initial_vol(false), 77 88 use_passthru(audio_use_passthru), 78 89 source(AUDIOOUTPUT_UNKNOWN), 90 psettings(_psettings), 79 91 upmixer(upmixer_startup) 80 92 { 93 if (!psettings) 94 { 95 QString name("Default"); 96 psettings = new PlaySettings(name); 97 } 81 98 } 82 99 100 AudioSettings::AudioSettings( 101 int audio_bits, 102 int audio_channels, 103 int audio_codec, 104 int audio_samplerate, 105 bool audio_use_passthru, 106 int upmixer_startup) : 107 main_device(QString::null), 108 passthru_device(QString::null), 109 bits(audio_bits), 110 channels(audio_channels), 111 codec(audio_codec), 112 samplerate(audio_samplerate), 113 set_initial_vol(false), 114 use_passthru(audio_use_passthru), 115 source(AUDIOOUTPUT_UNKNOWN), 116 psettings(NULL), 117 upmixer(upmixer_startup) 118 { 119 if (!psettings) 120 { 121 QString name("Default"); 122 psettings = new PlaySettings(name); 123 } 124 } 125 83 126 void AudioSettings::FixPassThrough(void) 84 127 { 85 128 if (passthru_device.isEmpty() || passthru_device.toLower() == "default") -
libs/libmyth/audiooutputbase.h
155 155 int orig_config_channels; 156 156 int src_quality; 157 157 158 PlaySettings *psettings; 159 158 160 private: 159 161 // software volume 160 162 template <class AudioDataType> -
libs/libmyth/audiooutputalsa.cpp
8 8 9 9 #include "mythcontext.h" 10 10 #include "audiooutputalsa.h" 11 #include "playsettings.h" 11 12 12 13 #define LOC QString("ALSA: ") 13 14 #define LOC_WARN QString("ALSA, Warning: ") … … 752 753 { 753 754 int volume; 754 755 755 mixer_control = gContext->GetSetting("MixerControl", "PCM");756 mixer_control = psettings->GetSetting("MixerControl", "PCM"); 756 757 757 758 SetupMixer(); 758 759 759 760 if (mixer_handle != NULL && setstartingvolume) 760 761 { 761 volume = gContext->GetNumSetting("MasterMixerVolume", 80);762 volume = psettings->GetNumSetting("MasterMixerVolume", 80); 762 763 SetCurrentVolume("Master", 0, volume); 763 764 SetCurrentVolume("Master", 1, volume); 764 765 765 volume = gContext->GetNumSetting("PCMMixerVolume", 80);766 volume = psettings->GetNumSetting("PCMMixerVolume", 80); 766 767 SetCurrentVolume("PCM", 0, volume); 767 768 SetCurrentVolume("PCM", 1, volume); 768 769 } … … 779 780 { 780 781 int err; 781 782 782 QString alsadevice = gContext->GetSetting("MixerDevice", "default");783 QString alsadevice = psettings->GetSetting("MixerDevice", "default"); 783 784 QString device = alsadevice.remove(QString("ALSA:")); 784 785 785 786 if (mixer_handle != NULL) -
libs/libmyth/audiooutputca.cpp
246 246 247 247 if (internal_vol && set_initial_vol) 248 248 { 249 QString controlLabel = gContext->GetSetting("MixerControl", "PCM");249 QString controlLabel = psettings->GetSetting("MixerControl", "PCM"); 250 250 controlLabel += "MixerVolume"; 251 251 SetCurrentVolume(gContext->GetNumSetting(controlLabel, 80)); 252 252 } -
libs/libmyth/volumebase.cpp
8 8 9 9 #include "volumebase.h" 10 10 #include "mythcontext.h" 11 #include "playsettings.h" 11 12 12 VolumeBase::VolumeBase( ) :13 VolumeBase::VolumeBase(PlaySettings *_settings) : 13 14 internal_vol(false), volume(80), 14 current_mute_state(kMuteOff) 15 current_mute_state(kMuteOff), settings(_settings) 15 16 { 16 17 swvol = swvol_setting = 17 ( gContext->GetSetting("MixerDevice", "default").toLower() == "software");18 (settings->GetSetting("MixerDevice", "default").toLower() == "software"); 18 19 } 19 20 20 21 bool VolumeBase::SWVolume(void) … … 39 40 volume = max(min(value, 100), 0); 40 41 UpdateVolume(); 41 42 42 QString controlLabel = gContext->GetSetting("MixerControl", "PCM");43 QString controlLabel = settings->GetSetting("MixerControl", "PCM"); 43 44 controlLabel += "MixerVolume"; 44 45 gContext->SaveSetting(controlLabel, volume); 45 46 } -
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 345 361 private: 346 362 bool rw; 347 363 QWidget *bxwidget; 348 364 MythComboBox *cbwidget; 365 bool changeOnSpecial; 366 QString specialLabel; 367 QLabel *labelWidget; 349 368 350 369 protected: 351 370 int step; … … 414 433 ImageSelectSetting(Storage *_storage) : 415 434 SelectSetting(_storage), 416 435 bxwidget(NULL), imagelabel(NULL), combo(NULL), 417 m_hmult(1.0f), m_wmult(1.0f) { } 436 m_hmult(1.0f), m_wmult(1.0f), 437 changeOnSpecial(false), specialLabel(""), labelWidget(NULL) { } 418 438 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 419 439 const char* widgetName = 0); 420 440 virtual void widgetInvalid(QObject *obj); … … 425 445 QImage* image, 426 446 QString value=QString::null, 427 447 bool select=false); 448 virtual void addDefaultSelection(const QString label, 449 const QString value, 450 const QString defaultValue, 451 bool select); 428 452 429 453 protected slots: 430 454 void imageSet(int); 455 void changeLabel(const QString &newLabel); 431 456 432 457 protected: 433 458 void Teardown(void); … … 439 464 QLabel *imagelabel; 440 465 MythComboBox *combo; 441 466 float m_hmult, m_wmult; 467 bool changeOnSpecial; 468 QString specialLabel; 469 QLabel *labelWidget; 442 470 }; 443 471 444 472 class MPUBLIC BooleanSetting : public Setting … … 479 507 MythCheckBox *widget; 480 508 }; 481 509 510 class MPUBLIC TristateSetting : public BooleanSetting 511 { 512 Q_OBJECT 513 514 public: 515 TristateSetting(Storage *_storage) : BooleanSetting(_storage) {} 516 517 Qt::CheckState tristateValue(void) const { 518 if (getValue() == "0") 519 return Qt::Unchecked; 520 if (getValue() == "1") 521 return Qt::Checked; 522 return Qt::PartiallyChecked; 523 } 524 525 static const char *kPartiallyCheckedString; 526 527 public slots: 528 virtual void setValue(/*Qt::CheckState*/int check); 529 530 signals: 531 void valueChanged(int); 532 }; 533 534 class MPUBLIC TristateCheckBoxSetting: public TristateSetting { 535 Q_OBJECT 536 537 public: 538 TristateCheckBoxSetting(Storage *_storage) : 539 TristateSetting(_storage), widget(NULL) { } 540 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 541 const char* widgetName = 0); 542 virtual void widgetInvalid(QObject*); 543 544 virtual void setEnabled(bool b); 545 546 virtual void setHelpText(const QString &str); 547 548 549 public slots: 550 virtual void setValue(/*Qt::CheckState*/int check); 551 virtual void relayValueChanged(int state) { 552 if (widget) 553 widget->setCheckState((Qt::CheckState)state); 554 } 555 556 protected: 557 MythCheckBox *widget; 558 }; 559 482 560 class MPUBLIC PathSetting : public ComboBoxSetting 483 561 { 484 562 public: -
libs/libmyth/audiooutputjack.cpp
211 211 { 212 212 int volume = 100; 213 213 if (set_initial_vol) 214 volume = gContext->GetNumSetting("MasterMixerVolume", 80);214 volume = psettings->GetNumSetting("MasterMixerVolume", 80); 215 215 216 216 JACK_SetAllVolume(audioid, volume); 217 217 } -
libs/libmyth/audiooutputbase.cpp
15 15 #include "audiooutputdigitalencoder.h" 16 16 #include "SoundTouch.h" 17 17 #include "freesurround.h" 18 #include "playsettings.h" 18 19 19 20 #define LOC QString("AO: ") 20 21 #define LOC_ERR QString("AO, ERROR: ") 21 22 22 23 AudioOutputBase::AudioOutputBase(const AudioSettings &settings) : 24 AudioOutput(settings.psettings), 23 25 // protected 24 26 effdsp(0), effdspstretched(0), 25 27 audio_channels(-1), audio_codec(CODEC_ID_NONE), … … 40 42 set_initial_vol(settings.set_initial_vol), 41 43 buffer_output_data_for_use(false), 42 44 45 psettings(settings.psettings), 46 43 47 // private 44 48 need_resampler(false), 45 49 … … 82 86 memset(tmp_buff, 0, sizeof(short) * kAudioTempBufSize); 83 87 memset(&audiotime_updated, 0, sizeof(audiotime_updated)); 84 88 memset(audiobuffer, 0, sizeof(char) * kAudioRingBufferSize); 85 orig_config_channels = gContext->GetNumSetting("MaxChannels", 2);86 src_quality = gContext->GetNumSetting("AudioUpmixType", 2);89 orig_config_channels = psettings->GetNumSetting("MaxChannels", 2); 90 src_quality = psettings->GetNumSetting("AudioUpmixType", 2); 87 91 //Set default upsampling quality to medium if using stereo 88 92 if (orig_config_channels == 2) 89 93 src_quality = 1; 90 94 91 95 // Handle override of SRC quality settings 92 if ( gContext->GetNumSetting("AdvancedAudioSettings", false) &&93 gContext->GetNumSetting("SRCQualityOverride", false))96 if (psettings->GetNumSetting("AdvancedAudioSettings", false) && 97 psettings->GetNumSetting("SRCQualityOverride", false)) 94 98 { 95 src_quality = gContext->GetNumSetting("SRCQuality", 1);99 src_quality = psettings->GetNumSetting("SRCQuality", 1); 96 100 // Extra test to keep backward compatibility with earlier SRC code setting 97 101 if (src_quality > 2) 98 102 src_quality = 2; … … 100 104 } 101 105 102 106 if (!settings.upmixer) 103 configured_audio_channels = gContext->GetNumSetting("AudioDefaultUpmix", false) ? orig_config_channels : 2; 107 configured_audio_channels = 108 psettings->GetNumSetting("AudioDefaultUpmix", false) ? 109 orig_config_channels : 2; 104 110 else 105 111 if (settings.upmixer == 1) 106 112 configured_audio_channels = 2; 107 113 else 108 114 configured_audio_channels = 6; 109 115 110 allow_ac3_passthru = (orig_config_channels > 2) ? gContext->GetNumSetting("AC3PassThru", false) : false; 116 allow_ac3_passthru = 117 (orig_config_channels > 2) ? 118 psettings->GetNumSetting("AC3PassThru", false) : false; 111 119 112 120 // You need to call Reconfigure from your concrete class. 113 121 // Reconfigure(laudio_bits, laudio_channels, … … 192 200 193 201 const AudioSettings settings(audio_bits, source_audio_channels, 194 202 audio_codec, source_audio_samplerate, 195 audio_passthru );203 audio_passthru, psettings); 196 204 Reconfigure(settings); 197 205 return (configured_audio_channels == 6); 198 206 } … … 278 286 killaudio = false; 279 287 pauseaudio = false; 280 288 was_paused = true; 281 internal_vol = gContext->GetNumSetting("MythControlsVolume", 0);289 internal_vol = settings.psettings->GetNumSetting("MythControlsVolume", 0); 282 290 283 291 numlowbuffer = 0; 284 292 … … 361 369 362 370 // Only used for software volume 363 371 if (set_initial_vol && internal_vol) 364 volume = gContext->GetNumSetting("PCMMixerVolume", 80);372 volume = settings.psettings->GetNumSetting("PCMMixerVolume", 80); 365 373 { 366 QString controlLabel = gContext->GetSetting("MixerControl", "PCM"); 374 QString controlLabel = 375 settings.psettings->GetSetting("MixerControl", "PCM"); 367 376 controlLabel += "MixerVolume"; 368 volume = gContext->GetNumSetting(controlLabel, 80);377 volume = settings.psettings->GetNumSetting(controlLabel, 80); 369 378 } 370 379 371 380 SyncVolume(); … … 377 386 if (audio_buffer_unused < 0) 378 387 audio_buffer_unused = 0; 379 388 380 if (! gContext->GetNumSetting("AdvancedAudioSettings", false))389 if (!settings.psettings->GetNumSetting("AdvancedAudioSettings", false)) 381 390 audio_buffer_unused = 0; 382 else if (!gContext->GetNumSetting("AggressiveSoundcardBuffer", false)) 391 else if (!settings.psettings->GetNumSetting("AggressiveSoundcardBuffer", 392 false)) 383 393 audio_buffer_unused = 0; 384 394 385 395 audbuf_timecode = 0; … … 395 405 VERBOSE(VB_AUDIO, LOC + QString("create upmixer")); 396 406 if (configured_audio_channels == 6) 397 407 { 398 surround_mode = gContext->GetNumSetting("AudioUpmixType", 2); 408 surround_mode = 409 settings.psettings->GetNumSetting("AudioUpmixType", 2); 399 410 } 400 411 401 412 upmixer = new FreeSurround( … … 669 680 volume = new_volume; 670 681 if (save) 671 682 { 672 QString controlLabel = gContext->GetSetting("MixerControl", "PCM");683 QString controlLabel = psettings->GetSetting("MixerControl", "PCM"); 673 684 controlLabel += "MixerVolume"; 674 685 gContext->SaveSetting(controlLabel, volume); 675 686 } -
libs/libmyth/audiooutput.cpp
6 6 #include "mythconfig.h" 7 7 #include "audiooutput.h" 8 8 #include "compat.h" 9 #include "playsettings.h" 9 10 10 11 #include "audiooutputnull.h" 11 12 #ifdef USING_MINGW … … 37 38 bool set_initial_vol, bool audio_passthru, 38 39 int upmixer_startup) 39 40 { 41 QString str("Default"); 42 PlaySettings psettings(str); 43 return OpenAudio(main_device, passthru_device, audio_bits, 44 audio_channels, audio_codec, audio_samplerate, 45 source, set_initial_vol, audio_passthru, 46 &psettings, upmixer_startup); 47 } 48 49 AudioOutput *AudioOutput::OpenAudio( 50 const QString &main_device, 51 const QString &passthru_device, 52 int audio_bits, int audio_channels, 53 int audio_codec, int audio_samplerate, 54 AudioOutputSource source, 55 bool set_initial_vol, bool audio_passthru, 56 PlaySettings *psettings, 57 int upmixer_startup) 58 { 40 59 AudioSettings settings( 41 60 main_device, passthru_device, audio_bits, 42 61 audio_channels, audio_codec, audio_samplerate, source, 43 set_initial_vol, audio_passthru, upmixer_startup);62 set_initial_vol, audio_passthru, psettings, upmixer_startup); 44 63 45 64 settings.FixPassThrough(); 46 65 -
libs/libmyth/libmyth.pro
56 56 SOURCES += recordingtypes.cpp remoteutil.cpp 57 57 SOURCES += rawsettingseditor.cpp 58 58 59 HEADERS += playsettings.h 60 SOURCES += playsettings.cpp 61 59 62 # remove when everything is switched to mythui 60 63 SOURCES += virtualkeyboard_qt.cpp 61 64 -
libs/libmyth/audiosettings.h
12 12 13 13 #include "mythexp.h" 14 14 15 class PlaySettings; 16 15 17 typedef enum { 16 18 AUDIOOUTPUT_UNKNOWN, 17 19 AUDIOOUTPUT_VIDEO, … … 34 36 AudioOutputSource audio_source, 35 37 bool audio_set_initial_vol, 36 38 bool audio_use_passthru, 39 PlaySettings *psettings, 37 40 int upmixer_startup = 0); 38 41 39 42 AudioSettings(int audio_bits, … … 41 44 int audio_codec, 42 45 int audio_samplerate, 43 46 bool audio_use_passthru, 47 PlaySettings *psettings, 44 48 int upmixer_startup = 0); 45 49 50 AudioSettings(int audio_bits, 51 int audio_channels, 52 int audio_codec, 53 int audio_samplerate, 54 bool audio_use_passthru, 55 int upmixer_startup = 0); 56 46 57 void FixPassThrough(void); 47 58 void TrimDeviceType(void); 48 59 … … 61 72 bool set_initial_vol; 62 73 bool use_passthru; 63 74 AudioOutputSource source; 75 PlaySettings *psettings; 64 76 int upmixer; 65 77 }; 66 78 -
libs/libmyth/audiooutputoss.cpp
27 27 #include "mythcontext.h" 28 28 #include "audiooutputoss.h" 29 29 #include "util.h" 30 #include "playsettings.h" 30 31 31 32 AudioOutputOSS::AudioOutputOSS(const AudioSettings &settings) : 32 33 AudioOutputBase(settings), … … 316 317 mixerfd = -1; 317 318 int volume = 0; 318 319 319 QString device = gContext->GetSetting("MixerDevice", "/dev/mixer");320 QString device = psettings->GetSetting("MixerDevice", "/dev/mixer"); 320 321 if (device.toLower() == "software") 321 322 return; 322 323 323 324 QByteArray dev = device.toAscii(); 324 325 mixerfd = open(dev.constData(), O_RDONLY); 325 326 326 QString controlLabel = gContext->GetSetting("MixerControl", "PCM");327 QString controlLabel = psettings->GetSetting("MixerControl", "PCM"); 327 328 328 329 if (controlLabel == "Master") 329 330 { … … 344 345 if (set_initial_vol) 345 346 { 346 347 int tmpVol; 347 volume = gContext->GetNumSetting("MasterMixerVolume", 80);348 volume = psettings->GetNumSetting("MasterMixerVolume", 80); 348 349 tmpVol = (volume << 8) + volume; 349 350 int ret = ioctl(mixerfd, MIXER_WRITE(SOUND_MIXER_VOLUME), &tmpVol); 350 351 if (ret < 0) … … 353 354 QString("Error Setting initial Master Volume") + ENO); 354 355 } 355 356 356 volume = gContext->GetNumSetting("PCMMixerVolume", 80);357 volume = psettings->GetNumSetting("PCMMixerVolume", 80); 357 358 tmpVol = (volume << 8) + volume; 358 359 ret = ioctl(mixerfd, MIXER_WRITE(SOUND_MIXER_PCM), &tmpVol); 359 360 if (ret < 0) -
libs/libmyth/volumebase.h
3 3 4 4 #include "mythexp.h" 5 5 6 class PlaySettings; 7 6 8 typedef enum { 7 9 kMuteOff = 0, 8 10 kMuteLeft, … … 13 15 class MPUBLIC VolumeBase 14 16 { 15 17 public: 16 VolumeBase( );18 VolumeBase(PlaySettings *settings); 17 19 virtual ~VolumeBase() {}; 18 20 19 21 void SWVolume(bool set); … … 46 48 MuteState current_mute_state; 47 49 bool swvol; 48 50 bool swvol_setting; 51 PlaySettings *settings; 49 52 50 53 }; 51 54 -
libs/libmyth/mythwidgets.cpp
223 223 else if (action == "DOWN") 224 224 focusNextPrevChild(true); 225 225 else if (action == "LEFT" || action == "RIGHT" || action == "SELECT") 226 toggle(); 226 { 227 if (isTristate()) 228 { 229 Qt::CheckState newState = 230 (Qt::CheckState)(((int)checkState() + 1) % 3); 231 setCheckState(newState); 232 } 233 else 234 toggle(); 235 } 227 236 else 228 237 handled = false; 229 238 } -
libs/libmyth/audiooutput.h
8 8 #include "volumebase.h" 9 9 #include "output.h" 10 10 11 class PlaySettings; 12 11 13 class MPUBLIC AudioOutput : public VolumeBase, public OutputListeners 12 14 { 13 15 public: … … 19 21 int audio_codec, int audio_samplerate, 20 22 AudioOutputSource source, 21 23 bool set_initial_vol, bool audio_passthru, 24 PlaySettings *psettings, 22 25 int upmixer_startup = 0); 26 static AudioOutput *OpenAudio( 27 const QString &audiodevice, 28 const QString &passthrudevice, 29 int audio_bits, int audio_channels, 30 int audio_codec, int audio_samplerate, 31 AudioOutputSource source, 32 bool set_initial_vol, bool audio_passthru, 33 int upmixer_startup = 0); 23 34 24 AudioOutput( ) :25 VolumeBase( ),OutputListeners(),35 AudioOutput(PlaySettings *psettings) : 36 VolumeBase(psettings), OutputListeners(), 26 37 lastError(QString::null), lastWarn(QString::null) {} 27 38 28 39 virtual ~AudioOutput() { }; -
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 -
libs/libmyth/audiooutputpulse.cpp
547 547 (char*)"under"); 548 548 if (set_initial_vol) 549 549 { 550 int volume = gContext->GetNumSetting("MasterMixerVolume", 80);550 int volume = psettings->GetNumSetting("MasterMixerVolume", 80); 551 551 pa_cvolume_set(&volume_control, audio_channels, 552 552 (float)volume * (float)PA_VOLUME_NORM / 100.0f); 553 553 } -
programs/mythfrontend/globalsettings.cpp
37 37 #include "mythconfig.h" 38 38 #include "mythdirs.h" 39 39 #include "mythuihelper.h" 40 #include "playsettings.h" 40 41 41 static HostComboBox *AudioOutputDevice() 42 #define CREATE_CHECKBOX_SETTING(var, name, settings) \ 43 BooleanSetting *var; \ 44 if ((settings)) \ 45 var = new PlaySettingsCheckBox((name), (settings)); \ 46 else \ 47 var = new HostCheckBox((name)) 48 49 #define CREATE_COMBOBOX_SETTING(var, name, settings) \ 50 ComboBoxSetting *var; \ 51 if ((settings)) \ 52 var = new PlaySettingsComboBox((name), (settings)); \ 53 else \ 54 var = new HostComboBox((name)) 55 56 #define CREATE_COMBOBOX1_SETTING(var, name, settings, arg1) \ 57 ComboBoxSetting *var; \ 58 if ((settings)) \ 59 var = new PlaySettingsComboBox((name), (settings), (arg1)); \ 60 else \ 61 var = new HostComboBox((name), (arg1)) 62 63 #define CREATE_SPINBOX_SETTING(var, name, settings, arg1, arg2, arg3, arg4) \ 64 SpinBoxSetting *var; \ 65 if ((settings)) \ 66 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3), (arg4)); \ 67 else \ 68 var = new HostSpinBox((name), (arg1), (arg2), (arg3), (arg4)) 69 70 #define CREATE_LINEEDIT_SETTING(var, name, settings) \ 71 LineEditSetting *var; \ 72 if ((settings)) \ 73 var = new PlaySettingsLineEdit((name), (settings), ""); \ 74 else \ 75 var = new HostLineEdit((name)) 76 77 // For PlaySettings, use a SpinBox instead of a Slider so that a 78 // default value can be easily used. 79 #define CREATE_SLIDER_SETTING(var, name, settings, arg1, arg2, arg3) \ 80 BoundedIntegerSetting *var; \ 81 if ((settings)) \ 82 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3)); \ 83 else \ 84 var = new HostSlider((name), (arg1), (arg2), (arg3)) 85 86 #define CREATE_IMAGESELECT_SETTING(var, name, settings) \ 87 ImageSelectSetting *var; \ 88 if ((settings)) \ 89 var = new PlaySettingsImageSelect((name), (settings)); \ 90 else \ 91 var = new HostImageSelect((name)) 92 93 static Setting *wrap(Setting *obj, PlaySettings *settings, 94 bool twoLineLabel=false) 42 95 { 43 HostComboBox *gc = new HostComboBox("AudioOutputDevice", true); 96 if (!settings) 97 return obj; 98 99 // Get the setting name 100 PlaySettingsCombinedStorage *storage = 101 dynamic_cast<PlaySettingsCombinedStorage *>(obj); 102 const QString &name = storage->getName(); 103 104 // Get the default value and label. The label is different 105 // from the value for most object types. 106 QString defaultValue = settings->GetSetting(name, "", true); 107 QString defaultLabel(defaultValue); 108 if (dynamic_cast<BooleanSetting *>(obj)) 109 defaultLabel = (defaultValue == "0" || defaultValue.isEmpty() ? 110 QObject::tr("disabled") : QObject::tr("enabled")); 111 if (dynamic_cast<SpinBoxSetting *>(obj) && defaultValue.isEmpty()) 112 defaultLabel = "0"; 113 ComboBoxSetting *cb = dynamic_cast<ComboBoxSetting *>(obj); 114 if (cb) 115 { 116 defaultLabel = cb->GetValueLabel(defaultValue); 117 // Add the default selection to a ComboBox 118 cb->addSelection(QString("(") + QObject::tr("default") + ")", 119 storage->getDefault(), 120 !settings->IsOverridden(name), 121 true); 122 } 123 ImageSelectSetting *is = dynamic_cast<ImageSelectSetting *>(obj); 124 if (is) 125 { 126 defaultLabel = is->GetValueLabel(defaultValue); 127 // Add the default selection to a ImageSelect 128 is->addDefaultSelection(QString("(") + QObject::tr("default") + ")", 129 storage->getDefault(), 130 defaultValue, 131 !settings->IsOverridden(name)); 132 } 133 134 // Change the help text to include the default and its source. 135 QString helpPrefix; 136 if (dynamic_cast<LineEditSetting *>(obj)) 137 helpPrefix = QObject::tr("Leave blank to keep default value"); 138 else 139 helpPrefix = QObject::tr("Override default value"); 140 helpPrefix += " (" + defaultLabel + ") "; 141 QString inheritsFrom = settings->InheritsFrom(name); 142 if (inheritsFrom.isNull()) 143 helpPrefix += QObject::tr("from global settings"); 144 else 145 helpPrefix += QObject::tr("from group") + " " + inheritsFrom; 146 helpPrefix += ". " + obj->getHelpText(); 147 obj->setHelpText(helpPrefix); 148 149 // Change the label to include the default. 150 obj->setLabel(obj->getLabel() + (twoLineLabel ? "\n" : "") + 151 " (" + defaultLabel + ")"); 152 153 return obj; 154 } 155 156 static QString getDefault(Setting *obj) 157 { 158 PlaySettingsCombinedStorage *storage = 159 dynamic_cast<PlaySettingsCombinedStorage *>(obj); 160 if (storage) 161 return storage->getDefault(); 162 else 163 return ""; 164 } 165 166 static Setting *AudioOutputDevice(PlaySettings *settings) 167 { 168 CREATE_COMBOBOX1_SETTING(gc, "AudioOutputDevice", settings, true); 44 169 gc->setLabel(QObject::tr("Audio output device")); 45 170 46 171 #ifdef USING_ALSA … … 85 210 86 211 gc->addSelection("NULL", "NULL"); 87 212 88 return gc;213 return wrap(gc, settings); 89 214 } 90 215 91 static HostComboBox *MaxAudioChannels()216 static Setting *MaxAudioChannels(PlaySettings *settings) 92 217 { 93 HostComboBox *gc = new HostComboBox("MaxChannels",false);218 CREATE_COMBOBOX_SETTING(gc, "MaxChannels", settings); 94 219 gc->setLabel(QObject::tr("Speakers configuration")); 95 220 gc->addSelection(QObject::tr("Stereo"), "2", true); // default 96 221 gc->addSelection(QObject::tr("5.1"), "6"); 97 222 gc->setHelpText( 98 223 QObject::tr( 99 224 "Set your audio configuration: Stereo or Surround.")); 100 return gc;225 return wrap(gc, settings); 101 226 } 102 227 103 static HostCheckBox *AudioUpmix()228 static Setting *AudioUpmix(PlaySettings *settings) 104 229 { 105 HostCheckBox *gc = new HostCheckBox("AudioDefaultUpmix");230 CREATE_CHECKBOX_SETTING(gc, "AudioDefaultUpmix", settings); 106 231 gc->setLabel(QObject::tr("Upconvert stereo to 5.1 surround")); 107 232 gc->setValue(true); 108 233 gc->setHelpText(QObject::tr("MythTV can upconvert stereo to 5.1 audio. " 109 234 "Set this option to enable it by default. " 110 235 "You can enable or disable the upconversion during playback at anytime.")); 111 return gc;236 return wrap(gc, settings); 112 237 } 113 238 114 static HostComboBox *AudioUpmixType()239 static Setting *AudioUpmixType(PlaySettings *settings) 115 240 { 116 HostComboBox *gc = new HostComboBox("AudioUpmixType",false);241 CREATE_COMBOBOX_SETTING(gc, "AudioUpmixType", settings); 117 242 gc->setLabel(QObject::tr("Upmix")); 118 243 gc->addSelection(QObject::tr("Fastest"), "0", true); // default 119 244 gc->addSelection(QObject::tr("Good"), "1"); … … 122 247 QObject::tr( 123 248 "Set the audio surround upconversion quality. " 124 249 "'Fastest' is the least demanding on the CPU at the expense of quality.")); 125 return gc;250 return wrap(gc, settings); 126 251 } 127 252 128 static HostCheckBox *AdvancedAudioSettings()253 static Setting *AdvancedAudioSettings(PlaySettings *settings) 129 254 { 130 HostCheckBox *gc = new HostCheckBox("AdvancedAudioSettings");255 CREATE_CHECKBOX_SETTING(gc, "AdvancedAudioSettings", settings); 131 256 gc->setLabel(QObject::tr("Advanced Audio Configuration")); 132 257 gc->setValue(false); 133 258 gc->setHelpText(QObject::tr("Enable extra audio settings.")); 134 return gc;259 return wrap(gc, settings); 135 260 } 136 261 137 static HostCheckBox *SRCQualityOverride()262 static Setting *SRCQualityOverride(PlaySettings *settings) 138 263 { 139 HostCheckBox *gc = new HostCheckBox("SRCQualityOverride");264 CREATE_CHECKBOX_SETTING(gc, "SRCQualityOverride", settings); 140 265 gc->setLabel(QObject::tr("Override SRC quality")); 141 266 gc->setValue(false); 142 267 gc->setHelpText(QObject::tr("Override audio sample rate conversion quality")); 143 return gc;268 return wrap(gc, settings); 144 269 } 145 270 146 static HostComboBox *SRCQuality()271 static Setting *SRCQuality(PlaySettings *settings) 147 272 { 148 HostComboBox *gc = new HostComboBox("SRCQuality", false);273 CREATE_COMBOBOX_SETTING(gc, "SRCQuality", settings); 149 274 gc->setLabel(QObject::tr("Sample Rate Conversion")); 150 275 gc->addSelection(QObject::tr("Disabled"), "-1"); 151 276 gc->addSelection(QObject::tr("Fastest"), "0"); … … 155 280 "\"Good\" (default) provides the best compromise between CPU usage " 156 281 "and quality. \"Disabled\" let the audio card handle sample rate conversion. " 157 282 "This only affects non 48kHz PCM audio.")); 158 return gc;283 return wrap(gc, settings); 159 284 } 160 285 161 static HostComboBox *PassThroughOutputDevice()286 static Setting *PassThroughOutputDevice(PlaySettings *settings) 162 287 { 163 HostComboBox *gc = new HostComboBox("PassThruOutputDevice", true);288 CREATE_COMBOBOX1_SETTING(gc, "PassThruOutputDevice", settings, true); 164 289 165 290 gc->setLabel(QObject::tr("Digital output device")); 166 291 gc->addSelection(QObject::tr("Default"), "Default"); … … 178 303 gc->setHelpText(QObject::tr("Audio output device to use for digital audio. Default is the same as Audio output " 179 304 "device. This value is currently only used with ALSA " 180 305 "and DirectX sound output.")); 181 return gc;306 return wrap(gc, settings); 182 307 } 183 308 184 static HostCheckBox *MythControlsVolume()309 static Setting *MythControlsVolume(PlaySettings *settings) 185 310 { 186 HostCheckBox *gc = new HostCheckBox("MythControlsVolume");311 CREATE_CHECKBOX_SETTING(gc, "MythControlsVolume", settings); 187 312 gc->setLabel(QObject::tr("Use internal volume controls")); 188 313 gc->setValue(true); 189 314 gc->setHelpText(QObject::tr("MythTV can control the PCM and master " 190 315 "mixer volume. If you prefer to control the volume externally " 191 316 "(like your amplifier) or use an external mixer " 192 317 "program, disable this option.")); 193 return gc;318 return wrap(gc, settings); 194 319 } 195 320 196 static HostComboBox *MixerDevice()321 static Setting *MixerDevice(PlaySettings *settings) 197 322 { 198 HostComboBox *gc = new HostComboBox("MixerDevice", true);323 CREATE_COMBOBOX1_SETTING(gc, "MixerDevice", settings, true); 199 324 gc->setLabel(QObject::tr("Mixer Device")); 200 325 201 326 #ifdef USING_OSS … … 221 346 "the volume of all audio at the expense of a slight quality loss.")); 222 347 #endif 223 348 224 return gc;349 return wrap(gc, settings); 225 350 } 226 351 227 352 static const char* MixerControlControls[] = { "PCM", 228 353 "Master" }; 229 354 230 static HostComboBox *MixerControl()355 static Setting *MixerControl(PlaySettings *settings) 231 356 { 232 HostComboBox *gc = new HostComboBox("MixerControl", true);357 CREATE_COMBOBOX1_SETTING(gc, "MixerControl", settings, true); 233 358 gc->setLabel(QObject::tr("Mixer Controls")); 234 359 for (unsigned int i = 0; i < sizeof(MixerControlControls) / sizeof(char*); 235 360 ++i) … … 239 364 } 240 365 241 366 gc->setHelpText(QObject::tr("Changing the volume adjusts the selected mixer.")); 242 return gc;367 return wrap(gc, settings); 243 368 } 244 369 245 static HostSlider *MixerVolume()370 static Setting *MixerVolume(PlaySettings *settings) 246 371 { 247 HostSlider *gs = new HostSlider("MasterMixerVolume", 0, 100, 1);372 CREATE_SLIDER_SETTING(gs, "MasterMixerVolume", settings, 0, 100, 1); 248 373 gs->setLabel(QObject::tr("Master Mixer Volume")); 249 374 gs->setValue(70); 250 375 gs->setHelpText(QObject::tr("Initial volume for the Master Mixer. " 251 376 "This affects all sound created by the sound card. " 252 377 "Note: Do not set this too low.")); 253 return gs;378 return wrap(gs, settings); 254 379 } 255 380 256 static HostSlider *PCMVolume()381 static Setting *PCMVolume(PlaySettings *settings) 257 382 { 258 HostSlider *gs = new HostSlider("PCMMixerVolume", 0, 100, 1);383 CREATE_SLIDER_SETTING(gs, "PCMMixerVolume", settings, 0, 100, 1); 259 384 gs->setLabel(QObject::tr("PCM Mixer Volume")); 260 385 gs->setValue(70); 261 386 gs->setHelpText(QObject::tr("Initial volume for PCM output. Using the " … … 263 388 return gs; 264 389 } 265 390 266 static HostCheckBox *IndividualMuteControl()391 static Setting *IndividualMuteControl(PlaySettings *settings) 267 392 { 268 HostCheckBox *gc = new HostCheckBox("IndividualMuteControl");393 CREATE_CHECKBOX_SETTING(gc, "IndividualMuteControl", settings); 269 394 gc->setLabel(QObject::tr("Independent Muting of Left and Right Audio " 270 395 "Channels")); 271 396 gc->setValue(false); … … 274 399 "original language on one channel, and a dubbed " 275 400 "version of the program on the other one. This " 276 401 "modifies the behavior of the Mute key.")); 277 return gc;402 return wrap(gc, settings); 278 403 } 279 404 280 static HostCheckBox *AC3PassThrough()405 static Setting *AC3PassThrough(PlaySettings *settings) 281 406 { 282 HostCheckBox *gc = new HostCheckBox("AC3PassThru");407 CREATE_CHECKBOX_SETTING(gc, "AC3PassThru", settings); 283 408 gc->setLabel(QObject::tr("Dolby Digital")); 284 409 gc->setValue(false); 285 410 gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder supports AC3/Dolby Digital. " 286 411 "You must use a digital connection. Uncheck if using an analog connection.")); 287 return gc;412 return wrap(gc, settings); 288 413 } 289 414 290 static HostCheckBox *DTSPassThrough()415 static Setting *DTSPassThrough(PlaySettings *settings) 291 416 { 292 HostCheckBox *gc = new HostCheckBox("DTSPassThru");417 CREATE_CHECKBOX_SETTING(gc, "DTSPassThru", settings); 293 418 gc->setLabel(QObject::tr("DTS")); 294 419 gc->setValue(false); 295 420 gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder supports DTS. " 296 421 "You must use a digital connection. Uncheck if using an analog connection")); 297 return gc;422 return wrap(gc, settings); 298 423 } 299 424 300 static HostCheckBox *AggressiveBuffer()425 static Setting *AggressiveBuffer(PlaySettings *settings) 301 426 { 302 HostCheckBox *gc = new HostCheckBox("AggressiveSoundcardBuffer");427 CREATE_CHECKBOX_SETTING(gc, "AggressiveSoundcardBuffer", settings); 303 428 gc->setLabel(QObject::tr("Aggressive Sound card Buffering")); 304 429 gc->setValue(false); 305 430 gc->setHelpText(QObject::tr("If enabled, MythTV will pretend to have " … … 309 434 return gc; 310 435 } 311 436 312 static HostCheckBox *DecodeExtraAudio()437 static Setting *DecodeExtraAudio(PlaySettings *settings) 313 438 { 314 HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");439 CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings); 315 440 gc->setLabel(QObject::tr("Extra audio buffering")); 316 441 gc->setValue(true); 317 442 gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing " … … 320 445 "effect on framegrabbers (MPEG-4/RTJPEG). MythTV will " 321 446 "keep extra audio data in its internal buffers to workaround " 322 447 "this bug.")); 323 return gc;448 return wrap(gc, settings); 324 449 } 325 450 326 static HostComboBox *PIPLocationComboBox()451 static Setting *PIPLocationComboBox(PlaySettings *settings) 327 452 { 328 HostComboBox *gc = new HostComboBox("PIPLocation");453 CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings); 329 454 gc->setLabel(QObject::tr("PIP Video Location")); 330 455 for (uint loc = 0; loc < kPIP_END; ++loc) 331 456 gc->addSelection(toString((PIPLocation) loc), QString::number(loc)); 332 457 gc->setHelpText(QObject::tr("Location of PIP Video window.")); 333 return gc;458 return wrap(gc, settings); 334 459 } 335 460 336 461 static GlobalLineEdit *AllRecGroupPassword() … … 427 552 return gc; 428 553 } 429 554 430 static HostCheckBox *SmartForward()555 static Setting *SmartForward(PlaySettings *settings) 431 556 { 432 HostCheckBox *gc = new HostCheckBox("SmartForward");557 CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings); 433 558 gc->setLabel(QObject::tr("Smart Fast Forwarding")); 434 559 gc->setValue(false); 435 560 gc->setHelpText(QObject::tr("If enabled, then immediately after " 436 561 "rewinding, only skip forward the same amount as " 437 562 "skipping backwards.")); 438 return gc;563 return wrap(gc, settings); 439 564 } 440 565 441 static HostCheckBox *ExactSeeking()566 static Setting *ExactSeeking(PlaySettings *settings) 442 567 { 443 HostCheckBox *gc = new HostCheckBox("ExactSeeking");568 CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings); 444 569 gc->setLabel(QObject::tr("Seek to exact frame")); 445 570 gc->setValue(false); 446 571 gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but " 447 572 "slower.")); 448 return gc;573 return wrap(gc, settings); 449 574 } 450 575 451 576 static GlobalComboBox *CommercialSkipMethod() … … 463 588 return bc; 464 589 } 465 590 466 static HostComboBox *AutoCommercialSkip()591 static Setting *AutoCommercialSkip(PlaySettings *settings) 467 592 { 468 HostComboBox *gc = new HostComboBox("AutoCommercialSkip");593 CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings); 469 594 gc->setLabel(QObject::tr("Automatically Skip Commercials")); 470 595 gc->addSelection(QObject::tr("Off"), "0"); 471 596 gc->addSelection(QObject::tr("Notify, but do not skip"), "2"); … … 474 599 "have been flagged during Automatic Commercial Flagging " 475 600 "or by the mythcommflag program, or just notify that a " 476 601 "commercial has been detected.")); 477 return gc;602 return wrap(gc, settings); 478 603 } 479 604 480 605 static GlobalCheckBox *AutoCommercialFlag() … … 559 684 return bc; 560 685 } 561 686 562 static HostSpinBox *CommRewindAmount()687 static Setting *CommRewindAmount(PlaySettings *settings) 563 688 { 564 HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);689 CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false); 565 690 gs->setLabel(QObject::tr("Commercial Skip Auto-Rewind Amount")); 566 691 gs->setHelpText(QObject::tr("If set, MythTV will automatically rewind " 567 692 "this many seconds after performing a commercial skip.")); 568 693 gs->setValue(0); 569 return gs;694 return wrap(gs, settings); 570 695 } 571 696 572 static HostSpinBox *CommNotifyAmount()697 static Setting *CommNotifyAmount(PlaySettings *settings) 573 698 { 574 HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);699 CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false); 575 700 gs->setLabel(QObject::tr("Commercial Skip Notify Amount")); 576 701 gs->setHelpText(QObject::tr("If set, MythTV will act like a commercial " 577 702 "begins this many seconds early. This can be useful " 578 703 "when commercial notification is used in place of " 579 704 "automatic skipping.")); 580 705 gs->setValue(0); 581 return gs;706 return wrap(gs, settings); 582 707 } 583 708 584 709 static GlobalSpinBox *MaximumCommercialSkip() … … 1368 1493 labels[j]->setValue(label_i); 1369 1494 } 1370 1495 1371 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) : 1496 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str, 1497 PlaySettings *settings) : 1372 1498 TriggeredConfigurationGroup(false, true, true, true, 1373 1499 false, false, true, true), grouptrigger(NULL) 1374 1500 { 1375 1501 setLabel(QObject::tr("Playback Profiles") + str); 1502 if (settings) 1503 setLabel(QObject::tr("Playback group settings for ") + 1504 settings->mGroupName + " - " + 1505 getLabel()); 1376 1506 1377 1507 QString host = gContext->GetHostName(); 1378 1508 QStringList profiles = VideoDisplayProfile::GetProfiles(host); … … 1400 1530 profiles = VideoDisplayProfile::GetProfiles(host); 1401 1531 } 1402 1532 1403 QString profile = VideoDisplayProfile::GetDefaultProfileName(host );1533 QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings); 1404 1534 if (!profiles.contains(profile)) 1405 1535 { 1406 1536 profile = (profiles.contains("Normal")) ? "Normal" : profiles[0]; 1407 1537 VideoDisplayProfile::SetDefaultProfileName(profile, host); 1408 1538 } 1409 1539 1410 grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile"); 1540 CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings); 1541 grouptrigger = gs; 1411 1542 grouptrigger->setLabel(QObject::tr("Current Video Playback Profile")); 1412 1543 QStringList::const_iterator it; 1413 1544 for (it = profiles.begin(); it != profiles.end(); ++it) 1414 1545 grouptrigger->addSelection(ProgramInfo::i18n(*it), *it); 1546 if (settings) 1547 { 1548 addChild(wrap(grouptrigger, settings)); 1549 return; 1550 } 1415 1551 1416 1552 HorizontalConfigurationGroup *grp = 1417 1553 new HorizontalConfigurationGroup(false, false, true, true); … … 1544 1680 return gc; 1545 1681 } 1546 1682 1547 static HostSpinBox *FFRewReposTime()1683 static Setting *FFRewReposTime(PlaySettings *settings) 1548 1684 { 1549 HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);1685 CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false); 1550 1686 gs->setLabel(QObject::tr("Fast forward/rewind reposition amount")); 1551 1687 gs->setValue(100); 1552 1688 gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind " … … 1554 1690 "resuming normal playback. This " 1555 1691 "compensates for the reaction time between seeing " 1556 1692 "where to resume playback and actually exiting seeking.")); 1557 return gs;1693 return wrap(gs, settings); 1558 1694 } 1559 1695 1560 static HostCheckBox *FFRewReverse()1696 static Setting *FFRewReverse(PlaySettings *settings) 1561 1697 { 1562 HostCheckBox *gc = new HostCheckBox("FFRewReverse");1698 CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings); 1563 1699 gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind")); 1564 1700 gc->setValue(true); 1565 1701 gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key " … … 1567 1703 "vice versa. If disabled, it will decrease the " 1568 1704 "current speed or switch to play mode if " 1569 1705 "the speed can't be decreased further.")); 1570 return gc;1706 return wrap(gc, settings); 1571 1707 } 1572 1708 1573 static HostSpinBox *OSDGeneralTimeout()1709 static Setting *OSDGeneralTimeout(PlaySettings *settings) 1574 1710 { 1575 HostSpinBox *gs = new HostSpinBox("OSDGeneralTimeout", 1, 30, 1);1711 CREATE_SPINBOX_SETTING(gs, "OSDGeneralTimeout", settings, 1, 30, 1, false); 1576 1712 gs->setLabel(QObject::tr("General OSD time-out (sec)")); 1577 1713 gs->setValue(2); 1578 1714 gs->setHelpText(QObject::tr("Length of time an on-screen display " 1579 1715 "window will be visible.")); 1580 return gs;1716 return wrap(gs, settings); 1581 1717 } 1582 1718 1583 static HostSpinBox *OSDProgramInfoTimeout()1719 static Setting *OSDProgramInfoTimeout(PlaySettings *settings) 1584 1720 { 1585 HostSpinBox *gs = new HostSpinBox("OSDProgramInfoTimeout", 1, 30, 1); 1721 CREATE_SPINBOX_SETTING(gs, "OSDProgramInfoTimeout", settings, 1722 1, 30, 1, false); 1586 1723 gs->setLabel(QObject::tr("Program Info OSD time-out")); 1587 1724 gs->setValue(3); 1588 1725 gs->setHelpText(QObject::tr("Length of time the on-screen display " 1589 1726 "will display program information.")); 1590 return gs;1727 return wrap(gs, settings); 1591 1728 } 1592 1729 1593 static HostSpinBox *OSDNotifyTimeout()1730 static Setting *OSDNotifyTimeout(PlaySettings *settings) 1594 1731 { 1595 HostSpinBox *gs = new HostSpinBox("OSDNotifyTimeout", 1, 30, 1);1732 CREATE_SPINBOX_SETTING(gs, "OSDNotifyTimeout", settings, 1, 30, 1, false); 1596 1733 gs->setLabel(QObject::tr("UDP Notify OSD time-out")); 1597 1734 gs->setValue(5); 1598 1735 gs->setHelpText(QObject::tr("How many seconds an on-screen display " 1599 1736 "will be active for UDP Notify events.")); 1600 return gs;1737 return wrap(gs, settings); 1601 1738 } 1602 1739 1603 1740 static HostSpinBox *ThemeCacheSize() … … 1641 1778 return gc; 1642 1779 } 1643 1780 1644 static HostComboBox *OSDFont()1781 static Setting *OSDFont(PlaySettings *settings) 1645 1782 { 1646 HostComboBox *gc = new HostComboBox("OSDFont");1783 CREATE_COMBOBOX_SETTING(gc, "OSDFont", settings); 1647 1784 gc->setLabel(QObject::tr("OSD font")); 1648 1785 QDir ttf(GetFontsDir(), GetFontsNameFilter()); 1649 1786 gc->fillSelectionsFromDir(ttf, false); … … 1651 1788 if (gc->findSelection(defaultOSDFont) > -1) 1652 1789 gc->setValue(defaultOSDFont); 1653 1790 1654 return gc;1791 return wrap(gc, settings); 1655 1792 } 1656 1793 1657 static HostComboBox *OSDCCFont()1794 static Setting *OSDCCFont(PlaySettings *settings) 1658 1795 { 1659 HostComboBox *gc = new HostComboBox("OSDCCFont");1796 CREATE_COMBOBOX_SETTING(gc, "OSDCCFont", settings); 1660 1797 gc->setLabel(QObject::tr("CC font")); 1661 1798 QDir ttf(GetFontsDir(), GetFontsNameFilter()); 1662 1799 gc->fillSelectionsFromDir(ttf, false); 1663 1800 gc->setHelpText(QObject::tr("Closed Caption font")); 1664 1801 1665 return gc;1802 return wrap(gc, settings); 1666 1803 } 1667 1804 1668 1805 static HostComboBox __attribute__ ((unused)) *DecodeVBIFormat() … … 1683 1820 return gc; 1684 1821 } 1685 1822 1686 static HostSpinBox *OSDCC708TextZoomPercentage(void)1823 static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings) 1687 1824 { 1688 HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5); 1825 CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings, 1826 50, 200, 5, false); 1689 1827 gs->setLabel(QObject::tr("Text zoom percentage")); 1690 1828 gs->setValue(100); 1691 1829 gs->setHelpText(QObject::tr("Use this to enlarge or shrink captions.")); 1692 1830 1693 return gs;1831 return wrap(gs, settings); 1694 1832 } 1695 1833 1696 static HostComboBox *OSDCC708DefaultFontType(void)1834 static Setting *OSDCC708DefaultFontType(PlaySettings *settings) 1697 1835 { 1698 HostComboBox *hc = new HostComboBox("OSDCC708DefaultFontType");1836 CREATE_COMBOBOX_SETTING(hc, "OSDCC708DefaultFontType", settings); 1699 1837 hc->setLabel(QObject::tr("Default Caption Font Type")); 1700 1838 hc->setHelpText( 1701 1839 QObject::tr("This allows you to set which font type to use " … … 1718 1856 }; 1719 1857 for (uint i = 0; i < 7; ++i) 1720 1858 hc->addSelection(typeNames[i], types[i]); 1721 return hc;1859 return wrap(hc, settings); 1722 1860 } 1723 1861 1724 static VerticalConfigurationGroup *OSDCC708Settings( void)1862 static VerticalConfigurationGroup *OSDCC708Settings(PlaySettings *settings) 1725 1863 { 1726 1864 VerticalConfigurationGroup *grp = 1727 1865 new VerticalConfigurationGroup(false, true, true, true); 1728 1866 grp->setLabel(QObject::tr("ATSC Caption Settings")); 1867 if (settings) 1868 grp->setLabel(QObject::tr("Playback group settings for ") + 1869 settings->mGroupName + " - " + 1870 grp->getLabel()); 1729 1871 1730 1872 // default text zoom 1.0 1731 grp->addChild(OSDCC708TextZoomPercentage( ));1873 grp->addChild(OSDCC708TextZoomPercentage(settings)); 1732 1874 1733 1875 // force X lines of captions 1734 1876 // force caption character color … … 1737 1879 // force background opacity 1738 1880 1739 1881 // set default font type 1740 grp->addChild(OSDCC708DefaultFontType( ));1882 grp->addChild(OSDCC708DefaultFontType(settings)); 1741 1883 1742 1884 return grp; 1743 1885 } 1744 1886 1745 static HostComboBox*OSDCC708Font(1887 static Setting *OSDCC708Font( 1746 1888 const QString &subtype, const QString &subtypeName, 1747 const QString &subtypeNameForHelp )1889 const QString &subtypeNameForHelp, PlaySettings *settings) 1748 1890 { 1749 HostComboBox *gc = new HostComboBox(1750 QString("OSDCC708%1Font").arg(subtype));1891 CREATE_COMBOBOX_SETTING(gc, QString("OSDCC708%1Font").arg(subtype), 1892 settings); 1751 1893 1752 1894 gc->setLabel(subtypeName); 1753 1895 QDir ttf(GetFontsDir(), GetFontsNameFilter()); … … 1755 1897 gc->setHelpText( 1756 1898 QObject::tr("ATSC %1 closed caption font.").arg(subtypeNameForHelp)); 1757 1899 1758 return gc;1900 return wrap(gc, settings, (subtypeName.length() > 10)); 1759 1901 } 1760 1902 1761 static HorizontalConfigurationGroup *OSDCC708Fonts( void)1903 static HorizontalConfigurationGroup *OSDCC708Fonts(PlaySettings *settings) 1762 1904 { 1763 1905 HorizontalConfigurationGroup *grpmain = 1764 1906 new HorizontalConfigurationGroup(false, true, true, true); 1765 1907 grpmain->setLabel(QObject::tr("ATSC Caption Fonts")); 1908 if (settings) 1909 grpmain->setLabel(QObject::tr("Playback group settings for ") + 1910 settings->mGroupName + " - " + 1911 grpmain->getLabel()); 1766 1912 VerticalConfigurationGroup *col[] = 1767 1913 { 1768 1914 new VerticalConfigurationGroup(false, false, true, true), … … 1798 1944 for (uint j = 0; j < 7; ++j) 1799 1945 { 1800 1946 col[i]->addChild(OSDCC708Font(subtypes[i].arg(types[j]), 1801 typeNames[j], typeNames[j])); 1947 typeNames[j], typeNames[j], 1948 settings)); 1802 1949 } 1803 1950 grpmain->addChild(col[i]); 1804 1951 1805 1952 i = 1; 1806 1953 for (uint j = 0; j < 7; ++j) 1807 1954 { 1808 col[i]->addChild(OSDCC708Font( 1809 subtypes[i].arg(types[j]), "", 1810 QObject::tr("Italic") + ' ' + typeNames[j])); 1955 col[i]->addChild(OSDCC708Font(subtypes[i].arg(types[j]), 1956 (settings ? typeNames[j] : ""), 1957 QObject::tr("Italic") + ' ' + typeNames[j], 1958 settings)); 1811 1959 } 1812 1960 1813 1961 grpmain->addChild(col[i]); … … 1815 1963 return grpmain; 1816 1964 } 1817 1965 1818 static HostComboBox *SubtitleCodec()1966 static Setting *SubtitleCodec(PlaySettings *settings) 1819 1967 { 1820 HostComboBox *gc = new HostComboBox("SubtitleCodec");1968 CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings); 1821 1969 1822 1970 gc->setLabel(QObject::tr("Subtitle Codec")); 1823 1971 QList<QByteArray> list = QTextCodec::availableCodecs(); … … 1827 1975 gc->addSelection(val, val, val.toLower() == "utf-8"); 1828 1976 } 1829 1977 1830 return gc;1978 return wrap(gc, settings); 1831 1979 } 1832 1980 1833 static HorizontalConfigurationGroup *ExternalSubtitleSettings( )1981 static HorizontalConfigurationGroup *ExternalSubtitleSettings(PlaySettings *settings) 1834 1982 { 1835 1983 HorizontalConfigurationGroup *grpmain = 1836 1984 new HorizontalConfigurationGroup(false, true, true, true); 1837 1985 1838 1986 grpmain->setLabel(QObject::tr("External Subtitle Settings")); 1839 1987 1840 grpmain->addChild(SubtitleCodec( ));1988 grpmain->addChild(SubtitleCodec(settings)); 1841 1989 1842 1990 return grpmain; 1843 1991 } 1844 1992 1845 static HostComboBox *OSDThemeFontSizeType()1993 static Setting *OSDThemeFontSizeType(PlaySettings *settings) 1846 1994 { 1847 HostComboBox *gc = new HostComboBox("OSDThemeFontSizeType");1995 CREATE_COMBOBOX_SETTING(gc, "OSDThemeFontSizeType", settings); 1848 1996 gc->setLabel(QObject::tr("Font size")); 1849 1997 gc->addSelection(QObject::tr("default"), "default"); 1850 1998 gc->addSelection(QObject::tr("small"), "small"); 1851 1999 gc->addSelection(QObject::tr("big"), "big"); 1852 2000 gc->setHelpText(QObject::tr("default: TV, small: monitor, big:")); 1853 return gc;2001 return wrap(gc, settings); 1854 2002 } 1855 2003 1856 2004 static HostComboBox *ChannelOrdering() … … 1862 2010 return gc; 1863 2011 } 1864 2012 1865 static HostSpinBox *VertScanPercentage()2013 static Setting *VertScanPercentage(PlaySettings *settings) 1866 2014 { 1867 HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1); 2015 CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings, 2016 -100, 100, 1, false); 1868 2017 gs->setLabel(QObject::tr("Vertical scaling")); 1869 2018 gs->setValue(0); 1870 2019 gs->setHelpText(QObject::tr( 1871 2020 "Adjust this if the image does not fill your " 1872 2021 "screen vertically. Range -100% to 100%")); 1873 return gs;2022 return wrap(gs, settings); 1874 2023 } 1875 2024 1876 static HostSpinBox *HorizScanPercentage()2025 static Setting *HorizScanPercentage(PlaySettings *settings) 1877 2026 { 1878 HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1); 2027 CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings, 2028 -100, 100, 1, false); 1879 2029 gs->setLabel(QObject::tr("Horizontal scaling")); 1880 2030 gs->setValue(0); 1881 2031 gs->setHelpText(QObject::tr( 1882 2032 "Adjust this if the image does not fill your " 1883 2033 "screen horizontally. Range -100% to 100%")); 1884 return gs;2034 return wrap(gs, settings); 1885 2035 }; 1886 2036 1887 static HostSpinBox *XScanDisplacement()2037 static Setting *XScanDisplacement(PlaySettings *settings) 1888 2038 { 1889 HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1); 2039 CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings, 2040 -50, 50, 1, false); 1890 2041 gs->setLabel(QObject::tr("Scan displacement (X)")); 1891 2042 gs->setValue(0); 1892 2043 gs->setHelpText(QObject::tr("Adjust this to move the image horizontally.")); 1893 return gs;2044 return wrap(gs, settings); 1894 2045 } 1895 2046 1896 static HostSpinBox *YScanDisplacement()2047 static Setting *YScanDisplacement(PlaySettings *settings) 1897 2048 { 1898 HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1); 2049 CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings, 2050 -50, 50, 1, false); 1899 2051 gs->setLabel(QObject::tr("Scan displacement (Y)")); 1900 2052 gs->setValue(0); 1901 2053 gs->setHelpText(QObject::tr("Adjust this to move the image vertically.")); 1902 return gs;2054 return wrap(gs, settings); 1903 2055 }; 1904 2056 1905 2057 static HostCheckBox *AlwaysStreamFiles() … … 1915 2067 return gc; 1916 2068 } 1917 2069 1918 static HostCheckBox *UseVideoTimebase()2070 static Setting *UseVideoTimebase(PlaySettings *settings) 1919 2071 { 1920 HostCheckBox *gc = new HostCheckBox("UseVideoTimebase");2072 CREATE_CHECKBOX_SETTING(gc, "UseVideoTimebase", settings); 1921 2073 gc->setLabel(QObject::tr("Use video as timebase")); 1922 2074 gc->setValue(false); 1923 2075 gc->setHelpText(QObject::tr("Use the video as the timebase and warp " 1924 2076 "the audio to keep it in sync. (Experimental)")); 1925 return gc;2077 return wrap(gc, settings); 1926 2078 } 1927 2079 1928 static HostCheckBox *CCBackground()2080 static Setting *CCBackground(PlaySettings *settings) 1929 2081 { 1930 HostCheckBox *gc = new HostCheckBox("CCBackground");2082 CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings); 1931 2083 gc->setLabel(QObject::tr("Black background for closed captioning")); 1932 2084 gc->setValue(false); 1933 2085 gc->setHelpText(QObject::tr( 1934 2086 "If enabled, captions will be displayed " 1935 2087 "as white text over a black background " 1936 2088 "for better contrast.")); 1937 return gc;2089 return wrap(gc, settings); 1938 2090 } 1939 2091 1940 static HostCheckBox *DefaultCCMode()2092 static Setting *DefaultCCMode(PlaySettings *settings) 1941 2093 { 1942 HostCheckBox *gc = new HostCheckBox("DefaultCCMode");2094 CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings); 1943 2095 gc->setLabel(QObject::tr("Always display closed captioning or subtitles")); 1944 2096 gc->setValue(false); 1945 2097 gc->setHelpText(QObject::tr( … … 1947 2099 "when playing back recordings or watching " 1948 2100 "live TV. Closed Captioning can be turned on or off " 1949 2101 "by pressing \"T\" during playback.")); 1950 return gc;2102 return wrap(gc, settings); 1951 2103 } 1952 2104 1953 static HostCheckBox *PreferCC708()2105 static Setting *PreferCC708(PlaySettings *settings) 1954 2106 { 1955 HostCheckBox *gc = new HostCheckBox("Prefer708Captions");2107 CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings); 1956 2108 gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions")); 1957 2109 gc->setValue(true); 1958 2110 gc->setHelpText( … … 1960 2112 "When enabled the new EIA-708 captions will be preferred over " 1961 2113 "the old EIA-608 captions in ATSC streams.")); 1962 2114 1963 return gc;2115 return wrap(gc, settings); 1964 2116 } 1965 2117 1966 static HostCheckBox *EnableMHEG()2118 static Setting *EnableMHEG(PlaySettings *settings) 1967 2119 { 1968 HostCheckBox *gc = new HostCheckBox("EnableMHEG");2120 CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings); 1969 2121 gc->setLabel(QObject::tr("Enable Interactive TV")); 1970 2122 gc->setValue(false); 1971 2123 gc->setHelpText(QObject::tr( 1972 2124 "If enabled, interactive TV applications (MHEG) will " 1973 2125 "be activated. This is used for teletext and logos for " 1974 2126 "radio and channels that are currently off-air.")); 1975 return gc;2127 return wrap(gc, settings); 1976 2128 } 1977 2129 1978 static HostCheckBox *PersistentBrowseMode()2130 static Setting *PersistentBrowseMode(PlaySettings *settings) 1979 2131 { 1980 HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");2132 CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings); 1981 2133 gc->setLabel(QObject::tr("Always use Browse mode in LiveTV")); 1982 2134 gc->setValue(true); 1983 2135 gc->setHelpText( 1984 2136 QObject::tr( 1985 2137 "If enabled, Browse mode will automatically be activated " 1986 2138 "whenever you use Channel UP/DOWN while watching Live TV.")); 1987 return gc;2139 return wrap(gc, settings); 1988 2140 } 1989 2141 1990 static HostCheckBox *BrowseAllTuners()2142 static Setting *BrowseAllTuners(PlaySettings *settings) 1991 2143 { 1992 HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");2144 CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings); 1993 2145 gc->setLabel(QObject::tr("Browse all channels")); 1994 2146 gc->setValue(false); 1995 2147 gc->setHelpText( … … 1997 2149 "If enabled, browse mode will shows channels on all " 1998 2150 "available recording devices, instead of showing " 1999 2151 "channels on just the current recorder.")); 2000 return gc;2152 return wrap(gc, settings); 2001 2153 } 2002 2154 2003 static HostCheckBox *ClearSavedPosition()2155 static Setting *ClearSavedPosition(PlaySettings *settings) 2004 2156 { 2005 HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");2157 CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings); 2006 2158 gc->setLabel(QObject::tr("Clear bookmark on playback")); 2007 2159 gc->setValue(true); 2008 2160 gc->setHelpText(QObject::tr("Automatically clear the bookmark on a " 2009 2161 "recording when the recording is played back. If " 2010 2162 "disabled, you can mark the beginning with rewind " 2011 2163 "then save position.")); 2012 return gc;2164 return wrap(gc, settings); 2013 2165 } 2014 2166 2015 static HostCheckBox *AltClearSavedPosition()2167 static Setting *AltClearSavedPosition(PlaySettings *settings) 2016 2168 { 2017 HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");2169 CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings); 2018 2170 gc->setLabel(QObject::tr("Alternate clear and save bookmark")); 2019 2171 gc->setValue(true); 2020 2172 gc->setHelpText(QObject::tr("During playback the Select key " … … 2022 2174 "Saved\" and \"Bookmark Cleared\". If disabled, the " 2023 2175 "Select key will save the current position for each " 2024 2176 "keypress.")); 2025 return gc;2177 return wrap(gc, settings); 2026 2178 } 2027 2179 2028 2180 #if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU) 2029 static HostCheckBox *UsePicControls()2181 static Setting *UsePicControls(PlaySettings *settings) 2030 2182 { 2031 HostCheckBox *gc = new HostCheckBox("UseOutputPictureControls");2183 CREATE_CHECKBOX_SETTING(gc, "UseOutputPictureControls", settings); 2032 2184 gc->setLabel(QObject::tr("Enable picture controls")); 2033 2185 gc->setValue(false); 2034 2186 gc->setHelpText( 2035 2187 QObject::tr( 2036 2188 "If enabled, MythTV attempts to initialize picture controls " 2037 2189 "(brightness, contrast, etc.) that are applied during playback.")); 2038 return gc;2190 return wrap(gc, settings); 2039 2191 } 2040 2192 #endif 2041 2193 2042 static HostLineEdit *UDPNotifyPort()2194 static Setting *UDPNotifyPort(PlaySettings *settings) 2043 2195 { 2044 HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");2196 CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings); 2045 2197 ge->setLabel(QObject::tr("UDP Notify Port")); 2046 2198 ge->setValue("6948"); 2047 2199 ge->setHelpText(QObject::tr("During playback, MythTV will listen for " 2048 2200 "connections from the \"mythtvosd\" or \"mythudprelay\" " 2049 2201 "programs on this port. See the README in " 2050 2202 "contrib/mythnotify/ for additional information.")); 2051 return ge;2203 return wrap(ge, settings); 2052 2204 } 2053 2205 2054 static HostComboBox *PlaybackExitPrompt()2206 static Setting *PlaybackExitPrompt(PlaySettings *settings) 2055 2207 { 2056 HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");2208 CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings); 2057 2209 gc->setLabel(QObject::tr("Action on playback exit")); 2058 2210 gc->addSelection(QObject::tr("Just exit"), "0"); 2059 2211 gc->addSelection(QObject::tr("Save position and exit"), "2"); … … 2064 2216 "when you exit playback mode. The options available will " 2065 2217 "allow you to save your position, delete the " 2066 2218 "recording, or continue watching.")); 2067 return gc;2219 return wrap(gc, settings); 2068 2220 } 2069 2221 2070 static HostCheckBox *EndOfRecordingExitPrompt()2222 static Setting *EndOfRecordingExitPrompt(PlaySettings *settings) 2071 2223 { 2072 HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");2224 CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings); 2073 2225 gc->setLabel(QObject::tr("Prompt at end of recording")); 2074 2226 gc->setValue(false); 2075 2227 gc->setHelpText(QObject::tr("If set, a menu will be displayed allowing " 2076 2228 "you to delete the recording when it has finished " 2077 2229 "playing.")); 2078 return gc;2230 return wrap(gc, settings); 2079 2231 } 2080 2232 2081 static HostCheckBox *JumpToProgramOSD()2233 static Setting *JumpToProgramOSD(PlaySettings *settings) 2082 2234 { 2083 HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");2235 CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings); 2084 2236 gc->setLabel(QObject::tr("Jump to Program OSD")); 2085 2237 gc->setValue(true); 2086 2238 gc->setHelpText(QObject::tr( … … 2089 2241 "'Watch Recording' screen when 'Jump to Program' " 2090 2242 "is activated. If set, the recordings are shown " 2091 2243 "in the OSD")); 2092 return gc;2244 return wrap(gc, settings); 2093 2245 } 2094 2246 2095 static HostCheckBox *ContinueEmbeddedTVPlay()2247 static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings) 2096 2248 { 2097 HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");2249 CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings); 2098 2250 gc->setLabel(QObject::tr("Continue Playback When Embedded")); 2099 2251 gc->setValue(false); 2100 2252 gc->setHelpText(QObject::tr( … … 2102 2254 "is embedded in the upcoming program list or recorded " 2103 2255 "list. The default is to pause the recorded show when " 2104 2256 "embedded.")); 2105 return gc;2257 return wrap(gc, settings); 2106 2258 } 2107 2259 2108 static HostCheckBox *AutomaticSetWatched()2260 static Setting *AutomaticSetWatched(PlaySettings *settings) 2109 2261 { 2110 HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");2262 CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings); 2111 2263 gc->setLabel(QObject::tr("Automatically mark a recording as watched")); 2112 2264 gc->setValue(false); 2113 2265 gc->setHelpText(QObject::tr("If set, when you exit near the end of a " … … 2115 2267 "detection is not foolproof, so do not enable this " 2116 2268 "setting if you don't want an unwatched recording marked " 2117 2269 "as watched.")); 2118 return gc;2270 return wrap(gc, settings); 2119 2271 } 2120 2272 2121 2273 static HostSpinBox *LiveTVIdleTimeout() … … 2380 2532 return gc; 2381 2533 } 2382 2534 2383 static HostComboBox *LetterboxingColour()2535 static Setting *LetterboxingColour(PlaySettings *settings) 2384 2536 { 2385 HostComboBox *gc = new HostComboBox("LetterboxColour");2537 CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings); 2386 2538 gc->setLabel(QObject::tr("Letterboxing Color")); 2387 2539 for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m) 2388 2540 gc->addSelection(toString((LetterBoxColour)m), QString::number(m)); … … 2392 2544 "letterboxing, but those with plasma screens may prefer gray " 2393 2545 "to minimize burn-in.") + " " + 2394 2546 QObject::tr("Currently only works with XVideo video renderer.")); 2395 return gc;2547 return wrap(gc, settings); 2396 2548 } 2397 2549 2398 static HostComboBox *AspectOverride()2550 static Setting *AspectOverride(PlaySettings *settings) 2399 2551 { 2400 HostComboBox *gc = new HostComboBox("AspectOverride");2552 CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings); 2401 2553 gc->setLabel(QObject::tr("Video Aspect Override")); 2402 2554 for (int m = kAspect_Off; m < kAspect_END; ++m) 2403 2555 gc->addSelection(toString((AspectOverrideMode)m), QString::number(m)); … … 2405 2557 "When enabled, these will override the aspect " 2406 2558 "ratio specified by any broadcaster for all " 2407 2559 "video streams.")); 2408 return gc;2560 return wrap(gc, settings); 2409 2561 } 2410 2562 2411 static HostComboBox *AdjustFill()2563 static Setting *AdjustFill(PlaySettings *settings) 2412 2564 { 2413 HostComboBox *gc = new HostComboBox("AdjustFill");2565 CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings); 2414 2566 gc->setLabel(QObject::tr("Zoom")); 2415 2567 gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff), 2416 2568 QString::number(kAdjustFill_AutoDetect_DefaultOff)); … … 2421 2573 gc->setHelpText(QObject::tr( 2422 2574 "When enabled, these will apply a predefined " 2423 2575 "zoom to all video playback in MythTV.")); 2424 return gc;2576 return wrap(gc, settings); 2425 2577 } 2426 2578 2427 2579 // Theme settings … … 2840 2992 return gc; 2841 2993 } 2842 2994 2843 ThemeSelector::ThemeSelector(QString label): 2844 HostImageSelect(label){2845 2995 static Setting *ThemeSelector(QString label, PlaySettings *settings=NULL) 2996 { 2997 CREATE_IMAGESELECT_SETTING(gs, label, settings); 2846 2998 ThemeType themetype = THEME_UI; 2847 2999 2848 3000 if (label == "Theme") 2849 3001 { 2850 3002 themetype = THEME_UI; 2851 setLabel(QObject::tr("UI Theme"));3003 gs->setLabel(QObject::tr("UI Theme")); 2852 3004 } 2853 3005 else if (label == "OSDTheme") 2854 3006 { 2855 3007 themetype = THEME_OSD; 2856 setLabel(QObject::tr("OSD Theme"));3008 gs->setLabel(QObject::tr("OSD Theme")); 2857 3009 } 2858 3010 else if (label == "MenuTheme") 2859 3011 { 2860 3012 themetype = THEME_MENU; 2861 setLabel(QObject::tr("Menu Theme"));3013 gs->setLabel(QObject::tr("Menu Theme")); 2862 3014 } 2863 3015 2864 3016 QDir themes(GetThemesParentDir()); … … 2922 3074 VERBOSE(VB_IMPORTANT, QString("Problem reading theme preview image" 2923 3075 " %1").arg(preview.filePath())); 2924 3076 2925 addImageSelection(name, previewImage, theme.fileName());3077 gs->addImageSelection(name, previewImage, theme.fileName()); 2926 3078 } 2927 3079 2928 3080 if (themetype & THEME_UI) 2929 setValue(DEFAULT_UI_THEME);3081 gs->setValue(DEFAULT_UI_THEME); 2930 3082 else if (themetype & THEME_OSD) 2931 setValue("BlackCurves-OSD"); 3083 gs->setValue("BlackCurves-OSD"); 3084 3085 return wrap(gs, settings); 2932 3086 } 2933 3087 2934 3088 static HostComboBox *ChannelFormat() … … 3413 3567 3414 3568 addTarget("6", group); 3415 3569 addTarget("2", new VerticalConfigurationGroup(false, true)); 3570 QString dflt = getDefault(checkbox); 3571 if (!dflt.isEmpty()) 3572 addTarget(dflt, group); 3416 3573 } 3417 3574 }; 3418 3575 … … 3426 3583 3427 3584 addTarget("1", group); 3428 3585 addTarget("0", new VerticalConfigurationGroup(false, true)); 3586 QString dflt = getDefault(checkbox); 3587 if (!dflt.isEmpty()) 3588 addTarget(dflt, group); 3429 3589 } 3430 3590 }; 3431 3591 … … 3440 3600 3441 3601 addTarget("1", setting); 3442 3602 addTarget("0", new VerticalConfigurationGroup(false, false)); 3603 QString dflt = getDefault(checkbox); 3604 if (!dflt.isEmpty()) 3605 addTarget(dflt, setting); 3443 3606 } 3444 3607 }; 3445 3608 3446 static ConfigurationGroup *AudioSystemSettingsGroup( )3609 static ConfigurationGroup *AudioSystemSettingsGroup(PlaySettings *settings) 3447 3610 { 3448 3611 ConfigurationGroup *vcg = new VerticalConfigurationGroup(false, true, false, false); 3449 3612 3450 3613 vcg->setLabel(QObject::tr("Audio System")); 3451 3614 vcg->setUseLabel(false); 3452 3615 3453 vcg->addChild(AudioOutputDevice( ));3616 vcg->addChild(AudioOutputDevice(settings)); 3454 3617 3455 Setting *numchannels = MaxAudioChannels( );3618 Setting *numchannels = MaxAudioChannels(settings); 3456 3619 vcg->addChild(numchannels); 3457 3620 3458 3621 ConfigurationGroup *group1 = 3459 3622 new VerticalConfigurationGroup(false, true, false, false); 3460 3623 3461 group1->addChild(AudioUpmix( ));3462 group1->addChild(AudioUpmixType( ));3463 group1->addChild(PassThroughOutputDevice( ));3624 group1->addChild(AudioUpmix(settings)); 3625 group1->addChild(AudioUpmixType(settings)); 3626 group1->addChild(PassThroughOutputDevice(settings)); 3464 3627 3465 3628 ConfigurationGroup *settings1 = 3466 3629 new HorizontalConfigurationGroup(); 3467 3630 settings1->setLabel(QObject::tr("Audio Processing Capabilities")); 3468 settings1->addChild(AC3PassThrough( ));3469 settings1->addChild(DTSPassThrough( ));3631 settings1->addChild(AC3PassThrough(settings)); 3632 settings1->addChild(DTSPassThrough(settings)); 3470 3633 3471 3634 group1->addChild(settings1); 3472 3635 … … 3475 3638 new AudioSystemSurroundGroup(numchannels, group1); 3476 3639 vcg->addChild(sub1); 3477 3640 3478 Setting *advancedsettings = AdvancedAudioSettings( );3641 Setting *advancedsettings = AdvancedAudioSettings(settings); 3479 3642 vcg->addChild(advancedsettings); 3480 3643 3481 3644 ConfigurationGroup *group2 = … … 3488 3651 ConfigurationGroup *settings2 = 3489 3652 new HorizontalConfigurationGroup(false, false, false, false); 3490 3653 3491 Setting *srcqualityoverride = SRCQualityOverride( );3654 Setting *srcqualityoverride = SRCQualityOverride(settings); 3492 3655 3493 3656 AudioSystemAdvancedSettings *sub3 = 3494 new AudioSystemAdvancedSettings(srcqualityoverride, SRCQuality()); 3657 new AudioSystemAdvancedSettings(srcqualityoverride, 3658 SRCQuality(settings)); 3495 3659 settings2->addChild(srcqualityoverride); 3496 3660 settings2->addChild(sub3); 3497 3661 3498 3662 group2->addChild(settings2); 3499 group2->addChild(AggressiveBuffer( ));3663 group2->addChild(AggressiveBuffer(settings)); 3500 3664 3501 3665 return vcg; 3502 3666 … … 3505 3669 class AudioMixerSettingsGroup : public TriggeredConfigurationGroup 3506 3670 { 3507 3671 public: 3508 AudioMixerSettingsGroup( ) :3672 AudioMixerSettingsGroup(PlaySettings *psettings) : 3509 3673 TriggeredConfigurationGroup(false, true, false, false) 3510 3674 { 3511 3675 setLabel(QObject::tr("Audio Mixer")); 3512 3676 setUseLabel(false); 3513 3677 3514 Setting *volumeControl = MythControlsVolume( );3678 Setting *volumeControl = MythControlsVolume(psettings); 3515 3679 addChild(volumeControl); 3516 3680 3517 3681 // Mixer settings 3518 3682 ConfigurationGroup *settings = 3519 3683 new VerticalConfigurationGroup(false, true, false, false); 3520 settings->addChild(MixerDevice( ));3521 settings->addChild(MixerControl( ));3522 settings->addChild(MixerVolume( ));3523 settings->addChild(PCMVolume( ));3524 settings->addChild(IndividualMuteControl( ));3684 settings->addChild(MixerDevice(psettings)); 3685 settings->addChild(MixerControl(psettings)); 3686 settings->addChild(MixerVolume(psettings)); 3687 settings->addChild(PCMVolume(psettings)); 3688 settings->addChild(IndividualMuteControl(psettings)); 3525 3689 3526 3690 ConfigurationGroup *dummy = 3527 3691 new VerticalConfigurationGroup(false, true, false, false); … … 3530 3694 setTrigger(volumeControl); 3531 3695 addTarget("0", dummy); 3532 3696 addTarget("1", settings); 3697 QString dflt = getDefault(volumeControl); 3698 if (!dflt.isEmpty()) 3699 addTarget(dflt, settings); 3533 3700 } 3534 3701 }; 3535 3702 … … 3603 3770 return gs; 3604 3771 } 3605 3772 3606 static HostCheckBox *RealtimePriority()3773 static Setting *RealtimePriority(PlaySettings *settings) 3607 3774 { 3608 HostCheckBox *gc = new HostCheckBox("RealtimePriority");3775 CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings); 3609 3776 gc->setLabel(QObject::tr("Enable realtime priority threads")); 3610 3777 gc->setHelpText(QObject::tr("When running mythfrontend with root " 3611 3778 "privileges, some threads can be given enhanced priority. " 3612 3779 "Disable this if mythfrontend freezes during video " 3613 3780 "playback.")); 3614 3781 gc->setValue(true); 3615 return gc;3782 return wrap(gc, settings, false); 3616 3783 } 3617 3784 3618 3785 static HostCheckBox *EnableMediaMon() … … 3768 3935 }; 3769 3936 3770 3937 #ifdef USING_OPENGL_VSYNC 3771 static HostCheckBox *UseOpenGLVSync()3938 static Setting *UseOpenGLVSync(PlaySettings *settings) 3772 3939 { 3773 HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");3940 CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings); 3774 3941 gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing")); 3775 3942 gc->setValue(false); 3776 3943 gc->setHelpText(QObject::tr( 3777 3944 "If it is supported by your hardware/drivers, " 3778 3945 "MythTV will use OpenGL vertical syncing for " 3779 3946 "video timing, reducing frame jitter.")); 3780 return gc;3947 return wrap(gc, settings); 3781 3948 } 3782 3949 #endif 3783 3950 … … 4203 4370 return gc; 4204 4371 } 4205 4372 4206 MainGeneralSettings::MainGeneralSettings() 4373 MainGeneralSettings::MainGeneralSettings(PlaySettings *settings, 4374 ConfigurationWizard *base) 4207 4375 { 4376 if (!settings) 4377 { 4208 4378 DatabaseSettings::addDatabaseSettings(this); 4209 4379 4210 4380 VerticalConfigurationGroup *pin = … … 4213 4383 pin->addChild(SetupPinCodeRequired()); 4214 4384 pin->addChild(SetupPinCode()); 4215 4385 addChild(pin); 4386 } 4216 4387 4217 addChild(AudioSystemSettingsGroup()); 4388 if (base) 4389 { 4390 base->addChild(AudioSystemSettingsGroup(settings)); 4391 base->addChild(new AudioMixerSettingsGroup(settings)); 4392 } 4393 else 4394 { 4395 addChild(AudioSystemSettingsGroup(settings)); 4396 addChild(new AudioMixerSettingsGroup(settings)); 4397 } 4218 4398 4219 addChild(new AudioMixerSettingsGroup());4220 4399 4400 if (!settings) 4401 { 4221 4402 VerticalConfigurationGroup *general = 4222 4403 new VerticalConfigurationGroup(false, true, false, false); 4223 4404 general->setLabel(QObject::tr("General")); … … 4257 4438 remotecontrol->addChild(NetworkControlEnabled()); 4258 4439 remotecontrol->addChild(NetworkControlPort()); 4259 4440 addChild(remotecontrol); 4441 } 4260 4442 } 4261 4443 4262 PlaybackSettings::PlaybackSettings() 4444 PlaybackSettings::PlaybackSettings(PlaySettings *settings, 4445 ConfigurationWizard *base) 4263 4446 { 4264 4447 uint i = 0, total = 8; 4265 4448 #if CONFIG_DARWIN 4266 4449 total += 2; 4267 4450 #endif // USING_DARWIN 4451 if (settings) 4452 total -= 3; 4268 4453 4269 4454 4270 4455 VerticalConfigurationGroup* general1 = 4271 4456 new VerticalConfigurationGroup(false); 4272 4457 general1->setLabel(QObject::tr("General Playback") + 4273 4458 QString(" (%1/%2)").arg(++i).arg(total)); 4459 if (settings) 4460 general1->setLabel(QObject::tr("Playback group settings for ") + 4461 settings->mGroupName + " - " + 4462 general1->getLabel()); 4274 4463 4275 4464 HorizontalConfigurationGroup *columns = 4276 4465 new HorizontalConfigurationGroup(false, false, true, true); 4277 4466 4278 4467 VerticalConfigurationGroup *column1 = 4279 4468 new VerticalConfigurationGroup(false, false, true, true); 4280 column1->addChild(RealtimePriority()); 4281 column1->addChild(DecodeExtraAudio()); 4282 column1->addChild(UseVideoTimebase()); 4283 column1->addChild(JumpToProgramOSD()); 4469 if (!settings) 4470 column1->addChild(RealtimePriority(settings)); 4471 column1->addChild(DecodeExtraAudio(settings)); 4472 column1->addChild(UseVideoTimebase(settings)); 4473 column1->addChild(JumpToProgramOSD(settings)); 4284 4474 columns->addChild(column1); 4285 4475 4286 4476 VerticalConfigurationGroup *column2 = 4287 4477 new VerticalConfigurationGroup(false, false, true, true); 4288 column2->addChild(ClearSavedPosition( ));4289 column2->addChild(AltClearSavedPosition( ));4290 column2->addChild(AutomaticSetWatched( ));4291 column2->addChild(ContinueEmbeddedTVPlay( ));4478 column2->addChild(ClearSavedPosition(settings)); 4479 column2->addChild(AltClearSavedPosition(settings)); 4480 column2->addChild(AutomaticSetWatched(settings)); 4481 column2->addChild(ContinueEmbeddedTVPlay(settings)); 4292 4482 columns->addChild(column2); 4293 4483 4294 4484 general1->addChild(columns); 4295 general1->addChild(LiveTVIdleTimeout()); 4296 general1->addChild(AlwaysStreamFiles()); 4485 if (!settings) 4486 general1->addChild(LiveTVIdleTimeout()); 4487 if (!settings) 4488 general1->addChild(AlwaysStreamFiles()); 4297 4489 #ifdef USING_OPENGL_VSYNC 4298 general1->addChild(UseOpenGLVSync( ));4490 general1->addChild(UseOpenGLVSync(settings)); 4299 4491 #endif // USING_OPENGL_VSYNC 4300 4492 #if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU) 4301 general1->addChild(UsePicControls( ));4493 general1->addChild(UsePicControls(settings)); 4302 4494 #endif // USING_XV 4303 addChild(general1); 4495 if (base) 4496 base->addChild(general1); 4497 else 4498 addChild(general1); 4304 4499 4305 4500 VerticalConfigurationGroup* general2 = 4306 4501 new VerticalConfigurationGroup(false); 4307 4502 general2->setLabel(QObject::tr("General Playback") + 4308 4503 QString(" (%1/%2)").arg(++i).arg(total)); 4504 if (settings) 4505 general2->setLabel(QObject::tr("Playback group settings for ") + 4506 settings->mGroupName + " - " + 4507 general2->getLabel()); 4309 4508 4310 4509 HorizontalConfigurationGroup* oscan = 4311 4510 new HorizontalConfigurationGroup(false, false, true, true); … … 4313 4512 new VerticalConfigurationGroup(false, false, true, true); 4314 4513 VerticalConfigurationGroup *ocol2 = 4315 4514 new VerticalConfigurationGroup(false, false, true, true); 4316 ocol1->addChild(VertScanPercentage( ));4317 ocol1->addChild(YScanDisplacement( ));4318 ocol2->addChild(HorizScanPercentage( ));4319 ocol2->addChild(XScanDisplacement( ));4515 ocol1->addChild(VertScanPercentage(settings)); 4516 ocol1->addChild(YScanDisplacement(settings)); 4517 ocol2->addChild(HorizScanPercentage(settings)); 4518 ocol2->addChild(XScanDisplacement(settings)); 4320 4519 oscan->addChild(ocol1); 4321 4520 oscan->addChild(ocol2); 4322 4521 4323 4522 HorizontalConfigurationGroup* aspect_fill = 4324 4523 new HorizontalConfigurationGroup(false, false, true, true); 4325 aspect_fill->addChild(AspectOverride( ));4326 aspect_fill->addChild(AdjustFill( ));4524 aspect_fill->addChild(AspectOverride(settings)); 4525 aspect_fill->addChild(AdjustFill(settings)); 4327 4526 4328 4527 general2->addChild(oscan); 4329 4528 general2->addChild(aspect_fill); 4330 general2->addChild(LetterboxingColour()); 4331 general2->addChild(PIPLocationComboBox()); 4332 general2->addChild(PlaybackExitPrompt()); 4333 general2->addChild(EndOfRecordingExitPrompt()); 4334 addChild(general2); 4529 general2->addChild(LetterboxingColour(settings)); 4530 general2->addChild(PIPLocationComboBox(settings)); 4531 general2->addChild(PlaybackExitPrompt(settings)); 4532 general2->addChild(EndOfRecordingExitPrompt(settings)); 4533 if (base) 4534 base->addChild(general2); 4535 else 4536 addChild(general2); 4335 4537 4336 4538 QString tmp = QString(" (%1/%2)").arg(++i).arg(total); 4337 addChild(new PlaybackProfileConfigs(tmp)); 4539 if (base) 4540 base->addChild(new PlaybackProfileConfigs(tmp, settings)); 4541 else 4542 addChild(new PlaybackProfileConfigs(tmp, settings)); 4338 4543 4544 if (!settings) 4545 { 4339 4546 VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false); 4340 4547 pbox->setLabel(QObject::tr("View Recordings") + 4341 4548 QString(" (%1/%2)").arg(++i).arg(total)); … … 4364 4571 pbox3->addChild(DisplayGroupTitleSort()); 4365 4572 pbox3->addChild(new WatchListSettings()); 4366 4573 addChild(pbox3); 4574 } 4367 4575 4368 4576 VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false); 4369 4577 seek->setLabel(QObject::tr("Seeking") + 4370 4578 QString(" (%1/%2)").arg(++i).arg(total)); 4371 seek->addChild(SmartForward()); 4372 seek->addChild(FFRewReposTime()); 4373 seek->addChild(FFRewReverse()); 4374 seek->addChild(ExactSeeking()); 4375 addChild(seek); 4579 if (settings) 4580 seek->setLabel(QObject::tr("Playback group settings for ") + 4581 settings->mGroupName + " - " + 4582 seek->getLabel()); 4583 seek->addChild(SmartForward(settings)); 4584 seek->addChild(FFRewReposTime(settings)); 4585 seek->addChild(FFRewReverse(settings)); 4586 seek->addChild(ExactSeeking(settings)); 4587 if (base) 4588 base->addChild(seek); 4589 else 4590 addChild(seek); 4376 4591 4377 4592 VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false); 4378 4593 comms->setLabel(QObject::tr("Commercial Skip") + 4379 4594 QString(" (%1/%2)").arg(++i).arg(total)); 4380 comms->addChild(AutoCommercialSkip()); 4381 comms->addChild(CommRewindAmount()); 4382 comms->addChild(CommNotifyAmount()); 4595 if (settings) 4596 comms->setLabel(QObject::tr("Playback group settings for ") + 4597 settings->mGroupName + " - " + 4598 comms->getLabel()); 4599 comms->addChild(AutoCommercialSkip(settings)); 4600 comms->addChild(CommRewindAmount(settings)); 4601 comms->addChild(CommNotifyAmount(settings)); 4602 if (!settings) // these are global settings, not host-specific 4603 { 4383 4604 comms->addChild(MaximumCommercialSkip()); 4384 4605 comms->addChild(MergeShortCommBreaks()); 4385 4606 comms->addChild(CommSkipAllBlanks()); 4386 addChild(comms); 4607 } 4608 if (base) 4609 base->addChild(comms); 4610 else 4611 addChild(comms); 4387 4612 4388 4613 #if CONFIG_DARWIN 4389 4614 VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false); 4390 4615 mac1->setLabel(QObject::tr("Mac OS X video settings") + 4391 4616 QString(" (%1/%2)").arg(++i).arg(total)); 4617 if (settings) 4618 mac1->setLabel(QObject::tr("Playback group settings for ") + 4619 settings->mGroupName + " - " + 4620 mac1->getLabel()); 4621 if (!settings) 4622 { 4392 4623 mac1->addChild(MacGammaCorrect()); 4393 4624 mac1->addChild(MacScaleUp()); 4394 4625 mac1->addChild(MacFullSkip()); 4395 addChild(mac1); 4626 } 4627 if (base) 4628 base->addChild(mac1); 4629 else 4630 addChild(mac1); 4396 4631 4397 4632 VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false); 4398 4633 mac2->setLabel(QObject::tr("Mac OS X video settings") + 4399 4634 QString(" (%1/%2)").arg(++i).arg(total)); 4635 if (settings) 4636 mac2->setLabel(QObject::tr("Playback group settings for ") + 4637 settings->mGroupName + " - " + 4638 mac2->getLabel()); 4639 if (!setings) 4640 { 4400 4641 mac2->addChild(new MacMainSettings()); 4401 4642 mac2->addChild(new MacFloatSettings()); 4402 4643 … … 4405 4646 row->addChild(new MacDockSettings()); 4406 4647 row->addChild(new MacDesktopSettings()); 4407 4648 mac2->addChild(row); 4649 } 4408 4650 4409 addChild(mac2); 4651 if (base) 4652 base->addChild(mac2); 4653 else 4654 addChild(mac2); 4410 4655 #endif 4411 4656 } 4412 4657 4413 OSDSettings::OSDSettings() 4658 OSDSettings::OSDSettings(PlaySettings *settings, 4659 ConfigurationWizard *base) 4414 4660 { 4415 4661 VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false); 4416 4662 osd->setLabel(QObject::tr("On-screen display")); 4663 if (settings) 4664 osd->setLabel(QObject::tr("Playback group settings for ") + 4665 settings->mGroupName + " - " + 4666 osd->getLabel()); 4417 4667 4418 osd->addChild(new ThemeSelector("OSDTheme")); 4419 osd->addChild(OSDGeneralTimeout()); 4420 osd->addChild(OSDProgramInfoTimeout()); 4421 osd->addChild(OSDFont()); 4422 osd->addChild(OSDThemeFontSizeType()); 4423 osd->addChild(EnableMHEG()); 4424 osd->addChild(PersistentBrowseMode()); 4425 osd->addChild(BrowseAllTuners()); 4426 addChild(osd); 4668 osd->addChild(ThemeSelector("OSDTheme", settings)); 4669 osd->addChild(OSDGeneralTimeout(settings)); 4670 osd->addChild(OSDProgramInfoTimeout(settings)); 4671 osd->addChild(OSDFont(settings)); 4672 osd->addChild(OSDThemeFontSizeType(settings)); 4673 osd->addChild(EnableMHEG(settings)); 4674 if (!settings) 4675 { 4676 osd->addChild(PersistentBrowseMode(settings)); 4677 osd->addChild(BrowseAllTuners(settings)); 4678 } 4679 if (base) 4680 base->addChild(osd); 4681 else 4682 addChild(osd); 4427 4683 4428 4684 VerticalConfigurationGroup *udp = new VerticalConfigurationGroup(false); 4429 4685 udp->setLabel(QObject::tr("UDP OSD Notifications")); 4430 udp->addChild(OSDNotifyTimeout()); 4431 udp->addChild(UDPNotifyPort()); 4432 addChild(udp); 4686 if (settings) 4687 udp->setLabel(QObject::tr("Playback group settings for ") + 4688 settings->mGroupName + " - " + 4689 udp->getLabel()); 4690 udp->addChild(OSDNotifyTimeout(settings)); 4691 udp->addChild(UDPNotifyPort(settings)); 4692 if (base) 4693 base->addChild(udp); 4694 else 4695 addChild(udp); 4433 4696 4434 4697 VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false); 4435 4698 cc->setLabel(QObject::tr("Analog Closed Captions")); 4436 cc->addChild(OSDCCFont()); 4699 if (settings) 4700 cc->setLabel(QObject::tr("Playback group settings for ") + 4701 settings->mGroupName + " - " + 4702 cc->getLabel()); 4703 cc->addChild(OSDCCFont(settings)); 4437 4704 //cc->addChild(DecodeVBIFormat()); 4438 cc->addChild(CCBackground()); 4439 cc->addChild(DefaultCCMode()); 4440 cc->addChild(PreferCC708()); 4441 addChild(cc); 4705 cc->addChild(CCBackground(settings)); 4706 cc->addChild(DefaultCCMode(settings)); 4707 cc->addChild(PreferCC708(settings)); 4708 if (base) 4709 base->addChild(cc); 4710 else 4711 addChild(cc); 4442 4712 4443 addChild(OSDCC708Settings()); 4444 addChild(OSDCC708Fonts()); 4445 addChild(ExternalSubtitleSettings()); 4713 if (base) 4714 { 4715 base->addChild(OSDCC708Settings(settings)); 4716 base->addChild(OSDCC708Fonts(settings)); 4717 base->addChild(ExternalSubtitleSettings(settings)); 4718 } 4719 else 4720 { 4721 addChild(OSDCC708Settings(settings)); 4722 addChild(OSDCC708Fonts(settings)); 4723 addChild(ExternalSubtitleSettings(settings)); 4724 } 4446 4725 4447 4726 #if CONFIG_DARWIN 4448 4727 // Any Mac OS-specific OSD stuff would go here. … … 4594 4873 VerticalConfigurationGroup* theme = new VerticalConfigurationGroup(false); 4595 4874 theme->setLabel(QObject::tr("Theme")); 4596 4875 4597 theme->addChild( newThemeSelector("Theme"));4876 theme->addChild(ThemeSelector("Theme")); 4598 4877 4599 4878 theme->addChild(ThemeCacheSize()); 4600 4879 -
programs/mythfrontend/main.cpp
34 34 #include "globalsettings.h" 35 35 #include "profilegroup.h" 36 36 #include "playgroup.h" 37 #include "playsettings.h" 37 38 #include "networkcontrol.h" 38 39 #include "DVDRingBuffer.h" 39 40 #include "scheduledrecording.h" … … 485 486 delete statusbox; 486 487 } 487 488 489 ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 490 { 491 return new PlaybackSettings(settings, base); 492 } 493 494 ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 495 { 496 return new OSDSettings(settings, base); 497 } 498 499 ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 500 { 501 return new MainGeneralSettings(settings, base); 502 } 503 504 static PlayGroupEditor::SettingsLookup pbgroupSetup[] = { 505 createPlaybackSettingsForPlaybackGroup, 506 createOSDSettingsForPlaybackGroup, 507 createMainGeneralSettingsForPlaybackGroup 508 }; 509 488 510 void TVMenuCallback(void *data, QString &selection) 489 511 { 490 512 (void)data; … … 577 599 } 578 600 else if (sel == "settings playgroup") 579 601 { 580 PlayGroupEditor editor; 602 PlayGroupEditor editor(pbgroupSetup, 603 sizeof(pbgroupSetup)/sizeof(*pbgroupSetup)); 581 604 editor.exec(); 582 605 } 583 606 else if (sel == "settings general") … … 749 772 Qt::ISODate)); 750 773 pginfo->lenMins = lenMins; 751 774 pginfo->isVideo = true; 775 pginfo->playgroup = "Videos"; 752 776 pginfo->pathname = mrl; 753 777 754 778 QDir d(mrl + "/VIDEO_TS"); -
programs/mythfrontend/globalsettings.h
10 10 #include "themeinfo.h" 11 11 12 12 class QFileInfo; 13 class PlaySettings; 13 14 14 class ThemeSelector : public HostImageSelect15 {16 public:17 ThemeSelector(QString label);18 19 private:20 bool parseThemeInfo(QFileInfo *theme, QString &name, QFileInfo &preview);21 };22 23 15 class PlaybackSettings : public ConfigurationWizard 24 16 { 25 17 public: 26 PlaybackSettings(); 18 PlaybackSettings(PlaySettings *settings=NULL, 19 ConfigurationWizard *base=NULL); 27 20 }; 28 21 29 22 class OSDSettings: virtual public ConfigurationWizard 30 23 { 31 24 public: 32 OSDSettings(); 25 OSDSettings(PlaySettings *settings=NULL, 26 ConfigurationWizard *base=NULL); 33 27 }; 34 28 35 29 class GeneralSettings : public ConfigurationWizard … … 53 47 class MainGeneralSettings : public ConfigurationWizard 54 48 { 55 49 public: 56 MainGeneralSettings(); 50 MainGeneralSettings(PlaySettings *settings=NULL, 51 ConfigurationWizard *base=NULL); 57 52 }; 58 53 59 54 class GeneralRecPrioritiesSettings : public ConfigurationWizard … … 140 135 Q_OBJECT 141 136 142 137 public: 143 PlaybackProfileConfigs(const QString &str );138 PlaybackProfileConfigs(const QString &str, PlaySettings *settings); 144 139 virtual ~PlaybackProfileConfigs(); 145 140 146 141 private: … … 152 147 153 148 private: 154 149 QStringList profiles; 155 HostComboBox*grouptrigger;150 ComboBoxSetting *grouptrigger; 156 151 }; 157 152 158 153 #endif -
programs/mythtranscode/transcode.cpp
36 36 class AudioReencodeBuffer : public AudioOutput 37 37 { 38 38 public: 39 AudioReencodeBuffer(int audio_bits, int audio_channels) 39 AudioReencodeBuffer(int audio_bits, int audio_channels, 40 PlaySettings *psettings) 41 : AudioOutput(psettings) 40 42 { 41 43 Reset(); 42 const AudioSettings settings(audio_bits, audio_channels, 0, 0, false); 44 const AudioSettings settings(audio_bits, audio_channels, 0, 0, false, 45 psettings); 43 46 Reconfigure(settings); 44 47 bufsize = 512000; 45 48 audiobuffer = new unsigned char[bufsize]; … … 419 422 statustime = statustime.addSecs(5); 420 423 } 421 424 422 AudioOutput *audioOutput = new AudioReencodeBuffer(0, 0); 425 AudioOutput *audioOutput = 426 new AudioReencodeBuffer(0, 0, player_ctx->settings); 423 427 AudioReencodeBuffer *arb = ((AudioReencodeBuffer*)audioOutput); 424 428 nvp->SetAudioOutput(audioOutput); 425 429 nvp->SetTranscoding(true); -
programs/mythavtest/main.cpp
22 22 #include "dbcheck.h" 23 23 #include "myththemebase.h" 24 24 #include "audiopulseutil.h" 25 #include "playsettings.h" 25 26 26 27 27 28 static void *run_priv_thread(void *data) … … 189 190 if (pa_ret != GENERIC_EXIT_OK) 190 191 return pa_ret; 191 192 192 #if defined(Q_OS_MACX)193 // Mac OS X doesn't define the AudioOutputDevice setting194 #else195 QString auddevice = gContext->GetSetting("AudioOutputDevice");196 if (auddevice.isEmpty())197 {198 VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "199 "to run 'mythfrontend', not 'mythtv'.");200 return TV_EXIT_NO_AUDIO;201 }202 #endif203 204 193 MythMainWindow *mainWindow = GetMythMainWindow(); 205 194 mainWindow->Init(); 206 195 gContext->SetMainWindow(mainWindow); … … 215 204 return GENERIC_EXIT_DB_OUTOFDATE; 216 205 } 217 206 218 TV *tv = new TV();219 if (!tv->Init())220 {221 VERBOSE(VB_IMPORTANT, "Fatal Error: Could not initialize TV class.");222 return TV_EXIT_NO_TV;223 }224 225 207 ProgramInfo *pginfo = NULL; 226 208 227 209 if (!filename.isEmpty() && … … 240 222 241 223 } 242 224 225 PlaySettings settings(pginfo->playgroup); 226 227 #if defined(Q_OS_MACX) 228 // Mac OS X doesn't define the AudioOutputDevice setting 229 #else 230 QString auddevice = settings.GetSetting("AudioOutputDevice", ""); 231 if (auddevice.isEmpty()) 232 { 233 VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need " 234 "to run 'mythfrontend', not 'mythtv'."); 235 return TV_EXIT_NO_AUDIO; 236 } 237 #endif 238 239 TV *tv = new TV(&settings); 240 if (!tv->Init()) 241 { 242 VERBOSE(VB_IMPORTANT, "Fatal Error: Could not initialize TV class."); 243 return TV_EXIT_NO_TV; 244 } 245 243 246 TV::StartTV(pginfo, false); 244 247 245 248 if (pginfo)