- new: applying channel names from .csv reference lists to current channel list

- fixed: samsung channel data wasn't updated anymore after the file was saved the 1st time
- fixed: deleted channels for samsung B series
- fixed: samsung channel name length reduced to 50char/100byte
This commit is contained in:
hbeham
2013-11-16 21:00:51 +01:00
parent 8ce26520ac
commit dfd44c1950
11 changed files with 112 additions and 52 deletions

View File

@@ -82,6 +82,7 @@ namespace ChanSort.Api
if (!this.addChannels)
{
channel.NewProgramNr = programNr;
channel.Name = name;
if (parts.Count >= 7)
ApplyFlags(channel, parts[6]);
}

View File

@@ -126,7 +126,9 @@
offProgramNr = 0
offVideoPid = 2
offPcrPid = 4
offFavOld = 6
; "Deleted"-flag is implemented in reverse by IsActive
offIsActive = 6
maskIsActive = 0x02
offQam = 7
offInUse = 8
maskInUse = 0x80
@@ -175,7 +177,7 @@
offLogicalProgramNr = 44
offTransportStreamId = 48
offName = 64
lenName = 200
lenName = 100
offShortName = 264
lenShortName = 18
offVideoFormat = 282
@@ -210,7 +212,7 @@
offLogicalProgramNr = 44
offTransportStreamId = 48
offName = 64
lenName = 200
lenName = 100
offShortName = 264
lenShortName = 18
offVideoFormat = 282

View File

@@ -19,7 +19,9 @@ namespace ChanSort.Loader.Samsung
Transponder transponder = dataRoot.Transponder.TryGet(transponderIndex);
if (transponder == null)
{
dataRoot.Warnings.AppendLine("Invalid transponder index: " + transponderIndex);
var list = dataRoot.GetChannelList(this.SignalSource|SignalSource.Tv);
dataRoot.Warnings.AppendFormat("{0} channel record #{1} (Pr# {2} \"{3}\") contains invalid transponder index {4}\r\n",
list.ShortCaption, slot, this.OldProgramNr, this.Name, transponderIndex);
return;
}

View File

