Example #1
0
void display_overlay(uint8_t *vram_address) {
	char buffer[LP_MAX_WORD];

	if (FLAG_GUI_MODE == GUIMODE_OLC && AE_IS_CREATIVE(DPData.ae)) {
		if (FLAG_DISPLAY_ON) {
			int current_cmode = get_current_cmode();

			if (status.msm_active)
				bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY),  35,  96, "[***]");
			else if (status.cmode_active && current_cmode != CMODE_NONE)
				bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY),  16,  96, "%s", cmodes_config.names[current_cmode]);

			if (status.fexp && DPData.tv_val != TV_VAL_BULB)
				bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY), 138,  32, "#");

			if (settings.autoiso_enable && (DPData.ae != AE_MODE_M || DPData.tv_val != TV_VAL_BULB))
				bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY), 237,  14, "%s", AUTOISO_AUTO);

			if (DPData.wb == WB_MODE_COLORTEMP)
				bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY),  50, 138, "%d", DPData.color_temp);

			if (DPData.ae_bkt) {
				ec_print(buffer, DPData.ae_bkt);
				bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY), 224,  96, "%s", buffer);
			}

#ifdef RELEASE
			bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_BLUE), 148, 0, LP_WORD(L_P_400PLUS));
#else
			bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_RED ),  20, 0, LP_WORD(L_A_WARNING));
#endif

			if (*display_message) {
				if(timestamp() < message_timeout)
					bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_WHITE, COLOR_BLACK),  16, 228, display_message);
				else
					*display_message = '\0';
			}
		}

	}
}
Example #2
0
void cmode_recall_apply(int full) {
	int current_cmode = get_current_cmode();

	snapshot_t snapshot;

	if(AE_IS_CREATIVE(status.main_dial_ae)) {
		// Update current status
		status.cmode_active = FALSE;

		// Try to find a mode file, and load it
		if (amode_read(status.main_dial_ae, &snapshot)) {
			amode_delete(status.main_dial_ae);
			snapshot_apply(&snapshot);
		}
	} else {
		// Only if a custom mode was loaded, and we can read it back
		if (current_cmode != CMODE_NONE && cmode_read(current_cmode, &snapshot)) {
			// Update current status
			status.cmode_active = TRUE;

			// First revert to AE mode
			snapshot_recall(&snapshot);

			if (full) {
				// Save current mode before overwriting other parameters
				if (!status.cmode_active)
					amode_write(DPData.ae);

				// Then apply full custom mode
				snapshot_apply(&snapshot);
			}
		} else {
			// Update current status
			status.cmode_active = FALSE;
		}
	}
}