示例#1
0
int glue_loadChannel(int c, const char *fname, const char *fpath) {

	/* save the patch and take the last browser's dir in order to re-use it
	 * the next time */

	G_Conf.setPath(G_Conf.samplePath, fpath);

	int result = mh_loadChan(fname, c);

	if (result == SAMPLE_LOADED_OK)
		gu_trim_label(G_Mixer.chan[c]->name.c_str(), 28, mainWin->keyboard->sampleButton[c]);

	return result;
}
示例#2
0
void gdEditor::__cb_reload() {

	if (!gdConfirmWin("Warning", "Reload sample: are you sure?"))
		return;

	/* no need for glue_loadChan, there's no gui to refresh */

	mh_loadChan(G_Mixer.chan[chan]->pathfile.c_str(), chan);

	glue_setBoost(this, chan, DEFAULT_BOOST, true);
	glue_setPitch(this, chan, gDEFAULT_PITCH, true);
	glue_setPanning(this, chan, 1.0f);
	pan->value(1.0f);  // glue_setPanning doesn't do it
	pan->redraw();     // glue_setPanning doesn't do it

	wt->wave->calcZoom();
	wt->wave->alloc();
	wt->wave->redraw();

	glue_setBeginEndChannel(this, chan, 0, G_Mixer.chan[chan]->size, true);

	redraw();
}