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


C# DataContracts.Channel类代码示例

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


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

示例1: LiveStream

 /// <summary>
 /// Create a new instance of LiveStream.
 /// </summary>
 /// <param name="channel">The channel being streamed.</param>
 /// <param name="rtspUrl">The rtsp URL to the stream.</param>
 /// <param name="streamStartedTimeUtc">The date and time the stream was first started.</param>
 public LiveStream(Channel channel, string rtspUrl, DateTime streamStartedTimeUtc)
 {
     this.Channel = channel;
     this.RtspUrl = rtspUrl;
     this.StreamStartedTime = streamStartedTimeUtc.ToLocalTime();
     this.StreamLastAliveTimeUtc = streamStartedTimeUtc;
 }
开发者ID:Inspirony,项目名称:Emby.Plugins,代码行数:13,代码来源:LiveStream.cs

示例2: ProgramEventArgs

 public ProgramEventArgs(GuideProgramSummary guideProgram, Channel channel, Point location)
 {
     this.GuideProgram = guideProgram;
     this.Channel = channel;
     this.Location = location;
     this.UpcomingProgramId = guideProgram.GetUniqueUpcomingProgramId(channel.ChannelId);
 }
开发者ID:Christoph21x,项目名称:ARGUS-TV,代码行数:7,代码来源:EpgControl.cs

示例3: AppendProgramDetails

 public static void AppendProgramDetails(StringBuilder reply, Channel channel, IProgramSummary program)
 {
     reply.AppendFormat("[{0}] {1} {2}-{3} {4}",
         channel.DisplayName,
         GetShortDayDateString(program.StartTime),
         program.StartTime.ToShortTimeString().PadLeft(5, '0'),
         program.StopTime.ToShortTimeString().PadLeft(5, '0'),
         program.CreateProgramTitle());
 }
开发者ID:ElRakiti,项目名称:ARGUS-TV,代码行数:9,代码来源:Utility.cs

示例4: GetProgramAt

 public IProgramSummary GetProgramAt(int number, out Channel channel, out Guid? upcomingProgramId)
 {
     if (--number >= 0)
     {
         if (_guidePrograms != null
             && number < _guidePrograms.Count)
         {
             channel = this.Channel;
             upcomingProgramId = _guidePrograms[number].GetUniqueUpcomingProgramId(channel.ChannelId);
             return _guidePrograms[number];
         }
         else if (_searchedPrograms != null
             && number < _searchedPrograms.Count)
         {
             channel = _searchedPrograms[number].Channel;
             upcomingProgramId = _searchedPrograms[number].GetUniqueUpcomingProgramId();
             return _searchedPrograms[number];
         }
         else if (_upcomingPrograms != null
             && number < _upcomingPrograms.Count)
         {
             channel = _upcomingPrograms[number].Channel;
             upcomingProgramId = _upcomingPrograms[number].UpcomingProgramId;
             return _upcomingPrograms[number];
         }
         else if (_upcomingRecordings != null
             && number < _upcomingRecordings.Count)
         {
             channel = _upcomingRecordings[number].Program.Channel;
             upcomingProgramId = _upcomingRecordings[number].Program.UpcomingProgramId;
             return _upcomingRecordings[number];
         }
     }
     channel = null;
     upcomingProgramId = null;
     return null;
 }
开发者ID:Christoph21x,项目名称:ARGUS-TV,代码行数:37,代码来源:Programs.cs

示例5: Programs

 public Programs(Channel channel, IList<GuideProgramSummary> guidePrograms)
 {
     _channel = channel;
     _guidePrograms = guidePrograms;
 }
开发者ID:Christoph21x,项目名称:ARGUS-TV,代码行数:5,代码来源:Programs.cs

