From: Andre Noll Date: Sun, 29 Jun 2008 19:02:36 +0000 (+0200) Subject: Move make_taginfo() from mp3_afh.c to afh_common.c. X-Git-Tag: v0.3.3~53^2~3 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=8fcac57c23111fb59ca793eea4bc21e6aedcfd05 Move make_taginfo() from mp3_afh.c to afh_common.c. This way, also the ogg vorbis code can use it. --- diff --git a/afh.h b/afh.h index fbc0ba6f..e315f787 100644 --- a/afh.h +++ b/afh.h @@ -103,3 +103,5 @@ const char *audio_format_name(int); void afh_get_chunk(long unsigned chunk_num, struct afh_info *afhi, void *map, const char **buf, size_t *len); void afh_get_header(struct afh_info *afhi, void *map, const char **buf, size_t *len); +char *make_taginfo(char *title, char *artist, char *album, char *year, + char *comment); diff --git a/afh_common.c b/afh_common.c index 6f6e8324..07e6a78c 100644 --- a/afh_common.c +++ b/afh_common.c @@ -122,6 +122,21 @@ int guess_audio_format(const char *name) return -1; } +char *make_taginfo(char *title, char *artist, char *album, char *year, + char *comment) +{ + return make_message("%s: %s, by %s\n" /* taginfo1 */ + "%s: A: %s, Y: %s, C: %s\n", /* taginfo 2*/ + status_item_list[SI_TAGINFO1], + (title && *title)? title : "(title tag not set)", + (artist && *artist)? artist : "(artist tag not set)", + status_item_list[SI_TAGINFO2], + (album && *album)? album : "(album tag not set)", + (year && *year)? year : "????", + (comment && *comment)? comment : "(comment tag not set)" + ); +} + /** * Call get_file_info() to obtain an afhi structure. * diff --git a/mp3_afh.c b/mp3_afh.c index ebb6bf52..ca644160 100644 --- a/mp3_afh.c +++ b/mp3_afh.c @@ -71,21 +71,6 @@ static const int mp3info_bitrate[2][3][14] = { static const int frame_size_index[] = {24000, 72000, 72000}; static const char *mode_text[] = {"stereo", "joint stereo", "dual channel", "mono", "invalid"}; -static char *make_taginfo(char *title, char *artist, char *album, char *year, - char *comment) -{ - return make_message("%s: %s, by %s\n" /* taginfo1 */ - "%s: A: %s, Y: %s, C: %s\n", /* taginfo 2*/ - status_item_list[SI_TAGINFO1], - (title && *title)? title : "(title tag not set)", - (artist && *artist)? artist : "(artist tag not set)", - status_item_list[SI_TAGINFO2], - (album && *album)? album : "(album tag not set)", - (year && *year)? year : "????", - (comment && *comment)? comment : "(comment tag not set)" - ); -} - #ifdef HAVE_LIBID3TAG #include