diff --git a/source/ChanSort.Api/Model/ChannelInfo.cs b/source/ChanSort.Api/Model/ChannelInfo.cs index 1ca3f1f..a37e383 100644 --- a/source/ChanSort.Api/Model/ChannelInfo.cs +++ b/source/ChanSort.Api/Model/ChannelInfo.cs @@ -158,7 +158,7 @@ namespace ChanSort.Api { if (this.uid == null) { - if ((this.SignalSource & SignalSource.MaskAnalogDigital) == SignalSource.Analog) + if ((this.SignalSource & SignalSource.Analog) != 0) this.uid = "A-0-" + (int) (this.FreqInMhz*20) + "-0"; else { diff --git a/source/ChanSort.Api/Model/DataRoot.cs b/source/ChanSort.Api/Model/DataRoot.cs index cd72a32..3b5cc63 100644 --- a/source/ChanSort.Api/Model/DataRoot.cs +++ b/source/ChanSort.Api/Model/DataRoot.cs @@ -112,7 +112,10 @@ namespace ChanSort.Api foreach (var list in this.ChannelLists) { if (list.IsMixedSourceFavoritesList) + { + loader.Features.SortedFavorites = true; // all mixed source favorite lists must support ordering continue; + } // make sure that deleted channels have OldProgramNr = -1 bool hasPolarity = false; diff --git a/source/ChanSort.Loader.Philips/BinarySerializer.cs b/source/ChanSort.Loader.Philips/BinarySerializer.cs index 1831eb2..5637429 100644 --- a/source/ChanSort.Loader.Philips/BinarySerializer.cs +++ b/source/ChanSort.Loader.Philips/BinarySerializer.cs @@ -12,7 +12,7 @@ namespace ChanSort.Loader.Philips { /* - This loader handles the file format versions 1.x (*Table and *.dat files) and version 25.x-45.x (*Db.bin files) + This loader handles the file format versions 1.x (*Table and *.dat files) and version 25.x-45.x (*Db.bin files + tv.db and list.db) channellib\CableDigSrvTable: =========================== @@ -45,9 +45,15 @@ namespace ChanSort.Loader.Philips { private readonly IniFile ini; private readonly List dataFilePaths = new List(); + // lists for old binary formats <= 11.x private readonly ChannelList dvbtChannels = new ChannelList(SignalSource.DvbT, "DVB-T"); private readonly ChannelList dvbcChannels = new ChannelList(SignalSource.DvbC, "DVB-C"); - private readonly ChannelList satChannels = new ChannelList(SignalSource.DvbS, "DVB-S"); + private readonly ChannelList dvbsChannels = new ChannelList(SignalSource.DvbS, "DVB-S"); + // lists for binary format >= 25.x + private readonly ChannelList antChannels = new ChannelList(SignalSource.Antenna, "Antenna"); + private readonly ChannelList cabChannels = new ChannelList(SignalSource.Cable, "Cable"); + private readonly ChannelList satChannels = new ChannelList(SignalSource.Sat, "Satellite"); + private ChanLstBin chanLstBin; private readonly StringBuilder logMessages = new StringBuilder(); private readonly List favListIndexToId = new(); @@ -64,36 +70,11 @@ namespace ChanSort.Loader.Philips this.Features.DeleteMode = DeleteMode.NotSupported; this.Features.CanSaveAs = false; this.Features.CanHaveGaps = false; - this.Features.SupportedFavorites = Favorites.A; + this.Features.SupportedFavorites = Favorites.A; // Map45 format will change this this.Features.SortedFavorites = false; // satellite favorites are stored in a separate file that may support independent sorting, but DVB C/T only have a flag this.Features.AllowGapsInFavNumbers = false; this.Features.CanEditFavListNames = false; - this.DataRoot.AddChannelList(this.dvbtChannels); - this.DataRoot.AddChannelList(this.dvbcChannels); - this.DataRoot.AddChannelList(this.satChannels); - this.DataRoot.AddChannelList(this.favChannels); - this.favChannels.IsMixedSourceFavoritesList = true; - - foreach (var list in this.DataRoot.ChannelLists) - { - list.VisibleColumnFieldNames.Remove("Skip"); - list.VisibleColumnFieldNames.Remove("ShortName"); - list.VisibleColumnFieldNames.Remove("ServiceTypeName"); - list.VisibleColumnFieldNames.Remove("Hidden"); - list.VisibleColumnFieldNames.Remove("AudioPid"); - list.VisibleColumnFieldNames.Remove("Encrypted"); - } - - foreach (var list in new[] {dvbcChannels, dvbtChannels}) - { - list.VisibleColumnFieldNames.Remove("PcrPid"); - list.VisibleColumnFieldNames.Remove("VideoPid"); - list.VisibleColumnFieldNames.Remove("AudioPid"); - list.VisibleColumnFieldNames.Remove("ChannelOrTransponder"); - list.VisibleColumnFieldNames.Remove("Provider"); - } - string iniFile = Assembly.GetExecutingAssembly().Location.Replace(".dll", ".ini"); this.ini = new IniFile(iniFile); } @@ -115,6 +96,10 @@ namespace ChanSort.Loader.Philips if (chanLstBin.VersionMajor <= 11) { + this.DataRoot.AddChannelList(this.dvbtChannels); + this.DataRoot.AddChannelList(this.dvbcChannels); + this.DataRoot.AddChannelList(this.dvbsChannels); + LoadDvbCT(dvbtChannels, Path.Combine(channellib, "AntennaDigSrvTable"), "CableDigSrvTable_entry"); LoadDvbCTPresets(dvbtChannels, Path.Combine(channellib, "AntennaPresetTable")); LoadDvbCT(dvbcChannels, Path.Combine(channellib, "CableDigSrvTable"), "CableDigSrvTable_entry"); @@ -122,7 +107,7 @@ namespace ChanSort.Loader.Philips LoadDvbsSatellites(Path.Combine(s2channellib, "satellite.dat")); LoadDvbsTransponders(Path.Combine(s2channellib, "tuneinfo.dat")); - LoadDvbS(satChannels, Path.Combine(s2channellib, "service.dat"), "service.dat_entry"); + LoadDvbS(dvbsChannels, Path.Combine(s2channellib, "service.dat"), "service.dat_entry"); LoadDvbsFavorites(Path.Combine(s2channellib, "favorite.dat")); var db_file_info = Path.Combine(s2channellib, "db_file_info.dat"); if (File.Exists(db_file_info)) @@ -131,9 +116,18 @@ namespace ChanSort.Loader.Philips else if (chanLstBin.VersionMajor >= 25 && chanLstBin.VersionMajor <= 45) { // version 25-45 - LoadDvbCT(dvbtChannels, Path.Combine(channellib, "TerrestrialDb.bin"), "Map45_CableDb.bin_entry"); - LoadDvbCT(dvbcChannels, Path.Combine(channellib, "CableDb.bin"), "Map45_CableDb.bin_entry"); + this.favChannels.IsMixedSourceFavoritesList = true; + this.Features.CanHaveGaps = true; + + this.DataRoot.AddChannelList(this.antChannels); + this.DataRoot.AddChannelList(this.cabChannels); + this.DataRoot.AddChannelList(this.satChannels); + this.DataRoot.AddChannelList(this.favChannels); + + LoadDvbCT(antChannels, Path.Combine(channellib, "TerrestrialDb.bin"), "Map45_CableDb.bin_entry"); + LoadDvbCT(cabChannels, Path.Combine(channellib, "CableDb.bin"), "Map45_CableDb.bin_entry"); LoadDvbS(satChannels, Path.Combine(s2channellib, "SatelliteDb.bin"), "Map45_SatelliteDb.bin_entry"); + var tvDbFile = Path.Combine(dir, "tv.db"); if (File.Exists(tvDbFile)) { @@ -147,6 +141,14 @@ namespace ChanSort.Loader.Philips this.dataFilePaths.Add(listDbFile); this.LoadMap45Favorites(listDbFile); } + + foreach(var list in this.DataRoot.ChannelLists) + list.VisibleColumnFieldNames.Add(nameof(ChannelInfo.Encrypted)); + satChannels.VisibleColumnFieldNames.Add(nameof(ChannelInfo.Polarity)); + } + else + { + throw new FileLoadException("Only Philips channel list format version 1.x and 25-45 are supported by this loader"); } // for a proper ChanSort backup/restore with .bak files, the Philips _backup.dat files must also be included @@ -155,6 +157,28 @@ namespace ChanSort.Loader.Philips if (file.Contains(".dat")) this.dataFilePaths.Add(file.Replace(".dat", "_backup.dat")); } + + dvbsChannels.VisibleColumnFieldNames.Add(nameof(ChannelInfo.Polarity)); + foreach (var list in this.DataRoot.ChannelLists) + { + list.VisibleColumnFieldNames.Remove("Skip"); + list.VisibleColumnFieldNames.Remove("ShortName"); + if (chanLstBin.VersionMajor <= 11) + list.VisibleColumnFieldNames.Remove("ServiceTypeName"); + list.VisibleColumnFieldNames.Remove("Hidden"); + list.VisibleColumnFieldNames.Remove("AudioPid"); + list.VisibleColumnFieldNames.Remove("Encrypted"); + } + + foreach (var list in new[] { dvbcChannels, dvbtChannels, antChannels, cabChannels, satChannels }) + { + list.VisibleColumnFieldNames.Remove("PcrPid"); + list.VisibleColumnFieldNames.Remove("VideoPid"); + list.VisibleColumnFieldNames.Remove("AudioPid"); + list.VisibleColumnFieldNames.Remove("ChannelOrTransponder"); + list.VisibleColumnFieldNames.Remove("Provider"); + } + } #endregion @@ -193,9 +217,27 @@ namespace ChanSort.Loader.Philips throw new FileLoadException($"Invalid CRC in record {i} in {path}"); } - var ch = new Channel(list.SignalSource, i, progNr, channelName); + var ch = new Channel(list.SignalSource & SignalSource.MaskAntennaCableSat, i, progNr, channelName); ch.Id = mapping.GetWord("offId"); // only relevant for ChannelMap45 - ch.FreqInMhz = (decimal) mapping.GetWord("offFreqTimes16") / 16; + if (chanLstBin.VersionMajor <= 11) + ch.FreqInMhz = (decimal) mapping.GetWord("offFreqTimes16") / 16; + else + { + ch.FreqInMhz = mapping.GetDword("offFreq") / 1000; + ch.Encrypted = mapping.GetDword("offEncrypted") != 0; + ch.SignalSource |= mapping.GetDword("offIsDigital") == 0 ? SignalSource.Analog : SignalSource.Digital; + if (mapping.GetDword("offServiceType") == 2) + { + ch.SignalSource |= SignalSource.Radio; + ch.ServiceTypeName = "Radio"; + } + else + { + ch.SignalSource |= SignalSource.Tv; + ch.ServiceTypeName = "TV"; + } + } + ch.OriginalNetworkId = mapping.GetWord("offOnid"); ch.TransportStreamId = mapping.GetWord("offTsid"); ch.ServiceId = mapping.GetWord("offSid"); @@ -204,6 +246,7 @@ namespace ChanSort.Loader.Philips ch.Favorites = mapping.GetByte("offIsFav") != 0 ? Favorites.A : 0; if (ch.Favorites != 0) ch.OldFavIndex[0] = ch.OldProgramNr; + this.DataRoot.AddChannel(list, ch); } } @@ -349,7 +392,8 @@ namespace ChanSort.Loader.Philips var t = new Transponder(i); t.SymbolRate = symRate; - t.FrequencyInMhz = BitConverter.ToUInt16(data, baseOffset + 2); + t.FrequencyInMhz = BitConverter.ToUInt16(data, baseOffset + 2) & 0x3FFF; + t.Polarity = (BitConverter.ToUInt16(data, baseOffset + 2) & 0x4000) != 0 ? 'V' : 'H'; var satIndex = data[baseOffset + 6] >> 4; // guesswork t.Satellite = DataRoot.Satellites.TryGet(satIndex); t.TransportStreamId = tsid; @@ -414,7 +458,7 @@ namespace ChanSort.Loader.Philips { var transponderId = mapping.GetWord("offTransponderIndex"); var progNr = mapping.GetWord("offProgNr"); - var ch = new Channel(list.SignalSource, recordIndex, progNr, ""); + var ch = new Channel(list.SignalSource & SignalSource.MaskAntennaCableSat, recordIndex, progNr, ""); // deleted channels must be kept in the list because their records must also be physically reordered when saving the list if (progNr == 0xFFFF || transponderId == 0xFFFF) @@ -427,7 +471,7 @@ namespace ChanSort.Loader.Philips // onid, tsid, pcrpid and vpid can be 0 in some lists ch.PcrPid = mapping.GetWord("offPcrPid") & mapping.GetMask("maskPcrPid"); ch.Lock = mapping.GetFlag("Locked"); - ch.OriginalNetworkId = mapping.GetWord("OffOnid"); + ch.OriginalNetworkId = mapping.GetWord("offOnid"); ch.TransportStreamId = mapping.GetWord("offTsid"); ch.ServiceId = mapping.GetWord("offSid"); ch.VideoPid = mapping.GetWord("offVpid") & mapping.GetMask("maskVpid"); @@ -444,9 +488,24 @@ namespace ChanSort.Loader.Philips } else { + ch.SignalSource |= mapping.GetWord("offIsDigital") == 0 ? SignalSource.Analog : SignalSource.Digital; ch.Name = Encoding.Unicode.GetString(mapping.Data, mapping.BaseOffset + mapping.GetConst("offName", 0), mapping.GetConst("lenName", 0)).TrimEnd('\0'); ch.FreqInMhz = (decimal)mapping.GetDword("offFreq") / 1000; + ch.Encrypted = mapping.GetDword("offEncrypted") != 0; + ch.Polarity = mapping.GetDword("offPolarity") == 0 ? 'H' : 'V'; ch.SymbolRate = (int)(mapping.GetDword("offSymbolRate") / 1000); + if (mapping.GetDword("offServiceType") == 2) + { + ch.SignalSource |= SignalSource.Radio; + ch.ServiceTypeName = "Radio"; + } + else + { + ch.SignalSource |= SignalSource.Tv; + ch.ServiceTypeName = "TV"; + } + ch.AddDebug((byte)mapping.GetDword("offUnk1")); + ch.AddDebug((byte)mapping.GetDword("offUnk2")); } dvbStringDecoder.GetChannelNames(mapping.Data, mapping.BaseOffset + mapping.GetConst("offProvider", 0), mapping.GetConst("lenProvider", 0), out var provider, out _); @@ -457,6 +516,7 @@ namespace ChanSort.Loader.Philips { ch.Transponder = t; ch.FreqInMhz = t.FrequencyInMhz; + ch.Polarity = t.Polarity; ch.SymbolRate = t.SymbolRate; ch.SatPosition = t.Satellite?.OrbitalPosition; ch.Satellite = t.Satellite?.Name; @@ -502,7 +562,7 @@ namespace ChanSort.Loader.Philips var baseOffset = 8; for (int i = 0, curFav = firstFavIndex; i < favCount; i++) { - this.satChannels.Channels[curFav].SetOldPosition(1, i + 1); + this.dvbsChannels.Channels[curFav].SetOldPosition(1, i + 1); curFav = BitConverter.ToInt16(data, baseOffset + curFav * 4 + 2); } } @@ -530,7 +590,7 @@ namespace ChanSort.Loader.Philips using var conn = new SQLiteConnection($"Data Source={tvDb}"); conn.Open(); using var cmd = conn.CreateCommand(); - cmd.CommandText = "select _id, display_number, display_name, original_network_id, transport_stream_id, service_id from channels"; + cmd.CommandText = "select _id, display_number, display_name, original_network_id, transport_stream_id, service_id, service_type from channels"; var r = cmd.ExecuteReader(); while (r.Read()) { @@ -548,15 +608,28 @@ namespace ChanSort.Loader.Philips } if (ch.OldProgramNr != nr) - this.logMessages.AppendFormat($"channel with id {id}: prNum {ch.OldProgramNr} in bin file and {r.GetInt32(1)} in tv.db"); + this.logMessages.AppendLine($"channel with id {id}: prNum {ch.OldProgramNr} in bin file and {r.GetInt32(1)} in tv.db"); if (ch.Name != r.GetString(2)) - this.logMessages.AppendFormat($"channel with id {id}: Name {ch.Name} in bin file and {r.GetString(2)} in tv.db"); + this.logMessages.AppendLine($"channel with id {id}: Name {ch.Name} in bin file and {r.GetString(2)} in tv.db"); if (ch.OriginalNetworkId != r.GetInt32(3)) - this.logMessages.AppendFormat($"channel with id {id}: ONID {ch.OriginalNetworkId} in bin file and {r.GetInt32(3)} in tv.db"); + this.logMessages.AppendLine($"channel with id {id}: ONID {ch.OriginalNetworkId} in bin file and {r.GetInt32(3)} in tv.db"); if (ch.TransportStreamId != r.GetInt32(4)) - this.logMessages.AppendFormat($"channel with id {id}: TSID {ch.TransportStreamId} in bin file and {r.GetInt32(4)} in tv.db"); + this.logMessages.AppendLine($"channel with id {id}: TSID {ch.TransportStreamId} in bin file and {r.GetInt32(4)} in tv.db"); if (ch.ServiceId != r.GetInt32(5)) - this.logMessages.AppendFormat($"channel with id {id}: SID {ch.ServiceId} in bin file and {r.GetInt32(5)} in tv.db"); + this.logMessages.AppendLine($"channel with id {id}: SID {ch.ServiceId} in bin file and {r.GetInt32(5)} in tv.db"); + + var stype = r.GetString(6); + if (stype == "SERVICE_TYPE_AUDIO") + { + if ((ch.SignalSource & SignalSource.Radio) == 0) + this.logMessages.AppendLine($"channel with id {id}: service type TV in bin file and RADIO in tv.db"); + } + else // if (stype == "SERVICE_TYPE_AUDIO_VIDEO" || stype == "SERVICE_TYPE_OTHER") // Sky option channels are OTHER + { + if ((ch.SignalSource & SignalSource.Tv) == 0) + this.logMessages.AppendLine($"channel with id {id}: service type RADIO in bin file and TV in tv.db"); + } + } } #endregion @@ -582,6 +655,8 @@ namespace ChanSort.Loader.Philips conn.Open(); using var cmd = conn.CreateCommand(); cmd.CommandText = "select list_id, list_name from List"; + this.Features.SupportedFavorites = 0; + this.Features.SortedFavorites = true; using (var r = cmd.ExecuteReader()) { int i = 0; @@ -593,6 +668,14 @@ namespace ChanSort.Loader.Philips this.Features.SupportedFavorites |= (Favorites) (1 << i); i++; } + + for (; i < 8; i++) + { + this.favListIndexToId.Add(-i-1); + this.favListIdToIndex.Add(-i-1, i); + this.DataRoot.SetFavListCaption(i, "Fav " + (i+1)); + this.Features.SupportedFavorites |= (Favorites)(1 << i); + } } for (int listIndex = 0; listIndex < this.favListIndexToId.Count; listIndex++) @@ -640,15 +723,15 @@ namespace ChanSort.Loader.Philips SaveDvbCTChannels(this.dvbcChannels, Path.Combine(channellib, "CableDigSrvTable")); SaveDvbCTPresets(this.dvbcChannels, Path.Combine(channellib, "CablePresetTable")); - SaveDvbsChannels(Path.Combine(s2channellib, "service.dat")); + SaveDvbsChannels(this.dvbsChannels, Path.Combine(s2channellib, "service.dat")); SaveDvbsFavorites(Path.Combine(s2channellib, "favorite.dat")); SaveDvbsDbFileInfo(Path.Combine(s2channellib, "db_file_info.dat")); } else if (chanLstBin.VersionMajor >= 25 && chanLstBin.VersionMajor <= 45) { - SaveDvbCTChannels(this.dvbtChannels, Path.Combine(channellib, "TerrestrialDb.bin")); - SaveDvbCTChannels(this.dvbcChannels, Path.Combine(channellib, "CableDb.bin")); - SaveDvbsChannels(Path.Combine(s2channellib, "SatelliteDb.bin")); + SaveDvbCTChannels(this.antChannels, Path.Combine(channellib, "TerrestrialDb.bin")); + SaveDvbCTChannels(this.cabChannels, Path.Combine(channellib, "CableDb.bin")); + SaveDvbsChannels(this.satChannels, Path.Combine(s2channellib, "SatelliteDb.bin")); UpdateChannelMap45TvDb(); UpdateChannelMap45ListDb(); @@ -731,7 +814,7 @@ namespace ChanSort.Loader.Philips #endregion #region SaveDvbsChannels - private void SaveDvbsChannels(string path) + private void SaveDvbsChannels(ChannelList list, string path) { var orig = File.ReadAllBytes(path); @@ -766,8 +849,8 @@ namespace ChanSort.Loader.Philips // this way the linked next/prev list remains in-sync with the channel order int i = 0; var channels = chanLstBin.VersionMajor < 25 - ? this.satChannels.Channels.OrderBy(c => c.NewProgramNr <= 0 ? int.MaxValue : c.NewProgramNr).ThenBy(c => c.OldProgramNr) - : this.satChannels.Channels.OrderBy(c => c.RecordIndex); + ? list.Channels.OrderBy(c => c.NewProgramNr <= 0 ? int.MaxValue : c.NewProgramNr).ThenBy(c => c.OldProgramNr) + : list.Channels.OrderBy(c => c.RecordIndex); foreach (var ch in channels) { mapping.BaseOffset = baseOffset + i * recordSize; @@ -813,7 +896,7 @@ namespace ChanSort.Loader.Philips var recordSize = 4; var recordCount = (dataSize - 4) / recordSize; - var favList = this.satChannels.Channels.Where(c => c.FavIndex[0] != -1).OrderBy(c => c.FavIndex[0]).ToList(); + var favList = this.dvbsChannels.Channels.Where(c => c.FavIndex[0] != -1).OrderBy(c => c.FavIndex[0]).ToList(); var favCount = favList.Count; var firstFavIndex = favCount == 0 ? -1 : (int)favList[0].RecordIndex; data.SetInt16(4, firstFavIndex); @@ -917,7 +1000,26 @@ namespace ChanSort.Loader.Philips for (int favListIndex = 0; favListIndex < this.favListIndexToId.Count; favListIndex++) { var favListId = favListIndexToId[favListIndex]; - cmd.CommandText = $"delete from FavoriteChannels where fav_list_id={favListId}"; + string sqlInsertOrUpdateList; + if (favListId >= 0) + { + cmd.CommandText = $"delete from FavoriteChannels where fav_list_id={favListId}"; + cmd.ExecuteNonQuery(); + sqlInsertOrUpdateList = "update List set list_name=@name where list_id=@id"; + } + else + { + favListId = favListIndexToId.Count == 0 ? 1 : favListIndexToId.Max() + 1; + favListIndexToId[favListIndex] = favListId; + favListIdToIndex[favListId] = favListIndex; + sqlInsertOrUpdateList = "insert into List (list_id, list_name) values (@id,@name)"; + } + + cmd.CommandText = sqlInsertOrUpdateList; + cmd.Parameters.Add(new SQLiteParameter("@id", DbType.Int16)); + cmd.Parameters.Add(new SQLiteParameter("@name", DbType.String)); + cmd.Parameters["@id"].Value = favListId; + cmd.Parameters["@name"].Value = DataRoot.GetFavListCaption(favListIndex); cmd.ExecuteNonQuery(); cmd.CommandText = "insert into FavoriteChannels(fav_list_id, channel_id, rank) values (@listId,@channelId,@rank)"; @@ -941,6 +1043,11 @@ namespace ChanSort.Loader.Philips } } + // delete empty fav lists + cmd.Parameters.Clear(); + cmd.CommandText = "delete from List where list_id not in (select fav_list_id from FavoriteChannels)"; + cmd.ExecuteNonQuery(); + trans.Commit(); conn.Close(); } diff --git a/source/ChanSort.Loader.Philips/ChanLstBin.cs b/source/ChanSort.Loader.Philips/ChanLstBin.cs index 95d70d1..c28f270 100644 --- a/source/ChanSort.Loader.Philips/ChanLstBin.cs +++ b/source/ChanSort.Loader.Philips/ChanLstBin.cs @@ -36,6 +36,8 @@ namespace ChanSort.Loader.Philips private readonly Dictionary crcOffsetByRelPath = new Dictionary(); public uint VersionMinor { get; private set; } public uint VersionMajor { get; private set; } + public string ModelName { get; private set; } + private Action log; public void Load(string path, Action log) @@ -53,7 +55,14 @@ namespace ChanSort.Loader.Philips off += 14; var modelNameLen = BitConverter.ToInt32(content, off); - off += 4 + modelNameLen; + off += 4; + + if (modelNameLen >= 1) + this.ModelName = Encoding.ASCII.GetString(content, off, modelNameLen-1); + off += modelNameLen; + + log?.Invoke($"Philips TV model: {this.ModelName}\nFile format version: {VersionMajor}.{VersionMinor}\n\n"); + var baseDir = Path.GetDirectoryName(path) ?? ""; var relPath = "/channellib/"; while (off < content.Length) diff --git a/source/ChanSort.Loader.Philips/ChanSort.Loader.Philips.ini b/source/ChanSort.Loader.Philips/ChanSort.Loader.Philips.ini index 6b0c39a..cca2394 100644 --- a/source/ChanSort.Loader.Philips/ChanSort.Loader.Philips.ini +++ b/source/ChanSort.Loader.Philips/ChanSort.Loader.Philips.ini @@ -1,4 +1,4 @@ -# ChannelMap_11 format +# 1.x format [service.dat_entry] offPcrPid=0 @@ -51,13 +51,13 @@ offFreq=18 offId=0 offFreq=4 offProgNr=8 -offAnalogUid=12 +offIsDigital=12 offOnid=16 offTsid=20 offSid=24 offSymbolRate=28 offLogoNr=32 -offScrambleStat=36 +offEncrypted=36 offLocked=40 offModulateion=44 offServiceType=52 @@ -69,13 +69,13 @@ lenName=64 offId=0 offFreq=4 offProgNr=8 -offAnalogUid=12 +offIsDigital=12 offOnid=16 offTsid=20 offSid=24 offSymbolRate=28 offLogoNr=32 -offScrambleStat=36 +offEncrypted=36 offLocked=40 offModulateion=44 offServiceType=52 @@ -85,3 +85,6 @@ offName=80 lenName=64 offSatName=146 lenSatName=64 +offUnk1=48 +offUnk2=68 +offPolarity=72 diff --git a/source/ChanSort/MainForm.cs b/source/ChanSort/MainForm.cs index 9a15266..54ba1d1 100644 --- a/source/ChanSort/MainForm.cs +++ b/source/ChanSort/MainForm.cs @@ -882,6 +882,8 @@ namespace ChanSort.Ui var wasRenumbered = false; foreach (var list in this.DataRoot.ChannelLists) { + if (list.IsMixedSourceFavoritesList) + continue; var chNr = 1; foreach (var channel in list.Channels.OrderBy(c => c.NewProgramNr)) { diff --git a/source/Information/FileStructures_for_HHD_Hex_Editor_Neo/philips_SatelliteDb-bin.h b/source/Information/FileStructures_for_HHD_Hex_Editor_Neo/philips_SatelliteDb-bin.h index d49b4ba..7953184 100644 --- a/source/Information/FileStructures_for_HHD_Hex_Editor_Neo/philips_SatelliteDb-bin.h +++ b/source/Information/FileStructures_for_HHD_Hex_Editor_Neo/philips_SatelliteDb-bin.h @@ -15,13 +15,13 @@ public struct Ph_ChannelMap45_CableDbBin dword id; dword freq; dword number; - dword analogUid; + dword isDigital; dword onid; dword tsid; dword sid; dword symRate; dword logoNr; - dword scrambleStat; + dword isEncrypted; dword locked; dword modulation; dword unk1; @@ -52,13 +52,13 @@ public struct Ph_ChannelMap45_SatelliteDbBin dword id; dword freq; dword number; - dword analogUid; + dword isDigital; dword onid; dword tsid; dword sid; dword symRate; dword logoNr; - dword scrambleStat; + dword isEncrypted; dword locked; dword modulation; dword unk1; @@ -67,7 +67,7 @@ public struct Ph_ChannelMap45_SatelliteDbBin dword isUserModifiedLogo; dword serviceEdit; dword streamPriorityMaybe; - dword unk2; + dword polarity; word unk3TransponderRelated; word unk4TransponderRelated; wchar_t name[32+1]; diff --git a/source/changelog.md b/source/changelog.md index 7d038d3..8d33ec1 100644 --- a/source/changelog.md +++ b/source/changelog.md @@ -1,6 +1,15 @@ ChanSort Change Log =================== +2021-02-08 +- Philips: lists with a chanLst.bin file show information about file format version and TV model under File / Information +- Philips ChannelMap_45: fixed handling of favorite lists (allow up to 8 lists, empty ones get removed automatically) +- Philips ChannelMap_45: no longer prompting to reorder channels sequentially (to close gaps). + (This feature caused DVB-C/T list to only contain odd numbers and DVB-S to contain only even numbers, when both exist) +- Philips ChannelMap_45: added display for service type (TV/radio), encryption, sat frequency polarity +- Philips ChannelMap_45: fixed display of DVB-C/T frequency +- Philips Repair\chanLst.bin (1.x): fixed sat frequency display for transponders with vertical polarity + 2021-02-05 - Philips ChannelMap_100 and later: keeping original indentation in XML files and original number of bytes for hex-encoded Unicode names (channel name, fav list names)