| |||||||
| 0.2.0.0 Final and SVN Builds Post bugs you have found in 0.2.0.0 final or any SVN-Snapshot here. |
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Portal Member Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
| MediaPortal Version: 0.2.0.4 and greater There is a bug in the MP source code in the TVguide section that it is impossible to change channels by channel number even if the "select channel by index" is unchecked because this value is never used in the TV Guide source code! See the code for GUITvGuideBase.cs. The function ChangeChannelNr does not check the value of _byIndex because it is not even referenced in that class. Here is an updated version of the function ChangeChannelNr which should work and also include support for externalchannels which is so desperately needed: Code: void ChangeChannelNr(int iChannelNr)
{
if (_byIndex) // Check if channel changing should be byIndex
{
// Channel change by index
iChannelNr--;
}
else
{
// Change channel by using actual channel number
int iCounter = 0;
bool found = false;
TVChannel chan;
// Loop through complete channel list until match is found
while (iCounter < _channelList.Count && found == false)
{
chan = (TVChannel)_channelList[iCounter];
// Check if channel is an external channel
if (chan.External == false)
{
//Not External Channel
if (chan.Number == iChannelNr)
{
iChannelNr = iCounter;
found = true;
}
}
else
{
//External channel
if (Int32.Parse(chan.ExternalTunerChannel) == iChannelNr)
{
iChannelNr = iCounter;
found = true;
}
}
iCounter++; // Increment loop counter
}
}
if (iChannelNr >= 0 && iChannelNr < _channelList.Count)
{
UnFocus();
_channelOffset = 0;
_cursorX = 0;
// Last page adjust (To get a full page channel listing)
if (iChannelNr > _channelList.Count - _channelCount + 1)
{
_channelOffset = _channelList.Count - _channelCount;
iChannelNr = iChannelNr - _channelOffset;
}
while (iChannelNr >= _channelCount)
{
iChannelNr -= _channelCount;
_channelOffset += _channelCount;
}
_cursorX = iChannelNr;
Update(false);
SetFocus();
}
}
Code: #region variables ...snip bool _byIndex = false; ...snip #endregion Code: void LoadSettings()
{
using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.Get(Config.Dir.Config) + "MediaPortal.xml"))
{
_currentTvChannel = xmlreader.GetValueAsString("tvguide", "channel", String.Empty);
_cursorX = xmlreader.GetValueAsInt("tvguide", "ypos", 0);
_channelOffset = xmlreader.GetValueAsInt("tvguide", "yoffset", 0);
_autoTurnOnTv = xmlreader.GetValueAsBool("mytv", "autoturnontv", false);
_disableXMLTVImportOption = xmlreader.GetValueAsBool("plugins", "TV Movie Clickfinder", false);
_byIndex = xmlreader.GetValueAsBool("mytv", "byindex", true);
}
}
Now, we have the problem of external channels not supported in the LiveTV. Here is the relevant code that fixes that problem as well. In the GUITVHome.cs file, the function ZapToChannelNumber should be Code: public void ZapToChannelNumber( int channelNr, bool useZapDelay )
{
List<TVChannel> channels = CurrentGroup.TvChannels;
if ( channelNr >= 0 )
{
bool found = false;
int ChannelCnt = 0;
TVChannel chan;
while ( found == false && ChannelCnt < channels.Count )
{
chan = (TVChannel)channels[ChannelCnt];
if (chan.External == false)
{
if (chan.Number == channelNr)
{
ZapToChannel(chan.Name, useZapDelay);
found = true;
}
}
else
{
if (Int32.Parse(chan.ExternalTunerChannel) == channelNr)
{
ZapToChannel(chan.Name, useZapDelay);
found = true;
}
}
ChannelCnt++;
}
}
}
There is also another problem. I have satellite TV in the US. The majority of the channels have three digits, but it is hardcoded in the OnKeyCode function in the GUITvGuideBase.cs file to only accept 2 digits. Can this be made a variable and put in the TV configuration section? I will post separately if necessary. Developers, please look at this code and let me and everyone else know what you think. I believe this should fix all of the problems that us U.S. users are having with changing channel by actual channel numbers and also support external channels for a STB. Jesse |
| | |
| | #2 (permalink) |
| Portal Member Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
| For those that are interested in testing this change, I compiled the code. You need to be running a recent SVN. Please backup your file before overwriting. Note that in this file I hardcoded the channel number input to 3 digits and increased the delay time for us satellite users. The delay probably needs to be a bit longer even still. Jesse Last edited by Hesse; 2006-09-23 at 01:38. |
| | |
| | #5 (permalink) |
| Retired Team Member Join Date: Jan 2005 Location: Berlin Age: 34
Posts: 2,086
Thanks: 0
Thanked 3 Times in 3 Posts
Country: | Thanks for the code, it's in SVN and will be tested by our test team.
__________________ Bad news from the stars... We cannot give any support without a properly filled support template and a full mediaportal.log pasted here. Before you ask... |
| | |
| | #6 (permalink) |
| Portal Member Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
| @jawbroken No, I didn't do that. It sounds like mPod has added it for me. Thanks for that mPod. For future reference, since I'm a newbie at this, how would I do that? Is there information in the wiki on that? |
| | |
| | #8 (permalink) |
| Retired Team Member Join Date: Aug 2006 Location: Bay Area, CA
Posts: 324
Thanks: 0
Thanked 0 Times in 0 Posts
Country: | I see that the SVN changelog indicates: MediaPortal MyTV 23/09/2006 [11:27h] mPod added: "Select channel by index" did not work in TVGuide and everywhere for External Channels (thanks to Hesse) Does this indicate that this passed the test teams tests? I'm running mediaportal-svn--09-24-2006--02-04-rev10448.exe and I will be trying this out tonight. It has been a troublesome to change channels on my external STB (DirecTV). Have others tried the newer SVN's and confirmed that this fix works? Thanks Hesse and mPod! |
| | |
| | #9 (permalink) | |
| Portal Member Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
| Quote:
| |
| | |
| | #10 (permalink) |
| Portal Member Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
| I just noticed a small flaw in the code that I submitted. When changing channels in the TV guide, if you enter a channel number that doesn't exist, then it will drop through the for loop since it won't match a channel and then simply change channel by index which was the previous behaviour. I think what we'd ideally want is that if a channel isn't found, it would go to the nearest match. So if the channels that exist are 495 501 502 503 504 and we entered 500, it would change to 501 to get us to the right section of the guide. I think this is how DirectTV works by default. I'll have to look over that section of code again to see the best way to implement that. For now it will work fine if you enter the exact channel number. |
| | |
![]() |
| Bookmarks |
| Tags |
| external, nonfunction, select channel by index, tvguide |
| Thread Tools | |
| Display Modes | |
| |