Paraslash Audio Streaming | |
About News Download Documentation Development |
Exported symbols of the audio file selector. More...
Data Structures | |
struct | afs_info |
Audio file selector data stored in the audio file table. More... | |
struct | rmatt_event_data |
Used as data for afs_event() for events of type ATTRIBUTE_ADD . More... | |
struct | afsi_change_event_data |
Used as data for afs_event() for events of type ATTRIBUTE_AFSI_CHANGE . More... | |
struct | afs_table_operations |
Methods for table startup/shutdown and event handling. More... | |
struct | pattern_match_data |
Structure passed to for_each_matching_row(). More... | |
struct | afs_callback_arg |
Arguments passed to each afs callback. More... | |
struct | afs_max_size_handler_data |
Structure passed to the AFS max_size handler. More... | |
Macros | |
#define | NUM_COMPARE(x, y) ((int)((x) < (y)) - (int)((x) > (y))) |
evaluates to 1 if x < y, to -1 if x > y and to 0 if x == y More... | |
#define | DECLARE_BLOB_SYMBOLS(table_name, cmd_prefix) |
Define exported functions and a table pointer for an osl blob table. More... | |
Typedefs | |
typedef int | afs_callback(struct afs_callback_arg *aca) |
The "top half" of an afs command. More... | |
typedef int | callback_result_handler(struct osl_object *result, uint8_t band, void *private) |
Dispatch the output of an afs callback. More... | |
Enumerations | |
enum | afs_events { ATTRIBUTE_ADD, ATTRIBUTE_RENAME, ATTRIBUTE_REMOVE, AFSI_CHANGE, AFHI_CHANGE, AUDIO_FILE_RENAME, AUDIO_FILE_ADD, AUDIO_FILE_REMOVE, BLOB_ADD, BLOB_RENAME, BLOB_REMOVE } |
Events caused by changes to an afs table. More... | |
enum | play_mode { PLAY_MODE_MOOD, PLAY_MODE_PLAYLIST } |
How audio files are selected by afs. More... | |
enum | afs_server_code { NEXT_AUDIO_FILE, NO_ADMISSIBLE_FILES } |
Codes used for communication between the server and the afs process. More... | |
enum | pattern_match_flags { PM_REVERSE_LOOP = 1, PM_NO_PATTERN_MATCHES_EVERYTHING = 2, PM_SKIP_EMPTY_NAME = 4 } |
Flags passed to for_each_matching_row(). More... | |
enum | blob_table_columns { BLOBCOL_ID, BLOBCOL_NAME, BLOBCOL_DEF, NUM_BLOB_COLUMNS } |
blob_symbols More... | |
Functions | |
int | afs_cb_result_handler (struct osl_object *result, uint8_t band, void *private) |
Result handler for sending data to the para_client process. More... | |
int | pass_buffer_as_shm (int fd, uint8_t band, const char *buf, size_t size) |
Send data as shared memory to a file descriptor. More... | |
_static_inline_ int | afs_max_size_handler (char *buf, size_t size, void *private) |
Standard max_size handler for AFS commands. More... | |
__noreturn void | afs_init (int socket_fd) |
Initialize the audio file selector process. More... | |
__must_check int | afs_event (enum afs_events event, struct para_buffer *pb, void *data) |
The afs event dispatcher. More... | |
int | send_callback_request (afs_callback *f, struct osl_object *query, callback_result_handler *result_handler, void *private_result_data) |
Ask the afs process to call a given function. More... | |
int | send_lls_callback_request (afs_callback *f, const struct lls_command *const cmd, struct lls_parse_result *lpr, void *private_result_data) |
Wrapper for send_callback_request() which passes a lopsub parse result. More... | |
__printf_2_3 void | afs_error (const struct afs_callback_arg *aca, const char *fmt,...) |
Format and send an error message to the command handler. More... | |
int | string_compare (const struct osl_object *obj1, const struct osl_object *obj2) |
Compare two osl objects of string type. More... | |
int | for_each_matching_row (struct pattern_match_data *pmd) |
Execute the given function for each matching row. More... | |
void | score_open (struct osl_table **result) |
Allocate a score table instance. More... | |
void | score_close (struct osl_table *t) |
Free all volatile objects, then close the table. More... | |
int | score_loop (osl_rbtree_loop_func *func, struct osl_table *t, void *data) |
Call the given function for each row of the score table. More... | |
int | score_get_best (struct osl_row **aft_row, long *score) |
Get the admissible audio file with highest score. More... | |
int | get_score_and_aft_row (struct osl_row *score_row, long *score, struct osl_row **aft_row) |
Given an admissible file, get the corresponding row in the aft and the score. More... | |
int | score_add (const struct osl_row *aft_row, long score, struct osl_table *t) |
Add a (row, score) pair to the score table. More... | |
int | score_update (const struct osl_row *aft_row, long new_score) |
Replace a row of the score table. More... | |
int | score_delete (const struct osl_row *aft_row) |
Remove an entry from the rbtree of admissible files. More... | |
void | score_clear (void) |
Remove all entries from the score table, but keep the table open. More... | |
bool | row_belongs_to_score_table (const struct osl_row *aft_row) |
Find out whether an audio file is contained in the score table. More... | |
void | get_attribute_bitmap (const uint64_t *atts, char *buf) |
Return a binary representation of the given attribute value. More... | |
int | get_attribute_bitnum_by_name (const char *att_name, unsigned char *bitnum) |
Retrieve the identifier (number) of an attribute. More... | |
int | get_attribute_text (uint64_t *atts, const char *delim, char **text) |
Get a string containing the set attributes in text form. More... | |
int | attribute_check_callback (struct afs_callback_arg *aca) |
Compute the attribute bit mask and check each afs info bitmap. More... | |
int | aft_get_row_of_path (const char *path, struct osl_row **row) |
Get the row of the audio file table corresponding to the given path. More... | |
int | aft_check_attributes (uint64_t att_mask, struct para_buffer *pb) |
Iterate over all audio files and check the attribute bit mask. More... | |
int | open_and_update_audio_file (int *fd) |
Open the audio file with highest score and set up an afd structure. More... | |
int | load_afd (int shmid, struct audio_file_data *afd) |
Extract a afd stored in a shared memory area. More... | |
int | get_afsi_of_row (const struct osl_row *row, struct afs_info *afsi) |
Get the audio file selector info, given a row of the audio file table. More... | |
int | get_afhi_of_row (const struct osl_row *row, struct afh_info *afhi) |
Get the audio format handler info, given a row of the audio file table. More... | |
int | get_audio_file_path_of_row (const struct osl_row *row, char **path) |
Get the path of an audio file, given a row of the audio file table. More... | |
int | audio_file_loop (void *private_data, osl_rbtree_loop_func *func) |
Call the given function for each file in the audio file table. More... | |
int | aft_check_callback (struct afs_callback_arg *aca) |
Check the audio file table for inconsistencies. More... | |
void | free_status_items (void) |
Deallocate and invalidate the status item strings. More... | |
int | mood_load (const char *mood_name, struct mood_instance **result, char **msg) |
Populate a score table with admissible files for the given mood. More... | |
int | mood_loop (struct mood_instance *m, osl_rbtree_loop_func *func, void *data) |
Iterate over the admissible files of a mood instance. More... | |
void | mood_unload (struct mood_instance *m) |
Free all resources of a mood instance. More... | |
int | mood_check_callback (struct afs_callback_arg *aca) |
Check all moods for syntax errors. 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... | |
void | playlist_unload (struct playlist_instance *pi) |
Free all resources of the given/current playlist. More... | |
int | playlist_check_callback (struct afs_callback_arg *aca) |
Check the playlist table for inconsistencies. More... | |
Variables | |
const struct afs_table_operations | score_ops |
The score table stores (aft row, score) pairs in memory. More... | |
const struct afs_table_operations | attr_ops |
The attribute table stores name/bitnum pairs. More... | |
const struct afs_table_operations | aft_ops |
The audio file table contains information about known audio files. More... | |
Exported symbols of the audio file selector.
#define NUM_COMPARE | ( | x, | |
y | |||
) | ((int)((x) < (y)) - (int)((x) > (y))) |
evaluates to 1 if x < y, to -1 if x > y and to 0 if x == y
#define DECLARE_BLOB_SYMBOLS | ( | table_name, | |
cmd_prefix | |||
) |
Define exported functions and a table pointer for an osl blob table.
typedef int afs_callback(struct afs_callback_arg *aca) |
The "top half" of an afs command.
Afs command handlers run as a process which is not related to the afs process, i.e. they can not change the address space of afs directly. Therefore afs commands typically consist of two functions: The command handler and the corresponding callback function that runs in afs context.
typedef int callback_result_handler(struct osl_object *result, uint8_t band, void *private) |
Dispatch the output of an afs callback.
Some AFS callbacks need to send data back to the command handler. Pointers to this type of function are passed to send_callback_request() and related functions to dispatch the data in the command handler process. Most (but not all) afs commands pass afs_cb_result_handler(), which sends the output of the callback to the connected client.
enum afs_events |
Events caused by changes to an afs table.
Whenever an afs table changes, an event is generated which causes afs to call the event handlers of all other tables. For example, if an audio file is added, the event handler of the mood table checks the new file for admissibility.
enum play_mode |
enum afs_server_code |
Codes used for communication between the server and the afs process.
Before forking the afs child, para_server creates a bidirectional pipe through which both processes communicate. Usually para_server requests a new audio file in order to start streaming or when the end of the current audio file has been reached. The afs process responds to such a request by sending back an eight byte buffer. The first four bytes is the uint32_t representation of the code, usually NEXT_AUDIO_FILE
if an admissible audio file was found, successfully opened and verified. The other four bytes represent the shared memory id of the shared memory area that contains details about the audio file to be streamed next. The open file descriptor of that file is also passed from afs to para_server through the same pipe.
Enumerator | |
---|---|
NEXT_AUDIO_FILE | An audio file was successfully opened. |
NO_ADMISSIBLE_FILES | No admissible audio file was found. |
enum pattern_match_flags |
Flags passed to for_each_matching_row().
enum blob_table_columns |
int afs_cb_result_handler | ( | struct osl_object * | result, |
uint8_t | band, | ||
void * | private | ||
) |
Result handler for sending data to the para_client process.
result | The data to be sent. |
band | The band designator. |
private | Pointer to the command context. |
References SBD_CRIT_LOG, SBD_DEBUG_LOG, SBD_EMERG_LOG, SBD_ERROR_LOG, SBD_INFO_LOG, SBD_NOTICE_LOG, SBD_OUTPUT, and SBD_WARNING_LOG.
int pass_buffer_as_shm | ( | int | fd, |
uint8_t | band, | ||
const char * | buf, | ||
size_t | size | ||
) |
Send data as shared memory to a file descriptor.
fd | File descriptor to send the shmid to. |
band | The band designator for this data. |
buf | The buffer holding the data to be sent. |
size | The size of buf. |
This function creates a shared memory area large enough to hold the content given by buf and size and sends the identifier of this area to the file descriptor fd.
It is called by the AFS max_size handler as well as directly by the AFS command callbacks to send command output to the command handlers.
NULL
or size is zero. Negative on errors, and positive on success. References ATTACH_RW, PARA_ERROR_LOG, SBD_OUTPUT, shm_attach(), shm_destroy(), shm_detach(), shm_new(), and write_all().
Referenced by afs_error(), and afs_max_size_handler().
_static_inline_ int afs_max_size_handler | ( | char * | buf, |
size_t | size, | ||
void * | private | ||
) |
Standard max_size handler for AFS commands.
buf | Contains (part of) the AFS command output. |
size | The number of bytes in buf. |
private | Pointer to a afs_max_size_handler_data structure. |
Whenever the output of an AFS command exceeds the maximal size of a shared memory area, the max size handler of the para_buffer which holds the command output is called with private being a pointer to a structure of type afs_max_size_handler_data.
References afs_max_size_handler_data::band, afs_max_size_handler_data::fd, and pass_buffer_as_shm().
__noreturn void afs_init | ( | int | socket_fd | ) |
Initialize the audio file selector process.
socket_fd | File descriptor used for communication with the server. |
__must_check int afs_event | ( | enum afs_events | event, |
struct para_buffer * | pb, | ||
void * | data | ||
) |
The afs event dispatcher.
event | Type of the event. |
pb | May be NULL . |
data | Type depends on event. |
This function calls each table event handler, passing pb and data verbatim. It's up to the handlers to interpret the data pointer. If a handler returns negative, the loop is aborted.
References NUM_AFS_TABLES.
int send_callback_request | ( | afs_callback * | f, |
struct osl_object * | query, | ||
callback_result_handler * | result_handler, | ||
void * | private_result_data | ||
) |
Ask the afs process to call a given function.
f | The function to be called. |
query | Pointer to arbitrary data for the callback. |
result_handler | Called for each shm area sent by the callback. |
private_result_data | Passed verbatim to result_handler. |
This function creates a socket for communication with the afs process and a shared memory area (sma) to which the buffer pointed to by query is copied. It then notifies the afs process that the callback function f should be executed by sending the shared memory identifier (shmid) to the socket.
If the callback produces a result, it sends any number of shared memory identifiers back via the socket. For each such identifier received, result_handler is called. The contents of the sma identified by the received shmid are passed to that function as an osl object. The private_result_data pointer is passed as the second argument to result_handler.
References afs_socket_cookie, ATTACH_RW, connect_local_socket(), OPT_STRING_VAL, recv_bin_buffer(), shm_attach(), shm_detach(), shm_new(), and write_all().
Referenced by send_afs_status().
int send_lls_callback_request | ( | afs_callback * | f, |
const struct lls_command *const | cmd, | ||
struct lls_parse_result * | lpr, | ||
void * | private_result_data | ||
) |
Wrapper for send_callback_request() which passes a lopsub parse result.
f | The callback function. |
cmd | Needed for (de-)serialization. |
lpr | Must match cmd. |
private_result_data | Passed to send_callback_request(). |
This function serializes the parse result given by the lpr pointer into a buffer. The buffer is sent as the query to the afs process with the callback mechanism.
__printf_2_3 void afs_error | ( | const struct afs_callback_arg * | aca, |
const char * | fmt, | ||
... | |||
) |
Format and send an error message to the command handler.
To pass an error message from the callback of an afs command to the client, this function should be called. It formats the message into a buffer which is passed as a shared memory area to the command handler from where it propagates to the client.
The message will be tagged with the ERROR_LOG sideband designator so that the client writes it to its stderr stream rather than to stdout as with aca->pbout. In analogy to the default Unix semantics of stderr, the message is sent without buffering.
If sending the error message fails, an error is logged on the server side, but no other action is taken.
aca | Used to obtain the fd to send the shmid to. |
fmt | Usual format string. |
References afs_callback_arg::fd, PARA_ERROR_LOG, para_strerror(), pass_buffer_as_shm(), SBD_ERROR_LOG, and xvasprintf().
int string_compare | ( | const struct osl_object * | obj1, |
const struct osl_object * | obj2 | ||
) |
Compare two osl objects of string type.
obj1 | Pointer to the first object. |
obj2 | Pointer to the second object. |
In any case, only MIN
(obj1->size, obj2->size) characters of each string are taken into account.
References PARA_MIN.
int for_each_matching_row | ( | struct pattern_match_data * | pmd | ) |
Execute the given function for each matching row.
pmd | Describes what to match and how. |
References pattern_match_data::loop_col_num, osl(), pattern_match_data::pm_flags, PM_REVERSE_LOOP, and pattern_match_data::table.
void score_open | ( | struct osl_table ** | result | ) |
Allocate a score table instance.
result | NULL means to open the currently active score table. |
Since the score table does no filesystem I/O, this function always succeeds.
References osl().
Referenced by playlist_load().
void score_close | ( | struct osl_table * | t | ) |
Free all volatile objects, then close the table.
t | As returned from score_open(). |
This either succeeds or terminates the calling process.
Referenced by playlist_unload().
int score_loop | ( | osl_rbtree_loop_func * | func, |
struct osl_table * | t, | ||
void * | data | ||
) |
Call the given function for each row of the score table.
func | Callback, called once per row. |
t | NULL means to use the currently active score table. |
data | Passed verbatim to the callback. |
References osl().
Referenced by mood_loop(), and playlist_loop().
int score_get_best | ( | struct osl_row ** | aft_row, |
long * | score | ||
) |
Get the admissible audio file with highest score.
aft_row | Points to the row in the aft of the "best" audio file. |
score | Highest score value in the score table. |
References osl().
int get_score_and_aft_row | ( | struct osl_row * | score_row, |
long * | score, | ||
struct osl_row ** | aft_row | ||
) |
Given an admissible file, get the corresponding row in the aft and the score.
score_row | Determines the admissible file. |
score | Result pointer. |
aft_row | Result pointer. |
int score_add | ( | const struct osl_row * | aft_row, |
long | score, | ||
struct osl_table * | t | ||
) |
Add a (row, score) pair to the score table.
aft_row | Identifies the audio file to be added. |
score | The score value of the audio file. |
t | NULL means to operate on the currently active table. |
References NUM_SCORE_COLUMNS.
int score_update | ( | const struct osl_row * | aft_row, |
long | percent | ||
) |
Replace a row of the score table.
aft_row | Determines the audio file to change. |
percent | The position to re-insert the audio file. |
The percent parameter must be between 0 and 100. A value of zero means to re-insert the audio file into the score table with a score lower than any other admissible file.
References osl().
int score_delete | ( | const struct osl_row * | aft_row | ) |
Remove an entry from the rbtree of admissible files.
aft_row | The file which is no longer admissible. |
void score_clear | ( | void | ) |
Remove all entries from the score table, but keep the table open.
bool row_belongs_to_score_table | ( | const struct osl_row * | aft_row | ) |
Find out whether an audio file is contained in the score table.
aft_row | The row of the audio file table. |
void get_attribute_bitmap | ( | const uint64_t * | atts, |
char * | buf | ||
) |
Return a binary representation of the given attribute value.
atts | Pointer to the attribute value. |
buf | Result. |
This function prints a string of at most 64 characters plus the terminating NULL
character into buf which must be provided by the caller and at least 65 bytes long. The "x" character is used for set attributes and "-" is used for unset attributes.
In practice, not all 64 attributes are defined. In this case, the function only prints N + 1 characters where N is the greatest id of a defined attribute.
int get_attribute_bitnum_by_name | ( | const char * | att_name, |
unsigned char * | bitnum | ||
) |
Retrieve the identifier (number) of an attribute.
att_name | The name of the attribute. |
bitnum | Result pointer. |
References osl().
Referenced by mp_is_set().
int get_attribute_text | ( | uint64_t * | atts, |
const char * | delim, | ||
char ** | text | ||
) |
Get a string containing the set attributes in text form.
atts | The attribute bitmap. |
delim | The delimiter to separate matching attribute names. |
text | Result pointer. |
int attribute_check_callback | ( | struct afs_callback_arg * | aca | ) |
Compute the attribute bit mask and check each afs info bitmap.
aca | The query field of aca is ignored. |
This iterates over all attributes in the attribute table and computes the logical or of 1 << b where b is the bit number of the attribute. The resulting bit mask is passed to aft_check_attributes() which performs the actual check.
int aft_get_row_of_path | ( | const char * | path, |
struct osl_row ** | row | ||
) |
Get the row of the audio file table corresponding to the given path.
path | The full path of the audio file. |
row | Result pointer. |
References osl().
int aft_check_attributes | ( | uint64_t | att_mask, |
struct para_buffer * | pb | ||
) |
Iterate over all audio files and check the attribute bit mask.
att_mask | The mask of all valid attributes. |
pb | Used for reporting inconsistencies. |
This reads the attribute bit mask of each audio file from the afs info structure stored in the audio file table and verifies that all set bits are also turned on in att_mask, i.e., correspond to an attribute of the attribute table. Audio files for which this is not the case are reported via pb.
References audio_file_loop(), and para_printf().
int open_and_update_audio_file | ( | int * | fd | ) |
Open the audio file with highest score and set up an afd structure.
This determines and opens the next audio file, verifies that it did not change by comparing the recomputed the hash value of the file contents against the value stored in the audio file table. If all goes well, it creates a shared memory area containing the serialized version of the afd structure, including the chunk table, if any. The caller can then send the ID of this area and the open fd to the server process.
fd | Result pointer for the file descriptor of the audio file. |
On success, the numplayed field of the audio file selector info is increased and the lastplayed time is set to the current time. Finally, the score of the audio file is updated.
References HASH2_SIZE.
int load_afd | ( | int | shmid, |
struct audio_file_data * | afd | ||
) |
Extract a afd stored in a shared memory area.
Attach the shared memory area given by shmid, load the audio file data stored therein and detach the area afterwards. Called by vss, after receiving a positive response to the request for the next audio file.
shmid | The identifier of the shared memory area containing the afd. |
afd | Result pointer. |
References ATTACH_RO, shm_attach(), and shm_size().
int get_afsi_of_row | ( | const struct osl_row * | row, |
struct afs_info * | afsi | ||
) |
Get the audio file selector info, given a row of the audio file table.
row | Pointer to a row in the audio file table. |
afsi | Result pointer. |
int get_afhi_of_row | ( | const struct osl_row * | row, |
struct afh_info * | afhi | ||
) |
Get the audio format handler info, given a row of the audio file table.
row | Pointer to a row of the audio file table. |
afhi | Result pointer. |
After the call the members of the afhi structure point to mapped memory which is owned by the osl table, Hence the caller must not attempt to free this memory by calling clear_afhi().
References osl().
int get_audio_file_path_of_row | ( | const struct osl_row * | row, |
char ** | path | ||
) |
int audio_file_loop | ( | void * | private_data, |
osl_rbtree_loop_func * | func | ||
) |
Call the given function for each file in the audio file table.
private_data | An arbitrary data pointer, passed to func. |
func | The custom function to be called. |
References osl().
Referenced by aft_check_attributes(), and aft_check_callback().
int aft_check_callback | ( | struct afs_callback_arg * | aca | ) |
Check the audio file table for inconsistencies.
aca | Only ->pbout is used for diagnostics. |
References audio_file_loop(), para_printf(), and afs_callback_arg::pbout.
void free_status_items | ( | void | ) |
int mood_load | ( | const char * | mood_name, |
struct mood_instance ** | result, | ||
char ** | msg | ||
) |
Populate a score table with admissible files for the given mood.
This consults the mood table to initialize the mood parser with the mood expression stored in the blob object which corresponds to the given name. A score table is allocated and populated with references to those entries of the audio file table which evaluate as admissible with respect to the mood expression. For each audio file a score value is computed and stored along with the file reference.
mood_name | The name of the mood to load. |
result | Opaque, refers to the mood parser and the score table. |
msg | Error message or mood info is returned here. |
If the mood name is NULL, the dummy mood is loaded. This mood regards every audio file as admissible.
A NULL result pointer instructs the function to operate on the current mood. That is, on the mood instance which is used by the server to select the next audio file for streaming. In this mode of operation, the mood which was active before the call, if any, is unloaded on success.
If result is not NULL, the current mood is unaffected and *result points to an initialized mood instance on success. The caller can pass this reference to mood_loop() to iterate over the admissible files, and should call mood_unload() to free the mood instance afterwards.
If the message pointer is not NULL, a suitable message is returned there in all cases. The caller must free this string.
int mood_loop | ( | struct mood_instance * | m, |
osl_rbtree_loop_func * | func, | ||
void * | data | ||
) |
Iterate over the admissible files of a mood instance.
This wrapper around score_loop() is the mood counterpart of playlist_loop().
m | Determines the score table to iterate. Must not be NULL. |
func | See score_loop(). |
data | See score_loop(). |
References score_loop().
void mood_unload | ( | struct mood_instance * | m | ) |
Free all resources of a mood instance.
m | As obtained by mood_load(). If NULL, unload the current mood. |
It's OK to call this with m == NULL even if no current mood is loaded.
int mood_check_callback | ( | struct afs_callback_arg * | aca | ) |
Check all moods for syntax errors.
aca | Output goes to ->pbout, errors to ->fd on the error band. |
References BLOBCOL_ID, osl(), para_printf(), and afs_callback_arg::pbout.
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().
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_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.
|
extern |
The score table stores (aft row, score) pairs in memory.
|
extern |
The attribute table stores name/bitnum pairs.
|
extern |
The audio file table contains information about known audio files.