paraslash Paraslash Audio Streaming
About   News   Download   Documentation   Development

Data Fields
selector_operations Struct Reference

Data Fields

int(* load )(const char *mood_name, struct para_buffer *pbout, struct afs_callback_arg *aca, struct selector_instance **result)
 
int(* loop )(int(*func)(struct osl_row *aft_row, long score, void *data), struct selector_instance *si, void *data)
 
void(* unload )(struct selector_instance *si)
 
int(* check )(struct afs_callback_arg *aca)
 
int(* get_best )(struct osl_row **aft_row, long *score, struct selector_instance *si)
 
int(* invalidate )(struct osl_row *aft_row, struct selector_instance *si)
 

Detailed Description

API implemented by the mood and playlist selectors.

A selector implements a set of operations, including a method to map a name to a list of audio files called the admissible files.

The mood and playlist selector determine the admissible files by readuing a blob of the corresponding blob table, then consulting the audio file table. Both selectors maintain a score table which contains one row for each admissible file. This implementation detail is hidden in the API, though.

Field Documentation

◆ load

int(* load) (const char *mood_name, struct para_buffer *pbout, struct afs_callback_arg *aca, struct selector_instance **result)

A reference to the newly created instance is returned via the result pointer, which must not be NULL.

The caller can pass this reference to various methods, for example to ->loop() to iterate the admissible files. It should call ->unload() to free the mood instance when it is no longer needed.

If the message pointer is not NULL, a suitable message is returned there in all cases. The caller must free this string.

◆ loop

int(* loop) (int(*func)(struct osl_row *aft_row, long score, void *data), struct selector_instance *si, void *data)

Iterate over all admissible files.

◆ unload

void(* unload) (struct selector_instance *si)

Free all memory allocated at load time.

◆ check

int(* check) (struct afs_callback_arg *aca)

Perform integrity checks, if any.

◆ get_best

int(* get_best) (struct osl_row **aft_row, long *score, struct selector_instance *si)

Get a reference to the highest scoring audio file.

◆ invalidate

int(* invalidate) (struct osl_row *aft_row, struct selector_instance *si)

Mark an audio file as non-admissible.


The documentation for this struct was generated from the following file: