本文整理匯總了C#中TvDatabase.Channel.ReferringTuningDetail方法的典型用法代碼示例。如果您正苦於以下問題:C# Channel.ReferringTuningDetail方法的具體用法?C# Channel.ReferringTuningDetail怎麽用?C# Channel.ReferringTuningDetail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TvDatabase.Channel
的用法示例。
在下文中一共展示了Channel.ReferringTuningDetail方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetTuningChannelsByDbChannel
public List<IChannel> GetTuningChannelsByDbChannel(Channel channel)
{
List<IChannel> tvChannels = new List<IChannel>();
IList<TuningDetail> tuningDetails = channel.ReferringTuningDetail();
for (int i = 0; i < tuningDetails.Count; ++i)
{
TuningDetail detail = tuningDetails[i];
tvChannels.Add(GetTuningChannel(detail));
}
return tvChannels;
}
示例2: CreateItemForChannel
private ListViewItem CreateItemForChannel(Channel channel, object map)
{
bool hasFta = false;
bool hasScrambled = false;
IList<TuningDetail> tuningDetails = channel.ReferringTuningDetail();
foreach (TuningDetail detail in tuningDetails)
{
if (detail.FreeToAir)
{
hasFta = true;
}
if (!detail.FreeToAir)
{
hasScrambled = true;
}
}
int imageIndex;
if (hasFta && hasScrambled)
{
imageIndex = 2;
}
else if (hasScrambled)
{
imageIndex = 1;
}
else
{
imageIndex = 0;
}
ListViewItem item = new ListViewItem(channel.DisplayName, imageIndex);
item.Checked = channel.VisibleInGuide;
item.Tag = map;
item.SubItems.Add(channel.ChannelNumber.ToString());
return item;
}
示例3: GetTuningChannelByType
public IChannel GetTuningChannelByType(Channel channel, int channelType)
{
IList<TuningDetail> tuningDetails = channel.ReferringTuningDetail();
for (int i = 0; i < tuningDetails.Count; ++i)
{
TuningDetail detail = tuningDetails[i];
if (detail.ChannelType != channelType)
{
continue;
}
return GetTuningChannel(detail);
}
return null;
}
示例4: BuildXmlTvIdFromChannelData
/// <summary>
/// Creates a XmlTvId string using the using the Old Zap2it format and MPChannel data and the XMLTVID constant
/// </summary>
/// <param name="tvChannel">The MP Channel</param>
/// <param name="zap2ItXmlTvId">The existing Zap2It based XMLTVID</param>
/// <returns>If successful, the new SchedulesDirect format ID, else an empty string</returns>
protected string BuildXmlTvIdFromChannelData(Channel tvChannel, string zap2ItXmlTvId)
{
if (String.IsNullOrEmpty(zap2ItXmlTvId))
return String.Empty;
if (!zap2ItXmlTvId.ToLower().EndsWith(ZAP2ITXMLTVID.ToLower()))
return zap2ItXmlTvId;
string[] idArr = zap2ItXmlTvId.Split(new char[] { '.' });
string xmlId = idArr[0];
ATSCChannel atscChannel = new ATSCChannel();
if (GetATSCChannel(tvChannel, ref atscChannel))
xmlId += "." + atscChannel.MajorChannel.ToString() + "-" + atscChannel.MinorChannel.ToString() + XMLTVID;
else
{
IList chDetailList = (IList)tvChannel.ReferringTuningDetail();
if (chDetailList.Count > 0)
{
TuningDetail chDetail = (TuningDetail)chDetailList[0];
xmlId += "." + chDetail.ChannelNumber.ToString() + XMLTVID;
}
}
return xmlId;
}
示例5: comparetuningdetails
public bool comparetuningdetails(Channel channel1, Channel channel2)
{
#if(MP100)
IList alltuningdetails1 = channel1.ReferringTuningDetail();
#elif(MP101)
IList<TuningDetail> alltuningdetails1 = channel1.ReferringTuningDetail();
#else //MP11BETA or SVN
IList<TuningDetail> alltuningdetails1 = channel1.ReferringTuningDetail();
#endif
TuningDetail[] tuningdetailarray1 = new TuningDetail[alltuningdetails1.Count];
int i = 0;
foreach (TuningDetail tuningdetail1 in alltuningdetails1)
{
tuningdetailarray1[i++] = tuningdetail1;
}
#if(MP100)
IList alltuningdetails2 = channel2.ReferringTuningDetail();
#elif(MP101)
IList<TuningDetail> alltuningdetails2 = channel2.ReferringTuningDetail();
#else //MP11BETA or SVN
IList<TuningDetail> alltuningdetails2 = channel2.ReferringTuningDetail();
#endif
TuningDetail[] tuningdetailarray2 = new TuningDetail[alltuningdetails2.Count];
i = 0;
foreach (TuningDetail tuningdetail2 in alltuningdetails2)
{
tuningdetailarray2[i++] = tuningdetail2;
}
if (alltuningdetails1.Count != alltuningdetails2.Count) //tuningdetail count not equal
return false;
for (i = 0; i < alltuningdetails1.Count; i++)
{
if (comparetuningdetail(tuningdetailarray1[i], tuningdetailarray2[i]) == false) //different tuning parameters
return false;
}
// textoutput("Tunigdetails equal for channel " + channel1.IdChannel + " and channel " + channel2.IdChannel);
return true;
}
示例6: GetATSCChannel
/// <summary>
/// Provides a cached wrapped for getting the ATSC channel.
/// </summary>
/// <param name="mpChannel">The TvDatabase.Channel</param>
/// <param name="retChannel">The TvLibrary.Channels.ATSCChannel</param>
/// <returns>true if the ATSC channel was found</returns>
protected bool GetATSCChannel(Channel mpChannel, ref ATSCChannel retChannel)
{
if (_mpAtscChannelCache.ContainsKey(mpChannel.IdChannel))
{
retChannel = _mpAtscChannelCache[mpChannel.IdChannel] as ATSCChannel;
return true;
}
System.Collections.IList tuneDetails = (System.Collections.IList)mpChannel.ReferringTuningDetail();
if (tuneDetails.Count > 0)
{
if (TransFormTuningDetailToATSCChannel((TuningDetail)tuneDetails[0], ref retChannel))
{
_mpAtscChannelCache.Add(mpChannel.IdChannel, retChannel);
return true;
}
}
return false;
}
示例7: GetFreeToAirInformation
/// <summary>
/// Checks if the channel is available on free to air or scrambled
/// </summary>
/// <param name="ch">The channel to get the free to air information for.</param>
/// <returns>0 if the channel is available only scrambled, 1 if it is only available free to air, 2 if it is available scrambled and free to air.</returns>
private static int GetFreeToAirInformation(Channel ch)
{
IList<TuningDetail> tuningDetails = ch.ReferringTuningDetail();
// channel is available on only one frequency, use the FreeToAir information from this frequency
if (tuningDetails.Count == 1)
return tuningDetails.First().FreeToAir ? 1 : 0;
// if the channel is available on more than one frequency, check if it is available only free to air, only scrambled or both
bool hasFta = tuningDetails.Any(i => i.FreeToAir);
bool hasScrambled = tuningDetails.Any(i => !i.FreeToAir);
// has both scrambled and free to air frequencies
if (hasFta && hasScrambled)
return 2;
// has only scrambled frequency
if (hasScrambled)
return 0;
// has only free to air frequency
return 1;
}
示例8: GetTuningDetailsByCardType
private static List<TuningDetail> GetTuningDetailsByCardType(Channel channel, CardType cardType, bool enableDVBS2)
{
List<TuningDetail> result = new List<TuningDetail>();
foreach (TuningDetail tDetail in channel.ReferringTuningDetail())
{
switch (cardType)
{
case CardType.Analog:
if (tDetail.ChannelType == 0)
result.Add(tDetail);
break;
case CardType.Atsc:
if (tDetail.ChannelType == 1)
result.Add(tDetail);
break;
case CardType.DvbC:
if (tDetail.ChannelType == 2)
result.Add(tDetail);
break;
case CardType.DvbS:
if (tDetail.ChannelType == 3)
{
if (!enableDVBS2 && (tDetail.Pilot > -1 || tDetail.RollOff > -1))
{
Log.Debug(String.Format(
"Imported channel {0} detected as DVB-S2. Skipped! \n Enable \"DVB-S2 tuning\" option in your TV-Card properties to be able to map these channels.",
tDetail.Name));
}
else
{
result.Add(tDetail);
}
}
break;
case CardType.DvbT:
if (tDetail.ChannelType == 4)
result.Add(tDetail);
break;
case CardType.DvbIP:
if (tDetail.ChannelType == 7)
result.Add(tDetail);
break;
case CardType.RadioWebStream:
if (tDetail.ChannelType == 5)
result.Add(tDetail);
break;
default:
break;
}
}
return result;
}
示例9: GetWebStreamURL
public string GetWebStreamURL(ref Channel chan)
{
string url = "";
IList<TuningDetail> details = chan.ReferringTuningDetail();
foreach (TuningDetail detail in details)
{
if (detail.ChannelType == 5)
{
url = detail.Url;
break;
}
}
return url;
}
示例10: CreateListViewItemForChannel
/// <summary>
/// Create a listview item for a channel
/// </summary>
/// <param name="ch">Channel</param>
/// <param name="cards">All available cards</param>
/// <returns>Listview item representing the channel</returns>
internal ListViewItem CreateListViewItemForChannel(Channel ch, Dictionary<int, CardType> cards)
{
if (_listViewCache.ContainsKey(ch.IdChannel)) return _listViewCache[ch.IdChannel];
bool analog = false;
bool dvbc = false;
bool dvbt = false;
bool dvbs = false;
bool atsc = false;
bool dvbip = false;
bool webstream = false;
bool notmapped = true;
if (ch.IsWebstream())
{
webstream = true;
notmapped = false;
}
if (notmapped)
{
IList<ChannelMap> maps = ch.ReferringChannelMap();
foreach (ChannelMap map in maps)
{
if (cards.ContainsKey(map.IdCard))
{
CardType type = cards[map.IdCard];
switch (type)
{
case CardType.Analog:
analog = true;
notmapped = false;
break;
case CardType.DvbC:
dvbc = true;
notmapped = false;
break;
case CardType.DvbT:
dvbt = true;
notmapped = false;
break;
case CardType.DvbS:
dvbs = true;
notmapped = false;
break;
case CardType.Atsc:
atsc = true;
notmapped = false;
break;
case CardType.DvbIP:
dvbip = true;
notmapped = false;
break;
}
}
}
}
ListViewItem item = new ListViewItem(ch.DisplayName);
item.Checked = ch.VisibleInGuide;
item.Tag = ch;
IList<string> groups = ch.GroupNames;
List<string> groupNames = new List<string>();
foreach (string groupName in groups)
{
if (groupName != TvConstants.TvGroupNames.AllChannels &&
groupName != TvConstants.RadioGroupNames.AllChannels)
{
//Don't add "All Channels"
groupNames.Add(groupName);
}
}
string group = String.Join(", ", groupNames.ToArray());
item.SubItems.Add(group);
List<string> providers = new List<string>();
IList<TuningDetail> tuningDetails = ch.ReferringTuningDetail();
bool hasFta = false;
bool hasScrambled = false;
foreach (TuningDetail detail in tuningDetails)
{
if (!providers.Contains(detail.Provider) && !String.IsNullOrEmpty(detail.Provider))
{
providers.Add(detail.Provider);
}
if (detail.FreeToAir)
{
hasFta = true;
}
if (!detail.FreeToAir)
{
hasScrambled = true;
}
}
//.........這裏部分代碼省略.........