Replace status item DBINFO2 by ATTRIBUTES.
authorAndre Noll <maan@systemlinux.org>
Tue, 23 Oct 2007 20:06:51 +0000 (22:06 +0200)
committerAndre Noll <maan@systemlinux.org>
Tue, 23 Oct 2007 20:06:51 +0000 (22:06 +0200)
afs.h
aft.c
command.c
gui_theme.c
para.h
stat.c

diff --git a/afs.h b/afs.h
index 4d3feb4..a4624ba 100644 (file)
--- 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;
 
 struct audio_file_data {
        enum play_mode current_play_mode;
+       char attributes_string[MAXLINE];
        int fd;
        long score;
        struct afs_info afsi;
        int fd;
        long score;
        struct afs_info afsi;
diff --git a/aft.c b/aft.c
index 99b972c..f81c485 100644 (file)
--- 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;
        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;
 
        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 = 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);
        aced.aft_row = aft_row;
        aced.old_afsi = &afd->afsi;
        afs_event(AFSI_CHANGE, NULL, &aced);
index 977e456..74141b9 100644 (file)
--- 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:%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,
                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)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);
 
        );
        free(bar);
index 98830c2..483b21f 100644 (file)
@@ -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_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 = "";
 
        d[SI_DBINFO3].prefix = "";
        d[SI_DBINFO3].postfix = "";
diff --git a/para.h b/para.h
index a23c440..c41ed9d 100644 (file)
--- 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_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,
        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 adff3b7..93607df 100644 (file)
--- 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_AUDIO_INFO3] = "audio_file_info3",
        [SI_AFS_MODE] = "afs_mode",
-       [SI_DBINFO2] = "dbinfo2",
+       [SI_ATTRIBUTES] = "attributes",
 
        [SI_DBINFO3] = "dbinfo3",
        [SI_DECODER_FLAGS] = "decoder_flags",
 
        [SI_DBINFO3] = "dbinfo3",
        [SI_DECODER_FLAGS] = "decoder_flags",