- Samsung .scm: added support for Skip + Hidden flags for D-H series DVB-T/C

- negative mask values in a .ini file now invert the value of the flag (clear instead of set and v.v.)
This commit is contained in:
hbeham
2017-10-29 15:45:35 +01:00
parent 1f92149c88
commit 5e81167b3d
7 changed files with 47 additions and 10 deletions

View File

@@ -132,9 +132,17 @@ namespace ChanSort.Api
public bool GetFlag(string valueKey, int mask, bool defaultValue = false)
{
if (mask == 0) return defaultValue;
bool reverseLogic = false;
if (mask < 0)
{
reverseLogic = true;
mask = -mask;
}
var offsets = settings.GetIntList(valueKey);
if (offsets.Length == 0) return defaultValue;
return (this.data[baseOffset + offsets[0]] & mask) == mask;
bool isSet = (this.data[baseOffset + offsets[0]] & mask) == mask;
return isSet != reverseLogic;
}
#endregion
@@ -153,10 +161,16 @@ namespace ChanSort.Api
public void SetFlag(string valueKey, int mask, bool value)
{
if (mask == 0) return;
bool reverseLogic = false;
if (mask < 0)
{
reverseLogic = true;
mask = -mask;
}
var offsets = settings.GetIntList(valueKey);
foreach (var offset in offsets)
{
if (value)
if (value != reverseLogic)
this.data[baseOffset + offset] |= (byte)mask;
else
this.data[baseOffset + offset] &= (byte)~mask;

View File

@@ -93,9 +93,12 @@ namespace ChanSort.Api
#region ParseNumber()
private int ParseNumber(string value)
{
int sig = value.StartsWith("-") ? -1 : 1;
if (sig < 0)
value = value.Substring(1).Trim();
if (value.ToLower().StartsWith("0x"))
{
try { return Convert.ToInt32(value, 16); }
try { return Convert.ToInt32(value, 16) * sig; }
catch { return 0; }
}
int intValue;

View File

@@ -165,6 +165,8 @@
maskDeleted = 0x01
offSignalSource = 10
offQam = 12
offSkip = 13
maskSkip = 0x01
offBandwidth = 14
offServiceType = 15
offCodec = 16
@@ -172,7 +174,8 @@
offVRes = 22
offEncrypted = 24
maskEncrypted = 0x01
offFrameRate = 25
offHidden = 25
maskHidden = 0x01
offSymbolRate = 28
offLock = 31
maskLock = 0x01
@@ -201,6 +204,8 @@
maskDeleted = 0x01
offSignalSource = 10
offQam = 12
offSkip = 13
maskSkip = 0x01
offBandwidth = 14
offServiceType = 15
offCodec = 16
@@ -208,7 +213,8 @@
offVRes = 22
offEncrypted = 24
maskEncrypted = 0x01
offFrameRate = 25
offHidden = 25
maskHidden = 0x01
offSymbolRate = 28
offLock = 31
maskLock = 0x01

View File

@@ -21,6 +21,8 @@ namespace ChanSort.Loader.Samsung
private const string _Checksum = "offChecksum";
// DVB
private const string _Skip = "Skip";
private const string _Hidden = "Hidden";
private const string _ServiceId = "offServiceId";
private const string _VideoPid = "offVideoPid";
private const string _AudioPid = "offAudioPid";
@@ -59,6 +61,8 @@ namespace ChanSort.Loader.Samsung
this.Name = data.GetString(_Name, data.Settings.GetInt("lenName"));
this.Favorites = this.ParseRawFavorites();
this.Lock = data.GetFlag(_Lock);
this.Hidden = data.GetFlag(_Hidden);
this.Skip = data.GetFlag(_Skip);
this.Encrypted = data.GetFlag(_Encrypted);
this.IsDeleted = data.GetFlag(_Deleted, false) || !data.GetFlag(_IsActive, true);
if (this.IsDeleted)
@@ -144,6 +148,8 @@ namespace ChanSort.Loader.Samsung
mapping.SetFlag(_Lock, this.Lock);
mapping.SetFlag(_Deleted, this.NewProgramNr < 0);
mapping.SetFlag(_IsActive, this.NewProgramNr >= 0);
mapping.SetFlag(_Skip, this.Skip);
mapping.SetFlag(_Hidden, this.Hidden);
if (this.Encrypted != null)
mapping.SetFlag(_Encrypted, this.Encrypted.Value);
this.UpdateChecksum();

View File

@@ -3,7 +3,6 @@ using System.IO;
using System.Reflection;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ChanSort.Api;
using ICSharpCode.SharpZipLib.Zip;

View File

@@ -44,7 +44,7 @@ struct SCM_mapDigital_C_entry
word ServiceId;
byte Unknown8[4];
byte Qam;
byte Unknown13;
byte Skip;
byte Bandwidth;
byte ServiceType;
byte Codec;
@@ -52,7 +52,7 @@ struct SCM_mapDigital_C_entry
word HRes;
word VRes;
byte Encrypted;
byte FrameRate;
byte Hidden;
byte Unknown26[2];
word SymbolRate;
byte Unknown30;
@@ -93,7 +93,7 @@ struct SCM_mapDigital_DEF_entry
byte SignalSource;
byte SignalType;
byte Qam;
byte Unknown13;
byte Skip;
byte BandwidthIs8MHz;
byte ServiceType;
byte Codec;
@@ -101,7 +101,7 @@ struct SCM_mapDigital_DEF_entry
word HRes;
word VRes;
byte Encrypted;
byte FrameRate;
byte Hidden;
byte Unknown26[2];
word SymbolRate;
byte Unknown30;

View File

@@ -1,6 +1,15 @@
ChanSort Change Log
===================
2017-10-29
- Show popup with download link for MS Visual C++ 2010 x86 Redist
(this package is needed to open lists with a SQLite file format)
- Show diagnostic information when no plugin was able to load a file
- Samsung .zip: improved detection of transponder data
- Samsung .scm: user defined transponders now have priority
- Samsung .scm: DVB-T and DVB-C lists now support Skip and Hide flags
(DVB-S lists still don't)
2017-06-08
- added experimental support for Loewe / Hisense 2017 servicelist.db
file format