mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-05-07 14:56:32 +02:00
complete support for Samsung J series (added DVB-T, analog and reference list support)
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
ONID;Start;End;Name;Operator
|
||||
SERVICETYPE;Number;Description
|
||||
SERVICETYPE;01;SD-TV
|
||||
SERVICETYPE;02;Radio
|
||||
SERVICETYPE;12;Data/Test
|
||||
SERVICETYPE;22;SD-TV
|
||||
SERVICETYPE;25;HD-TV
|
||||
SERVICETYPE;31;4K-TV
|
||||
SERVICETYPE;211;Option
|
||||
|
||||
ONID;Start;End;Name;Operator
|
||||
ONID;0x0000;0x0000;(Reserved);(Reserved)
|
||||
ONID;0x0001;0x0001;Société Européenne des Satellites;Société Européenne des Satellites
|
||||
ONID;0x0002;0x0002;Société Européenne des Satellites;Société Européenne des Satellites
|
||||
@@ -417,11 +426,110 @@ TRANSP;118;12699
|
||||
TRANSP;119;12722
|
||||
TRANSP;120;12728
|
||||
|
||||
SERVICETYPE;Number;Description
|
||||
SERVICETYPE;01;SD-TV
|
||||
SERVICETYPE;02;Radio
|
||||
SERVICETYPE;12;Data/Test
|
||||
SERVICETYPE;22;SD-TV
|
||||
SERVICETYPE;25;HD-TV
|
||||
SERVICETYPE;31;4K-TV
|
||||
SERVICETYPE;211;Option
|
||||
DVBC;kHz;Channel
|
||||
DVBC;50500;2
|
||||
DVBC;57500;3
|
||||
DVBC;64500;4
|
||||
DVBC;71500;S 01
|
||||
DVBC;78500;S 02
|
||||
DVBC;85500;S 03
|
||||
DVBC;107500;SE 1
|
||||
DVBC;113000;SE 2
|
||||
DVBC;114500;SE 2
|
||||
DVBC;121000;SE 3
|
||||
DVBC;121500;SE 3
|
||||
DVBC;128500;SE 4
|
||||
DVBC;135500;SE 5
|
||||
DVBC;142500;SE 6
|
||||
DVBC;149500;SE 7
|
||||
DVBC;156500;SE 8
|
||||
DVBC;163500;SE 9
|
||||
DVBC;170500;SE 10
|
||||
DVBC;177500;5
|
||||
DVBC;184500;6
|
||||
DVBC;191500;7
|
||||
DVBC;198500;8
|
||||
DVBC;205500;9
|
||||
DVBC;212500;10
|
||||
DVBC;219500;11
|
||||
DVBC;226500;12
|
||||
DVBC;233500;SE 11
|
||||
DVBC;240500;SE 12
|
||||
DVBC;247500;SE 13
|
||||
DVBC;254500;SE 14
|
||||
DVBC;261500;SE 15
|
||||
DVBC;268500;SE 16
|
||||
DVBC;275500;SE 17
|
||||
DVBC;282500;SE 18
|
||||
DVBC;289500;SE 19
|
||||
DVBC;296500;SE 20
|
||||
DVBC;306000;S 21
|
||||
DVBC;314000;S 22
|
||||
DVBC;322000;S 23
|
||||
DVBC;330000;S 24
|
||||
DVBC;338000;S 25
|
||||
DVBC;346000;S 26
|
||||
DVBC;354000;S 27
|
||||
DVBC;362000;S 28
|
||||
DVBC;370000;S 29
|
||||
DVBC;378000;S 30
|
||||
DVBC;386000;S 31
|
||||
DVBC;394000;S 32
|
||||
DVBC;402000;S 33
|
||||
DVBC;410000;S 34
|
||||
DVBC;418000;S 35
|
||||
DVBC;426000;S 36
|
||||
DVBC;434000;S 37
|
||||
DVBC;442000;S 38
|
||||
DVBC;450000;S 39
|
||||
DVBC;458000;S 40
|
||||
DVBC;466000;S 41
|
||||
DVBC;474000;21
|
||||
DVBC;482000;22
|
||||
DVBC;490000;23
|
||||
DVBC;498000;24
|
||||
DVBC;506000;25
|
||||
DVBC;514000;26
|
||||
DVBC;522000;27
|
||||
DVBC;530000;28
|
||||
DVBC;538000;29
|
||||
DVBC;546000;30
|
||||
DVBC;554000;31
|
||||
DVBC;562000;32
|
||||
DVBC;570000;33
|
||||
DVBC;578000;34
|
||||
DVBC;586000;35
|
||||
DVBC;594000;36
|
||||
DVBC;602000;37
|
||||
DVBC;610000;38
|
||||
DVBC;618000;39
|
||||
DVBC;626000;40
|
||||
DVBC;634000;41
|
||||
DVBC;642000;42
|
||||
DVBC;650000;43
|
||||
DVBC;658000;44
|
||||
DVBC;666000;45
|
||||
DVBC;674000;46
|
||||
DVBC;682000;47
|
||||
DVBC;690000;48
|
||||
DVBC;698000;49
|
||||
DVBC;706000;50
|
||||
DVBC;714000;51
|
||||
DVBC;722000;52
|
||||
DVBC;730000;53
|
||||
DVBC;738000;54
|
||||
DVBC;746000;55
|
||||
DVBC;754000;56
|
||||
DVBC;762000;57
|
||||
DVBC;770000;58
|
||||
DVBC;778000;59
|
||||
DVBC;786000;60
|
||||
DVBC;794000;61
|
||||
DVBC;802000;62
|
||||
DVBC;810000;63
|
||||
DVBC;818000;64
|
||||
DVBC;826000;65
|
||||
DVBC;834000;66
|
||||
DVBC;842000;67
|
||||
DVBC;850000;68
|
||||
DVBC;858000;69
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
@@ -8,9 +9,8 @@ namespace ChanSort.Api
|
||||
{
|
||||
private readonly IDictionary<int, NetworkInfo> networks = new Dictionary<int, NetworkInfo>();
|
||||
private readonly IDictionary<int, int> transponderNrByFreqInMhz = new Dictionary<int, int>();
|
||||
private readonly IDictionary<int, int> transponderFreqInMhzByNr = new Dictionary<int, int>();
|
||||
private readonly IDictionary<int, string> serviceTypeDescriptions = new Dictionary<int, string>();
|
||||
private readonly IDictionary<int, int> dvbtFreqInMhzByTransponder = new Dictionary<int, int>();
|
||||
private readonly IDictionary<int, string> dvbcChannels = new ConcurrentDictionary<int, string>();
|
||||
|
||||
public static readonly LookupData Instance = new LookupData();
|
||||
|
||||
@@ -28,8 +28,8 @@ namespace ChanSort.Api
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region GetTransponderNumber(), GetTransponderFrequency()
|
||||
public int GetTransponderNumber(int frequencyInMhz)
|
||||
#region GetAstraTransponder(), GetAstraFrequency()
|
||||
public int GetAstraTransponder(int frequencyInMhz)
|
||||
{
|
||||
int number;
|
||||
bool found = this.transponderNrByFreqInMhz.TryGetValue(frequencyInMhz, out number) ||
|
||||
@@ -40,7 +40,7 @@ namespace ChanSort.Api
|
||||
return found ? number : 0;
|
||||
}
|
||||
|
||||
public int GetTransponderFrequency(int transponderNr)
|
||||
public int GetAstraFrequency(int transponderNr)
|
||||
{
|
||||
return this.transponderNrByFreqInMhz.TryGet(transponderNr);
|
||||
}
|
||||
@@ -59,12 +59,10 @@ namespace ChanSort.Api
|
||||
public void LoadDataFromCsvFile()
|
||||
{
|
||||
this.networks.Clear();
|
||||
this.transponderFreqInMhzByNr.Clear();
|
||||
this.transponderNrByFreqInMhz.Clear();
|
||||
this.serviceTypeDescriptions.Clear();
|
||||
this.dvbtFreqInMhzByTransponder.Clear();
|
||||
|
||||
string file = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "lookup.csv");
|
||||
string file = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "", "lookup.csv");
|
||||
if (!File.Exists(file))
|
||||
return;
|
||||
using (var reader = new StreamReader(file, System.Text.Encoding.UTF8))
|
||||
@@ -78,8 +76,8 @@ namespace ChanSort.Api
|
||||
switch (fields[0].ToLower())
|
||||
{
|
||||
case "onid": this.ParseNetwork(fields); break;
|
||||
case "dvbt": this.ParseDvbtTransponder(fields); break;
|
||||
case "transp": this.ParseTransponder(fields); break;
|
||||
case "dvbc": this.ParseDvbcChannel(fields); break;
|
||||
case "servicetype": this.ParseServiceType(fields); break;
|
||||
}
|
||||
}
|
||||
@@ -98,14 +96,6 @@ namespace ChanSort.Api
|
||||
private void AddTransponderMapping(int transponderNr, int frequencyInMhz)
|
||||
{
|
||||
this.transponderNrByFreqInMhz[frequencyInMhz] = transponderNr;
|
||||
this.transponderFreqInMhzByNr[transponderNr] = frequencyInMhz;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region AddDvbtTransponderMapping()
|
||||
private void AddDvbtTransponderMapping(int transponderNr, int frequencyInMhz)
|
||||
{
|
||||
this.dvbtFreqInMhzByTransponder[transponderNr] = frequencyInMhz;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -164,17 +154,16 @@ namespace ChanSort.Api
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ParseTransponder()
|
||||
private void ParseDvbtTransponder(IList<string> fields)
|
||||
#region ParseDvbcChannel()
|
||||
private void ParseDvbcChannel(IList<string> fields)
|
||||
{
|
||||
if (fields.Count < 3)
|
||||
return;
|
||||
int nr, freq;
|
||||
int.TryParse(fields[1], out nr);
|
||||
int.TryParse(fields[2], out freq);
|
||||
if (nr == 0 || freq == 0)
|
||||
int freq;
|
||||
int.TryParse(fields[1], out freq);
|
||||
if (freq == 0)
|
||||
return;
|
||||
this.AddDvbtTransponderMapping(nr, freq);
|
||||
this.dvbcChannels[freq] = fields[2];
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -208,24 +197,27 @@ namespace ChanSort.Api
|
||||
#endregion
|
||||
|
||||
#region GetDvbtTransponder()
|
||||
public int GetDvbtTransponder(decimal freq)
|
||||
public int GetDvbtTransponder(decimal freqInMhz)
|
||||
{
|
||||
return (int)(freq - 106)/8;
|
||||
return (int)(freqInMhz - 306)/8;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region GetDvbtFrequency()
|
||||
public decimal GetDvbtFrequeny(int channelTransponder)
|
||||
{
|
||||
return channelTransponder * 8 + 306;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region GetDvbtFrequencyForTransponder()
|
||||
public decimal GetDvbtFrequenyForTransponder(int transponder)
|
||||
public int GetDvbcTransponder(decimal freqInMhz)
|
||||
{
|
||||
return transponder * 8 + 106;
|
||||
return GetDvbtTransponder(freqInMhz) + 25; // Samsung handles it like this
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region GetDvbtFrequencyForChannel()
|
||||
public decimal GetDvbtFrequenyForChannel(int channel)
|
||||
public string GetDvbcChannelName(decimal freqInMhz)
|
||||
{
|
||||
return channel * 8 + 306;
|
||||
return dvbcChannels.TryGet((int)(freqInMhz * 1000)) ?? "";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user