mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-01-28 10:09:02 +01:00
- added skip/lock/crypt/fav flags for cmdb.bin lists
- added config for 4532KB dtv_cmdb_2.bin - fixed some cmdb config issues (videoPid, channelTypeOld)
This commit is contained in:
@@ -29,6 +29,12 @@ offName=2
|
||||
lenName=16
|
||||
|
||||
[dvbsChannel:196]
|
||||
offEncrypted=11
|
||||
maskEncrypted=0x10
|
||||
offSkip=11
|
||||
maskSkip=0x20
|
||||
offLocked=11
|
||||
maskLocked=0x40
|
||||
offChannelTypeOld=13
|
||||
offServiceType=15
|
||||
offTransponderIndex=16
|
||||
@@ -99,12 +105,18 @@ offFreqInMhz=16
|
||||
offSymbolRate=28
|
||||
|
||||
[dvbsChannel:200]
|
||||
#offChannelType=-1
|
||||
offEncrypted=13
|
||||
maskEncrypted=0x10
|
||||
offSkip=13
|
||||
maskSkip=0x20
|
||||
offLocked=13
|
||||
maskLocked=0x40
|
||||
offChannelTypeOld=15
|
||||
offServiceType=17
|
||||
offTransponderIndex=18
|
||||
offPmtPid=22
|
||||
offVideoPid=24
|
||||
offPcrPid=26
|
||||
offPcrPid=24
|
||||
offVideoPid=26
|
||||
offProgramNr=32
|
||||
offServiceId=34
|
||||
offAudioPid=52
|
||||
@@ -141,11 +153,20 @@ offFreqInMhz=16
|
||||
offSymbolRate=28
|
||||
|
||||
[dvbsChannel:256]
|
||||
offEncrypted=13
|
||||
maskEncrypted=0x10
|
||||
offSkip=13
|
||||
maskSkip=0x20
|
||||
offLocked=13
|
||||
maskLocked=0x40
|
||||
offChannelType=15
|
||||
offServiceType=16
|
||||
offFav=18
|
||||
maskFav=1
|
||||
offTransponderIndex=20
|
||||
offPmtPid=22
|
||||
offPcrPid=26
|
||||
offVideoPid=28
|
||||
offProgramNr=32
|
||||
offServiceId=34
|
||||
offAudioPid=58
|
||||
@@ -155,12 +176,66 @@ offProvider=200
|
||||
lenProvider=52
|
||||
|
||||
|
||||
# Philips format 100 lists - dtv_cmdb_2.bin with 3443 KB
|
||||
# Philips ChannelMap_100 lists - dtv_cmdb_2.bin with 3443 KB
|
||||
#[dtv_cmdb_2.bin:3525205]
|
||||
|
||||
|
||||
# blackbox - 4532 KB
|
||||
#[dtv_cmdb_2.bin:4640189]
|
||||
|
||||
[dtv_cmdb_2.bin:4640189]
|
||||
offChannelBitmap=8
|
||||
lenChannelBitmap=752
|
||||
offChannelRecord=0x2f8
|
||||
lenChannelRecord=608
|
||||
numChannelRecord=6000
|
||||
offTransponderBitmap=0x0037acf8
|
||||
lenTransponderBitmap=376
|
||||
offTransponderRecord=0x0037ae70
|
||||
lenTransponderRecord=320
|
||||
numTransponderRecord=3000
|
||||
offSatelliteBitmap=0x00468a24
|
||||
lenSatelliteBitmap=32
|
||||
offSatelliteRecord=0x00468a44
|
||||
lenSatelliteRecord=68
|
||||
numSatelliteRecord=254
|
||||
|
||||
[dvbsSatellite:68]
|
||||
offName=2
|
||||
lenName=32
|
||||
offLowFreq=36
|
||||
offHighFreq=38
|
||||
|
||||
[dvbsTransponder:320]
|
||||
offSatelliteIndex=0
|
||||
offTransportStreamId=6
|
||||
offOriginalNetworkId=8
|
||||
offNetworkId=10
|
||||
offTransponderIndex=14
|
||||
offFreqInMhz=16
|
||||
offSymbolRate=28
|
||||
|
||||
[dvbsChannel:608]
|
||||
offEncrypted=13
|
||||
maskEncrypted=0x10
|
||||
offSkip=13
|
||||
maskSkip=0x20
|
||||
offLocked=13
|
||||
maskLocked=0x40
|
||||
offChannelType=15
|
||||
offServiceType=16
|
||||
offFav=18
|
||||
maskFav=1
|
||||
offTransponderIndex=20
|
||||
offPmtPid=22
|
||||
offPcrPid=26
|
||||
offVideoPid=28
|
||||
offProgramNr=32
|
||||
offServiceId=34
|
||||
offAudioPid=58
|
||||
offName=246
|
||||
lenName=66
|
||||
offProvider=312
|
||||
lenProvider=270
|
||||
|
||||
|
||||
|
||||
@@ -199,11 +274,20 @@ offFreqInMhz=16
|
||||
offSymbolRate=28
|
||||
|
||||
[dvbsChannel:660]
|
||||
offEncrypted=13
|
||||
maskEncrypted=0x10
|
||||
offSkip=13
|
||||
maskSkip=0x20
|
||||
offLocked=13
|
||||
maskLocked=0x40
|
||||
offChannelType=15
|
||||
offServiceType=16
|
||||
offFav=18
|
||||
maskFav=1
|
||||
offTransponderIndex=20
|
||||
offPmtPid=22
|
||||
offPcrPid=26
|
||||
offVideoPid=28
|
||||
offProgramNr=32
|
||||
offServiceId=34
|
||||
offAudioPid=58
|
||||
|
||||
@@ -21,10 +21,22 @@ namespace ChanSort.Loader.CmdbBin
|
||||
|
||||
public CmdbFileSerializer(string inputFile) : base(inputFile)
|
||||
{
|
||||
this.Features.FavoritesMode = FavoritesMode.Flags;
|
||||
this.Features.MaxFavoriteLists = 1;
|
||||
|
||||
this.DataRoot.AddChannelList(dvbsTv);
|
||||
this.DataRoot.AddChannelList(dvbsRadio);
|
||||
// this.DataRoot.AddChannelList(dvbsData); // there seem to be multiple data lists with Toshiba TVs which all have their own numbering starting at 1. Better don't show data channels at all than dupes
|
||||
this.ReadConfigurationFromIniFile();
|
||||
|
||||
foreach (var list in this.DataRoot.ChannelLists)
|
||||
{
|
||||
//list.VisibleColumnFieldNames.Remove(nameof(ChannelInfo.Favorites));
|
||||
//list.VisibleColumnFieldNames.Remove(nameof(ChannelInfo.Skip));
|
||||
//list.VisibleColumnFieldNames.Remove(nameof(ChannelInfo.Lock));
|
||||
list.VisibleColumnFieldNames.Remove(nameof(ChannelInfo.Hidden));
|
||||
//list.VisibleColumnFieldNames.Remove(nameof(ChannelInfo.Encrypted));
|
||||
}
|
||||
}
|
||||
|
||||
#region ReadConfigurationFromIniFile()
|
||||
@@ -109,13 +121,16 @@ namespace ChanSort.Loader.CmdbBin
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ReadSatellite()
|
||||
private void ReadSatellite(DataMapping map, int index)
|
||||
{
|
||||
var sat = new Satellite(index);
|
||||
sat.Name = map.GetString("offName", map.Settings.GetInt("lenName"));
|
||||
this.DataRoot.AddSatellite(sat);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ReadTransponder()
|
||||
private void ReadTransponder(DataMapping map, int index)
|
||||
{
|
||||
//var idx = map.GetWord("offTransponderIndex"); // seems to be some logical number, skipping a new numbers here and there
|
||||
@@ -129,6 +144,7 @@ namespace ChanSort.Loader.CmdbBin
|
||||
tp.SymbolRate = map.GetWord("offSymbolRate");
|
||||
this.DataRoot.AddTransponder(tp.Satellite, tp);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ReadChannel()
|
||||
private void ReadChannel(DataMapping chanMap, ChannelList tvList, ChannelList radioList, ChannelList dataList, int recordIndex)
|
||||
@@ -137,8 +153,9 @@ namespace ChanSort.Loader.CmdbBin
|
||||
if (channelType == 0) // some file format versions store the channel type in the upper nibble of a byte
|
||||
channelType = chanMap.GetByte("offChannelTypeOld") >> 4;
|
||||
var serviceType = chanMap.GetByte("offServiceType");
|
||||
var apid = chanMap.GetWord("offAudioPid") & 0x1FFF;
|
||||
var vpid = chanMap.GetWord("offVideoPid") & 0x1FFF;
|
||||
|
||||
if (chanMap.Settings.GetInt("offFav", -1) < 0)
|
||||
this.Features.FavoritesMode = FavoritesMode.None;
|
||||
|
||||
ChannelList list;
|
||||
if (channelType != 0)
|
||||
@@ -149,10 +166,7 @@ namespace ChanSort.Loader.CmdbBin
|
||||
list = type == SignalSource.Radio ? radioList : type == SignalSource.Tv ? tvList : dataList;
|
||||
}
|
||||
else
|
||||
{
|
||||
//list = vpid != 0 && vpid != 0x1FFF ? tvList : apid != 0 && apid != 0x1FFF ? radioList : dataList;
|
||||
list = tvList;
|
||||
}
|
||||
|
||||
var progNr = (int)chanMap.GetWord("offProgramNr");
|
||||
if (progNr == 0xFFFE)
|
||||
@@ -163,8 +177,12 @@ namespace ChanSort.Loader.CmdbBin
|
||||
ch.ServiceTypeName = Api.LookupData.Instance.GetServiceTypeDescription(ch.ServiceType);
|
||||
ch.PcrPid = chanMap.GetWord("offPcrPid") & 0x1FFF;
|
||||
ch.ServiceId = chanMap.GetWord("offServiceId");
|
||||
ch.AudioPid = apid;
|
||||
ch.VideoPid = vpid;
|
||||
ch.AudioPid = chanMap.GetWord("offAudioPid");
|
||||
ch.Encrypted = chanMap.GetFlag("Encrypted");
|
||||
ch.VideoPid = chanMap.GetWord("offVideoPid") & 0x1FFF;
|
||||
ch.Skip = chanMap.GetFlag("Skip");
|
||||
ch.Lock = chanMap.GetFlag("Locked");
|
||||
ch.Favorites = chanMap.GetFlag("Fav") ? Favorites.A : 0;
|
||||
|
||||
var off = chanMap.BaseOffset + chanMap.GetOffsets("offName")[0];
|
||||
this.dvbStringDecoder.GetChannelNames(chanMap.Data, off, chanMap.Settings.GetInt("lenName"), out var longName, out var shortName);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using ChanSort.Api;
|
||||
using System.IO;
|
||||
using ChanSort.Api;
|
||||
|
||||
namespace ChanSort.Loader.CmdbBin
|
||||
{
|
||||
@@ -10,7 +11,15 @@ namespace ChanSort.Loader.CmdbBin
|
||||
|
||||
public SerializerBase CreateSerializer(string inputFile)
|
||||
{
|
||||
return new CmdbFileSerializer(inputFile);
|
||||
var dir = Path.GetDirectoryName(inputFile);
|
||||
|
||||
// ignore Philips ChannelMap_100 channel lists which don't have atv_cmdb.bin and dtv_cmdb_2.bin in the same folder
|
||||
|
||||
var anchorFile = Path.Combine(dir, "dtv_cmdb_2.bin");
|
||||
if (File.Exists(anchorFile) && File.Exists(Path.Combine(dir, "atv_cmdb.bin")))
|
||||
return new CmdbFileSerializer(anchorFile);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user