return;
}
+ if (app->ani_h)
+ {
+ /* stop animation running already */
+ ani_stop(app);
+ pui_ani_destroy(app->ani_h);
+ app->ani_h = NULL;
+ }
+
ani_h = pui_ani_create(app->ph, ani_collection[ani_idx].id);
if (!ani_h)
{
debug_error("Failed to create new PUI animation handle !\n");
- return;
- }
-
- if (app->ani_h)
- {
- /* stop animation running already */
- e = pui_ani_control(app->ani_h, PUI_ANI_CMD_STOP, 0);
-
- if (PUI_ERROR_NONE != e)
- {
- debug_error("Failed on stopping an animation !(cmd:%d, repeat:%d)\n", PUI_ANI_CMD_STOP, 0);
- return;
- }
- debug_info("Animation(%s) will be stopped !\n", pui_ani_get_id(ani_h));
+ if (++ani_idx >= n_animation)
+ ani_idx = 0;
- app->ani_h = NULL;
+ return;
}
app->ani_h = ani_h;