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


C# TvDatabase.Channel类代码示例

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


Channel类属于TvDatabase命名空间,在下文中一共展示了Channel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsChannelMappedToCard

    public static bool IsChannelMappedToCard(Channel dbChannel, Card card)
    {
      bool isChannelMappedToCard = false;

      IDictionary<int, bool> cardIds;

      bool isChannelFound = _channelMapping.TryGetValue(dbChannel.IdChannel, out cardIds);

      bool channelMappingFound = false;
      if (isChannelFound)
      {
        channelMappingFound = cardIds.TryGetValue(card.IdCard, out isChannelMappedToCard);
      }

      if (!channelMappingFound)
      {
        //check if channel is mapped to this card and that the mapping is not for "Epg Only"        
        isChannelMappedToCard = _businessLayer.IsChannelMappedToCard(dbChannel, card, false);

        if (cardIds == null)
        {
          cardIds = new Dictionary<int, bool>();
        }
        cardIds.Add(card.IdCard, isChannelMappedToCard);
      }

      _channelMapping[dbChannel.IdChannel] = cardIds;
      return isChannelMappedToCard;
    }
开发者ID:sanyaade-embedded-systems,项目名称:MediaPortal-1,代码行数:29,代码来源:CardAllocationCache.cs

示例2: WebChannel

 public WebChannel(Channel ch)
 {
   this.idChannel = ch.IdChannel;
   this.displayName = ch.DisplayName;
   this.grabEPG = ch.GrabEpg;
   this.isRadio = ch.IsRadio;
   this.isTv = ch.IsTv;
   this.isWebStream = ch.IsWebstream();
 }
开发者ID:rndthoughts,项目名称:ipimpplus,代码行数:9,代码来源:Classes.cs

示例3: WebMiniEPG

 public WebMiniEPG(Channel ch)
 {
   if (ch == null)
     return;
   this.idChannel = ch.IdChannel;
   this.name = ch.DisplayName;
   this.isWebStream = ch.IsWebstream();
   epgNow = new WebShortProgram(ch.CurrentProgram);
   epgNext=new WebShortProgram(ch.NextProgram);
 }
开发者ID:rndthoughts,项目名称:ipimpplus,代码行数:10,代码来源:Classes.cs

示例4: GetTuningDetailsByChannelId

    public static IList<IChannel> GetTuningDetailsByChannelId(Channel channel)
    {
      IList<IChannel> tuningDetails;
      bool tuningChannelMappingFound = _tuningChannelMapping.TryGetValue(channel.IdChannel, out tuningDetails);

      if (!tuningChannelMappingFound)
      {        
        tuningDetails = _businessLayer.GetTuningChannelsByDbChannel(channel);
        _tuningChannelMapping.Add(channel.IdChannel, tuningDetails);
      }
      return tuningDetails;
    }
开发者ID:sanyaade-embedded-systems,项目名称:MediaPortal-1,代码行数:12,代码来源:CardAllocationCache.cs

