- File / "File information" now shows information for all TV models
- Disabled "TV-Set" menu items which are not applicable
- Fixed DVB-S transponder/frequency information for LG LN and LA61xx series
- Fixed deleting channels in Samsung B-series Digital Air/Cable lists
- Fixed encryption information in Samsung B-series Digital Air/Cable lists
- Fixed loading of reference lists with non-unique channel identifiers
- Fixed error when saving LG files for models LD-LK after applying a
  reference list which contains channels not present in the TLL file
This commit is contained in:
hbeham
2013-11-09 16:30:59 +01:00
parent df59285d07
commit 0b4820433f
15 changed files with 3705 additions and 3621 deletions

View File

@@ -7,7 +7,6 @@ namespace ChanSort.Api
public class SupportedFeatures
{
public bool ChannelNameEdit { get; set; }
public bool FileInformation { get; set; }
public bool CleanUpChannelData { get; set; }
public bool DeviceSettings { get; set; }
}
@@ -38,7 +37,36 @@ namespace ChanSort.Api
public virtual void EraseChannelData() { }
public virtual string GetFileInformation() { return ""; }
public virtual string GetFileInformation()
{
StringBuilder sb = new StringBuilder();
sb.Append("File name: ").AppendLine(this.FileName);
sb.AppendLine();
foreach (var list in this.DataRoot.ChannelLists)
{
sb.Append(list.ShortCaption).AppendLine("-----");
sb.Append("number of channels: ").AppendLine(list.Count.ToString());
sb.Append("number of duplicate program numbers: ").AppendLine(list.DuplicateProgNrCount.ToString());
sb.Append("number of duplicate channel identifiers: ").AppendLine(list.DuplicateUidCount.ToString());
int deleted = 0;
int hidden = 0;
int skipped = 0;
foreach (var channel in list.Channels)
{
if (channel.IsDeleted)
++deleted;
if (channel.Hidden)
++hidden;
if (channel.Skip)
++skipped;
}
sb.Append("number of deleted channels: ").AppendLine(deleted.ToString());
sb.Append("number of hidden channels: ").AppendLine(hidden.ToString());
sb.Append("number of skipped channels: ").AppendLine(skipped.ToString());
sb.AppendLine();
}
return sb.ToString();
}
public virtual void ShowDeviceSettingsForm(object parentWindow) { }

View File

@@ -63,8 +63,8 @@ namespace ChanSort.Api
{
others = new List<ChannelInfo>();
this.channelByUid.Add(ci.Uid, others);
others.Add(ci);
}
others.Add(ci);
string warning2 = null;
bool isDupeProgNr = false;

View File

@@ -118,22 +118,22 @@ namespace ChanSort.Api
#region GetFlag
public bool GetFlag(string key)
public bool GetFlag(string key, bool defaultValue = false)
{
return GetFlag("off" + key, "mask" + key);
return GetFlag("off" + key, "mask" + key, defaultValue);
}
public bool GetFlag(string valueKey, string maskKey)
public bool GetFlag(string valueKey, string maskKey, bool defaultValue = false)
{
int mask = settings.GetInt(maskKey);
return GetFlag(valueKey, mask);
return GetFlag(valueKey, mask, defaultValue);
}
public bool GetFlag(string valueKey, int mask)
public bool GetFlag(string valueKey, int mask, bool defaultValue = false)
{
if (mask == 0) return false;
if (mask == 0) return defaultValue;
var offsets = settings.GetIntList(valueKey);
if (offsets.Length == 0) return false;
if (offsets.Length == 0) return defaultValue;
return (this.data[baseOffset + offsets[0]] & mask) == mask;
}
#endregion

View File

@@ -417,7 +417,7 @@
offSatIndex = 38
[TransponderDataMapping:44]
; LN
; LN, LA6136
offFirstChannelIndex = 0
offLastChannelIndex = 2
offChannelCount = 4
@@ -503,11 +503,11 @@
[SatChannelDataMapping:76]
; LN series
; LN series, LA6136
lenName = 40
offSatelliteNr = 0
offSourceType = 4
offTransponderIndex = 6, 12
offTransponderIndex = 5, 12
offProgramNr = 8
offProgramNrPreset = 10
offFavorites2 = 14
@@ -535,7 +535,7 @@
lenName = 40
offSatelliteNr = 0
offSourceType = 4
offTransponderIndex = 6, 12
offTransponderIndex = 5, 12
offProgramNr = 8
offProgramNrPreset = 10
offFavorites2 = 16

