From: Andre Noll Date: Tue, 23 Oct 2007 20:06:51 +0000 (+0200) Subject: Replace status item DBINFO2 by ATTRIBUTES. X-Git-Tag: v0.3.0~233 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=152ea84aba06555f8b828fce19d9531e97ff0b21;p=paraslash.git Replace status item DBINFO2 by ATTRIBUTES. --- diff --git a/afs.h b/afs.h index 4d3feb48..a4624ba2 100644 --- a/afs.h +++ b/afs.h @@ -72,6 +72,7 @@ enum play_mode {PLAY_MODE_MOOD, PLAY_MODE_PLAYLIST}; struct audio_file_data { enum play_mode current_play_mode; + char attributes_string[MAXLINE]; int fd; long score; struct afs_info afsi; diff --git a/aft.c b/aft.c index 99b972c9..f81c4856 100644 --- a/aft.c +++ b/aft.c @@ -666,6 +666,7 @@ int open_and_update_audio_file(struct osl_row *aft_row, struct audio_file_data * int ret = get_hash_of_row(aft_row, &aft_hash); struct afsi_change_event_data aced; struct osl_object map, chunk_table_obj; + char *tmp; if (ret < 0) return ret; @@ -704,7 +705,12 @@ int open_and_update_audio_file(struct osl_row *aft_row, struct audio_file_data * ret = load_chunk_info(&chunk_table_obj, &afd->afhi); if (ret < 0) goto err; - + ret = get_attribute_text(&afd->afsi.attributes, " ", &tmp); + if (ret < 0) + goto err; + tmp[sizeof(afd->attributes_string) - 1] = '\0'; + strcpy(afd->attributes_string, tmp); /* OK */ + free(tmp); aced.aft_row = aft_row; aced.old_afsi = &afd->afsi; afs_event(AFSI_CHANGE, NULL, &aced); diff --git a/command.c b/command.c index 977e4567..74141b9e 100644 --- a/command.c +++ b/command.c @@ -115,7 +115,7 @@ static char *get_status(struct misc_meta_data *nmmd) "%s:%zu\n" "%s:%s\n" "%s:%lu\n" "%s:%u\n" "%s:%s\n" "%s:%s\n" "%s:%s\n" "%s:%s\n" "%s:%li\n" "%s:%s\n" "%s:%s\n" "%s" - "%s:%s\n" "%s:%lu.%lu\n" "%s:%lu.%lu\n", + "%s:%s\n" "%s:%lu.%lu\n" "%s:%lu.%lu\n" "%s:%s\n", status_item_list[SI_FILE_SIZE], nmmd->size / 1024, status_item_list[SI_MTIME], mtime, status_item_list[SI_LENGTH], nmmd->afd.afhi.seconds_total, @@ -137,7 +137,8 @@ static char *get_status(struct misc_meta_data *nmmd) (long unsigned)nmmd->stream_start.tv_usec, status_item_list[SI_CURRENT_TIME], (long unsigned)now.tv_sec, - (long unsigned)now.tv_usec + (long unsigned)now.tv_usec, + status_item_list[SI_ATTRIBUTES], mmd->afd.attributes_string ); free(bar); diff --git a/gui_theme.c b/gui_theme.c index 98830c22..483b21fe 100644 --- a/gui_theme.c +++ b/gui_theme.c @@ -256,14 +256,14 @@ static void init_theme_colorful_blackness(struct gui_theme *t) d[SI_AFS_MODE].y = 77; d[SI_AFS_MODE].len = 100; - d[SI_DBINFO2].prefix = ""; - d[SI_DBINFO2].postfix = ""; - d[SI_DBINFO2].fg = COLOR_YELLOW; - d[SI_DBINFO2].bg = COLOR_BLACK; - d[SI_DBINFO2].align = CENTER; - d[SI_DBINFO2].x = 0; - d[SI_DBINFO2].y = 87; - d[SI_DBINFO2].len = 100; + d[SI_ATTRIBUTES].prefix = ""; + d[SI_ATTRIBUTES].postfix = ""; + d[SI_ATTRIBUTES].fg = COLOR_YELLOW; + d[SI_ATTRIBUTES].bg = COLOR_BLACK; + d[SI_ATTRIBUTES].align = CENTER; + d[SI_ATTRIBUTES].x = 0; + d[SI_ATTRIBUTES].y = 87; + d[SI_ATTRIBUTES].len = 100; d[SI_DBINFO3].prefix = ""; d[SI_DBINFO3].postfix = ""; diff --git a/para.h b/para.h index a23c4406..c41ed9dd 100644 --- a/para.h +++ b/para.h @@ -164,7 +164,7 @@ enum { SI_MTIME, SI_LENGTH_MIN, SI_LENGTH_SEC, SI_FILE_SIZE, SI_STATUS_FLAGS, SI_FORMAT, SI_SCORE, SI_AUDIO_INFO1, SI_AUDIO_INFO2, - SI_AUDIO_INFO3, SI_AFS_MODE, SI_DBINFO2, + SI_AUDIO_INFO3, SI_AFS_MODE, SI_ATTRIBUTES, SI_DBINFO3, SI_DECODER_FLAGS, SI_AUDIOD_STATUS, SI_PLAY_TIME, SI_UPTIME, SI_OFFSET, SI_LENGTH, SI_STREAM_START, SI_CURRENT_TIME, diff --git a/stat.c b/stat.c index adff3b70..93607df7 100644 --- a/stat.c +++ b/stat.c @@ -66,7 +66,7 @@ const char *status_item_list[NUM_STAT_ITEMS] = { [SI_AUDIO_INFO3] = "audio_file_info3", [SI_AFS_MODE] = "afs_mode", - [SI_DBINFO2] = "dbinfo2", + [SI_ATTRIBUTES] = "attributes", [SI_DBINFO3] = "dbinfo3", [SI_DECODER_FLAGS] = "decoder_flags",