diff --git a/tui.c b/tui.c index 8151953..4df1b08 100644 --- a/tui.c +++ b/tui.c @@ -892,6 +892,7 @@ static void draw_grid(void) { mvprintw(GRID_ROWS * CELL_HEIGHT + 18, 0, "? - Toggle help"); mvprintw(GRID_ROWS * CELL_HEIGHT + 19, 0, "Esc/q - Quit"); mvprintw(GRID_ROWS * CELL_HEIGHT + 20, 0, "In fuzzy search: j/k navigate, h/l page, Enter select, Esc cancel"); + mvprintw(GRID_ROWS * CELL_HEIGHT + 21, 0, "L - Load sample into selected clip (fuzzy search)"); attroff(COLOR_PAIR(COLOR_HELP)); } @@ -1334,6 +1335,23 @@ void tui_run(Engine *engine) { zoom_mode = !zoom_mode; break; } + case 'L': { + // Start fuzzy search for WAV files + const char *samples_dir = getenv("JACK_LOOPER_SAMPLES_DIR"); + if (!samples_dir) samples_dir = "."; + int count; + const char **files = list_wav_files(samples_dir, &count); + if (files && count > 0) { + start_fuzzy_search_items("Load sample:", load_sample_callback, + files, count, true); + } else { + // No files found, show message + mvprintw(LINES - 1, 0, "No WAV files found in %s", samples_dir); + refresh(); + napms(1500); + } + break; + } case '?': show_help = !show_help; break;