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
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;
}
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;
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();