本文整理汇总了C++中SongList::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ SongList::begin方法的具体用法?C++ SongList::begin怎么用?C++ SongList::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SongList
的用法示例。
在下文中一共展示了SongList::begin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FilterCurrentWMASong
SongList Library::FilterCurrentWMASong(SongList songs, Song* queued) {
for (SongList::iterator it = songs.begin(); it != songs.end();) {
if (it->url() == current_wma_song_url_) {
*queued = *it;
it = songs.erase(it);
} else {
++it;
}
}
return songs;
}
示例2: main
int main( int argc, char *argv[] )
{
// Init fmod
if (!FSOUND_Init( 44100, 32, 0 ))
{
printf("FSound init failed\n" );
}
//FSOUND_SetOutput( FSOUND_OUTPUT_WINMM );
sfx_cowbell = FSOUND_Sample_Load( FSOUND_UNMANAGED, "gamedata/cowbell.wav", FSOUND_NORMAL, 0, 0 );
sfx_doh = FSOUND_Sample_Load( FSOUND_UNMANAGED, "gamedata/sfxr_doh.wav", FSOUND_NORMAL, 0, 0 );
srand( time(NULL) );
// Initialize SDL
if (SDL_Init( SDL_INIT_NOPARACHUTE | SDL_INIT_VIDEO ) < 0 )
{
fprintf( stderr, "Unable to init SDL: %s\n", SDL_GetError() );
}
if (SDL_SetVideoMode( 800, 600, 32, SDL_OPENGL /*| SDL_FULLSCREEN */ ) == 0 )
{
fprintf(stderr, "Unable to set video mode: %s\n", SDL_GetError());
exit(1);
}
SDL_WM_SetCaption( "LD11 Focus", NULL );
// initialize DevIL
ilInit();
ilutRenderer( ILUT_OPENGL );
// Load the song DB
LoadSongList( songs );
for (SongList::iterator ca = songs.begin(); ca != songs.end(); ++ca )
{
printf( ">> %s\n", (*ca).first.c_str() );
artistNames.push_back( (*ca).first );
}
// Main Loop
Uint32 ticks = SDL_GetTicks(), ticks_elapsed, sim_ticks = 0;
bool beat_sample = false;
bool done = false;
world = new World();
Beatronome nome;
while(!done)
{
SDL_Event event;
while (SDL_PollEvent( &event ) )
{
switch (event.type )
{
case SDL_KEYDOWN:
// global keys
//if (event.key.keysym.sym == SDLK_ESCAPE)
//{
// done = true;
//}
if (mode == MODE_TITLE)
{
switch( event.key.keysym.sym )
{
case SDLK_DOWN:
menuNdx++;
if (menuItem[menuNdx] == NULL)
{
menuNdx = 0;
}
break;
case SDLK_UP:
if (menuNdx==0)
{
while (menuItem[menuNdx+1]) menuNdx++;
}
else
{
menuNdx--;
}
break;
case SDLK_RETURN:
case SDLK_SPACE:
// bail
if (artistNames.size() == 0)
{
done = 1;
break;
}
if (!strcmp( menuItem[menuNdx], "Quit" ))
//.........这里部分代码省略.........