Ticket #8088: 8088_playgroups_v17.patch
File 8088_playgroups_v17.patch, 112.4 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
33 33 34 34 TextSubtitles* GetTextSubtitles(void) { return &m_TextSubtitles; } 35 35 bool HasTextSubtitles(void); 36 bool LoadExternalSubtitles(const QString &videoFile );36 bool LoadExternalSubtitles(const QString &videoFile, PlaySettings *settings); 37 37 38 38 private: 39 39 AVSubtitles m_AVSubtitles; -
libs/libmythtv/videooutwindow.cpp
29 29 30 30 #include "videooutwindow.h" 31 31 #include "osd.h" 32 #include "playsettings.h" 32 33 #include "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), … … 84 85 85 86 // Various state variables 86 87 embedding(false), needrepaint(false), 87 allowpreviewepg(true), pip_state(kPIPOff) 88 allowpreviewepg(true), pip_state(kPIPOff), 89 90 settings(_settings) 88 91 { 89 92 db_pip_size = gCoreContext->GetNumSetting("PIPSize", 26); 90 93 91 db_move = QPoint( gCoreContext->GetNumSetting("xScanDisplacement", 0),92 gCoreContext->GetNumSetting("yScanDisplacement", 0));94 db_move = QPoint(settings->GetNumSetting("xScanDisplacement", 0), 95 settings->GetNumSetting("yScanDisplacement", 0)); 93 96 db_use_gui_size = gCoreContext->GetNumSetting("GuiSizeForTV", 0); 94 97 95 98 QDesktopWidget *desktop = NULL; … … 612 615 if (change) 613 616 { 614 617 db_scale_vert = 615 gCoreContext->GetNumSetting("VertScanPercentage", 0) * 0.01f;618 settings->GetNumSetting("VertScanPercentage", 0) * 0.01f; 616 619 db_scale_horiz = 617 gCoreContext->GetNumSetting("HorizScanPercentage", 0) * 0.01f;620 settings->GetNumSetting("HorizScanPercentage", 0) * 0.01f; 618 621 db_scaling_allowed = true; 619 622 } 620 623 else -
libs/libmythtv/videoout_d3d.cpp
50 50 opts.priorities->insert("direct3d", 55); 51 51 } 52 52 53 VideoOutputD3D::VideoOutputD3D( void)54 : VideoOutput( ),m_lock(QMutex::Recursive),53 VideoOutputD3D::VideoOutputD3D(PlaySettigns *settings) 54 : VideoOutput(settings), m_lock(QMutex::Recursive), 55 55 m_hWnd(NULL), m_render(NULL), 56 56 m_video(NULL), 57 57 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
35 35 opts.priorities->insert("opengl", 65); 36 36 } 37 37 38 VideoOutputOpenGL::VideoOutputOpenGL( )39 : VideoOutput( ),38 VideoOutputOpenGL::VideoOutputOpenGL(PlaySettings *settings) 39 : VideoOutput(settings), 40 40 gl_context_lock(QMutex::Recursive), 41 41 gl_context(NULL), gl_videochain(NULL), gl_pipchain_active(NULL), 42 42 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 … … 1102 1104 /** \class VideoOutputQuartz 1103 1105 * \brief Implementation of Quartz (Mac OS X windowing system) video output 1104 1106 */ 1105 VideoOutputQuartz::VideoOutputQuartz( ) :1106 VideoOutput( ), Started(false), data(new QuartzData())1107 VideoOutputQuartz::VideoOutputQuartz(PlaySettings *settings) : 1108 VideoOutput(settings), Started(false), data(new QuartzData()) 1107 1109 { 1108 1110 init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0); 1109 1111 } … … 1753 1755 MythCodecID VideoOutputQuartz::GetBestSupportedCodec( 1754 1756 uint width, uint height, 1755 1757 uint osd_width, uint osd_height, 1756 uint stream_type, uint fourcc )1758 uint stream_type, uint fourcc, PlaySettings *settings) 1757 1759 { 1758 1760 (void) osd_width; 1759 1761 (void) osd_height; 1760 1762 1761 VideoDisplayProfile vdp ;1763 VideoDisplayProfile vdp(settings); 1762 1764 vdp.SetInput(QSize(width, height)); 1763 1765 QString dec = vdp.GetDecoder(); 1764 1766 if ((dec == "libmpeg2") || (dec == "ffmpeg")) -
libs/libmythtv/avformatdecoder.cpp
31 31 #include "BDRingBuffer.h" 32 32 #include "videodisplayprofile.h" 33 33 #include "mythuihelper.h" 34 #include "playsettings.h" 34 35 35 36 #include "lcddevice.h" 36 37 … … 273 274 274 275 cc608_build_parity_table(cc608_parity_table); 275 276 276 if ( gCoreContext->GetNumSetting("CCBackground", 0))277 if (GetPlayer()->GetPlaySettings()->GetNumSetting("CCBackground", 0)) 277 278 CC708Window::forceWhiteOnBlackText = true; 278 279 279 280 no_dts_hack = false; … … 1177 1178 if (selectedStream) 1178 1179 { 1179 1180 directrendering = true; 1180 if (! gCoreContext->GetNumSetting("DecodeExtraAudio", 0) &&1181 if (!GetPlayer()->GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0) && 1181 1182 !CODEC_IS_HWACCEL(codec)) 1182 1183 { 1183 1184 SetLowBuffers(false); … … 1653 1654 1654 1655 if (!is_db_ignored) 1655 1656 { 1656 VideoDisplayProfile vdp ;1657 VideoDisplayProfile vdp(GetPlayer()->GetPlaySettings()); 1657 1658 vdp.SetInput(QSize(width, height)); 1658 1659 dec = vdp.GetDecoder(); 1659 1660 thread_count = vdp.GetMaxCPUs(); … … 1681 1682 MythCodecID vdpau_mcid; 1682 1683 vdpau_mcid = VideoOutputVDPAU::GetBestSupportedCodec( 1683 1684 width, height, 1684 mpeg_version(enc->codec_id), no_hardware_decoders); 1685 mpeg_version(enc->codec_id), no_hardware_decoders, 1686 GetPlayer()->GetPlaySettings()); 1685 1687 1686 1688 if (vdpau_mcid >= video_codec_id) 1687 1689 { … … 1713 1715 /* mpeg type */ mpeg_version(enc->codec_id), 1714 1716 /* xvmc pix fmt */ xvmc_pixel_format(enc->pix_fmt), 1715 1717 /* test surface */ codec_is_std(video_codec_id), 1716 /* force_xv */ force_xv); 1718 /* force_xv */ force_xv, 1719 GetPlayer()->GetPlaySettings()); 1717 1720 1718 1721 if (mcid >= video_codec_id) 1719 1722 { -
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
57 57 class OSDListTreeItemEnteredEvent; 58 58 class OSDListTreeItemSelectedEvent; 59 59 struct osdInfo; 60 class PlaySettings; 60 61 61 62 typedef QMap<QString,InfoMap> DDValueMap; 62 63 typedef QMap<QString,DDValueMap> DDKeyMap; … … 180 181 unsigned long seconds; 181 182 }; 182 183 183 TV( void);184 TV(PlaySettings *settings); 184 185 ~TV(); 185 186 186 void InitFromDB( void);187 void InitFromDB(PlaySettings *settings); 187 188 bool Init(bool createWindow = true); 188 189 189 190 // User input processing commands … … 206 207 207 208 // Recording commands 208 209 int PlayFromRecorder(int recordernum); 209 int Playback(const ProgramInfo &rcinfo );210 int Playback(const ProgramInfo &rcinfo, PlaySettings *settings); 210 211 211 212 // Commands used by frontend playback box 212 213 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
3556 3556 3557 3557 VideoDisplayProfile::CreateNewProfiles(host); 3558 3558 profiles = VideoDisplayProfile::GetProfiles(host); 3559 QString profile = VideoDisplayProfile::GetDefaultProfileName(host); 3559 QString profile = 3560 VideoDisplayProfile::GetDefaultProfileName(host, NULL); 3560 3561 3561 3562 if (profiles.contains("Normal") && 3562 3563 (profile=="CPU++" || profile=="CPU+" || profile=="CPU--")) … … 5937 5938 " jump int(11) NOT NULL default '0'," 5938 5939 " PRIMARY KEY (`name`)" 5939 5940 ");", 5941 "CREATE TABLE playgroupsettings (" 5942 " playgroupname varchar(64) NOT NULL," 5943 " `value` varchar(128) NOT NULL," 5944 " `data` text," 5945 " overridden tinyint(1) NOT NULL," 5946 " PRIMARY KEY (playgroupname, `value`)" 5947 ");", 5940 5948 "CREATE TABLE powerpriority (" 5941 5949 " priorityname varchar(64) collate utf8_bin NOT NULL," 5942 5950 " recpriority int(10) NOT NULL default '0'," -
libs/libmythtv/videoout_vdpau.cpp
48 48 opts.deints->insert("vdpau", deints); 49 49 } 50 50 51 VideoOutputVDPAU::VideoOutputVDPAU( )52 : m_win(0),m_render(NULL),51 VideoOutputVDPAU::VideoOutputVDPAU(PlaySettings *settings) 52 : VideoOutput(settings), m_win(0), m_render(NULL), 53 53 m_buffer_size(NUM_VDPAU_BUFFERS), m_pause_surface(0), 54 54 m_need_deintrefs(false), m_video_mixer(0), m_mixer_features(kVDPFeatNone), 55 55 m_checked_surface_ownership(false), … … 871 871 872 872 MythCodecID VideoOutputVDPAU::GetBestSupportedCodec( 873 873 uint width, uint height, 874 uint stream_type, bool no_acceleration )874 uint stream_type, bool no_acceleration, PlaySettings *settings) 875 875 { 876 876 bool use_cpu = no_acceleration; 877 VideoDisplayProfile vdp ;877 VideoDisplayProfile vdp(settings); 878 878 vdp.SetInput(QSize(width, height)); 879 879 QString dec = vdp.GetDecoder(); 880 880 -
libs/libmythtv/videoout_directfb.cpp
274 274 opts.priorities->insert("directfb", 60); 275 275 } 276 276 277 VideoOutputDirectfb::VideoOutputDirectfb( )278 : VideoOutput( ), XJ_started(false), widget(NULL),277 VideoOutputDirectfb::VideoOutputDirectfb(PlaySettings *settings) 278 : VideoOutput(settings), XJ_started(false), widget(NULL), 279 279 data(new DirectfbData()) 280 280 { 281 281 init(&pauseFrame, FMT_YV12, NULL, 0, 0, 0, 0); -
libs/libmythtv/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: ") … … 404 406 WId embedwinid, const QRect *embedbounds, 405 407 bool muted) 406 408 { 407 int exact_seeking = gCoreContext->GetNumSetting("ExactSeeking", 0);409 int exact_seeking = settings->GetNumSetting("ExactSeeking", 0); 408 410 409 411 if (HasPlayer()) 410 412 { … … 447 449 { 448 450 QString subfn = buffer->GetSubtitleFilename(); 449 451 if (!subfn.isEmpty() && player->GetSubReader()) 450 player->GetSubReader()->LoadExternalSubtitles(subfn );452 player->GetSubReader()->LoadExternalSubtitles(subfn, settings); 451 453 } 452 454 453 455 if ((embedwinid > 0) && embedbounds) … … 888 890 /** 889 891 * \brief assign programinfo to the context 890 892 */ 891 void PlayerContext::SetPlayingInfo(const ProgramInfo *info) 893 void PlayerContext::SetPlayingInfo(const ProgramInfo *info, 894 PlaySettings *_settings) 892 895 { 893 896 bool ignoreDB = gCoreContext->IsDatabaseIgnored(); 894 897 … … 900 903 playingInfo->MarkAsInUse(false, recUsage); 901 904 delete playingInfo; 902 905 playingInfo = NULL; 906 // XXX delete settings? 903 907 } 904 908 905 909 if (info) … … 908 912 if (!ignoreDB) 909 913 playingInfo->MarkAsInUse(true, recUsage); 910 914 playingLen = playingInfo->GetSecondsInRecording(); 915 settings = (_settings ? _settings : 916 new PlaySettings(playingInfo->GetPlaybackGroup())); 911 917 } 912 918 } 913 919 -
libs/libmythtv/subtitlereader.cpp
56 56 av_free(subtitle.rects); 57 57 } 58 58 59 bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName) 59 bool SubtitleReader::LoadExternalSubtitles(const QString &subtitleFileName, 60 PlaySettings *settings) 60 61 { 61 62 m_TextSubtitles.Clear(); 62 return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles); 63 return TextSubtitleParser::LoadSubtitles(subtitleFileName, m_TextSubtitles, 64 settings); 63 65 } 64 66 65 67 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 } … … 832 835 class TVInitRunnable : public QRunnable 833 836 { 834 837 public: 835 TVInitRunnable(TV *ourTV) : tv(ourTV) {} 836 virtual void run(void) { tv->InitFromDB(); } 838 TVInitRunnable(TV *ourTV, PlaySettings *ourSettings) : 839 tv(ourTV), settings(ourSettings) {} 840 virtual void run(void) { tv->InitFromDB(settings); } 837 841 TV *tv; 842 PlaySettings *settings; 838 843 }; 839 844 840 845 /** \fn TV::TV(void) 841 846 * \sa Init(void) 842 847 */ 843 TV::TV( void)848 TV::TV(PlaySettings *settings) 844 849 : // Configuration variables from database 845 850 baseFilters(""), 846 851 db_channel_format("<num> <sign>"), … … 939 944 playerActive = 0; 940 945 playerLock.unlock(); 941 946 942 QThreadPool::globalInstance()->start(new TVInitRunnable(this ), 99);947 QThreadPool::globalInstance()->start(new TVInitRunnable(this, settings), 99); 943 948 944 949 VERBOSE(VB_PLAYBACK, LOC + "ctor -- end"); 945 950 } 946 951 947 void TV::InitFromDB( void)952 void TV::InitFromDB(PlaySettings *settings) 948 953 { 949 954 QMap<QString,QString> kv; 950 955 kv["LiveTVIdleTimeout"] = "0"; … … 989 994 kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]); 990 995 991 996 MythDB::getMythDB()->GetSettings(kv); 997 settings->AddToMap(kv); 992 998 993 999 // convert from minutes to ms. 994 1000 db_idle_timeout = kv["LiveTVIdleTimeout"].toInt() * 60 * 1000; … … 1724 1730 askAllowLock.unlock(); 1725 1731 } 1726 1732 1727 int TV::Playback(const ProgramInfo &rcinfo )1733 int TV::Playback(const ProgramInfo &rcinfo, PlaySettings *settings) 1728 1734 { 1729 1735 wantsToQuit = false; 1730 1736 jumpToProgram = false; … … 1738 1744 return 0; 1739 1745 } 1740 1746 1741 mctx->SetPlayingInfo(&rcinfo );1747 mctx->SetPlayingInfo(&rcinfo, settings); 1742 1748 mctx->SetInitialTVState(false); 1743 1749 ScheduleStateChange(mctx); 1744 1750 … … 1821 1827 1822 1828 if (fileexists) 1823 1829 { 1824 Playback(pginfo); 1830 PlaySettings settings("Default"); 1831 Playback(pginfo, &settings); 1825 1832 retval = 1; 1826 1833 } 1827 1834 … … 2162 2169 QString msg = tr("%1 Settings") 2163 2170 .arg(tv_i18n(ctx->playingInfo->GetPlaybackGroup())); 2164 2171 ctx->UnlockPlayingInfo(__FILE__, __LINE__); 2165 if (count > 0) 2172 if (count > 0 && 2173 ctx->playingInfo->GetPlaybackGroup() != "Default" && 2174 ctx->playingInfo->GetPlaybackGroup() != "Videos") 2166 2175 SetOSDMessage(ctx, msg); 2167 2176 ITVRestart(ctx, false); 2168 2177 } -
libs/libmythtv/videodisplayprofile.h
13 13 14 14 #include "mythcontext.h" 15 15 16 class PlaySettings; 17 16 18 typedef QMap<QString,QString> pref_map_t; 17 19 typedef QMap<QString,QStringList> safe_map_t; 18 20 typedef QStringList safe_list_t; … … 80 82 class MPUBLIC VideoDisplayProfile 81 83 { 82 84 public: 83 VideoDisplayProfile( );85 VideoDisplayProfile(PlaySettings *settings); 84 86 ~VideoDisplayProfile(); 85 87 86 88 void SetInput(const QSize &size); … … 124 126 static QString GetDecoderName(const QString &decoder); 125 127 static QString GetDecoderHelp(QString decoder = QString::null); 126 128 127 static QString GetDefaultProfileName(const QString &hostname); 129 static QString GetDefaultProfileName(const QString &hostname, 130 PlaySettings *settings); 128 131 static void SetDefaultProfileName(const QString &profilename, 129 132 const QString &hostname); 130 133 static uint GetProfileGroupID(const QString &profilename, -
libs/libmythtv/videoout_null.cpp
27 27 opts.priorities->insert("null", 10); 28 28 } 29 29 30 VideoOutputNull::VideoOutputNull( ) :31 VideoOutput( ), global_lock(QMutex::Recursive)30 VideoOutputNull::VideoOutputNull(PlaySettings *settings) : 31 VideoOutput(settings), global_lock(QMutex::Recursive) 32 32 { 33 33 VERBOSE(VB_PLAYBACK, "VideoOutputNull()"); 34 34 memset(&av_pause_frame, 0, sizeof(av_pause_frame)); -
libs/libmythtv/videooutbase.cpp
7 7 #include "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 310 312 db_display_dim(0,0), 311 313 db_aspectoverride(kAspect_Off), db_adjustfill(kAdjustFill_Off), … … 345 347 monitor_sz(640,480), monitor_dim(400,300), 346 348 347 349 // OSD 348 osd_painter(NULL), osd_image(NULL) 350 osd_painter(NULL), osd_image(NULL), 351 settings(_settings) 349 352 350 353 { 351 354 bzero(&pip_tmp_image, sizeof(pip_tmp_image)); 352 db_display_dim = QSize( gCoreContext->GetNumSetting("DisplaySizeWidth", 0),353 gCoreContext->GetNumSetting("DisplaySizeHeight", 0));355 db_display_dim = QSize(settings->GetNumSetting("DisplaySizeWidth", 0), 356 settings->GetNumSetting("DisplaySizeHeight", 0)); 354 357 355 358 db_pict_attr[kPictureAttribute_Brightness] = 356 gCoreContext->GetNumSetting("PlaybackBrightness", 50);359 settings->GetNumSetting("PlaybackBrightness", 50); 357 360 db_pict_attr[kPictureAttribute_Contrast] = 358 gCoreContext->GetNumSetting("PlaybackContrast", 50);361 settings->GetNumSetting("PlaybackContrast", 50); 359 362 db_pict_attr[kPictureAttribute_Colour] = 360 gCoreContext->GetNumSetting("PlaybackColour", 50);363 settings->GetNumSetting("PlaybackColour", 50); 361 364 db_pict_attr[kPictureAttribute_Hue] = 362 gCoreContext->GetNumSetting("PlaybackHue", 0);365 settings->GetNumSetting("PlaybackHue", 0); 363 366 364 367 db_aspectoverride = (AspectOverrideMode) 365 gCoreContext->GetNumSetting("AspectOverride", 0);368 settings->GetNumSetting("AspectOverride", 0); 366 369 db_adjustfill = (AdjustFillMode) 367 gCoreContext->GetNumSetting("AdjustFill", 0);370 settings->GetNumSetting("AdjustFill", 0); 368 371 db_letterbox_colour = (LetterBoxColour) 369 gCoreContext->GetNumSetting("LetterboxColour", 0);372 settings->GetNumSetting("LetterboxColour", 0); 370 373 db_use_picture_controls = 371 gCoreContext->GetNumSetting("UseOutputPictureControls", 0);374 settings->GetNumSetting("UseOutputPictureControls", 0); 372 375 373 376 if (!gCoreContext->IsDatabaseIgnored()) 374 db_vdisp_profile = new VideoDisplayProfile( );377 db_vdisp_profile = new VideoDisplayProfile(settings); 375 378 376 windows.push_back(VideoOutWindow( ));379 windows.push_back(VideoOutWindow(settings)); 377 380 } 378 381 379 382 /** … … 449 452 return QString::null; 450 453 } 451 454 452 bool VideoOutput::IsPreferredRenderer(QSize video_size )455 bool VideoOutput::IsPreferredRenderer(QSize video_size, PlaySettings *settings) 453 456 { 454 457 if (!db_vdisp_profile || (video_size == windows[0].GetVideoDispDim())) 455 458 return true; 456 459 457 VideoDisplayProfile vdisp ;460 VideoDisplayProfile vdisp(settings); 458 461 vdisp.SetInput(video_size); 459 462 QString new_rend = vdisp.GetVideoRenderer(); 460 463 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, … … 162 163 bool allowpreviewepg; 163 164 PIPState pip_state; 164 165 166 PlaySettings *settings; 167 165 168 // Constants 166 169 static const float kManualZoomMaxHorizontalZoom; 167 170 static const float kManualZoomMaxVerticalZoom; -
libs/libmythtv/videoout_directfb.h
12 12 { 13 13 public: 14 14 static void GetRenderOptions(render_opts &opts, QStringList &cpudeints); 15 VideoOutputDirectfb( );15 VideoOutputDirectfb(PlaySettings *settings); 16 16 ~VideoOutputDirectfb(); 17 17 18 18 bool Init(int width, int height, float aspect, WId winid, -
libs/libmythtv/playercontext.h
28 28 class LiveTVChain; 29 29 class MythDialog; 30 30 class QPainter; 31 class PlaySettings; 31 32 32 33 struct osdInfo 33 34 { … … 112 113 void SetRecorder(RemoteEncoder *rec); 113 114 void SetTVChain(LiveTVChain *chain); 114 115 void SetRingBuffer(RingBuffer *buf); 115 void SetPlayingInfo(const ProgramInfo *info );116 void SetPlayingInfo(const ProgramInfo *info, PlaySettings *settings=NULL); 116 117 void SetPlayGroup(const QString &group); 117 118 void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state); 118 119 void SetPIPLocation(int loc) { pipLocation = loc; } … … 168 169 LiveTVChain *tvchain; 169 170 RingBuffer *buffer; 170 171 ProgramInfo *playingInfo; ///< Currently playing info 172 PlaySettings *settings; // corresponding to playingInfo 171 173 long long playingLen; ///< Initial CalculateLength() 172 174 bool nohardwaredecoders; // < Disable use of VDPAU decoding 173 175 int last_cardid; ///< CardID of current/last recorder -
libs/libmythtv/vsync.h
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
165 165 * \see VideoOutput, VideoBuffers 166 166 * 167 167 */ 168 VideoOutputXv::VideoOutputXv( )169 : VideoOutput( ),168 VideoOutputXv::VideoOutputXv(PlaySettings *settings) 169 : VideoOutput(settings), 170 170 video_output_subtype(XVUnknown), 171 171 global_lock(QMutex::Recursive), 172 172 … … 390 390 * \return port number if it succeeds, else -1. 391 391 */ 392 392 int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root, 393 PlaySettings *settings, 393 394 MythCodecID mcodecid, 394 395 uint width, uint height, 395 396 bool &xvsetdefaults, … … 474 475 } 475 476 476 477 // figure out if we want chromakeying.. 477 VideoDisplayProfile vdp ;478 VideoDisplayProfile vdp(settings); 478 479 vdp.SetInput(QSize(width, height)); 479 480 bool check_for_colorkey = (vdp.GetOSDRenderer() == "chromakey"); 480 481 … … 763 764 disp->StartLog(); 764 765 QString adaptor_name = QString::null; 765 766 const QSize video_dim = windows[0].GetVideoDim(); 766 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), video_codec_id,767 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, video_codec_id, 767 768 video_dim.width(), video_dim.height(), 768 769 xv_set_defaults, 769 770 xvmc_chroma, &xvmc_surf_info, &adaptor_name); … … 842 843 disp->StartLog(); 843 844 QString adaptor_name = QString::null; 844 845 const QSize video_dim = windows[0].GetVideoDim(); 845 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), kCodec_MPEG2,846 xv_port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, kCodec_MPEG2, 846 847 video_dim.width(), video_dim.height(), 847 848 xv_set_defaults, 0, NULL, &adaptor_name); 848 849 if (xv_port == -1) … … 996 997 uint width, uint height, 997 998 uint osd_width, uint osd_height, 998 999 uint stream_type, int xvmc_chroma, 999 bool test_surface, bool force_xv) 1000 bool test_surface, bool force_xv, 1001 PlaySettings *settings) 1000 1002 { 1001 1003 (void)width, (void)height, (void)osd_width, (void)osd_height; 1002 1004 (void)stream_type, (void)xvmc_chroma, (void)test_surface; … … 1007 1009 return ret; 1008 1010 1009 1011 #ifdef USING_XVMC 1010 VideoDisplayProfile vdp ;1012 VideoDisplayProfile vdp(settings); 1011 1013 vdp.SetInput(QSize(width, height)); 1012 1014 QString dec = vdp.GetDecoder(); 1013 1015 if ((dec == "libmpeg2") || (dec == "ffmpeg")) … … 1057 1059 1058 1060 ok = false; 1059 1061 bool dummy; 1060 int port = GrabSuitableXvPort(disp, disp->GetRoot(), ret, width, height, 1062 int port = GrabSuitableXvPort(disp, disp->GetRoot(), settings, 1063 ret, width, height, 1061 1064 dummy, xvmc_chroma, &info); 1062 1065 if (port >= 0) 1063 1066 { -
libs/libmythtv/mythplayer.cpp
61 61 #include "mythpainter.h" 62 62 #include "mythimage.h" 63 63 #include "mythuiimage.h" 64 #include "playsettings.h" 64 65 65 66 extern "C" { 66 67 #include "vbitext/vbi.h" … … 246 247 output_jmeter(NULL) 247 248 { 248 249 playerThread = QThread::currentThread(); 249 // Playback (output) zoom control250 detect_letter_box = new DetectLetterbox(this);251 250 252 vbimode = VBIMode::Parse(gCoreContext->GetSetting("VbiFormat"));253 decode_extra_audio = gCoreContext->GetNumSetting("DecodeExtraAudio", 0);254 itvEnabled = gCoreContext->GetNumSetting("EnableMHEG", 0);255 db_prefer708 = gCoreContext->GetNumSetting("Prefer708Captions", 1);256 257 251 bzero(&tc_lastval, sizeof(tc_lastval)); 258 252 bzero(&tc_wrap, sizeof(tc_wrap)); 259 253 … … 485 479 if (using_null_videoout && GetDecoder()) 486 480 { 487 481 MythCodecID codec = GetDecoder()->GetVideoCodecID(); 488 videoOutput = new VideoOutputNull( );482 videoOutput = new VideoOutputNull(GetPlaySettings()); 489 483 if (!videoOutput->Init(video_disp_dim.width(), video_disp_dim.height(), 490 484 video_aspect, 0, 0, 0, 0, 0, codec, 0)) 491 485 { … … 535 529 pipState, 536 530 video_disp_dim, video_aspect, 537 531 widget->winId(), display_rect, (video_frame_rate * play_speed), 538 0 /*embedid*/ );532 0 /*embedid*/, GetPlaySettings()); 539 533 } 540 534 541 535 if (videoOutput) … … 629 623 630 624 void MythPlayer::ReinitVideo(void) 631 625 { 632 if (!videoOutput->IsPreferredRenderer(video_disp_dim ))626 if (!videoOutput->IsPreferredRenderer(video_disp_dim, GetPlaySettings())) 633 627 { 634 628 VERBOSE(VB_PLAYBACK, LOC + QString("Need to switch video renderer.")); 635 629 SetErrored(QObject::tr("Need to switch video renderer.")); … … 1948 1942 } 1949 1943 #endif // USING_MHEG 1950 1944 1951 SetCaptionsEnabled(gCoreContext->GetNumSetting("DefaultCCMode"), false); 1945 SetCaptionsEnabled(GetPlaySettings()->GetNumSetting("DefaultCCMode", 0), 1946 false); 1952 1947 } 1953 1948 1954 1949 SetPlaying(true); … … 1994 1989 m_double_process = videoOutput->IsExtraProcessingRequired(); 1995 1990 1996 1991 videosync = VideoSync::BestMethod( 1997 videoOutput, fr_int, rf_int, m_double_framerate); 1992 videoOutput, GetPlaySettings(), 1993 fr_int, rf_int, m_double_framerate); 1998 1994 1999 1995 // Make sure video sync can do it 2000 1996 if (videosync != NULL && m_double_framerate) … … 2357 2353 if (bookmarkseek > 30) 2358 2354 { 2359 2355 DoFastForward(bookmarkseek, true, false); 2360 if ( gCoreContext->GetNumSetting("ClearSavedPosition", 1) &&2356 if (GetPlaySettings()->GetNumSetting("ClearSavedPosition", 1) && 2361 2357 !player_ctx->IsPIP()) 2362 2358 { 2363 2359 ClearBookmark(false); … … 2563 2559 { 2564 2560 if (jumpto == totalFrames) 2565 2561 { 2566 if (!( gCoreContext->GetNumSetting("EndOfRecordingExitPrompt") == 12562 if (!(GetPlaySettings()->GetNumSetting("EndOfRecordingExitPrompt", 0) == 1 2567 2563 && !player_ctx->IsPIP() && 2568 2564 player_ctx->GetState() == kState_WatchingPreRecorded)) 2569 2565 { … … 2831 2827 return kPIP_END; 2832 2828 2833 2829 if (pip_players.isEmpty()) 2834 return (PIPLocation)gCoreContext->GetNumSetting("PIPLocation", kPIPTopLeft); 2830 return (PIPLocation)GetPlaySettings()->GetNumSetting("PIPLocation", 2831 kPIPTopLeft); 2835 2832 2836 2833 // order of preference, could be stored in db if we want it configurable 2837 2834 PIPLocation ols[] = … … 3337 3334 exactseeks = frame_exact_seek; 3338 3335 player_ctx = ctx; 3339 3336 livetv = ctx->tvchain; 3337 3338 vbimode = VBIMode::Parse(GetPlaySettings()->GetSetting("VbiFormat", "")); 3339 3340 // Playback (output) zoom control 3341 detect_letter_box = new DetectLetterbox(this); 3342 3343 decode_extra_audio = GetPlaySettings()->GetNumSetting("DecodeExtraAudio", 0); 3344 itvEnabled = GetPlaySettings()->GetNumSetting("EnableMHEG", 0); 3345 db_prefer708 = GetPlaySettings()->GetNumSetting("Prefer708Captions", 1); 3340 3346 } 3341 3347 3342 3348 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 bool operator<(const text_subtitle_t& left, 26 27 const text_subtitle_t& right) … … 116 117 m_lock.unlock(); 117 118 } 118 119 119 bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target) 120 bool TextSubtitleParser::LoadSubtitles(QString fileName, TextSubtitles &target, 121 PlaySettings *settings) 120 122 { 121 123 demux_sputext_t sub_data; 122 124 sub_data.rbuffer = new RingBuffer(fileName, 0, false); … … 134 136 target.SetFrameBasedTiming(!sub_data.uses_time); 135 137 136 138 QTextCodec *textCodec = NULL; 137 QString codec = gCoreContext->GetSetting("SubtitleCodec", "");139 QString codec = settings->GetSetting("SubtitleCodec", ""); 138 140 if (!codec.isEmpty()) 139 141 textCodec = QTextCodec::codecForName(codec.toLatin1()); 140 142 if (!textCodec) -
libs/libmythtv/subtitlescreen.cpp
7 7 #include "mythuiimage.h" 8 8 #include "mythpainter.h" 9 9 #include "subtitlescreen.h" 10 #include "playsettings.h" 10 11 11 12 #define LOC QString("Subtitles: ") 12 13 #define LOC_WARN QString("Subtitles Warning: ") … … 62 63 VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-608 reader."); 63 64 if (!m_708reader) 64 65 VERBOSE(VB_IMPORTANT, LOC_WARN + "Failed to get CEA-708 reader."); 65 m_useBackground = (bool) gCoreContext->GetNumSetting("CCBackground", 0);66 m_708fontZoom = gCoreContext->GetNumSetting("OSDCC708TextZoom", 100);66 m_useBackground = (bool)m_player->GetPlaySettings()->GetNumSetting("CCBackground", 0); 67 m_708fontZoom = m_player->GetPlaySettings()->GetNumSetting("OSDCC708TextZoom", 100); 67 68 return true; 68 69 } 69 70 -
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 cbwidget->insertItem(label); 739 807 } 740 808 809 if (special_formatting) 810 { 811 changeOnSpecial = true; 812 specialLabel = label; 813 } 814 741 815 SelectSetting::addSelection(label, value, select); 742 816 743 817 if (cbwidget && isSet) … … 953 1027 BooleanSetting::setHelpText(str); 954 1028 } 955 1029 1030 QWidget* TristateCheckBoxSetting::configWidget(ConfigurationGroup *cg, 1031 QWidget* parent, 1032 const char* widgetName) { 1033 widget = new MythCheckBox(parent, widgetName, true); 1034 connect(widget, SIGNAL(destroyed(QObject*)), 1035 this, SLOT(widgetDeleted(QObject*))); 1036 1037 widget->setHelpText(getHelpText()); 1038 widget->setText(getLabel()); 1039 widget->setCheckState(tristateValue()); 1040 setValue(tristateValue()); 1041 1042 connect(widget, SIGNAL(stateChanged(int)), 1043 this, SLOT(setValue(int))); 1044 connect(this, SIGNAL(valueChanged(int)), 1045 this, SLOT(relayValueChanged(int))); 1046 1047 if (cg) 1048 connect(widget, SIGNAL(changeHelpText(QString)), cg, 1049 SIGNAL(changeHelpText(QString))); 1050 1051 return widget; 1052 } 1053 1054 void TristateCheckBoxSetting::widgetInvalid(QObject *obj) 1055 { 1056 widget = (widget == obj) ? NULL : widget; 1057 } 1058 1059 void TristateCheckBoxSetting::setEnabled(bool fEnabled) 1060 { 1061 TristateSetting::setEnabled(fEnabled); 1062 if (widget) 1063 widget->setEnabled(fEnabled); 1064 } 1065 1066 void TristateCheckBoxSetting::setHelpText(const QString &str) 1067 { 1068 if (widget) 1069 widget->setHelpText(str); 1070 TristateSetting::setHelpText(str); 1071 } 1072 1073 const char *TristateSetting::kPartiallyCheckedString = "default"; 1074 1075 void TristateCheckBoxSetting::setValue(int check) 1076 { 1077 adjustFont(widget, (check != Qt::Checked && check != Qt::Unchecked)); 1078 TristateSetting::setValue(check); 1079 emit valueChanged(check); 1080 } 1081 1082 void TristateSetting::setValue(int check) 1083 { 1084 if (check == Qt::Checked) 1085 Setting::setValue("1"); 1086 else if (check == Qt::Unchecked) 1087 Setting::setValue("0"); 1088 else 1089 Setting::setValue(kPartiallyCheckedString); 1090 emit valueChanged(check); 1091 } 1092 956 1093 void AutoIncrementDBSetting::Save(QString table) 957 1094 { 958 1095 if (intValue() == 0) … … 1140 1277 addSelection(label, value, select); 1141 1278 } 1142 1279 1280 void ImageSelectSetting::addDefaultSelection(const QString label, 1281 const QString value, 1282 const QString defaultValue, 1283 bool select) 1284 { 1285 for (unsigned i=0; i<values.size(); i++) 1286 { 1287 if (values[i] == defaultValue) 1288 { 1289 changeOnSpecial = true; 1290 specialLabel = label; 1291 images.push_back(new QImage(*images[i])); 1292 addSelection(label, value, select); 1293 return; 1294 } 1295 } 1296 } 1297 1143 1298 ImageSelectSetting::~ImageSelectSetting() 1144 1299 { 1145 1300 Teardown(); … … 1162 1317 bxwidget = NULL; 1163 1318 imagelabel = NULL; 1164 1319 combo = NULL; 1320 labelWidget = NULL; 1165 1321 } 1166 1322 1167 1323 void ImageSelectSetting::imageSet(int num) … … 1209 1365 QLabel *label = new QLabel(); 1210 1366 label->setText(getLabel() + ":"); 1211 1367 layout->addWidget(label); 1368 labelWidget = label; 1212 1369 } 1213 1370 1214 1371 combo = new MythComboBox(false); … … 1255 1412 connect(combo, SIGNAL(highlighted(int)), this, SLOT(imageSet(int))); 1256 1413 connect(combo, SIGNAL(activated(int)), this, SLOT(setValue(int))); 1257 1414 connect(combo, SIGNAL(activated(int)), this, SLOT(imageSet(int))); 1415 connect(combo, SIGNAL(highlighted(const QString &)), 1416 this, SLOT(changeLabel(const QString &))); 1417 connect(combo, SIGNAL(activated(const QString &)), 1418 this, SLOT(changeLabel(const QString &))); 1258 1419 1259 1420 connect(this, SIGNAL(selectionsCleared()), 1260 1421 combo, SLOT(clear())); … … 1265 1426 1266 1427 bxwidget->setLayout(layout); 1267 1428 1429 changeLabel(GetLabel(current)); 1430 1268 1431 return bxwidget; 1269 1432 } 1270 1433 1434 void ImageSelectSetting::changeLabel(const QString &newLabel) 1435 { 1436 if (changeOnSpecial) 1437 { 1438 adjustFont(labelWidget, specialLabel == newLabel); 1439 adjustFont(combo, specialLabel == newLabel); 1440 } 1441 } 1442 1271 1443 void ImageSelectSetting::widgetInvalid(QObject *obj) 1272 1444 { 1273 1445 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
37 37 #include "mythconfig.h" 38 38 #include "mythdirs.h" 39 39 #include "mythuihelper.h" 40 #include "playsettings.h" 40 41 42 #define CREATE_CHECKBOX_SETTING(var, name, settings) \ 43 BooleanSetting *var; \ 44 if ((settings)) \ 45 var = new PlaySettingsCheckBox((name), (settings)); \ 46 else \ 47 var = new HostCheckBox((name)) 48 49 #define CREATE_COMBOBOX_SETTING(var, name, settings) \ 50 ComboBoxSetting *var; \ 51 if ((settings)) \ 52 var = new PlaySettingsComboBox((name), (settings)); \ 53 else \ 54 var = new HostComboBox((name)) 55 56 #define CREATE_COMBOBOX1_SETTING(var, name, settings, arg1) \ 57 ComboBoxSetting *var; \ 58 if ((settings)) \ 59 var = new PlaySettingsComboBox((name), (settings), (arg1)); \ 60 else \ 61 var = new HostComboBox((name), (arg1)) 62 63 #define CREATE_SPINBOX_SETTING(var, name, settings, arg1, arg2, arg3, arg4) \ 64 SpinBoxSetting *var; \ 65 if ((settings)) \ 66 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3), (arg4)); \ 67 else \ 68 var = new HostSpinBox((name), (arg1), (arg2), (arg3), (arg4)) 69 70 #define CREATE_LINEEDIT_SETTING(var, name, settings) \ 71 LineEditSetting *var; \ 72 if ((settings)) \ 73 var = new PlaySettingsLineEdit((name), (settings), ""); \ 74 else \ 75 var = new HostLineEdit((name)) 76 77 // For PlaySettings, use a SpinBox instead of a Slider so that a 78 // default value can be easily used. 79 #define CREATE_SLIDER_SETTING(var, name, settings, arg1, arg2, arg3) \ 80 BoundedIntegerSetting *var; \ 81 if ((settings)) \ 82 var = new PlaySettingsSpinBox((name), (settings), (arg1), (arg2), (arg3)); \ 83 else \ 84 var = new HostSlider((name), (arg1), (arg2), (arg3)) 85 86 #define CREATE_IMAGESELECT_SETTING(var, name, settings) \ 87 ImageSelectSetting *var; \ 88 if ((settings)) \ 89 var = new PlaySettingsImageSelect((name), (settings)); \ 90 else \ 91 var = new HostImageSelect((name)) 92 93 static Setting *wrap(Setting *obj, PlaySettings *settings, 94 bool twoLineLabel=false) 95 { 96 if (!settings) 97 return obj; 98 99 // Get the setting name 100 PlaySettingsCombinedStorage *storage = 101 dynamic_cast<PlaySettingsCombinedStorage *>(obj); 102 const QString &name = storage->getName(); 103 104 // Get the default value and label. The label is different 105 // from the value for most object types. 106 QString defaultValue = settings->GetSetting(name, "", true); 107 QString defaultLabel(defaultValue); 108 if (dynamic_cast<BooleanSetting *>(obj)) 109 defaultLabel = (defaultValue == "0" || defaultValue.isEmpty() ? 110 QObject::tr("disabled") : QObject::tr("enabled")); 111 if (dynamic_cast<SpinBoxSetting *>(obj) && defaultValue.isEmpty()) 112 defaultLabel = "0"; 113 ComboBoxSetting *cb = dynamic_cast<ComboBoxSetting *>(obj); 114 if (cb) 115 { 116 defaultLabel = cb->GetValueLabel(defaultValue); 117 // Add the default selection to a ComboBox 118 cb->addSelection(QString("(") + QObject::tr("default") + ")", 119 storage->getDefault(), 120 !settings->IsOverridden(name), 121 true); 122 } 123 ImageSelectSetting *is = dynamic_cast<ImageSelectSetting *>(obj); 124 if (is) 125 { 126 defaultLabel = is->GetValueLabel(defaultValue); 127 // Add the default selection to a ImageSelect 128 is->addDefaultSelection(QString("(") + QObject::tr("default") + ")", 129 storage->getDefault(), 130 defaultValue, 131 !settings->IsOverridden(name)); 132 } 133 134 // Change the help text to include the default and its source. 135 QString helpPrefix; 136 if (dynamic_cast<LineEditSetting *>(obj)) 137 helpPrefix = QObject::tr("Leave blank to keep default value"); 138 else 139 helpPrefix = QObject::tr("Override default value"); 140 helpPrefix += " (" + defaultLabel + ") "; 141 QString inheritsFrom = settings->InheritsFrom(name); 142 if (inheritsFrom.isNull()) 143 helpPrefix += QObject::tr("from global settings"); 144 else 145 helpPrefix += QObject::tr("from group") + " " + inheritsFrom; 146 helpPrefix += ". " + obj->getHelpText(); 147 obj->setHelpText(helpPrefix); 148 149 // Change the label to include the default. 150 obj->setLabel(obj->getLabel() + (twoLineLabel ? "\n" : "") + 151 " (" + defaultLabel + ")"); 152 153 return obj; 154 } 155 41 156 class TriggeredItem : public TriggeredConfigurationGroup 42 157 { 43 158 public: … … 593 708 return gs; 594 709 } 595 710 596 static HostCheckBox *DecodeExtraAudio()711 static Setting *DecodeExtraAudio(PlaySettings *settings) 597 712 { 598 HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");713 CREATE_CHECKBOX_SETTING(gc, "DecodeExtraAudio", settings); 599 714 gc->setLabel(QObject::tr("Extra audio buffering")); 600 715 gc->setValue(true); 601 716 gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing " … … 604 719 "effect on framegrabbers (MPEG-4/RTJPEG). MythTV will " 605 720 "keep extra audio data in its internal buffers to " 606 721 "workaround this bug.")); 607 return gc;722 return wrap(gc, settings); 608 723 } 609 724 610 static HostComboBox *PIPLocationComboBox()725 static Setting *PIPLocationComboBox(PlaySettings *settings) 611 726 { 612 HostComboBox *gc = new HostComboBox("PIPLocation");727 CREATE_COMBOBOX_SETTING(gc, "PIPLocation", settings); 613 728 gc->setLabel(QObject::tr("PIP video location")); 614 729 for (uint loc = 0; loc < kPIP_END; ++loc) 615 730 gc->addSelection(toString((PIPLocation) loc), QString::number(loc)); 616 731 gc->setHelpText(QObject::tr("Location of PIP Video window.")); 617 return gc;732 return wrap(gc, settings); 618 733 } 619 734 620 735 static GlobalLineEdit *AllRecGroupPassword() … … 710 825 return gc; 711 826 } 712 827 713 static HostCheckBox *SmartForward()828 static Setting *SmartForward(PlaySettings *settings) 714 829 { 715 HostCheckBox *gc = new HostCheckBox("SmartForward");830 CREATE_CHECKBOX_SETTING(gc, "SmartForward", settings); 716 831 gc->setLabel(QObject::tr("Smart fast forwarding")); 717 832 gc->setValue(false); 718 833 gc->setHelpText(QObject::tr("If enabled, then immediately after " 719 834 "rewinding, only skip forward the same amount as " 720 835 "skipping backwards.")); 721 return gc;836 return wrap(gc, settings); 722 837 } 723 838 724 static HostCheckBox *ExactSeeking()839 static Setting *ExactSeeking(PlaySettings *settings) 725 840 { 726 HostCheckBox *gc = new HostCheckBox("ExactSeeking");841 CREATE_CHECKBOX_SETTING(gc, "ExactSeeking", settings); 727 842 gc->setLabel(QObject::tr("Seek to exact frame")); 728 843 gc->setValue(false); 729 844 gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but " 730 845 "slower.")); 731 return gc;846 return wrap(gc, settings); 732 847 } 733 848 734 849 static GlobalComboBox *CommercialSkipMethod() … … 746 861 return bc; 747 862 } 748 863 749 static HostComboBox *AutoCommercialSkip()864 static Setting *AutoCommercialSkip(PlaySettings *settings) 750 865 { 751 HostComboBox *gc = new HostComboBox("AutoCommercialSkip");866 CREATE_COMBOBOX_SETTING(gc, "AutoCommercialSkip", settings); 752 867 gc->setLabel(QObject::tr("Automatically skip commercials")); 753 868 gc->addSelection(QObject::tr("Off"), "0"); 754 869 gc->addSelection(QObject::tr("Notify, but do not skip"), "2"); … … 757 872 "have been flagged during automatic commercial detection " 758 873 "or by the mythcommflag program, or just notify that a " 759 874 "commercial has been detected.")); 760 return gc;875 return wrap(gc, settings); 761 876 } 762 877 763 878 static GlobalCheckBox *AutoCommercialFlag() … … 843 958 return bc; 844 959 } 845 960 846 static HostSpinBox *CommRewindAmount()961 static Setting *CommRewindAmount(PlaySettings *settings) 847 962 { 848 HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);963 CREATE_SPINBOX_SETTING(gs, "CommRewindAmount", settings, 0, 10, 1, false); 849 964 gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)")); 850 965 gs->setHelpText(QObject::tr("MythTV will automatically rewind " 851 966 "this many seconds after performing a commercial skip.")); 852 967 gs->setValue(0); 853 return gs;968 return wrap(gs, settings); 854 969 } 855 970 856 static HostSpinBox *CommNotifyAmount()971 static Setting *CommNotifyAmount(PlaySettings *settings) 857 972 { 858 HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);973 CREATE_SPINBOX_SETTING(gs, "CommNotifyAmount", settings, 0, 10, 1, false); 859 974 gs->setLabel(QObject::tr("Commercial skip notify amount (secs)")); 860 975 gs->setHelpText(QObject::tr("MythTV will act like a commercial " 861 976 "begins this many seconds early. This can be useful " 862 977 "when commercial notification is used in place of " 863 978 "automatic skipping.")); 864 979 gs->setValue(0); 865 return gs;980 return wrap(gs, settings); 866 981 } 867 982 868 983 static GlobalSpinBox *MaximumCommercialSkip() … … 1664 1779 labels[j]->setValue(label_i); 1665 1780 } 1666 1781 1667 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) : 1782 PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str, 1783 PlaySettings *settings) : 1668 1784 TriggeredConfigurationGroup(false, true, true, true, 1669 1785 false, false, true, true), grouptrigger(NULL) 1670 1786 { 1671 1787 setLabel(QObject::tr("Playback Profiles") + str); 1788 if (settings) 1789 setLabel(QObject::tr("Playback group settings for ") + 1790 settings->mGroupName + " - " + 1791 getLabel()); 1672 1792 1673 1793 QString host = gCoreContext->GetHostName(); 1674 1794 QStringList profiles = VideoDisplayProfile::GetProfiles(host); … … 1696 1816 profiles = VideoDisplayProfile::GetProfiles(host); 1697 1817 } 1698 1818 1699 QString profile = VideoDisplayProfile::GetDefaultProfileName(host );1819 QString profile = VideoDisplayProfile::GetDefaultProfileName(host, settings); 1700 1820 if (!profiles.contains(profile)) 1701 1821 { 1702 1822 profile = (profiles.contains("Normal")) ? "Normal" : profiles[0]; 1703 1823 VideoDisplayProfile::SetDefaultProfileName(profile, host); 1704 1824 } 1705 1825 1706 grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile"); 1826 CREATE_COMBOBOX_SETTING(gs, "DefaultVideoPlaybackProfile", settings); 1827 grouptrigger = gs; 1707 1828 grouptrigger->setLabel(QObject::tr("Current Video Playback Profile")); 1708 1829 QStringList::const_iterator it; 1709 1830 for (it = profiles.begin(); it != profiles.end(); ++it) 1710 1831 grouptrigger->addSelection(ProgramInfo::i18n(*it), *it); 1832 if (settings) 1833 { 1834 addChild(wrap(grouptrigger, settings)); 1835 return; 1836 } 1711 1837 1712 1838 HorizontalConfigurationGroup *grp = 1713 1839 new HorizontalConfigurationGroup(false, false, true, true); … … 1840 1966 return gc; 1841 1967 } 1842 1968 1843 static HostSpinBox *FFRewReposTime()1969 static Setting *FFRewReposTime(PlaySettings *settings) 1844 1970 { 1845 HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);1971 CREATE_SPINBOX_SETTING(gs, "FFRewReposTime", settings, 0, 200, 5, false); 1846 1972 gs->setLabel(QObject::tr("Fast forward/rewind reposition amount")); 1847 1973 gs->setValue(100); 1848 1974 gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind " … … 1850 1976 "resuming normal playback. This " 1851 1977 "compensates for the reaction time between seeing " 1852 1978 "where to resume playback and actually exiting seeking.")); 1853 return gs;1979 return wrap(gs, settings); 1854 1980 } 1855 1981 1856 static HostCheckBox *FFRewReverse()1982 static Setting *FFRewReverse(PlaySettings *settings) 1857 1983 { 1858 HostCheckBox *gc = new HostCheckBox("FFRewReverse");1984 CREATE_CHECKBOX_SETTING(gc, "FFRewReverse", settings); 1859 1985 gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind")); 1860 1986 gc->setValue(true); 1861 1987 gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key " … … 1863 1989 "vice versa. If disabled, it will decrease the " 1864 1990 "current speed or switch to play mode if " 1865 1991 "the speed can't be decreased further.")); 1866 return gc;1992 return wrap(gc, settings); 1867 1993 } 1868 1994 1869 1995 static HostComboBox *MenuTheme() … … 1914 2040 return gc; 1915 2041 } 1916 2042 1917 static HostSpinBox *OSDCC708TextZoomPercentage(void)2043 static Setting *OSDCC708TextZoomPercentage(PlaySettings *settings) 1918 2044 { 1919 HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5); 2045 CREATE_SPINBOX_SETTING(gs, "OSDCC708TextZoom", settings, 2046 50, 200, 5, false); 1920 2047 gs->setLabel(QObject::tr("ATSC caption text zoom percentage")); 1921 2048 gs->setValue(100); 1922 2049 gs->setHelpText(QObject::tr("Use this to enlarge or shrink captions.")); 1923 2050 1924 return gs;2051 return wrap(gs, settings); 1925 2052 } 1926 2053 1927 static HostComboBox *SubtitleCodec()2054 static Setting *SubtitleCodec(PlaySettings *settings) 1928 2055 { 1929 HostComboBox *gc = new HostComboBox("SubtitleCodec");2056 CREATE_COMBOBOX_SETTING(gc, "SubtitleCodec", settings); 1930 2057 1931 2058 gc->setLabel(QObject::tr("Subtitle Codec")); 1932 2059 QList<QByteArray> list = QTextCodec::availableCodecs(); … … 1948 2075 return gc; 1949 2076 } 1950 2077 1951 static HostSpinBox *VertScanPercentage()2078 static Setting *VertScanPercentage(PlaySettings *settings) 1952 2079 { 1953 HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1); 2080 CREATE_SPINBOX_SETTING(gs, "VertScanPercentage", settings, 2081 -100, 100, 1, false); 1954 2082 gs->setLabel(QObject::tr("Vertical scaling")); 1955 2083 gs->setValue(0); 1956 2084 gs->setHelpText(QObject::tr( 1957 2085 "Adjust this if the image does not fill your " 1958 2086 "screen vertically. Range -100% to 100%")); 1959 return gs;2087 return wrap(gs, settings); 1960 2088 } 1961 2089 1962 static HostSpinBox *HorizScanPercentage()2090 static Setting *HorizScanPercentage(PlaySettings *settings) 1963 2091 { 1964 HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1); 2092 CREATE_SPINBOX_SETTING(gs, "HorizScanPercentage", settings, 2093 -100, 100, 1, false); 1965 2094 gs->setLabel(QObject::tr("Horizontal scaling")); 1966 2095 gs->setValue(0); 1967 2096 gs->setHelpText(QObject::tr( 1968 2097 "Adjust this if the image does not fill your " 1969 2098 "screen horizontally. Range -100% to 100%")); 1970 return gs;2099 return wrap(gs, settings); 1971 2100 }; 1972 2101 1973 static HostSpinBox *XScanDisplacement()2102 static Setting *XScanDisplacement(PlaySettings *settings) 1974 2103 { 1975 HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1); 2104 CREATE_SPINBOX_SETTING(gs, "XScanDisplacement", settings, 2105 -50, 50, 1, false); 1976 2106 gs->setLabel(QObject::tr("Scan displacement (X)")); 1977 2107 gs->setValue(0); 1978 2108 gs->setHelpText(QObject::tr("Adjust this to move the image horizontally.")); 1979 return gs;2109 return wrap(gs, settings); 1980 2110 } 1981 2111 1982 static HostSpinBox *YScanDisplacement()2112 static Setting *YScanDisplacement(PlaySettings *settings) 1983 2113 { 1984 HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1); 2114 CREATE_SPINBOX_SETTING(gs, "YScanDisplacement", settings, 2115 -50, 50, 1, false); 1985 2116 gs->setLabel(QObject::tr("Scan displacement (Y)")); 1986 2117 gs->setValue(0); 1987 2118 gs->setHelpText(QObject::tr("Adjust this to move the image vertically.")); 1988 return gs;2119 return wrap(gs, settings); 1989 2120 }; 1990 2121 1991 2122 static HostCheckBox *AlwaysStreamFiles() … … 2000 2131 return gc; 2001 2132 } 2002 2133 2003 static HostCheckBox *CCBackground()2134 static Setting *CCBackground(PlaySettings *settings) 2004 2135 { 2005 HostCheckBox *gc = new HostCheckBox("CCBackground");2136 CREATE_CHECKBOX_SETTING(gc, "CCBackground", settings); 2006 2137 gc->setLabel(QObject::tr("Black background for closed captioning")); 2007 2138 gc->setValue(false); 2008 2139 gc->setHelpText(QObject::tr( 2009 2140 "If enabled, captions will be displayed " 2010 2141 "as white text over a black background " 2011 2142 "for better contrast.")); 2012 return gc;2143 return wrap(gc, settings); 2013 2144 } 2014 2145 2015 static HostCheckBox *DefaultCCMode()2146 static Setting *DefaultCCMode(PlaySettings *settings) 2016 2147 { 2017 HostCheckBox *gc = new HostCheckBox("DefaultCCMode");2148 CREATE_CHECKBOX_SETTING(gc, "DefaultCCMode", settings); 2018 2149 gc->setLabel(QObject::tr("Always display closed captioning or subtitles")); 2019 2150 gc->setValue(false); 2020 2151 gc->setHelpText(QObject::tr( … … 2022 2153 "when playing back recordings or watching " 2023 2154 "Live TV. Closed Captioning can be turned on or off " 2024 2155 "by pressing \"T\" during playback.")); 2025 return gc;2156 return wrap(gc, settings); 2026 2157 } 2027 2158 2028 static HostCheckBox *PreferCC708()2159 static Setting *PreferCC708(PlaySettings *settings) 2029 2160 { 2030 HostCheckBox *gc = new HostCheckBox("Prefer708Captions");2161 CREATE_CHECKBOX_SETTING(gc, "Prefer708Captions", settings); 2031 2162 gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions")); 2032 2163 gc->setValue(true); 2033 2164 gc->setHelpText( … … 2035 2166 "If enabled, the newer EIA-708 captions will be preferred over " 2036 2167 "the older EIA-608 captions in ATSC streams.")); 2037 2168 2038 return gc;2169 return wrap(gc, settings); 2039 2170 } 2040 2171 2041 static HostCheckBox *EnableMHEG()2172 static Setting *EnableMHEG(PlaySettings *settings) 2042 2173 { 2043 HostCheckBox *gc = new HostCheckBox("EnableMHEG");2174 CREATE_CHECKBOX_SETTING(gc, "EnableMHEG", settings); 2044 2175 gc->setLabel(QObject::tr("Enable interactive TV")); 2045 2176 gc->setValue(false); 2046 2177 gc->setHelpText(QObject::tr( 2047 2178 "If enabled, interactive TV applications (MHEG) will " 2048 2179 "be activated. This is used for teletext and logos for " 2049 2180 "radio and channels that are currently off-air.")); 2050 return gc;2181 return wrap(gc, settings); 2051 2182 } 2052 2183 2053 static HostCheckBox *PersistentBrowseMode()2184 static Setting *PersistentBrowseMode(PlaySettings *settings) 2054 2185 { 2055 HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");2186 CREATE_CHECKBOX_SETTING(gc, "PersistentBrowseMode", settings); 2056 2187 gc->setLabel(QObject::tr("Always use browse mode in Live TV")); 2057 2188 gc->setValue(true); 2058 2189 gc->setHelpText( 2059 2190 QObject::tr( 2060 2191 "If enabled, browse mode will automatically be activated " 2061 2192 "whenever you use channel up/down while watching Live TV.")); 2062 return gc;2193 return wrap(gc, settings); 2063 2194 } 2064 2195 2065 static HostCheckBox *BrowseAllTuners()2196 static Setting *BrowseAllTuners(PlaySettings *settings) 2066 2197 { 2067 HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");2198 CREATE_CHECKBOX_SETTING(gc, "BrowseAllTuners", settings); 2068 2199 gc->setLabel(QObject::tr("Browse all channels")); 2069 2200 gc->setValue(false); 2070 2201 gc->setHelpText( … … 2072 2203 "If enabled, browse mode will shows channels on all " 2073 2204 "available recording devices, instead of showing " 2074 2205 "channels on just the current recorder.")); 2075 return gc;2206 return wrap(gc, settings); 2076 2207 } 2077 2208 2078 static HostCheckBox *ClearSavedPosition()2209 static Setting *ClearSavedPosition(PlaySettings *settings) 2079 2210 { 2080 HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");2211 CREATE_CHECKBOX_SETTING(gc, "ClearSavedPosition", settings); 2081 2212 gc->setLabel(QObject::tr("Clear bookmark on playback")); 2082 2213 gc->setValue(true); 2083 2214 gc->setHelpText(QObject::tr("If enabled, automatically clear the " 2084 2215 "bookmark on a recording when the recording is played " 2085 2216 "back. If disabled, you can mark the beginning with " 2086 2217 "rewind then save position.")); 2087 return gc;2218 return wrap(gc, settings); 2088 2219 } 2089 2220 2090 static HostCheckBox *AltClearSavedPosition()2221 static Setting *AltClearSavedPosition(PlaySettings *settings) 2091 2222 { 2092 HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");2223 CREATE_CHECKBOX_SETTING(gc, "AltClearSavedPosition", settings); 2093 2224 gc->setLabel(QObject::tr("Alternate clear and save bookmark")); 2094 2225 gc->setValue(true); 2095 2226 gc->setHelpText(QObject::tr("During playback the SELECT key " … … 2097 2228 "Saved\" and \"Bookmark Cleared\". If disabled, the " 2098 2229 "SELECT key will save the current position for each " 2099 2230 "keypress.")); 2100 return gc;2231 return wrap(gc, settings); 2101 2232 } 2102 2233 2103 2234 #if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU) 2104 static HostCheckBox *UsePicControls()2235 static Setting *UsePicControls(PlaySettings *settings) 2105 2236 { 2106 HostCheckBox *gc = new HostCheckBox("UseOutputPictureControls");2237 CREATE_CHECKBOX_SETTING(gc, "UseOutputPictureControls", settings); 2107 2238 gc->setLabel(QObject::tr("Enable picture controls")); 2108 2239 gc->setValue(false); 2109 2240 gc->setHelpText( 2110 2241 QObject::tr( 2111 2242 "If enabled, MythTV attempts to initialize picture controls " 2112 2243 "(brightness, contrast, etc.) that are applied during playback.")); 2113 return gc;2244 return wrap(gc, settings); 2114 2245 } 2115 2246 #endif 2116 2247 2117 static HostLineEdit *UDPNotifyPort()2248 static Setting *UDPNotifyPort(PlaySettings *settings) 2118 2249 { 2119 HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");2250 CREATE_LINEEDIT_SETTING(ge, "UDPNotifyPort", settings); 2120 2251 ge->setLabel(QObject::tr("UDP notify port")); 2121 2252 ge->setValue("6948"); 2122 2253 ge->setHelpText(QObject::tr("During playback, MythTV will listen for " 2123 2254 "connections from the \"mythtvosd\" or \"mythudprelay\" " 2124 2255 "programs on this port. For additional information, see " 2125 2256 "http://www.mythtv.org/wiki/MythNotify .")); 2126 return ge;2257 return wrap(ge, settings); 2127 2258 } 2128 2259 2129 static HostComboBox *PlaybackExitPrompt()2260 static Setting *PlaybackExitPrompt(PlaySettings *settings) 2130 2261 { 2131 HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");2262 CREATE_COMBOBOX_SETTING(gc, "PlaybackExitPrompt", settings); 2132 2263 gc->setLabel(QObject::tr("Action on playback exit")); 2133 2264 gc->addSelection(QObject::tr("Just exit"), "0"); 2134 2265 gc->addSelection(QObject::tr("Save position and exit"), "2"); … … 2139 2270 "when you exit playback mode. The options available will " 2140 2271 "allow you to save your position, delete the " 2141 2272 "recording, or continue watching.")); 2142 return gc;2273 return wrap(gc, settings); 2143 2274 } 2144 2275 2145 static HostCheckBox *EndOfRecordingExitPrompt()2276 static Setting *EndOfRecordingExitPrompt(PlaySettings *settings) 2146 2277 { 2147 HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");2278 CREATE_CHECKBOX_SETTING(gc, "EndOfRecordingExitPrompt", settings); 2148 2279 gc->setLabel(QObject::tr("Prompt at end of recording")); 2149 2280 gc->setValue(false); 2150 2281 gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing " 2151 2282 "you to delete the recording when it has finished " 2152 2283 "playing.")); 2153 return gc;2284 return wrap(gc, settings); 2154 2285 } 2155 2286 2156 static HostCheckBox *JumpToProgramOSD()2287 static Setting *JumpToProgramOSD(PlaySettings *settings) 2157 2288 { 2158 HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");2289 CREATE_CHECKBOX_SETTING(gc, "JumpToProgramOSD", settings); 2159 2290 gc->setLabel(QObject::tr("Jump to program OSD")); 2160 2291 gc->setValue(true); 2161 2292 gc->setHelpText(QObject::tr( … … 2164 2295 "'Watch Recording' screen when 'Jump to Program' " 2165 2296 "is activated. If enabled, the recordings are shown " 2166 2297 "in the OSD")); 2167 return gc;2298 return wrap(gc, settings); 2168 2299 } 2169 2300 2170 static HostCheckBox *ContinueEmbeddedTVPlay()2301 static Setting *ContinueEmbeddedTVPlay(PlaySettings *settings) 2171 2302 { 2172 HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");2303 CREATE_CHECKBOX_SETTING(gc, "ContinueEmbeddedTVPlay", settings); 2173 2304 gc->setLabel(QObject::tr("Continue playback when embedded")); 2174 2305 gc->setValue(false); 2175 2306 gc->setHelpText(QObject::tr( … … 2177 2308 "is embedded in the upcoming program list or recorded " 2178 2309 "list. The default is to pause the recorded show when " 2179 2310 "embedded.")); 2180 return gc;2311 return wrap(gc, settings); 2181 2312 } 2182 2313 2183 static HostCheckBox *AutomaticSetWatched()2314 static Setting *AutomaticSetWatched(PlaySettings *settings) 2184 2315 { 2185 HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");2316 CREATE_CHECKBOX_SETTING(gc, "AutomaticSetWatched", settings); 2186 2317 gc->setLabel(QObject::tr("Automatically mark a recording as watched")); 2187 2318 gc->setValue(false); 2188 2319 gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a " … … 2190 2321 "detection is not foolproof, so do not enable this " 2191 2322 "setting if you don't want an unwatched recording marked " 2192 2323 "as watched.")); 2193 return gc;2324 return wrap(gc, settings); 2194 2325 } 2195 2326 2196 2327 static HostSpinBox *LiveTVIdleTimeout() … … 2390 2521 return gc; 2391 2522 } 2392 2523 2393 static HostComboBox *LetterboxingColour()2524 static Setting *LetterboxingColour(PlaySettings *settings) 2394 2525 { 2395 HostComboBox *gc = new HostComboBox("LetterboxColour");2526 CREATE_COMBOBOX_SETTING(gc, "LetterboxColour", settings); 2396 2527 gc->setLabel(QObject::tr("Letterboxing color")); 2397 2528 for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m) 2398 2529 gc->addSelection(toString((LetterBoxColour)m), QString::number(m)); … … 2402 2533 "letterboxing, but those with plasma screens may prefer gray " 2403 2534 "to minimize burn-in.") + " " + 2404 2535 QObject::tr("Currently only works with XVideo video renderer.")); 2405 return gc;2536 return wrap(gc, settings); 2406 2537 } 2407 2538 2408 static HostComboBox *AspectOverride()2539 static Setting *AspectOverride(PlaySettings *settings) 2409 2540 { 2410 HostComboBox *gc = new HostComboBox("AspectOverride");2541 CREATE_COMBOBOX_SETTING(gc, "AspectOverride", settings); 2411 2542 gc->setLabel(QObject::tr("Video aspect override")); 2412 2543 for (int m = kAspect_Off; m < kAspect_END; ++m) 2413 2544 gc->addSelection(toString((AspectOverrideMode)m), QString::number(m)); … … 2415 2546 "When enabled, these will override the aspect " 2416 2547 "ratio specified by any broadcaster for all " 2417 2548 "video streams.")); 2418 return gc;2549 return wrap(gc, settings); 2419 2550 } 2420 2551 2421 static HostComboBox *AdjustFill()2552 static Setting *AdjustFill(PlaySettings *settings) 2422 2553 { 2423 HostComboBox *gc = new HostComboBox("AdjustFill");2554 CREATE_COMBOBOX_SETTING(gc, "AdjustFill", settings); 2424 2555 gc->setLabel(QObject::tr("Zoom")); 2425 2556 gc->addSelection(toString(kAdjustFill_AutoDetect_DefaultOff), 2426 2557 QString::number(kAdjustFill_AutoDetect_DefaultOff)); … … 2431 2562 gc->setHelpText(QObject::tr( 2432 2563 "When enabled, these will apply a predefined " 2433 2564 "zoom to all video playback in MythTV.")); 2434 return gc;2565 return wrap(gc, settings); 2435 2566 } 2436 2567 2437 2568 // Theme settings … … 2853 2984 return gc; 2854 2985 } 2855 2986 2856 ThemeSelector::ThemeSelector(QString label): 2857 HostImageSelect(label){2858 2987 static Setting *ThemeSelector(QString label, PlaySettings *settings=NULL) 2988 { 2989 CREATE_IMAGESELECT_SETTING(gs, label, settings); 2859 2990 ThemeType themetype = THEME_UI; 2860 2991 2861 2992 if (label == "Theme") 2862 2993 { 2863 2994 themetype = THEME_UI; 2864 setLabel(QObject::tr("UI theme"));2995 gs->setLabel(QObject::tr("UI theme")); 2865 2996 } 2866 2997 else if (label == "MenuTheme") 2867 2998 { 2868 2999 themetype = THEME_MENU; 2869 setLabel(QObject::tr("Menu theme"));3000 gs->setLabel(QObject::tr("Menu theme")); 2870 3001 } 2871 3002 2872 3003 QDir themes(GetThemesParentDir()); … … 2930 3061 VERBOSE(VB_IMPORTANT, QString("Problem reading theme preview image" 2931 3062 " %1").arg(preview.filePath())); 2932 3063 2933 addImageSelection(name, previewImage, theme.fileName());3064 gs->addImageSelection(name, previewImage, theme.fileName()); 2934 3065 } 2935 3066 2936 3067 if (themetype & THEME_UI) 2937 setValue(DEFAULT_UI_THEME); 3068 gs->setValue(DEFAULT_UI_THEME); 3069 3070 return wrap(gs, settings); 2938 3071 } 2939 3072 2940 3073 static HostComboBox *ChannelFormat() … … 3437 3570 return gs; 3438 3571 } 3439 3572 3440 static HostCheckBox *RealtimePriority()3573 static Setting *RealtimePriority(PlaySettings *settings) 3441 3574 { 3442 HostCheckBox *gc = new HostCheckBox("RealtimePriority");3575 CREATE_CHECKBOX_SETTING(gc, "RealtimePriority", settings); 3443 3576 gc->setLabel(QObject::tr("Enable realtime priority threads")); 3444 3577 gc->setHelpText(QObject::tr("When running mythfrontend with root " 3445 3578 "privileges, some threads can be given enhanced priority. " 3446 3579 "Disable this if mythfrontend freezes during video " 3447 3580 "playback.")); 3448 3581 gc->setValue(true); 3449 return gc;3582 return wrap(gc, settings, false); 3450 3583 } 3451 3584 3452 3585 static HostCheckBox *EnableMediaMon() … … 3602 3735 }; 3603 3736 3604 3737 #ifdef USING_OPENGL_VSYNC 3605 static HostCheckBox *UseOpenGLVSync()3738 static Setting *UseOpenGLVSync(PlaySettings *settings) 3606 3739 { 3607 HostCheckBox *gc = new HostCheckBox("UseOpenGLVSync");3740 CREATE_CHECKBOX_SETTING(gc, "UseOpenGLVSync", settings); 3608 3741 gc->setLabel(QObject::tr("Enable OpenGL vertical sync for timing")); 3609 3742 gc->setValue(false); 3610 3743 gc->setHelpText(QObject::tr( 3611 3744 "If supported by your hardware/drivers, " 3612 3745 "MythTV will use OpenGL vertical syncing for " 3613 3746 "video timing, reducing frame jitter.")); 3614 return gc;3747 return wrap(gc, settings); 3615 3748 } 3616 3749 #endif 3617 3750 … … 4037 4170 return gc; 4038 4171 } 4039 4172 4040 MainGeneralSettings::MainGeneralSettings() 4173 MainGeneralSettings::MainGeneralSettings(PlaySettings *settings, 4174 ConfigurationWizard *base) 4041 4175 { 4176 if (!settings) 4177 { 4042 4178 DatabaseSettings::addDatabaseSettings(this); 4043 4179 4044 4180 VerticalConfigurationGroup *pin = … … 4091 4227 remotecontrol->addChild(NetworkControlEnabled()); 4092 4228 remotecontrol->addChild(NetworkControlPort()); 4093 4229 addChild(remotecontrol); 4230 } 4094 4231 } 4095 4232 4096 PlaybackSettings::PlaybackSettings() 4233 PlaybackSettings::PlaybackSettings(PlaySettings *settings, 4234 ConfigurationWizard *base) 4097 4235 { 4098 4236 uint i = 0, total = 8; 4099 4237 #if CONFIG_DARWIN 4100 4238 total += 2; 4101 4239 #endif // USING_DARWIN 4240 if (settings) 4241 total -= 3; 4102 4242 4103 4243 4104 4244 VerticalConfigurationGroup* general1 = 4105 4245 new VerticalConfigurationGroup(false); 4106 4246 general1->setLabel(QObject::tr("General Playback") + 4107 4247 QString(" (%1/%2)").arg(++i).arg(total)); 4248 if (settings) 4249 general1->setLabel(QObject::tr("Playback group settings for ") + 4250 settings->mGroupName + " - " + 4251 general1->getLabel()); 4108 4252 4109 4253 HorizontalConfigurationGroup *columns = 4110 4254 new HorizontalConfigurationGroup(false, false, true, true); 4111 4255 4112 4256 VerticalConfigurationGroup *column1 = 4113 4257 new VerticalConfigurationGroup(false, false, true, true); 4114 column1->addChild(RealtimePriority()); 4115 column1->addChild(DecodeExtraAudio()); 4116 column1->addChild(JumpToProgramOSD()); 4258 if (!settings) 4259 column1->addChild(RealtimePriority(settings)); 4260 column1->addChild(DecodeExtraAudio(settings)); 4261 column1->addChild(JumpToProgramOSD(settings)); 4117 4262 columns->addChild(column1); 4118 4263 4119 4264 VerticalConfigurationGroup *column2 = 4120 4265 new VerticalConfigurationGroup(false, false, true, true); 4121 column2->addChild(ClearSavedPosition( ));4122 column2->addChild(AltClearSavedPosition( ));4123 column2->addChild(AutomaticSetWatched( ));4124 column2->addChild(ContinueEmbeddedTVPlay( ));4266 column2->addChild(ClearSavedPosition(settings)); 4267 column2->addChild(AltClearSavedPosition(settings)); 4268 column2->addChild(AutomaticSetWatched(settings)); 4269 column2->addChild(ContinueEmbeddedTVPlay(settings)); 4125 4270 columns->addChild(column2); 4126 4271 4127 4272 general1->addChild(columns); 4128 general1->addChild(LiveTVIdleTimeout()); 4129 general1->addChild(AlwaysStreamFiles()); 4273 if (!settings) 4274 general1->addChild(LiveTVIdleTimeout()); 4275 if (!settings) 4276 general1->addChild(AlwaysStreamFiles()); 4130 4277 #ifdef USING_OPENGL_VSYNC 4131 general1->addChild(UseOpenGLVSync( ));4278 general1->addChild(UseOpenGLVSync(settings)); 4132 4279 #endif // USING_OPENGL_VSYNC 4133 4280 #if defined(USING_XV) || defined(USING_OPENGL_VIDEO) || defined(USING_VDPAU) 4134 general1->addChild(UsePicControls( ));4281 general1->addChild(UsePicControls(settings)); 4135 4282 #endif // USING_XV 4136 addChild(general1); 4283 if (base) 4284 base->addChild(general1); 4285 else 4286 addChild(general1); 4137 4287 4138 4288 VerticalConfigurationGroup* general2 = 4139 4289 new VerticalConfigurationGroup(false); 4140 4290 general2->setLabel(QObject::tr("General Playback") + 4141 4291 QString(" (%1/%2)").arg(++i).arg(total)); 4292 if (settings) 4293 general2->setLabel(QObject::tr("Playback group settings for ") + 4294 settings->mGroupName + " - " + 4295 general2->getLabel()); 4142 4296 4143 4297 HorizontalConfigurationGroup* oscan = 4144 4298 new HorizontalConfigurationGroup(false, false, true, true); … … 4146 4300 new VerticalConfigurationGroup(false, false, true, true); 4147 4301 VerticalConfigurationGroup *ocol2 = 4148 4302 new VerticalConfigurationGroup(false, false, true, true); 4149 ocol1->addChild(VertScanPercentage( ));4150 ocol1->addChild(YScanDisplacement( ));4151 ocol2->addChild(HorizScanPercentage( ));4152 ocol2->addChild(XScanDisplacement( ));4303 ocol1->addChild(VertScanPercentage(settings)); 4304 ocol1->addChild(YScanDisplacement(settings)); 4305 ocol2->addChild(HorizScanPercentage(settings)); 4306 ocol2->addChild(XScanDisplacement(settings)); 4153 4307 oscan->addChild(ocol1); 4154 4308 oscan->addChild(ocol2); 4155 4309 4156 4310 HorizontalConfigurationGroup* aspect_fill = 4157 4311 new HorizontalConfigurationGroup(false, false, true, true); 4158 aspect_fill->addChild(AspectOverride( ));4159 aspect_fill->addChild(AdjustFill( ));4312 aspect_fill->addChild(AspectOverride(settings)); 4313 aspect_fill->addChild(AdjustFill(settings)); 4160 4314 4161 4315 general2->addChild(oscan); 4162 4316 general2->addChild(aspect_fill); 4163 general2->addChild(LetterboxingColour()); 4164 general2->addChild(PIPLocationComboBox()); 4165 general2->addChild(PlaybackExitPrompt()); 4166 general2->addChild(EndOfRecordingExitPrompt()); 4167 addChild(general2); 4317 general2->addChild(LetterboxingColour(settings)); 4318 general2->addChild(PIPLocationComboBox(settings)); 4319 general2->addChild(PlaybackExitPrompt(settings)); 4320 general2->addChild(EndOfRecordingExitPrompt(settings)); 4321 if (base) 4322 base->addChild(general2); 4323 else 4324 addChild(general2); 4168 4325 4169 4326 QString tmp = QString(" (%1/%2)").arg(++i).arg(total); 4170 addChild(new PlaybackProfileConfigs(tmp)); 4327 if (base) 4328 base->addChild(new PlaybackProfileConfigs(tmp, settings)); 4329 else 4330 addChild(new PlaybackProfileConfigs(tmp, settings)); 4171 4331 4332 if (!settings) 4333 { 4172 4334 VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false); 4173 4335 pbox->setLabel(QObject::tr("View Recordings") + 4174 4336 QString(" (%1/%2)").arg(++i).arg(total)); … … 4196 4358 pbox3->addChild(DisplayGroupTitleSort()); 4197 4359 pbox3->addChild(new WatchListSettings()); 4198 4360 addChild(pbox3); 4361 } 4199 4362 4200 4363 VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false); 4201 4364 seek->setLabel(QObject::tr("Seeking") + 4202 4365 QString(" (%1/%2)").arg(++i).arg(total)); 4203 seek->addChild(SmartForward()); 4204 seek->addChild(FFRewReposTime()); 4205 seek->addChild(FFRewReverse()); 4206 seek->addChild(ExactSeeking()); 4207 addChild(seek); 4366 if (settings) 4367 seek->setLabel(QObject::tr("Playback group settings for ") + 4368 settings->mGroupName + " - " + 4369 seek->getLabel()); 4370 seek->addChild(SmartForward(settings)); 4371 seek->addChild(FFRewReposTime(settings)); 4372 seek->addChild(FFRewReverse(settings)); 4373 seek->addChild(ExactSeeking(settings)); 4374 if (base) 4375 base->addChild(seek); 4376 else 4377 addChild(seek); 4208 4378 4209 4379 VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false); 4210 4380 comms->setLabel(QObject::tr("Commercial Skip") + 4211 4381 QString(" (%1/%2)").arg(++i).arg(total)); 4212 comms->addChild(AutoCommercialSkip()); 4213 comms->addChild(CommRewindAmount()); 4214 comms->addChild(CommNotifyAmount()); 4382 if (settings) 4383 comms->setLabel(QObject::tr("Playback group settings for ") + 4384 settings->mGroupName + " - " + 4385 comms->getLabel()); 4386 comms->addChild(AutoCommercialSkip(settings)); 4387 comms->addChild(CommRewindAmount(settings)); 4388 comms->addChild(CommNotifyAmount(settings)); 4389 if (!settings) // these are global settings, not host-specific 4390 { 4215 4391 comms->addChild(MaximumCommercialSkip()); 4216 4392 comms->addChild(MergeShortCommBreaks()); 4217 4393 comms->addChild(CommSkipAllBlanks()); 4218 addChild(comms); 4394 } 4395 if (base) 4396 base->addChild(comms); 4397 else 4398 addChild(comms); 4219 4399 4220 4400 #if CONFIG_DARWIN 4221 4401 VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false); 4222 4402 mac1->setLabel(QObject::tr("Mac OS X Video Settings") + 4223 4403 QString(" (%1/%2)").arg(++i).arg(total)); 4404 if (settings) 4405 mac1->setLabel(QObject::tr("Playback group settings for ") + 4406 settings->mGroupName + " - " + 4407 mac1->getLabel()); 4408 if (!settings) 4409 { 4224 4410 mac1->addChild(MacGammaCorrect()); 4225 4411 mac1->addChild(MacScaleUp()); 4226 4412 mac1->addChild(MacFullSkip()); 4227 addChild(mac1); 4413 } 4414 if (base) 4415 base->addChild(mac1); 4416 else 4417 addChild(mac1); 4228 4418 4229 4419 VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false); 4230 4420 mac2->setLabel(QObject::tr("Mac OS X Video Settings") + 4231 4421 QString(" (%1/%2)").arg(++i).arg(total)); 4422 if (settings) 4423 mac2->setLabel(QObject::tr("Playback group settings for ") + 4424 settings->mGroupName + " - " + 4425 mac2->getLabel()); 4426 if (!setings) 4427 { 4232 4428 mac2->addChild(new MacMainSettings()); 4233 4429 mac2->addChild(new MacFloatSettings()); 4234 4430 … … 4242 4438 #endif 4243 4439 } 4244 4440 4245 OSDSettings::OSDSettings() 4441 OSDSettings::OSDSettings(PlaySettings *settings, 4442 ConfigurationWizard *base) 4246 4443 { 4247 4444 VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false); 4248 4445 osd->setLabel(QObject::tr("On-screen Display")); 4446 if (settings) 4447 osd->setLabel(QObject::tr("Playback group settings for ") + 4448 settings->mGroupName + " - " + 4449 osd->getLabel()); 4249 4450 4250 osd->addChild(EnableMHEG()); 4251 osd->addChild(PersistentBrowseMode()); 4252 osd->addChild(BrowseAllTuners()); 4253 osd->addChild(SubtitleCodec()); 4254 osd->addChild(UDPNotifyPort()); 4255 addChild(osd); 4451 if (!settings) 4452 { 4453 osd->addChild(EnableMHEG(settings)); 4454 osd->addChild(PersistentBrowseMode(settings)); 4455 osd->addChild(BrowseAllTuners(settings)); 4456 osd->addChild(SubtitleCodec(settings)); 4457 osd->addChild(UDPNotifyPort(settings)); 4458 } 4459 if (base) 4460 base->addChild(osd); 4461 else 4462 addChild(osd); 4256 4463 4257 4464 VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false); 4258 4465 cc->setLabel(QObject::tr("Closed Captions")); 4466 if (settings) 4467 cc->setLabel(QObject::tr("Playback group settings for ") + 4468 settings->mGroupName + " - " + 4469 cc->getLabel()); 4259 4470 //cc->addChild(DecodeVBIFormat()); 4260 cc->addChild(CCBackground()); 4261 cc->addChild(DefaultCCMode()); 4262 cc->addChild(PreferCC708()); 4263 cc->addChild(OSDCC708TextZoomPercentage()); 4264 addChild(cc); 4471 cc->addChild(CCBackground(settings)); 4472 cc->addChild(DefaultCCMode(settings)); 4473 cc->addChild(PreferCC708(settings)); 4474 cc->addChild(OSDCC708TextZoomPercentage(settings)); 4475 if (base) 4476 base->addChild(cc); 4477 else 4478 addChild(cc); 4265 4479 4266 4480 #if CONFIG_DARWIN 4267 4481 // Any Mac OS-specific OSD stuff would go here. … … 4404 4618 VerticalConfigurationGroup* theme = new VerticalConfigurationGroup(false); 4405 4619 theme->setLabel(QObject::tr("Theme")); 4406 4620 4407 theme->addChild( newThemeSelector("Theme"));4621 theme->addChild(ThemeSelector("Theme")); 4408 4622 4409 4623 theme->addChild(ThemePainter()); 4410 4624 theme->addChild(MenuTheme()); -
programs/mythfrontend/main.cpp
34 34 #include "globalsettings.h" 35 35 #include "profilegroup.h" 36 36 #include "playgroup.h" 37 #include "playsettings.h" 37 38 #include "networkcontrol.h" 38 39 #include "DVDRingBuffer.h" 39 40 #include "scheduledrecording.h" … … 482 483 delete statusbox; 483 484 } 484 485 486 ConfigurationWizard *createPlaybackSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 487 { 488 return new PlaybackSettings(settings, base); 489 } 490 491 ConfigurationWizard *createOSDSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 492 { 493 return new OSDSettings(settings, base); 494 } 495 496 ConfigurationWizard *createMainGeneralSettingsForPlaybackGroup(PlaySettings *settings, ConfigurationWizard *base) 497 { 498 return new MainGeneralSettings(settings, base); 499 } 500 501 static PlayGroupEditor::SettingsLookup pbgroupSetup[] = { 502 createPlaybackSettingsForPlaybackGroup, 503 createOSDSettingsForPlaybackGroup, 504 createMainGeneralSettingsForPlaybackGroup 505 }; 506 485 507 void TVMenuCallback(void *data, QString &selection) 486 508 { 487 509 (void)data; … … 574 596 } 575 597 else if (sel == "settings playgroup") 576 598 { 577 PlayGroupEditor editor; 599 PlayGroupEditor editor(pbgroupSetup, 600 sizeof(pbgroupSetup)/sizeof(*pbgroupSetup)); 578 601 editor.exec(); 579 602 } 580 603 else if (sel == "settings general") … … 766 789 } 767 790 } 768 791 delete tmprbuf; 792 pginfo->SetPlaybackGroup("Videos"); 769 793 } 770 794 else if (pginfo->IsVideo()) 795 { 771 796 pos = pginfo->QueryBookmark(); 797 pginfo->SetPlaybackGroup("Videos"); 798 } 772 799 773 800 if (pos > 0) 774 801 { -
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.");