示例5: RecordingDetail

    /// <summary>
    /// constructor
    /// </summary>
    /// <param name="schedule">Schedule of this recording</param>
    /// <param name="channel">Channel on which the recording is done</param>
    /// <param name="endTime">Date/Time the recording should start without pre-record interval</param>
    /// <param name="endTime">Date/Time the recording should stop with post record interval</param>
    /// <param name="isSerie">Is serie recording</param>
    /// 
    /// 
    public RecordingDetail(Schedule schedule, Channel channel, DateTime endTime, bool isSerie)
    {
      _user = UserFactory.CreateSchedulerUser(schedule.IdSchedule);
      /*User.Name = string.Format("scheduler{0}", schedule.IdSchedule);
      User.CardId = -1;
      User.SubChannel = -1;
      User.IsAdmin = true;
      User.Priority = UserFactory.SCHEDULER_PRIORITY;*/

      _schedule = schedule;
      _channel = channel;
      _endTime = endTime;
      _program = null;
      _isSerie = isSerie;

      DateTime startTime = DateTime.MinValue;

      if (isSerie)
      {
        DateTime now = DateTime.Now.AddMinutes(schedule.PreRecordInterval);
        startTime = new DateTime(now.Year, now.Month, now.Day, schedule.StartTime.Hour, schedule.StartTime.Minute, 0);
      }
      else
      {
        startTime = schedule.StartTime;
      }

      _program = schedule.ReferencedChannel().GetProgramAt(startTime);

      //no program? then treat this as a manual recording
      if (_program == null)
      {
        _program = new TvDatabase.Program(0, DateTime.Now, endTime, "manual", "", "",
                                          TvDatabase.Program.ProgramState.None,
                                          System.Data.SqlTypes.SqlDateTime.MinValue.Value, string.Empty, string.Empty,
                                          string.Empty, string.Empty, -1, string.Empty, 0);
      }
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:48,代码来源:RecordingDetail.cs

示例6: UpdateChannelStateUserBasedOnCardOwnership

 private static void UpdateChannelStateUserBasedOnCardOwnership(ITvCardHandler tvcard, IList<IUser> allUsers,
                                                                Channel ch)
 {
   for (int i = 0; i < allUsers.Count; i++)
   {
     IUser user = allUsers[i];
     if (user.IsAdmin)
     {
       continue;
     }
     if (!tvcard.Users.IsOwner(user))
     {
       //no
       //Log.Info("Controller:    card:{0} type:{1} is tuned to different transponder", cardId, tvcard.Type);
       //allow admin users like the scheduler to use this card anyway          
       UpdateChannelStateUser(user, ChannelState.nottunable, ch.IdChannel);
     }
     else
     {
       UpdateChannelStateUser(user, ChannelState.tunable, ch.IdChannel);
     }
     allUsers[i] = user;
   }
 }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:24,代码来源:ChannelStates.cs

示例7: AddTuningDetails

    public TuningDetail AddTuningDetails(Channel channel, IChannel tvChannel)
    {
      string channelName = "";
      long channelFrequency = 0;
      int channelNumber = 0;
      int country = 31;
      bool isRadio = false;
      bool isTv = false;
      int tunerSource = 0;
      int videoInputType = 0;
      int audioInputType = 0;
      bool isVCRSignal = false;
      int symbolRate = 0;
      int modulation = 0;
      int polarisation = 0;
      int switchFrequency = 0;
      int diseqc = 0;
      int bandwidth = 8;
      bool freeToAir = true;
      int pmtPid = -1;
      int networkId = -1;
      int serviceId = -1;
      int transportId = -1;
      int minorChannel = -1;
      int majorChannel = -1;
      string provider = "";
      int channelType = 0;
      int band = 0;
      int satIndex = -1;
      int innerFecRate = (int)BinaryConvolutionCodeRate.RateNotSet;
      int pilot = (int)Pilot.NotSet;
      int rollOff = (int)RollOff.NotSet;
      string url = "";

      AnalogChannel analogChannel = tvChannel as AnalogChannel;
      if (analogChannel != null)
      {
        channelName = analogChannel.Name;
        channelFrequency = analogChannel.Frequency;
        channelNumber = analogChannel.ChannelNumber;
        country = analogChannel.Country.Index;
        isRadio = analogChannel.IsRadio;
        isTv = analogChannel.IsTv;
        tunerSource = (int)analogChannel.TunerSource;
        videoInputType = (int)analogChannel.VideoSource;
        audioInputType = (int)analogChannel.AudioSource;
        isVCRSignal = analogChannel.IsVCRSignal;
        channelType = 0;
      }

      ATSCChannel atscChannel = tvChannel as ATSCChannel;
      if (atscChannel != null)
      {
        majorChannel = atscChannel.MajorChannel;
        minorChannel = atscChannel.MinorChannel;
        channelNumber = atscChannel.PhysicalChannel;
        //videoPid = atscChannel.VideoPid;
        //audioPid = atscChannel.AudioPid;
        modulation = (int)atscChannel.ModulationType;
        channelType = 1;
      }

      DVBCChannel dvbcChannel = tvChannel as DVBCChannel;
      if (dvbcChannel != null)
      {
        symbolRate = dvbcChannel.SymbolRate;
        modulation = (int)dvbcChannel.ModulationType;
        channelNumber = dvbcChannel.LogicalChannelNumber;
        channelType = 2;
      }

      DVBSChannel dvbsChannel = tvChannel as DVBSChannel;
      if (dvbsChannel != null)
      {
        symbolRate = dvbsChannel.SymbolRate;
        polarisation = (int)dvbsChannel.Polarisation;
        switchFrequency = dvbsChannel.SwitchingFrequency;
        diseqc = (int)dvbsChannel.DisEqc;
        band = (int)dvbsChannel.BandType;
        satIndex = dvbsChannel.SatelliteIndex;
        modulation = (int)dvbsChannel.ModulationType;
        innerFecRate = (int)dvbsChannel.InnerFecRate;
        pilot = (int)dvbsChannel.Pilot;
        rollOff = (int)dvbsChannel.Rolloff;
        channelNumber = dvbsChannel.LogicalChannelNumber;
        channelType = 3;
      }

      DVBTChannel dvbtChannel = tvChannel as DVBTChannel;
      if (dvbtChannel != null)
      {
        bandwidth = dvbtChannel.BandWidth;
        channelNumber = dvbtChannel.LogicalChannelNumber;
        channelType = 4;
      }

      DVBIPChannel dvbipChannel = tvChannel as DVBIPChannel;
      if (dvbipChannel != null)
      {
        url = dvbipChannel.Url;
//.........这里部分代码省略.........
开发者ID:sekotin,项目名称:MediaPortal-1,代码行数:101,代码来源:BusinessLayer.cs

示例8: 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;
 }
开发者ID:sekotin,项目名称:MediaPortal-1,代码行数:11,代码来源:BusinessLayer.cs

示例9: IsChannelMappedToCard

 public bool IsChannelMappedToCard(Channel dbChannel, Card card, bool forEpg)
 {
   SqlBuilder sb = new SqlBuilder(StatementType.Select, typeof (ChannelMap));
   SqlStatement origStmt = sb.GetStatement(true);
   string sql = "select cm.* from ChannelMap cm where cm.idChannel =" +
                dbChannel.IdChannel + " and cm.idCard=" + card.IdCard + (forEpg ? "" : " and cm.epgOnly=0");
   SqlStatement statement = new SqlStatement(StatementType.Select, origStmt.Command, sql,
                                             typeof (Channel));
   IList<ChannelMap> maps = ObjectFactory.GetCollection<ChannelMap>(statement.Execute());
   return maps != null && maps.Count > 0;
 }
开发者ID:sekotin,项目名称:MediaPortal-1,代码行数:11,代码来源:BusinessLayer.cs

示例10: AddChannelToRadioGroup

 public void AddChannelToRadioGroup(Channel channel, RadioChannelGroup group)
 {
   bool found = false;
   IList<RadioGroupMap> groupMaps = group.ReferringRadioGroupMap();
   foreach (RadioGroupMap map in groupMaps)
   {
     if (map.IdChannel == channel.IdChannel)
     {
       found = true;
       break;
     }
   }
   if (!found)
   {
     RadioGroupMap map = new RadioGroupMap(group.IdGroup, channel.IdChannel, channel.SortOrder);
     map.Persist();
   }
 }
开发者ID:sekotin,项目名称:MediaPortal-1,代码行数:18,代码来源:BusinessLayer.cs

示例11: AddChannelToGroup

 public void AddChannelToGroup(Channel channel, string groupName)
 {
   bool found = false;
   ChannelGroup group = CreateGroup(groupName);
   IList<GroupMap> groupMaps = group.ReferringGroupMap();
   foreach (GroupMap map in groupMaps)
   {
     if (map.IdChannel == channel.IdChannel)
     {
       found = true;
       break;
     }
   }
   if (!found)
   {
     GroupMap map = new GroupMap(group.IdGroup, channel.IdChannel, channel.SortOrder);
     map.Persist();
   }
 }
开发者ID:sekotin,项目名称:MediaPortal-1,代码行数:19,代码来源:BusinessLayer.cs

示例12: SearchMinimalPrograms

 public IList<Program> SearchMinimalPrograms(DateTime startTime, DateTime endTime, string programName,
                                             Channel channel)
 {
   return channel != null
            ? GetProgramsByTitle(channel, startTime, endTime, programName)
            : GetProgramsByTitle(startTime, endTime, programName);
 }
开发者ID:sekotin,项目名称:MediaPortal-1,代码行数:7,代码来源:BusinessLayer.cs

示例13: PreTuneChecks

    /// <summary>
    /// Pre-tune checks "outsourced" to reduce code complexity
    /// </summary>
    /// <param name="channel">the channel to tune</param>
    /// <param name="doContinue">indicate to continue</param>
    /// <returns>return value when not continuing</returns>
    private static bool PreTuneChecks(Channel channel, out bool doContinue)
    {
      doContinue = false;
      if (_suspended && _waitonresume > 0)
      {
        Log.Info("TVHome.ViewChannelAndCheck(): system just woke up...waiting {0} ms., suspended {2}", _waitonresume,
                 _suspended);
        Thread.Sleep(_waitonresume);
      }

      _waitForVideoReceived.Reset();

      if (channel == null)
      {
        Log.Info("TVHome.ViewChannelAndCheck(): channel==null");
        return false;
      }
      Log.Info("TVHome.ViewChannelAndCheck(): View channel={0}", channel.DisplayName);

      //if a channel is untunable, then there is no reason to carry on or even stop playback.   
      var userCopy = Card.User.Clone() as IUser;
      if (userCopy != null) 
      {
        userCopy.Name = Dns.GetHostName();
        ChannelState CurrentChanState = TvServer.GetChannelState(channel.IdChannel, userCopy);
        if (CurrentChanState == ChannelState.nottunable)
        {
          ChannelTuneFailedNotifyUser(TvResult.AllCardsBusy, false, channel);
          return false;
        }
      }      

      //BAV: fixing mantis bug 1263: TV starts with no video if Radio is previously ON & channel selected from TV guide
      if ((!channel.IsRadio && g_Player.IsRadio) || (channel.IsRadio && !g_Player.IsRadio))
      {
        Log.Info("TVHome.ViewChannelAndCheck(): Stop g_Player");
        g_Player.Stop(true);
      }
      // do we stop the player when changing channel ?
      // _userChannelChanged is true if user did interactively change the channel, like with mini ch. list. etc.
      if (!_userChannelChanged)
      {
        if (g_Player.IsTVRecording)
        {
          return true;
        }
        if (!_autoTurnOnTv) //respect the autoturnontv setting.
        {
          if (g_Player.IsVideo || g_Player.IsDVD || g_Player.IsMusic)
          {
            return true;
          }
        }
        else
        {
          if (g_Player.IsVideo || g_Player.IsDVD || g_Player.IsMusic || g_Player.IsCDA) // || g_Player.IsRadio)
          {
            g_Player.Stop(true); // tell that we are zapping so exclusive mode is not going to be disabled
          }
        }
      }
      else if (g_Player.IsTVRecording && _userChannelChanged)
      //we are watching a recording, we have now issued a ch. change..stop the player.
      {
        _userChannelChanged = false;
        g_Player.Stop(true);
      }
      else if ((channel.IsTv && g_Player.IsRadio) || (channel.IsRadio && g_Player.IsTV) || g_Player.IsCDA ||
               g_Player.IsMusic || g_Player.IsVideo)
      {
        g_Player.Stop(true);
      }

      if (Card != null)
      {
        if (g_Player.Playing && g_Player.IsTV && !g_Player.IsTVRecording)
        //modified by joboehl. Avoids other video being played instead of TV. 
        {
          //if we're already watching this channel, then simply return
          if (Card.IsTimeShifting == true && Card.IdChannel == channel.IdChannel)
          {
            return true;
          }
        }
      }

      // if all checks passed then we won't return
      doContinue = true;
      return true; // will be ignored
    }
开发者ID:splatterpop,项目名称:MediaPortal-1,代码行数:96,代码来源:TVHome.cs

示例14: ChannelTuneFailedNotifyUser

    private static void ChannelTuneFailedNotifyUser(TvResult succeeded, bool wasPlaying, Channel channel)
    {
      GUIGraphicsContext.RenderBlackImage = false;

      _lastError.Result = succeeded;
      _lastError.FailingChannel = channel;
      _lastError.Messages.Clear();

      int TextID = 0;
      _lastError.Messages.Add(GUILocalizeStrings.Get(1500));
      switch (succeeded)
      {
        case TvResult.NoPmtFound:
          TextID = 1498;
          break;
        case TvResult.NoSignalDetected:
          TextID = 1499;
          break;
        case TvResult.CardIsDisabled:
          TextID = 1501;
          break;
        case TvResult.AllCardsBusy:
          TextID = 1502;
          break;
        case TvResult.ChannelIsScrambled:
          TextID = 1503;
          break;
        case TvResult.NoVideoAudioDetected:
          TextID = 1504;
          break;
        case TvResult.UnableToStartGraph:
          TextID = 1505;
          break;
        case TvResult.TuneCancelled:
          TextID = 1524;
          break;
        case TvResult.UnknownError:
          // this error can also happen if we have no connection to the server.
          if (!Connected) // || !IsRemotingConnected())
          {
            TextID = 1510;
          }
          else
          {
            TextID = 1506;
          }
          break;
        case TvResult.UnknownChannel:
          TextID = 1507;
          break;
        case TvResult.ChannelNotMappedToAnyCard:
          TextID = 1508;
          break;
        case TvResult.NoTuningDetails:
          TextID = 1509;
          break;
        case TvResult.GraphBuildingFailed:
          TextID = 1518;
          break;
        case TvResult.SWEncoderMissing:
          TextID = 1519;
          break;
        case TvResult.NoFreeDiskSpace:
          TextID = 1520;
          break;
        default:
          // this error can also happen if we have no connection to the server.
          if (!Connected) // || !IsRemotingConnected())
          {
            TextID = 1510;
          }
          else
          {
            TextID = 1506;
          }
          break;
      }

      if (TextID != 0)
      {
        _lastError.Messages.Add(GUILocalizeStrings.Get(TextID));
      }

      GUIDialogNotify pDlgNotify = (GUIDialogNotify)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_NOTIFY);
      string caption = GUILocalizeStrings.Get(605) + " - " + _lastError.FailingChannel.DisplayName;
      pDlgNotify.SetHeading(caption); //my tv
      pDlgNotify.SetImage(TVUtil.GetChannelLogo(_lastError.FailingChannel));
      StringBuilder sbMessage = new StringBuilder();
      // ignore the "unable to start timeshift" line to avoid scrolling, because NotifyDLG has very few space available.
      for (int idx = 1; idx < _lastError.Messages.Count; idx++)
      {
        sbMessage.AppendFormat("\n{0}", _lastError.Messages[idx]);
      }
      pDlgNotify.SetText(sbMessage.ToString());

      // Fullscreen shows the TVZapOSD to handle error messages
      if (GUIWindowManager.ActiveWindow == (int)(int)Window.WINDOW_TVFULLSCREEN)
      {
        // If failed and wasPlaying TV, left screen as it is and show osd with error message 
        Log.Info("send message to fullscreen tv");
//.........这里部分代码省略.........
开发者ID:splatterpop,项目名称:MediaPortal-1,代码行数:101,代码来源:TVHome.cs

示例15: UpdateNextEpgProperties

    private static void UpdateNextEpgProperties(Channel ch)
    {
      Program next = null;
      if (ch == null)
      {
        Log.Debug("UpdateNextEpgProperties: no channel, returning");
      }
      else
      {
        next = ch.NextProgram;
        if (next == null)
        {
          Log.Debug("UpdateNextEpgProperties: no EPG data, returning");
        }
      }

      if (next != null)
      {
        GUIPropertyManager.SetProperty("#TV.Next.title", next.Title);
        GUIPropertyManager.SetProperty("#TV.Next.compositetitle", TVUtil.GetDisplayTitle(next));
        GUIPropertyManager.SetProperty("#TV.Next.start",
                                               next.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat));
        GUIPropertyManager.SetProperty("#TV.Next.stop",
                                       next.EndTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat));
        GUIPropertyManager.SetProperty("#TV.Next.description", next.Description);
        GUIPropertyManager.SetProperty("#TV.Next.subtitle", next.EpisodeName);
        GUIPropertyManager.SetProperty("#TV.Next.episode", next.EpisodeNumber);
        GUIPropertyManager.SetProperty("#TV.Next.genre", next.Genre);
        GUIPropertyManager.SetProperty("#TV.Next.remaining", Utils.SecondsToHMSString(next.EndTime - next.StartTime));
      }
      else
      {
        GUIPropertyManager.SetProperty("#TV.Next.title", GUILocalizeStrings.Get(736));          // no epg for this channel
        GUIPropertyManager.SetProperty("#TV.Next.compositetitle", GUILocalizeStrings.Get(736)); // no epg for this channel
        GUIPropertyManager.SetProperty("#TV.Next.start", String.Empty);
        GUIPropertyManager.SetProperty("#TV.Next.stop", String.Empty);
        GUIPropertyManager.SetProperty("#TV.Next.description", String.Empty);
        GUIPropertyManager.SetProperty("#TV.Next.subtitle", String.Empty);
        GUIPropertyManager.SetProperty("#TV.Next.episode", String.Empty);
        GUIPropertyManager.SetProperty("#TV.Next.genre", String.Empty);
      }
    }
开发者ID:splatterpop,项目名称:MediaPortal-1,代码行数:42,代码来源:TVHome.cs


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