当前位置: 首页>>代码示例>>C++>>正文


C++ SongList::begin方法代码示例

本文整理汇总了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;
}
开发者ID:Atrament666,项目名称:Clementine,代码行数:11,代码来源:library.cpp

示例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" ))
//.........这里部分代码省略.........
开发者ID:bradparks,项目名称:ld48jovoc_food_fight_3d_luxe,代码行数:101,代码来源:focus_main.cpp


注:本文中的SongList::begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。