Rename length status item to seconds_total and print it only once.
authorAndre Noll <maan@systemlinux.org>
Thu, 1 Nov 2007 18:58:12 +0000 (19:58 +0100)
committerAndre Noll <maan@systemlinux.org>
Thu, 1 Nov 2007 18:58:12 +0000 (19:58 +0100)
aft.c
audiod.c
command.c
gui_theme.c
para.h
stat.c

diff --git a/aft.c b/aft.c
index 8ac8538..483ab25 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -912,6 +912,7 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts,
                        "frequency: %dHz\n"
                        "channels: %d\n"
                        "duration: %s\n"
+                       "seconds_total: %lu\n"
                        "num_played: %d\n"
                        "last_played: %s\n"
                        "tag info: %s\n",
@@ -928,6 +929,7 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts,
                        afhi->frequency,
                        afhi->channels,
                        duration_buf,
+                       afhi->seconds_total,
                        afsi->num_played,
                        last_played_time,
                        afhi->info_string
index d2d0004..f7e481b 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -519,7 +519,7 @@ static int check_stat_line(char *line, __a_unused void *data)
        case SI_OFFSET:
                stat_task->offset_seconds = atoi(line + ilen + 1);
                break;
-       case SI_LENGTH:
+       case SI_SECONDS_TOTAL:
                stat_task->length_seconds = atoi(line + ilen + 1);
                break;
        case SI_STREAM_START:
index c728310..7302d3e 100644 (file)
--- a/command.c
+++ b/command.c
@@ -115,14 +115,13 @@ static char *get_status(struct misc_meta_data *nmmd)
        }
        gettimeofday(&now, NULL);
        ret = make_message(
-               "%s:%zu\n"      "%s:%s\n"               "%s:%lu\n"
+               "%s:%zu\n"      "%s:%s\n"
                "%s:%s\n"       "%s:%s\n"       "%s:%s\n"
                "%s:%li\n"      "%s:%s\n"
                "%s:%s\n"       "%s:%lu.%lu\n"  "%s:%lu.%lu\n"
                "%s:%s\n"       "%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_BASENAME], basename ? basename : "(none)",
                status_item_list[SI_STATUS], status,
index 8b6856b..e4f4ac8 100644 (file)
@@ -263,7 +263,17 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
        d[SI_AFS_MODE].align = CENTER;
        d[SI_AFS_MODE].x = 0;
        d[SI_AFS_MODE].y = 77;
-       d[SI_AFS_MODE].len = 100;
+       d[SI_AFS_MODE].len = 50;
+
+       d[SI_DURATION].prefix = "";
+       d[SI_DURATION].postfix = "";
+       d[SI_DURATION].fg = COLOR_YELLOW;
+       d[SI_DURATION].bg = COLOR_BLACK;
+       d[SI_DURATION].align = CENTER;
+       d[SI_DURATION].x = 50;
+       d[SI_DURATION].y = 77;
+       d[SI_DURATION].len = 50;
+
 
        d[SI_ATTRIBUTES].prefix = "";
        d[SI_ATTRIBUTES].postfix = "";
diff --git a/para.h b/para.h
index 2d8d9cc..9fe316e 100644 (file)
--- a/para.h
+++ b/para.h
@@ -167,8 +167,9 @@ enum {
        SI_AUDIO_INFO3,         SI_AFS_MODE,            SI_ATTRIBUTES,
        SI_DIRECTORY,           SI_DECODER_FLAGS,       SI_AUDIOD_STATUS,
        SI_PLAY_TIME,           SI_UPTIME,              SI_OFFSET,
-       SI_LENGTH,              SI_STREAM_START,        SI_CURRENT_TIME,
+       SI_SECONDS_TOTAL,       SI_STREAM_START,        SI_CURRENT_TIME,
        SI_AUDIOD_UPTIME,       SI_IMAGE_ID,            SI_LYRICS_ID,
+       SI_DURATION,
        NUM_STAT_ITEMS
 };
 
diff --git a/stat.c b/stat.c
index eefac72..514ca3f 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -74,13 +74,14 @@ const char *status_item_list[NUM_STAT_ITEMS] = {
        [SI_UPTIME] = "uptime",
        [SI_OFFSET] = "offset",
 
-       [SI_LENGTH] = "length",
+       [SI_SECONDS_TOTAL] = "seconds_total",
        [SI_STREAM_START] = "stream_start",
        [SI_CURRENT_TIME] = "current_time",
 
        [SI_AUDIOD_UPTIME] = "audiod_uptime",
        [SI_IMAGE_ID] = "image_id",
-       [SI_LYRICS_ID] = "lyrics_id"
+       [SI_LYRICS_ID] = "lyrics_id",
+       [SI_DURATION] = "duration"
 };
 
 static void dump_stat_client_list(void)