示例6: GetLinkedMessageAndColor

 private void GetLinkedMessageAndColor(Channel channel, out string message, out Color rowColor)
 {
     bool isAutoLinked;
     bool duplicateChannelsFound;
     LinkedMediaPortalChannel linkedChannel =
        ChannelLinks.GetLinkedMediaPortalChannel(channel, out isAutoLinked, out duplicateChannelsFound);
     if (duplicateChannelsFound)
     {
         message = "More than one channel found, change name or link manually";
         rowColor = Color.Red;
     }
     else if (linkedChannel == null)
     {
         message = "Channel not linked, change name or link manually";
         rowColor = Color.Red;
     }
     else if (isAutoLinked)
     {
         message = "Linked (auto)";
         rowColor = Color.Black;
     }
     else
     {
         message = "Linked to " + linkedChannel.DisplayName;
         rowColor = Color.DarkGreen;
     }
 }
开发者ID:ARGUS-TV,项目名称:ARGUS-TV-Recorders,代码行数:27,代码来源:SetupForm.cs

示例7: MergeExtraPrograms

 private void MergeExtraPrograms(Channel channel, ChannelPrograms channelPrograms, DateTime fromDateTime, DateTime toDateTime)
 {
     if (toDateTime > fromDateTime)
     {
         var guidePrograms = Proxies.GuideService.GetChannelProgramsBetween(channel.GuideChannelId.Value, fromDateTime, toDateTime).Result;
         foreach (GuideProgramSummary guideProgram in guidePrograms)
         {
             channelPrograms.InsertProgram(guideProgram);
         }
     }
 }
开发者ID:Christoph21x,项目名称:ARGUS-TV,代码行数:11,代码来源:GuideController.cs

示例8: GetChannelProgramIcon

        private string GetChannelProgramIcon(Channel channel, Guid guideProgramId, out GuideUpcomingProgram guideUpcomingProgram)
        {
            Guid upcomingProgramId = UpcomingProgram.GetUniqueUpcomingProgramId(guideProgramId, channel.ChannelId);

            guideUpcomingProgram = null;
            string recordIconImage = null;
            GuideUpcomingProgram upcoming = null;
            ScheduleType type = ScheduleType.Recording;
            if (_model.UpcomingRecordingsById.ContainsKey(upcomingProgramId))
            {
                type = ScheduleType.Recording;
                upcoming = _model.UpcomingRecordingsById[upcomingProgramId];
                guideUpcomingProgram = upcoming;
            }
            else if (_model.UpcomingAlertsById.ContainsKey(upcomingProgramId))
            {
                type = ScheduleType.Alert;
                upcoming = _model.UpcomingAlertsById[upcomingProgramId];
                guideUpcomingProgram = upcoming;
            }
            else if (_model.UpcomingSuggestionsById.ContainsKey(upcomingProgramId))
            {
                type = ScheduleType.Suggestion;
                upcoming = _model.UpcomingSuggestionsById[upcomingProgramId];
            }
            if (upcoming != null
                && upcoming.ChannelId == channel.ChannelId)
            {
                recordIconImage = Utility.GetIconImageFileName(type, upcoming);
            }
            return recordIconImage;
        }
开发者ID:Christoph21x,项目名称:ARGUS-TV,代码行数:32,代码来源:GuideBase.cs

示例9: ZapToChannel

        /// <summary>
        /// Changes the current channel and channelgroup after a specified delay.
        /// </summary>
        /// <param name="channelGroup">The channelgroup to switch to.</param>
        /// <param name="channel">The channel to switch to</param>
        /// <param name="useZapDelay">If true, the configured zap delay is used. Otherwise it zaps immediately.</param>
        public void ZapToChannel(ChannelGroup channelGroup, Channel channel, bool useZapDelay)
        {
            Log.Debug("ChannelNavigator.ZapToChannel {0} - zapdelay {1}", channel.DisplayName, useZapDelay);

            _zapGroup = channelGroup ?? _currentChannelGroup;
            _zapChannel = channel;

            if (useZapDelay)
            {
                _zapTime = DateTime.Now.AddMilliseconds(_zapDelayMs);
            }
            else
            {
                _zapTime = DateTime.Now;
            }
        }
