Mercurial > audlegacy
changeset 365:98831d210c57 trunk
[svn] Implement GYM tag reader.
author | chainsaw |
---|---|
date | Sat, 31 Dec 2005 13:36:01 -0800 |
parents | afdba4a1ebdf |
children | 4a9139a7b53e |
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 Sat Dec 31 13:14:35 2005 -0800 +++ b/Plugins/Input/console/Audacious_Driver.cpp Sat Dec 31 13:36:01 2005 -0800 @@ -128,7 +128,33 @@ static gchar *get_title_gym(gchar *filename) { gchar *title; - title = g_path_get_basename(filename); + Emu_Std_Reader reader; + Gym_Emu::header_t header; + + reader.open(filename); + reader.read(&header, sizeof(header)); + + if (header.song) + { + TitleInput *tinput; + + tinput = bmp_title_input_new(); + + tinput->performer = g_strdup(header.game); + tinput->album_name = g_strdup(header.game); + tinput->track_name = g_strdup(header.song); + + 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; }