-- Store the reference to the currently playing preview local currentpreview = nil --…
- User
-- Store the reference to the currently playing preview local current_preview = nil
-- Variables for search functionality local search_query = ""
-- Function to handle search input function handle_search_input(ctx) local changed, text = reaper.ImGui_InputText(ctx, "Search", search_query, 256) if changed then search_query = text end return search_query end
-- Function to create a directory tree and search for files recursively function create_directory_tree(path, depth) -- Enumerate subdirectories and files local idx = 0 while true do local subdir = reaper.EnumerateSubdirectories(path, idx) if not subdir then break end
codelocal full_path = path .. "/" .. subdir -- Check if the directory matches the search query if search_query == "" or subdir:lower():find(search_query:lower(), 1, true) then if reaper.ImGui_TreeNode(ctx, subdir) then create_directory_tree(full_path, depth + 1) reaper.ImGui_TreePop(ctx) end end idx = idx + 1 end -- Enumerate files idx = 0 while true do local file = reaper.EnumerateFiles(path, idx) if not file then break end -- Check if the file matches the search query if (file:match("%.wav$") or file:match("%.mp3$")) then if search_query:startsWith("body:") then -- Search for the query in the file content if search_file_content(path .. "/" .. file, search_query:sub(6)) then if reaper.ImGui_Selectable(ctx, file) then preview_file(path .. "/" .. file) end end elseif search_query == "" or file:lower():find(search_query:lower(), 1, true) then if reaper.ImGui_Selectable(ctx, file) then preview_file(path .. "/" .. file) end end end idx = idx + 1 end - Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.