Direct Channel Access (1 Viewer)

bionicdonkey

Portal Pro
September 3, 2004
108
1
Sydney :: Australia
http://home.exetel.com.au/bionicdonkey/files/NewStuff.rar

This archive contains 2 binaries and some source code.
One binary is windowsplugins.dll which has the ability to select the channel by it's channel number.
The second is for bda users. It'll retireve the LCN's for thier channels.

To use these, backup the old file and put my file in it's place.
If you are a bda user, you will need to rescan. Also backup your old tvdatabase & radio databases.

regards
Bionic Donkey
 
A

Anonymous

Guest
bionicdonkey

File not found --- the URL is broken. I tried things like new_stuff.rar, new/stuff.rar, but no go.

John
 

AllenConquest

Portal Pro
January 9, 2005
232
0
London, UK
bionicdonkey said:
The second is for bda users. It'll retireve the LCN's for thier channels.

By this do you mean that, for example CBeebies will come back as channel 31 ? If that's true this is just what I've been looking for. Will the channels then be sorted by this number automatically, or is this something that has to be done by hand ?
 
A

Anonymous

Guest
bionicdonkey

This did not work the way I was thinking it would. I think I know why.

I looked in the database using the SQL Lite Database Browser tool and found that for internal channels, the field <u>iChannelNr</u> contains the "channel number" that I am looking for.

However for external channels (i.e satellite/cable channels via external box) the field <u>iChannelNr</u> always contains "10001", the 'address' of the video/audio inputs on one of the cards. The actual channel in this case is in field <u>ExternalChannel</u>.

There is no single field in the database where the "channel number" in (North American usage) is stored as a numeric value. The closest thing is in <u>strChannel</u> where the first "n" characters are the "channel number" (e.g. "10 WPLG", "67 SCIFI", "300 HBO", etc.)

Unless I missed something, it looks like the current database schema makes this more complex than first suspected. It would be silly to parse the strChannel value for the channel as this is pretty much arbitrary.

One possible change would be to always store the actual "channel number" in the <u>ExternalChannel</u> field regardless of the nature of the channel type (internal vs external.) My "guess" is that this field is used to obtain the value to send out on the IR transmitter to change the satellite/cable box. Always storing the "channel number" in this field would then allow it to be used as both

- an identifier for the channel when using direct channel access, regardless of the channel type;
- a source of the channel value to send to an external satellite/cable box.

Another alternative would be to examine the field <u>bExternal</u> when doing a direct channel access lookup and obtain the "channel number" from the appropriate field depending on the setting of the <u>bExternal</u> value.

------------------------------------
In conjunction with all of this it has occured to me that two other mods would be useful for folks with a large number of channels:

- a 'one-button' selection from the TVGuide would be useful. With the highlight on a channel a single unique button to go to that channel. As it stands now you have to hit "F3" then select from the menu;

- a semi-transparent TVGuide overlay in Fullscreen mode to allow you to bring up the TVGuide and go to a channel directly from there.

Both of these of course should be in the Feature Request category but I thought I'd mention them while they were fresh in my mind.
 

AllenConquest

Portal Pro
January 9, 2005
232
0
London, UK
I just tried it and it works great for DVB-T channels. I now get all the correct channel numbers that match to my DVB-T set-top box. The kiddies will now be able to find CBeebies :D

However, it would now be nice if the clicking on the channel number in the configuration sorted them properly numerically, instead of alphabetically. Then reordering them would be easy. Of could an option to automatically sort by channel number would be nice too...
 
A

Anonymous

Guest
AllenConquest

Yes, I suspect that the problem is in mix of internal/external channels.

And I agree that it would be good to have it sort "properly". I used it and now my channels are ordered 10, 100, 101, 102, ... 26, 201, 205, ... 267, 36, 301, 302 ... 40, 41, 42, ... 500, 501, ... 52, 53, etc.

So now I get to export the table, sort it in Excel and reimport it! What a pain...
 
A

Anonymous

Guest
bionicdonkey

After I removed your mods I tried a little experiment.

Using the SQLLite DB browser I ran some local SQL to renumber the sort fields (I think one was iSort and I can't remember the other --- I'm at the office) so that their values would be the same as the "channel numbers" that I'm looking for. I did this by setting these fields from the iChannelNr or ExternalChannel fields as appropriate.

I was hoping that one of these 'sort' fields was the one used in in the current "direct access/database index" method. I then ran MP and tried going to a specific channel and the results were the same as before, it still goes to the "wrong" channel. Absent examining the code, from this it almost appears that the current direct access method is to go to the actual row in the database and get the channel information from there --- but that doesn't really make sense.

Frankly I think I must have made some other mistake or the database didn't get saved properly after I made the changes because I can't see that it would actually do it that way, but one never knows...

Anyway the search for direct channel access continues ... ;-)
 
A

Anonymous

Guest
No joy, it appears to work the way it always did. If I enter "17" it goes to channel 48, the 17th item in the database. The only thing in the database that "looks like" 17 is the value in iSort which is a zero-based field so the 17th value in there is "16".

So another experiment to see if in fact the channel is actually selected based on iSort. I ran some local SQL using the SQLLite DB browser tool from the docs:

UPDATE channel SET iSort = (iChannelNr-1) WHERE bExteranl = 0 and
UPDATE channel SET iSort = (ExternalChannel-1) WHERE bExternal = 1

The result of this was to set the value of the iSort field equal to the channel number minus 1 (iSort appears to be zero-based). I fired up MP and went to fullscreen. I then tried selecting a channel based on the channel number but the result was exactly the same. The channel that displays occupies the "nth" row in the database.

I'm not familiar with SQLLite so there may well be some access function going on with which I am not familiar, but I know from my work with other database systems (MS-SQL, MS-Access, MySQL) that I have never tried getting data based on the physical row location in the database. My work involves larger, dynamic databases where this would be a particularly unreliable way of accessing data. MP's database is small and relatively fixed so maybe this works OK, or as I said there is some other mechanism at work in MP and/or SQLLite.

Anyway, bottom line is that these changes did not make any difference, and absent a better understanding of the internals of MP, I haven't been able to identify a simple method that would work in all cases.
 

Users who are viewing this thread

Top Bottom