Index: mediaportal/Configuration/Sections/TVClient.cs =================================================================== --- mediaportal/Configuration/Sections/TVClient.cs (revision 28134) +++ mediaportal/Configuration/Sections/TVClient.cs (working copy) @@ -69,6 +69,7 @@ private MPGroupBox mpGroupBox4; private MPCheckBox mpCheckBoxEnableTTXTSub; private MPCheckBox mpCheckBoxEnableDVBSub; + private MPCheckBox mpCheckBoxAutoShowSubWhenTvStarts; private ColumnHeader columnHeader1; private ColumnHeader columnHeader2; private ColumnHeader columnHeader4; @@ -143,6 +144,7 @@ mpCheckBoxEnableDVBSub.Checked = xmlreader.GetValueAsBool("tvservice", "dvbbitmapsubtitles", false); mpCheckBoxEnableTTXTSub.Checked = xmlreader.GetValueAsBool("tvservice", "dvbttxtsubtitles", false); + mpCheckBoxAutoShowSubWhenTvStarts.Checked = xmlreader.GetValueAsBool("tvservice", "autoshowsubwhentvstarts", true); enableAudioDualMonoModes.Checked = xmlreader.GetValueAsBool("tvservice", "audiodualmono", false); cbHideAllChannels.Checked = xmlreader.GetValueAsBool("mytv", "hideAllChannelsGroup", false); cbShowChannelStateIcons.Checked = xmlreader.GetValueAsBool("mytv", "showChannelStateIcons", true); @@ -318,6 +320,7 @@ xmlwriter.SetValueAsBool("tvservice", "dvbbitmapsubtitles", mpCheckBoxEnableDVBSub.Checked); xmlwriter.SetValueAsBool("tvservice", "dvbttxtsubtitles", mpCheckBoxEnableTTXTSub.Checked); + xmlwriter.SetValueAsBool("tvservice", "autoshowsubwhentvstarts", mpCheckBoxAutoShowSubWhenTvStarts.Checked); xmlwriter.SetValueAsBool("tvservice", "audiodualmono", enableAudioDualMonoModes.Checked); xmlwriter.SetValueAsBool("mytv", "hideAllChannelsGroup", cbHideAllChannels.Checked); xmlwriter.SetValueAsBool("myradio", "hideAllChannelsGroup", cbHideAllChannels.Checked); @@ -427,6 +430,7 @@ this.checkBoxNotifyPlaySound = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.mpLabel2 = new MediaPortal.UserInterface.Controls.MPLabel(); this.txtNotifyBefore = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.mpCheckBoxAutoShowSubWhenTvStarts = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.mpGroupBox2.SuspendLayout(); this.mpGroupBox1.SuspendLayout(); this.tabControlTVGeneral.SuspendLayout(); @@ -947,12 +951,13 @@ // // mpGroupBox4 // + this.mpGroupBox4.Controls.Add(this.mpCheckBoxAutoShowSubWhenTvStarts); this.mpGroupBox4.Controls.Add(this.mpCheckBoxEnableTTXTSub); this.mpGroupBox4.Controls.Add(this.mpCheckBoxEnableDVBSub); this.mpGroupBox4.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.mpGroupBox4.Location = new System.Drawing.Point(16, 308); this.mpGroupBox4.Name = "mpGroupBox4"; - this.mpGroupBox4.Size = new System.Drawing.Size(432, 60); + this.mpGroupBox4.Size = new System.Drawing.Size(432, 86); this.mpGroupBox4.TabIndex = 10; this.mpGroupBox4.TabStop = false; this.mpGroupBox4.Text = "Subtitle settings"; @@ -1236,6 +1241,17 @@ this.txtNotifyBefore.TabIndex = 7; this.txtNotifyBefore.Text = "300"; // + // mpCheckBoxAutoShowSubWhenTvStarts + // + this.mpCheckBoxAutoShowSubWhenTvStarts.AutoSize = true; + this.mpCheckBoxAutoShowSubWhenTvStarts.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.mpCheckBoxAutoShowSubWhenTvStarts.Location = new System.Drawing.Point(9, 55); + this.mpCheckBoxAutoShowSubWhenTvStarts.Name = "mpCheckBoxAutoShowSubWhenTvStarts"; + this.mpCheckBoxAutoShowSubWhenTvStarts.Size = new System.Drawing.Size(134, 17); + this.mpCheckBoxAutoShowSubWhenTvStarts.TabIndex = 12; + this.mpCheckBoxAutoShowSubWhenTvStarts.Text = "Automatically show subtitles when TV starts"; + this.mpCheckBoxAutoShowSubWhenTvStarts.UseVisualStyleBackColor = false; + // // TVClient // this.Controls.Add(this.tabControlTVGeneral); Index: mediaportal/Core/Player/TSReaderPlayer.cs =================================================================== --- mediaportal/Core/Player/TSReaderPlayer.cs (revision 28134) +++ mediaportal/Core/Player/TSReaderPlayer.cs (working copy) @@ -47,6 +47,7 @@ private bool enableDVBBitmapSubtitles = false; private bool enableDVBTtxtSubtitles = false; private bool enableMPAudioSwitcher = false; + private bool autoShowSubWhenTvStarts = true; private int relaxTsReader = 0; // Disable dropping of discontinued dvb packets private string strVideoCodec = ""; private string strAudioCodec = ""; @@ -154,7 +155,7 @@ ref string strAudioCodec, ref string strAACAudioCodec, ref string strDDPLUSAudioCodec, ref string strH264VideoCodec, ref string strAudioRenderer, - ref bool enableDVBBitmapSubtitles, ref bool enableDVBTtxtSubtitles, + ref bool enableDVBBitmapSubtitles, ref bool enableDVBTtxtSubtitles, ref bool autoShowSubWhenTvStarts, ref int relaxTsReader) { using (Settings xmlreader = new MPSettings()) @@ -178,6 +179,7 @@ strAudioRenderer = xmlreader.GetValueAsString("mytv", "audiorenderer", "Default DirectSound Device"); enableDVBBitmapSubtitles = xmlreader.GetValueAsBool("tvservice", "dvbbitmapsubtitles", false); enableDVBTtxtSubtitles = xmlreader.GetValueAsBool("tvservice", "dvbttxtsubtitles", false); + autoShowSubWhenTvStarts = xmlreader.GetValueAsBool("tvservice", "autoshowsubwhentvstarts", true); enableMPAudioSwitcher = xmlreader.GetValueAsBool("tvservice", "audiodualmono", false); relaxTsReader = (xmlreader.GetValueAsBool("mytv", "relaxTsReader", false) == false ? 0 : 1); // as int for passing through interface @@ -258,7 +260,7 @@ LoadMyTvFilterSettings(ref intFilters, ref strFilters, ref strVideoCodec, ref strAudioCodec, ref strAACAudioCodec, ref strDDPLUSAudioCodec, ref strH264VideoCodec, ref strAudioRenderer, - ref enableDVBBitmapSubtitles, ref enableDVBTtxtSubtitles, ref relaxTsReader); + ref enableDVBBitmapSubtitles, ref enableDVBTtxtSubtitles, ref autoShowSubWhenTvStarts, ref relaxTsReader); _graphBuilder = (IGraphBuilder)new FilterGraph(); _rotEntry = new DsROTEntry((IFilterGraph)_graphBuilder); @@ -529,6 +531,13 @@ Log.Debug("TSReaderPlayer: Last subtitle index: {0}", lastSubIndex); CurrentSubtitleStream = lastSubIndex; } + + if (!autoShowSubWhenTvStarts) + { + Log.Debug("TSReaderPlayer: Automatically show subtitles when TV starts is set to {0}", autoShowSubWhenTvStarts); + EnableSubtitle = autoShowSubWhenTvStarts; + } + return true; } catch (Exception ex)