void CAutorun::ExecuteAutorun(const CStdString& path, bool bypassSettings, bool ignoreplaying, bool startFromBeginning )
{
- if ((!ignoreplaying && (g_application.IsPlayingAudio() || g_application.IsPlayingVideo() || g_windowManager.HasModalDialog())) || g_windowManager.GetActiveWindow() == WINDOW_LOGIN_SCREEN)
+ if ((!ignoreplaying && (g_application.m_pPlayer->IsPlayingAudio() || g_application.m_pPlayer->IsPlayingVideo() || g_windowManager.HasModalDialog())) || g_windowManager.GetActiveWindow() == WINDOW_LOGIN_SCREEN)
return ;
CCdInfo* pInfo = g_mediaManager.GetCdInfo(path);
bool CAutorun::PlayDisc(const CStdString& path, bool bypassSettings, bool startFromBeginning)
{
- if ( !bypassSettings && !CSettings::Get().GetInt("audiocds.autoaction") == AUTOCD_PLAY && !CSettings::Get().GetBool("dvds.autorun"))
+ if ( !bypassSettings && CSettings::Get().GetInt("audiocds.autoaction") != AUTOCD_PLAY && !CSettings::Get().GetBool("dvds.autorun"))
return false;
int nSize = g_playlistPlayer.GetPlaylist( PLAYLIST_MUSIC ).size();
if (pInfo == NULL)
return false;
- if (mediaPath.IsEmpty() && pInfo->IsAudio(1))
+ if (mediaPath.empty() && pInfo->IsAudio(1))
mediaPath = "cdda://local/";
- if (mediaPath.IsEmpty() && (pInfo->IsISOUDF(1) || pInfo->IsISOHFS(1) || pInfo->IsIso9660(1) || pInfo->IsIso9660Interactive(1)))
+ if (mediaPath.empty() && (pInfo->IsISOUDF(1) || pInfo->IsISOHFS(1) || pInfo->IsIso9660(1) || pInfo->IsIso9660Interactive(1)))
mediaPath = "iso9660://";
- if (mediaPath.IsEmpty())
+ if (mediaPath.empty())
mediaPath = path;
#ifdef TARGET_WINDOWS
- if (mediaPath.IsEmpty() || mediaPath.CompareNoCase("iso9660://") == 0)
+ if (mediaPath.empty() || mediaPath == "iso9660://")
mediaPath = g_mediaManager.TranslateDevicePath("");
#endif
}
// Sorting necessary for easier HDDVD handling
- vecItems.Sort(SORT_METHOD_LABEL, SortOrderAscending);
+ vecItems.Sort(SortByLabel, SortOrderAscending);
bool bAllowVideo = true;
// bool bAllowPictures = true;
CStdString path = URIUtils::AddFileToFolder(pItem->GetPath(), "VIDEO_TS.IFO");
if(!CFile::Exists(path))
path = URIUtils::AddFileToFolder(pItem->GetPath(), "video_ts.ifo");
- CFileItem item(path, false);
- item.SetLabel(g_mediaManager.GetDiskLabel(strDrive));
- item.GetVideoInfoTag()->m_strFileNameAndPath = g_mediaManager.GetDiskUniqueId(strDrive);
+ CFileItemPtr item(new CFileItem(path, false));
+ item->SetLabel(g_mediaManager.GetDiskLabel(strDrive));
+ item->GetVideoInfoTag()->m_strFileNameAndPath = g_mediaManager.GetDiskUniqueId(strDrive);
- if (!startFromBeginning && !item.GetVideoInfoTag()->m_strFileNameAndPath.IsEmpty())
- item.m_lStartOffset = STARTOFFSET_RESUME;
+ if (!startFromBeginning && !item->GetVideoInfoTag()->m_strFileNameAndPath.empty())
+ item->m_lStartOffset = STARTOFFSET_RESUME;
- g_application.PlayFile(item, false);
- bPlaying = true;
+ g_playlistPlayer.ClearPlaylist(PLAYLIST_VIDEO);
+ g_playlistPlayer.SetShuffle (PLAYLIST_VIDEO, false);
+ g_playlistPlayer.Add(PLAYLIST_VIDEO, item);
+ g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_VIDEO);
+ g_playlistPlayer.Play(0);
return true;
}
if (name.Equals("BDMV") && bAllowVideo
&& (bypassSettings || CSettings::Get().GetBool("dvds.autorun")))
{
- CFileItem item(URIUtils::AddFileToFolder(pItem->GetPath(), "index.bdmv"), false);
- item.SetLabel(g_mediaManager.GetDiskLabel(strDrive));
- item.GetVideoInfoTag()->m_strFileNameAndPath = g_mediaManager.GetDiskUniqueId(strDrive);
+ CFileItemPtr item(new CFileItem(URIUtils::AddFileToFolder(pItem->GetPath(), "index.bdmv"), false));
+ item->SetLabel(g_mediaManager.GetDiskLabel(strDrive));
+ item->GetVideoInfoTag()->m_strFileNameAndPath = g_mediaManager.GetDiskUniqueId(strDrive);
- if (!startFromBeginning && !item.GetVideoInfoTag()->m_strFileNameAndPath.IsEmpty())
- item.m_lStartOffset = STARTOFFSET_RESUME;
+ if (!startFromBeginning && !item->GetVideoInfoTag()->m_strFileNameAndPath.empty())
+ item->m_lStartOffset = STARTOFFSET_RESUME;
- g_application.PlayFile(item, false);
- bPlaying = true;
+ g_playlistPlayer.ClearPlaylist(PLAYLIST_VIDEO);
+ g_playlistPlayer.SetShuffle (PLAYLIST_VIDEO, false);
+ g_playlistPlayer.Add(PLAYLIST_VIDEO, item);
+ g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_VIDEO);
+ g_playlistPlayer.Play(0);
return true;
}
{
// HD DVD Standard says the highest numbered playlist has to be handled first.
CLog::Log(LOGINFO,"HD DVD: Playlist found. Set filetypes to *.xpl for external player.");
- items.Sort(SORT_METHOD_LABEL, SortOrderDescending);
+ items.Sort(SortByLabel, SortOrderDescending);
phddvdItem = pItem;
hddvdname = URIUtils::GetFileName(items[0]->GetPath());
CLog::Log(LOGINFO,"HD DVD: %s", items[0]->GetPath().c_str());
{
// HD DVD Standard says the lowest numbered ifo has to be handled first.
CLog::Log(LOGINFO,"HD DVD: IFO found. Set filename to HV* and filetypes to *.ifo for external player.");
- items.Sort(SORT_METHOD_LABEL, SortOrderAscending);
+ items.Sort(SortByLabel, SortOrderAscending);
phddvdItem = pItem;
hddvdname = URIUtils::GetFileName(items[0]->GetPath());
CLog::Log(LOGINFO,"HD DVD: %s",items[0]->GetPath().c_str());
if (items.Size())
{
// Sort *.evo files in alphabetical order.
- items.Sort(SORT_METHOD_LABEL, SortOrderAscending);
+ items.Sort(SortByLabel, SortOrderAscending);
int64_t asize = 0;
int ecount = 0;
// calculate average size of elements above 1gb
if (items[j]->m_dwSize >= asize)
sitems.Add (items[j]);
// Sort *.evo files by size.
- items.Sort(SORT_METHOD_SIZE, SortOrderDescending);
+ items.Sort(SortBySize, SortOrderDescending);
// Add other files with descending size to bottom of new list.
for (int j = 0; j < items.Size(); j++)
if (items[j]->m_dwSize < asize)
item.SetLabel(g_mediaManager.GetDiskLabel(strDrive));
item.GetVideoInfoTag()->m_strFileNameAndPath = g_mediaManager.GetDiskUniqueId(strDrive);
- if (!startFromBeginning && !item.GetVideoInfoTag()->m_strFileNameAndPath.IsEmpty())
+ if (!startFromBeginning && !item.GetVideoInfoTag()->m_strFileNameAndPath.empty())
item.m_lStartOffset = STARTOFFSET_RESUME;
// get playername
{
CLog::Log(LOGINFO,"HD DVD: External singlefile playback initiated: %s",hddvdname.c_str());
g_application.PlayFile(item, false);
- bPlaying = true;
return true;
} else
CLog::Log(LOGINFO,"HD DVD: No external player found. Fallback to internal one.");
g_playlistPlayer.Add(PLAYLIST_VIDEO, items);
g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_VIDEO);
g_playlistPlayer.Play(0);
- bPlaying = true;
return true;
}
strExt = ".mpg";
// If a file format was extracted we are sure this is a VCD. Autoplay if settings indicate we should.
- if (!strExt.IsEmpty() && bAllowVideo
+ if (!strExt.empty() && bAllowVideo
&& (bypassSettings || CSettings::Get().GetBool("dvds.autorun")))
{
CFileItemList items;
CDirectory::GetDirectory(pItem->GetPath(), items, strExt);
if (items.Size())
{
- items.Sort(SORT_METHOD_LABEL, SortOrderAscending);
+ items.Sort(SortByLabel, SortOrderAscending);
g_playlistPlayer.ClearPlaylist(PLAYLIST_VIDEO);
g_playlistPlayer.Add(PLAYLIST_VIDEO, items);
g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_VIDEO);
g_playlistPlayer.Play(0);
- bPlaying = true;
return true;
}
}
&& (bypassSettings))
{
bPlaying = true;
- CStdString strExec;
- strExec.Format("XBMC.RecursiveSlideShow(%s)", pItem->GetPath().c_str());
+ CStdString strExec = StringUtils::Format("XBMC.RecursiveSlideShow(%s)", pItem->GetPath().c_str());
CBuiltins::Execute(strExec);
return true;
}
if (!pItem->m_bIsFolder && pItem->IsPicture())
{
bPlaying = true;
- CStdString strExec;
- strExec.Format("XBMC.RecursiveSlideShow(%s)", strDrive.c_str());
+ CStdString strExec = StringUtils::Format("XBMC.RecursiveSlideShow(%s)", strDrive.c_str());
CBuiltins::Execute(strExec);
break;
}
bool CAutorun::CanResumePlayDVD(const CStdString& path)
{
CStdString strUniqueId = g_mediaManager.GetDiskUniqueId(path);
- if (!strUniqueId.IsEmpty())
+ if (!strUniqueId.empty())
{
CVideoDatabase dbs;
dbs.Open();