A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 76 lines 1.5 kB view raw
1/* A _very_ skeleton file to demonstrate building tagcache db on host. */ 2 3#include <stdbool.h> 4#include <stdio.h> 5#include <errno.h> 6#include <dirent.h> 7#include <sys/stat.h> 8#include <sys/types.h> 9 10#include "config.h" 11#include "tagcache.h" 12#include "dir.h" 13 14/* This is meant to be run on the root of the dap. it'll put the db files into 15 * a .rockbox subdir */ 16 17int main(int argc, char **argv) 18{ 19 (void)argc; 20 (void)argv; 21 22 fprintf(stderr, "Rockbox database tool for '%s'\n\n", TARGET_NAME); 23 24 DIR* rbdir = opendir(ROCKBOX_DIR); 25 if (!rbdir) { 26 fprintf(stderr, "Unable to find the '%s' directory!\n", ROCKBOX_DIR); 27 fprintf(stderr, "This needs to be executed in your DAP's top-level directory!\n\n"); 28 return 1; 29 } 30 closedir(rbdir); 31 32 /* / is actually ., will get translated in io.c 33 * (with the help of sim_root_dir below */ 34 const char *paths[] = { "/", NULL }; 35 tagcache_init(); 36 37 fprintf(stderr, "Scanning files (may take some time)..."); 38 39 do_tagcache_build(paths); 40 tagcache_reverse_scan(); 41 42 fprintf(stderr, "...done!\n"); 43 44 return 0; 45} 46 47 48/* needed for io.c */ 49const char *sim_root_dir = "."; 50 51/* stubs to avoid including thread-sdl.c */ 52#include "kernel.h" 53void mutex_init(struct mutex *m) 54{ 55 (void)m; 56} 57 58void mutex_lock(struct mutex *m) 59{ 60 (void)m; 61} 62 63void mutex_unlock(struct mutex *m) 64{ 65 (void)m; 66} 67 68void sim_thread_lock(void *me) 69{ 70 (void)me; 71} 72 73void * sim_thread_unlock(void) 74{ 75 return (void*)1; 76}