예제 #1
0
파일: sffile.cpp 프로젝트: Blzut3/gzdoom
int Instruments::process_pdta(int size, SFInfo *sf, struct timidity_file *fd)
{
	while (size > 0) {
		SFChunk chunk;

		/* read a subchunk */
		if (READCHUNK(&chunk, fd) <= 0)
			return -1;
		size -= 8;

		ctl_cmsg(CMSG_INFO, VERB_DEBUG, " %c%c%c%c:",
			chunk.id[0], chunk.id[1], chunk.id[2], chunk.id[3]);
		switch (chunkid(chunk.id)) {
		case PHDR_ID:
			load_preset_header(chunk.size, sf, fd);
			break;
		case PBAG_ID:
			load_bag(chunk.size, &prbags, fd);
			break;
		case PGEN_ID:
			load_gen(chunk.size, &prbags, fd);
			break;
		case INST_ID:
			load_inst_header(chunk.size, sf, fd);
			break;
		case IBAG_ID:
			load_bag(chunk.size, &inbags, fd);
			break;
		case IGEN_ID:
			load_gen(chunk.size, &inbags, fd);
			break;
		case SHDR_ID:
			load_sample_info(chunk.size, sf, fd);
			break;
		case PMOD_ID: /* ignored */
		case IMOD_ID: /* ingored */
		default:
			FSKIP(chunk.size, fd);
			break;
		}
		size -= chunk.size;
	}
	return 0;
}
예제 #2
0
파일: sffile.c 프로젝트: tiwai/awesfx
static int process_pdta(int size, SFInfo *sf, FILE *fd)
{
	while (size > 0) {
		SFChunk chunk;

		/* read a subchunk */
		READCHUNK(chunk, fd); size -= 8;
		if (feof(fd))
			return -1;

		switch (chunkid(chunk.id)) {
		case PHDR_ID:
			load_preset_header(chunk.size, sf, fd);
			break;
		case PBAG_ID:
			load_bag(chunk.size, &prbags, fd);
			break;
		case PGEN_ID:
			load_gen(chunk.size, &prbags, fd);
			break;
		case INST_ID:
			load_inst_header(chunk.size, sf, fd);
			break;
		case IBAG_ID:
			load_bag(chunk.size, &inbags, fd);
			break;
		case IGEN_ID:
			load_gen(chunk.size, &inbags, fd);
			break;
		case SHDR_ID:
			load_sample_info(chunk.size, sf, fd);
			break;
		case PMOD_ID: /* ignored */
		case IMOD_ID: /* ingored */
		default:
			FSKIP(chunk.size, fd);
			break;
		}
		size -= chunk.size;
	}
	return 0;
}