I don't want to declare macros for every single string, and then have them in a separate file. Reason: you can no longer understand what exactly the program is printing there without having two files open.
400plus uses this technique. The programming style looks a lot cleaner than mine, but I have trouble browsing their code, because I need to switch back and forth between two files.
menuitem_t bramp_items[] = {
MENUITEM_BOOLEAN(0, LP_WORD(L_I_DELAY), &settings.bramp_delay, NULL),
MENUITEM_COUNTER(0, LP_WORD(L_I_SHOTS), &settings.bramp_shots, NULL),
MENUITEM_TIMEOUT(0, LP_WORD(L_I_INTERVAL), &settings.bramp_time, NULL),
MENUITEM_TIMEOUT(0, LP_WORD(L_I_EXPOSURE), &settings.bramp_exp, NULL),
MENUITEM_BRTIME( 0, LP_WORD(L_I_RAMP_T), &settings.bramp_ramp_t, NULL),
MENUITEM_BRSHOTS(0, LP_WORD(L_I_RAMP_S), &settings.bramp_ramp_s, NULL),
MENUITEM_EVCOMP (0, LP_WORD(L_I_RAMPING_TIME), &settings.bramp_ramp_time, NULL),
MENUITEM_EVCOMP (0, LP_WORD(L_I_RAMPING_EXP), &settings.bramp_ramp_exp, NULL),
};
and in another file:
LANG_PAIR( I_MANUAL_L, "Bulb min" ) \
LANG_PAIR( I_MANUAL_R, "Bulb max" ) \
LANG_PAIR( I_INTERVAL, "Interval" ) \
LANG_PAIR( I_EXPOSURE, "Exposure" ) \
LANG_PAIR( I_RAMP_T, "Ramp size (time)" ) \
LANG_PAIR( I_RAMP_S, "Ramp size (shots)" ) \
LANG_PAIR( I_RAMPING_EXP, "Ramping (exposure)" ) \
LANG_PAIR( I_RAMPING_TIME, "Ramping (interval)" ) \
ML version is more verbose, but I know exactly what I'm going to get:
{
.name = "Intervalometer",
.priv = &intervalometer_running,
.max = 1,
.update = intervalometer_display,
.help = "Take pictures at fixed intervals (for timelapse).",
.submenu_width = 700,
.works_best_in = DEP_PHOTO_MODE,
.children = (struct menu_entry[]) {
{
.name = "Take a pic every",
.priv = &interval_timer_index,
.update = interval_timer_display,
.select = interval_timer_toggle,
.icon_type = IT_PERCENT,
.help = "Duration between two shots.",
},
{
.name = "Start after",
.priv = &interval_start_timer_index,
.update = interval_start_after_display,
.select = interval_timer_toggle,
.icon_type = IT_PERCENT,
.help = "Start the intervalometer after X seconds / minutes / hours.",
},
{
.name = "Stop after",
.priv = &interval_stop_after,
.max = 5000, // 5000 shots
.update = interval_stop_after_display,
.icon_type = IT_PERCENT_LOG_OFF,
.help = "Stop the intervalometer after taking X shots.",
},
#ifdef FEATURE_FOCUS_RAMPING
{
.name = "Manual FocusRamp",
.priv = &bramp_manual_speed_focus_steps_per_shot,
.max = 100,
.min = -100,
.update = manual_focus_ramp_print,
.help = "Manual focus ramping, in steps per shot. LiveView only.",
.help2 = "Tip: enable powersaving features from Prefs menu.",
.depends_on = DEP_AUTOFOCUS,
.works_best_in = DEP_LIVEVIEW,
},
#endif
MENU_EOL
},
},
Of course, 400plus has only 180 strings, so it's a lot less work there.
So, where's the advantage?