]> git.tue.mpg.de Git - paraslash.git/commitdiff
Rename audio_info status items and get rid of duplicate afh info.
authorAndre Noll <maan@systemlinux.org>
Fri, 2 Nov 2007 02:00:35 +0000 (03:00 +0100)
committerAndre Noll <maan@systemlinux.org>
Fri, 2 Nov 2007 02:00:35 +0000 (03:00 +0100)
SI_AUDIO_INFO1 -> SI_AUDIO_FILE_INFO
SI_AUDIO_INFO2 -> SI_TAG_INFO1
SI_AUDIO_INFO3 -> SI_TAG_INFO2

The mp3 and the ogg afh stored bits of information in the info
string. Only store there what is not already contained in afh_info.

aac_afh.c
aft.c
gui_theme.c
mp3_afh.c
ogg_afh.c
para.h
stat.c
vss.c

index e495bf1484c7b832ffba01a36f8e3718092f2153..4941fb1f41c2941e0c31f1aa0fe076b0ae03b5a5 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -137,12 +137,10 @@ static int aac_get_file_info(char *map, size_t numbytes,
        ret = (afhi->chunk_table[afhi->chunks_total] - afhi->chunk_table[0]) * 8; /* bits */
        ret += (channels * afhi->seconds_total * 500); /* avoid rounding error */
        afhi->bitrate = ret / (channels * afhi->seconds_total * 1000);
-       sprintf(afhi->info_string, "audio_file_info1:%lu x %lums, "
-               "%uHz, %d channel%s, %ukb/s\n"
-               "audio_file_info2:\n"
-               "audio_file_info3:\n",
-               afhi->chunks_total, tv2ms(&afhi->chunk_tv),
-               afhi->frequency, channels, channels == 1? "" : "s", afhi->bitrate
+       sprintf(afhi->info_string, "%s:\n%s:\n%s:\n",
+               status_item_list[SI_AUDIO_FILE_INFO],
+               status_item_list[SI_TAG_INFO1],
+               status_item_list[SI_TAG_INFO2]
        );
        tv_scale(20, &afhi->chunk_tv, &afhi->eof_tv);
        ret = 1;
diff --git a/aft.c b/aft.c
index 2a35e8ac09b35bcb7493d6218dd69effe51f23e4..e485997e273bbf4f656a582a695e6344043ea930 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -932,7 +932,7 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts,
                        "seconds_total: %lu\n"
                        "num_played: %d\n"
                        "last_played: %s\n"
-                       "tag info: %s\n",
+                       "%s\n", /* tag info */
                        filename_lines,
                        have_score? "score: " : "", score_buf,
                                have_score? "\n" : "",
@@ -968,7 +968,7 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts,
                        "channels: %d\n"
                        "duration: %s\n"
                        "num_played: %d\n"
-                       "tag info: %s\n"
+                       "%s\n" /* tag info */
                        "%s%s\n",
                        last_played_time,
                        d->path,
index e4f4ac86f0e6c21451a706c6f7054cbde235d30d..bb0a813f741208ede81528901415cffb05c18be1 100644 (file)
@@ -228,33 +228,32 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
        d[SI_AUDIOD_UPTIME].y = 27;
        d[SI_AUDIOD_UPTIME].len = 22;
 
-
-       d[SI_AUDIO_INFO1].prefix = "";
-       d[SI_AUDIO_INFO1].postfix = "";
-       d[SI_AUDIO_INFO1].fg = COLOR_GREEN;
-       d[SI_AUDIO_INFO1].bg = COLOR_BLACK;
-       d[SI_AUDIO_INFO1].align = CENTER;
-       d[SI_AUDIO_INFO1].x = 0;
-       d[SI_AUDIO_INFO1].y = 43;
-       d[SI_AUDIO_INFO1].len = 100;
-
-       d[SI_AUDIO_INFO2].prefix = "";
-       d[SI_AUDIO_INFO2].postfix = "";
-       d[SI_AUDIO_INFO2].fg = COLOR_GREEN;
-       d[SI_AUDIO_INFO2].bg = COLOR_BLACK;
-       d[SI_AUDIO_INFO2].align = CENTER;
-       d[SI_AUDIO_INFO2].x = 0;
-       d[SI_AUDIO_INFO2].y = 53;
-       d[SI_AUDIO_INFO2].len = 100;
-
-       d[SI_AUDIO_INFO3].prefix = "";
-       d[SI_AUDIO_INFO3].postfix = "";
-       d[SI_AUDIO_INFO3].fg = COLOR_GREEN;
-       d[SI_AUDIO_INFO3].bg = COLOR_BLACK;
-       d[SI_AUDIO_INFO3].align = CENTER;
-       d[SI_AUDIO_INFO3].x = 0;
-       d[SI_AUDIO_INFO3].y = 63;
-       d[SI_AUDIO_INFO3].len = 100;
+       d[SI_AUDIO_FILE_INFO].prefix = "";
+       d[SI_AUDIO_FILE_INFO].postfix = "";
+       d[SI_AUDIO_FILE_INFO].fg = COLOR_GREEN;
+       d[SI_AUDIO_FILE_INFO].bg = COLOR_BLACK;
+       d[SI_AUDIO_FILE_INFO].align = CENTER;
+       d[SI_AUDIO_FILE_INFO].x = 0;
+       d[SI_AUDIO_FILE_INFO].y = 43;
+       d[SI_AUDIO_FILE_INFO].len = 100;
+
+       d[SI_TAG_INFO1].prefix = "";
+       d[SI_TAG_INFO1].postfix = "";
+       d[SI_TAG_INFO1].fg = COLOR_GREEN;
+       d[SI_TAG_INFO1].bg = COLOR_BLACK;
+       d[SI_TAG_INFO1].align = CENTER;
+       d[SI_TAG_INFO1].x = 0;
+       d[SI_TAG_INFO1].y = 53;
+       d[SI_TAG_INFO1].len = 100;
+
+       d[SI_TAG_INFO2].prefix = "";
+       d[SI_TAG_INFO2].postfix = "";
+       d[SI_TAG_INFO2].fg = COLOR_GREEN;
+       d[SI_TAG_INFO2].bg = COLOR_BLACK;
+       d[SI_TAG_INFO2].align = CENTER;
+       d[SI_TAG_INFO2].x = 0;
+       d[SI_TAG_INFO2].y = 63;
+       d[SI_TAG_INFO2].len = 100;
 
        d[SI_AFS_MODE].prefix = "";
        d[SI_AFS_MODE].postfix = "";
index ed55d7c02e7a7c50f1b7bc8ca4af950d2eed09b2..710b6a50aa149f5f2192c591a1e0a50c649543dd 100644 (file)
--- a/mp3_afh.c
+++ b/mp3_afh.c
@@ -139,20 +139,21 @@ static void write_info_str(struct afh_info *afhi)
        int v = mp3.id3_isvalid;
 
        snprintf(afhi->info_string, MMD_INFO_SIZE,
-               "audio_file_info1:%lu x %lums, %u kbit/s (%cbr) %i KHz %s\n"
-               "audio_file_info2:%s, by %s\n"
-               "audio_file_info3:A: %s, Y: %s, C: %s\n",
-               afhi->chunks_total,
-               tv2ms(&afhi->chunk_tv),
-               afhi->bitrate,
-               mp3.vbr? 'v' : 'c',
-               afhi->frequency / 1000,
-               header_mode(&mp3.header),
-               v && *mp3.id3.title? mp3.id3.title : "(title tag not set)",
-               v && *mp3.id3.artist? mp3.id3.artist : "(artist tag not set)",
-               v && *mp3.id3.album? mp3.id3.album : "(album tag not set)",
-               v && *mp3.id3.year? mp3.id3.year : "????",
-               v && *mp3.id3.comment? mp3.id3.comment : "(comment tag not set)"
+               "%s: %cbr, %s\n" /* audio file info*/
+               "%s: %s, by %s\n" /* taginfo1 */
+               "%s: A: %s, Y: %s, C: %s\n", /* taginfo 2*/
+               status_item_list[SI_AUDIO_FILE_INFO], mp3.vbr? 'v' : 'c',
+                       header_mode(&mp3.header),
+               status_item_list[SI_TAG_INFO1], v && *mp3.id3.title?
+                       mp3.id3.title : "(title tag not set)",
+                       v && *mp3.id3.artist?
+                       mp3.id3.artist : "(artist tag not set)",
+               status_item_list[SI_TAG_INFO2],
+                       v && *mp3.id3.album?
+                               mp3.id3.album : "(album tag not set)",
+                       v && *mp3.id3.year? mp3.id3.year : "????",
+                       v && *mp3.id3.comment?
+                               mp3.id3.comment : "(comment tag not set)"
        );
 }
 
index 5611579abd552df3b6074a2cf4d65abb1b3abab1..f223b57f5fe6be547caf0dc8d01eb4ed26a90bcb 100644 (file)
--- a/ogg_afh.c
+++ b/ogg_afh.c
@@ -267,13 +267,12 @@ static int ogg_get_file_info(char *map, size_t numbytes,
        afhi->bitrate = ov_bitrate(&of, 0) / 1000;
        afhi->channels = vi->channels;
        afhi->chunks_total = ogg_compute_chunk_table(&of, afhi, afhi->seconds_total);
-       sprintf(afhi->info_string, "audio_file_info1:%lu x %lu, %ukHz, "
-               "%d channels, %ukbps\n"
-               "audio_file_info2: \n"
-               "audio_file_info3: \n",
-               afhi->chunks_total, (long unsigned) (chunk_time * 1000 * 1000),
-               afhi->frequency / 1000, vi->channels, afhi->bitrate
-               );
+       afhi->info_string[0] = '\0';
+       sprintf(afhi->info_string, "%s:\n%s:\n%s:\n",
+               status_item_list[SI_AUDIO_FILE_INFO],
+               status_item_list[SI_TAG_INFO1],
+               status_item_list[SI_TAG_INFO2]
+       );
        afhi->chunk_tv.tv_sec = 0;
        afhi->chunk_tv.tv_usec = 250 * 1000;
        tv_scale(3, &afhi->chunk_tv, &afhi->eof_tv);
diff --git a/para.h b/para.h
index 69383dbe65492734fbedd49d9525cddee4bc1119..b7542bf5e2b95f43b21b02cb76907cd22daebe0a 100644 (file)
--- a/para.h
+++ b/para.h
@@ -163,8 +163,8 @@ enum {
        SI_BASENAME,            SI_STATUS,              SI_NUM_PLAYED,
        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_ATTRIBUTES,
+       SI_SCORE,               SI_AUDIO_FILE_INFO,     SI_TAG_INFO1,
+       SI_TAG_INFO2,           SI_AFS_MODE,            SI_ATTRIBUTES,
        SI_DIRECTORY,           SI_DECODER_FLAGS,       SI_AUDIOD_STATUS,
        SI_PLAY_TIME,           SI_UPTIME,              SI_OFFSET,
        SI_SECONDS_TOTAL,       SI_STREAM_START,        SI_CURRENT_TIME,
diff --git a/stat.c b/stat.c
index 514ca3f3b7f065e6d1a06e4a0528581eb6ff047b..5b1c033e7ab2c42de82457c5f080b60146a5053a 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -59,10 +59,10 @@ const char *status_item_list[NUM_STAT_ITEMS] = {
        [SI_FORMAT] = "format",
 
        [SI_SCORE] = "score",
-       [SI_AUDIO_INFO1] = "audio_file_info1",
-       [SI_AUDIO_INFO2] = "audio_file_info2",
+       [SI_AUDIO_FILE_INFO] = "audio_file_info",
 
-       [SI_AUDIO_INFO3] = "audio_file_info3",
+       [SI_TAG_INFO1] = "taginfo1",
+       [SI_TAG_INFO2] =  "taginfo2",
        [SI_AFS_MODE] = "afs_mode",
        [SI_ATTRIBUTES] = "attributes",
 
diff --git a/vss.c b/vss.c
index 7150c9087845b3450690a9a1210039ef9b319b27..3c566227f0925006a0501ec0ec2e8e5d48dd21bc 100644 (file)
--- a/vss.c
+++ b/vss.c
@@ -193,8 +193,8 @@ static void vss_eof(void)
        mmd->afd.afhi.seconds_total = 0;
        free(mmd->afd.afhi.chunk_table);
        mmd->afd.afhi.chunk_table = NULL;
-       tmp  = make_message("%s:\n%s:\n%s:\n", status_item_list[SI_AUDIO_INFO1],
-               status_item_list[SI_AUDIO_INFO2], status_item_list[SI_AUDIO_INFO3]);
+       tmp  = make_message("%s:\n%s:\n%s:\n", status_item_list[SI_AUDIO_FILE_INFO],
+               status_item_list[SI_TAG_INFO1], status_item_list[SI_TAG_INFO2]);
        strncpy(mmd->afd.afhi.info_string, tmp, sizeof(mmd->afd.afhi.info_string));
        mmd->afd.afhi.info_string[sizeof(mmd->afd.afhi.info_string) - 1] = '\0';
        free(tmp);