-- Rykord - ImGui Media Explorer -- folders are represented as tree nodes -- items are…
- User
-- Rykord - ImGui Media Explorer
-- folders are represented as tree nodes -- items are selectables -- play functionality with volume knob and autoplay -- drag and drop functionalities -- drop to the arrange view (priority) -- drop to the media explorer -- search bar functionality
-- Store the reference to the currently playing preview local current_preview = nil
-- Variables for search functionality local search_query = "" local last_search_query = "" local search_cache = {} local debounce_timer = 0
-- Function to check if a directory contains any matching files function directory_contains_matching_files(path) if search_cache[path] ~= nil then return search_cache[path] end
codelocal idx = 0 local contains_matches = false while true do local file = reaper.EnumerateFiles(path, idx) if not file then break end -- Ignore hidden files and directories if not file:match("^%.") then -- Check if the file matches the search query if (file:match("%.wav$") or file:match("%.mp3$")) and (search_query == "" or file:lower():find(search_query:lower(), 1, true)) then contains_matches = true break end end idx = idx + 1 end if not contains_matches then idx = 0 while true do local subdir = reaper.EnumerateSubdirectories(path, idx) if not subdir then break end -- Ignore hidden files and directories if not subdir:match("^%.") then local full_path = path .. "/" .. subdir if directory_contains_matching_files(full_path) then contains_matches = true break end end idx = idx + 1 end end search_cache[path] = contains_matches return contains_matchesend
-- Function to create a directory tree and search for files recursively function create_directory_tree(path, depth) if depth > 5 then return end -- Limit search depth
- Assistant