X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;ds=sidebyside;f=aft.c;h=4ff7ef198cf3f18de42836396b56bf221ff3cbc9;hb=f3c29f0f4c000f3d860c0da31d4387afc798a77a;hp=d1c46ba0255da44bf5d42a4fa83aa1c4db53a7c8;hpb=28c8e051a5e94db5105787e8450bab35931f78b8;p=paraslash.git diff --git a/aft.c b/aft.c index d1c46ba0..4ff7ef19 100644 --- a/aft.c +++ b/aft.c @@ -20,6 +20,50 @@ static struct osl_table *audio_file_table; +enum ls_listing_mode { + LS_MODE_SHORT, + LS_MODE_LONG, + LS_MODE_VERBOSE, + LS_MODE_MBOX +}; + +enum ls_flags { + LS_FLAG_FULL_PATH = 1, + LS_FLAG_ADMISSIBLE_ONLY = 2, + LS_FLAG_REVERSE = 4, +}; + +struct ls_widths { + unsigned short score_width; + unsigned short image_id_width; + unsigned short lyrics_id_width; + unsigned short bitrate_width; + unsigned short frequency_width; + unsigned short duration_width; + unsigned short num_played_width; +}; + +struct ls_data { + struct audio_format_info afhi; + struct afs_info afsi; + char *path; + long score; + HASH_TYPE *hash; +}; + +struct ls_options { + unsigned flags; + enum ls_sorting_method sorting; + enum ls_listing_mode mode; + char **patterns; + int num_patterns; + struct ls_widths widths; + uint32_t array_size; + uint32_t num_matching_paths; + struct ls_data *data; + struct ls_data **data_ptr; +}; + /** * Describes the layout of the mmapped-afs info struct. * @@ -741,7 +785,8 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts, "channels: %d\n" "duration: %s\n" "num_played: %d\n" - "last_played: %s\n\n", + "last_played: %s\n" + "tag info: %s\n", (opts->flags & LS_FLAG_FULL_PATH)? "path" : "file", d->path, have_score? "score: " : "", score_buf, @@ -756,7 +801,8 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts, afhi->channels, duration_buf, afsi->num_played, - last_played_time + last_played_time, + afhi->info_string ); free(att_line); free(lyrics_line); @@ -1780,10 +1826,9 @@ int aft_init(struct table_info *ti, const char *db) audio_file_table_desc.dir = db; ti->desc = &audio_file_table_desc; - ret = osl_open_table(ti->desc, &ti->table); + ret = osl_open_table(ti->desc, &audio_file_table); if (ret >= 0) { unsigned num; - audio_file_table = ti->table; osl_get_num_rows(audio_file_table, &num); PARA_INFO_LOG("audio file table contains %d files\n", num); return ret;