This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
strncpy(buffer, id3.v1_0.artist, 30);
buffer[30] = 0;
KillTrailingSpaces(buffer);
// simple test to see if we have "more" data
// would be nice if we can test for "better" data
if(strlen(buffer) > metadata->Artist().size())
metadata->SetArtist(buffer);
strncpy(buffer, id3.v1_0.album, 30);
buffer[30] = 0;
KillTrailingSpaces(buffer);
// simple test to see if we have "more" data
// would be nice if we can test for "better" data
if(strlen(buffer) > metadata->Album().size())
metadata->SetAlbum(buffer);
strncpy(buffer, id3.v1_0.title, 30);
buffer[30] = 0;
KillTrailingSpaces(buffer);
// simple test to see if we have "more" data
// would be nice if we can test for "better" data
if(strlen(buffer) > metadata->Title().size())
metadata->SetTitle(buffer);
strncpy(buffer, id3.v1_0.comment,
(id3.v1_1.zero ? 30 : 28));
buffer[(id3.v1_1.zero ? 30 : 28)] = 0;
KillTrailingSpaces(buffer);
// simple test to see if we have "more" data
// would be nice if we can test for "better" data
if(strlen(buffer) > metadata->Comment().size())
metadata->SetComment(buffer);
if(id3.v1_0.genre >= 0 && (uint32)id3.v1_0.genre < kNumGenres)
{
// simple test to see if we have "more" data
// would be nice if we can test for "better" data
if(strlen(buffer) > metadata->Genre().size())
metadata->SetGenre(genre_strings[id3.v1_0.genre]);
}
else
{
// simple test to see if we have "more" data
// would be nice if we can test for "better" data
if(!metadata->Genre().size())
metadata->SetGenre("{unknown}");