|
| 1 | +/* |
| 2 | + * Copyright (C) 2025 The HighResMusicPlayer community |
| 3 | + * |
| 4 | + * This program is free software: you can redistribute it and/or modify |
| 5 | + * it under the terms of the GNU General Public License as published by |
| 6 | + * the Free Software Foundation, either version 3 of the License, or |
| 7 | + * (at your option) any later version. |
| 8 | + * |
| 9 | + * This program is distributed in the hope that it will be useful, |
| 10 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | + * GNU General Public License for more details. |
| 13 | + * |
| 14 | + * You should have received a copy of the GNU General Public License |
| 15 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 16 | + */ |
| 17 | + |
| 18 | +#ifndef HRMP_PLAYLIST_H |
| 19 | +#define HRMP_PLAYLIST_H |
| 20 | + |
| 21 | +#ifdef __cplusplus |
| 22 | +extern "C" { |
| 23 | +#endif |
| 24 | + |
| 25 | +#include <list.h> |
| 26 | + |
| 27 | +#include <stdbool.h> |
| 28 | + |
| 29 | +/** |
| 30 | + * Load a playlist file (.hrmp) into an existing files list. |
| 31 | + * |
| 32 | + * Each non-empty line can be: |
| 33 | + * - Relative file/directory path (relative to the playlist file directory) |
| 34 | + * - Absolute file/directory path |
| 35 | + * - "*" to add all files in the playlist file directory |
| 36 | + * - recursive glob ("**" + "/" + "*") |
| 37 | + * |
| 38 | + * @param playlist_path Path to playlist file |
| 39 | + * @param files Target list to append files to |
| 40 | + * @param quiet If true, suppress warnings about missing files |
| 41 | + * @return 0 on success, otherwise 1 |
| 42 | + */ |
| 43 | +int |
| 44 | +hrmp_playlist_load(const char* playlist_path, struct list* files, bool quiet); |
| 45 | + |
| 46 | +#ifdef __cplusplus |
| 47 | +} |
| 48 | +#endif |
| 49 | + |
| 50 | +#endif |
0 commit comments