Example #1
0
void glue_keyPress(int c, bool ctrl, bool shift) {

	/* -- case CTRL --------------------------------------------------- */
	if (ctrl)
		glue_writeMute(c, false);

	/* -- case SHIFT------------------------------------------------------
	 * action recording on:
	 * 		if seq is playing, rec a killchan
	 * action recording off:
	 * 		if chan has recorded events:
	 * 		|	 if seq is playing OR channel 'c' is stopped, de/activate recs
	 * 		|	 else kill chan
	 *		else kill chan */
	else
	if (shift)	{
		if (recorder::active) {
			if (G_Mixer.running) {
				mh_killChan(c);
				if (recorder::canRec(c) && !(G_Mixer.chanMode[c] & LOOP_ANY))   // don't record killChan actions for LOOP channels
					recorder::rec(c, ACTION_KILLCHAN, G_Mixer.actualFrame);
			}
		}
		else {
			if (recorder::chanEvents[c]) {
				if (G_Mixer.running || G_Mixer.chanStatus[c] == STATUS_OFF)
					recorder::chanActive[c] ? glue_stopReadingRecs(c) : glue_startReadingRecs(c);
				else
					mh_killChan(c);
			}
			else
				mh_killChan(c);
		}
	}

	/* -- case no modifier -------------------------------------------- */
	else {

		/* record now if the quantizer is off, otherwise let mixer to handle it
		 * when a quantoWait has passed. Moreover, KEYPRESS and KEYREL are
		 * meaningless for loop modes */

		if (G_Mixer.quantize == 0 &&
		    recorder::canRec(c)   &&
		    !(G_Mixer.chanMode[c] & LOOP_ANY))
		{
			if (G_Mixer.chanMode[c] == SINGLE_PRESS)
				recorder::startOverdub(c, ACTION_KEYS, G_Mixer.actualFrame);
			else
				recorder::rec(c, ACTION_KEYPRESS, G_Mixer.actualFrame);
		}

		mh_startChan(c);
	}

	/* the GUI update is done by gui_refresh() */
}
Example #2
0
void gSampleChannel::__cb_readActions() {
	ch->readActions ? glue_stopReadingRecs(ch) : glue_startReadingRecs(ch);
}