本文整理汇总了C++中DownloadManager::ReadDownloadFile方法的典型用法代码示例。如果您正苦于以下问题:C++ DownloadManager::ReadDownloadFile方法的具体用法?C++ DownloadManager::ReadDownloadFile怎么用?C++ DownloadManager::ReadDownloadFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DownloadManager
的用法示例。
在下文中一共展示了DownloadManager::ReadDownloadFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
replaceCurrentQueue = false;
}
}
for(int32 i = 0; i < count; i++)
{
strcpy(path, array + offset);
offset += strlen(path) + 1;
// is this a URL we know how to handle
if( !strncasecmp(path, "http://", 7) ||
!strncasecmp(path, "rtp://", 6))
{
context->plm->AddItem(path);
if(playNow)
{
SetTimer(hwnd, 1, 1000, NULL);
}
continue;
}
HANDLE handle;
WIN32_FIND_DATA data;
handle = FindFirstFile(path, &data);
if(handle != INVALID_HANDLE_VALUE)
{
char* cp = NULL;
cp = strrchr(path, '\\');
if(cp)
{
strcpy(cp + 1, data.cFileName);
}
FindClose(handle);
}
FilePathToURL(path, url, &length);
// who needs to get this, plm or dlm?
bool giveToDLM = false;
bool giveToTheme = false;
char* extension = NULL;
PlaylistManager* plm = context->plm;
DownloadManager* dlm = context->downloadManager;
extension = strrchr(url, '.');
if(extension)
{
DownloadFormatInfo dlfi;
uint32 i = 0;
extension++;
while(IsntError(dlm->GetSupportedDownloadFormats(&dlfi, i++)))
{
if(!strcasecmp(extension, dlfi.GetExtension()))
{
giveToDLM = true;
break;
}
}
if (strcasecmp(extension, themeExtension) == 0)
giveToTheme = true;
}
if(giveToDLM)
dlm->ReadDownloadFile(url);
else if(giveToTheme)
context->player->AddTheme(url);
else
plm->AddItem(url);
if(playNow)
{
SetTimer(hwnd, 1, 1000, NULL);
}
}
break;
}
case WM_DISPLAYCHANGE:
{
context->target->AcceptEvent(new Event(INFO_PrefsChanged));
break;
}
default:
result = DefWindowProc(hwnd, msg, wParam, lParam);
break;
}
return result;
}