本文整理汇总了C++中soundLib::stop_music方法的典型用法代码示例。如果您正苦于以下问题:C++ soundLib::stop_music方法的具体用法?C++ soundLib::stop_music怎么用?C++ soundLib::stop_music使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类soundLib
的用法示例。
在下文中一共展示了soundLib::stop_music方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: show_scene
void sceneShow::show_scene(int n)
{
if (n < 0) {
return;
}
if (scene_list.size() <= n) {
std::cout << "ERROR: Scene List[" << n << "] invalid. List size is " << image_scenes.size() << "." << std::endl;
return;
}
CURRENT_FILE_FORMAT::file_scene_list scene = scene_list.at(n);
input.clean();
for (int i=0; i<SCENE_OBJECTS_N; i++) {
input.read_input();
int scene_seek_n = scene.objects[i].seek_n;
//std::cout << ">> sceneShow::show_scene - i: " << i << ", scene_seek_n: " << scene_seek_n << std::endl;
if (_interrupt_scene == true || input.p1_input[BTN_START] == 1) {
scene_seek_n = -1;
break;
}
if (scene_seek_n != -1) {
int scene_type = scene.objects[i].type;
//std::cout << "### scene_type[" << scene_type << "]" << std::endl;
if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_SHOW_TEXT) {
show_text(scene_seek_n);
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_CLEAR_AREA) {
clear_area(scene_seek_n);
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_CLEAR_SCREEN) {
graphLib.clear_area(0 ,0, RES_W, RES_H, 0, 0, 0);
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_MOVE_IMAGE) {
show_image(scene_seek_n);
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_MOVE_VIEWPOINT) {
show_viewpoint(scene_seek_n);
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_PLAY_MUSIC) {
play_music(scene_seek_n);
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_PLAY_SFX) {
play_sfx(scene_seek_n);
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_SHOW_ANIMATION) {
show_animation(scene_seek_n, scene.objects[i].repeat_value, scene.objects[i].repeat_type);
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_STOP_MUSIC) {
soundManager.stop_music();
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_SUBSCENE) {
show_scene(scene_seek_n);
} else {
std::cout << ">> sceneShow::show_scene - unknown scene_type[" << scene_type << "]" << std::endl;
}
std::cout << "show_scene::DELAY[" << i << "][" << scene.objects[i].delay_after << "]" << std::endl;
if (input.waitScapeTime(scene.objects[i].delay_after) == 1) {
_interrupt_scene = true;
}
} else {
break;
}
}
std::cout << "show_scene::DONE" << std::endl;
}
示例2: play_music
void sceneShow::play_music(int n)
{
if (playmusic_list.size() <= n) {
std::cout << "ERROR: Scene PlayMusic[" << n << "] invalid. List size is " << image_scenes.size() << "." << std::endl;
exit(-1);
}
soundManager.stop_music();
soundManager.load_music(playmusic_list.at(n).filename);
soundManager.play_music();
}
示例3: show_scene
void sceneShow::show_scene(int n)
{
if (scene_list.size() <= n) {
std::cout << "ERROR: Scene List[" << n << "] invalid. List size is " << image_scenes.size() << "." << std::endl;
exit(-1);
}
CURRENT_FILE_FORMAT::file_scene_list scene = scene_list.at(0);
for (int i=0; i<SCENE_OBJECTS_N; i++) {
int scene_seek_n = scene.objects[i].seek_n;
if (scene_seek_n != -1) {
int scene_type = scene.objects[i].type;
if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_SHOW_TEXT) {
show_text(scene_seek_n);
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_CLEAR_AREA) {
clear_area(scene_seek_n);
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_CLEAR_SCREEN) {
graphLib.clear_area(0 ,0, RES_W, RES_H, 0, 0, 0);
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_MOVE_IMAGE) {
show_image(scene_seek_n);
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_MOVE_VIEWPOINT) {
/// @TODO
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_PLAY_MUSIC) {
play_music(scene_seek_n);
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_PLAY_SFX) {
play_sfx(scene_seek_n);
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_SHOW_ANIMATION) {
show_animation(scene_seek_n, scene.objects[i].repeat_value, scene.objects[i].repeat_type);
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_STOP_MUSIC) {
soundManager.stop_music();
} else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_SUBSCENE) {
show_scene(scene_seek_n);
}
timer.delay(scene.objects[i].delay_after);
}
}
}