コード例 #1
0
void TimeCode::Start(void) {
	console_save_cursor();
	console_set_cursor(COLUMN, ROW);
	console_set_fg_color(CONSOLE_CYAN);
	console_puts(timecode);
	console_restore_cursor();
}
コード例 #2
0
void monitor_update(void) {
	// Handle Active Sensing messages
	switch (midi_get_active_sense_state()) {
	case MIDI_ACTIVE_SENSE_ENABLED:
		console_save_cursor();
		console_set_cursor(70, 3);
		console_set_fg_bg_color(CONSOLE_BLACK, CONSOLE_CYAN);
		(void) console_puts("ACTIVE SENSING          ");
		console_restore_cursor();
		break;
	case MIDI_ACTIVE_SENSE_FAILED:
		console_save_cursor();
		console_set_cursor(70, 3);
		console_set_fg_bg_color(CONSOLE_RED, CONSOLE_WHITE);
		(void) console_puts("ACTIVE SENSING - Failed!");
		console_restore_cursor();
		break;
	default:
		break;
	}
}
コード例 #3
0
/**
 *
 * @param ArtNetTimeCode
 */
void TimeCode::Handler(const struct TArtNetTimeCode *ArtNetTimeCode) {
	itoa_base10(ArtNetTimeCode->Hours, (char *) &timecode[0]);
	itoa_base10(ArtNetTimeCode->Minutes, (char *) &timecode[3]);
	itoa_base10(ArtNetTimeCode->Seconds, (char *) &timecode[6]);
	itoa_base10(ArtNetTimeCode->Frames, (char *) &timecode[9]);

	if ((prev_type != ArtNetTimeCode->Type) && (ArtNetTimeCode->Type < (uint8_t) 4)) {
		memcpy((char *) &timecode[12], (char *) types[ArtNetTimeCode->Type], 5);
		prev_type = ArtNetTimeCode->Type;
	}

	console_save_cursor();
	console_set_cursor(COLUMN, ROW);
	console_set_fg_color(CONSOLE_CYAN);
	console_write(timecode, TIMECODE_LENGTH);
	console_restore_cursor();
}