本文整理汇总了C++中MetaData::SetTime方法的典型用法代码示例。如果您正苦于以下问题:C++ MetaData::SetTime方法的具体用法?C++ MetaData::SetTime怎么用?C++ MetaData::SetTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MetaData
的用法示例。
在下文中一共展示了MetaData::SetTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddItem
void PLS::AddItem(vector<PlaylistItem*>* list, char *entry,
char *title, int32 len, char *root)
{
int32 index;
uint32 length;
char path[_MAX_PATH];
PlaylistItem *item;
// if this is not a URL then let's
// enable people with different platforms
// to swap files by changing the path
// separator as necessary
if( strncmp(entry, "http://", 7) &&
strncmp(entry, "rtp://", 6) &&
strncmp(entry, "file://", 7))
{
for (index = strlen(entry) - 1; index >=0; index--)
{
if(entry[index] == '\\' && DIR_MARKER == '/')
entry[index] = DIR_MARKER;
else if(entry[index] == '/' && DIR_MARKER == '\\')
entry[index] = DIR_MARKER;
}
}
// get rid of nasty trailing whitespace
for (index = strlen(entry) - 1; index >=0; index--)
{
if(isspace(entry[index]))
{
entry[index] = 0x00;
}
else
break;
}
// is there anything left?
if(strlen(entry))
{
// is it a url already?
if (!strncmp(entry, "http://", 7) ||
!strncmp(entry, "rtp://", 6) ||
!strncmp(entry, "file://", 7))
{
strcpy(path, entry);
}
else
{
// is the path relative?
if( !strncmp(entry, "..", 2) ||
(strncmp(entry + 1, ":\\", 2) &&
strncmp(entry, DIR_MARKER_STR, 1)))
{
strcpy(path, root);
strcat(path, entry);
}
else
{
strcpy(path, entry);
}
// make it a url so we can add it to the playlist
length = strlen(path) + 15;
char *itemurl = new char[length];
if (IsntError(FilePathToURL(path, itemurl, &length)))
strcpy(path, itemurl);
delete [] itemurl;
}
if (title || len > 0)
{
MetaData oData;
if (title)
oData.SetTitle(title);
if (len > 0)
oData.SetTime(len);
item = new PlaylistItem(path, &oData);
}
else
item = new PlaylistItem(path);
list->push_back(item);
}
}