int xmp_seek_time(xmp_context ctx, int time) { struct xmp_player_context *p = &((struct xmp_context *)ctx)->p; int i, t; /* _D("seek to %d, total %d", time, xmp_cfg.time); */ time *= 1000; for (i = 0; i < p->m.xxh->len; i++) { t = p->m.xxo_info[i].time; _D("%2d: %d %d", i, time, t); if (t > time) { if (i > 0) i--; xmp_ord_set(ctx, i); return XMP_OK; } } return -1; }
JNIEXPORT jint JNICALL Java_org_helllabs_android_xmp_Xmp_seek(JNIEnv *env, jobject obj, jint time) { int i, t; struct xmp_player_context *p = &((struct xmp_context *)ctx)->p; time *= 100; for (i = 0; i < p->m.xxh->len; i++) { t = p->m.xxo_info[i].time; if (t > time) { if (i > 0) i--; xmp_ord_set(ctx, i); break; } } return 0; }
static void mseek(InputPlayback *ipb, unsigned long time) { int i, t; struct xmp_player_context *p = &((struct xmp_context *)ctx)->p; _D("seek to %d, total %d", time, xmp_cfg.time); for (i = 0; i < xmp_cfg.mod_info.len; i++) { t = p->m.xxo_info[i].time; _D("%2d: %d %d", i, time, t); if (t > time) { int a; if (i > 0) i--; a = xmp_ord_set(ctx, i); xmp_ip.output->flush(p->m.xxo_info[i].time); break; } } }
JNIEXPORT jint JNICALL Java_org_helllabs_android_xmp_Xmp_setOrd(JNIEnv *env, jobject obj, jint n) { return xmp_ord_set(ctx, n); }