开发者ID:Rpatrishh,项目名称:ARGUS-TV-Clients,代码行数:22,代码来源:ChannelNavigator.cs

示例10: StopLiveStream

        /// <summary>
        /// Use this when you are sure that the livestream playback was stopped some time ago.
        /// </summary>
        public void StopLiveStream()
        {
            Log.Debug("ChannelNavigator: StopLiveStream()");
            if (_liveStream != null)
            {
                this.ControlAgent.StopLiveStream(_liveStream);
                _liveStream = null;

                if (_currentChannel != null)
                    _navigatorChannels[_currentChannel.ChannelType].PreviousChannel = _currentChannel;
            }

            if (!_doingChannelChange && !_lastChannelChangeFailed)
                _currentChannel = null;
        }
开发者ID:Rpatrishh,项目名称:ARGUS-TV-Clients,代码行数:18,代码来源:ChannelNavigator.cs

示例11: CheckChannelChange

        /// <summary>
        /// Checks if it is time to zap to a different channel. This is called during Process().
        /// </summary>
        public bool CheckChannelChange()
        {
            if (_reentrant)
            {
                return false;
            }
            try
            {
                _reentrant = true;

                // Zapping to another group or channel?
                if (_zapGroup != null || _zapChannel != null)
                {
                    // Time to zap?
                    if (DateTime.Now >= _zapTime)
                    {
                        Log.Debug("ChannelNavigator: CheckChannelChange()_DateTime.Now >= _zapTime,_zapgroup = {0} , _zapchannel = {1}", _zapGroup.GroupName, _zapChannel.DisplayName);
                        // Zapping to another group?
                        if (_zapGroup != null && _zapGroup != _currentChannelGroup)
                        {
                            // Change current group (and possibly zap to the first channel of the group)
                            if (_currentChannelGroup != null)
                            {
                                _navigatorChannels[_currentChannelGroup.ChannelType].PreviousChannelGroup = _currentChannelGroup;
                            }
                            _currentChannelGroup = _zapGroup;
                            RefreshChannelsInGroup(_zapGroup.ChannelType);
                            if (_zapChannel == null
                                && _navigatorChannels[_zapGroup.ChannelType].Channels.Count > 0)
                            {
                                _zapChannel = _navigatorChannels[_zapGroup.ChannelType].Channels[0];
                            }
                        }

                        // Zap to desired channel
                        Channel zappingTo = _zapChannel;
                        _zapChannel = null;
                        _zapGroup = null;

                        if (PluginMain.Navigator.CurrentChannel != null
                            && PluginMain.Navigator.CurrentChannel.ChannelId == zappingTo.ChannelId
                            && _liveStream != null && !_lastChannelChangeFailed)
                        {
                            Log.Debug("ChannelNavigator: CheckChannelChange()_CurrentChannel.ChannelId = zappingTo.ChannelId --> break off zapping");
                            zappingTo = null;
                        }

                        if (zappingTo != null)
                        {
                            if ((this.IsLiveStreamOn && _currentChannel != null
                                && zappingTo.ChannelType != _currentChannel.ChannelType)
                                || (g_Player.Playing && !this.IsLiveStreamOn))
                            {
                                //g_Player needs a comlete stop when the ChannelType changes
                                if (_liveStream != null)
                                {
                                    g_Player.PauseGraph();
                                    Thread.Sleep(100);
                                    this.StopLiveStream();
                                }
                                g_Player.Stop(true);
                                Thread.Sleep(250);
                            }

                            Channel prevChannel = _currentChannel;
                            ChannelGroup prevGroup = _currentChannelGroup;
                            TuneLiveStream(zappingTo);
                            if (prevChannel != null)
                            {
                                _navigatorChannels[prevChannel.ChannelType].PreviousChannel = prevChannel;
                                _navigatorChannels[prevGroup.ChannelType].PreviousChannelGroup = prevGroup;
                            }
                            _navigatorChannels[zappingTo.ChannelType].LastChannel = _currentChannel;
                            _navigatorChannels[zappingTo.ChannelType].LastChannelGroup = _currentChannelGroup;

                            if (zappingTo.ChannelType == ChannelType.Radio)
                            {
                                RadioHome.SetMusicProperties(zappingTo.DisplayName, zappingTo.ChannelId);
                            }

                        }
                        _zapChannelNr = -1;
                        _reentrant = false;
                        return true;
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Error("ChannelNavigator: error CheckChannelChange() = {0}", ex.Message);
            }
            finally
            {
                _reentrant = false;
            }
            return false;
        }
开发者ID:Rpatrishh,项目名称:ARGUS-TV-Clients,代码行数:100,代码来源:ChannelNavigator.cs

示例12: AsyncStopLiveStream

        /// <summary>
        /// Use this when the livestream playback just stopped.
        /// </summary>
        public void AsyncStopLiveStream()
        {
            if (_liveStream != null)
            {
                _streamToStopAsync = _liveStream;
                _liveStream = null;

                if (_currentChannel != null)
                    _navigatorChannels[_currentChannel.ChannelType].PreviousChannel = _currentChannel;

                _asyncStopLiveStreamThread = new Thread(new ThreadStart(AsyncStopLiveStreamThreadMain));
                _asyncStopLiveStreamThread.Start();
            }

            if (!_doingChannelChange && !_lastChannelChangeFailed)
                _currentChannel = null;
        }
开发者ID:Rpatrishh,项目名称:ARGUS-TV-Clients,代码行数:20,代码来源:ChannelNavigator.cs

示例13: TuneLiveStream

        private void TuneLiveStream(Channel channel)
        {
            Log.Debug("ChannelNavigator: TuneLiveStream(), channel = {0}", channel.DisplayName);
            if (channel != null)
            {
                using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
                {
                    LiveStream liveStream = _liveStream;
                    CurrentAndNextProgram currentAndNext = tvSchedulerAgent.GetCurrentAndNextForChannel(channel.ChannelId, true, _liveStream);//null);

                    _currentChannel = channel;
                    _doingChannelChange = true;
                    RenderBlackImage();

                    if (liveStream != null)
                    {
                        try
                        {
                            g_Player.PauseGraph();
                            g_Player.OnZapping(0x80);

                            result = this.ControlAgent.TuneLiveStream(channel, ref liveStream);
                            Log.Debug("ChannelNavigator: First try to re-tune the existing TV stream (staying on the same card), result = {0}", result);

                            if (result == LiveStreamResult.Succeeded)
                            {
                                if (_isAnalog)
                                    g_Player.OnZapping(-1);

                                double duration = g_Player.Duration;
                                if (g_Player.Duration < 0.0)
                                    result = LiveStreamResult.UnknownError;
                                else
                                {
                                    g_Player.SeekAbsolute(duration);
                                    g_Player.ContinueGraph();
                                }
                            }
                            else if (result == LiveStreamResult.NoRetunePossible)// not mapped to card, card in use by recorder or other user ---> start new stream
                            {
                                // Now re-try the new channel with a new stream.
                                Log.Debug("ChannelNavigator: Seems a re-tune has failed, stop the current stream and start a new one");
                                SilentlyStopLiveStream(liveStream);
                                result = StartAndPlayNewLiveStream(channel, liveStream);
                            }
                        }
                        catch
                        {
                            result = LiveStreamResult.UnknownError;
                            Log.Error("ChannelNavigator: TuneLiveStream error");
                        }
                    }
                    else
                    {
                        result = StartAndPlayNewLiveStream(channel,liveStream);
                    }

                    _doingChannelChange = false;
                    if (result == LiveStreamResult.Succeeded)
                    {
                        _lastChannelChangeFailed = false;
                        StopRenderBlackImage();
                    }
                    else
                    {
                        _lastChannelChangeFailed = true;
                        SilentlyStopLiveStream(liveStream);
                        ChannelTuneFailedNotifyUser(result, channel);
                    }
                }
            }
        }
开发者ID:Rpatrishh,项目名称:ARGUS-TV-Clients,代码行数:72,代码来源:ChannelNavigator.cs

示例14: LoadSettings

        private void LoadSettings(out string currentChannelName)
        {
            using (global::MediaPortal.Profile.Settings xmlreader = new global::MediaPortal.Profile.MPSettings())
            {
                _cursorX = xmlreader.GetValueAsInt(this.SettingsSection, "ypos", 0);
                _channelOffset = xmlreader.GetValueAsInt(this.SettingsSection, "yoffset", 0);
                _byIndex = xmlreader.GetValueAsBool("mytv", "byindex", true);
                _showChannelNumber = xmlreader.GetValueAsBool("mytv", "showchannelnumber", false);
                _channelNumberMaxLength = xmlreader.GetValueAsInt("mytv", "channelnumbermaxlength", 3);
                _timePerBlock = xmlreader.GetValueAsInt(this.SettingsSection, "timeperblock", 30);
                _hdtvProgramText = xmlreader.GetValueAsString("mytv", "hdtvProgramText", "(HDTV)");
                _guideContinuousScroll = xmlreader.GetValueAsBool("mytv", "continuousScrollGuide", false);
                _loopDelay = xmlreader.GetValueAsInt("gui", "listLoopDelay", 0);
                currentChannelName = xmlreader.GetValueAsString(this.SettingsSection, "channel", String.Empty);

                _currentChannel = PluginMain.Navigator.CurrentChannel ?? PluginMain.Navigator.GetPreviousChannel(_channelType);
                if (_currentChannel != null)
                {
                    currentChannelName = _currentChannel.DisplayName;
                }

                if (_channelOffset < 0)
                {
                    _channelOffset = 0;
                }
            }
            _useNewRecordingButtonColor =
              Utils.FileExistsInCache(Path.Combine(GUIGraphicsContext.Skin, @"media\tvguide_recButton_Focus_middle.png"));
            _useNewPartialRecordingButtonColor =
              Utils.FileExistsInCache(Path.Combine(GUIGraphicsContext.Skin, @"media\tvguide_partRecButton_Focus_middle.png"));
            _useNewNotifyButtonColor =
              Utils.FileExistsInCache(Path.Combine(GUIGraphicsContext.Skin, @"media\tvguide_notifyButton_Focus_middle.png"));
            _useHdProgramIcon =
              Utils.FileExistsInCache(Path.Combine(GUIGraphicsContext.Skin, @"media\tvguide_hd_program.png"));
        }
开发者ID:Christoph21x,项目名称:ARGUS-TV,代码行数:35,代码来源:GuideBase.cs

示例15: updateSingleChannelNumber

 private void updateSingleChannelNumber()
 {
     // update selected channel
     if (!_singleChannelView)
     {
         _singleChannelNumber = _cursorX + _channelOffset;
         if (_singleChannelNumber < 0)
         {
             _singleChannelNumber = 0;
         }
         if (_singleChannelNumber >= _channelList.Count)
         {
             _singleChannelNumber -= _channelList.Count;
         }
         // instead of direct casting us "as"; else it fails for other controls!
         GUIButton3PartControl img = GetControl(_cursorX + (int)Controls.IMG_CHAN1) as GUIButton3PartControl;
         ;
         if (null != img)
         {
             _currentChannel = (Channel)img.Data;
         }
     }
 }
开发者ID:Christoph21x,项目名称:ARGUS-TV,代码行数:23,代码来源:GuideBase.cs


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