@@ -13,6 +13,7 @@ namespace ChanSort.Loader.Samsung
private const string _NameLength = "offNameLength";
private const string _ShortName = "offShortName";
private const string _Favorites = "offFavorites";
private const string _IsActive = "IsActive";
private const string _Deleted = "Deleted";
private const string _Encrypted = "Encrypted";
private const string _Lock = "Lock";
@@ -57,7 +58,7 @@ namespace ChanSort.Loader.Samsung
this.Favorites = this.ParseRawFavorites();
this.Lock = data.GetFlag(_Lock);
this.Encrypted = data.GetFlag(_Encrypted);
this.IsDeleted = data.GetFlag(_Deleted);
this.IsDeleted = data.GetFlag(_Deleted, false) || !data.GetFlag(_IsActive, true);
if (this.IsDeleted)
this.OldProgramNr = -1;
}
@@ -123,11 +124,19 @@ namespace ChanSort.Loader.Samsung
this.UpdateRawFavorites();
mapping.SetFlag(_Lock, this.Lock);
mapping.SetFlag(_Deleted, this.NewProgramNr < 0);
mapping.SetFlag(_IsActive, this.NewProgramNr >= 0);
this.UpdateChecksum();
}
#endregion
#region EraseRawData()
internal virtual void EraseRawData()
{
int len = this.mapping.Settings.GetInt("offChecksum") + 1;
Tools.MemSet(this.rawData, this.baseOffset, 0, len);
}
#endregion
#region UpdateRawFavorites()
private void UpdateRawFavorites()
{
@@ -146,9 +155,9 @@ namespace ChanSort.Loader.Samsung
{
int favValue;
if (this.sortedFavorites)
favValue = (fav & mask) != 0 ? this.FavIndex[favIndex] : -1;
favValue = (fav & mask) != 0 ? this.FavIndex[favIndex] : -1; // E,F series
else
favValue = (fav & mask) != 0 ? 1 : 0;
favValue = (fav & mask) != 0 ? 1 : 0; // D series
Array.Copy(BitConverter.GetBytes(favValue), 0, this.rawData, baseOffset + off, 4);
mask <<= 1;
++favIndex;

View File

@@ -2,7 +2,7 @@
using System.IO;
using System.Reflection;
using System.Linq;
using System.Windows.Forms;
using System.Text;
using ChanSort.Api;
using ICSharpCode.SharpZipLib.Zip;
@@ -48,6 +48,7 @@ namespace ChanSort.Loader.Samsung
{
this.ReadConfigurationFromIniFile();
this.Features.ChannelNameEdit = true;
this.Features.CleanUpChannelData = true;
}
#endregion
@@ -546,21 +547,21 @@ namespace ChanSort.Loader.Samsung
using (ZipFile zip = new ZipFile(tvOutputFile))
{
zip.BeginUpdate();
this.SaveChannels(zip, "map-AirA", this.avbtChannels, ref this.avbtFileContent);
this.SaveChannels(zip, "map-CableA", this.avbcChannels, ref this.avbcFileContent);
this.SaveChannels(zip, "map-AirD", this.dvbtChannels, ref this.dvbtFileContent);
this.SaveChannels(zip, "map-CableD", this.dvbcChannels, ref this.dvbcFileContent);
this.SaveChannels(zip, "map-SateD", this.dvbsChannels, ref this.dvbsFileContent);
this.SaveChannels(zip, "map-AstraHDPlusD", this.hdplusChannels, ref this.hdplusFileContent);
this.SaveChannels(zip, "map-CablePrime_D", this.primeChannels, ref this.primeFileContent);
this.SaveChannels(zip, "map-FreesatD", this.freesatChannels, ref this.freesatFileContent);
this.SaveChannels(zip, "map-AirA", this.avbtChannels, this.avbtFileContent);
this.SaveChannels(zip, "map-CableA", this.avbcChannels, this.avbcFileContent);
this.SaveChannels(zip, "map-AirD", this.dvbtChannels, this.dvbtFileContent);
this.SaveChannels(zip, "map-CableD", this.dvbcChannels, this.dvbcFileContent);
this.SaveChannels(zip, "map-SateD", this.dvbsChannels, this.dvbsFileContent);
this.SaveChannels(zip, "map-AstraHDPlusD", this.hdplusChannels, this.hdplusFileContent);
this.SaveChannels(zip, "map-CablePrime_D", this.primeChannels, this.primeFileContent);
this.SaveChannels(zip, "map-FreesatD", this.freesatChannels, this.freesatFileContent);
zip.CommitUpdate();
}
}
#endregion
#region SaveChannels()
private void SaveChannels(ZipFile zip, string fileName, ChannelList channels, ref byte[] fileContent)
private void SaveChannels(ZipFile zip, string fileName, ChannelList channels, byte[] fileContent)
{
if (fileContent == null)
return;
@@ -570,11 +571,6 @@ namespace ChanSort.Loader.Samsung
using (var stream = new FileStream(tempFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite))
{
this.WriteChannels(channels, fileContent, stream);
stream.Flush();
stream.Seek(0, SeekOrigin.Begin);
int size = (int)new FileInfo(tempFilePath).Length;
fileContent = new byte[size];
stream.Read(fileContent, 0, size);
}
zip.Add(tempFilePath, fileName);
@@ -594,6 +590,46 @@ namespace ChanSort.Loader.Samsung
}
#endregion
// -------- cleanup --------
#region CleanUpChannelData()
public override string CleanUpChannelData()
{
StringBuilder log = new StringBuilder();
RemoveChannelsWithServiceType0(log);
RemoveDuplicateAnalogList(log);
return log.ToString();
}
private void RemoveChannelsWithServiceType0(StringBuilder log)
{
foreach (var list in this.DataRoot.ChannelLists)
{
if ((list.SignalSource & SignalSource.Digital) == 0)
continue;
var listOfChannels = new List<ChannelInfo>(list.Channels);
foreach (ScmChannelBase channel in listOfChannels)
{
if (channel.ServiceType == 0)
{
channel.EraseRawData();
list.Channels.Remove(channel);
log.AppendFormat("{0} channel at index {1} (Pr# {2} \"{3}\") was erased due to invalid service type 0\r\n",
list.ShortCaption, channel.RecordIndex, channel.OldProgramNr, channel.Name);
}
}
}
}
private void RemoveDuplicateAnalogList(StringBuilder log)
{
if (this.avbtChannels.Count == 0 || this.avbcChannels.Count == 0)
return;
// TODO
}
#endregion
// ------- 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-11-09";
public const string AppVersion = "v2013-11-16";
private const int MaxMruEntries = 5;
@@ -1884,6 +1884,9 @@ namespace ChanSort.Ui
#region gridLeft_DragOver
private void gridLeft_DragOver(object sender, DragEventArgs e)
{
if (this.dragDropInfo == null) // drag operation from outside ChanSort
return;
// this event is called on the current target of the drag operation
var point = this.gridLeft.PointToClient(MousePosition);
var hit = this.gviewLeft.CalcHitInfo(point);

View File

@@ -199,12 +199,7 @@ namespace ChanSort.Ui.Properties {
}
/// <summary>
/// Looks up a localized string similar to The verification of the file content showed some anomalies. Possible causes are:
///- The TV itself created a mess in the channel lists (which happens frequently).
///- The file format is partially unknown (e.g. unknown TV model or firmware).
///- The file has been edited with a broken program version.
///- ChanSort&apos;s validation rules are based on wrong assumptions.
///You can continue editing, but it is possibile that your TV will reject the changes..
/// Looks up a localized string similar to The file content shows some anomalies and is possibly corrupt..
/// </summary>
internal static string MainForm_LoadFiles_ValidationWarningMsg {
get {

View File

@@ -161,12 +161,7 @@
<value>Datenüberprüfung</value>
</data>
<data name="MainForm_LoadFiles_ValidationWarningMsg" xml:space="preserve">
<value>Die Überprüfung des Dateiinhalts fand einige Auffälligkeiten. Mögliche Ursachen sind:
- Der Fernseher hat seine Senderlisten versaut (was häufig vorkommt).
- Das Dateiformat ist teilweise unbekannt (unbekanntes Modell oder Firmware).
- Die Datei wurde mit einer defekten Programmversion bearbeitet.
- Eine von ChanSort's Prüfungen geht von einer falschen Annahme aus.
Sie können mit der Bearbeitung fortfahren, es ist aber möglich, dass Ihr Fernsehgerät die Änderungen nicht annimmt.</value>
<value>Die Überprüfung des Dateiinhalts fand einige Auffälligkeiten, die Senderliste ist womöglich defekt.</value>
</data>
<data name="MainForm_RestoreScanOrder_Message" xml:space="preserve">
<value>Die händische Sortierung wird überschrieben.

View File

@@ -158,12 +158,7 @@
<value>Error loading file</value>
</data>
<data name="MainForm_LoadFiles_ValidationWarningMsg" xml:space="preserve">
<value>The verification of the file content showed some anomalies. Possible causes are:
- The TV itself created a mess in the channel lists (which happens frequently).
- The file format is partially unknown (e.g. unknown TV model or firmware).
- The file has been edited with a broken program version.
- ChanSort's validation rules are based on wrong assumptions.
You can continue editing, but it is possibile that your TV will reject the changes.</value>
<value>The file content shows some anomalies and is possibly corrupt.</value>
</data>
<data name="MainForm_LoadFiles_ValidationWarningCap" xml:space="preserve">
<value>Data validation</value>

View File

@@ -114,7 +114,7 @@ struct SCM_mapSate_EF_entry
public struct SCM_mapSate_EF
{
SCM_mapSate_E_entry Entries[*];
SCM_mapSate_EF_entry Entries[*];
};

View File

@@ -1,14 +1,20 @@
Version v2013-11-09 =======================================================
Version v2013-11-16 =======================================================
Changes:
- 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
- Loading a .csv reference list now also changes the channel names. This
way analog channel names can be restored after a new channel scan
- FIX: changes to Samsung channel lists after the first "save file"
operation were lost. Only the first save operation worked as expected.
- FIX: dragging something (e.g. a file) from outside ChanSort over one of
its tables causes an error
- FIX: channels in Samsung B-series DVB-C/T channel lists were incorrectly
identified and marked as deleted/active, resulting in duplicate program
numbers on the TV.
- FIX: channel names in Samsung lists sometimes showed "..." after the end
- Experimental support for modifying LG channel lists with predefined
channel numbers (LCN)
- Backed-out some changes from 2013-11-09 which may have caused incorrect
handling of deleted channels in Samsung channel lists
The complete change log can be found at the end of this document
@@ -117,6 +123,22 @@ OTHER DEALINGS IN THE SOFTWARE.
Change log ================================================================
2013-11-16
- FIX: changes to Samsung channel lists after the first "save file"
operation were lost. Only the first save operation worked as expected.
- FIX: channels in Samsung B-series DVB-C/T channel lists were incorrectly
identified and marked as deleted/active, resulting in duplicate program
numbers on the TV.
- FIX: channel names in Samsung lists sometimes showed "..." after the end
- FIX: dragging something (e.g. a file) from outside ChanSort over one of
its tables causes an error
2013-11-12 (beta)
- Experimental support for modifying LG channel lists with predefined
channel numbers (LCN)
- Backed-out some changes from 2013-11-09 which may have caused incorrect
handling of deleted channels in Samsung channel lists
2013-11-09
- File / "File information" now shows information for all TV models
- Disabled "TV-Set" menu items which are not applicable