home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Custom Data Grabber including Sky UK Channel/EPG Grabber
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="DJBlu" data-source="post: 1079655" data-attributes="member: 54957"><p>[USER=121281]@Benoire[/USER]</p><p></p><p>Try this, replace the AddRemoveChannels sub with the following</p><p>[code]</p><p></p><p> Public Sub UpdateAddChannels()</p><p> Try</p><p> Dim DiseqC As Integer = Settings.DiseqC</p><p> Dim UseSkyNumbers As Boolean = Settings.UseSkyNumbers</p><p> Dim SwitchingFrequency As Integer = Settings.SwitchingFrequency</p><p> Dim UseSkyRegions As Boolean = Settings.UseSkyRegions</p><p> Dim UseSkyCategories As Boolean = Settings.UseSkyCategories</p><p> Dim ChannelsAdded As Integer = 0</p><p> Dim UseModNotSetSD As Boolean = Settings.UseNotSetModSD</p><p> Dim UseModNotSetHD As Boolean = Settings.UseNotSetModHD</p><p> Dim IgnoreScrambled As Boolean = Settings.IgnoreScrambled</p><p> Dim NID As Integer = Settings.NID</p><p> Dim channel As New DVBSChannel</p><p> Dim currentDetail As TuningDetail</p><p></p><p> If (Not OnMessageEvent Is Nothing) Then</p><p> RaiseEvent OnMessage("", False)</p><p> End If</p><p></p><p> For Each pair As KeyValuePair(Of Integer, Sky_Channel) In Channels</p><p> '//Dim detail As TuningDetail - Needs rest of Sky filtering work.</p><p> ChannelsAdded += 1</p><p> RaiseEvent OnMessage("(" & ChannelsAdded & "/" & Channels.Count & ") Channels sorted", True)</p><p> Dim ChannelId As Integer = pair.Key</p><p> Dim ScannedChannel As Sky_Channel = pair.Value</p><p> If ChannelId < 1 Then Continue For</p><p> If ScannedChannel.NID = 0 Or ScannedChannel.TID = 0 Or ScannedChannel.SID = 0 Then</p><p> Continue For</p><p> End If</p><p> Dim SDT As SDTInfo = GetChannelbySID(ScannedChannel.NID & "-" & ScannedChannel.TID & "-" & ScannedChannel.SID)</p><p> If SDT Is Nothing Then</p><p> Continue For</p><p> End If</p><p> If SDT Is Nothing Then</p><p> Continue For</p><p> End If</p><p> If IgnoreScrambled And SDT.isFTA Then</p><p> Continue For</p><p> End If</p><p> Dim checker As Channel = _layer.GetChannelbyExternalID(ScannedChannel.NID & ":" & ScannedChannel.ChannelID.ToString)</p><p> currentDetail = Nothing</p><p> If Not checker Is Nothing Then</p><p> Dim Channels As List(Of TuningDetail) = checker.ReferringTuningDetail</p><p> If Channels Is Not Nothing Then</p><p> For Each Chann As TuningDetail In Channels</p><p> If Chann.ChannelType = 3 And Chann.NetworkId = 169 Then</p><p> currentDetail = Chann</p><p> Exit For</p><p> End If</p><p> Next</p><p> End If</p><p> End If</p><p> 'Add New Channel</p><p> If currentDetail Is Nothing Then</p><p> GoTo AddNewChannel</p><p> End If</p><p>AddNewChannel:</p><p> If Not NITInfo.ContainsKey(ScannedChannel.TID) Then</p><p> 'no nit info</p><p> RaiseEvent OnMessage("No NIT found for : " & ScannedChannel.SID, False)</p><p> RaiseEvent OnMessage("", False)</p><p> Continue For</p><p> End If</p><p> ''//this stuff appears missing:</p><p> Dim channelNumber As Integer = 10000</p><p> Dim VisibleInGuide As Boolean = True</p><p> If (UseSkyNumbers And (ScannedChannel.LCNCount > 0)) Then</p><p> If ScannedChannel.ContainsLCN(Me.BouquetIDtoUse, Me.RegionIDtoUse) Then</p><p> channelNumber = ScannedChannel.GetLCN(Me.BouquetIDtoUse, Me.RegionIDtoUse).SkyNum</p><p> If ScannedChannel.ContainsLCN(Me.BouquetIDtoUse, 255) Then</p><p> channelNumber = ScannedChannel.GetLCN(Me.BouquetIDtoUse, 255).SkyNum</p><p> End If</p><p> End If</p><p></p><p> If (channelNumber = 10000) Then</p><p> VisibleInGuide = False</p><p> End If</p><p> End If</p><p> Dim DBChannel As Channel = _layer.AddNewChannel(SDT.ChannelName, channelNumber)</p><p> Dim NIT As NITSatDescriptor = NITInfo(ScannedChannel.TID)</p><p> DVBSChannel.BandType = 0</p><p> DVBSChannel.DisEqc = DirectCast(DiseqC, DisEqcType)</p><p> DVBSChannel.FreeToAir = True</p><p> DVBSChannel.Frequency = NIT.Frequency</p><p> DVBSChannel.SymbolRate = NIT.Symbolrate</p><p> DVBSChannel.InnerFecRate = DirectCast(NIT.FECInner, DirectShowLib.BDA.BinaryConvolutionCodeRate)</p><p> DVBSChannel.IsRadio = SDT.isRadio</p><p> DVBSChannel.IsTv = SDT.isTV</p><p> DVBSChannel.FreeToAir = Not SDT.isFTA</p><p> DBChannel.ChannelNumber = channelNumber</p><p> DBChannel.SortOrder = channelNumber</p><p> DBChannel.VisibleInGuide = VisibleInGuide</p><p> If (NIT.isS2 And UseModNotSetHD) Or (NIT.isS2 = False And UseModNotSetSD) Then</p><p> DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotSet</p><p> Else</p><p> Select Case NIT.Modulation</p><p> Case 1</p><p> If NIT.isS2 Then</p><p> DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNbcQpsk</p><p> Else</p><p> DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModQpsk</p><p> End If</p><p> Case 2</p><p> If NIT.isS2 Then</p><p> DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNbc8Psk</p><p> Else</p><p> DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotDefined</p><p> End If</p><p> Case Else</p><p> DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotDefined</p><p> End Select</p><p> End If</p><p> DVBSChannel.Name = SDT.ChannelName</p><p> DVBSChannel.NetworkId = ScannedChannel.NID</p><p> DVBSChannel.Pilot = -1</p><p> DVBSChannel.Rolloff = -1</p><p> If NIT.isS2 = 1 Then</p><p> DVBSChannel.Rolloff = CType(NIT.RollOff, DirectShowLib.BDA.RollOff)</p><p> End If</p><p> DVBSChannel.PmtPid = 0</p><p> DVBSChannel.Polarisation = CType(NIT.Polarisation, DirectShowLib.BDA.Polarisation)</p><p> DVBSChannel.Provider = SDT.Provider</p><p> DVBSChannel.ServiceId = ScannedChannel.SID</p><p> DVBSChannel.TransportId = ScannedChannel.TID</p><p> DVBSChannel.SwitchingFrequency = SwitchingFrequency ' Option for user to enter</p><p> DBChannel.IsRadio = SDT.isRadio</p><p> DBChannel.IsTv = SDT.isTV</p><p> DBChannel.ExternalId = ScannedChannel.NID & ":" & ScannedChannel.ChannelID.ToString</p><p> DBChannel.Persist()</p><p> MapChannelToCards(DBChannel)</p><p> AddChannelToGroups(DBChannel, SDT, DVBSChannel, UseSkyCategories)</p><p> _layer.AddTuningDetails(DBChannel, DVBSChannel)</p><p> DBChannel = currentDetail.ReferencedChannel()</p><p> If DBChannel.ExternalId <> ScannedChannel.NID & ":" & ChannelId.ToString Then</p><p> 'Problem with TVServer so need to add new channel.</p><p> GoTo AddNewChannel</p><p> End If</p><p> Dim checkDVBSChannel As DVBSChannel = _layer.GetTuningChannel(currentDetail)</p><p> If checkDVBSChannel Is Nothing Then</p><p> Continue For</p><p> End If</p><p> If DBChannel Is Nothing Then</p><p> Continue For</p><p> End If</p><p> Dim Checksdt As SDTInfo</p><p> If SDTInfo.ContainsKey(ScannedChannel.NID & "-" & ScannedChannel.TID & "-" & ScannedChannel.SID) Then</p><p> Dim haschanged As Boolean = False</p><p> Dim deleteepg As Boolean = False</p><p> Checksdt = SDTInfo(ScannedChannel.NID & "-" & ScannedChannel.TID & "-" & ScannedChannel.SID)</p><p> If DBChannel.DisplayName <> Checksdt.ChannelName Or currentDetail.Name <> Checksdt.ChannelName Then</p><p> RaiseEvent OnMessage("Channel " & DBChannel.DisplayName & " name changed to " & Checksdt.ChannelName, False)</p><p> DBChannel.DisplayName = Checksdt.ChannelName</p><p> checkDVBSChannel.Name = Checksdt.ChannelName</p><p> 'Check Channel hasn't become a real channel from a test channel</p><p> If ScannedChannel.LCNCount > 0 And DBChannel.VisibleInGuide = False Then</p><p> DBChannel.VisibleInGuide = True</p><p> RaiseEvent OnMessage("Channel " & DBChannel.DisplayName & " is now part of the EPG making visible " & Checksdt.ChannelName & ".", False)</p><p> End If</p><p> haschanged = True</p><p> End If</p><p> If checkDVBSChannel.Provider <> Checksdt.Provider Then</p><p> RaiseEvent OnMessage("Channel " & DBChannel.DisplayName & " Provider name changed to " & Checksdt.Provider & ".", False)</p><p> RaiseEvent OnMessage("", False)</p><p> checkDVBSChannel.Provider = Checksdt.Provider</p><p> haschanged = True</p><p> End If</p><p> If currentDetail.TransportId <> ScannedChannel.TID Then</p><p> 'Moved transponder</p><p> RaiseEvent OnMessage("Channel : " & DBChannel.DisplayName & " tuning details changed.", False)</p><p> RaiseEvent OnMessage("", False)</p><p> If NITInfo.ContainsKey(ScannedChannel.TID) Then</p><p> NIT = NITInfo(ScannedChannel.TID)</p><p> Else</p><p> Continue For</p><p> End If</p><p> checkDVBSChannel.BandType = 0</p><p> checkDVBSChannel.Frequency = NIT.Frequency</p><p> checkDVBSChannel.SymbolRate = NIT.Symbolrate</p><p> checkDVBSChannel.InnerFecRate = CType(NIT.FECInner, DirectShowLib.BDA.BinaryConvolutionCodeRate)</p><p> If (NIT.isS2 And UseModNotSetHD) Or (NIT.isS2 = False And UseModNotSetSD) Then</p><p> checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotSet</p><p> Else</p><p> Select Case NIT.Modulation</p><p> Case 1</p><p> If NIT.isS2 Then</p><p> checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNbcQpsk</p><p> Else</p><p> checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModQpsk</p><p> End If</p><p> Case 2</p><p> If NIT.isS2 Then</p><p> checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNbc8Psk</p><p> Else</p><p> checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotDefined</p><p> End If</p><p> Case Else</p><p> checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotDefined</p><p> End Select</p><p> End If</p><p> checkDVBSChannel.Pilot = -1</p><p> checkDVBSChannel.Rolloff = -1</p><p> If NIT.isS2 = 1 Then</p><p> checkDVBSChannel.Rolloff = CType(NIT.RollOff, DirectShowLib.BDA.RollOff)</p><p> End If</p><p> checkDVBSChannel.PmtPid = 0</p><p> checkDVBSChannel.Polarisation = CType(NIT.Polarisation, DirectShowLib.BDA.Polarisation)</p><p> checkDVBSChannel.TransportId = ScannedChannel.TID</p><p> checkDVBSChannel.SwitchingFrequency = SwitchingFrequency ' Option for user to enter</p><p> haschanged = True</p><p> deleteepg = True</p><p> RaiseEvent OnMessage("Channel : " & DBChannel.DisplayName & " tuning details changed.", False)</p><p> RaiseEvent OnMessage("", False)</p><p> End If</p><p> If currentDetail.ServiceId <> ScannedChannel.SID Then</p><p> checkDVBSChannel.ServiceId = ScannedChannel.SID</p><p> checkDVBSChannel.PmtPid = 0</p><p> RaiseEvent OnMessage("Channel : " & DBChannel.DisplayName & " serviceID changed.", False)</p><p> RaiseEvent OnMessage("", False)</p><p> haschanged = True</p><p> deleteepg = True</p><p> End If</p><p> If UseSkyRegions = True Then</p><p> Dim checkLCN As Integer = 10000</p><p> If UseSkyNumbers Then</p><p> If ScannedChannel.LCNCount > 0 Then</p><p> If ScannedChannel.ContainsLCN(BouquetIDtoUse, RegionIDtoUse) Then</p><p> Dim LCN As LCNHolder = ScannedChannel.GetLCN(BouquetIDtoUse, RegionIDtoUse)</p><p> checkLCN = LCN.SkyNum</p><p> Else</p><p> If ScannedChannel.ContainsLCN(BouquetIDtoUse, 255) Then</p><p> Dim LCN As LCNHolder = ScannedChannel.GetLCN(BouquetIDtoUse, 255)</p><p> checkLCN = LCN.SkyNum</p><p> End If</p><p> End If</p><p> If (currentDetail.ChannelNumber <> checkLCN And checkLCN < 1000) Or (checkLCN = 10000 And DBChannel.SortOrder <> 10000) Then</p><p> RaiseEvent OnMessage("Channel : " & DBChannel.DisplayName & " number has changed from : " & checkDVBSChannel.LogicalChannelNumber & " to : " & checkLCN & ".", False)</p><p> RaiseEvent OnMessage("", False)</p><p> DBChannel.RemoveFromAllGroups()</p><p> currentDetail.ChannelNumber = checkLCN</p><p> checkDVBSChannel.LogicalChannelNumber = checkLCN</p><p> DBChannel.SortOrder = checkLCN</p><p> DBChannel.VisibleInGuide = True</p><p> haschanged = True</p><p> AddChannelToGroups(DBChannel, Checksdt, checkDVBSChannel, UseSkyCategories)</p><p> End If</p><p> End If</p><p> End If</p><p> End If</p><p> If haschanged Then</p><p> DBChannel.Persist()</p><p> Dim tuning As TuningDetail = _layer.UpdateTuningDetails(DBChannel, checkDVBSChannel, currentDetail)</p><p> If tuning Is Not Nothing Then</p><p> tuning.Persist()</p><p> MapChannelToCards(DBChannel)</p><p> If deleteepg Then</p><p> _layer.RemoveAllPrograms(DBChannel.IdChannel)</p><p> End If</p><p> End If</p><p> End If</p><p> End If</p><p> Next</p><p> Catch err As Exception</p><p> MsgBox(err.Message)</p><p> End Try</p><p> End Sub</p><p></p><p>[/code]</p></blockquote><p></p>
[QUOTE="DJBlu, post: 1079655, member: 54957"] [USER=121281]@Benoire[/USER] Try this, replace the AddRemoveChannels sub with the following [code] Public Sub UpdateAddChannels() Try Dim DiseqC As Integer = Settings.DiseqC Dim UseSkyNumbers As Boolean = Settings.UseSkyNumbers Dim SwitchingFrequency As Integer = Settings.SwitchingFrequency Dim UseSkyRegions As Boolean = Settings.UseSkyRegions Dim UseSkyCategories As Boolean = Settings.UseSkyCategories Dim ChannelsAdded As Integer = 0 Dim UseModNotSetSD As Boolean = Settings.UseNotSetModSD Dim UseModNotSetHD As Boolean = Settings.UseNotSetModHD Dim IgnoreScrambled As Boolean = Settings.IgnoreScrambled Dim NID As Integer = Settings.NID Dim channel As New DVBSChannel Dim currentDetail As TuningDetail If (Not OnMessageEvent Is Nothing) Then RaiseEvent OnMessage("", False) End If For Each pair As KeyValuePair(Of Integer, Sky_Channel) In Channels '//Dim detail As TuningDetail - Needs rest of Sky filtering work. ChannelsAdded += 1 RaiseEvent OnMessage("(" & ChannelsAdded & "/" & Channels.Count & ") Channels sorted", True) Dim ChannelId As Integer = pair.Key Dim ScannedChannel As Sky_Channel = pair.Value If ChannelId < 1 Then Continue For If ScannedChannel.NID = 0 Or ScannedChannel.TID = 0 Or ScannedChannel.SID = 0 Then Continue For End If Dim SDT As SDTInfo = GetChannelbySID(ScannedChannel.NID & "-" & ScannedChannel.TID & "-" & ScannedChannel.SID) If SDT Is Nothing Then Continue For End If If SDT Is Nothing Then Continue For End If If IgnoreScrambled And SDT.isFTA Then Continue For End If Dim checker As Channel = _layer.GetChannelbyExternalID(ScannedChannel.NID & ":" & ScannedChannel.ChannelID.ToString) currentDetail = Nothing If Not checker Is Nothing Then Dim Channels As List(Of TuningDetail) = checker.ReferringTuningDetail If Channels Is Not Nothing Then For Each Chann As TuningDetail In Channels If Chann.ChannelType = 3 And Chann.NetworkId = 169 Then currentDetail = Chann Exit For End If Next End If End If 'Add New Channel If currentDetail Is Nothing Then GoTo AddNewChannel End If AddNewChannel: If Not NITInfo.ContainsKey(ScannedChannel.TID) Then 'no nit info RaiseEvent OnMessage("No NIT found for : " & ScannedChannel.SID, False) RaiseEvent OnMessage("", False) Continue For End If ''//this stuff appears missing: Dim channelNumber As Integer = 10000 Dim VisibleInGuide As Boolean = True If (UseSkyNumbers And (ScannedChannel.LCNCount > 0)) Then If ScannedChannel.ContainsLCN(Me.BouquetIDtoUse, Me.RegionIDtoUse) Then channelNumber = ScannedChannel.GetLCN(Me.BouquetIDtoUse, Me.RegionIDtoUse).SkyNum If ScannedChannel.ContainsLCN(Me.BouquetIDtoUse, 255) Then channelNumber = ScannedChannel.GetLCN(Me.BouquetIDtoUse, 255).SkyNum End If End If If (channelNumber = 10000) Then VisibleInGuide = False End If End If Dim DBChannel As Channel = _layer.AddNewChannel(SDT.ChannelName, channelNumber) Dim NIT As NITSatDescriptor = NITInfo(ScannedChannel.TID) DVBSChannel.BandType = 0 DVBSChannel.DisEqc = DirectCast(DiseqC, DisEqcType) DVBSChannel.FreeToAir = True DVBSChannel.Frequency = NIT.Frequency DVBSChannel.SymbolRate = NIT.Symbolrate DVBSChannel.InnerFecRate = DirectCast(NIT.FECInner, DirectShowLib.BDA.BinaryConvolutionCodeRate) DVBSChannel.IsRadio = SDT.isRadio DVBSChannel.IsTv = SDT.isTV DVBSChannel.FreeToAir = Not SDT.isFTA DBChannel.ChannelNumber = channelNumber DBChannel.SortOrder = channelNumber DBChannel.VisibleInGuide = VisibleInGuide If (NIT.isS2 And UseModNotSetHD) Or (NIT.isS2 = False And UseModNotSetSD) Then DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotSet Else Select Case NIT.Modulation Case 1 If NIT.isS2 Then DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNbcQpsk Else DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModQpsk End If Case 2 If NIT.isS2 Then DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNbc8Psk Else DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotDefined End If Case Else DVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotDefined End Select End If DVBSChannel.Name = SDT.ChannelName DVBSChannel.NetworkId = ScannedChannel.NID DVBSChannel.Pilot = -1 DVBSChannel.Rolloff = -1 If NIT.isS2 = 1 Then DVBSChannel.Rolloff = CType(NIT.RollOff, DirectShowLib.BDA.RollOff) End If DVBSChannel.PmtPid = 0 DVBSChannel.Polarisation = CType(NIT.Polarisation, DirectShowLib.BDA.Polarisation) DVBSChannel.Provider = SDT.Provider DVBSChannel.ServiceId = ScannedChannel.SID DVBSChannel.TransportId = ScannedChannel.TID DVBSChannel.SwitchingFrequency = SwitchingFrequency ' Option for user to enter DBChannel.IsRadio = SDT.isRadio DBChannel.IsTv = SDT.isTV DBChannel.ExternalId = ScannedChannel.NID & ":" & ScannedChannel.ChannelID.ToString DBChannel.Persist() MapChannelToCards(DBChannel) AddChannelToGroups(DBChannel, SDT, DVBSChannel, UseSkyCategories) _layer.AddTuningDetails(DBChannel, DVBSChannel) DBChannel = currentDetail.ReferencedChannel() If DBChannel.ExternalId <> ScannedChannel.NID & ":" & ChannelId.ToString Then 'Problem with TVServer so need to add new channel. GoTo AddNewChannel End If Dim checkDVBSChannel As DVBSChannel = _layer.GetTuningChannel(currentDetail) If checkDVBSChannel Is Nothing Then Continue For End If If DBChannel Is Nothing Then Continue For End If Dim Checksdt As SDTInfo If SDTInfo.ContainsKey(ScannedChannel.NID & "-" & ScannedChannel.TID & "-" & ScannedChannel.SID) Then Dim haschanged As Boolean = False Dim deleteepg As Boolean = False Checksdt = SDTInfo(ScannedChannel.NID & "-" & ScannedChannel.TID & "-" & ScannedChannel.SID) If DBChannel.DisplayName <> Checksdt.ChannelName Or currentDetail.Name <> Checksdt.ChannelName Then RaiseEvent OnMessage("Channel " & DBChannel.DisplayName & " name changed to " & Checksdt.ChannelName, False) DBChannel.DisplayName = Checksdt.ChannelName checkDVBSChannel.Name = Checksdt.ChannelName 'Check Channel hasn't become a real channel from a test channel If ScannedChannel.LCNCount > 0 And DBChannel.VisibleInGuide = False Then DBChannel.VisibleInGuide = True RaiseEvent OnMessage("Channel " & DBChannel.DisplayName & " is now part of the EPG making visible " & Checksdt.ChannelName & ".", False) End If haschanged = True End If If checkDVBSChannel.Provider <> Checksdt.Provider Then RaiseEvent OnMessage("Channel " & DBChannel.DisplayName & " Provider name changed to " & Checksdt.Provider & ".", False) RaiseEvent OnMessage("", False) checkDVBSChannel.Provider = Checksdt.Provider haschanged = True End If If currentDetail.TransportId <> ScannedChannel.TID Then 'Moved transponder RaiseEvent OnMessage("Channel : " & DBChannel.DisplayName & " tuning details changed.", False) RaiseEvent OnMessage("", False) If NITInfo.ContainsKey(ScannedChannel.TID) Then NIT = NITInfo(ScannedChannel.TID) Else Continue For End If checkDVBSChannel.BandType = 0 checkDVBSChannel.Frequency = NIT.Frequency checkDVBSChannel.SymbolRate = NIT.Symbolrate checkDVBSChannel.InnerFecRate = CType(NIT.FECInner, DirectShowLib.BDA.BinaryConvolutionCodeRate) If (NIT.isS2 And UseModNotSetHD) Or (NIT.isS2 = False And UseModNotSetSD) Then checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotSet Else Select Case NIT.Modulation Case 1 If NIT.isS2 Then checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNbcQpsk Else checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModQpsk End If Case 2 If NIT.isS2 Then checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNbc8Psk Else checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotDefined End If Case Else checkDVBSChannel.ModulationType = DirectShowLib.BDA.ModulationType.ModNotDefined End Select End If checkDVBSChannel.Pilot = -1 checkDVBSChannel.Rolloff = -1 If NIT.isS2 = 1 Then checkDVBSChannel.Rolloff = CType(NIT.RollOff, DirectShowLib.BDA.RollOff) End If checkDVBSChannel.PmtPid = 0 checkDVBSChannel.Polarisation = CType(NIT.Polarisation, DirectShowLib.BDA.Polarisation) checkDVBSChannel.TransportId = ScannedChannel.TID checkDVBSChannel.SwitchingFrequency = SwitchingFrequency ' Option for user to enter haschanged = True deleteepg = True RaiseEvent OnMessage("Channel : " & DBChannel.DisplayName & " tuning details changed.", False) RaiseEvent OnMessage("", False) End If If currentDetail.ServiceId <> ScannedChannel.SID Then checkDVBSChannel.ServiceId = ScannedChannel.SID checkDVBSChannel.PmtPid = 0 RaiseEvent OnMessage("Channel : " & DBChannel.DisplayName & " serviceID changed.", False) RaiseEvent OnMessage("", False) haschanged = True deleteepg = True End If If UseSkyRegions = True Then Dim checkLCN As Integer = 10000 If UseSkyNumbers Then If ScannedChannel.LCNCount > 0 Then If ScannedChannel.ContainsLCN(BouquetIDtoUse, RegionIDtoUse) Then Dim LCN As LCNHolder = ScannedChannel.GetLCN(BouquetIDtoUse, RegionIDtoUse) checkLCN = LCN.SkyNum Else If ScannedChannel.ContainsLCN(BouquetIDtoUse, 255) Then Dim LCN As LCNHolder = ScannedChannel.GetLCN(BouquetIDtoUse, 255) checkLCN = LCN.SkyNum End If End If If (currentDetail.ChannelNumber <> checkLCN And checkLCN < 1000) Or (checkLCN = 10000 And DBChannel.SortOrder <> 10000) Then RaiseEvent OnMessage("Channel : " & DBChannel.DisplayName & " number has changed from : " & checkDVBSChannel.LogicalChannelNumber & " to : " & checkLCN & ".", False) RaiseEvent OnMessage("", False) DBChannel.RemoveFromAllGroups() currentDetail.ChannelNumber = checkLCN checkDVBSChannel.LogicalChannelNumber = checkLCN DBChannel.SortOrder = checkLCN DBChannel.VisibleInGuide = True haschanged = True AddChannelToGroups(DBChannel, Checksdt, checkDVBSChannel, UseSkyCategories) End If End If End If End If If haschanged Then DBChannel.Persist() Dim tuning As TuningDetail = _layer.UpdateTuningDetails(DBChannel, checkDVBSChannel, currentDetail) If tuning Is Not Nothing Then tuning.Persist() MapChannelToCards(DBChannel) If deleteepg Then _layer.RemoveAllPrograms(DBChannel.IdChannel) End If End If End If End If Next Catch err As Exception MsgBox(err.Message) End Try End Sub [/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Custom Data Grabber including Sky UK Channel/EPG Grabber
Contact us
RSS
Top
Bottom