xck3001 Posted January 31, 2007 Share Posted January 31, 2007 (edited) Hallo, gibt es eine Info wie genau das IChannelItem.ChannelID Feld belegt ist? Ausgehend vom Namen dachte ich eigentlich ChannelID ist ein eindeutiger Bezeichner für einen Kanal (eine ID eben). Schein aber nicht so zu sein... Kann man das selbst zusammensetzen? Konkret habe ich mit dem Feld 2 Probleme, die eine manuelle Generierung für mich notwendig machen: 1. Ich lese zu Beginn meines Programmes alle IChannelItem mittels GetChannelList aus. Leider gibt es in dem Array keine ChannelID, daher muss ich die ChannelID anschließend mittels ChannelManager.GetChannelID( List[i,26] ) auslesen. Leider gibt das einen Leerstring zurück? (Wieso ist das so?) Wenn ich die ChannelID per ChannelManager.Item.ChannelID auslese bekomme ich den korrekten Wert, aber das ist sehr langsam. Eine manuelle Generierung wäre daher deutlich besser. 2. Dann noch ein Problem mit der ChannelID von Timern: Ich habe zum Test im DVBViewer mehrere Timer erzeugt. Diese lese ich mit TimerManager.GetTimerList() aus. Allerdings stimmen die ChannelID aus 1., also ChannelManager.Item.ChannelID nicht mit der Timerliste List[n, 1] überein, obwohl der selbe Kanal angewählt sein sollte! Der Kanalname ist korrekt, aber die vorangestellte Nummer ist nicht identisch. Ich hoffe ich konnte die Probleme einigermaßen deutlich machen. Danke im Voraus für den Support! Edit: Mal ein konkretes Beispiel zu 2. aus meinem Logfile: 43937134|ZDFdokukanal 1117678958|ZDFdokukanal Links: ChannelManager.Item.ChannelID Rechts: TimerManager.GetTimerList() -> List[n,1] Edited January 31, 2007 by xck3001 Quote Link to comment
Guest Lars_MQ Posted January 31, 2007 Share Posted January 31, 2007 ChannelManager.GetChannelID( List[i,26] ) Das ist ein fehler in der Doku es muss lauten: ChannelManager.GetChannelID( List[i,26] + List[i,23] shl 16 ) -> (SID + TID shl 16) Du kannst Dir die ChannelID auch selber erzeugen: (TunerType +1) shl 29 + APID shl 16 + SID + '|' + Channelname Das bedeutet: (List[i, 4] + 1) shl 29 + List[i, 20] shl 16 + List[i, 26] + '|' + List[i, 1] Wobei der Tunertype weggelassen werden kann (das passiert im Moment noch bei Deinem Beispiel in ChannelManager.Item.ChannelID). Theoretisch kann fast alles wegfallen (APID oder SID oder Channelname), intern sucht der Viewer nach einem möglichst passenden kanal, wenn einige der kriterien nicht vorhanden sind. Zwingend sollte zumindest die SID oder der Kanalname sein, wobei dann natürlich der erste in der Knalliste auftretende Audiokanal genommen wird. Bei nur Kanalname kann auch der Empfangstyp wechseln (Pro 7 DVB-S und Pro 7 DVB-T sind dann gleichwertig und nur die Kanallisten position entscheidet welcher genommen wird). Quote Link to comment
xck3001 Posted January 31, 2007 Author Share Posted January 31, 2007 Spitze, alle Fragen zur vollsten Zufriedenheit beantwortet und darüber hinaus Mache mich gleich ans ausprobieren, danke! Quote Link to comment
xck3001 Posted January 31, 2007 Author Share Posted January 31, 2007 (edited) Funktioniert tadellos. Man beachte den mit der Timerliste rechts gematchten Eintrag: Edited January 31, 2007 by xck3001 Quote Link to comment
cgiesen Posted March 9, 2007 Share Posted March 9, 2007 Hallo xck3001, kannst Du mir mal veraten wie Du das machst? Ich probieren hier schon seit Tagen mit VB2005 rum und komme auf keinen grünen Zweig. Danke Carsten 1. Ich lese zu Beginn meines Programmes alle IChannelItem mittels GetChannelList aus.Leider gibt es in dem Array keine ChannelID, daher muss ich die ChannelID anschließend mittels ChannelManager.GetChannelID( List[i,26] ) auslesen. Leider gibt das einen Leerstring zurück? (Wieso ist das so?) Wenn ich die ChannelID per ChannelManager.Item.ChannelID auslese bekomme ich den korrekten Wert, aber das ist sehr langsam. Eine manuelle Generierung wäre daher deutlich besser. Quote Link to comment
Petr Vavrik Posted October 6, 2007 Share Posted October 6, 2007 (TunerType +1) shl 29 + APID shl 16 + SID + '|' + Channelname Please, i don't understand your language , it is algorithm to calculate ChannelID? What is "shl" ? Can you show me please, how to calculate ChannelID for this: [Channel398] TunerType=1 Frequency=12382 Polarity=h Symbolrate=27500 FEC=2 APID=161 VPID=151 PMTPID=150 PCRPID=151 AC3=0 TelePID=0 SID=20316 StreamID=1099 NetworkID=1 LNB-Selection=1 LNB=10600 DiseqC=1 Root=Scan 5.10.2007 Name=CT24 Category=UPC Direct Encrypted=24 SatModulation=1 SatModulationSystem=0 Group=0 Language= Thank you. Quote Link to comment
Lars_MQ Posted October 7, 2007 Share Posted October 7, 2007 shl = shift left. A bitshifting operation you can express it also as: n shl x = n * 2^x So the tunertype calculates as: (TunerType +1) * 536870912 + APID * 65536 + SID + '|' + Channelname Your example: (2 * 536870912 + 161 * 65526 + 20316) as String + '|CT24' Quote Link to comment
Petr Vavrik Posted October 8, 2007 Share Posted October 8, 2007 (TunerType +1) * 536870912 + APID * 65536 + SID + '|' + Channelname Thanx, it works! But are you sure, that there is no buggy? .. because on some channels, where are more audio tracks - APIDs (hun,cze,eng) and i switch to channel where ChannelID is for APID with "cze", i listen always first (i think) APID .. hun Can you check this please and tell me, if you found something wrong or mistake is on my side? .. version 3.9.0.0 I use this for favourites.xml and wants to switch on channel in my language. Thank you. Quote Link to comment
Lars_MQ Posted October 8, 2007 Share Posted October 8, 2007 well why don't you simply take your language into the favourites or make the the mainchannel in the channellist? Quote Link to comment
Petr Vavrik Posted October 8, 2007 Share Posted October 8, 2007 well why don't you simply take your language into the favourites or make the the mainchannel in the channellist? Well, but i making a tool, that you can simply synchronize channel lists for Enigma 1.x, DGS 2.x, MediaPortal 0.2.2.0, MediaPortal TV3e. and DVBViewer 3.x according one XML file by "One Click". That is why, i need to know,.. beause a tool making channel ordering => (reorganize channels in INI DVBViewer structure for) => favourite channel numbers and settings for correct channel APIDs. So, if I calculate ChannelID and store with channel name to favourite.xml structure, and then I switch from DVBViewer to someone where is more APIDs, I usualy get this channel with first APID even if ChannelID is calculated for other APID - and I dont know why Quote Link to comment
Griga Posted October 9, 2007 Share Posted October 9, 2007 and i switch to channel where ChannelID is for APID with "cze", i listen always first (i think) APID .. hun Did you consider that different audio tracks may require different names? Have a look at this (working) example <section name="3"> <entry name="Header">1100115405|arte (deu)</entry> </section> <section name="4"> <entry name="Header">1100180941|arte (fra)</entry> </section> with tunertype = satellite = 1+1 = 2, APID = 402 (deu) resp. 403 (fra), SID = 28109. The names must comply with the according names in the channel list. Quote Link to comment
Petr Vavrik Posted October 9, 2007 Share Posted October 9, 2007 Did you consider that different audio tracks may require different names? Have a look at this (working) exampleThe names must comply with the according names in the channel list. Thank you! Here can be my problem,.. because name of channels what i use to store after ChannelID in favourite.xml are from my XML list and not fully corresponded with channel names from DVBViewer (channel list). Quote Link to comment
Moses Posted October 9, 2007 Share Posted October 9, 2007 maybe you should omit the name then. If I understood the documentation of the ID correctly, it should select the correct channel and audio track, if all other data is correct. Quote Link to comment
Griga Posted October 9, 2007 Share Posted October 9, 2007 An empty channel name is a wild card -> matches always. A bit better than a wrong one. Quote Link to comment
Petr Vavrik Posted October 9, 2007 Share Posted October 9, 2007 An empty channel name is a wild card -> matches always. A bit better than a wrong one. Yes, if channel name is not set, it works correctly, but in DVBViewer I see numbers and not channel names If I understood the documentation of the ID correctly, it should select the correct channel and audio track, if all other data is correct. Yes, you are right and it was my problem, because channel names what I use after ChannelID| in favourites.xml was not from DVBViewer channel list and not always corresponded with it. Now, I set correctly names of channels depends on channel list from DVBViewer and all works fine. Thank you to all again. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.