mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-05-07 12:27:49 +02:00
- added unit tests for Enigma2 and Grundig loaders
- added round-trip unit test for all loaders to check reordering channels and favorites, saving and reloading - internal code clean-up regarding different favorite list modes (none vs. flags vs. ordered per source vs. mixed source)
This commit is contained in:
@@ -29,9 +29,9 @@ namespace ChanSort.Loader.Samsung.Scm
|
||||
public readonly int hdplusChannelLength;
|
||||
public readonly int avbtFineTuneLength;
|
||||
public readonly int dvbtFineTuneLength;
|
||||
public readonly Favorites supportedFavorites;
|
||||
public readonly int ptcLength;
|
||||
public readonly int serviceProviderLength;
|
||||
public readonly int numFavorites;
|
||||
public readonly FavoritesIndexMode SortedFavorites;
|
||||
public readonly int cyfraPlusChannelSize;
|
||||
|
||||
@@ -49,11 +49,7 @@ namespace ChanSort.Loader.Samsung.Scm
|
||||
this.avbtFineTuneLength = iniSection.GetInt("FineTune");
|
||||
this.dvbtFineTuneLength = iniSection.GetInt("FineTune_Digital");
|
||||
this.serviceProviderLength = iniSection.GetInt("ServiceProvider", 108);
|
||||
int numFavorites = iniSection.GetInt("Favorites");
|
||||
int mask = 0;
|
||||
for (int i = 0; i < numFavorites; i++)
|
||||
mask = (mask << 1) | 1;
|
||||
this.supportedFavorites = (Favorites)mask;
|
||||
this.numFavorites = iniSection.GetInt("Favorites");
|
||||
this.SortedFavorites = (FavoritesIndexMode)iniSection.GetInt("SortedFavorites");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -8,7 +7,7 @@ using ChanSort.Api;
|
||||
|
||||
namespace ChanSort.Loader.Samsung.Scm
|
||||
{
|
||||
internal class ScmSerializer : SerializerBase
|
||||
public class ScmSerializer : SerializerBase
|
||||
{
|
||||
private readonly Dictionary<string, ModelConstants> modelConstants = new Dictionary<string, ModelConstants>();
|
||||
private readonly MappingPool<DataMapping> analogMappings = new MappingPool<DataMapping>("Analog");
|
||||
@@ -111,8 +110,8 @@ namespace ChanSort.Loader.Samsung.Scm
|
||||
this.UnzipFileToTempFolder();
|
||||
|
||||
DetectModelConstants(this.TempPath);
|
||||
Features.SupportedFavorites = c.supportedFavorites;
|
||||
Features.SortedFavorites = c.SortedFavorites == FavoritesIndexMode.IndividuallySorted;
|
||||
Features.FavoritesMode = c.SortedFavorites == FavoritesIndexMode.IndividuallySorted ? FavoritesMode.OrderedPerSource : FavoritesMode.Flags;
|
||||
Features.MaxFavoriteLists = c.numFavorites;
|
||||
|
||||
ReadAnalogFineTuning(this.TempPath);
|
||||
ReadAnalogChannels(this.TempPath, "map-AirA", this.avbtChannels, out this.avbtFileContent, this.avbtFrequency);
|
||||
|
||||
@@ -31,8 +31,8 @@ namespace ChanSort.Loader.Samsung.Zip
|
||||
this.Features.CanSkipChannels = true;
|
||||
this.Features.CanLockChannels = true;
|
||||
this.Features.CanHideChannels = true;
|
||||
this.Features.SupportedFavorites = Favorites.A | Favorites.B | Favorites.C | Favorites.D | Favorites.E;
|
||||
this.Features.SortedFavorites = true;
|
||||
this.Features.FavoritesMode = FavoritesMode.OrderedPerSource;
|
||||
this.Features.MaxFavoriteLists = 5;
|
||||
this.Features.AllowGapsInFavNumbers = true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user