Ejemplo n.º 1
0
int check_seeking(size_t *errs)
{
	struct seeko so;
	int ret = 0;

	/* First opening. */
	if(open_file() != 0) return -1;

	printf("Collecting samples...\n");
	ret = collect(&so);
	if(ret != 0) return ret;

	errs[0] = check_positions(&so);

	printf("With fresh opening (empty seek index):\n");
	if(open_file() != 0) return -1;

	errs[1] = check_positions(&so);

	printf("Another fresh Opening to see if first sample works:\n");
	if(open_file() != 0) return -1;
	if(check_sample(&so, 0) != 0)
	++first_sample_errs;

	return ret;
}
Ejemplo n.º 2
0
size_t check_positions(struct seeko *so)
{
	size_t i;
	size_t errs = 0;
	printf("Seeking and comparing...\n");
	for(i=0; i<samples; ++i)
	{
		if(check_sample(so, i) != 0)
		++errs;
	}
	printf("Check the first one again, seeking back from the end.\n");
	if(check_sample(so, 0) != 0)
	++first_sample_errs;

	return errs;
}
Ejemplo n.º 3
0
/* -------------
	 | Give Info |
	 ------------- */
void do_info(void)
{
OBJECT *info_fm;

rsrc_gaddr(R_TREE, SND_INFO, &info_fm);
if (dialog(info_fm) == DO_STAT)
	check_sample();
}
Ejemplo n.º 4
0
static SCM
play_sample (SCM sample_smob, SCM s_gain, SCM s_pan, SCM s_speed)
{
    Sample *sample = check_sample (sample_smob);
    float gain = scm_to_double (s_gain);
    float pan = scm_to_double (s_pan);
    float speed = scm_to_double (s_speed);

    if (sample->sample) {
        al_play_sample (sample->sample, gain, pan, speed, ALLEGRO_PLAYMODE_ONCE, NULL);
    }

    return SCM_UNSPECIFIED;
}
Ejemplo n.º 5
0
 void MetaEntryVisitor::operator()(std::map<std::string, std::string> & value) const
 {
     auto & id = entry.id;
     if (id == ALT) {
         check_alt(value);
     } else if (id == ASSEMBLY) {
         // TODO May check URL correctness (regexp?)
     } else if (id == CONTIG) {
         check_contig(value);
     } else if (id == FILTER) {
         check_filter(value);
     } else if (id == FORMAT) {
         check_format(value);
     } else if (id == INFO) {
         check_info(value);
     } else if (id == PEDIGREE) {
         // Nothing to check
     } else if (id == PEDIGREEDB) {
         // Nothing to check
     } else if (id == SAMPLE) {
         check_sample(value);
     }
 }