|
enum | ls_sorting_method {
LS_SORT_BY_PATH,
LS_SORT_BY_SCORE,
LS_SORT_BY_LAST_PLAYED,
LS_SORT_BY_NUM_PLAYED,
LS_SORT_BY_FREQUENCY,
LS_SORT_BY_CHANNELS,
LS_SORT_BY_IMAGE_ID,
LS_SORT_BY_LYRICS_ID,
LS_SORT_BY_BITRATE,
LS_SORT_BY_DURATION,
LS_SORT_BY_AUDIO_FORMAT,
LS_SORT_BY_HASH
} |
| The different sorting methods of the ls command. More...
|
|
enum | ls_listing_mode {
LS_MODE_SHORT,
LS_MODE_LONG,
LS_MODE_VERBOSE,
LS_MODE_MBOX,
LS_MODE_CHUNKS,
LS_MODE_PARSER
} |
| The different listing modes of the ls command. More...
|
|
enum | afsi_offsets {
AFSI_LAST_PLAYED_OFFSET = 0,
AFSI_ATTRIBUTES_OFFSET = 8,
AFSI_NUM_PLAYED_OFFSET = 16,
AFSI_IMAGE_ID_OFFSET = 20,
AFSI_LYRICS_ID_OFFSET = 24,
AFSI_AUDIO_FORMAT_ID_OFFSET = 28,
AFSI_AMP_OFFSET = 29,
AFSI_AUDIO_FORMAT_UNUSED_OFFSET = 30,
AFSI_SIZE = 32
} |
| Describes the layout of the mmapped-afs info struct. More...
|
|
enum | audio_file_table_columns {
AFTCOL_HASH,
AFTCOL_PATH,
AFTCOL_AFSI,
AFTCOL_AFHI,
AFTCOL_CHUNKS,
NUM_AFT_COLUMNS,
AFTCOL_HASH,
AFTCOL_PATH,
AFTCOL_AFSI,
AFTCOL_AFHI,
AFTCOL_CHUNKS,
NUM_AFT_COLUMNS
} |
| The columns of the audio file table. More...
|
|
enum | afhi_offsets {
AFHI_SECONDS_TOTAL_OFFSET = 0,
AFHI_BITRATE_OFFSET = 4,
AFHI_FREQUENCY_OFFSET = 8,
AFHI_UNUSED1_OFFSET = 12,
AFHI_HEADER_LEN_OFFSET = 16,
CHUNKS_TOTAL_OFFSET = 20,
HEADER_LEN_OFFSET = 24,
AFHI_MAX_CHUNK_SIZE_OFFSET = 28,
CHUNK_TV_TV_SEC_OFFSET = 32,
CHUNK_TV_TV_USEC_OFFSET = 36,
AFHI_CHANNELS_OFFSET = 40,
AFHI_INFO_STRING_OFFSET = 41,
MIN_AFHI_SIZE = 47
} |
| The on-disk layout of a afhi struct. More...
|
|
enum | com_add_buffer_offsets {
CAB_AFHI_OFFSET_POS = 0,
CAB_CHUNKS_OFFSET_POS = 4,
CAB_LPR_OFFSET = 8,
CAB_AUDIO_FORMAT_ID_OFFSET = 12,
CAB_HASH_OFFSET = 13,
CAB_PATH_OFFSET = (CAB_HASH_OFFSET + 32 )
} |
| The format of the data stored by save_audio_file_data(). More...
|
|
enum | touch_flags { TOUCH_FLAG_FNM_PATHNAME = 1,
TOUCH_FLAG_VERBOSE = 2
} |
| Flags used by the touch command. 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 | 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_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 | 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 | load_afd (int shmid, struct audio_file_data *afd) |
| Extract a afd stored in a shared memory area. More...
|
|
void | free_status_items (void) |
| Deallocate and invalidate the status item strings. More...
|
|
int | open_and_update_audio_file (int *fd) |
| Open the audio file with highest score and set up an afd structure. 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 | send_afs_status (struct command_context *cc, int parser_friendly) |
| Get the current afs status items from the afs process and send it. More...
|
|
int | aft_check_callback (struct afs_callback_arg *aca) |
| Check the audio file table for inconsistencies. 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...
|
|
Audio file table functions.
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.
- Parameters
-
shmid | The identifier of the shared memory area containing the afd. |
afd | Result pointer. |
- Returns
- Standard.
References ATTACH_RO, shm_attach(), and shm_size().
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.
- Parameters
-
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.
- Returns
- Positive shmid on success, negative on errors.
References HASH2_SIZE.
int aft_check_attributes |
( |
uint64_t |
att_mask, |
|
|
struct para_buffer * |
pb |
|
) |
| |
Iterate over all audio files and check the attribute bit mask.
- Parameters
-
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.
- Returns
- Standard. Inconsistencies are not regarded as errors.
- See also
- attribute_check_callback().
References audio_file_loop(), and para_printf().