mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 01:48:35 -07:00
Temporarily backport app updates from apps repo
This commit is contained in:
@@ -16,6 +16,39 @@ const uint32_t orientation_value[4] = {
|
||||
CameraSuiteOrientation270,
|
||||
};
|
||||
|
||||
// Possible dithering types for the camera.
|
||||
const char* const dither_text[28] = {
|
||||
"Floyd-Steinberg",
|
||||
"Stucki",
|
||||
"Jarvis-Judice-Ninke",
|
||||
};
|
||||
|
||||
const uint32_t dither_value[4] = {
|
||||
CameraSuiteDitherFloydSteinberg,
|
||||
CameraSuiteDitherStucki,
|
||||
CameraSuiteDitherJarvisJudiceNinke,
|
||||
};
|
||||
|
||||
const char* const flash_text[2] = {
|
||||
"OFF",
|
||||
"ON",
|
||||
};
|
||||
|
||||
const uint32_t flash_value[2] = {
|
||||
CameraSuiteFlashOff,
|
||||
CameraSuiteFlashOn,
|
||||
};
|
||||
|
||||
const char* const jpeg_text[2] = {
|
||||
"OFF",
|
||||
"ON",
|
||||
};
|
||||
|
||||
const uint32_t jpeg_value[2] = {
|
||||
CameraSuiteJpegOff,
|
||||
CameraSuiteJpegOn,
|
||||
};
|
||||
|
||||
const char* const haptic_text[2] = {
|
||||
"OFF",
|
||||
"ON",
|
||||
@@ -54,6 +87,30 @@ static void camera_suite_scene_settings_set_camera_orientation(VariableItem* ite
|
||||
app->orientation = orientation_value[index];
|
||||
}
|
||||
|
||||
static void camera_suite_scene_settings_set_camera_dither(VariableItem* item) {
|
||||
CameraSuite* app = variable_item_get_context(item);
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
|
||||
variable_item_set_current_value_text(item, dither_text[index]);
|
||||
app->dither = dither_value[index];
|
||||
}
|
||||
|
||||
static void camera_suite_scene_settings_set_flash(VariableItem* item) {
|
||||
CameraSuite* app = variable_item_get_context(item);
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
|
||||
variable_item_set_current_value_text(item, flash_text[index]);
|
||||
app->flash = flash_value[index];
|
||||
}
|
||||
|
||||
static void camera_suite_scene_settings_set_jpeg(VariableItem* item) {
|
||||
CameraSuite* app = variable_item_get_context(item);
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
|
||||
variable_item_set_current_value_text(item, jpeg_text[index]);
|
||||
app->jpeg = jpeg_value[index];
|
||||
}
|
||||
|
||||
static void camera_suite_scene_settings_set_haptic(VariableItem* item) {
|
||||
CameraSuite* app = variable_item_get_context(item);
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
@@ -97,6 +154,38 @@ void camera_suite_scene_settings_on_enter(void* context) {
|
||||
variable_item_set_current_value_index(item, value_index);
|
||||
variable_item_set_current_value_text(item, orientation_text[value_index]);
|
||||
|
||||
// Camera Dither Type
|
||||
item = variable_item_list_add(
|
||||
app->variable_item_list,
|
||||
"Dithering Type:",
|
||||
3,
|
||||
camera_suite_scene_settings_set_camera_dither,
|
||||
app);
|
||||
value_index = value_index_uint32(app->dither, dither_value, 3);
|
||||
variable_item_set_current_value_index(item, value_index);
|
||||
variable_item_set_current_value_text(item, dither_text[value_index]);
|
||||
|
||||
// Flash ON/OFF
|
||||
item = variable_item_list_add(
|
||||
app->variable_item_list, "Flash:", 2, camera_suite_scene_settings_set_flash, app);
|
||||
value_index = value_index_uint32(app->flash, flash_value, 2);
|
||||
variable_item_set_current_value_index(item, value_index);
|
||||
variable_item_set_current_value_text(item, flash_text[value_index]);
|
||||
|
||||
// @todo - Save picture to ESP32-CAM sd-card instead of Flipper Zero
|
||||
// sd-card. This hides the setting for it, for now.
|
||||
// Save JPEG to ESP32-CAM sd-card instead of Flipper Zero sd-card ON/OFF
|
||||
// item = variable_item_list_add(
|
||||
// app->variable_item_list,
|
||||
// "Save JPEG to ext sdcard:",
|
||||
// 2,
|
||||
// camera_suite_scene_settings_set_jpeg,
|
||||
// app);
|
||||
// value_index = value_index_uint32(app->jpeg, jpeg_value, 2);
|
||||
// variable_item_set_current_value_index(item, value_index);
|
||||
// variable_item_set_current_value_text(item, jpeg_text[value_index]);
|
||||
UNUSED(camera_suite_scene_settings_set_jpeg);
|
||||
|
||||
// Haptic FX ON/OFF
|
||||
item = variable_item_list_add(
|
||||
app->variable_item_list, "Haptic FX:", 2, camera_suite_scene_settings_set_haptic, app);
|
||||
|
||||
Reference in New Issue
Block a user