- support for individually sorted favorite lists (Panasonic, Samsung E+F)

- FIX: "insert after" when dropping a channel from right list
This commit is contained in:
hbeham
2013-07-02 23:55:02 +02:00
parent dc2ce9fa65
commit 3bb80ed6bb
13 changed files with 404 additions and 117 deletions

View File

@@ -71,12 +71,16 @@ namespace ChanSort.Loader.Samsung
// series D,E,F
byte fav = 0;
byte mask = 0x01;
int favIndex = 0;
foreach (int off in offsets)
{
int favValue = BitConverter.ToInt32(this.rawData, baseOffset + off);
if (sortedFavorites && favValue != -1 || !sortedFavorites && favValue != 0)
fav |= mask;
if (sortedFavorites)
this.FavIndex[favIndex] = favValue;
mask <<= 1;
++favIndex;
}
return (Favorites) fav;
}
@@ -135,15 +139,17 @@ namespace ChanSort.Loader.Samsung
// series D,E,F
byte fav = (byte)this.Favorites;
byte mask = 0x01;
int favIndex = 0;
foreach (int off in offsets)
{
int favValue;
if (this.sortedFavorites)
favValue = (fav & mask) != 0 ? this.NewProgramNr : -1;
favValue = (fav & mask) != 0 ? this.FavIndex[favIndex] : -1;
else
favValue = (fav & mask) != 0 ? 1 : 0;
Array.Copy(BitConverter.GetBytes(favValue), 0, this.rawData, baseOffset + off, 4);
mask <<= 1;
++favIndex;
}
}
#endregion

View File

@@ -92,6 +92,7 @@ namespace ChanSort.Loader.Samsung
{
DetectModelConstants(zip);
DataRoot.SupportedFavorites = c.supportedFavorites;
DataRoot.SortedFavorites = c.SortedFavorites;
ReadAnalogFineTuning(zip);
ReadAnalogChannels(zip, "map-AirA", this.avbtChannels, out this.avbtFileContent, this.avbtFrequency);