| |||||||
| Development You want to code something for the TV-Server? Share it in here! |
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Portal Member | 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 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; |
| | |
| This User Say Thank You: |
| |
| | #2 (permalink) |
| Portal Member Join Date: Mar 2007 Location: Denver, Colorado
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Country: | I want to thank W_Z for working on this code - it is awesome to finally see this fix! I think rather then having a max digit input that we extend and/or make configurable the timeout value. This would allow for fine tuning for remote. I beleive this code is what is causing my 0 issue. <code>_lineInput = String.Empty; } _keyPressedTimer = DateTime.Now; if (chKey == '0' && _lineInput.Length == 0) return; </code>
__________________ IcePick |
| | |
| | #3 (permalink) |
| Portal Member | I have improved my code a bit. Here’s my list of updates in this. It should have no effect on non-NA users whatsoever now. - the indexed channel number option in MP setup should function correctly now - it is either by channel number or index. - if you enter a channel number and it doesn’t exist it will go to the nearest number. - the first “time” label at the top of the guide has been used to show the channel numbers as you enter them. When you finish or let it time out (800ms) it goes back to how it was. - options for ‘show channel number in guide’ and ‘channel number max. length’ have been added in MP setup. To do: -make channel entry work in fullscreen and miniepg -add an option to sort by channel name in TVE3. I think adding a ‘Channel Number’ column header that you could click on to sort would be perfect. -add a checkbox/option to set channelNumber field to SID when scanning dvb. Hopefully this will get tested and added to SVN soon. Thanks for the feedback so far. Code is attached as I know some of you are interested. |
| | |
| | #4 (permalink) |
| Portal Member Join Date: Jun 2007 Location: Near London, Ontario, Canada Age: 1
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Country: | Thanks W_Z Any chance of getting a pre-compiled version? No coding ability here ;0)
__________________ "I'm going on a bender to end all benders" - Krusty |
| | |
| | #8 (permalink) |
| Portal Member | Please see: http://sourceforge.net/tracker/index...97&atid=647927 NOTE: Users will need to manually copy serviceID to channelNumber in the database until scanning can populate the channelNumber field. Use: Code: UPDATE dbo.TuningDetail SET channelNumber = serviceId; |
| | |
| | #9 (permalink) | |
| Portal Member | Quote:
For those that are not familiar with the MS SQL Server Management Studio Express utility, open it up and log in using the username/password that you provided when setting up the TV Server. Drill down until you find the TvLibrary under the Databases section on the left of the screen. Right click on TvLibrary and choose Tasks > Back Up > backup your database before doing the next steps (Just in case). Now, Click on New Query, paste the following into the query editor: UPDATE dbo.TuningDetail SET channelNumber = serviceId WHERE networkId = 4100 UPDATE dbo.TuningDetail SET channelNumber = serviceId WHERE networkId = 4102 UPDATE dbo.TuningDetail SET channelNumber = 1000 + serviceId WHERE networkId = 256 UPDATE dbo.TuningDetail SET channelNumber = 1000 + serviceId WHERE networkId = 257 After you have this in the query editor, click on the Execute button. This query will only work with Dish/Bev setups... you will need to modify it to work with other sats. | |
| | |
| This User Say Thank You: |
![]() |
| Bookmarks |
| Tags |
| change, channel, channelnumber, code, sid |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Use SID as channel number when scanning your Sats. | ASiDiE | Improvement Suggestions | 8 | 2008-01-30 01:00 |
| Changing channel by Sid not channelid | Nox71 | pre 1.0 RC1 | 1 | 2007-05-02 08:09 |
| twinhan dvb-t signal 0, code change | lar282 | The old Bugreport Forum | 3 | 2006-03-10 11:41 |
| Change Channel using F7/F8 Changes Group, not channel | Anonymous | General Support | 2 | 2005-11-04 16:30 |
| TV Channel code all over the place | Anonymous | General Development (no feature request here!) | 4 | 2004-12-13 10:05 |