当前位置: 首页>>代码示例>>C#>>正文


C# TvBusinessLayer.GetTuningDetail方法代码示例

本文整理汇总了C#中TvDatabase.TvBusinessLayer.GetTuningDetail方法的典型用法代码示例。如果您正苦于以下问题:C# TvBusinessLayer.GetTuningDetail方法的具体用法?C# TvBusinessLayer.GetTuningDetail怎么用?C# TvBusinessLayer.GetTuningDetail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TvDatabase.TvBusinessLayer的用法示例。


在下文中一共展示了TvBusinessLayer.GetTuningDetail方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RequestCardTuneReservation


//.........这里部分代码省略.........
          {
            IUser actualUser = users[i];                           
            CardReservationHelper.AddUserIfRecording(tvcard, ref actualUser, recUsers);
            CardReservationHelper.AddUserIfTimeshifting(tvcard, ref actualUser, tsUsers);

            bool isCurrentUser = user.Name.Equals(actualUser.Name);

            IChannel userChannel = tvcard.CurrentChannel(ref actualUser);
            var userDVBchannel = userChannel as DVBBaseChannel;

            if (!isCurrentUser)
            {
              if (!isRecordingAnyUser)
              {
                isRecordingAnyUser = CardReservationHelper.IsRecordingUser(tvcard, user, ref actualUser);
              }

              if (actualUser.SubChannel == user.SubChannel && user.IdChannel > 0)
              {
                conflictingSubchannelFound = true;
              }
              numberOfOtherUsersOnCurrentCard = CardReservationHelper.GetNumberOfOtherUsersOnCurrentCard(user,
                                                                                                         numberOfOtherUsersOnCurrentCard);

              
              if (userChannel == null)
              {
                inactiveUsers.Add(actualUser);
              }
              else
              {                
                if (userDVBchannel != null)
                {
                  actualUser.IdChannel = layer.GetTuningDetail(userDVBchannel).IdChannel;
                }

                bool isDiffTS = tuningDetail.IsDifferentTransponder(userChannel);

                if (isDiffTS)
                {
                  activeUsers.Add(actualUser);
                }
                else
                {
                  if (!isOwner)
                  {
                    bool isUserOnSameChannel = CardReservationHelper.IsUserOnSameChannel(tuningDetail, layer,
                                                                                         userDVBchannel);
                    if (isUserOnSameChannel)
                    {
                      numberOfOtherUsersOnSameChannel++;
                      //we do not want to hook up on schedulers existing subchannel
                      if (!actualUser.IsAdmin)
                      {
                        ownerSubchannel = actualUser.SubChannel;
                      }
                    }                    
                  }                  
                }
              }
            }

            bool isUserOnSameCurrentChannel = CardReservationHelper.IsUserOnSameCurrentChannel(currentChannelId, actualUser);
            if (isUserOnSameCurrentChannel)
            {
              numberOfUsersOnSameCurrentChannel++;
开发者ID:sanyaade-embedded-systems,项目名称:MediaPortal-1,代码行数:67,代码来源:CardReservationBase.cs

示例2: IsUserOnSameChannel

    public static bool IsUserOnSameChannel(IChannel tuningDetail, TvBusinessLayer layer, DVBBaseChannel userDVBchannel)
    {
      bool isUserOnSameChannel = false;      
      if (userDVBchannel != null)
      {        
        var currentDVBchannel = tuningDetail as DVBBaseChannel;
        if (currentDVBchannel != null)
        {
          TuningDetail currentDVBtuningDetail = layer.GetTuningDetail(currentDVBchannel);
          TuningDetail userDVBtuningDetail = layer.GetTuningDetail(userDVBchannel);
          isUserOnSameChannel = (currentDVBtuningDetail != null && currentDVBtuningDetail.IdChannel == userDVBtuningDetail.IdChannel);

        }        
      }
      return isUserOnSameChannel;
    }
开发者ID:sanyaade-embedded-systems,项目名称:MediaPortal-1,代码行数:16,代码来源:CardReservationHelper.cs

示例3: DoScan

    /// <summary>
    /// Scan Thread
    /// </summary>
    private void DoScan()
    {
      suminfo tv = new suminfo();
      suminfo radio = new suminfo();
      IUser user = new User();
      user.CardId = _cardNumber;
      try
      {
        scanState = ScanState.Scanning;
        if (_dvbcChannels.Count == 0)
          return;

        RemoteControl.Instance.EpgGrabberEnabled = false;

        SetButtonState();
        TvBusinessLayer layer = new TvBusinessLayer();
        Card card = layer.GetCardByDevicePath(RemoteControl.Instance.CardDevice(_cardNumber));

        for (int index = 0; index < _dvbcChannels.Count; ++index)
        {
          if (scanState == ScanState.Cancel)
            return;

          float percent = ((float)(index)) / _dvbcChannels.Count;
          percent *= 100f;
          if (percent > 100f)
            percent = 100f;
          progressBar1.Value = (int)percent;

          Application.DoEvents();

          DVBCChannel tuneChannel = new DVBCChannel(_dvbcChannels[index]); // new DVBCChannel();
          string line = String.Format("{0}tp- {1}", 1 + index, tuneChannel.TuningInfo.ToString());
          ListViewItem item = listViewStatus.Items.Add(new ListViewItem(line));
          item.EnsureVisible();

          if (index == 0)
          {
            RemoteControl.Instance.Scan(ref user, tuneChannel, -1);
          }

          IChannel[] channels = RemoteControl.Instance.Scan(_cardNumber, tuneChannel);
          UpdateStatus();

          if (channels == null || channels.Length == 0)
          {
            if (RemoteControl.Instance.TunerLocked(_cardNumber) == false)
            {
              line = String.Format("{0}tp- {1} {2} {3}:No signal", 1 + index, tuneChannel.Frequency,
                                   tuneChannel.ModulationType, tuneChannel.SymbolRate);
              item.Text = line;
              item.ForeColor = Color.Red;
              continue;
            }
            line = String.Format("{0}tp- {1} {2} {3}:Nothing found", 1 + index, tuneChannel.Frequency,
                                 tuneChannel.ModulationType, tuneChannel.SymbolRate);
            item.Text = line;
            item.ForeColor = Color.Red;
            continue;
          }

          radio.newChannel = 0;
          radio.updChannel = 0;
          tv.newChannel = 0;
          tv.updChannel = 0;
          for (int i = 0; i < channels.Length; ++i)
          {
            Channel dbChannel;
            DVBCChannel channel = (DVBCChannel)channels[i];
            bool exists;
            TuningDetail currentDetail;
            //Check if we already have this tuningdetail. The user has the option to enable channel move detection...
            if (checkBoxEnableChannelMoveDetection.Checked)
            {
              //According to the DVB specs ONID + SID is unique, therefore we do not need to use the TSID to identify a service.
              //The DVB spec recommends that the SID should not change if a service moves. This theoretically allows us to
              //track channel movements.
              currentDetail = layer.GetTuningDetail(channel.NetworkId, channel.ServiceId,
                                                                 TvBusinessLayer.GetChannelType(channel));
            }
            else
            {
              //There are certain providers that do not maintain unique ONID + SID combinations.
              //In those cases, ONID + TSID + SID is generally unique. The consequence of using the TSID to identify
              //a service is that channel movement tracking won't work (each transponder/mux should have its own TSID).
              currentDetail = layer.GetTuningDetail(channel.NetworkId, channel.TransportId, channel.ServiceId,
                                                                 TvBusinessLayer.GetChannelType(channel));
            }

            if (currentDetail == null)
            {
              //add new channel
              exists = false;
              dbChannel = layer.AddNewChannel(channel.Name);
              dbChannel.SortOrder = 10000;
              if (channel.LogicalChannelNumber >= 1)
              {
//.........这里部分代码省略.........
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:101,代码来源:CardDvbC.cs

示例4: PersistPMTtoDataBase

 private void PersistPMTtoDataBase(int pmtPid)
 {
   // check if PMT has changed, in this case update tuning details
   DVBBaseChannel currentDvbChannel = _currentChannel as DVBBaseChannel;
   if (currentDvbChannel != null && pmtPid != currentDvbChannel.PmtPid && !alwaysUsePATLookup)
   {
     currentDvbChannel.PmtPid = pmtPid;
     TvBusinessLayer layer = new TvBusinessLayer();
     TuningDetail currentDetail = layer.GetTuningDetail(currentDvbChannel);
     if (currentDetail != null)
     {
       try
       {
         currentDetail.PmtPid = pmtPid;
         currentDetail.Persist();
         Log.Log.Debug("Updated PMT Pid to {0:X}!", pmtPid);
       }
       catch (Exception e)
       {
         Log.Log.Error("PMT {0:X} could not be persisted to DB!", pmtPid, e);
       }
     }
     else
     {
       Log.Log.Debug("PMT {0:X} could not be persisted to DB, no tuningdetails found!", pmtPid);
     }
   }
 }
开发者ID:sanyaade-embedded-systems,项目名称:MediaPortal-1,代码行数:28,代码来源:TvDvbChannel.cs

示例5: DoScan


//.........这里部分代码省略.........
              line = String.Format("{0}- {1} - {2} :Nothing found", 1 + index, tuneChannel.Url, tuneChannel.Name);
              item.Text = line;
              item.ForeColor = Color.Red;
              continue;
            }
          }

          int newChannels = 0;
          int updatedChannels = 0;

          for (int i = 0; i < channels.Length; ++i)
          {
            Channel dbChannel;
            DVBIPChannel channel = (DVBIPChannel)channels[i];
            if (channels.Length > 1)
            {
              if (channel.Name.IndexOf("Unknown") == 0)
              {
                channel.Name = name + (i + 1);
              }
            }
            else
            {
              channel.Name = name;
            }
            bool exists;
            TuningDetail currentDetail;
            //Check if we already have this tuningdetail. According to DVB-IP specifications there are two ways to identify DVB-IP
            //services: one ONID + SID based, the other domain/URL based. At this time we don't fully and properly implement the DVB-IP
            //specifications, so the safest method for service identification is the URL. The user has the option to enable the use of
            //ONID + SID identification and channel move detection...
            if (checkBoxEnableChannelMoveDetection.Checked)
            {
              currentDetail = layer.GetTuningDetail(channel.NetworkId, channel.ServiceId,
                                                                 TvBusinessLayer.GetChannelType(channel));
            }
            else
            {
              currentDetail = layer.GetTuningDetail(channel.Url, TvBusinessLayer.GetChannelType(channel));
            }

            if (currentDetail == null)
            {
              //add new channel
              exists = false;
              dbChannel = layer.AddNewChannel(channel.Name, channel.LogicalChannelNumber);
              dbChannel.SortOrder = 10000;
              if (channel.LogicalChannelNumber >= 1)
              {
                dbChannel.SortOrder = channel.LogicalChannelNumber;
              }
              dbChannel.IsTv = channel.IsTv;
              dbChannel.IsRadio = channel.IsRadio;
              dbChannel.Persist();
            }
            else
            {
              exists = true;
              dbChannel = currentDetail.ReferencedChannel();
            }

            layer.AddChannelToGroup(dbChannel, TvConstants.TvGroupNames.AllChannels);

            if (checkBoxCreateGroups.Checked)
            {
              layer.AddChannelToGroup(dbChannel, channel.Provider);
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:67,代码来源:CardDvbIP.cs

示例6: StartTimeShifting


//.........这里部分代码省略.........
          if (isTS)
          {
            IUser[] users = tvcard.Users.GetUsers();
            for (int j = users.Length - 1; j > -1; j--)
            {
              IUser u = users[j];
              if (user.Name.Equals(u.Name))
              {
                continue;
              }

              IChannel tmpChannel = tvcard.CurrentChannel(ref u);

              if (tmpChannel == null)
              {
                tvcard.Users.RemoveUser(u);
                //removing inactive user which shouldnt happen, but atleast its better than having timeshfiting fail.
                continue;
              }

              bool isDiffTS = tuneChannel.IsDifferentTransponder(tmpChannel);

              if (isDiffTS)
              {
                Log.Write("Controller: kicking leech user {0} off card {1} since owner {2} changed transponder", u.Name,
                          cardInfo.Card.Name, user.Name);
                StopTimeShifting(ref u, TvStoppedReason.OwnerChangedTS);
              }
              else
              {
                DVBBaseChannel dvbBaseChannel = tmpChannel as DVBBaseChannel;
                if (dvbBaseChannel != null)
                {
                  TuningDetail userChannel = layer.GetTuningDetail(dvbBaseChannel);
                  bool isOnSameChannel = (idChannel == userChannel.IdChannel);

                  if (isOnSameChannel)
                  {
                    if (tvcard.Users.IsOwner(userCopy))
                    {
                      if (i < maxCards)
                      {
                        Log.Write("Controller: skipping card:{0} since other users are present on the same channel.",
                                  userCopy.CardId);
                        skipCard = true;
                        break; //try next card  
                      }
                    }
                    else
                    {
                      nrOfOtherUsersTimeshiftingOnCard++;
                      if (!u.IsAdmin)
                      {
                        userCopy.SubChannel = u.SubChannel;
                      }
                    }
                  }
                }
              }
            }
          }

          if (skipCard)
          {
            continue;
          }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:67,代码来源:TVController.cs

示例7: DoScan


//.........这里部分代码省略.........
           tuneChannel.PhysicalChannel = index + 1;
           tuneChannel.Frequency = _atscChannels[index].frequency;
           tuneChannel.ModulationType = ModulationType.Mod64Qam;
           line = String.Format("physical channel:{0} frequency:{1} modulation:{2}: No signal", tuneChannel.PhysicalChannel, tuneChannel.Frequency, tuneChannel.ModulationType);
           item.Text = line;
           channels = RemoteControl.Instance.Scan(_cardNumber, tuneChannel);
         }
       }*/
       UpdateStatus();
       if (channels == null || channels.Length == 0)
       {
         if (RemoteControl.Instance.TunerLocked(_cardNumber) == false)
         {
           line = String.Format("physical channel:{0} frequency:{1} modulation:{2}: No signal",
                                tuneChannel.PhysicalChannel, tuneChannel.Frequency, tuneChannel.ModulationType);
           item.Text = line;
           item.ForeColor = Color.Red;
           continue;
         }
         line = String.Format("physical channel:{0} frequency:{1} modulation:{2}: Nothing found",
                              tuneChannel.PhysicalChannel, tuneChannel.Frequency, tuneChannel.ModulationType);
         item.Text = line;
         item.ForeColor = Color.Red;
         continue;
       }
       int newChannels = 0;
       int updatedChannels = 0;
       for (int i = 0; i < channels.Length; ++i)
       {
         Channel dbChannel;
         ATSCChannel channel = (ATSCChannel)channels[i];
         //No support for channel moving, or merging with existing channels here.
         //We do not know how ATSC works to correctly implement this.
         TuningDetail currentDetail = layer.GetTuningDetail(channel);
         if (currentDetail != null)
           if (channel.Frequency != currentDetail.Frequency)
             currentDetail = null;
         bool exists;
         if (currentDetail == null)
         {
           //add new channel
           exists = false;
           dbChannel = layer.AddNewChannel(channel.Name);
           dbChannel.SortOrder = 10000;
           if (channel.LogicalChannelNumber >= 1)
           {
             dbChannel.SortOrder = channel.LogicalChannelNumber;
           }
         }
         else
         {
           exists = true;
           dbChannel = currentDetail.ReferencedChannel();
         }
         dbChannel.IsTv = channel.IsTv;
         dbChannel.IsRadio = channel.IsRadio;
         dbChannel.Persist();
         if (dbChannel.IsTv)
         {
           layer.AddChannelToGroup(dbChannel, TvConstants.TvGroupNames.AllChannels);
         }
         if (dbChannel.IsRadio)
         {
           layer.AddChannelToRadioGroup(dbChannel, TvConstants.RadioGroupNames.AllChannels);
         }
         if (currentDetail == null)
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:67,代码来源:CardAtsc.cs

示例8: DoScan


//.........这里部分代码省略.........
         Log.Info("ATSC: scanning digital cable, {0}", line);
       }
       line += "... ";
       ListViewItem item = listViewStatus.Items.Add(new ListViewItem(line));
       item.EnsureVisible();
       if (index == minchan)
       {
         RemoteControl.Instance.Scan(ref user, tuneChannel, -1);
       }
       IChannel[] channels = RemoteControl.Instance.Scan(_cardNumber, tuneChannel);
       UpdateStatus();
       if (channels == null || channels.Length == 0)
       {
         if (tuneChannel.PhysicalChannel > 0 && !RemoteControl.Instance.TunerLocked(_cardNumber))
         {
           line += "no signal";
         }
         else
         {
           line += "signal locked, no channels found";
         }
         item.Text = line;
         item.ForeColor = Color.Red;
         continue;
       }
       int newChannels = 0;
       int updatedChannels = 0;
       for (int i = 0; i < channels.Length; ++i)
       {
         Channel dbChannel;
         ATSCChannel channel = (ATSCChannel)channels[i];
         //No support for channel moving, or merging with existing channels here.
         //We do not know how ATSC works to correctly implement this.
         TuningDetail currentDetail = layer.GetTuningDetail(channel);
         if (currentDetail != null)
         {
           if (channel.IsDifferentTransponder(layer.GetTuningChannel(currentDetail)))
           {
             currentDetail = null;
           }
         }
         bool exists;
         if (currentDetail == null)
         {
           //add new channel
           exists = false;
           dbChannel = layer.AddNewChannel(channel.Name, channel.LogicalChannelNumber);
           dbChannel.SortOrder = 10000;
           if (channel.LogicalChannelNumber >= 1)
           {
             dbChannel.SortOrder = channel.LogicalChannelNumber;
           }
         }
         else
         {
           exists = true;
           dbChannel = currentDetail.ReferencedChannel();
         }
         dbChannel.IsTv = channel.IsTv;
         dbChannel.IsRadio = channel.IsRadio;
         dbChannel.Persist();
         if (dbChannel.IsTv)
         {
           layer.AddChannelToGroup(dbChannel, TvConstants.TvGroupNames.AllChannels);
         }
         if (dbChannel.IsRadio)
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:67,代码来源:CardAtsc.cs


注:本文中的TvDatabase.TvBusinessLayer.GetTuningDetail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。