mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-02-27 08:40:42 +01:00
- fixed channel lists for panasonic
- LG file cleanup now also cleans up empty sat blocks
This commit is contained in:
@@ -621,15 +621,23 @@ namespace ChanSort.Loader.LG
|
||||
}
|
||||
|
||||
// copy temp data back to fileContent and clear remainder
|
||||
if (originalChannelCount != 0) // even if there's 0 channels, channel[0] must contain valid data
|
||||
if (originalChannelCount == 0)
|
||||
{
|
||||
// even if there's 0 channels, channel[0] must contain valid data
|
||||
Tools.MemSet(this.fileContent,
|
||||
this.dvbsBlockOffset + satConfig.ChannelListOffset + 1 * satConfig.dvbsChannelLength,
|
||||
0xFF,
|
||||
(satConfig.dvbsMaxChannelCount - 1) * satConfig.dvbsChannelLength);
|
||||
}
|
||||
else
|
||||
{
|
||||
Tools.MemCopy(sortedChannels, 0,
|
||||
this.fileContent, this.dvbsBlockOffset + satConfig.ChannelListOffset,
|
||||
channelCounter*satConfig.dvbsChannelLength);
|
||||
this.fileContent, this.dvbsBlockOffset + satConfig.ChannelListOffset,
|
||||
channelCounter * satConfig.dvbsChannelLength);
|
||||
Tools.MemSet(this.fileContent,
|
||||
this.dvbsBlockOffset + satConfig.ChannelListOffset + channelCounter*satConfig.dvbsChannelLength,
|
||||
this.dvbsBlockOffset + satConfig.ChannelListOffset + channelCounter * satConfig.dvbsChannelLength,
|
||||
0xFF,
|
||||
(satConfig.dvbsMaxChannelCount - channelCounter)*satConfig.dvbsChannelLength);
|
||||
(satConfig.dvbsMaxChannelCount - channelCounter) * satConfig.dvbsChannelLength);
|
||||
}
|
||||
UpdateChannelAllocationBitmap(channelCounter);
|
||||
UpdateChannelLinkedList(channelCounter);
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace ChanSort.Loader.Panasonic
|
||||
{
|
||||
this.RecordIndex = r.GetInt32(field["rowid"]);
|
||||
this.RecordOrder = r.GetInt32(field["major_channel"]);
|
||||
this.OldProgramNr = r.GetInt32(field["major_channel"]);
|
||||
int ntype = r.GetInt32(field["ntype"]);
|
||||
if (ntype == 1)
|
||||
this.SignalSource |= SignalSource.DvbS;
|
||||
@@ -22,7 +23,7 @@ namespace ChanSort.Loader.Panasonic
|
||||
else if (ntype == 3)
|
||||
this.SignalSource |= SignalSource.DvbC;
|
||||
else if (ntype == 10)
|
||||
this.SignalSource |= SignalSource.AnalogC | SignalSource.Tv;
|
||||
this.SignalSource |= SignalSource.AnalogCT|SignalSource.Tv;
|
||||
|
||||
byte[] buffer = new byte[1000];
|
||||
var len = r.GetBytes(field["delivery"], 0, buffer, 0, 1000);
|
||||
@@ -37,10 +38,6 @@ namespace ChanSort.Loader.Panasonic
|
||||
this.ReadAnalogData(r, field);
|
||||
else
|
||||
this.ReadDvbData(r, field, dataRoot, buffer);
|
||||
|
||||
var list = dataRoot.GetChannelList(this.SignalSource);
|
||||
if (list != null)
|
||||
this.OldProgramNr = ntype == 10 ? list.Count : list.Count + 1;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -12,9 +12,10 @@ namespace ChanSort.Loader.Panasonic
|
||||
{
|
||||
private static readonly string ERR_FileFormatOrEncryption = "File uses an unknown format or encryption";
|
||||
private static readonly int[] headerCypherTable;
|
||||
private readonly ChannelList atvChannels = new ChannelList(SignalSource.AnalogCT | SignalSource.Tv, "Analog TV");
|
||||
private readonly ChannelList dtvTvChannels = new ChannelList(SignalSource.DvbCT | SignalSource.DvbS | SignalSource.Tv, "Digital TV");
|
||||
private readonly ChannelList dtvRadioChannels = new ChannelList(SignalSource.DvbCT | SignalSource.DvbS | SignalSource.Radio, "Radio");
|
||||
private readonly ChannelList atvChannels = new ChannelList(SignalSource.AnalogCT | SignalSource.Tv | SignalSource.Radio, "Analog");
|
||||
private readonly ChannelList dvbtChannels = new ChannelList(SignalSource.DvbT | SignalSource.Tv | SignalSource.Radio, "DVB-T");
|
||||
private readonly ChannelList dvbcChannels = new ChannelList(SignalSource.DvbC | SignalSource.Tv | SignalSource.Radio, "DVB-C");
|
||||
private readonly ChannelList dvbsChannels = new ChannelList(SignalSource.DvbS | SignalSource.Tv | SignalSource.Radio, "DVB-S");
|
||||
|
||||
private string workFile;
|
||||
private CypherMode cypherMode;
|
||||
@@ -299,8 +300,9 @@ namespace ChanSort.Loader.Panasonic
|
||||
public Serializer(string inputFile) : base(inputFile)
|
||||
{
|
||||
this.DataRoot.AddChannelList(this.atvChannels);
|
||||
this.DataRoot.AddChannelList(this.dtvTvChannels);
|
||||
this.DataRoot.AddChannelList(this.dtvRadioChannels);
|
||||
this.DataRoot.AddChannelList(this.dvbtChannels);
|
||||
this.DataRoot.AddChannelList(this.dvbcChannels);
|
||||
this.DataRoot.AddChannelList(this.dvbsChannels);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -499,10 +501,10 @@ order by s.ntype,major_channel
|
||||
{
|
||||
using (var trans = conn.BeginTransaction())
|
||||
{
|
||||
int[] channelIndex = new int[5];
|
||||
this.WriteChannels(cmd, this.atvChannels, channelIndex);
|
||||
this.WriteChannels(cmd, this.dtvTvChannels, channelIndex);
|
||||
this.WriteChannels(cmd, this.dtvRadioChannels, channelIndex);
|
||||
this.WriteChannels(cmd, this.atvChannels);
|
||||
this.WriteChannels(cmd, this.dvbtChannels);
|
||||
this.WriteChannels(cmd, this.dvbcChannels);
|
||||
this.WriteChannels(cmd, this.dvbsChannels);
|
||||
trans.Commit();
|
||||
}
|
||||
}
|
||||
@@ -513,8 +515,10 @@ order by s.ntype,major_channel
|
||||
#endregion
|
||||
|
||||
#region WriteChannels()
|
||||
private void WriteChannels(SQLiteCommand cmd, ChannelList channelList, int[] channelIndex)
|
||||
private void WriteChannels(SQLiteCommand cmd, ChannelList channelList)
|
||||
{
|
||||
int[] favIndex = new int[4];
|
||||
|
||||
cmd.CommandText = "update SVL set major_channel=@progNr, sname=@name, profile1index=@fav1, profile2index=@fav2, profile3index=@fav3, profile4index=@fav4, child_lock=@lock, skip=@skip where rowid=@rowid";
|
||||
cmd.Parameters.Clear();
|
||||
cmd.Parameters.Add(new SQLiteParameter("@rowid", DbType.Int32));
|
||||
@@ -533,9 +537,9 @@ order by s.ntype,major_channel
|
||||
continue;
|
||||
channel.UpdateRawData();
|
||||
cmd.Parameters["@rowid"].Value = channel.RecordIndex;
|
||||
cmd.Parameters["@progNr"].Value = ++channelIndex[0]; // channel.NewProgramNr;
|
||||
cmd.Parameters["@progNr"].Value = channel.NewProgramNr;
|
||||
for (int fav = 0; fav < 4; fav++)
|
||||
cmd.Parameters["@fav" + (fav + 1)].Value = ((int) channel.Favorites & (1<<fav)) == 0 ? 0 : ++channelIndex[fav+1];
|
||||
cmd.Parameters["@fav" + (fav + 1)].Value = ((int) channel.Favorites & (1<<fav)) == 0 ? 0 : ++favIndex[fav];
|
||||
cmd.Parameters["@name"].Value = channel.Name;
|
||||
cmd.Parameters["@lock"].Value = channel.Lock;
|
||||
cmd.Parameters["@skip"].Value = channel.Skip;
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace ChanSort.Ui
|
||||
{
|
||||
public partial class MainForm : XtraForm
|
||||
{
|
||||
public const string AppVersion = "v2013-06-25";
|
||||
public const string AppVersion = "v2013-06-27";
|
||||
|
||||
private const int MaxMruEntries = 5;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Version v2013-06-25 ======================================================
|
||||
Version v2013-06-27 ======================================================
|
||||
|
||||
Changes:
|
||||
- Added experimental support for Panasonic channel lists (svl.db, svl.bin)
|
||||
- Improved experimental support for Panasonic channel lists
|
||||
|
||||
The complete change log can be found at the end of this document
|
||||
|
||||
@@ -101,6 +101,9 @@ OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Change log ================================================================
|
||||
|
||||
2013-06-27
|
||||
- Improved experimental support for Panasonic channel lists (svl.db, svl.bin)
|
||||
|
||||
2013-06-25
|
||||
- Added experimental support for Panasonic channel lists (svl.db, svl.bin)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user