コード例 #1
0
void mh_loadPatch_DEPR_(bool isProject, const char *projPath)
{
	G_Mixer.init();
	G_Mixer.ready = false;   

	int numChans = G_Patch_DEPR_.getNumChans();
	for (int i=0; i<numChans; i++) {
		Channel *ch = glue_addChannel(G_Patch_DEPR_.getColumn(i), G_Patch_DEPR_.getType(i));
		string samplePath = isProject ? projPath + gGetSlash() + G_Patch_DEPR_.getSamplePath(i) : "";
		ch->readPatch_DEPR_(samplePath.c_str(), i);
	}

	G_Mixer.outVol     = G_Patch_DEPR_.getOutVol();
	G_Mixer.inVol      = G_Patch_DEPR_.getInVol();
	G_Mixer.bpm        = G_Patch_DEPR_.getBpm();
	G_Mixer.bars       = G_Patch_DEPR_.getBars();
	G_Mixer.beats      = G_Patch_DEPR_.getBeats();
	G_Mixer.quantize   = G_Patch_DEPR_.getQuantize();
	G_Mixer.metronome  = G_Patch_DEPR_.getMetronome();
	G_Patch_DEPR_.lastTakeId = G_Patch_DEPR_.getLastTakeId();
	G_Patch_DEPR_.samplerate = G_Patch_DEPR_.getSamplerate();

	

	G_Mixer.rewind();
	G_Mixer.updateFrameBars();
	G_Mixer.ready = true;
}
コード例 #2
0
ファイル: sampleChannel.cpp プロジェクト: DomiLou/giada
int SampleChannel::readPatch_DEPR_(const char *f, int i)
{
	int res = load(f);

		volume      = G_Patch_DEPR_.getVol(i);
		key         = G_Patch_DEPR_.getKey(i);
		index       = G_Patch_DEPR_.getIndex(i);
		mode        = G_Patch_DEPR_.getMode(i);
		mute        = G_Patch_DEPR_.getMute(i);
		mute_s      = G_Patch_DEPR_.getMute_s(i);
		solo        = G_Patch_DEPR_.getSolo(i);
		boost       = G_Patch_DEPR_.getBoost(i);
		panLeft     = G_Patch_DEPR_.getPanLeft(i);
		panRight    = G_Patch_DEPR_.getPanRight(i);
		readActions = G_Patch_DEPR_.getRecActive(i);
		recStatus   = readActions ? REC_READING : REC_STOPPED;

		readPatchMidiIn_DEPR_(i);
		midiInReadActions = G_Patch_DEPR_.getMidiValue(i, "InReadActions");
		midiInPitch       = G_Patch_DEPR_.getMidiValue(i, "InPitch");
		readPatchMidiOut_DEPR_(i);

	if (res == SAMPLE_LOADED_OK) {
		setBegin(G_Patch_DEPR_.getBegin(i));
		setEnd  (G_Patch_DEPR_.getEnd(i, wave->size));
		setPitch(G_Patch_DEPR_.getPitch(i));
	}
	else {
		// volume = DEFAULT_VOL;
		// mode   = DEFAULT_CHANMODE;
		// status = STATUS_WRONG;
		// key    = 0;

		if (res == SAMPLE_LEFT_EMPTY)
			status = STATUS_EMPTY;
		else
		if (res == SAMPLE_READ_ERROR)
			status = STATUS_MISSING;
		sendMidiLplay();
	}

	return res;
}
コード例 #3
0
void mh_loadPatch_DEPR_(bool isProject, const char *projPath)
{
	G_Mixer.init();
	G_Mixer.ready = false;   // put it in wait mode

	int numChans = G_Patch_DEPR_.getNumChans();
	for (int i=0; i<numChans; i++) {
		Channel *ch = glue_addChannel(G_Patch_DEPR_.getColumn(i), G_Patch_DEPR_.getType(i));
		string projectPath = projPath;  // safe
		string samplePath  = isProject ? projectPath + G_SLASH + G_Patch_DEPR_.getSamplePath(i) : "";
		ch->readPatch_DEPR_(samplePath.c_str(), i, &G_Patch_DEPR_, G_Conf.samplerate,
				G_Conf.rsmpQuality);
	}

	G_Mixer.outVol     = G_Patch_DEPR_.getOutVol();
	G_Mixer.inVol      = G_Patch_DEPR_.getInVol();
	G_Mixer.bpm        = G_Patch_DEPR_.getBpm();
	G_Mixer.bars       = G_Patch_DEPR_.getBars();
	G_Mixer.beats      = G_Patch_DEPR_.getBeats();
	G_Mixer.quantize   = G_Patch_DEPR_.getQuantize();
	G_Mixer.metronome  = G_Patch_DEPR_.getMetronome();
	G_Patch_DEPR_.lastTakeId = G_Patch_DEPR_.getLastTakeId();
	G_Patch_DEPR_.samplerate = G_Patch_DEPR_.getSamplerate();

	/* rewind and update frames in Mixer (it's vital) */

	G_Mixer.rewind();
	G_Mixer.updateFrameBars();
	G_Mixer.ready = true;
}