diff options
author | Adam Boot <rotator@gmail.com> | 2007-03-03 06:08:28 +0000 |
---|---|---|
committer | Adam Boot <rotator@gmail.com> | 2007-03-03 06:08:28 +0000 |
commit | b9a71b305b98a87f747dc1e0cc91324b73693fd1 (patch) | |
tree | c6e033835b4fc63ad0955ea3124f4b699cc9fd69 /apps/codecs | |
parent | 411f8198b46764a7c29030f8da1da90dc332308c (diff) | |
download | rockbox-b9a71b305b98a87f747dc1e0cc91324b73693fd1.tar.gz rockbox-b9a71b305b98a87f747dc1e0cc91324b73693fd1.zip |
Add get_metadata() and year & comment tag support for SPC.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12563 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-rw-r--r-- | apps/codecs/spc.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/apps/codecs/spc.c b/apps/codecs/spc.c index 12b236c53d..1cf20098fa 100644 --- a/apps/codecs/spc.c +++ b/apps/codecs/spc.c | |||
@@ -671,14 +671,31 @@ static int LoadID666(unsigned char *buf) { | |||
671 | ID666.emulator=*ib; | 671 | ID666.emulator=*ib; |
672 | ib++; | 672 | ib++; |
673 | } else { | 673 | } else { |
674 | int year, month, day; | ||
675 | unsigned long tmp; | 674 | unsigned long tmp; |
676 | char buf[64]; | 675 | char buf[64]; |
677 | 676 | ||
678 | DEBUGF("text tag detected\n"); | 677 | DEBUGF("text tag detected\n"); |
679 | 678 | ||
680 | year=month=day=0; | 679 | memcpy(buf, ib, 2); |
681 | ib+=11; | 680 | buf[2] = 0; |
681 | tmp = 0; | ||
682 | for (i=0;i<2 && buf[i]>='0' && buf[i]<='9';i++) tmp=tmp*10+buf[i]-'0'; | ||
683 | ID666.month = tmp; | ||
684 | ib+=3; | ||
685 | |||
686 | memcpy(buf, ib, 2); | ||
687 | buf[2] = 0; | ||
688 | tmp = 0; | ||
689 | for (i=0;i<2 && buf[i]>='0' && buf[i]<='9';i++) tmp=tmp*10+buf[i]-'0'; | ||
690 | ID666.day = tmp; | ||
691 | ib+=3; | ||
692 | |||
693 | memcpy(buf, ib, 4); | ||
694 | buf[4] = 0; | ||
695 | tmp = 0; | ||
696 | for (i=0;i<4 && buf[i]>='0' && buf[i]<='9';i++) tmp=tmp*10+buf[i]-'0'; | ||
697 | ID666.year = tmp; | ||
698 | ib+=5; | ||
682 | 699 | ||
683 | memcpy(buf, ib, 3); | 700 | memcpy(buf, ib, 3); |
684 | buf[3] = 0; | 701 | buf[3] = 0; |
@@ -861,6 +878,8 @@ enum codec_status codec_main(void) | |||
861 | ci->id3->title = ID666.song; | 878 | ci->id3->title = ID666.song; |
862 | ci->id3->album = ID666.game; | 879 | ci->id3->album = ID666.game; |
863 | ci->id3->artist = ID666.artist; | 880 | ci->id3->artist = ID666.artist; |
881 | ci->id3->year = ID666.year; | ||
882 | ci->id3->comment = ID666.comments; | ||
864 | 883 | ||
865 | reset_profile_timers(); | 884 | reset_profile_timers(); |
866 | } | 885 | } |