本文整理汇总了C++中SongList::AddSong方法的典型用法代码示例。如果您正苦于以下问题:C++ SongList::AddSong方法的具体用法?C++ SongList::AddSong怎么用?C++ SongList::AddSong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SongList
的用法示例。
在下文中一共展示了SongList::AddSong方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddDirectory
void SongList::AddDirectory(Directory Dir, bool VSRGActive, bool DotcurActive)
{
SongList* NewList = new SongList(this);
ListEntry NewEntry;
NewEntry.EntryName = Dir.path().substr(Dir.path().find_last_of('/')+1);
NewEntry.Kind = ListEntry::Directory;
NewEntry.Data = NewList;
std::vector<VSRG::Song*> Songs7K;
std::vector<dotcur::Song*> SongsDC;
std::vector<String> Listing;
Dir.ListDirectory(Listing, Directory::FS_DIR);
for (std::vector<String>::iterator i = Listing.begin();
i != Listing.end();
i++)
{
if (VSRGActive)
LoadSong7KFromDir(Dir / *i, Songs7K);
if (DotcurActive)
LoadSongDCFromDir(Dir / *i, SongsDC);
if (!SongsDC.size() && !Songs7K.size())
NewList->AddDirectory(Dir / *i, VSRGActive, DotcurActive);
if (Songs7K.size())
{
for (std::vector<VSRG::Song*>::iterator j = Songs7K.begin();
j != Songs7K.end();
j++)
{
NewList->AddSong(*j);
}
Songs7K.clear();
}
if (SongsDC.size())
{
for (std::vector<dotcur::Song*>::iterator j = SongsDC.begin();
j != SongsDC.end();
j++)
{
NewList->AddSong(*j);
}
SongsDC.clear();
}
}
if (NewList->GetNumEntries())
mChildren.push_back(NewEntry);
else
delete NewList;
}
示例2: AddVirtualDirectory
void SongList::AddVirtualDirectory(String NewEntryName, Game::Song* List, int Count)
{
SongList* NewList = new SongList(this);
ListEntry NewEntry;
NewEntry.EntryName = NewEntryName;
NewEntry.Kind = ListEntry::Directory;
NewEntry.Data = NewList;
for (int i = 0; i < Count; i++)
NewList->AddSong(&List[Count]);
mChildren.push_back(NewEntry);
}