North American satellite users (and perhaps others) are used to having channel numbers that are based on serviceID. Currently, when you type in a number in the guide it goes to the offset in the guide. Also, there is a hardcoded limit of two digits. As far as I can tell this was partially corrected in the standalone MP but never made it to the TV plugin.
Here is code that allows for channel numbers of 3 digits in length and changes based on channelNumber. I haven't looked at the code for fullscreen and miniepg yet so this is only for finding channels in the guide.
TvGuideBase.cs
I propose that instead of serviceID we use channelNumber as this should be a more universal system because I believe analog input devices, etc already populate this field. With this setup we'd need to have the channelNumber field in the database populated with serviceID when a scan is done. I think this would only be for North American users so we may need a checkbox next to the scan button. Users can use the following query in the meantime to manually copy SID to channelNumber:
Here is code that allows for channel numbers of 3 digits in length and changes based on channelNumber. I haven't looked at the code for fullscreen and miniepg yet so this is only for finding channels in the guide.
TvGuideBase.cs
Code:
void OnKeyCode(char chKey)
{
if (chKey >= '0' && chKey <= '9') //Make sure it's only for the remote
{
TimeSpan ts = DateTime.Now - _keyPressedTimer;
if (_lineInput.Length >= 3 || ts.TotalMilliseconds >= 800)
{
_lineInput = String.Empty;
}
_keyPressedTimer = DateTime.Now;
if (chKey == '0' && _lineInput.Length == 0)
return;
_lineInput += chKey;
if (_lineInput.Length == 3)
{
// change channel
int iChannel = Int32.Parse(_lineInput);
ChangeChannelNr(iChannel);
}
}
}
void ChangeChannelNr(int iChannelNr)
{
// iChannelNr--;
int iCounter = 0;
bool found = false;
Channel chan;
while (iCounter < _channelList.Count && found == false)
{
chan = (Channel)_channelList[iCounter];
foreach (TuningDetail detail in chan.ReferringTuningDetail())
{
if (detail.channelNumber == iChannelNr)
{
iChannelNr = iCounter;
found = true;
}
}
iCounter++;
}
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();
}
}
I propose that instead of serviceID we use channelNumber as this should be a more universal system because I believe analog input devices, etc already populate this field. With this setup we'd need to have the channelNumber field in the database populated with serviceID when a scan is done. I think this would only be for North American users so we may need a checkbox next to the scan button. Users can use the following query in the meantime to manually copy SID to channelNumber:
Code:
UPDATE dbo.TuningDetail SET channelNumber = serviceId;