- updated NuGet packages

- added support for dtv_cmdb_3.bin file with file size 1323920
- fixed error when opening reference list dialog with Italian translation
- "Tornado" TV lists which are a slight variation of old Philips lists using a file name __chtb_do_not_delete_.xml
This commit is contained in:
Horst Beham
2024-08-18 17:41:46 +02:00
parent 78e53e7183
commit d33f349626
53 changed files with 712 additions and 429 deletions

View File

@@ -1,10 +1,75 @@
# This file holds the definitions for various verions of the binary "dtv_cmdb_2.bin" channel list format used by some models of Sharp, Toshiba, Dyon, OK. and others
# Some files have an 8 byte header starting with "0004", others have an 12 byte header starting with "0005"
# Some files have an 8 byte header starting with "0004", others have an 12 byte header starting with "0005" or "1114"
# [dtv_chmdb_x.bin:filesize] defines the overall layout of the various file format versions. Values for x are 0=antenna, 1=cable, 2=satellite
# lenChannelRecord, lenTransponderRecord and lenSatelliteRecord are then used to select the [dvsChannel:...], [dvbsTransponder:...] and [dvbsSatellite:...] sections
# C.F. - Grundig 37 VLE 9270 SL dtv_cmd_3.bin with 1293 KB
[dtv_cmdb_3.bin:1323920]
offSatelliteBitmap=0x0008
lenSatelliteBitmap=4
offChannelBitmap=12
lenChannelBitmap=752
offSatelliteRecord=0x2fc
lenSatelliteRecord=60_3
numSatelliteRecord=24
offNetworkRecord=0x89c
lenNetworkRecord=54
numNetworkRecord=254
offTransponderBitmap=-1
lenTransponderBitmap=-1
offTransponderRecord=0x3e30
lenTransponderRecord=44_3
numTransponderRecord=3000
numChannelRecord=6000
offChannelRecord=0x241d0
lenChannelRecord=196_3
[dvbsSatellite:60_3]
offName=2
lenName=14
[dvbsTransponder:44_3]
offSatelliteIndex=0
offTransportStreamId=6
offOriginalNetworkId=8
offNetworkId=-1
offTransponderIndex=10
offFreqInMhz=12
offSymbolRate=32
[dvbsChannel:196_3]
offEncrypted=11
maskEncrypted=0x10
offSkip=11
maskSkip=0x20
offLocked=11
maskLocked=0x40
offDeleted=11
maskDeleted=0x04
offChannelType=13
offServiceType=-1
offTransponderIndex=16
offPmtPid=18
offPcrPid=22
offVideoPid=24
offProgramNr=28
offServiceId=30
offAudioPid=52
offName=144
lenName=44
offDebug=11
lenDebug=1
# Rabinowitsch - dtv_cmd_2.bin with 1296 KB
[dtv_cmdb_2.bin:1326665]

View File

@@ -59,6 +59,9 @@ namespace ChanSort.Loader.CmdbBin
case "dtv_cmdb_2.bin":
LoadFile(file, this.dvbsTv, this.dvbsRadio, this.dvbsData);
break;
case "dtv_cmdb_3.bin":
LoadFile(file, this.dvbsTv, this.dvbsRadio, this.dvbsData);
break;
case "atv_cmdb.bin":
LoadFile(file, this.avbtTv, null, null);
break;
@@ -93,7 +96,7 @@ namespace ChanSort.Loader.CmdbBin
}
else
{
LoadBitmappedRecords(data, sec, "dvbs", "Satellite", ReadSatellite);
LoadBitmappedRecords(data, sec, "dvbs", "Satellite", ReadSatellite, Encoding.UTF8);
LoadBitmappedRecords(data, sec, "dvbs", "Transponder", ReadTransponder);
LoadBitmappedRecords(data, sec, "dvbs", "Channel", (map, index, len) => ReadDigitalChannel(map, tvList, radioList, dataList, index, len));
}
@@ -116,28 +119,42 @@ namespace ChanSort.Loader.CmdbBin
#endregion
#region LoadBitmappedRecords()
private void LoadBitmappedRecords(byte[] data, IniFile.Section sec, string recordSectionPrefix, string recordType, Action<DataMapping, int, int> readRecord)
private void LoadBitmappedRecords(byte[] data, IniFile.Section sec, string recordSectionPrefix, string recordType, Action<DataMapping, int, int> readRecord, Encoding forceEncoding = null)
{
var lenRecord = sec.GetInt($"len{recordType}Record");
var map = new DataMapping(this.ini.GetSection($"{recordSectionPrefix}{recordType}:{lenRecord}"));
map.DefaultEncoding = this.DefaultEncoding;
var lenRecordVariant = sec.GetString($"len{recordType}Record");
var p = lenRecordVariant.IndexOf('_');
var lenRecord = p < 0 ? int.Parse(lenRecordVariant) : int.Parse(lenRecordVariant.Substring(0, p));
var map = new DataMapping(this.ini.GetSection($"{recordSectionPrefix}{recordType}:{lenRecordVariant}"));
map.DefaultEncoding = forceEncoding ?? this.DefaultEncoding;
map.SetDataPtr(data, sec.GetInt($"off{recordType}Record"));
var off = sec.GetInt($"off{recordType}Bitmap");
var len = sec.GetInt($"len{recordType}Bitmap");
var count = sec.GetInt($"num{recordType}Record", short.MaxValue);
int index = 0;
for (int i = 0; i < len; i++)
if (off >= 0)
{
var b = data[off + i];
for (byte mask = 1; mask != 0; mask <<= 1)
var len = sec.GetInt($"len{recordType}Bitmap");
var count = sec.GetInt($"num{recordType}Record", short.MaxValue);
int index = 0;
for (int i = 0; i < len; i++)
{
if ((b & mask) != 0)
readRecord(map, index, lenRecord);
var b = data[off + i];
for (byte mask = 1; mask != 0; mask <<= 1)
{
if ((b & mask) != 0)
readRecord(map, index, lenRecord);
map.BaseOffset += lenRecord;
++index;
if (index >= count)
break;
}
}
}
else
{
var count = sec.GetInt($"num{recordType}Record", short.MaxValue);
for (int index = 0; index < count; index++)
{
readRecord(map, index, lenRecord);
map.BaseOffset += lenRecord;
++index;
if (index >= count)
break;
}
}
}
@@ -218,6 +235,7 @@ namespace ChanSort.Loader.CmdbBin
ch.Encrypted = chanMap.GetFlag("Encrypted", false);
ch.Skip = chanMap.GetFlag("Skip", false);
ch.Lock = chanMap.GetFlag("Locked", false);
ch.IsDeleted = chanMap.GetFlag("Deleted", false);
ch.Favorites = chanMap.GetFlag("Fav", false) ? Favorites.A : 0;
var off = chanMap.BaseOffset + chanMap.GetOffsets("offName")[0];