Paraslash Audio Streaming | |
About News Download Documentation Development |
Functions for loading and saving playlists. More...
#include <regex.h>
#include <osl.h>
#include <lopsub.h>
#include "para.h"
#include "error.h"
#include "string.h"
#include "afh.h"
#include "afs.h"
#include "ipc.h"
#include "sideband.h"
Functions | |
int | playlist_check_callback (struct afs_callback_arg *aca) |
Check the playlist table for inconsistencies. More... | |
void | playlist_unload (struct playlist_instance *pi) |
Free all resources of the given/current playlist. More... | |
int | playlist_load (const char *name, struct playlist_instance **result, char **msg) |
Populate the score table from the paths of a playlist database object. More... | |
int | playlist_loop (struct playlist_instance *pi, osl_rbtree_loop_func *func, void *data) |
Iterate over all admissible audio files of a playlist instance. More... | |
int | playlists_event_handler (enum afs_events event, __a_unused struct para_buffer *pb, void *data) |
Handle afs events relevant to playlists. More... | |
Functions for loading and saving playlists.
int playlist_check_callback | ( | struct afs_callback_arg * | aca | ) |
Check the playlist table for inconsistencies.
aca | This callback ignores ->query. |
References BLOBCOL_ID, osl(), para_printf(), and afs_callback_arg::pbout.
void playlist_unload | ( | struct playlist_instance * | pi | ) |
Free all resources of the given/current playlist.
pi | NULL means to unload the current playlist. |
References score_close().
int playlist_load | ( | const char * | name, |
struct playlist_instance ** | result, | ||
char ** | msg | ||
) |
Populate the score table from the paths of a playlist database object.
This loads the blob object which corresponds to the given name from the playlist table. Each line of the blob is regarded as a path which is looked up in the audio file table. If the path lookup succeeds, a reference to the corresponding row of the audio file table is added to the score table.
name | The name of the playlist to load. |
result | Opaque, refers to the underlying score table. |
msg | Error message or playlist info is returned here. |
References ERRNO_TO_PARA_ERROR, FELF_READ_ONLY, for_each_line(), make_message(), score_open(), and zalloc().
int playlist_loop | ( | struct playlist_instance * | pi, |
osl_rbtree_loop_func * | func, | ||
void * | data | ||
) |
Iterate over all admissible audio files of a playlist instance.
This wrapper around score_loop() is the playlist counterpart of mood_loop().
pi | Determines the score table to iterate. Must not be NULL. |
func | See score_loop(). |
data | See score_loop(). |
References score_loop().
int playlists_event_handler | ( | enum afs_events | event, |
__a_unused struct para_buffer * | pb, | ||
void * | data | ||
) |
Handle afs events relevant to playlists.
event | The event type. |
pb | Unused. |
data | Depends on the event type. |