View File

@@ -77,7 +77,6 @@ namespace ChanSort.Loader.LG
public TllFileSerializer(string inputFile) : base(inputFile)
{
this.Features.ChannelNameEdit = true;
this.Features.FileInformation = true;
this.Features.DeviceSettings = true;
this.Features.CleanUpChannelData = true;
this.SupportedTvCountryCodes = new List<string>
@@ -982,7 +981,7 @@ namespace ChanSort.Loader.LG
int slot = 0;
foreach (ChannelInfo appChannel in sortedList)
{
if (appChannel.NewProgramNr <= 0 && removeDeletedActChannels)
if (appChannel.RecordIndex < 0 || appChannel.NewProgramNr <= 0 && removeDeletedActChannels)
continue;
if (appChannel.RecordIndex != slot)
{

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Data;
using System.Data.SQLite;
using System.IO;
using System.Text;
using System.Windows.Forms;
using ChanSort.Api;
@@ -24,6 +25,7 @@ namespace ChanSort.Loader.Panasonic
private byte[] fileHeader = new byte[0];
private int dbSizeOffset;
private bool littleEndianByteOrder = false;
private string charEncoding;
enum CypherMode
{
@@ -329,6 +331,7 @@ namespace ChanSort.Loader.Panasonic
using (var conn = new SQLiteConnection(channelConnString))
{
conn.Open();
InitCharacterEncoding(conn);
using (var cmd = conn.CreateCommand())
{
this.ReadChannels(cmd);
@@ -477,6 +480,17 @@ namespace ChanSort.Loader.Panasonic
}
#endregion
#region InitCharacterEncoding()
private void InitCharacterEncoding(SQLiteConnection conn)
{
using (var cmd = conn.CreateCommand())
{
cmd.CommandText = "PRAGMA encoding";
this.charEncoding = cmd.ExecuteScalar() as string;
}
}
#endregion
#region ReadChannels()
private void ReadChannels(SQLiteCommand cmd)
{
@@ -639,5 +653,25 @@ order by s.ntype,major_channel
data[data.Length - 4] = (byte)((checksum >> 24) & 0xFF);
}
#endregion
public override string GetFileInformation()
{
StringBuilder sb = new StringBuilder();
sb.Append(base.GetFileInformation());
sb.Append("Content type: ");
switch (this.GetCypherMode(this.FileName))
{
case CypherMode.None: sb.AppendLine("unencrypted SQLite database"); break;
case CypherMode.Encryption: sb.AppendLine("encrypted SQLite database"); break;
case CypherMode.HeaderAndChecksum:
sb.AppendLine("embedded SQLite database");
sb.Append("Byte order: ").AppendLine(this.littleEndianByteOrder ?
"little-endian (least significant byte first)" : "big-endian (most significant byte first)");
break;
}
sb.Append("Character encoding: ").AppendLine(this.charEncoding);
return sb.ToString();
}
}
}

View File

@@ -126,24 +126,25 @@
offProgramNr = 0
offVideoPid = 2
offPcrPid = 4
offServiceId = 10
offDeleted = 7
maskDeleted = 0x20
offFavOld = 6
offQam = 7
offInUse = 8
maskInUse = 0x80
offServiceType = 9
offEncrypted = 23
maskEncrypted = 0x01
offSymbolRate = 32
offLock = 244
maskLock = 0x01
offServiceId = 10
offOriginalNetworkId = 12
offNetworkId = 14
offBouquet = 34
offEncrypted = 23
maskEncrypted = 0x20
offChannelTransponder = 26
offLogicalProgramNr = 28
offSymbolRate = 32
offBouqet = 34
offTransportStreamId = 36
offName = 44
lenName = 100
offLock = 245
maskLock = 0x01
offFavorites = 246
offChecksum = 247

View File

@@ -48,7 +48,7 @@ namespace ChanSort.Loader.Samsung
#region InitCommonData()
protected void InitCommonData(int slot, SignalSource signalSource, DataMapping data)
{
this.InUse = data.GetFlag(_InUse);
this.InUse = data.GetFlag(_InUse, true);
this.RecordIndex = slot;
this.RecordOrder = slot;
this.SignalSource = signalSource;
@@ -58,8 +58,6 @@ namespace ChanSort.Loader.Samsung
this.Lock = data.GetFlag(_Lock);
this.Encrypted = data.GetFlag(_Encrypted);
this.IsDeleted = data.GetFlag(_Deleted);
if (this.IsDeleted)
this.OldProgramNr = -1;
}
#endregion

View File

@@ -117,8 +117,8 @@ namespace ChanSort.Loader.Samsung
#region DetectModelConstants()
private void DetectModelConstants(ZipFile zip)
{
if (DetectModelFromCloneInfoFile(zip)) return;
if (DetectModelFromFileName()) return;
if (DetectModelFromCloneInfoFile(zip)) return;
if (DetectModelFromContentFileLengths(zip)) return;
throw new FileLoadException("Unable to determine TV model from file content or name");
}
@@ -129,11 +129,20 @@ namespace ChanSort.Loader.Samsung
{
string file = Path.GetFileName(this.FileName)??"";
System.Text.RegularExpressions.Regex regex =
new System.Text.RegularExpressions.Regex("channel_list_(?:[A-Z]{2}[0-9]{2}|BD-)([A-Z])[0-9A-Z]+_[0-9]{4}.*\\.scm");
new System.Text.RegularExpressions.Regex("channel_list_([A-Z]{2}[0-9]{2}|BD-)([A-Z])[0-9A-Z]+_([0-9]{4}).*\\.scm");
var match = regex.Match(file);
if (match.Success)
{
string series = match.Groups[1].Value;
string series;
switch (match.Groups[3].Value)
{
case "1001": series = "C"; break;
case "1101": series = "D"; break;
case "1201": series = "E"; break;
default:
series = match.Groups[1].Value.StartsWith("LT") ? "F" : match.Groups[2].Value;
break;
}
if (this.modelConstants.TryGetValue("Series:" + series, out this.c))
return true;
}
@@ -154,6 +163,8 @@ namespace ChanSort.Loader.Samsung
if (cloneInfo.Length >= 9)
{
char series = (char) cloneInfo[8];
if (series == 'B') // 2013 B-series uses E/F-series format
series = 'F';
if (this.modelConstants.TryGetValue("Series:" + series, out this.c))
return true;
}
@@ -173,7 +184,7 @@ namespace ChanSort.Loader.Samsung
DetectModelFromAstraHdPlusD(zip)
};
// note: E and F series use an identical format, so we only care about E here
// note: E, F and B(2013) series use an identical format, so we only care about E here
string validCandidates = "BCDE";
foreach (var candidateList in candidates)
{
@@ -390,7 +401,7 @@ namespace ChanSort.Loader.Samsung
for (int slotIndex = 0; slotIndex < count; slotIndex++)
{
DigitalChannel ci = new DigitalChannel(slotIndex, isCable, rawChannel, frequency, c.SortedFavorites);
if (ci.OldProgramNr > 0)
if (ci.InUse && !ci.IsDeleted)
this.DataRoot.AddChannel(list, ci);
rawChannel.BaseOffset += entrySize;
@@ -583,13 +594,6 @@ namespace ChanSort.Loader.Samsung
}
#endregion
public override void ShowDeviceSettingsForm(object parentWindow)
{
MessageBox.Show((Form) parentWindow, "Sorry, ChanSort currently doesn't support any settings for your TV model.",
"Device Settings",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
// ------- testing -----------
internal string Series { get { return c.series; } }

View File

@@ -25,7 +25,7 @@ namespace ChanSort.Ui
{
public partial class MainForm : XtraForm
{
public const string AppVersion = "v2013-10-07";
public const string AppVersion = "v2013-11-09";
private const int MaxMruEntries = 5;
@@ -1299,9 +1299,8 @@ namespace ChanSort.Ui
&& channel.GetPosition(this.subListIndex) > this.currentChannelList.FirstProgramNumber;
this.miMoveDown.Enabled = this.btnDown.Enabled = mayEdit && isLeftGridSortedByNewProgNr;
this.miTvSettings.Enabled = this.currentTvSerializer != null;
this.miCleanupChannels.Visibility = this.currentTvSerializer != null &&
this.currentTvSerializer.Features.CleanUpChannelData ? BarItemVisibility.Always : BarItemVisibility.Never;
this.miTvSettings.Enabled = this.currentTvSerializer != null && this.currentTvSerializer.Features.DeviceSettings;
this.miCleanupChannels.Enabled = this.currentTvSerializer != null && this.currentTvSerializer.Features.CleanUpChannelData;
this.txtSetSlot.Enabled = mayEdit;
}

View File

@@ -5,7 +5,7 @@ struct SCM_mapDigital_B_entry
word ProgramNr;
word VideoPid;
word PcrPid;
byte u6;
byte Fav1;
byte Qam;
byte Status;
byte ServiceType;
@@ -24,7 +24,8 @@ struct SCM_mapDigital_B_entry
word TransportStreamId;
byte u38[6];
uc16be Name[50];
byte u144[102];
byte u144[101];
byte Lock;
byte Favorites;
byte Checksum;
};

View File

@@ -214,8 +214,8 @@ struct LN224_SatChannel
word LnbConfigIndex;
word u2;
byte SourceType;
byte u3;
word TP_Number;
byte u3;
word CH_Number;
word CH_NumberFixed;
word TP_Number2;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,14 @@
Version v2013-10-07 ======================================================
Version v2013-11-09 =======================================================
Changes:
- Added support for Samsung "FreesatD" channel lists
- Added support for LG LP-series sat channel lists (DVB-C/T not supported)
- Added columns for "skip" and "hide" channel flags to left list
- skipped/hidden channels are now display with blue/light grey color
- LG hotel-mode/DTV-update settings editable for all supported LG models
- File / "File information" now shows information for all TV models
- Disabled "TV-Set" menu items which are not applicable
- Fixed DVB-S transponder/frequency information for LG LN and LA61xx series
- Fixed deleting channels in Samsung B-series Digital Air/Cable lists
- Fixed encryption information in Samsung B-series Digital Air/Cable lists
- Fixed loading of reference lists with non-unique channel identifiers
- Fixed error when saving LG files for models LD-LK after applying a
reference list which contains channels not present in the TLL file
The complete change log can be found at the end of this document
@@ -29,15 +32,22 @@ http://sourceforge.net/p/chansort/discussion/ or by contacting me by email:
mailto:horst@beham.biz
! USE AT YOUR OWN RISK !
------------------------
This software was written without access to official documentation about
the file formats involved. Without full knowledge about the specifics of a
format there is a chance of unwanted side-effects or damage to your TV.
Supported TV models =======================================================
Samsung
-------
Series: B*, C, D, E, F
Series: B (2009)*, B (2013), C, D, E, F
Lists: Air analog, Air digital, Cable analog, Cable digital,
Cable prime, Sat digital, Astra HD+, Freesat digital
* NOTE: the "Air Analog"-list of the B-series doesn't support all
* NOTE: the "Air Analog"-list of the 2009 B-series doesn't support all
editing features due to a lack of test files. If you have such a file,
please send it to me.
@@ -73,17 +83,10 @@ Toshiba
(e.g. RL, SL, TL, UL, VL, WL, XL, YL models of series 8xx/9xx)
! USE AT YOUR OWN RISK !
------------------------
This software was written without access to official documentation about
the file formats involved. Without full knowledge about the specifics of a
format there is a chance of unwanted side-effects or damage to your TV.
System requirements =======================================================
- Microsoft .NET Framework 4.0 (included in Win8, can be installed manually
on Windows 7, Windows Vista, Windows XP SP3):
- Microsoft .NET Framework 4.0 (Full): included in Win8, can be installed
manually on Windows 7, Windows Vista and Windows XP SP3
http://www.microsoft.com/en-us/download/details.aspx?id=17851
- Microsoft Visual C++ 2010 Redistributable Package (x86)
Required to edit Panasonic and Toshiba channel lists (through SQLite)
@@ -105,6 +108,7 @@ Source code available on http://sourceforge.net/projects/chansort/
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
@@ -113,6 +117,22 @@ OTHER DEALINGS IN THE SOFTWARE.
Change log ================================================================
2013-11-09
- File / "File information" now shows information for all TV models
- Disabled "TV-Set" menu items which are not applicable
- Fixed DVB-S transponder/frequency information for LG LN and LA61xx series
- Fixed deleting channels in Samsung B-series Digital Air/Cable lists
- Fixed encryption information in Samsung B-series Digital Air/Cable lists
- Fixed loading of reference lists with non-unique channel identifiers
- Fixed error when saving LG files for models LD-LK after applying a
reference list which contains channels not present in the TLL file
2013-10-23
- Support for Samsung's Monitor/TV 3-series (LTxxy3)
2013-10-22
- Support for Samsung's 2013 B-Series
2013-10-07
- Added support for Samsung "FreesatD" channel lists
- Added support for LG LP-series sat channel lists (DVB-C/T not supported)