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
MediaPortal 1 Talk
programatic way to change channels on MP 1.15 client?
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="mm1352000" data-source="post: 1203977" data-attributes="member: 82144"><p>I think I see the problem.</p><p></p><p>Does your code still do this:</p><p><a href="https://forum.team-mediaportal.com/threads/programatic-way-to-change-channels-on-mp-1-15-client.135299/#post-1202786" target="_blank">https://forum.team-mediaportal.com/threads/programatic-way-to-change-channels-on-mp-1-15-client.135299/#post-1202786</a></p><p>[code] Dim selectChannel As TvDatabase.Channel = myitem.Tag</p><p> Dim tuningDetail As TvDatabase.TuningDetail = selectChannel.ReferringTuningDetail(0)</p><p> Dim myChannel As TvLibrary.Channels.ATSCChannel = New TvLibrary.Channels.ATSCChannel()</p><p> myChannel.FreeToAir = tuningDetail.FreeToAir</p><p> myChannel.Frequency = tuningDetail.Frequency</p><p> myChannel.IsRadio = tuningDetail.IsRadio</p><p> myChannel.IsTv = tuningDetail.IsTv</p><p> myChannel.MajorChannel = tuningDetail.MajorChannel</p><p> myChannel.MinorChannel = tuningDetail.MinorChannel</p><p> myChannel.Name = tuningDetail.Name</p><p> myChannel.NetworkId = tuningDetail.NetworkId</p><p> myChannel.PmtPid = tuningDetail.PmtPid</p><p> myChannel.Provider = tuningDetail.Provider</p><p> myChannel.ServiceId = tuningDetail.ServiceId</p><p> myChannel.TransportId = tuningDetail.TransportId[/code]</p><p></p><p>If yes, that's where the problem is. You're not setting the [crucial!] PhysicalChannel and ModulationType properties on the myChannel object. In general such an approach is going to be very error prone, and therefore I wouldn't recommend it. Instead I'd recommend you use the provided functions such as <a href="https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TVDatabase/TvBusinessLayer/BusinessLayer.cs#L620" target="_blank">TvBusinessLayer.GetTuningChannel()</a> to do conversions. Strictly speaking even that is not ideal because Channels can be associated with zero or more TuningDetails. Your code, specifically:</p><p>[code]Dim tuningDetail As TvDatabase.TuningDetail = selectChannel.ReferringTuningDetail(0)[/code]</p><p></p><p>...either assumes there will be exactly one tuning detail, or that the first tuning detail is always correct. That may be fine for your purposes (which is why I said "strictly speaking"), but it won't necessarily translate well for other people. Something to keep in mind if you were ever to decide to make your plugin available to the general public.</p><p></p><p>P.S. I see you failed to tune 3ABN as well. Reason is the same as for Chiller: it's an SDV channel, and Charter's map is out-of-date. If you want to you can make it work in the same way that you did for Chiller.</p></blockquote><p></p>
[QUOTE="mm1352000, post: 1203977, member: 82144"] I think I see the problem. Does your code still do this: [URL]https://forum.team-mediaportal.com/threads/programatic-way-to-change-channels-on-mp-1-15-client.135299/#post-1202786[/URL] [code] Dim selectChannel As TvDatabase.Channel = myitem.Tag Dim tuningDetail As TvDatabase.TuningDetail = selectChannel.ReferringTuningDetail(0) Dim myChannel As TvLibrary.Channels.ATSCChannel = New TvLibrary.Channels.ATSCChannel() myChannel.FreeToAir = tuningDetail.FreeToAir myChannel.Frequency = tuningDetail.Frequency myChannel.IsRadio = tuningDetail.IsRadio myChannel.IsTv = tuningDetail.IsTv myChannel.MajorChannel = tuningDetail.MajorChannel myChannel.MinorChannel = tuningDetail.MinorChannel myChannel.Name = tuningDetail.Name myChannel.NetworkId = tuningDetail.NetworkId myChannel.PmtPid = tuningDetail.PmtPid myChannel.Provider = tuningDetail.Provider myChannel.ServiceId = tuningDetail.ServiceId myChannel.TransportId = tuningDetail.TransportId[/code] If yes, that's where the problem is. You're not setting the [crucial!] PhysicalChannel and ModulationType properties on the myChannel object. In general such an approach is going to be very error prone, and therefore I wouldn't recommend it. Instead I'd recommend you use the provided functions such as [URL='https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TVDatabase/TvBusinessLayer/BusinessLayer.cs#L620']TvBusinessLayer.GetTuningChannel()[/URL] to do conversions. Strictly speaking even that is not ideal because Channels can be associated with zero or more TuningDetails. Your code, specifically: [code]Dim tuningDetail As TvDatabase.TuningDetail = selectChannel.ReferringTuningDetail(0)[/code] ...either assumes there will be exactly one tuning detail, or that the first tuning detail is always correct. That may be fine for your purposes (which is why I said "strictly speaking"), but it won't necessarily translate well for other people. Something to keep in mind if you were ever to decide to make your plugin available to the general public. P.S. I see you failed to tune 3ABN as well. Reason is the same as for Chiller: it's an SDV channel, and Charter's map is out-of-date. If you want to you can make it work in the same way that you did for Chiller. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Talk
programatic way to change channels on MP 1.15 client?
Contact us
RSS
Top
Bottom