Mercurial > audlegacy
changeset 473:c7191cd6ee8e trunk
[svn] Tag reading for NSF.
author | chainsaw |
---|---|
date | Wed, 18 Jan 2006 17:18:37 -0800 |
parents | 98ebf4727a64 |
children | f3b46533da81 |
files | Plugins/Input/console/Audacious_Driver.cpp |
diffstat | 1 files changed, 27 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/Plugins/Input/console/Audacious_Driver.cpp Wed Jan 18 17:07:59 2006 -0800 +++ b/Plugins/Input/console/Audacious_Driver.cpp Wed Jan 18 17:18:37 2006 -0800 @@ -117,7 +117,33 @@ static gchar *get_title_nsf(gchar *filename) { gchar *title; - title = g_path_get_basename(filename); + Emu_Std_Reader reader; + Nsf_Emu::header_t header; + + reader.open(filename); + reader.read(&header, sizeof(header)); + + if (header.game) + { + TitleInput *tinput; + + tinput = bmp_title_input_new(); + + tinput->performer = g_strdup(header.author); + tinput->album_name = g_strdup(header.copyright); + tinput->track_name = g_strdup(header.game); + + tinput->file_name = g_path_get_basename(filename); + tinput->file_path = g_path_get_dirname(filename); + + title = xmms_get_titlestring(xmms_get_gentitle_format(), + tinput); + + g_free(tinput); + } + else + title = g_path_get_basename(filename); + return title; }