本文整理汇总了C++中CPVRChannel::ChannelNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRChannel::ChannelNumber方法的具体用法?C++ CPVRChannel::ChannelNumber怎么用?C++ CPVRChannel::ChannelNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRChannel
的用法示例。
在下文中一共展示了CPVRChannel::ChannelNumber方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnAction
//.........这里部分代码省略.........
break;
case ACTION_AUDIO_NEXT_LANGUAGE:
{
if (g_application.m_pPlayer->GetAudioStreamCount() == 1)
return true;
if(g_settings.m_currentVideoSettings.m_AudioStream < 0)
g_settings.m_currentVideoSettings.m_AudioStream = g_application.m_pPlayer->GetAudioStream();
g_settings.m_currentVideoSettings.m_AudioStream++;
if (g_settings.m_currentVideoSettings.m_AudioStream >= g_application.m_pPlayer->GetAudioStreamCount())
g_settings.m_currentVideoSettings.m_AudioStream = 0;
g_application.m_pPlayer->SetAudioStream(g_settings.m_currentVideoSettings.m_AudioStream); // Set the audio stream to the one selected
CStdString aud;
g_application.m_pPlayer->GetAudioStreamName(g_settings.m_currentVideoSettings.m_AudioStream,aud);
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Info, g_localizeStrings.Get(460), aud, DisplTime, false, MsgTime);
return true;
}
break;
case REMOTE_0:
case REMOTE_1:
case REMOTE_2:
case REMOTE_3:
case REMOTE_4:
case REMOTE_5:
case REMOTE_6:
case REMOTE_7:
case REMOTE_8:
case REMOTE_9:
{
if (g_application.CurrentFileItem().IsLiveTV())
{
CPVRChannel channel;
int iChannelNumber = -1;
g_PVRManager.GetCurrentChannel(channel);
if (action.GetID() == REMOTE_0)
{
iChannelNumber = g_PVRManager.GetPreviousChannel();
}
else
{
int autoCloseTime = g_guiSettings.GetBool("pvrplayback.switchautoclose") ? 1500 : 0;
CStdString strChannel;
strChannel.Format("%i", action.GetID() - REMOTE_0);
if (CGUIDialogNumeric::ShowAndGetNumber(strChannel, g_localizeStrings.Get(19000), autoCloseTime) || autoCloseTime)
iChannelNumber = atoi(strChannel.c_str());
}
if (iChannelNumber > 0 && iChannelNumber != channel.ChannelNumber())
OnAction(CAction(ACTION_CHANNEL_SWITCH, (float)iChannelNumber));
}
else
{
ChangetheTimeCode(action.GetID());
}
return true;
}
break;
case ACTION_ASPECT_RATIO:
{ // toggle the aspect ratio mode (only if the info is onscreen)
if (m_bShowViewModeInfo)
{
#ifdef HAS_VIDEO_PLAYBACK
g_renderManager.SetViewMode(++g_settings.m_currentVideoSettings.m_ViewMode);
示例2: CPVRTimerInfoTag
CPVRTimerInfoTag *CPVRTimerInfoTag::InstantTimer()
{
/* create a new timer */
CPVRTimerInfoTag *newTag = new CPVRTimerInfoTag();
if (!newTag)
{
CLog::Log(LOGERROR, "%s - couldn't create new timer", __FUNCTION__);
return NULL;
}
CFileItem *curPlayingChannel = g_PVRManager.GetCurrentPlayingItem();
CPVRChannel *channel = (curPlayingChannel) ? curPlayingChannel->GetPVRChannelInfoTag(): NULL;
if (!channel)
{
CLog::Log(LOGDEBUG, "%s - couldn't find current playing channel", __FUNCTION__);
channel = PVRChannelsTV.GetByChannelNumber(1);
if (!channel)
{
CLog::Log(LOGERROR, "%s - cannot find any channels",
__FUNCTION__);
}
}
int iDuration = g_guiSettings.GetInt("pvrrecord.instantrecordtime");
if (!iDuration)
iDuration = 180; /* default to 180 minutes */
int iPriority = g_guiSettings.GetInt("pvrrecord.defaultpriority");
if (!iPriority)
iPriority = 50; /* default to 50 */
int iLifetime = g_guiSettings.GetInt("pvrrecord.defaultlifetime");
if (!iLifetime)
iLifetime = 30; /* default to 30 days */
/* set the timer data */
newTag->m_iClientIndex = -1;
newTag->m_bIsActive = true;
newTag->m_strTitle = g_localizeStrings.Get(19056);
newTag->m_iChannelNumber = channel->ChannelNumber();
newTag->m_iClientNumber = channel->ClientChannelNumber();
newTag->m_iClientID = channel->ClientID();
newTag->m_bIsRadio = channel->IsRadio();
newTag->m_StartTime = CDateTime::GetCurrentDateTime();
newTag->SetDuration(iDuration);
newTag->m_iPriority = iPriority;
newTag->m_iLifetime = iLifetime;
/* generate summary string */
newTag->m_strSummary.Format("%s %s %s %s %s",
newTag->m_StartTime.GetAsLocalizedDate(),
g_localizeStrings.Get(19159),
newTag->m_StartTime.GetAsLocalizedTime("", false),
g_localizeStrings.Get(19160),
newTag->m_StopTime.GetAsLocalizedTime("", false));
/* unused only for reference */
newTag->m_strFileNameAndPath = "pvr://timers/new";
return newTag;
}
示例3: UpdateItem
bool CPVRManager::UpdateItem(CFileItem& item)
{
/* Don't update if a recording is played */
if (item.IsPVRRecording())
return true;
if (!item.IsPVRChannel())
{
CLog::Log(LOGERROR, "CPVRManager - %s - no channel tag provided", __FUNCTION__);
return false;
}
CSingleLock lock(m_critSection);
if (*m_currentFile->GetPVRChannelInfoTag() == *item.GetPVRChannelInfoTag())
return false;
g_application.CurrentFileItem() = *m_currentFile;
g_infoManager.SetCurrentItem(*m_currentFile);
CPVRChannel* channelTag = item.GetPVRChannelInfoTag();
const CPVREpgInfoTag* epgTagNow = channelTag->GetEPGNow();
if (channelTag->IsRadio())
{
CMusicInfoTag* musictag = item.GetMusicInfoTag();
if (musictag)
{
musictag->SetTitle(epgTagNow ? epgTagNow->Title() : g_localizeStrings.Get(19055));
musictag->SetGenre(epgTagNow ? epgTagNow->Genre() : "");
musictag->SetDuration(epgTagNow ? epgTagNow->GetDuration() : 3600);
musictag->SetURL(channelTag->Path());
musictag->SetArtist(channelTag->ChannelName());
musictag->SetAlbumArtist(channelTag->ChannelName());
musictag->SetLoaded(true);
musictag->SetComment("");
musictag->SetLyrics("");
}
}
else
{
CVideoInfoTag *videotag = item.GetVideoInfoTag();
if (videotag)
{
videotag->m_strTitle = epgTagNow ? epgTagNow->Title() : g_localizeStrings.Get(19055);
videotag->m_strGenre = epgTagNow ? epgTagNow->Genre() : "";
videotag->m_strPath = channelTag->Path();
videotag->m_strFileNameAndPath = channelTag->Path();
videotag->m_strPlot = epgTagNow ? epgTagNow->Plot() : "";
videotag->m_strPlotOutline = epgTagNow ? epgTagNow->PlotOutline() : "";
videotag->m_iEpisode = epgTagNow ? epgTagNow->EpisodeNum() : 0;
}
}
CPVRChannel* tagPrev = item.GetPVRChannelInfoTag();
if (tagPrev && tagPrev->ChannelNumber() != m_LastChannel)
{
m_LastChannel = tagPrev->ChannelNumber();
m_LastChannelChanged = CTimeUtils::GetTimeMS();
}
if (CTimeUtils::GetTimeMS() - m_LastChannelChanged >= (unsigned int) g_guiSettings.GetInt("pvrplayback.channelentrytimeout") && m_LastChannel != m_PreviousChannel[m_PreviousChannelIndex])
m_PreviousChannel[m_PreviousChannelIndex ^= 1] = m_LastChannel;
return false;
}
示例4: SelectChannel
bool CDVDInputStreamPVRManager::SelectChannel(const CPVRChannel &channel)
{
if (m_pLiveTV)
return m_pLiveTV->SelectChannel(channel.ChannelNumber());
return false;
}
示例5: CPVRTimerInfoTag
CPVRTimerInfoTag *CPVRTimerInfoTag::CreateFromEpg(const CEpgInfoTag &tag)
{
/* create a new timer */
CPVRTimerInfoTag *newTag = new CPVRTimerInfoTag();
if (!newTag)
{
CLog::Log(LOGERROR, "%s - couldn't create new timer", __FUNCTION__);
return NULL;
}
/* check if a valid channel is set */
CPVRChannel *channel = (CPVRChannel *) tag.ChannelTag();
if (channel == NULL)
{
CLog::Log(LOGERROR, "%s - no channel set", __FUNCTION__);
return NULL;
}
/* check if the epg end date is in the future */
if (tag.EndAsLocalTime() < CDateTime::GetCurrentDateTime())
{
CLog::Log(LOGERROR, "%s - end time is in the past", __FUNCTION__);
return NULL;
}
/* set the timer data */
CDateTime newStart = tag.StartAsUTC();
CDateTime newEnd = tag.EndAsUTC();
newTag->m_iClientIndex = -1;
newTag->m_strTitle = tag.Title().IsEmpty() ? channel->ChannelName() : tag.Title();
newTag->m_iChannelNumber = channel->ChannelNumber();
newTag->m_iClientChannelUid = channel->UniqueID();
newTag->m_iClientId = channel->ClientID();
newTag->m_bIsRadio = channel->IsRadio();
newTag->m_iGenreType = tag.GenreType();
newTag->m_iGenreSubType = tag.GenreSubType();
newTag->SetStartFromUTC(newStart);
newTag->SetEndFromUTC(newEnd);
if (tag.Plot().IsEmpty())
{
newTag->m_strSummary.Format("%s %s %s %s %s",
newTag->StartAsLocalTime().GetAsLocalizedDate(),
g_localizeStrings.Get(19159),
newTag->StartAsLocalTime().GetAsLocalizedTime("", false),
g_localizeStrings.Get(19160),
newTag->EndAsLocalTime().GetAsLocalizedTime("", false));
}
else
{
newTag->m_strSummary = tag.Plot();
}
/* we might have a copy of the tag here, so get the real one from the pvrmanager */
const CEpg *epgTable = channel->GetEPG();
newTag->m_epgInfo = epgTable ? epgTable->GetTag(tag.UniqueBroadcastID(), tag.StartAsUTC()) : NULL;
/* unused only for reference */
newTag->m_strFileNameAndPath = "pvr://timers/new";
return newTag;
}