Ticket #8088: 8088_playgroups_v18.3.patch
File 8088_playgroups_v18.3.patch, 112.3 KB (added by , 15 years ago) |
---|
-
libs/libmythtv/videoout_vdpau.h
20 20 { 21 21 public: 22 22 static void GetRenderOptions(render_opts &opts); 23 VideoOutputVDPAU( );23 VideoOutputVDPAU(PlaySettings *settings); 24 24 ~VideoOutputVDPAU(); 25 25 bool Init(int width, int height, float aspect, WId winid, 26 26 int winx, int winy, int winw, int winh, … … 54 54 const QSize &video_dim); 55 55 static MythCodecID GetBestSupportedCodec(uint width, uint height, 56 56 uint stream_type, 57 bool no_acceleration); 57 bool no_acceleration, 58 PlaySettings *settings); 58 59 virtual bool IsPIPSupported(void) const { return true; } 59 60 virtual bool IsPBPSupported(void) const { return false; } 60 61 virtual bool NeedExtraAudioDecode(void) const -
libs/libmythtv/subtitlereader.h
44 44 45 45 TextSubtitles* GetTextSubtitles(void) { return &m_TextSubtitles; } 46 46 bool HasTextSubtitles(void); 47 bool LoadExternalSubtitles(const QString &videoFile );47 bool LoadExternalSubtitles(const QString &videoFile, PlaySettings *settings); 48 48 49 49 QStringList GetRawTextSubtitles(uint64_t &duration); 50 50 void AddRawTextSubtitle(QStringList list, uint64_t duration); -
libs/libmythtv/videooutwindow.cpp
29 29 30 30 #include "videooutwindow.h" 31 31 #include "osd.h" 32 #include "playsettings.h" 32 33 #include "mythplayer.h" 33 34 #include "videodisplayprofile.h" 34 35 #include "decoderbase.h" … … 53 54 const float VideoOutWindow::kManualZoomMinVerticalZoom = 0.5f; 54 55 const int VideoOutWindow::kManualZoomMaxMove = 50; 55 56 56 VideoOutWindow::VideoOutWindow( ) :57 VideoOutWindow::VideoOutWindow(PlaySettings *_settings) : 57 58 // DB settings 58 59 db_move(0, 0), db_scale_horiz(0.0f), db_scale_vert(0.0f), 59 60 db_pip_size(26), … … 85 86 86 87 // Various state variables 87 88 embedding(false), needrepaint(false), 88 allowpreviewepg(true), pip_state(kPIPOff) 89 allowpreviewepg(true), pip_state(kPIPOff), 90 91 settings(_settings) 89 92 { 90 93 db_pip_size = gCoreContext->GetNumSetting("PIPSize", 26); 91 94 92 db_move = QPoint( gCoreContext->GetNumSetting("xScanDisplacement", 0),93 gCoreContext->GetNumSetting("yScanDisplacement", 0));95 db_move = QPoint(settings->GetNumSetting("xScanDisplacement", 0), 96 settings->GetNumSetting("yScanDisplacement", 0)); 94 97 db_use_gui_size = gCoreContext->GetNumSetting("GuiSizeForTV", 0); 95 98 96 99 QDesktopWidget *desktop = NULL; … … 615 618 if (change) 616 619 { 617 620 db_scale_vert = 618 gCoreContext->GetNumSetting("VertScanPercentage", 0) * 0.01f;621 settings->GetNumSetting("VertScanPercentage", 0) * 0.01f; 619 622 db_scale_horiz = 620 gCoreContext->GetNumSetting("HorizScanPercentage", 0) * 0.01f;623 settings->GetNumSetting("HorizScanPercentage", 0) * 0.01f; 621 624 db_scaling_allowed = true; 622 625 } 623 626 else -
libs/libmythtv/videoout_d3d.cpp
52 52 opts.priorities->insert("direct3d", 55); 53 53 } 54 54 55 VideoOutputD3D::VideoOutputD3D( void)56 : VideoOutput( ),m_lock(QMutex::Recursive),55 VideoOutputD3D::VideoOutputD3D(PlaySettigns *settings) 56 : VideoOutput(settings), m_lock(QMutex::Recursive), 57 57 m_hWnd(NULL), m_render(NULL), 58 58 m_video(NULL), 59 59 m_render_valid(false), m_render_reset(false), m_pip_active(NULL), -
libs/libmythtv/DetectLetterbox.cpp
5 5 #include "mythplayer.h" 6 6 #include "videoouttypes.h" 7 7 #include "mythcorecontext.h" 8 #include "playsettings.h" 8 9 9 10 DetectLetterbox::DetectLetterbox(MythPlayer* const player) 10 11 { 11 int dbAdjustFill = gCoreContext->GetNumSetting("AdjustFill", 0);12 int dbAdjustFill = player->GetPlaySettings()->GetNumSetting("AdjustFill", 0); 12 13 isDetectLetterbox = dbAdjustFill >= kAdjustFill_AutoDetect_DefaultOff; 13 14 firstFrameChecked = 0; 14 15 detectLetterboxDefaultMode = (AdjustFillMode) max((int) kAdjustFill_Off, … … 18 19 detectLetterboxPossibleFullFrame = -1; 19 20 detectLetterboxConsecutiveCounter = 0; 20 21 detectLetterboxDetectedMode = player->GetAdjustFill(); 21 detectLetterboxLimit = gCoreContext->GetNumSetting("DetectLeterboxLimit", 75); 22 detectLetterboxLimit = 23 player->GetPlaySettings()->GetNumSetting("DetectLeterboxLimit", 75); 22 24 m_player = player; 23 25 } 24 26 -
libs/libmythtv/videoout_opengl.cpp
39 39 opts.priorities->insert("opengl", 65); 40 40 } 41 41 42 VideoOutputOpenGL::VideoOutputOpenGL( )43 : VideoOutput( ),42 VideoOutputOpenGL::VideoOutputOpenGL(PlaySettings *settings) 43 : VideoOutput(settings), 44 44 gl_context_lock(QMutex::Recursive), 45 45 gl_context(NULL), gl_videochain(NULL), gl_pipchain_active(NULL), 46 46 gl_parent_win(0), gl_embed_win(0), gl_painter(NULL) -
libs/libmythtv/videoout_quartz.cpp
63 63 #include "mythverbose.h" 64 64 #include "videodisplayprofile.h" 65 65 66 class PlaySettings; 67 66 68 #define LOC QString("VideoOutputQuartz::") 67 69 #define LOC_ERR QString("VideoOutputQuartz Error: ") 68 70 … … 1106 1108 /** \class VideoOutputQuartz 1107 1109 * \brief Implementation of Quartz (Mac OS X windowing system) video output 1108 1110 */ 1109 VideoOutputQuartz::VideoOutputQuartz( ) :1110 VideoOutput( ), Started(false), data(new QuartzData())1111 VideoOutputQuartz::VideoOutputQuartz(PlaySettings *settings) : 1112 VideoOutput(settings), Started(false), data(new QuartzData()) 1111 1113 { 1112 1114 init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0); 1113 1115 } … … 1757 1759 MythCodecID VideoOutputQuartz::GetBestSupportedCodec( 1758 1760 uint width, uint height, 1759 1761 uint osd_width, uint osd_height, 1760 uint stream_type, uint fourcc )1762 uint stream_type, uint fourcc, PlaySettings *settings) 1761 1763 { 1762 1764 (void) osd_width; 1763 1765 (void) osd_height; 1764 1766 1765 VideoDisplayProfile vdp ;1767 VideoDisplayProfile vdp(settings); 1766 1768 vdp.SetInput(QSize(width, height)); 1767 1769 QString dec = vdp.GetDecoder(); 1768 1770 if ((dec == "libmpeg2") || (dec == "ffmpeg")) -
libs/libmythtv/avformatdecoder.cpp
33 33 #include "BDRingBuffer.h" 34 34 #include "videodisplayprofile.h" 35 35 #include "mythuihelper.h" 36 #include "playsettings.h" 36 37 37 38 #include "lcddevice.h" 38 39 … … 308 309 309 310 cc608_build_parity_table(cc608_parity_table); 310 311 311 if ( gCoreContext->GetNumSetting("CCBackground", 0))312 if (GetPlayer()->GetPlaySettings()->GetNumSetting("CCBackground", 0)) 312 313 CC708Window::forceWhiteOnBlackText = true; 313 314 314 315 no_dts_hack = false; … … 1200 1201 if (selectedStream) 1201 1202 { 1202 1203 directrendering = true; 1203 if (! gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&1204 if (!GetPlayer()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) && 1204 1205 !CODEC_IS_HWACCEL(codec)) 1205 1206 { 1206 1207 SetLowBuffers(false); … … 1733 1734 1734 1735 if (!is_db_ignored) 1735 1736 { 1736 VideoDisplayProfile vdp ;1737 VideoDisplayProfile vdp(GetPlayer()->GetPlaySettings()); 1737 1738 vdp.SetInput(QSize(width, height)); 1738 1739 dec = vdp.GetDecoder(); 1739 1740 thread_count = vdp.GetMaxCPUs(); … … 1761 1762 MythCodecID vdpau_mcid; 1762 1763 vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec( 1763 1764 width, height, 1764 mpeg_version(enc->codec_id), no_hardware_decoders); 1765 mpeg_version(enc->codec_id), no_hardware_decoders, 1766 GetPlayer()->GetPlaySettings()); 1765 1767 1766 1768 if (vdpau_mcid >= video_codec_id) 1767 1769 { … … 1793 1795 /* mpeg type */ mpeg_version(enc->codec_id), 1794 1796 /* xvmc pix fmt */ xvmc_pixel_format(enc->pix_fmt), 1795 1797 /* test surface */ codec_is_std(video_codec_id), 1796 /* force_xv */ force_xv); 1798 /* force_xv */ force_xv, 1799 GetPlayer()->GetPlaySettings()); 1797 1800 1798 1801 if (mcid >= video_codec_id) 1799 1802 { -
libs/libmythtv/playgroup.cpp
1 1 #include "mythdb.h" 2 2 #include "playgroup.h" 3 3 #include "programinfo.h" 4 #include "playsettings.h" 4 5 5 6 // A parameter associated with the profile itself 6 7 class PlayGroupDBStorage : public SimpleDBStorage … … 210 211 return res; 211 212 } 212 213 213 PlayGroupEditor::PlayGroupEditor(void) : 214 listbox(new ListBoxSetting(this)), lastValue("Default") 214 PlayGroupEditor::PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize) : 215 listbox(new ListBoxSetting(this)), lastValue("Default"), 216 getSettings(funcArray), getSettingsSize(funcArraySize) 215 217 { 216 218 listbox->setLabel(tr("Playback Groups")); 217 219 addChild(listbox); … … 242 244 } 243 245 244 246 PlayGroup group(name); 247 PlaySettings *psettings = new PlaySettings(name); 248 for (int i=0; i<getSettingsSize; i++) 249 getSettings[i](psettings, &group); 245 250 if (group.exec() == QDialog::Accepted || !created) 246 251 lastValue = name; 247 252 else … … 276 281 query.bindValue(":NAME", name); 277 282 if (!query.exec()) 278 283 MythDB::DBError("PlayGroupEditor::doDelete", query); 284 PlaySettings::deleteGroup(name); 279 285 280 286 int lastIndex = listbox->getValueIndex(name); 281 287 lastValue = ""; -
libs/libmythtv/videoout_opengl.h
10 10 { 11 11 public: 12 12 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 13 VideoOutputOpenGL( );13 VideoOutputOpenGL(PlaySettings *settings); 14 14 ~VideoOutputOpenGL(); 15 15 16 16 bool Init(int width, int height, float aspect, WId winid, -
libs/libmythtv/tv_play.h
59 59 class OSDListTreeItemEnteredEvent; 60 60 class OSDListTreeItemSelectedEvent; 61 61 struct osdInfo; 62 class PlaySettings; 62 63 63 64 typedef QMap<QString,InfoMap> DDValueMap; 64 65 typedef QMap<QString,DDValueMap> DDKeyMap; … … 182 183 unsigned long seconds; 183 184 }; 184 185 185 TV( void);186 TV(PlaySettings *settings); 186 187 ~TV(); 187 188 188 void InitFromDB( void);189 void InitFromDB(PlaySettings *settings); 189 190 bool Init(bool createWindow = true); 190 191 191 192 // User input processing commands … … 208 209 209 210 // Recording commands 210 211 int PlayFromRecorder(int recordernum); 211 int Playback(const ProgramInfo &rcinfo );212 int Playback(const ProgramInfo &rcinfo, PlaySettings *settings); 212 213 213 214 // Commands used by frontend playback box 214 215 QString GetRecordingGroup(int player_idx) const; -
libs/libmythtv/playgroup.h
7 7 #include "mythwidgets.h" 8 8 9 9 class ProgramInfo; 10 class PlaySettings; 10 11 11 12 class MPUBLIC PlayGroup: public ConfigurationWizard 12 13 { … … 29 30 Q_OBJECT 30 31 31 32 public: 32 PlayGroupEditor(void); 33 typedef ConfigurationWizard *(*SettingsLookup)(PlaySettings *settings, 34 ConfigurationWizard *base); 35 PlayGroupEditor(SettingsLookup *funcArray, int funcArraySize); 33 36 virtual DialogCode exec(void); 34 37 virtual void Load(void); 35 38 virtual void Save(void) { } … … 44 47 protected: 45 48 ListBoxSetting *listbox; 46 49 QString lastValue; 50 SettingsLookup *getSettings; 51 int getSettingsSize; 47 52 }; 48 53 49 54 #endif -
libs/libmythtv/dbcheck.cpp
3555 3555 3556 3556 VideoDisplayProfile::CreateNewProfiles(host); 3557 3557 profiles = VideoDisplayProfile::GetProfiles(host); 3558 QString profile = VideoDisplayProfile::GetDefaultProfileName(host); 3558 QString profile = 3559 VideoDisplayProfile::GetDefaultProfileName(host, NULL); 3559 3560 3560 3561 if (profiles.contains("Normal") && 3561 3562 (profile=="CPU++" || profile=="CPU+" || profile=="CPU--")) … … 5959 5960 " jump int(11) NOT NULL default '0'," 5960 5961 " PRIMARY KEY (`name`)" 5961 5962 ");", 5963 "CREATE TABLE playgroupsettings (" 5964 " playgroupname varchar(64) NOT NULL," 5965 " `value` varchar(128) NOT NULL," 5966 " `data` text," 5967 " overridden tinyint(1) NOT NULL," 5968 " PRIMARY KEY (playgroupname, `value`)" 5969 ");", 5962 5970 "CREATE TABLE powerpriority (" 5963 5971 " priorityname varchar(64) collate utf8_bin NOT NULL," 5964 5972 " recpriority int(10) NOT NULL default '0'," -
libs/libmythtv/videoout_vdpau.cpp
49 49 opts.deints->insert("vdpau", deints); 50 50 } 51 51 52 VideoOutputVDPAU::VideoOutputVDPAU( )53 : m_win(0),m_render(NULL),52 VideoOutputVDPAU::VideoOutputVDPAU(PlaySettings *settings) 53 : VideoOutput(settings), m_win(0), m_render(NULL), 54 54 m_buffer_size(NUM_VDPAU_BUFFERS), m_pause_surface(0), 55 55 m_need_deintrefs(false), m_video_mixer(0), m_mixer_features(kVDPFeatNone), 56 56 m_checked_surface_ownership(false), … … 881 881 882 882 MythCodecID VideoOutputVDPAU::GetBestSupportedCodec( 883 883 uint width, uint height, 884 uint stream_type, bool no_acceleration )884 uint stream_type, bool no_acceleration, PlaySettings *settings) 885 885 { 886 886 bool use_cpu = no_acceleration; 887 VideoDisplayProfile vdp ;887 VideoDisplayProfile vdp(settings); 888 888 vdp.SetInput(QSize(width, height)); 889 889 QString dec = vdp.GetDecoder(); 890 890 -
libs/libmythtv/videoout_directfb.cpp
277 277 opts.priorities->insert("directfb", 60); 278 278 } 279 279 280 VideoOutputDirectfb::VideoOutputDirectfb( )281 : VideoOutput( ), XJ_started(false), widget(NULL),280 VideoOutputDirectfb::VideoOutputDirectfb(PlaySettings *settings) 281 : VideoOutput(settings), XJ_started(false), widget(NULL), 282 282 data(new DirectfbData()) 283 283 { 284 284 init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0); -
libs/libmythtv/mythplayer.h
212 212 QString GetXDS(const QString &key) const; 213 213 PIPLocation GetNextPIPLocation(void) const; 214 214 215 PlaySettings *GetPlaySettings(void) const { 216 return player_ctx ? player_ctx->settings : NULL; 217 } 218 215 219 // Bool Gets 216 220 bool GetRawAudioState(void) const; 217 221 bool GetLimitKeyRepeat(void) const { return limitKeyRepeat; } -
libs/libmythtv/videoout_d3d.h
12 12 { 13 13 public: 14 14 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 15 VideoOutputD3D( );15 VideoOutputD3D(PlaySettings *settings); 16 16 ~VideoOutputD3D(); 17 17 18 18 bool Init(int width, int height, float aspect, WId winid, -
libs/libmythtv/playercontext.cpp
16 16 #include "storagegroup.h" 17 17 #include "mythcorecontext.h" 18 18 #include "videometadatautil.h" 19 #include "DetectLetterbox.h" 20 #include "playsettings.h" 19 21 20 22 #define LOC QString("playCtx: ") 21 23 #define LOC_ERR QString("playCtx, Error: ") … … 405 407 WId embedwinid, const QRect *embedbounds, 406 408 bool muted) 407 409 { 408 int exact_seeking = gCoreContext->GetNumSetting("ExactSeeking", 0);410 int exact_seeking = settings->GetNumSetting("ExactSeeking", 0); 409 411 410 412 if (HasPlayer()) 411 413 { … … 448 450 { 449 451 QString subfn = buffer->GetSubtitleFilename(); 450 452 if (!subfn.isEmpty() && player->GetSubReader()) 451 player->GetSubReader()->LoadExternalSubtitles(subfn );453 player->GetSubReader()->LoadExternalSubtitles(subfn, settings); 452 454 } 453 455 454 456 if ((embedwinid > 0) && embedbounds) … … 893 895 /** 894 896 * \brief assign programinfo to the context 895 897 */ 896 void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 898 void PlayerContext::SetPlayingInfo(const ProgramInfo *info, 899 PlaySettings *_settings) 897 900 { 898 901 bool ignoreDB = gCoreContext->IsDatabaseIgnored(); 899 902 … … 905 908 playingInfo->MarkAsInUse(false, recUsage); 906 909 delete playingInfo; 907 910 playingInfo = NULL; 911 // XXX delete settings? 908 912 } 909 913 910 914 if (info) … … 913 917 if (!ignoreDB) 914 918 playingInfo->MarkAsInUse(true, recUsage); 915 919 playingLen = playingInfo->GetSecondsInRecording(); 920 settings = (_settings ? _settings : 921 new PlaySettings(playingInfo->GetPlaybackGroup())); 916 922 } 917 923 } 918 924 -
libs/libmythtv/subtitlereader.cpp
65 65 av_free(subtitle.rects); 66 66 } 67 67 68 bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName) 68 bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName, 69 PlaySettings *settings) 69 70 { 70 71 m_TextSubtitles.Clear(); 71 return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles); 72 return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles, 73 settings); 72 74 } 73 75 74 76 bool SubtitleReader::HasTextSubtitles(void) -
libs/libmythtv/textsubtitleparser.h
17 17 // Qt headers 18 18 #include <QStringList> 19 19 20 class PlaySettings; 21 20 22 class text_subtitle_t 21 23 { 22 24 public: … … 79 81 class TextSubtitleParser 80 82 { 81 83 public: 82 static bool LoadSubtitles(QString fileName, TextSubtitles &target); 84 static bool LoadSubtitles(QString fileName, TextSubtitles &target, 85 PlaySettings *settings); 83 86 }; 84 87 85 88 #endif -
libs/libmythtv/vsync.cpp
34 34 35 35 #include "mythcontext.h" 36 36 #include "mythmainwindow.h" 37 #include "playsettings.h" 37 38 38 39 #ifdef USING_XV 39 40 #include "videoout_xv.h" … … 78 79 * \brief Returns the most sophisticated video sync method available. 79 80 */ 80 81 VideoSync *VideoSync::BestMethod(VideoOutput *video_output, 82 PlaySettings *settings, 81 83 uint frame_interval, uint refresh_interval, 82 84 bool halve_frame_interval) 83 85 { … … 102 104 #ifndef _WIN32 103 105 TESTVIDEOSYNC(DRMVideoSync); 104 106 #ifdef USING_OPENGL_VSYNC 105 if ( gCoreContext->GetNumSetting("UseOpenGLVSync", 1) &&107 if (settings->GetNumSetting("UseOpenGLVSync", 1) && 106 108 (getenv("NO_OPENGL_VSYNC") == NULL)) 107 109 { 108 110 TESTVIDEOSYNC(OpenGLVideoSync); -
libs/libmythtv/tv_play.cpp
57 57 #include "mythsystemevent.h" 58 58 #include "videometadatautil.h" 59 59 #include "mythdialogbox.h" 60 #include "playsettings.h" 60 61 61 62 #if ! HAVE_ROUND 62 63 #define round(x) ((int) ((x) + 0.5)) … … 207 208 bool startInGuide = flags & kStartTVInGuide; 208 209 bool inPlaylist = flags & kStartTVInPlayList; 209 210 bool initByNetworkCommand = flags & kStartTVByNetworkCommand; 210 TV *tv = new TV();211 211 bool quitAll = false; 212 212 bool showDialogs = true; 213 213 bool playCompleted = false; … … 221 221 curProgram->SetIgnoreBookmark(flags & kStartTVIgnoreBookmark); 222 222 } 223 223 224 PlaySettings settings(curProgram ? curProgram->GetPlaybackGroup() : "Default"); 225 TV *tv = new TV(&settings); 226 224 227 // Initialize TV 225 228 if (!tv->Init()) 226 229 { … … 251 254 if (curProgram) 252 255 { 253 256 VERBOSE(VB_PLAYBACK, LOC + "tv->Playback() -- begin"); 254 if (!tv->Playback(*curProgram ))257 if (!tv->Playback(*curProgram, &settings)) 255 258 { 256 259 quitAll = true; 257 260 } … … 842 845 class TVInitRunnable : public QRunnable 843 846 { 844 847 public: 845 TVInitRunnable(TV *ourTV) : tv(ourTV) {} 846 virtual void run(void) { tv->InitFromDB(); } 848 TVInitRunnable(TV *ourTV, PlaySettings *ourSettings) : 849 tv(ourTV), settings(ourSettings) {} 850 virtual void run(void) { tv->InitFromDB(settings); } 847 851 TV *tv; 852 PlaySettings *settings; 848 853 }; 849 854 850 855 /** \fn TV::TV(void) 851 856 * \sa Init(void) 852 857 */ 853 TV::TV( void)858 TV::TV(PlaySettings *settings) 854 859 : // Configuration variables from database 855 860 baseFilters(""), 856 861 db_channel_format("<num> <sign>"), … … 949 954 playerActive = 0; 950 955 playerLock.unlock(); 951 956 952 QThreadPool::globalInstance()->start(new TVInitRunnable(this ), 99);957 QThreadPool::globalInstance()->start(new TVInitRunnable(this, settings), 99); 953 958 954 959 VERBOSE(VB_PLAYBACK, LOC + "ctor -- end"); 955 960 } 956 961 957 void TV::InitFromDB( void)962 void TV::InitFromDB(PlaySettings *settings) 958 963 { 959 964 QMap<QString,QString> kv; 960 965 kv["LiveTVIdleTimeout"] = "0"; … … 999 1004 kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]); 1000 1005 1001 1006 MythDB::getMythDB()->GetSettings(kv); 1007 settings->AddToMap(kv); 1002 1008 1003 1009 // convert from minutes to ms. 1004 1010 db_idle_timeout = kv["LiveTVIdleTimeout"].toInt() * 60 * 1000; … … 1729 1735 askAllowLock.unlock(); 1730 1736 } 1731 1737 1732 int TV::Playback(const ProgramInfo &rcinfo )1738 int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings) 1733 1739 { 1734 1740 wantsToQuit = false; 1735 1741 jumpToProgram = false; … … 1743 1749 return 0; 1744 1750 } 1745 1751 1746 mctx->SetPlayingInfo(&rcinfo );1752 mctx->SetPlayingInfo(&rcinfo, settings); 1747 1753 mctx->SetInitialTVState(false); 1748 1754 ScheduleStateChange(mctx); 1749 1755 … … 1826 1832 1827 1833 if (fileexists) 1828 1834 { 1829 Playback(pginfo); 1835 PlaySettings settings("Default"); 1836 Playback(pginfo, &settings); 1830 1837 retval = 1; 1831 1838 } 1832 1839 … … 2167 2174 QString msg = tr("%1 Settings") 2168 2175 .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup())); 2169 2176 ctx->UnlockPlayingInfo(__FILE__, __LINE__); 2170 if (count > 0) 2177 if (count > 0 && 2178 ctx->playingInfo->GetPlaybackGroup() != "Default" && 2179 ctx->playingInfo->GetPlaybackGroup() != "Videos") 2171 2180 SetOSDMessage(ctx, msg); 2172 2181 ITVRestart(ctx, false); 2173 2182 } -
libs/libmythtv/videodisplayprofile.h
13 13 14 14 #include "mythcontext.h" 15 15 16 class PlaySettings; 17 16 18 typedef QMap<QString,QString> pref_map_t; 17 19 typedef QMap<QString,QStringList> safe_map_t; 18 20 typedef QStringList safe_list_t; … … 80 82 class MPUBLIC VideoDisplayProfile 81 83 { 82 84 public: 83 VideoDisplayProfile( );85 VideoDisplayProfile(PlaySettings *settings); 84 86 ~VideoDisplayProfile(); 85 87 86 88 void SetInput(const QSize &size); … … 124 126 static QString GetDecoderName(const QString &decoder); 125 127 static QString GetDecoderHelp(QString decoder = QString::null); 126 128 127 static QString GetDefaultProfileName(const QString &hostname); 129 static QString GetDefaultProfileName(const QString &hostname, 130 PlaySettings *settings); 128 131 static void SetDefaultProfileName(const QString &profilename, 129 132 const QString &hostname); 130 133 static uint GetProfileGroupID(const QString &profilename, -
libs/libmythtv/videoout_null.cpp
30 30 opts.priorities->insert("null", 10); 31 31 } 32 32 33 VideoOutputNull::VideoOutputNull( ) :34 VideoOutput( ), global_lock(QMutex::Recursive)33 VideoOutputNull::VideoOutputNull(PlaySettings *settings) : 34 VideoOutput(settings), global_lock(QMutex::Recursive) 35 35 { 36 36 VERBOSE(VB_PLAYBACK, "VideoOutputNull()"); 37 37 memset(&av_pause_frame, 0, sizeof(av_pause_frame)); -
libs/libmythtv/videooutbase.cpp
7 7 #include "mythplayer.h" 8 8 #include "videodisplayprofile.h" 9 9 #include "decoderbase.h" 10 #include "playsettings.h" 10 11 11 12 #include "mythcorecontext.h" 12 13 #include "mythverbose.h" … … 109 110 PIPState pipState, 110 111 const QSize &video_dim, float video_aspect, 111 112 WId win_id, const QRect &display_rect, 112 float video_prate, WId embed_id) 113 float video_prate, WId embed_id, 114 PlaySettings *settings) 113 115 { 114 116 (void) codec_priv; 115 117 … … 154 156 QString renderer = QString::null; 155 157 if (renderers.size() > 0) 156 158 { 157 VideoDisplayProfile vprof ;159 VideoDisplayProfile vprof(settings); 158 160 vprof.SetInput(video_dim); 159 161 160 162 QString tmp = vprof.GetVideoRenderer(); … … 182 184 183 185 #ifdef USING_DIRECTFB 184 186 if (renderer == "directfb") 185 vo = new VideoOutputDirectfb( );187 vo = new VideoOutputDirectfb(settings); 186 188 #endif // USING_DIRECTFB 187 189 188 190 #ifdef USING_MINGW 189 191 if (renderer == "direct3d") 190 vo = new VideoOutputD3D( );192 vo = new VideoOutputD3D(settings); 191 193 #endif // USING_MINGW 192 194 193 195 #ifdef USING_QUARTZ_VIDEO 194 196 if (osxlist.contains(renderer)) 195 vo = new VideoOutputQuartz( );197 vo = new VideoOutputQuartz(settings); 196 198 #endif // Q_OS_MACX 197 199 198 200 #ifdef USING_OPENGL_VIDEO 199 201 if (renderer == "opengl") 200 vo = new VideoOutputOpenGL( );202 vo = new VideoOutputOpenGL(settings); 201 203 #endif // USING_OPENGL_VIDEO 202 204 203 205 #ifdef USING_VDPAU 204 206 if (renderer == "vdpau") 205 vo = new VideoOutputVDPAU( );207 vo = new VideoOutputVDPAU(settings); 206 208 #endif // USING_VDPAU 207 209 208 210 #ifdef USING_XV 209 211 if (xvlist.contains(renderer)) 210 vo = new VideoOutputXv( );212 vo = new VideoOutputXv(settings); 211 213 #endif // USING_XV 212 214 213 215 if (vo) … … 305 307 * \brief This constructor for VideoOutput must be followed by an 306 308 * Init(int,int,float,WId,int,int,int,int,WId) call. 307 309 */ 308 VideoOutput::VideoOutput( ) :310 VideoOutput::VideoOutput(PlaySettings *_settings) : 309 311 // DB Settings 312 window(_settings), 310 313 db_display_dim(0,0), 311 314 db_aspectoverride(kAspect_Off), db_adjustfill(kAdjustFill_Off), 312 315 db_letterbox_colour(kLetterBoxColour_Black), … … 345 348 monitor_sz(640,480), monitor_dim(400,300), 346 349 347 350 // OSD 348 osd_painter(NULL), osd_image(NULL) 351 osd_painter(NULL), osd_image(NULL), 352 settings(_settings) 349 353 350 354 { 351 355 bzero(&pip_tmp_image, sizeof(pip_tmp_image)); 352 db_display_dim = QSize( gCoreContext->GetNumSetting("DisplaySizeWidth", 0),353 gCoreContext->GetNumSetting("DisplaySizeHeight", 0));356 db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth", 0), 357 settings->GetNumSetting("DisplaySizeHeight", 0)); 354 358 355 359 db_pict_attr[kPictureAttribute_Brightness] = 356 gCoreContext->GetNumSetting("PlaybackBrightness", 50);360 settings->GetNumSetting("PlaybackBrightness", 50); 357 361 db_pict_attr[kPictureAttribute_Contrast] = 358 gCoreContext->GetNumSetting("PlaybackContrast", 50);362 settings->GetNumSetting("PlaybackContrast", 50); 359 363 db_pict_attr[kPictureAttribute_Colour] = 360 gCoreContext->GetNumSetting("PlaybackColour", 50);364 settings->GetNumSetting("PlaybackColour", 50); 361 365 db_pict_attr[kPictureAttribute_Hue] = 362 gCoreContext->GetNumSetting("PlaybackHue", 0);366 settings->GetNumSetting("PlaybackHue", 0); 363 367 364 368 db_aspectoverride = (AspectOverrideMode) 365 gCoreContext->GetNumSetting("AspectOverride", 0);369 settings->GetNumSetting("AspectOverride", 0); 366 370 db_adjustfill = (AdjustFillMode) 367 gCoreContext->GetNumSetting("AdjustFill", 0);371 settings->GetNumSetting("AdjustFill", 0); 368 372 db_letterbox_colour = (LetterBoxColour) 369 gCoreContext->GetNumSetting("LetterboxColour", 0);373 settings->GetNumSetting("LetterboxColour", 0); 370 374 db_use_picture_controls = 371 gCoreContext->GetNumSetting("UseOutputPictureControls", 0);375 settings->GetNumSetting("UseOutputPictureControls", 0); 372 376 373 377 if (!gCoreContext->IsDatabaseIgnored()) 374 db_vdisp_profile = new VideoDisplayProfile( );378 db_vdisp_profile = new VideoDisplayProfile(settings); 375 379 } 376 380 377 381 /** … … 447 451 return QString::null; 448 452 } 449 453 450 bool VideoOutput::IsPreferredRenderer(QSize video_size )454 bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings) 451 455 { 452 456 if (!db_vdisp_profile || (video_size == window.GetVideoDispDim())) 453 457 return true; 454 458 455 VideoDisplayProfile vdisp ;459 VideoDisplayProfile vdisp(settings); 456 460 vdisp.SetInput(video_size); 457 461 QString new_rend = vdisp.GetVideoRenderer(); 458 462 if (new_rend.isEmpty()) -
libs/libmythtv/videooutwindow.h
16 16 #include "videoouttypes.h" 17 17 18 18 class MythPlayer; 19 class PlaySettings; 19 20 20 21 class VideoOutWindow 21 22 { 22 23 public: 23 VideoOutWindow( );24 VideoOutWindow(PlaySettings *settings); 24 25 25 26 bool Init(const QSize &new_video_dim, float aspect, 26 27 const QRect &new_display_visible_rect, … … 164 165 bool allowpreviewepg; 165 166 PIPState pip_state; 166 167 168 PlaySettings *settings; 169 167 170 // Constants 168 171 static const float kManualZoomMaxHorizontalZoom; 169 172 static const float kManualZoomMaxVerticalZoom; -
libs/libmythtv/videoout_directfb.h
12 12 { 13 13 public: 14 14 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 15 VideoOutputDirectfb( );15 VideoOutputDirectfb(PlaySettings *settings); 16 16 ~VideoOutputDirectfb(); 17 17 18 18 bool Init(int width, int height, float aspect, WId winid, -
libs/libmythtv/playercontext.h
28 28 class LiveTVChain; 29 29 class MythDialog; 30 30 class QPainter; 31 class PlaySettings; 31 32 32 33 struct osdInfo 33 34 { … … 112 113 void SetRecorder(RemoteEncoder *rec); 113 114 void SetTVChain(LiveTVChain *chain); 114 115 void SetRingBuffer(RingBuffer *buf); 115 void SetPlayingInfo(const ProgramInfo *info );116 void SetPlayingInfo(const ProgramInfo *info, PlaySettings *settings=NULL); 116 117 void SetPlayGroup(const QString &group); 117 118 void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state); 118 119 void SetPIPLocation(int loc) { pipLocation = loc; } … … 170 171 LiveTVChain *tvchain; 171 172 RingBuffer *buffer; 172 173 ProgramInfo *playingInfo; ///< Currently playing info 174 PlaySettings *settings; // corresponding to playingInfo 173 175 long long playingLen; ///< Initial CalculateLength() 174 176 AVSpecialDecode specialDecode; 175 177 bool nohardwaredecoders; // < Disable use of VDPAU decoding -
libs/libmythtv/vsync.h
87 87 88 88 // documented in vsync.cpp 89 89 static VideoSync *BestMethod(VideoOutput*, 90 PlaySettings *settings, 90 91 uint frame_interval, uint refresh_interval, 91 92 bool interlaced); 92 93 protected: -
libs/libmythtv/videoout_xv.h
51 51 friend class XvMCOSD; 52 52 public: 53 53 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 54 VideoOutputXv( );54 VideoOutputXv(PlaySettings *settings); 55 55 ~VideoOutputXv(); 56 56 57 57 bool Init(int width, int height, float aspect, WId winid, … … 109 109 static MythCodecID GetBestSupportedCodec(uint width, uint height, 110 110 uint osd_width, uint osd_height, 111 111 uint stream_type, int xvmc_chroma, 112 bool test_surface, bool force_xv); 112 bool test_surface, bool force_xv, 113 PlaySettings *settings); 113 114 114 115 static int GrabSuitableXvPort(MythXDisplay* disp, Window root, 116 PlaySettings *settings, 115 117 MythCodecID type, 116 118 uint width, uint height, 117 119 bool &xvsetdefaults, -
libs/libmythtv/videoout_xv.cpp
170 170 * \see VideoOutput, VideoBuffers 171 171 * 172 172 */ 173 VideoOutputXv::VideoOutputXv( )174 : VideoOutput( ),173 VideoOutputXv::VideoOutputXv(PlaySettings *settings) 174 : VideoOutput(settings), 175 175 video_output_subtype(XVUnknown), 176 176 global_lock(QMutex::Recursive), 177 177 … … 395 395 * \return port number if it succeeds, else -1. 396 396 */ 397 397 int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root, 398 PlaySettings *settings, 398 399 MythCodecID mcodecid, 399 400 uint width, uint height, 400 401 bool &xvsetdefaults, … … 479 480 } 480 481 481 482 // figure out if we want chromakeying.. 482 VideoDisplayProfile vdp ;483 VideoDisplayProfile vdp(settings); 483 484 vdp.SetInput(QSize(width, height)); 484 485 bool check_for_colorkey = (vdp.GetOSDRenderer() == "chromakey"); 485 486 … … 767 768 disp->StartLog(); 768 769 QString adaptor_name = QString::null; 769 770 const QSize video_dim = window.GetVideoDim(); 770 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), video_codec_id,771 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, video_codec_id, 771 772 video_dim.width(), video_dim.height(), 772 773 xv_set_defaults, 773 774 xvmc_chroma, &xvmc_surf_info, &adaptor_name); … … 846 847 disp->StartLog(); 847 848 QString adaptor_name = QString::null; 848 849 const QSize video_dim = window.GetVideoDim(); 849 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), kCodec_MPEG2,850 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, kCodec_MPEG2, 850 851 video_dim.width(), video_dim.height(), 851 852 xv_set_defaults, 0, NULL, &adaptor_name); 852 853 if (xv_port == -1) … … 1000 1001 uint width, uint height, 1001 1002 uint osd_width, uint osd_height, 1002 1003 uint stream_type, int xvmc_chroma, 1003 bool test_surface, bool force_xv) 1004 bool test_surface, bool force_xv, 1005 PlaySettings *settings) 1004 1006 { 1005 1007 (void)width, (void)height, (void)osd_width, (void)osd_height; 1006 1008 (void)stream_type, (void)xvmc_chroma, (void)test_surface; … … 1011 1013 return ret; 1012 1014 1013 1015 #ifdef USING_XVMC 1014 VideoDisplayProfile vdp ;1016 VideoDisplayProfile vdp(settings); 1015 1017 vdp.SetInput(QSize(width, height)); 1016 1018 QString dec = vdp.GetDecoder(); 1017 1019 if ((dec == "libmpeg2") || (dec == "ffmpeg")) … … 1061 1063 1062 1064 ok = false; 1063 1065 bool dummy; 1064 int port = GrabSuitableXvPort(disp, disp->GetRoot(), ret, width, height, 1066 int port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, 1067 ret, width, height, 1065 1068 dummy, xvmc_chroma, &info); 1066 1069 if (port >= 0) 1067 1070 { -
libs/libmythtv/mythplayer.cpp
60 60 #include "mythpainter.h" 61 61 #include "mythimage.h" 62 62 #include "mythuiimage.h" 63 #include "playsettings.h" 63 64 64 65 extern "C" { 65 66 #include "vbitext/vbi.h" … … 247 248 output_jmeter(NULL) 248 249 { 249 250 playerThread = QThread::currentThread(); 250 // Playback (output) zoom control251 detect_letter_box = new DetectLetterbox(this);252 251 253 vbimode = VBIMode::Parse(gCoreContext->GetSetting("VbiFormat"));254 decode_extra_audio = gCoreContext->GetNumSetting("DecodeExtraAudio", 0);255 itvEnabled = gCoreContext->GetNumSetting("EnableMHEG", 0);256 db_prefer708 = gCoreContext->GetNumSetting("Prefer708Captions", 1);257 258 252 bzero(&tc_lastval, sizeof(tc_lastval)); 259 253 bzero(&tc_wrap, sizeof(tc_wrap)); 260 254 … … 492 486 if (using_null_videoout && GetDecoder()) 493 487 { 494 488 MythCodecID codec = GetDecoder()->GetVideoCodecID(); 495 videoOutput = new VideoOutputNull( );489 videoOutput = new VideoOutputNull(GetPlaySettings()); 496 490 if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(), 497 491 video_aspect, 0, 0, 0, 0, 0, codec, 0)) 498 492 { … … 542 536 pipState, 543 537 video_disp_dim, video_aspect, 544 538 widget->winId(), display_rect, (video_frame_rate * play_speed), 545 0 /*embedid*/ );539 0 /*embedid*/, GetPlaySettings()); 546 540 } 547 541 548 542 if (videoOutput) … … 632 626 633 627 void MythPlayer::ReinitVideo(void) 634 628 { 635 if (!videoOutput->IsPreferredRenderer(video_disp_dim ))629 if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings())) 636 630 { 637 631 VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer.")); 638 632 SetErrored(QObject::tr("Need to switch video renderer.")); … … 1974 1968 } 1975 1969 #endif // USING_MHEG 1976 1970 1977 SetCaptionsEnabled(gCoreContext->GetNumSetting("DefaultCCMode"), false); 1971 SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0), 1972 false); 1978 1973 } 1979 1974 1980 1975 SetPlaying(true); … … 2020 2015 m_double_process = videoOutput->IsExtraProcessingRequired(); 2021 2016 2022 2017 videosync = VideoSync::BestMethod( 2023 videoOutput, fr_int, rf_int, m_double_framerate); 2018 videoOutput, GetPlaySettings(), 2019 fr_int, rf_int, m_double_framerate); 2024 2020 2025 2021 // Make sure video sync can do it 2026 2022 if (videosync != NULL && m_double_framerate) … … 2383 2379 if (bookmarkseek > 30) 2384 2380 { 2385 2381 DoFastForward(bookmarkseek, true, false); 2386 if ( gCoreContext->GetNumSetting("ClearSavedPosition", 1) &&2382 if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) && 2387 2383 !player_ctx->IsPIP()) 2388 2384 { 2389 2385 ClearBookmark(false); … … 2597 2593 { 2598 2594 if (jumpto == totalFrames) 2599 2595 { 2600 if (!( gCoreContext->GetNumSetting("EndOfRecordingExitPrompt") == 12596 if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1 2601 2597 && !player_ctx->IsPIP() && 2602 2598 player_ctx->GetState() == kState_WatchingPreRecorded)) 2603 2599 { … … 2864 2860 return kPIP_END; 2865 2861 2866 2862 if (pip_players.isEmpty()) 2867 return (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft); 2863 return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation", 2864 kPIPTopLeft); 2868 2865 2869 2866 // order of preference, could be stored in db if we want it configurable 2870 2867 PIPLocation ols[] = … … 3362 3359 exactseeks = frame_exact_seek; 3363 3360 player_ctx = ctx; 3364 3361 livetv = ctx->tvchain; 3362 3363 vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", "")); 3364 3365 // Playback (output) zoom control 3366 detect_letter_box = new DetectLetterbox(this); 3367 3368 decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0); 3369 itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0); 3370 db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1); 3365 3371 } 3366 3372 3367 3373 bool MythPlayer::EnableEdit(void) -
libs/libmythtv/videooutbase.h
32 32 class FilterChain; 33 33 class FilterManager; 34 34 class OpenGLContextGLX; 35 class PlaySettings; 35 36 36 37 typedef QMap<MythPlayer*,PIPLocation> PIPMap; 37 38 … … 52 53 PIPState pipState, 53 54 const QSize &video_dim, float video_aspect, 54 55 WId win_id, const QRect &display_rect, 55 float video_prate, WId embed_id); 56 float video_prate, WId embed_id, 57 PlaySettings *settings); 56 58 57 VideoOutput( );59 VideoOutput(PlaySettings *settings); 58 60 virtual ~VideoOutput(); 59 61 60 62 virtual bool Init(int width, int height, float aspect, … … 62 64 int winh, MythCodecID codec_id, WId embedid = 0); 63 65 virtual void InitOSD(OSD *osd); 64 66 virtual void SetVideoFrameRate(float); 65 virtual bool IsPreferredRenderer(QSize video_size );67 virtual bool IsPreferredRenderer(QSize video_size, PlaySettings *settings); 66 68 virtual bool SetDeinterlacingEnabled(bool); 67 69 virtual bool SetupDeinterlace(bool i, const QString& ovrf=""); 68 70 virtual void FallbackDeint(void); … … 338 340 // OSD painter and surface 339 341 MythYUVAPainter *osd_painter; 340 342 MythImage *osd_image; 343 344 PlaySettings *settings; 341 345 }; 342 346 343 347 #endif -
libs/libmythtv/textsubtitleparser.cpp
21 21 #include "RingBuffer.h" 22 22 #include "textsubtitleparser.h" 23 23 #include "xine_demux_sputext.h" 24 #include "playsettings.h" 24 25 25 26 static bool operator<(const text_subtitle_t& left, 26 27 const text_subtitle_t& right) … … 116 117 m_lock.unlock(); 117 118 } 118 119 119 bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target) 120 bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target, 121 PlaySettings *settings) 120 122 { 121 123 demux_sputext_t sub_data; 122 124 sub_data.rbuffer = new RingBuffer(fileName, 0, false); … … 134 136 target.SetFrameBasedTiming(!sub_data.uses_time); 135 137 136 138 QTextCodec *textCodec = NULL; 137 QString codec = gCoreContext->GetSetting("SubtitleCodec", "");139 QString codec = settings->GetSetting("SubtitleCodec", ""); 138 140 if (!codec.isEmpty()) 139 141 textCodec = QTextCodec::codecForName(codec.toLatin1()); 140 142 if (!textCodec) -
libs/libmythtv/subtitlescreen.cpp
7 7 #include "mythuiimage.h" 8 8 #include "mythpainter.h" 9 9 #include "subtitlescreen.h" 10 #include "playsettings.h" 10 11 11 12 #define LOC QString("Subtitles: ") 12 13 #define LOC_WARN QString("Subtitles Warning: ") … … 63 64 VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-608 reader."); 64 65 if (!m_708reader) 65 66 VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-708 reader."); 66 m_useBackground = (bool) gCoreContext->GetNumSetting("CCBackground", 0);67 m_textFontZoom = gCoreContext->GetNumSetting("OSDCC708TextZoom", 100);67 m_useBackground = (bool)m_player->GetPlaySettings()->GetNumSetting("CCBackground", 0); 68 m_textFontZoom = m_player->GetPlaySettings()->GetNumSetting("OSDCC708TextZoom", 100); 68 69 return true; 69 70 } 70 71 -
libs/libmythtv/videoout_quartz.h
2 2 #define VIDEOOUT_QUARTZ_H_ 3 3 4 4 struct QuartzData; 5 class PlaySettings; 5 6 6 7 #include "videooutbase.h" 7 8 … … 9 10 { 10 11 public: 11 12 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 12 VideoOutputQuartz( );13 VideoOutputQuartz(PlaySettings *settings); 13 14 ~VideoOutputQuartz(); 14 15 15 16 bool Init(int width, int height, float aspect, WId winid, … … 52 53 static MythCodecID GetBestSupportedCodec( 53 54 uint width, uint height, 54 55 uint osd_width, uint osd_height, 55 uint stream_type, uint fourcc );56 uint stream_type, uint fourcc, PlaySettings *settings); 56 57 virtual bool NeedExtraAudioDecode(void) const 57 58 { return !codec_is_std(video_codec_id); } 58 59 -
libs/libmythtv/videodisplayprofile.cpp
8 8 #include "mythverbose.h" 9 9 #include "videooutbase.h" 10 10 #include "avformatdecoder.h" 11 #include "playsettings.h" 11 12 12 13 bool ProfileItem::IsMatch(const QSize &size, float rate) const 13 14 { … … 212 213 pref_map_t VideoDisplayProfile::dec_name; 213 214 safe_list_t VideoDisplayProfile::safe_decoders; 214 215 215 VideoDisplayProfile::VideoDisplayProfile( )216 VideoDisplayProfile::VideoDisplayProfile(PlaySettings *settings) 216 217 : lock(QMutex::Recursive), last_size(0,0), last_rate(0.0f), 217 218 last_video_renderer(QString::null) 218 219 { … … 220 221 init_statics(); 221 222 222 223 QString hostname = gCoreContext->GetHostName(); 223 QString cur_profile = GetDefaultProfileName(hostname );224 QString cur_profile = GetDefaultProfileName(hostname, settings); 224 225 uint groupid = GetProfileGroupID(cur_profile, hostname); 225 226 226 227 item_list_t items = LoadDB(groupid); … … 772 773 return list; 773 774 } 774 775 775 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname) 776 QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname, 777 PlaySettings *settings) 776 778 { 777 779 QString tmp = 780 settings ? settings->GetSetting("DefaultVideoPlaybackProfile", "") : 778 781 gCoreContext->GetSettingOnHost("DefaultVideoPlaybackProfile", hostname); 779 782 780 783 QStringList profiles = GetProfiles(hostname); -
libs/libmythtv/videoout_null.h
9 9 { 10 10 public: 11 11 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 12 VideoOutputNull( );12 VideoOutputNull(PlaySettings *settings); 13 13 ~VideoOutputNull(); 14 14 15 15 bool Init(int width, int height, float aspect, WId winid, -
libs/libmyth/settings.cpp
235 235 return -1; 236 236 } 237 237 238 QString SelectSetting::GetValueLabel(const QString &value) 239 { 240 selectionList::const_iterator iterValues = values.begin(); 241 selectionList::const_iterator iterLabels = labels.begin(); 242 for (; iterValues != values.end() && iterLabels != labels.end(); 243 ++iterValues, ++iterLabels) 244 { 245 if (*iterValues == value) 246 return *iterLabels; 247 } 248 249 return "???"; 250 } 251 238 252 bool SelectSetting::ReplaceLabel(const QString &new_label, const QString &value) 239 253 { 240 254 int i = getValueIndex(value); … … 299 313 QLabel *label = new QLabel(); 300 314 label->setText(getLabel() + ": "); 301 315 layout->addWidget(label); 316 labelWidget = label; 302 317 } 303 318 304 319 bxwidget = widget; … … 327 342 328 343 widget->setLayout(layout); 329 344 345 setValue(getValue()); 346 330 347 return widget; 331 348 } 332 349 … … 336 353 { 337 354 bxwidget = NULL; 338 355 edit = NULL; 356 labelWidget = NULL; 339 357 } 340 358 } 341 359 … … 373 391 Setting::setHelpText(str); 374 392 } 375 393 394 static void adjustFont(QWidget *widget, bool isDefault) 395 { 396 if (widget) 397 { 398 QFont f = widget->font(); 399 f.setWeight(isDefault ? QFont::Light : QFont::Bold); 400 widget->setFont(f); 401 } 402 } 403 404 void LineEditSetting::setValue(const QString &newValue) 405 { 406 if (adjustOnBlank) 407 { 408 adjustFont(labelWidget, newValue.isEmpty()); 409 adjustFont(edit, newValue.isEmpty()); 410 } 411 Setting::setValue(newValue); 412 } 413 376 414 void BoundedIntegerSetting::setValue(int newValue) 377 415 { 378 416 newValue = std::max(std::min(newValue, max), min); … … 439 477 440 478 SpinBoxSetting::SpinBoxSetting( 441 479 Storage *_storage, int _min, int _max, int _step, 442 bool _allow_single_step, QString _special_value_text) : 480 bool _allow_single_step, QString _special_value_text, 481 bool change_style_on_special) : 443 482 BoundedIntegerSetting(_storage, _min, _max, _step), 444 483 spinbox(NULL), relayEnabled(true), 445 sstep(_allow_single_step), svtext("") 484 sstep(_allow_single_step), svtext(""), labelWidget(NULL), 485 changeOnSpecial(change_style_on_special) 446 486 { 447 487 if (!_special_value_text.isEmpty()) 448 488 svtext = _special_value_text; … … 476 516 QLabel *label = new QLabel(); 477 517 label->setText(getLabel() + ": "); 478 518 layout->addWidget(label); 519 labelWidget = label; 479 520 } 480 521 481 522 bxwidget = widget; … … 506 547 507 548 widget->setLayout(layout); 508 549 550 setValue(intValue()); 551 509 552 return widget; 510 553 } 511 554 … … 515 558 { 516 559 bxwidget = NULL; 517 560 spinbox = NULL; 561 labelWidget = NULL; 518 562 } 519 563 } 520 564 521 565 void SpinBoxSetting::setValue(int newValue) 522 566 { 523 567 newValue = std::max(std::min(newValue, max), min); 568 if (changeOnSpecial) 569 { 570 adjustFont(labelWidget, (newValue == min)); 571 adjustFont(spinbox, (newValue == min)); 572 } 524 573 if (spinbox && (spinbox->value() != newValue)) 525 574 { 526 575 //int old = intValue(); … … 631 680 QLabel *label = new QLabel(); 632 681 label->setText(getLabel() + ": "); 633 682 layout->addWidget(label); 683 labelWidget = label; 634 684 } 635 685 636 686 bxwidget = widget; … … 659 709 cbwidget, SLOT(clear())); 660 710 661 711 if (rw) 712 { 662 713 connect(cbwidget, SIGNAL(editTextChanged(const QString &)), 663 714 this, SLOT(editTextChanged(const QString &))); 715 connect(cbwidget, SIGNAL(editTextChanged(const QString &)), 716 this, SLOT(changeLabel(const QString &))); 717 } 664 718 665 719 if (cg) 666 720 connect(cbwidget, SIGNAL(changeHelpText(QString)), cg, … … 673 727 674 728 widget->setLayout(layout); 675 729 730 setValue(current); 731 676 732 return widget; 677 733 } 678 734 … … 682 738 { 683 739 bxwidget = NULL; 684 740 cbwidget = NULL; 741 labelWidget = NULL; 685 742 } 686 743 } 687 744 … … 717 774 718 775 if (rw) 719 776 { 777 changeLabel(newValue); 720 778 Setting::setValue(newValue); 721 779 if (cbwidget) 722 780 cbwidget->setCurrentIndex(current); … … 727 785 { 728 786 if (cbwidget) 729 787 cbwidget->setCurrentIndex(which); 788 changeLabel(labels[which]); 730 789 SelectSetting::setValue(which); 731 790 } 732 791 733 void ComboBoxSetting::addSelection( 734 const QString &label, QString value, bool select) 792 void ComboBoxSetting::changeLabel(const QString &newLabel) 735 793 { 794 if (changeOnSpecial) 795 { 796 adjustFont(labelWidget, specialLabel == newLabel); 797 adjustFont(cbwidget, specialLabel == newLabel); 798 } 799 } 800 801 void ComboBoxSetting::addSelection(const QString &label, QString value, 802 bool select, bool special_formatting) 803 { 736 804 if ((findSelection(label, value) < 0) && cbwidget) 737 805 { 738 806 resetMaxCount(cbwidget->count()+1); 739 807 cbwidget->insertItem(label); 740 808 } 741 809 810 if (special_formatting) 811 { 812 changeOnSpecial = true; 813 specialLabel = label; 814 } 815 742 816 SelectSetting::addSelection(label, value, select); 743 817 744 818 if (cbwidget && isSet) … … 955 1029 BooleanSetting::setHelpText(str); 956 1030 } 957 1031 1032 QWidget* TristateCheckBoxSetting::configWidget(ConfigurationGroup *cg, 1033 QWidget* parent, 1034 const char* widgetName) { 1035 widget = new MythCheckBox(parent, widgetName, true); 1036 connect(widget, SIGNAL(destroyed(QObject*)), 1037 this, SLOT(widgetDeleted(QObject*))); 1038 1039 widget->setHelpText(getHelpText()); 1040 widget->setText(getLabel()); 1041 widget->setCheckState(tristateValue()); 1042 setValue(tristateValue()); 1043 1044 connect(widget, SIGNAL(stateChanged(int)), 1045 this, SLOT(setValue(int))); 1046 connect(this, SIGNAL(valueChanged(int)), 1047 this, SLOT(relayValueChanged(int))); 1048 1049 if (cg) 1050 connect(widget, SIGNAL(changeHelpText(QString)), cg, 1051 SIGNAL(changeHelpText(QString))); 1052 1053 return widget; 1054 } 1055 1056 void TristateCheckBoxSetting::widgetInvalid(QObject *obj) 1057 { 1058 widget = (widget == obj) ? NULL : widget; 1059 } 1060 1061 void TristateCheckBoxSetting::setEnabled(bool fEnabled) 1062 { 1063 TristateSetting::setEnabled(fEnabled); 1064 if (widget) 1065 widget->setEnabled(fEnabled); 1066 } 1067 1068 void TristateCheckBoxSetting::setHelpText(const QString &str) 1069 { 1070 if (widget) 1071 widget->setHelpText(str); 1072 TristateSetting::setHelpText(str); 1073 } 1074 1075 const char *TristateSetting::kPartiallyCheckedString = "default"; 1076 1077 void TristateCheckBoxSetting::setValue(int check) 1078 { 1079 adjustFont(widget, (check != Qt::Checked && check != Qt::Unchecked)); 1080 TristateSetting::setValue(check); 1081 emit valueChanged(check); 1082 } 1083 1084 void TristateSetting::setValue(int check) 1085 { 1086 if (check == Qt::Checked) 1087 Setting::setValue("1"); 1088 else if (check == Qt::Unchecked) 1089 Setting::setValue("0"); 1090 else 1091 Setting::setValue(kPartiallyCheckedString); 1092 emit valueChanged(check); 1093 } 1094 958 1095 void AutoIncrementDBSetting::Save(QString table) 959 1096 { 960 1097 if (intValue() == 0) … … 1142 1279 addSelection(label, value, select); 1143 1280 } 1144 1281 1282 void ImageSelectSetting::addDefaultSelection(const QString label, 1283 const QString value, 1284 const QString defaultValue, 1285 bool select) 1286 { 1287 for (unsigned i=0; i<values.size(); i++) 1288 { 1289 if (values[i] == defaultValue) 1290 { 1291 changeOnSpecial = true; 1292 specialLabel = label; 1293 images.push_back(new QImage(*images[i])); 1294 addSelection(label, value, select); 1295 return; 1296 } 1297 } 1298 } 1299 1145 1300 ImageSelectSetting::~ImageSelectSetting() 1146 1301 { 1147 1302 Teardown(); … … 1164 1319 bxwidget = NULL; 1165 1320 imagelabel = NULL; 1166 1321 combo = NULL; 1322 labelWidget = NULL; 1167 1323 } 1168 1324 1169 1325 void ImageSelectSetting::imageSet(int num) … … 1211 1367 QLabel *label = new QLabel(); 1212 1368 label->setText(getLabel() + ":"); 1213 1369 layout->addWidget(label); 1370 labelWidget = label; 1214 1371 } 1215 1372 1216 1373 combo = new MythComboBox(false); … … 1257 1414 connect(combo, SIGNAL(highlighted(int)), this, SLOT(imageSet(int))); 1258 1415 connect(combo, SIGNAL(activated(int)), this, SLOT(setValue(int))); 1259 1416 connect(combo, SIGNAL(activated(int)), this, SLOT(imageSet(int))); 1417 connect(combo, SIGNAL(highlighted(const QString &)), 1418 this, SLOT(changeLabel(const QString &))); 1419 connect(combo, SIGNAL(activated(const QString &)), 1420 this, SLOT(changeLabel(const QString &))); 1260 1421 1261 1422 connect(this, SIGNAL(selectionsCleared()), 1262 1423 combo, SLOT(clear())); … … 1267 1428 1268 1429 bxwidget->setLayout(layout); 1269 1430 1431 changeLabel(GetLabel(current)); 1432 1270 1433 return bxwidget; 1271 1434 } 1272 1435 1436 void ImageSelectSetting::changeLabel(const QString &newLabel) 1437 { 1438 if (changeOnSpecial) 1439 { 1440 adjustFont(labelWidget, specialLabel == newLabel); 1441 adjustFont(combo, specialLabel == newLabel); 1442 } 1443 } 1444 1273 1445 void ImageSelectSetting::widgetInvalid(QObject *obj) 1274 1446 { 1275 1447 if (bxwidget == obj) -
libs/libmyth/mythwidgets.cpp
224 224 else if (action == "DOWN") 225 225 focusNextPrevChild(true); 226 226 else if (action == "LEFT" || action == "RIGHT" || action == "SELECT") 227 toggle(); 227 { 228 if (isTristate()) 229 { 230 Qt::CheckState newState = 231 (Qt::CheckState)(((int)checkState() + 1) % 3); 232 setCheckState(newState); 233 } 234 else 235 toggle(); 236 } 228 237 else 229 238 handled = false; 230 239 } -
libs/libmyth/settings.h
134 134 135 135 class MPUBLIC LineEditSetting : public Setting 136 136 { 137 Q_OBJECT 138 137 139 protected: 138 LineEditSetting(Storage *_storage, bool readwrite = true) : 140 LineEditSetting(Storage *_storage, bool readwrite = true, 141 bool adjust_on_blank = false) : 139 142 Setting(_storage), bxwidget(NULL), edit(NULL), 140 rw(readwrite), password_echo(false) { } 143 rw(readwrite), password_echo(false), 144 adjustOnBlank(adjust_on_blank), labelWidget(NULL) { } 141 145 142 146 public: 143 147 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, … … 159 163 160 164 virtual void setHelpText(const QString &str); 161 165 166 public slots: 167 virtual void setValue(const QString &newValue); 168 162 169 private: 163 170 QWidget *bxwidget; 164 171 MythLineEdit *edit; 165 172 bool rw; 166 173 bool password_echo; 174 bool adjustOnBlank; 175 QWidget *labelWidget; 167 176 }; 168 177 169 178 // TODO: set things up so that setting the value as a string emits … … 219 228 public: 220 229 SpinBoxSetting(Storage *_storage, int min, int max, int step, 221 230 bool allow_single_step = false, 222 QString special_value_text = ""); 231 QString special_value_text = "", 232 bool change_style_on_special = false); 223 233 224 234 virtual QWidget *configWidget(ConfigurationGroup *cg, QWidget *parent, 225 235 const char *widgetName = 0); … … 248 258 bool relayEnabled; 249 259 bool sstep; 250 260 QString svtext; 261 QLabel *labelWidget; 262 bool changeOnSpecial; 251 263 }; 252 264 253 265 class MPUBLIC SelectSetting : public Setting … … 277 289 { return (i < labels.size()) ? labels[i] : QString::null; } 278 290 virtual QString GetValue(uint i) const 279 291 { return (i < values.size()) ? values[i] : QString::null; } 292 virtual QString GetValueLabel(const QString &value); 280 293 281 294 signals: 282 295 void selectionAdded(const QString& label, QString value); … … 318 331 protected: 319 332 ComboBoxSetting(Storage *_storage, bool _rw = false, int _step = 1) : 320 333 SelectSetting(_storage), rw(_rw), 321 bxwidget(NULL), cbwidget(NULL), step(_step) { } 334 bxwidget(NULL), cbwidget(NULL), changeOnSpecial(false), 335 specialLabel(""), labelWidget(NULL), step(_step) { } 322 336 323 337 public: 324 338 virtual void setValue(QString newValue); … … 340 354 public slots: 341 355 void addSelection(const QString &label, 342 356 QString value = QString::null, 343 bool select = false); 357 bool select = false, 358 bool special_formatting = false); 344 359 bool removeSelection(const QString &label, 345 360 QString value = QString::null); 361 virtual void changeLabel(const QString &newValue); 346 362 void editTextChanged(const QString &newText); 347 363 348 364 private: 349 365 bool rw; 350 366 QWidget *bxwidget; 351 367 MythComboBox *cbwidget; 368 bool changeOnSpecial; 369 QString specialLabel; 370 QLabel *labelWidget; 352 371 353 372 protected: 354 373 int step; … … 417 436 ImageSelectSetting(Storage *_storage) : 418 437 SelectSetting(_storage), 419 438 bxwidget(NULL), imagelabel(NULL), combo(NULL), 420 m_hmult(1.0f), m_wmult(1.0f) { } 439 m_hmult(1.0f), m_wmult(1.0f), 440 changeOnSpecial(false), specialLabel(""), labelWidget(NULL) { } 421 441 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 422 442 const char* widgetName = 0); 423 443 virtual void widgetInvalid(QObject *obj); … … 428 448 QImage* image, 429 449 QString value=QString::null, 430 450 bool select=false); 451 virtual void addDefaultSelection(const QString label, 452 const QString value, 453 const QString defaultValue, 454 bool select); 431 455 432 456 protected slots: 433 457 void imageSet(int); 458 void changeLabel(const QString &newLabel); 434 459 435 460 protected: 436 461 void Teardown(void); … … 442 467 QLabel *imagelabel; 443 468 MythComboBox *combo; 444 469 float m_hmult, m_wmult; 470 bool changeOnSpecial; 471 QString specialLabel; 472 QLabel *labelWidget; 445 473 }; 446 474 447 475 class MPUBLIC BooleanSetting : public Setting … … 484 512 MythCheckBox *widget; 485 513 }; 486 514 515 class MPUBLIC TristateSetting : public BooleanSetting 516 { 517 Q_OBJECT 518 519 public: 520 TristateSetting(Storage *_storage) : BooleanSetting(_storage) {} 521 522 Qt::CheckState tristateValue(void) const { 523 if (getValue() == "0") 524 return Qt::Unchecked; 525 if (getValue() == "1") 526 return Qt::Checked; 527 return Qt::PartiallyChecked; 528 } 529 530 static const char *kPartiallyCheckedString; 531 532 public slots: 533 virtual void setValue(/*Qt::CheckState*/int check); 534 535 signals: 536 void valueChanged(int); 537 }; 538 539 class MPUBLIC TristateCheckBoxSetting: public TristateSetting { 540 Q_OBJECT 541 542 public: 543 TristateCheckBoxSetting(Storage *_storage) : 544 TristateSetting(_storage), widget(NULL) { } 545 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 546 const char* widgetName = 0); 547 virtual void widgetInvalid(QObject*); 548 549 virtual void setEnabled(bool b); 550 551 virtual void setHelpText(const QString &str); 552 553 554 public slots: 555 virtual void setValue(/*Qt::CheckState*/int check); 556 virtual void relayValueChanged(int state) { 557 if (widget) 558 widget->setCheckState((Qt::CheckState)state); 559 } 560 561 protected: 562 MythCheckBox *widget; 563 }; 564 487 565 class MPUBLIC PathSetting : public ComboBoxSetting 488 566 { 489 567 public: -
libs/libmyth/libmyth.pro
62 62 SOURCES += mythrssmanager.cpp netgrabbermanager.cpp 63 63 SOURCES += rssparse.cpp netutils.cpp 64 64 65 HEADERS += playsettings.h 66 SOURCES += playsettings.cpp 67 65 68 # remove when everything is switched to mythui 66 69 SOURCES += virtualkeyboard_qt.cpp 67 70 -
libs/libmyth/mythconfiggroups.cpp
476 476 Configurable *target) 477 477 { 478 478 VerifyLayout(); 479 bool isDuplicate = triggerMap.values().contains(target); 479 480 triggerMap[triggerValue] = target; 480 481 481 482 if (!configStack) … … 485 486 configStack->setSaveAll(isSaveAll); 486 487 } 487 488 488 configStack->addChild(target); 489 // Don't add a target as a child if it has already been added, 490 // otherwise something goes wrong with signals in the child. 491 if (!isDuplicate) 492 configStack->addChild(target); 489 493 } 490 494 491 495 Setting *TriggeredConfigurationGroup::byName(const QString &settingName) -
libs/libmyth/mythwidgets.h
329 329 Q_OBJECT 330 330 331 331 public: 332 MythCheckBox(QWidget *parent = 0, const char *name = "MythCheckBox") 333 : QCheckBox(parent) { setObjectName(name); }; 332 MythCheckBox(QWidget *parent = 0, const char *name = "MythCheckBox", 333 bool isTristate = false) : QCheckBox(parent) 334 { 335 setObjectName(name); 336 setTristate(isTristate); 337 } 334 338 MythCheckBox(const QString &text, 335 QWidget *parent = 0, const char *name = "MythCheckBox") 336 : QCheckBox(text, parent) { setObjectName(name); }; 339 QWidget *parent = 0, const char *name = "MythCheckBox", 340 bool isTristate = false) : QCheckBox(text, parent) 341 { 342 setObjectName(name); 343 setTristate(isTristate); 344 } 337 345 338 346 void setHelpText(const QString&); 339 347 -
programs/mythfrontend/globalsettings.cpp
38 38 #include "mythconfig.h" 39 39 #include "mythdirs.h" 40 40 #include "mythuihelper.h" 41 #include "playsettings.h" 41 42 43 #define CREATE_CHECKBOX_SETTING(var, name, settings) \ 44 BooleanSetting *var; \ 45 if ((settings)) \ 46 var = new PlaySettingsCheckBox((name), (settings)); \ 47 else \ 48 var = new HostCheckBox((name)) 49 50 #define CREATE_COMBOBOX_SETTING(var, name, settings) \ 51 ComboBoxSetting *var; \ 52 if ((settings)) \ 53 var = new PlaySettingsComboBox((name), (settings)); \ 54 else \ 55 var = new HostComboBox((name)) 56 57 #define CREATE_COMBOBOX1_SETTING(var, name, settings, arg1) \ 58 ComboBoxSetting *var; \ 59 if ((settings)) \ 60 var = new PlaySettingsComboBox((name), (settings), (arg1)); \ 61 else \ 62 var = new HostComboBox((name), (arg1)) 63 64 #define CREATE_SPINBOX_SETTING(var, name, settings, arg1, arg2, arg3, arg4) \ 65 SpinBoxSetting *var; \ 66 if ((settings)) \ 67 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3), (arg4)); \ 68 else \ 69 var = new HostSpinBox((name), (arg1), (arg2), (arg3), (arg4)) 70 71 #define CREATE_LINEEDIT_SETTING(var, name, settings) \ 72 LineEditSetting *var; \ 73 if ((settings)) \ 74 var = new PlaySettingsLineEdit((name), (settings), ""); \ 75 else \ 76 var = new HostLineEdit((name)) 77 78 // For PlaySettings, use a SpinBox instead of a Slider so that a 79 // default value can be easily used. 80 #define CREATE_SLIDER_SETTING(var, name, settings, arg1, arg2, arg3) \ 81 BoundedIntegerSetting *var; \ 82 if ((settings)) \ 83 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3)); \ 84 else \ 85 var = new HostSlider((name), (arg1), (arg2), (arg3)) 86 87 #define CREATE_IMAGESELECT_SETTING(var, name, settings) \ 88 ImageSelectSetting *var; \ 89 if ((settings)) \ 90 var = new PlaySettingsImageSelect((name), (settings)); \ 91 else \ 92 var = new HostImageSelect((name)) 93 94 static Setting *wrap(Setting *obj, PlaySettings *settings, 95 bool twoLineLabel=false) 96 { 97 if (!settings) 98 return obj; 99 100 // Get the setting name 101 PlaySettingsCombinedStorage *storage = 102 dynamic_cast<PlaySettingsCombinedStorage *>(obj); 103 const QString &name = storage->getName(); 104 105 // Get the default value and label. The label is different 106 // from the value for most object types. 107 QString defaultValue = settings->GetSetting(name, "", true); 108 QString defaultLabel(defaultValue); 109 if (dynamic_cast<BooleanSetting *>(obj)) 110 defaultLabel = (defaultValue == "0" || defaultValue.isEmpty() ? 111 QObject::tr("disabled") : QObject::tr("enabled")); 112 if (dynamic_cast<SpinBoxSetting *>(obj) && defaultValue.isEmpty()) 113 defaultLabel = "0"; 114 ComboBoxSetting *cb = dynamic_cast<ComboBoxSetting *>(obj); 115 if (cb) 116 { 117 defaultLabel = cb->GetValueLabel(defaultValue); 118 // Add the default selection to a ComboBox 119 cb->addSelection(QString("(") + QObject::tr("default") + ")", 120 storage->getDefault(), 121 !settings->IsOverridden(name), 122 true); 123 } 124 ImageSelectSetting *is = dynamic_cast<ImageSelectSetting *>(obj); 125 if (is) 126 { 127 defaultLabel = is->GetValueLabel(defaultValue); 128 // Add the default selection to a ImageSelect 129 is->addDefaultSelection(QString("(") + QObject::tr("default") + ")", 130 storage->getDefault(), 131 defaultValue, 132 !settings->IsOverridden(name)); 133 } 134 135 // Change the help text to include the default and its source. 136 QString helpPrefix; 137 if (dynamic_cast<LineEditSetting *>(obj)) 138 helpPrefix = QObject::tr("Leave blank to keep default value"); 139 else 140 helpPrefix = QObject::tr("Override default value"); 141 helpPrefix += " (" + defaultLabel + ") "; 142 QString inheritsFrom = settings->InheritsFrom(name); 143 if (inheritsFrom.isNull()) 144 helpPrefix += QObject::tr("from global settings"); 145 else 146 helpPrefix += QObject::tr("from group") + " " + inheritsFrom; 147 helpPrefix += ". " + obj->getHelpText(); 148 obj->setHelpText(helpPrefix); 149 150 // Change the label to include the default. 151 obj->setLabel(obj->getLabel() + (twoLineLabel ? "\n" : "") + 152 " (" + defaultLabel + ")"); 153 154 return obj; 155 } 156 42 157 class TriggeredItem : public TriggeredConfigurationGroup 43 158 { 44 159 public: … … 594 709 return gs; 595 710 } 596 711 597 static HostCheckBox *DecodeExtraAudio()712 static Setting *DecodeExtraAudio(PlaySettings *settings) 598 713 { 599 HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");714 CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings); 600 715 gc->setLabel(QObject::tr("Extra audio buffering")); 601 716 gc->setValue(true); 602 717 gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing " … … 605 720 "effect on framegrabbers (MPEG-4/RTJPEG). MythTV will " 606 721 "keep extra audio data in its internal buffers to " 607 722 "workaround this bug.")); 608 return gc;723 return wrap(gc, settings); 609 724 } 610 725 611 static HostComboBox *PIPLocationComboBox()726 static Setting *PIPLocationComboBox(PlaySettings *settings) 612 727 { 613 HostComboBox *gc = new HostComboBox("PIPLocation");728 CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings); 614 729 gc->setLabel(QObject::tr("PIP video location")); 615 730 for (uint loc = 0; loc < kPIP_END; ++loc) 616 731 gc->addSelection(toString((PIPLocation) loc), QString::number(loc)); 617 732 gc->setHelpText(QObject::tr("Location of PIP Video window.")); 618 return gc;733 return wrap(gc, settings); 619 734 } 620 735 621 736 static HostComboBox *DisplayRecGroup() … … 701 816 return gc; 702 817 } 703 818 704 static HostCheckBox *SmartForward()819 static Setting *SmartForward(PlaySettings *settings) 705 820 { 706 HostCheckBox *gc = new HostCheckBox("SmartForward");821 CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings); 707 822 gc->setLabel(QObject::tr("Smart fast forwarding")); 708 823 gc->setValue(false); 709 824 gc->setHelpText(QObject::tr("If enabled, then immediately after " 710 825 "rewinding, only skip forward the same amount as " 711 826 "skipping backwards.")); 712 return gc;827 return wrap(gc, settings); 713 828 } 714 829 715 static HostCheckBox *ExactSeeking()830 static Setting *ExactSeeking(PlaySettings *settings) 716 831 { 717 HostCheckBox *gc = new HostCheckBox("ExactSeeking");832 CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings); 718 833 gc->setLabel(QObject::tr("Seek to exact frame")); 719 834 gc->setValue(false); 720 835 gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but " 721 836 "slower.")); 722 return gc;837 return wrap(gc, settings); 723 838 } 724 839 725 840 static GlobalComboBox *CommercialSkipMethod() … … 747 862 return gc; 748 863 } 749 864 750 static HostComboBox *AutoCommercialSkip()865 static Setting *AutoCommercialSkip(PlaySettings *settings) 751 866 { 752 HostComboBox *gc = new HostComboBox("AutoCommercialSkip");867 CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings); 753 868 gc->setLabel(QObject::tr("Automatically skip commercials")); 754 869 gc->addSelection(QObject::tr("Off"), "0"); 755 870 gc->addSelection(QObject::tr("Notify, but do not skip"), "2"); … … 758 873 "have been flagged during automatic commercial detection " 759 874 "or by the mythcommflag program, or just notify that a " 760 875 "commercial has been detected.")); 761 return gc;876 return wrap(gc, settings); 762 877 } 763 878 764 879 static GlobalCheckBox *AutoCommercialFlag() … … 844 959 return bc; 845 960 } 846 961 847 static HostSpinBox *CommRewindAmount()962 static Setting *CommRewindAmount(PlaySettings *settings) 848 963 { 849 HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);964 CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false); 850 965 gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)")); 851 966 gs->setHelpText(QObject::tr("MythTV will automatically rewind " 852 967 "this many seconds after performing a commercial skip.")); 853 968 gs->setValue(0); 854 return gs;969 return wrap(gs, settings); 855 970 } 856 971 857 static HostSpinBox *CommNotifyAmount()972 static Setting *CommNotifyAmount(PlaySettings *settings) 858 973 { 859 HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);974 CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false); 860 975 gs->setLabel(QObject::tr("Commercial skip notify amount (secs)")); 861 976 gs->setHelpText(QObject::tr("MythTV will act like a commercial " 862 977 "begins this many seconds early. This can be useful " 863 978 "when commercial notification is used in place of " 864 979 "automatic skipping.")); 865 980 gs->setValue(0); 866 return gs;981 return wrap(gs, settings); 867 982 } 868 983 869 984 static GlobalSpinBox *MaximumCommercialSkip() … … 1665 1780 labels[j]->setValue(label_i); 1666 1781 } 1667 1782 1668 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) : 1783 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str, 1784 PlaySettings *settings) : 1669 1785 TriggeredConfigurationGroup(false, true, true, true, 1670 1786 false, false, true, true), grouptrigger(NULL) 1671 1787 { 1672 1788 setLabel(QObject::tr("Playback Profiles") + str); 1789 if (settings) 1790 setLabel(QObject::tr("Playback group settings for ") + 1791 settings->mGroupName + " - " + 1792 getLabel()); 1673 1793 1674 1794 QString host = gCoreContext->GetHostName(); 1675 1795 QStringList profiles = VideoDisplayProfile::GetProfiles(host); … … 1697 1817 profiles = VideoDisplayProfile::GetProfiles(host); 1698 1818 } 1699 1819 1700 QString profile = VideoDisplayProfile::GetDefaultProfileName(host );1820 QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings); 1701 1821 if (!profiles.contains(profile)) 1702 1822 { 1703 1823 profile = (profiles.contains("Normal")) ? "Normal" : profiles[0]; 1704 1824 VideoDisplayProfile::SetDefaultProfileName(profile, host); 1705 1825 } 1706 1826 1707 grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile"); 1827 CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings); 1828 grouptrigger = gs; 1708 1829 grouptrigger->setLabel(QObject::tr("Current Video Playback Profile")); 1709 1830 QStringList::const_iterator it; 1710 1831 for (it = profiles.begin(); it != profiles.end(); ++it) 1711 1832 grouptrigger->addSelection(ProgramInfo::i18n(*it), *it); 1833 if (settings) 1834 { 1835 addChild(wrap(grouptrigger, settings)); 1836 return; 1837 } 1712 1838 1713 1839 HorizontalConfigurationGroup *grp = 1714 1840 new HorizontalConfigurationGroup(false, false, true, true); … … 1841 1967 return gc; 1842 1968 } 1843 1969 1844 static HostSpinBox *FFRewReposTime()1970 static Setting *FFRewReposTime(PlaySettings *settings) 1845 1971 { 1846 HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);1972 CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false); 1847 1973 gs->setLabel(QObject::tr("Fast forward/rewind reposition amount")); 1848 1974 gs->setValue(100); 1849 1975 gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind " … … 1851 1977 "resuming normal playback. This " 1852 1978 "compensates for the reaction time between seeing " 1853 1979 "where to resume playback and actually exiting seeking.")); 1854 return gs;1980 return wrap(gs, settings); 1855 1981 } 1856 1982 1857 static HostCheckBox *FFRewReverse()1983 static Setting *FFRewReverse(PlaySettings *settings) 1858 1984 { 1859 HostCheckBox *gc = new HostCheckBox("FFRewReverse");1985 CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings); 1860 1986 gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind")); 1861 1987 gc->setValue(true); 1862 1988 gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key " … … 1864 1990 "vice versa. If disabled, it will decrease the " 1865 1991 "current speed or switch to play mode if " 1866 1992 "the speed can't be decreased further.")); 1867 return gc;1993 return wrap(gc, settings); 1868 1994 } 1869 1995 1870 1996 static HostComboBox *MenuTheme() … … 1915 2041 return gc; 1916 2042 } 1917 2043 1918 static HostSpinBox *OSDCC708TextZoomPercentage(void)2044 static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings) 1919 2045 { 1920 HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5); 2046 CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings, 2047 50, 200, 5, false); 1921 2048 gs->setLabel(QObject::tr("Subtitle text zoom percentage")); 1922 2049 gs->setValue(100); 1923 2050 gs->setHelpText(QObject::tr("Use this to enlarge or shrink text based subtitles.")); 1924 2051 1925 return gs;2052 return wrap(gs, settings); 1926 2053 } 1927 2054 1928 2055 static HostComboBox *SubtitleFont() … … 1942 2069 return hcb; 1943 2070 } 1944 2071 1945 static HostComboBox *SubtitleCodec()2072 static Setting *SubtitleCodec(PlaySettings *settings) 1946 2073 { 1947 HostComboBox *gc = new HostComboBox("SubtitleCodec");2074 CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings); 1948 2075 1949 2076 gc->setLabel(QObject::tr("Subtitle Codec")); 1950 2077 QList<QByteArray> list = QTextCodec::availableCodecs(); … … 1954 2081 gc->addSelection(val, val, val.toLower() == "utf-8"); 1955 2082 } 1956 2083 1957 return gc;2084 return wrap(gc, settings); 1958 2085 } 1959 2086 1960 2087 static HostComboBox *ChannelOrdering() … … 1966 2093 return gc; 1967 2094 } 1968 2095 1969 static HostSpinBox *VertScanPercentage()2096 static Setting *VertScanPercentage(PlaySettings *settings) 1970 2097 { 1971 HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1); 2098 CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings, 2099 -100, 100, 1, false); 1972 2100 gs->setLabel(QObject::tr("Vertical scaling")); 1973 2101 gs->setValue(0); 1974 2102 gs->setHelpText(QObject::tr( 1975 2103 "Adjust this if the image does not fill your " 1976 2104 "screen vertically. Range -100% to 100%")); 1977 return gs;2105 return wrap(gs, settings); 1978 2106 } 1979 2107 1980 static HostSpinBox *HorizScanPercentage()2108 static Setting *HorizScanPercentage(PlaySettings *settings) 1981 2109 { 1982 HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1); 2110 CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings, 2111 -100, 100, 1, false); 1983 2112 gs->setLabel(QObject::tr("Horizontal scaling")); 1984 2113 gs->setValue(0); 1985 2114 gs->setHelpText(QObject::tr( 1986 2115 "Adjust this if the image does not fill your " 1987 2116 "screen horizontally. Range -100% to 100%")); 1988 return gs;2117 return wrap(gs, settings); 1989 2118 }; 1990 2119 1991 static HostSpinBox *XScanDisplacement()2120 static Setting *XScanDisplacement(PlaySettings *settings) 1992 2121 { 1993 HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1); 2122 CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings, 2123 -50, 50, 1, false); 1994 2124 gs->setLabel(QObject::tr("Scan displacement (X)")); 1995 2125 gs->setValue(0); 1996 2126 gs->setHelpText(QObject::tr("Adjust this to move the image horizontally.")); 1997 return gs;2127 return wrap(gs, settings); 1998 2128 } 1999 2129 2000 static HostSpinBox *YScanDisplacement()2130 static Setting *YScanDisplacement(PlaySettings *settings) 2001 2131 { 2002 HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1); 2132 CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings, 2133 -50, 50, 1, false); 2003 2134 gs->setLabel(QObject::tr("Scan displacement (Y)")); 2004 2135 gs->setValue(0); 2005 2136 gs->setHelpText(QObject::tr("Adjust this to move the image vertically.")); 2006 return gs;2137 return wrap(gs, settings); 2007 2138 }; 2008 2139 2009 static HostCheckBox *CCBackground()2140 static Setting *CCBackground(PlaySettings *settings) 2010 2141 { 2011 HostCheckBox *gc = new HostCheckBox("CCBackground");2142 CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings); 2012 2143 gc->setLabel(QObject::tr("Black background for closed captioning")); 2013 2144 gc->setValue(false); 2014 2145 gc->setHelpText(QObject::tr( 2015 2146 "If enabled, captions will be displayed " 2016 2147 "as white text over a black background " 2017 2148 "for better contrast.")); 2018 return gc;2149 return wrap(gc, settings); 2019 2150 } 2020 2151 2021 static HostCheckBox *DefaultCCMode()2152 static Setting *DefaultCCMode(PlaySettings *settings) 2022 2153 { 2023 HostCheckBox *gc = new HostCheckBox("DefaultCCMode");2154 CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings); 2024 2155 gc->setLabel(QObject::tr("Always display closed captioning or subtitles")); 2025 2156 gc->setValue(false); 2026 2157 gc->setHelpText(QObject::tr( … … 2028 2159 "when playing back recordings or watching " 2029 2160 "Live TV. Closed Captioning can be turned on or off " 2030 2161 "by pressing \"T\" during playback.")); 2031 return gc;2162 return wrap(gc, settings); 2032 2163 } 2033 2164 2034 static HostCheckBox *PreferCC708()2165 static Setting *PreferCC708(PlaySettings *settings) 2035 2166 { 2036 HostCheckBox *gc = new HostCheckBox("Prefer708Captions");2167 CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings); 2037 2168 gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions")); 2038 2169 gc->setValue(true); 2039 2170 gc->setHelpText( … … 2041 2172 "If enabled, the newer EIA-708 captions will be preferred over " 2042 2173 "the older EIA-608 captions in ATSC streams.")); 2043 2174 2044 return gc;2175 return wrap(gc, settings); 2045 2176 } 2046 2177 2047 static HostCheckBox *EnableMHEG()2178 static Setting *EnableMHEG(PlaySettings *settings) 2048 2179 { 2049 HostCheckBox *gc = new HostCheckBox("EnableMHEG");2180 CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings); 2050 2181 gc->setLabel(QObject::tr("Enable interactive TV")); 2051 2182 gc->setValue(false); 2052 2183 gc->setHelpText(QObject::tr( 2053 2184 "If enabled, interactive TV applications (MHEG) will " 2054 2185 "be activated. This is used for teletext and logos for " 2055 2186 "radio and channels that are currently off-air.")); 2056 return gc;2187 return wrap(gc, settings); 2057 2188 } 2058 2189 2059 static HostCheckBox *PersistentBrowseMode()2190 static Setting *PersistentBrowseMode(PlaySettings *settings) 2060 2191 { 2061 HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");2192 CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings); 2062 2193 gc->setLabel(QObject::tr("Always use browse mode in Live TV")); 2063 2194 gc->setValue(true); 2064 2195 gc->setHelpText( 2065 2196 QObject::tr( 2066 2197 "If enabled, browse mode will automatically be activated " 2067 2198 "whenever you use channel up/down while watching Live TV.")); 2068 return gc;2199 return wrap(gc, settings); 2069 2200 } 2070 2201 2071 static HostCheckBox *BrowseAllTuners()2202 static Setting *BrowseAllTuners(PlaySettings *settings) 2072 2203 { 2073 HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");2204 CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings); 2074 2205 gc->setLabel(QObject::tr("Browse all channels")); 2075 2206 gc->setValue(false); 2076 2207 gc->setHelpText( … … 2078 2209 "If enabled, browse mode will shows channels on all " 2079 2210 "available recording devices, instead of showing " 2080 2211 "channels on just the current recorder.")); 2081 return gc;2212 return wrap(gc, settings); 2082 2213 } 2083 2214 2084 static HostCheckBox *ClearSavedPosition()2215 static Setting *ClearSavedPosition(PlaySettings *settings) 2085 2216 { 2086 HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");2217 CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings); 2087 2218 gc->setLabel(QObject::tr("Clear bookmark on playback")); 2088 2219 gc->setValue(true); 2089 2220 gc->setHelpText(QObject::tr("If enabled, automatically clear the " 2090 2221 "bookmark on a recording when the recording is played " 2091 2222 "back. If disabled, you can mark the beginning with " 2092 2223 "rewind then save position.")); 2093 return gc;2224 return wrap(gc, settings); 2094 2225 } 2095 2226 2096 static HostCheckBox *AltClearSavedPosition()2227 static Setting *AltClearSavedPosition(PlaySettings *settings) 2097 2228 { 2098 HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");2229 CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings); 2099 2230 gc->setLabel(QObject::tr("Alternate clear and save bookmark")); 2100 2231 gc->setValue(true); 2101 2232 gc->setHelpText(QObject::tr("During playback the SELECT key " … … 2103 2234 "Saved\" and \"Bookmark Cleared\". If disabled, the " 2104 2235 "SELECT key will save the current position for each " 2105 2236 "keypress.")); 2106 return gc;2237 return wrap(gc, settings); 2107 2238 } 2108 2239 2109 2240 #if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU) 2110 static HostCheckBox *UsePicControls()2241 static Setting *UsePicControls(PlaySettings *settings) 2111 2242 { 2112 HostCheckBox *gc = new HostCheckBox("UseOutputPictureControls");2243 CREATE_CHECKBOX_SETTING(gc, "UseOutputPictureControls", settings); 2113 2244 gc->setLabel(QObject::tr("Enable picture controls")); 2114 2245 gc->setValue(false); 2115 2246 gc->setHelpText( 2116 2247 QObject::tr( 2117 2248 "If enabled, MythTV attempts to initialize picture controls " 2118 2249 "(brightness, contrast, etc.) that are applied during playback.")); 2119 return gc;2250 return wrap(gc, settings); 2120 2251 } 2121 2252 #endif 2122 2253 2123 2254 // This currently does not work 2124 2255 /* 2125 static HostLineEdit *UDPNotifyPort()2256 static Setting *UDPNotifyPort(PlaySettings *settings) 2126 2257 { 2127 HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");2258 CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings); 2128 2259 ge->setLabel(QObject::tr("UDP notify port")); 2129 2260 ge->setValue("6948"); 2130 2261 ge->setHelpText(QObject::tr("During playback, MythTV will listen for " 2131 2262 "connections from the \"mythtvosd\" or \"mythudprelay\" " 2132 2263 "programs on this port. For additional information, see " 2133 2264 "http://www.mythtv.org/wiki/MythNotify .")); 2134 return ge;2265 return wrap(ge, settings); 2135 2266 } 2136 2267 */ 2137 2268 2138 static HostComboBox *PlaybackExitPrompt()2269 static Setting *PlaybackExitPrompt(PlaySettings *settings) 2139 2270 { 2140 HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");2271 CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings); 2141 2272 gc->setLabel(QObject::tr("Action on playback exit")); 2142 2273 gc->addSelection(QObject::tr("Just exit"), "0"); 2143 2274 gc->addSelection(QObject::tr("Save position and exit"), "2"); … … 2148 2279 "when you exit playback mode. The options available will " 2149 2280 "allow you to save your position, delete the " 2150 2281 "recording, or continue watching.")); 2151 return gc;2282 return wrap(gc, settings); 2152 2283 } 2153 2284 2154 static HostCheckBox *EndOfRecordingExitPrompt()2285 static Setting *EndOfRecordingExitPrompt(PlaySettings *settings) 2155 2286 { 2156 HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");2287 CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings); 2157 2288 gc->setLabel(QObject::tr("Prompt at end of recording")); 2158 2289 gc->setValue(false); 2159 2290 gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing " 2160 2291 "you to delete the recording when it has finished " 2161 2292 "playing.")); 2162 return gc;2293 return wrap(gc, settings); 2163 2294 } 2164 2295 2165 static HostCheckBox *JumpToProgramOSD()2296 static Setting *JumpToProgramOSD(PlaySettings *settings) 2166 2297 { 2167 HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");2298 CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings); 2168 2299 gc->setLabel(QObject::tr("Jump to program OSD")); 2169 2300 gc->setValue(true); 2170 2301 gc->setHelpText(QObject::tr( … … 2173 2304 "'Watch Recording' screen when 'Jump to Program' " 2174 2305 "is activated. If enabled, the recordings are shown " 2175 2306 "in the OSD")); 2176 return gc;2307 return wrap(gc, settings); 2177 2308 } 2178 2309 2179 static HostCheckBox *ContinueEmbeddedTVPlay()2310 static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings) 2180 2311 { 2181 HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");2312 CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings); 2182 2313 gc->setLabel(QObject::tr("Continue playback when embedded")); 2183 2314 gc->setValue(false); 2184 2315 gc->setHelpText(QObject::tr( … … 2186 2317 "is embedded in the upcoming program list or recorded " 2187 2318 "list. The default is to pause the recorded show when " 2188 2319 "embedded.")); 2189 return gc;2320 return wrap(gc, settings); 2190 2321 } 2191 2322 2192 static HostCheckBox *AutomaticSetWatched()2323 static Setting *AutomaticSetWatched(PlaySettings *settings) 2193 2324 { 2194 HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");2325 CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings); 2195 2326 gc->setLabel(QObject::tr("Automatically mark a recording as watched")); 2196 2327 gc->setValue(false); 2197 2328 gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a " … … 2199 2330 "detection is not foolproof, so do not enable this " 2200 2331 "setting if you don't want an unwatched recording marked " 2201 2332 "as watched.")); 2202 return gc;2333 return wrap(gc, settings); 2203 2334 } 2204 2335 2205 2336 static HostSpinBox *LiveTVIdleTimeout() … … 2399 2530 return gc; 2400 2531 } 2401 2532 2402 static HostComboBox *LetterboxingColour()2533 static Setting *LetterboxingColour(PlaySettings *settings) 2403 2534 { 2404 HostComboBox *gc = new HostComboBox("LetterboxColour");2535 CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings); 2405 2536 gc->setLabel(QObject::tr("Letterboxing color")); 2406 2537 for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m) 2407 2538 gc->addSelection(toString((LetterBoxColour)m), QString::number(m)); … … 2411 2542 "letterboxing, but those with plasma screens may prefer gray " 2412 2543 "to minimize burn-in.") + " " + 2413 2544 QObject::tr("Currently only works with XVideo video renderer.")); 2414 return gc;2545 return wrap(gc, settings); 2415 2546 } 2416 2547 2417 static HostComboBox *AspectOverride()2548 static Setting *AspectOverride(PlaySettings *settings) 2418 2549 { 2419 HostComboBox *gc = new HostComboBox("AspectOverride");2550 CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings); 2420 2551 gc->setLabel(QObject::tr("Video aspect override")); 2421 2552 for (int m = kAspect_Off; m < kAspect_END; ++m) 2422 2553 gc->addSelection(toString((AspectOverrideMode)m), QString::number(m)); … … 2424 2555 "When enabled, these will override the aspect " 2425 2556 "ratio specified by any broadcaster for all " 2426 2557 "video streams.")); 2427 return gc;2558 return wrap(gc, settings); 2428 2559 } 2429 2560 2430 static HostComboBox *AdjustFill()2561 static Setting *AdjustFill(PlaySettings *settings) 2431 2562 { 2432 HostComboBox *gc = new HostComboBox("AdjustFill");2563 CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings); 2433 2564 gc->setLabel(QObject::tr("Zoom")); 2434 2565 gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff), 2435 2566 QString::number(kAdjustFill_AutoDetect_DefaultOff)); … … 2440 2571 gc->setHelpText(QObject::tr( 2441 2572 "When enabled, these will apply a predefined " 2442 2573 "zoom to all video playback in MythTV.")); 2443 return gc;2574 return wrap(gc, settings); 2444 2575 } 2445 2576 2446 2577 // Theme settings … … 2864 2995 return gc; 2865 2996 } 2866 2997 2867 ThemeSelector::ThemeSelector(QString label): 2868 HostImageSelect(label){2869 2998 static Setting *ThemeSelector(QString label, PlaySettings *settings=NULL) 2999 { 3000 CREATE_IMAGESELECT_SETTING(gs, label, settings); 2870 3001 ThemeType themetype = THEME_UI; 2871 3002 2872 3003 if (label == "Theme") 2873 3004 { 2874 3005 themetype = THEME_UI; 2875 setLabel(QObject::tr("UI theme"));3006 gs->setLabel(QObject::tr("UI theme")); 2876 3007 } 2877 3008 else if (label == "MenuTheme") 2878 3009 { 2879 3010 themetype = THEME_MENU; 2880 setLabel(QObject::tr("Menu theme"));3011 gs->setLabel(QObject::tr("Menu theme")); 2881 3012 } 2882 3013 2883 3014 QDir themes(GetThemesParentDir()); … … 2941 3072 VERBOSE(VB_IMPORTANT, QString("Problem reading theme preview image" 2942 3073 " %1").arg(preview.filePath())); 2943 3074 2944 addImageSelection(name, previewImage, theme.fileName());3075 gs->addImageSelection(name, previewImage, theme.fileName()); 2945 3076 } 2946 3077 2947 3078 if (themetype & THEME_UI) 2948 setValue(DEFAULT_UI_THEME); 3079 gs->setValue(DEFAULT_UI_THEME); 3080 3081 return wrap(gs, settings); 2949 3082 } 2950 3083 2951 3084 static HostComboBox *ChannelFormat() … … 3450 3583 return gs; 3451 3584 } 3452 3585 3453 static HostCheckBox *RealtimePriority()3586 static Setting *RealtimePriority(PlaySettings *settings) 3454 3587 { 3455 HostCheckBox *gc = new HostCheckBox("RealtimePriority");3588 CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings); 3456 3589 gc->setLabel(QObject::tr("Enable realtime priority threads")); 3457 3590 gc->setHelpText(QObject::tr("When running mythfrontend with root " 3458 3591 "privileges, some threads can be given enhanced priority. " 3459 3592 "Disable this if mythfrontend freezes during video " 3460 3593 "playback.")); 3461 3594 gc->setValue(true); 3462 return gc;3595 return wrap(gc, settings, false); 3463 3596 } 3464 3597 3465 3598 static HostCheckBox *EnableMediaMon() … … 3615 3748 }; 3616 3749 3617 3750 #ifdef USING_OPENGL_VSYNC 3618 static HostCheckBox *UseOpenGLVSync()3751 static Setting *UseOpenGLVSync(PlaySettings *settings) 3619 3752 { 3620 HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");3753 CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings); 3621 3754 gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing")); 3622 3755 gc->setValue(false); 3623 3756 gc->setHelpText(QObject::tr( 3624 3757 "If supported by your hardware/drivers, " 3625 3758 "MythTV will use OpenGL vertical syncing for " 3626 3759 "video timing, reducing frame jitter.")); 3627 return gc;3760 return wrap(gc, settings); 3628 3761 } 3629 3762 #endif 3630 3763 … … 4050 4183 return gc; 4051 4184 } 4052 4185 4053 MainGeneralSettings::MainGeneralSettings() 4186 MainGeneralSettings::MainGeneralSettings(PlaySettings *settings, 4187 ConfigurationWizard *base) 4054 4188 { 4189 if (!settings) 4190 { 4055 4191 DatabaseSettings::addDatabaseSettings(this); 4056 4192 4057 4193 VerticalConfigurationGroup *pin = … … 4104 4240 remotecontrol->addChild(NetworkControlEnabled()); 4105 4241 remotecontrol->addChild(NetworkControlPort()); 4106 4242 addChild(remotecontrol); 4243 } 4107 4244 } 4108 4245 4109 PlaybackSettings::PlaybackSettings() 4246 PlaybackSettings::PlaybackSettings(PlaySettings *settings, 4247 ConfigurationWizard *base) 4110 4248 { 4111 4249 uint i = 0, total = 8; 4112 4250 #if CONFIG_DARWIN 4113 4251 total += 2; 4114 4252 #endif // USING_DARWIN 4253 if (settings) 4254 total -= 3; 4115 4255 4116 4256 4117 4257 VerticalConfigurationGroup* general1 = 4118 4258 new VerticalConfigurationGroup(false); 4119 4259 general1->setLabel(QObject::tr("General Playback") + 4120 4260 QString(" (%1/%2)").arg(++i).arg(total)); 4261 if (settings) 4262 general1->setLabel(QObject::tr("Playback group settings for ") + 4263 settings->mGroupName + " - " + 4264 general1->getLabel()); 4121 4265 4122 4266 HorizontalConfigurationGroup *columns = 4123 4267 new HorizontalConfigurationGroup(false, false, true, true); 4124 4268 4125 4269 VerticalConfigurationGroup *column1 = 4126 4270 new VerticalConfigurationGroup(false, false, true, true); 4127 column1->addChild(RealtimePriority()); 4128 column1->addChild(DecodeExtraAudio()); 4129 column1->addChild(JumpToProgramOSD()); 4271 if (!settings) 4272 column1->addChild(RealtimePriority(settings)); 4273 column1->addChild(DecodeExtraAudio(settings)); 4274 column1->addChild(JumpToProgramOSD(settings)); 4130 4275 columns->addChild(column1); 4131 4276 4132 4277 VerticalConfigurationGroup *column2 = 4133 4278 new VerticalConfigurationGroup(false, false, true, true); 4134 column2->addChild(ClearSavedPosition( ));4135 column2->addChild(AltClearSavedPosition( ));4136 column2->addChild(AutomaticSetWatched( ));4137 column2->addChild(ContinueEmbeddedTVPlay( ));4279 column2->addChild(ClearSavedPosition(settings)); 4280 column2->addChild(AltClearSavedPosition(settings)); 4281 column2->addChild(AutomaticSetWatched(settings)); 4282 column2->addChild(ContinueEmbeddedTVPlay(settings)); 4138 4283 columns->addChild(column2); 4139 4284 4140 4285 general1->addChild(columns); 4141 general1->addChild(LiveTVIdleTimeout()); 4286 if (!settings) 4287 general1->addChild(LiveTVIdleTimeout()); 4142 4288 #ifdef USING_OPENGL_VSYNC 4143 general1->addChild(UseOpenGLVSync( ));4289 general1->addChild(UseOpenGLVSync(settings)); 4144 4290 #endif // USING_OPENGL_VSYNC 4145 4291 #if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU) 4146 general1->addChild(UsePicControls( ));4292 general1->addChild(UsePicControls(settings)); 4147 4293 #endif // USING_XV 4148 addChild(general1); 4294 if (base) 4295 base->addChild(general1); 4296 else 4297 addChild(general1); 4149 4298 4150 4299 VerticalConfigurationGroup* general2 = 4151 4300 new VerticalConfigurationGroup(false); 4152 4301 general2->setLabel(QObject::tr("General Playback") + 4153 4302 QString(" (%1/%2)").arg(++i).arg(total)); 4303 if (settings) 4304 general2->setLabel(QObject::tr("Playback group settings for ") + 4305 settings->mGroupName + " - " + 4306 general2->getLabel()); 4154 4307 4155 4308 HorizontalConfigurationGroup* oscan = 4156 4309 new HorizontalConfigurationGroup(false, false, true, true); … … 4158 4311 new VerticalConfigurationGroup(false, false, true, true); 4159 4312 VerticalConfigurationGroup *ocol2 = 4160 4313 new VerticalConfigurationGroup(false, false, true, true); 4161 ocol1->addChild(VertScanPercentage( ));4162 ocol1->addChild(YScanDisplacement( ));4163 ocol2->addChild(HorizScanPercentage( ));4164 ocol2->addChild(XScanDisplacement( ));4314 ocol1->addChild(VertScanPercentage(settings)); 4315 ocol1->addChild(YScanDisplacement(settings)); 4316 ocol2->addChild(HorizScanPercentage(settings)); 4317 ocol2->addChild(XScanDisplacement(settings)); 4165 4318 oscan->addChild(ocol1); 4166 4319 oscan->addChild(ocol2); 4167 4320 4168 4321 HorizontalConfigurationGroup* aspect_fill = 4169 4322 new HorizontalConfigurationGroup(false, false, true, true); 4170 aspect_fill->addChild(AspectOverride( ));4171 aspect_fill->addChild(AdjustFill( ));4323 aspect_fill->addChild(AspectOverride(settings)); 4324 aspect_fill->addChild(AdjustFill(settings)); 4172 4325 4173 4326 general2->addChild(oscan); 4174 4327 general2->addChild(aspect_fill); 4175 general2->addChild(LetterboxingColour()); 4176 general2->addChild(PIPLocationComboBox()); 4177 general2->addChild(PlaybackExitPrompt()); 4178 general2->addChild(EndOfRecordingExitPrompt()); 4179 addChild(general2); 4328 general2->addChild(LetterboxingColour(settings)); 4329 general2->addChild(PIPLocationComboBox(settings)); 4330 general2->addChild(PlaybackExitPrompt(settings)); 4331 general2->addChild(EndOfRecordingExitPrompt(settings)); 4332 if (base) 4333 base->addChild(general2); 4334 else 4335 addChild(general2); 4180 4336 4181 4337 QString tmp = QString(" (%1/%2)").arg(++i).arg(total); 4182 addChild(new PlaybackProfileConfigs(tmp)); 4338 if (base) 4339 base->addChild(new PlaybackProfileConfigs(tmp, settings)); 4340 else 4341 addChild(new PlaybackProfileConfigs(tmp, settings)); 4183 4342 4343 if (!settings) 4344 { 4184 4345 VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false); 4185 4346 pbox->setLabel(QObject::tr("View Recordings") + 4186 4347 QString(" (%1/%2)").arg(++i).arg(total)); … … 4207 4368 pbox3->addChild(DisplayGroupTitleSort()); 4208 4369 pbox3->addChild(new WatchListSettings()); 4209 4370 addChild(pbox3); 4371 } 4210 4372 4211 4373 VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false); 4212 4374 seek->setLabel(QObject::tr("Seeking") + 4213 4375 QString(" (%1/%2)").arg(++i).arg(total)); 4214 seek->addChild(SmartForward()); 4215 seek->addChild(FFRewReposTime()); 4216 seek->addChild(FFRewReverse()); 4217 seek->addChild(ExactSeeking()); 4218 addChild(seek); 4376 if (settings) 4377 seek->setLabel(QObject::tr("Playback group settings for ") + 4378 settings->mGroupName + " - " + 4379 seek->getLabel()); 4380 seek->addChild(SmartForward(settings)); 4381 seek->addChild(FFRewReposTime(settings)); 4382 seek->addChild(FFRewReverse(settings)); 4383 seek->addChild(ExactSeeking(settings)); 4384 if (base) 4385 base->addChild(seek); 4386 else 4387 addChild(seek); 4219 4388 4220 4389 VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false); 4221 4390 comms->setLabel(QObject::tr("Commercial Skip") + 4222 4391 QString(" (%1/%2)").arg(++i).arg(total)); 4223 comms->addChild(AutoCommercialSkip()); 4224 comms->addChild(CommRewindAmount()); 4225 comms->addChild(CommNotifyAmount()); 4392 if (settings) 4393 comms->setLabel(QObject::tr("Playback group settings for ") + 4394 settings->mGroupName + " - " + 4395 comms->getLabel()); 4396 comms->addChild(AutoCommercialSkip(settings)); 4397 comms->addChild(CommRewindAmount(settings)); 4398 comms->addChild(CommNotifyAmount(settings)); 4399 if (!settings) // these are global settings, not host-specific 4400 { 4226 4401 comms->addChild(MaximumCommercialSkip()); 4227 4402 comms->addChild(MergeShortCommBreaks()); 4228 4403 comms->addChild(CommSkipAllBlanks()); 4229 addChild(comms); 4404 } 4405 if (base) 4406 base->addChild(comms); 4407 else 4408 addChild(comms); 4230 4409 4231 4410 #if CONFIG_DARWIN 4232 4411 VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false); 4233 4412 mac1->setLabel(QObject::tr("Mac OS X Video Settings") + 4234 4413 QString(" (%1/%2)").arg(++i).arg(total)); 4414 if (settings) 4415 mac1->setLabel(QObject::tr("Playback group settings for ") + 4416 settings->mGroupName + " - " + 4417 mac1->getLabel()); 4418 if (!settings) 4419 { 4235 4420 mac1->addChild(MacGammaCorrect()); 4236 4421 mac1->addChild(MacScaleUp()); 4237 4422 mac1->addChild(MacFullSkip()); 4238 addChild(mac1); 4423 } 4424 if (base) 4425 base->addChild(mac1); 4426 else 4427 addChild(mac1); 4239 4428 4240 4429 VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false); 4241 4430 mac2->setLabel(QObject::tr("Mac OS X Video Settings") + 4242 4431 QString(" (%1/%2)").arg(++i).arg(total)); 4432 if (settings) 4433 mac2->setLabel(QObject::tr("Playback group settings for ") + 4434 settings->mGroupName + " - " + 4435 mac2->getLabel()); 4436 if (!setings) 4437 { 4243 4438 mac2->addChild(new MacMainSettings()); 4244 4439 mac2->addChild(new MacFloatSettings()); 4245 4440 … … 4253 4448 #endif 4254 4449 } 4255 4450 4256 OSDSettings::OSDSettings() 4451 OSDSettings::OSDSettings(PlaySettings *settings, 4452 ConfigurationWizard *base) 4257 4453 { 4258 4454 VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false); 4259 4455 osd->setLabel(QObject::tr("On-screen Display")); 4456 if (settings) 4457 osd->setLabel(QObject::tr("Playback group settings for ") + 4458 settings->mGroupName + " - " + 4459 osd->getLabel()); 4260 4460 4261 osd->addChild(EnableMHEG()); 4262 osd->addChild(PersistentBrowseMode()); 4263 osd->addChild(BrowseAllTuners()); 4264 osd->addChild(CCBackground()); 4265 osd->addChild(DefaultCCMode()); 4266 osd->addChild(PreferCC708()); 4461 if (!settings) 4462 { 4463 osd->addChild(EnableMHEG(settings)); 4464 osd->addChild(PersistentBrowseMode(settings)); 4465 osd->addChild(BrowseAllTuners(settings)); 4466 } 4467 osd->addChild(CCBackground(settings)); 4468 osd->addChild(DefaultCCMode(settings)); 4469 osd->addChild(PreferCC708(settings)); 4470 if (!settings) 4267 4471 osd->addChild(SubtitleFont()); 4268 osd->addChild(OSDCC708TextZoomPercentage()); 4269 osd->addChild(SubtitleCodec()); 4270 //osd->addChild(UDPNotifyPort()); 4271 addChild(osd); 4472 osd->addChild(OSDCC708TextZoomPercentage(settings)); 4473 osd->addChild(SubtitleCodec(settings)); 4474 //osd->addChild(UDPNotifyPort(settings)); 4475 if (base) 4476 base->addChild(osd); 4477 else 4478 addChild(osd); 4272 4479 4273 4480 //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false); 4274 4481 //cc->setLabel(QObject::tr("Closed Captions")); … … 4417 4624 VerticalConfigurationGroup* theme = new VerticalConfigurationGroup(false); 4418 4625 theme->setLabel(QObject::tr("Theme")); 4419 4626 4420 theme->addChild( newThemeSelector("Theme"));4627 theme->addChild(ThemeSelector("Theme")); 4421 4628 4422 4629 theme->addChild(ThemePainter()); 4423 4630 theme->addChild(MenuTheme()); -
programs/mythfrontend/main.cpp
35 35 #include "globalsettings.h" 36 36 #include "profilegroup.h" 37 37 #include "playgroup.h" 38 #include "playsettings.h" 38 39 #include "networkcontrol.h" 39 40 #include "DVDRingBuffer.h" 40 41 #include "scheduledrecording.h" … … 470 471 delete statusbox; 471 472 } 472 473 474 ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 475 { 476 return new PlaybackSettings(settings, base); 477 } 478 479 ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 480 { 481 return new OSDSettings(settings, base); 482 } 483 484 ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 485 { 486 return new MainGeneralSettings(settings, base); 487 } 488 489 static PlayGroupEditor::SettingsLookup pbgroupSetup[] = { 490 createPlaybackSettingsForPlaybackGroup, 491 createOSDSettingsForPlaybackGroup, 492 createMainGeneralSettingsForPlaybackGroup 493 }; 494 473 495 static void TVMenuCallback(void *data, QString &selection) 474 496 { 475 497 (void)data; … … 568 590 } 569 591 else if (sel == "settings playgroup") 570 592 { 571 PlayGroupEditor editor; 593 PlayGroupEditor editor(pbgroupSetup, 594 sizeof(pbgroupSetup)/sizeof(*pbgroupSetup)); 572 595 editor.exec(); 573 596 } 574 597 else if (sel == "settings general") … … 760 783 } 761 784 } 762 785 delete tmprbuf; 786 pginfo->SetPlaybackGroup("Videos"); 763 787 } 764 788 else if (pginfo->IsVideo()) 789 { 765 790 pos = pginfo->QueryBookmark(); 791 pginfo->SetPlaybackGroup("Videos"); 792 } 766 793 767 794 if (pos > 0) 768 795 { -
programs/mythfrontend/globalsettings.h
13 13 14 14 class QFileInfo; 15 15 class AudioDeviceComboBox; 16 class PlaySettings; 16 17 17 18 class AudioConfigSettings : public VerticalConfigurationGroup 18 19 { … … 88 89 class PlaybackSettings : public ConfigurationWizard 89 90 { 90 91 public: 91 PlaybackSettings(); 92 PlaybackSettings(PlaySettings *settings=NULL, 93 ConfigurationWizard *base=NULL); 92 94 }; 93 95 94 96 class OSDSettings: virtual public ConfigurationWizard 95 97 { 96 98 public: 97 OSDSettings(); 99 OSDSettings(PlaySettings *settings=NULL, 100 ConfigurationWizard *base=NULL); 98 101 }; 99 102 100 103 class GeneralSettings : public ConfigurationWizard … … 118 121 class MainGeneralSettings : public ConfigurationWizard 119 122 { 120 123 public: 121 MainGeneralSettings(); 124 MainGeneralSettings(PlaySettings *settings=NULL, 125 ConfigurationWizard *base=NULL); 122 126 }; 123 127 124 128 class GeneralRecPrioritiesSettings : public ConfigurationWizard … … 206 210 Q_OBJECT 207 211 208 212 public: 209 PlaybackProfileConfigs(const QString &str );213 PlaybackProfileConfigs(const QString &str, PlaySettings *settings); 210 214 virtual ~PlaybackProfileConfigs(); 211 215 212 216 private: … … 218 222 219 223 private: 220 224 QStringList profiles; 221 HostComboBox*grouptrigger;225 ComboBoxSetting *grouptrigger; 222 226 }; 223 227 224 228 #endif -
programs/mythavtest/main.cpp
20 20 #include "compat.h" 21 21 #include "mythuihelper.h" 22 22 #include "dbcheck.h" 23 #include "playsettings.h" 23 24 24 25 static void *run_priv_thread(void *data) 25 26 { … … 186 187 187 188 GetMythUI()->LoadQtConfig(); 188 189 189 #if defined(Q_OS_MACX)190 // Mac OS X doesn't define the AudioOutputDevice setting191 #else192 QString auddevice = gCoreContext->GetSetting("AudioOutputDevice");193 if (auddevice.isEmpty())194 {195 VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need "196 "to run 'mythfrontend', not 'mythtv'.");197 return TV_EXIT_NO_AUDIO;198 }199 #endif200 201 190 MythMainWindow *mainWindow = GetMythMainWindow(); 202 191 mainWindow->Init(); 203 192 … … 210 199 return GENERIC_EXIT_DB_OUTOFDATE; 211 200 } 212 201 213 TV *tv = new TV(); 202 QString playgroup(""); 203 if (!filename.isEmpty()) 204 { 205 ProgramInfo pg(filename); 206 playgroup = pg.GetPlaybackGroup(); 207 } 208 PlaySettings settings(playgroup); 209 210 #if defined(Q_OS_MACX) 211 // Mac OS X doesn't define the AudioOutputDevice setting 212 #else 213 QString auddevice = settings.GetSetting("AudioOutputDevice", ""); 214 if (auddevice.isEmpty()) 215 { 216 VERBOSE(VB_IMPORTANT, "Fatal Error: Audio not configured, you need " 217 "to run 'mythfrontend', not 'mythtv'."); 218 return TV_EXIT_NO_AUDIO; 219 } 220 #endif 221 222 TV *tv = new TV(&settings); 214 223 if (!tv->Init()) 215 224 { 216 225 VERBOSE(VB_IMPORTANT, "Fatal Error: Could not initialize TV class.");