/* scorpiox-scorpioplayer-lrc-lyrics-parse — public C API (C99) */ #ifndef SCORPIOX_SPLRC_H #define SCORPIOX_SPLRC_H #include #ifndef SPLRC_API # if defined(__GNUC__) # define SPLRC_API __attribute__((visibility("default"))) # else # define SPLRC_API # endif #endif #ifdef __cplusplus extern "C" { #endif typedef enum { SPLRC_OK = 0, SPLRC_ERR_PARSE = 1, SPLRC_ERR_EMPTY = 2, SPLRC_ERR_INVALID_ARG = 3, SPLRC_ERR_IO = 4, SPLRC_ERR_OOM = 5 } splrc_status; /* Parse UTF-8 LRC text. Returns splrc_status. */ SPLRC_API int splrc_parse(const char *text, size_t len); SPLRC_API int splrc_parse_file(const char *path); /* Improved IsLrc: 1 if looks like LRC, 0 otherwise. */ SPLRC_API int splrc_detect(const char *text, size_t len); SPLRC_API void splrc_clear(void); SPLRC_API int splrc_line_count(void); SPLRC_API int splrc_line_start_ms(int i); /* Next line start; last line = start + 3000 (subtitle-adapter projection). */ SPLRC_API int splrc_line_end_ms(int i); SPLRC_API const char *splrc_line_text(int i); /* key: ti|ar|al|by (case-insensitive). NULL if unset. */ SPLRC_API const char *splrc_meta(const char *key); SPLRC_API int splrc_offset_ms(void); /* TagParser heuristics — separate scratch state from last parse_title call. */ SPLRC_API int splrc_tag_parse_title(const char *title); /* fills artists */ SPLRC_API int splrc_tag_artist_count(void); SPLRC_API const char *splrc_tag_artist(int i); SPLRC_API const char *splrc_tag_clean_title(const char *title); /* static/owned until next call */ SPLRC_API const char *splrc_result_json(void); SPLRC_API const char *splrc_last_error(void); SPLRC_API int splrc_warning_count(void); SPLRC_API const char *splrc_warning(int i); #ifdef __cplusplus } #endif #endif /* SCORPIOX_SPLRC_H */