本文整理汇总了C++中CGUIWindowSlideShow::CurrentSlide方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIWindowSlideShow::CurrentSlide方法的具体用法?C++ CGUIWindowSlideShow::CurrentSlide怎么用?C++ CGUIWindowSlideShow::CurrentSlide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIWindowSlideShow
的用法示例。
在下文中一共展示了CGUIWindowSlideShow::CurrentSlide方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetItem
//.........这里部分代码省略.........
else if (player == Video)
{
if (!CVideoLibrary::FillFileItem(g_application.CurrentFile(), fileItem, parameterObject))
{
const CVideoInfoTag *currentVideoTag = g_infoManager.GetCurrentMovieTag();
if (currentVideoTag != NULL)
fileItem = CFileItemPtr(new CFileItem(*currentVideoTag));
fileItem->SetPath(g_application.CurrentFileItem().GetPath());
}
}
else
{
if (!CAudioLibrary::FillFileItem(g_application.CurrentFile(), fileItem, parameterObject))
{
const MUSIC_INFO::CMusicInfoTag *currentMusicTag = g_infoManager.GetCurrentSongTag();
if (currentMusicTag != NULL)
fileItem = CFileItemPtr(new CFileItem(*currentMusicTag));
fileItem->SetPath(g_application.CurrentFileItem().GetPath());
}
}
}
if (IsPVRChannel())
break;
if (player == Video)
{
bool additionalInfo = false;
bool streamdetails = false;
for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
{
CStdString fieldValue = itr->asString();
if (fieldValue == "cast" || fieldValue == "set" || fieldValue == "setid" || fieldValue == "showlink" || fieldValue == "resume" ||
(fieldValue == "streamdetails" && !fileItem->GetVideoInfoTag()->m_streamDetails.HasItems()))
additionalInfo = true;
}
CVideoDatabase videodatabase;
if ((additionalInfo) &&
videodatabase.Open())
{
if (additionalInfo)
{
switch (fileItem->GetVideoContentType())
{
case VIDEODB_CONTENT_MOVIES:
videodatabase.GetMovieInfo("", *(fileItem->GetVideoInfoTag()), fileItem->GetVideoInfoTag()->m_iDbId);
break;
case VIDEODB_CONTENT_MUSICVIDEOS:
videodatabase.GetMusicVideoInfo("", *(fileItem->GetVideoInfoTag()), fileItem->GetVideoInfoTag()->m_iDbId);
break;
case VIDEODB_CONTENT_EPISODES:
videodatabase.GetEpisodeInfo("", *(fileItem->GetVideoInfoTag()), fileItem->GetVideoInfoTag()->m_iDbId);
break;
case VIDEODB_CONTENT_TVSHOWS:
case VIDEODB_CONTENT_MOVIE_SETS:
default:
break;
}
}
videodatabase.Close();
}
}
else if (player == Audio)
{
if (fileItem->IsMusicDb())
{
CMusicDatabase musicdb;
CFileItemList items;
items.Add(fileItem);
CAudioLibrary::GetAdditionalSongDetails(parameterObject, items, musicdb);
}
}
break;
}
case Picture:
{
CGUIWindowSlideShow *slideshow = (CGUIWindowSlideShow*)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (!slideshow)
return FailedToExecute;
CFileItemList slides;
slideshow->GetSlideShowContents(slides);
fileItem = slides[slideshow->CurrentSlide() - 1];
break;
}
case None:
default:
return FailedToExecute;
}
HandleFileItem("id", !IsPVRChannel(), "item", fileItem, parameterObject, parameterObject["properties"], result, false);
return OK;
}
示例2: GetPropertyValue
//.........这里部分代码省略.........
case Picture:
MillisecondsToTimeObject(0, result);
break;
default:
return FailedToExecute;
}
}
else if (property.Equals("percentage"))
{
CGUIWindowSlideShow *slideshow = NULL;
switch (player)
{
case Video:
case Audio:
{
if (!IsPVRChannel())
result = g_application.GetPercentage();
else
{
EPG::CEpgInfoTag epg;
if (GetCurrentEpg(epg))
result = epg.ProgressPercentage();
else
result = 0;
}
break;
}
case Picture:
slideshow = (CGUIWindowSlideShow*)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (slideshow && slideshow->NumSlides() > 0)
result = (double)slideshow->CurrentSlide() / slideshow->NumSlides();
else
result = 0.0;
break;
default:
return FailedToExecute;
}
}
else if (property.Equals("totaltime"))
{
switch (player)
{
case Video:
case Audio:
{
int ms = 0;
if (!IsPVRChannel())
ms = (int)(g_application.GetTotalTime() * 1000.0);
else
{
EPG::CEpgInfoTag epg;
if (GetCurrentEpg(epg))
ms = epg.GetDuration() * 1000;
}
MillisecondsToTimeObject(ms, result);
break;
}
case Picture:
MillisecondsToTimeObject(0, result);
break;
示例3: lock
/*----------------------------------------------------------------------
| CUPnPRenderer::UpdateState
+---------------------------------------------------------------------*/
void
CUPnPRenderer::UpdateState()
{
NPT_AutoLock lock(m_state);
PLT_Service *avt;
if (NPT_FAILED(FindServiceByType("urn:schemas-upnp-org:service:AVTransport:1", avt)))
return;
/* don't update state while transitioning */
NPT_String state;
avt->GetStateVariableValue("TransportState", state);
if(state == "TRANSITIONING")
return;
avt->SetStateVariable("TransportStatus", "OK");
if (g_application.m_pPlayer->IsPlaying() || g_application.m_pPlayer->IsPausedPlayback()) {
avt->SetStateVariable("NumberOfTracks", "1");
avt->SetStateVariable("CurrentTrack", "1");
std::string buffer = g_infoManager.GetCurrentPlayTime(TIME_FORMAT_HH_MM_SS);
avt->SetStateVariable("RelativeTimePosition", buffer.c_str());
avt->SetStateVariable("AbsoluteTimePosition", buffer.c_str());
buffer = g_infoManager.GetDuration(TIME_FORMAT_HH_MM_SS);
if (buffer.length() > 0) {
avt->SetStateVariable("CurrentTrackDuration", buffer.c_str());
avt->SetStateVariable("CurrentMediaDuration", buffer.c_str());
} else {
avt->SetStateVariable("CurrentTrackDuration", "00:00:00");
avt->SetStateVariable("CurrentMediaDuration", "00:00:00");
}
} else if (g_windowManager.GetActiveWindow() == WINDOW_SLIDESHOW) {
avt->SetStateVariable("TransportState", "PLAYING");
avt->SetStateVariable("AVTransportURI" , g_infoManager.GetPictureLabel(SLIDE_FILE_PATH).c_str());
avt->SetStateVariable("CurrentTrackURI", g_infoManager.GetPictureLabel(SLIDE_FILE_PATH).c_str());
avt->SetStateVariable("TransportPlaySpeed", "1");
CGUIWindowSlideShow *slideshow = g_windowManager.GetWindow<CGUIWindowSlideShow>(WINDOW_SLIDESHOW);
if (slideshow)
{
std::string index;
index = StringUtils::Format("%d", slideshow->NumSlides());
avt->SetStateVariable("NumberOfTracks", index.c_str());
index = StringUtils::Format("%d", slideshow->CurrentSlide());
avt->SetStateVariable("CurrentTrack", index.c_str());
}
avt->SetStateVariable("CurrentTrackMetadata", "");
avt->SetStateVariable("AVTransportURIMetaData", "");
} else {
avt->SetStateVariable("TransportState", "STOPPED");
avt->SetStateVariable("TransportPlaySpeed", "1");
avt->SetStateVariable("NumberOfTracks", "0");
avt->SetStateVariable("CurrentTrack", "0");
avt->SetStateVariable("RelativeTimePosition", "00:00:00");
avt->SetStateVariable("AbsoluteTimePosition", "00:00:00");
avt->SetStateVariable("CurrentTrackDuration", "00:00:00");
avt->SetStateVariable("CurrentMediaDuration", "00:00:00");
avt->SetStateVariable("NextAVTransportURI", "");
avt->SetStateVariable("NextAVTransportURIMetaData", "");
}
}
示例4: GetPropertyValue
//.........这里部分代码省略.........
case Picture:
MillisecondsToTimeObject(0, result);
break;
default:
return FailedToExecute;
}
}
else if (property == "percentage")
{
CGUIWindowSlideShow *slideshow = NULL;
switch (player)
{
case Video:
case Audio:
{
if (!IsPVRChannel())
result = g_application.GetPercentage();
else
{
EPG::CEpgInfoTagPtr epg(GetCurrentEpg());
if (epg)
result = epg->ProgressPercentage();
else
result = 0;
}
break;
}
case Picture:
slideshow = (CGUIWindowSlideShow*)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (slideshow && slideshow->NumSlides() > 0)
result = (double)slideshow->CurrentSlide() / slideshow->NumSlides();
else
result = 0.0;
break;
default:
return FailedToExecute;
}
}
else if (property == "totaltime")
{
switch (player)
{
case Video:
case Audio:
{
int ms = 0;
if (!IsPVRChannel())
ms = (int)(g_application.GetTotalTime() * 1000.0);
else
{
EPG::CEpgInfoTagPtr epg(GetCurrentEpg());
if (epg)
ms = epg->GetDuration() * 1000;
}
MillisecondsToTimeObject(ms, result);
break;
}
case Picture:
MillisecondsToTimeObject(0, result);
break;
示例5: GetLabel
bool CPicturesGUIInfo::GetLabel(std::string& value, const CFileItem *item, int contextWindow, const CGUIInfo &info, std::string *fallback) const
{
///////////////////////////////////////////////////////////////////////////////////////////////
// LISTITEM_* / SLIDESHOW_* (values directly supported by PictureInfoTag)
///////////////////////////////////////////////////////////////////////////////////////////////
if (item->IsPicture() && info.m_info >= LISTITEM_PICTURE_START && info.m_info <= LISTITEM_PICTURE_END)
{
const auto& it = listitem2slideshow_map.find(info.m_info);
if (it != listitem2slideshow_map.end())
{
value = item->GetPictureInfoTag()->GetInfo(it->second);
return true;
}
else
{
CLog::Log(LOGERROR, "CPicturesGUIInfo::GetLabel - cannot map LISTITEM (%d) to SLIDESHOW label!", info.m_info);
return false;
}
}
else if (m_currentSlide && info.m_info >= SLIDESHOW_LABELS_START && info.m_info <= SLIDESHOW_LABELS_END)
{
value = m_currentSlide->GetPictureInfoTag()->GetInfo(info.m_info);
return true;
}
if (item->IsPicture())
{
/////////////////////////////////////////////////////////////////////////////////////////////////
// LISTITEM_*
/////////////////////////////////////////////////////////////////////////////////////////////////
switch (info.m_info)
{
case LISTITEM_PICTURE_PATH:
{
if (!item->IsZIP() || item->IsRAR() || item->IsCBZ() || item->IsCBR())
{
value = item->GetPath();
return true;
}
break;
}
}
}
if (item->HasPictureInfoTag())
{
switch (info.m_info)
{
///////////////////////////////////////////////////////////////////////////////////////////////
// SLIDESHOW_* (values not directly supported by PictureInfoTag)
///////////////////////////////////////////////////////////////////////////////////////////////
case SLIDESHOW_FILE_NAME:
{
value = URIUtils::GetFileName(item->GetPath());
return true;
}
case SLIDESHOW_FILE_PATH:
{
const std::string path = URIUtils::GetDirectory(item->GetPath());
value = CURL(path).GetWithoutUserDetails();
return true;
}
case SLIDESHOW_FILE_SIZE:
{
if (!item->m_bIsFolder || item->m_dwSize)
{
value = StringUtils::SizeToString(item->m_dwSize);
return true;
}
break;
}
case SLIDESHOW_FILE_DATE:
{
if (item->m_dateTime.IsValid())
{
value = item->m_dateTime.GetAsLocalizedDate();
return true;
}
break;
}
}
}
switch (info.m_info)
{
///////////////////////////////////////////////////////////////////////////////////////////////
// SLIDESHOW_*
///////////////////////////////////////////////////////////////////////////////////////////////
case SLIDESHOW_INDEX:
{
CGUIWindowSlideShow *slideshow = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIWindowSlideShow>(WINDOW_SLIDESHOW);
if (slideshow && slideshow->NumSlides())
{
value = StringUtils::Format("%d/%d", slideshow->CurrentSlide(), slideshow->NumSlides());
return true;
}
break;
}
}
//.........这里部分代码省略.........