Commit c27a83e8 authored by a1ex's avatar a1ex
Browse files

A bit of cleanup (commented Movie AF, FF AutoLock, matrix silent pic, some...

A bit of cleanup (commented Movie AF, FF AutoLock, matrix silent pic, some Q-shortcuts, audio meters is only ON/OFF, config option for PTP...)

--HG--
branch : 550d
parent 19504ef3047c
......@@ -32,6 +32,7 @@ CONFIG_PYMITE = n
CONFIG_RELOC = n
CONFIG_TIMECODE = n
CONFIG_LUA = n
CONFIG_PTP = n
CONFIG_CONSOLE = n
CONFIG_DEBUGMSG = 0
......@@ -225,11 +226,13 @@ ML_OBJS-y = \
shoot.o \
focus.o \
chdk-gui_draw.o \
ptp.o \
movtweaks.o \
tweaks.o \
my_memset.o \
ML_OBJS-$(CONFIG_PTP) += \
ptp.o \
NO=\
hotplug.o \
bootflags.o \
......
......@@ -313,13 +313,11 @@ int audio_meters_are_drawn()
{
return
(
(do_draw_meters && zebra_should_run()) ||
(gui_menu_shown() && is_menu_active("Audio"))
shooting_mode == SHOOTMODE_MOVIE && cfg_draw_meters && do_draw_meters && zebra_should_run()
)
&&
||
(
cfg_draw_meters == 1 ||
(cfg_draw_meters == 2 && shooting_mode == SHOOTMODE_MOVIE)
gui_menu_shown() && is_menu_active("Audio") && cfg_draw_meters
);
}
/** Task to monitor the audio levels.
......@@ -801,10 +799,9 @@ audio_meter_display( void * priv, int x, int y, int selected )
selected ? MENU_FONT_SEL : MENU_FONT,
x, y,
"Audio Meters : %s",
v == 1 ? "ON " :
(v == 2 ? "Movie Only": "OFF")
v ? "ON" : "OFF"
);
menu_draw_icon(x, y, v && !get_global_draw() ? MNI_WARNING : MNI_BOOL_AUTO(v), 0);
menu_draw_icon(x, y, v && !get_global_draw() ? MNI_WARNING : MNI_BOOL(v), 0);
}
......
......@@ -13,6 +13,7 @@
#include "config.h"
#include "ptp.h"
CONFIG_INT( "focus.step", focus_stack_step, 100 );
CONFIG_INT( "focus.count", focus_stack_count, 5 );
......@@ -457,22 +458,22 @@ follow_focus_print(
selected ? MENU_FONT_SEL : MENU_FONT,
x, y,
"Follow Focus : %s",
follow_focus == 1 ? "Manual" : follow_focus == 2 ? "AutoLock" : "OFF"
follow_focus ? "ON" : "OFF"
);
if (follow_focus)
{
bmp_printf(FONT_MED, x + 480, y+5, follow_focus_reverse_h ? "- +" : "+ -");
bmp_printf(FONT_MED, x + 480 + font_med.width, y-4, follow_focus_reverse_v ? "-\n+" : "+\n-");
}
menu_draw_icon(x, y, MNI_BOOL_AUTO(follow_focus), 0);
menu_draw_icon(x, y, MNI_BOOL_LV(follow_focus), 0);
}
CONFIG_INT("movie.af", movie_af, 0);
#ifdef CONFIG_MOVIE_AF
CONFIG_INT("movie.af.aggressiveness", movie_af_aggressiveness, 4);
CONFIG_INT("movie.af.noisefilter", movie_af_noisefilter, 7); // 0 ... 9
int movie_af_stepsize = 10;
#endif
int focus_value = 0; // heuristic from 0 to 100
......@@ -514,11 +515,6 @@ int can_lv_trap_focus_be_active()
return 1;
}
int movie_af_active()
{
return shooting_mode == SHOOTMODE_MOVIE && lv_drawn() && !is_manual_focus() && (focus_done || movie_af==3);
}
static int hsp = 0;
int movie_af_reverse_dir_request = 0;
PROP_HANDLER(PROP_HALF_SHUTTER)
......@@ -546,6 +542,12 @@ int is_manual_focus()
return (af_mode & 0xF) == 3;
}
#ifdef CONFIG_MOVIE_AF
int movie_af_active()
{
return shooting_mode == SHOOTMODE_MOVIE && lv_drawn() && !is_manual_focus() && (focus_done || movie_af==3);
}
static void movie_af_step(int mag)
{
if (!movie_af_active()) return;
......@@ -629,6 +631,7 @@ static void movie_af_step(int mag)
}
prev_mag = mag;
}
#endif
#define NMAGS 64
static int mags[NMAGS] = {0};
......@@ -665,12 +668,13 @@ static void plot_focus_mag()
bmp_draw_rect(COLOR_BLACK, 8 + i, 100, 0, 50);
bmp_draw_rect(COLOR_YELLOW, 8 + i, 150 - FH, 0, FH);
}
ff_check_autolock();
//~ ff_check_autolock();
)
}
#undef FH
#undef NMAGS
/*
void ff_check_autolock()
{
static int rev_countdown = 0;
......@@ -708,7 +712,7 @@ void ff_check_autolock()
}
if (stop_countdown) stop_countdown--;
}
}
}*/
int focus_mag_a = 0;
int focus_mag_b = 0;
......@@ -719,16 +723,21 @@ PROP_HANDLER(PROP_LV_FOCUS_DATA)
focus_mag_b = buf[3];
focus_mag_c = buf[4];
#ifdef CONFIG_MOVIE_AF
if (movie_af != 3)
#endif
{
update_focus_mag(focus_mag_a + focus_mag_b);
if (get_focus_graph()) plot_focus_mag();
#ifdef CONFIG_MOVIE_AF
if ((movie_af == 2) || (movie_af == 1 && get_halfshutter_pressed()))
movie_af_step(focus_mag_a + focus_mag_b);
#endif
}
return prop_cleanup(token, property);
}
#ifdef CONFIG_MOVIE_AF
static void
movie_af_print(
void * priv,
......@@ -763,6 +772,7 @@ void movie_af_noisefilter_bump(void* priv)
{
movie_af_noisefilter = (movie_af_noisefilter + 1) % 10;
}
#endif
static void
focus_misc_task()
......@@ -773,6 +783,7 @@ focus_misc_task()
if (hsp_countdown) hsp_countdown--;
#ifdef CONFIG_MOVIE_AF
if (movie_af == 3)
{
int fm = get_spot_focus(100);
......@@ -780,6 +791,7 @@ focus_misc_task()
if (get_focus_graph()) plot_focus_mag();
movie_af_step(fm);
}
#endif
}
}
......@@ -811,11 +823,12 @@ static struct menu_entry focus_menu[] = {
{
.priv = &follow_focus,
.display = follow_focus_print,
.select = menu_ternary_toggle,
.select = menu_binary_toggle,
.select_reverse = follow_focus_toggle_dir_v,
.select_auto = follow_focus_toggle_dir_h,
.help = "Simple follow focus with arrow keys."
},
#ifdef CONFIG_MOVIE_AF
{
.priv = &movie_af,
.display = movie_af_print,
......@@ -824,6 +837,7 @@ static struct menu_entry focus_menu[] = {
.select_auto = movie_af_aggressiveness_bump,
.help = "Custom AF algorithm in movie mode. Not very efficient."
},
#endif
{
.display = focus_rack_speed_display,
.select = focus_rack_speed_increment,
......
......@@ -362,6 +362,7 @@ static int handle_buttons(struct event * event)
*/
// quick access to some menu items
if (event->type == 0 && event->param == BGMT_Q_ALT && !gui_menu_shown())
{
if (ISO_ADJUSTMENT_ACTIVE)
......@@ -370,6 +371,7 @@ static int handle_buttons(struct event * event)
give_semaphore( gui_sem );
return 0;
}
/*
else if (CURRENT_DIALOG_MAYBE == DLG_WB)
{
select_menu("Expo", 1);
......@@ -388,7 +390,7 @@ static int handle_buttons(struct event * event)
give_semaphore( gui_sem );
return 0;
}
/*else if (CURRENT_DIALOG_MAYBE == DLG_PICTURE_STYLE)
else if (CURRENT_DIALOG_MAYBE == DLG_PICTURE_STYLE)
{
select_menu("Expo", 7);
give_semaphore( gui_sem );
......@@ -405,13 +407,13 @@ static int handle_buttons(struct event * event)
select_menu("Debug", 2);
give_semaphore( gui_sem );
return 0;
}*/
}
else if (lv_dispsize > 1)
{
select_menu("LiveV", 8);
give_semaphore( gui_sem );
return 0;
}
}*/
}
......@@ -547,6 +549,9 @@ static void gui_main_task_550d()
index = event->type;
if ((index >= GMT_NFUNCS) || (index < 0))
continue;
//~ if (event->type != 2)
//~ console_printf("%d %d %d\n", event->type, event->param, event->arg);
if (!magic_is_off())
if (handle_buttons(event) == 0)
......
......@@ -195,7 +195,7 @@ audio_release_display( void * priv, int x, int y, int selected )
x, y,
"Audio RemoteShot: OFF"
);*/
menu_draw_icon(x, y, audio_release_running ? MNI_PERCENT : MNI_OFF, audio_release_level * 100 / 30);
//~ menu_draw_icon(x, y, audio_release_running ? MNI_PERCENT : MNI_OFF, audio_release_level * 100 / 30);
}
static void
......@@ -213,12 +213,12 @@ audio_release_level_toggle_reverse(void* priv)
static void
motion_release_level_toggle(void* priv)
{
motion_detect_level = mod(motion_detect_level - 5 + 1, 26) + 5;
motion_detect_level = mod(motion_detect_level - 1 + 1, 31) + 1;
}
static void
motion_release_level_toggle_reverse(void* priv)
{
motion_detect_level = mod(motion_detect_level - 5 - 1, 26) + 5;
motion_detect_level = mod(motion_detect_level - 1 - 1, 31) + 1;
}
static void
......@@ -233,6 +233,7 @@ motion_detect_display( void * priv, int x, int y, int selected )
motion_detect == 2 ? "DIF" : "err",
motion_detect_level
);
menu_draw_icon(x, y, MNI_BOOL_LV(motion_detect), 0);
}
......@@ -265,10 +266,10 @@ flash_and_no_flash_toggle( void * priv )
}*/
//2 4 6 9 12 16 20 25
static const int16_t silent_pic_sweep_modes_l[] = {2, 2, 2, 3, 3, 4, 4, 5};
static const int16_t silent_pic_sweep_modes_c[] = {1, 2, 3, 3, 4, 4, 5, 5};
#define SILENTPIC_NL COERCE(silent_pic_sweep_modes_l[COERCE(silent_pic_highres,0,COUNT(silent_pic_sweep_modes_l)-1)], 0, 5)
#define SILENTPIC_NC COERCE(silent_pic_sweep_modes_c[COERCE(silent_pic_highres,0,COUNT(silent_pic_sweep_modes_c)-1)], 0, 5)
//~ static const int16_t silent_pic_sweep_modes_l[] = {2, 2, 2, 3, 3, 4, 4, 5};
//~ static const int16_t silent_pic_sweep_modes_c[] = {1, 2, 3, 3, 4, 4, 5, 5};
//~ #define SILENTPIC_NL COERCE(silent_pic_sweep_modes_l[COERCE(silent_pic_highres,0,COUNT(silent_pic_sweep_modes_l)-1)], 0, 5)
//~ #define SILENTPIC_NC COERCE(silent_pic_sweep_modes_c[COERCE(silent_pic_highres,0,COUNT(silent_pic_sweep_modes_c)-1)], 0, 5)
static void
silent_pic_display( void * priv, int x, int y, int selected )
......@@ -291,7 +292,7 @@ silent_pic_display( void * priv, int x, int y, int selected )
silent_pic_fullhd ? "FullHD" : "Single"
);
}
else if (silent_pic_mode == 2)
/* else if (silent_pic_mode == 2)
{
bmp_printf(
selected ? MENU_FONT_SEL : MENU_FONT,
......@@ -302,7 +303,7 @@ silent_pic_display( void * priv, int x, int y, int selected )
);
bmp_printf(FONT_MED, x + 430, y+5, "%dx%d", SILENTPIC_NC*(1024-8), SILENTPIC_NL*(680-8));
}
/* else if (silent_pic_mode == 3)
else if (silent_pic_mode == 3)
{
int t = timer_values_ms[mod(silent_pic_longexp_time_index, COUNT(timer_values_ms))];
bmp_printf(
......@@ -330,15 +331,16 @@ static void silent_pic_mode_toggle(void* priv)
{
silent_pic_mode = mod(silent_pic_mode + 1, 5); // off, normal, hi-res, long-exp, slit
if (silent_pic_mode == 3) silent_pic_mode = 4; // skip longx, not working
if (silent_pic_mode == 2) silent_pic_mode = 4; // skip hi-res
}
static void silent_pic_toggle(int sign)
{
if (silent_pic_mode == 1)
silent_pic_submode = mod(silent_pic_submode + 1, 3);
else if (silent_pic_mode == 2)
/*else if (silent_pic_mode == 2)
silent_pic_highres = mod(silent_pic_highres + sign, COUNT(silent_pic_sweep_modes_c));
/*else if (silent_pic_mode == 3)
else if (silent_pic_mode == 3)
{
if (sign < 0)
{
......@@ -387,12 +389,12 @@ PROP_HANDLER( PROP_HALF_SHUTTER ) {
return prop_cleanup( token, property );
}
int sweep_lv_on = 0;
/*int sweep_lv_on = 0;
static void
sweep_lv_start(void* priv)
{
sweep_lv_on = 1;
}
}*/
int center_lv_aff = 0;
void center_lv_afframe()
......@@ -422,6 +424,7 @@ void move_lv_afframe(int dx, int dy)
prop_request_change(PROP_LV_AFFRAME, afframe, 0x68);
}
/*
static void
sweep_lv()
{
......@@ -448,7 +451,7 @@ sweep_lv()
zoom = 1;
prop_request_change(PROP_LV_DISPSIZE, &zoom, 4);
}
}*/
#if 0 // does not work... out of memory?
uint8_t* read_entire_file(const char * filename, int* buf_size)
......@@ -853,7 +856,7 @@ silent_pic_take_lv_dbg()
dump_seg(vram->vram, vram->pitch * vram->height, imgname);
}
static void
/*static void
silent_pic_take_sweep()
{
if (recording) return;
......@@ -923,7 +926,7 @@ silent_pic_take_sweep()
bmp_printf(FONT_MED, 100, 100, "Psst! Just took a high-res pic ");
}
}*/
static void
silent_pic_take_slitscan(int interactive)
......@@ -1002,8 +1005,8 @@ silent_pic_take(int interactive) // for remote release, set interactive=0
if (silent_pic_mode == 1) // normal
silent_pic_take_simple();
else if (silent_pic_mode == 2) // hi-res
silent_pic_take_sweep();
//~ else if (silent_pic_mode == 2) // hi-res
//~ silent_pic_take_sweep();
//~ else if (silent_pic_mode == 3) // long exposure
//~ silent_pic_take_longexp();
else if (silent_pic_mode == 4) // slit-scan
......@@ -2118,7 +2121,7 @@ struct menu_entry shoot_menus[] = {
},
{
.priv = &motion_detect,
.select = menu_ternary_toggle,
.select = menu_quaternary_toggle,
.display = motion_detect_display,
.select_auto = motion_release_level_toggle,
.select_reverse = motion_release_level_toggle_reverse,
......@@ -2537,11 +2540,11 @@ void display_shooting_info() // called from debug task
else
bmp_printf(fnt, 380, 450, " ");
bmp_printf(fnt, 200, 450, "Flash:%s",
strobo_firing == 0 ? " ON" :
strobo_firing == 1 ? "OFF" : "Auto"
//~ bmp_printf(fnt, 200, 450, "Flash:%s",
//~ strobo_firing == 0 ? " ON" :
//~ strobo_firing == 1 ? "OFF" : "Auto"
//~ strobo_firing < 2 && flash_and_no_flash ? "/T" : " "
);
//~ );
bmp_printf(fnt, 40, 460, get_mlu() ? "MLU" : " ");
......@@ -2824,11 +2827,11 @@ shoot_task( void )
prop_request_change(PROP_LV_DISPSIZE, &zoom, 4);
msleep(100);
}
if (sweep_lv_on)
/*if (sweep_lv_on)
{
sweep_lv();
sweep_lv_on = 0;
}
}*/
if (center_lv_aff)
{
center_lv_afframe_do();
......
......@@ -1966,10 +1966,10 @@ crop_display( void * priv, int x, int y, int selected )
index ? cropmark_names[index-1] : "OFF",
(cropmarks || !index) ? "" : "!" // ! means error
);
int h = font_large.height;
int w = h * 720 / 480;
bmp_draw_scaled_ex(cropmarks, x + 572, y, w, h, 0, 0);
if (cropmark_movieonly && shooting_mode != SHOOTMODE_MOVIE)
//~ int h = font_large.height;
//~ int w = h * 720 / 480;
//~ bmp_draw_scaled_ex(cropmarks, x + 572, y, w, h, 0, 0);
if (index && cropmark_movieonly && shooting_mode != SHOOTMODE_MOVIE)
menu_draw_icon(x, y, MNI_WARNING, 0);
menu_draw_icon(x, y, MNI_BOOL_GDR(index), 0);
}
......@@ -2877,6 +2877,13 @@ void zebra_sleep_when_tired()
crop_set_dirty(40);
//~ if (lv_drawn() && !gui_menu_shown()) redraw();
}
static int prev_recording = 0;
if (prev_recording != recording)
{
msleep(2000);
redraw();
}
}
void clear_this_message_not_available_in_movie_mode()
......@@ -3026,7 +3033,6 @@ clearscreen_loop:
{
display_on();
bmp_on();
redraw();
}
}
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment