本文整理汇总了C#中TvControl.TvServer.TimeShiftingWouldUseCard方法的典型用法代码示例。如果您正苦于以下问题:C# TvServer.TimeShiftingWouldUseCard方法的具体用法?C# TvServer.TimeShiftingWouldUseCard怎么用?C# TvServer.TimeShiftingWouldUseCard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TvControl.TvServer
的用法示例。
在下文中一共展示了TvServer.TimeShiftingWouldUseCard方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewChannelAndCheck
/// <summary>
/// Tunes to a new channel
/// </summary>
/// <param name="channel"></param>
/// <returns></returns>
public static bool ViewChannelAndCheck(Channel channel)
{
bool checkResult;
bool doContinue;
if (!Connected)
{
return false;
}
_status.Clear();
_doingChannelChange = false;
try
{
checkResult = PreTuneChecks(channel, out doContinue);
if (doContinue == false)
return checkResult;
_doingChannelChange = true;
TvResult succeeded;
IUser user = new User();
if (Card != null)
{
user.CardId = Card.Id;
}
if ((g_Player.Playing && g_Player.IsTimeShifting && !g_Player.Stopped) && (g_Player.IsTV || g_Player.IsRadio))
{
_status.Set(LiveTvStatus.WasPlaying);
}
//Start timeshifting the new tv channel
TvServer server = new TvServer();
VirtualCard card;
int newCardId = -1;
// check which card will be used
newCardId = server.TimeShiftingWouldUseCard(ref user, channel.IdChannel);
//Added by joboehl - If any major related to the timeshifting changed during the start, restart the player.
if (newCardId != -1 && Card.Id != newCardId)
{
_status.Set(LiveTvStatus.CardChange);
RegisterCiMenu(newCardId);
}
// we need to stop player HERE if card has changed.
if (_status.AllSet(LiveTvStatus.WasPlaying | LiveTvStatus.CardChange))
{
Log.Debug("TVHome.ViewChannelAndCheck(): Stopping player. CardId:{0}/{1}, RTSP:{2}", Card.Id, newCardId,
Card.RTSPUrl);
Log.Debug("TVHome.ViewChannelAndCheck(): Stopping player. Timeshifting:{0}", Card.TimeShiftFileName);
Log.Debug("TVHome.ViewChannelAndCheck(): rebuilding graph (card changed) - timeshifting continueing.");
}
if (_status.IsSet(LiveTvStatus.WasPlaying))
{
RenderBlackImage();
g_Player.PauseGraph();
}
else
{
// if CI menu is not attached due to card change, do it if graph was not playing
// (some handlers use polling threads that get stopped on graph stop)
if (_status.IsNotSet(LiveTvStatus.CardChange))
RegisterCiMenu(newCardId);
}
// if card was not changed
if (_status.IsNotSet(LiveTvStatus.CardChange))
{
g_Player.OnZapping(0x80); // Setup Zapping for TsReader, requesting new PAT from stream
}
bool cardChanged = false;
succeeded = server.StartTimeShifting(ref user, channel.IdChannel, out card, out cardChanged);
if (_status.IsSet(LiveTvStatus.WasPlaying))
{
if (card != null)
g_Player.OnZapping((int)card.Type);
else
g_Player.OnZapping(-1);
}
if (succeeded != TvResult.Succeeded)
{
//timeshifting new channel failed.
g_Player.Stop();
// ensure right channel name, even if not watchable:Navigator.Channel = channel;
ChannelTuneFailedNotifyUser(succeeded, _status.IsSet(LiveTvStatus.WasPlaying), channel);
//.........这里部分代码省略.........