Ignore:
Timestamp:
12/24/06 17:17:50 (17 years ago)
Author:
r2d
Message:

Added TagLib support (as a static lib). Used to display track title.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • winamp-musepack/trunk/winamp-musepack/mpc_player.cpp

    r188 r189  
    66#include <mpc/minimax.h>
    77
     8#include <tag.h>
    89
    910mpc_player::mpc_player(In_Module * in_mod)
     
    3132        mod = in_mod;
    3233        wait_event = 0;
     34        tag_file = 0;
    3335}
    3436
     
    5759                demux = 0;
    5860                mpc_reader_exit_stdio(&reader);
     61        }
     62        if (tag_file != 0) {
     63                delete tag_file;
     64                tag_file = 0;
    5965        }
    6066}
     
    158164        if (length_in_ms) *length_in_ms = getLength();
    159165        if (title) {
    160                 char *p = lastfn + strlen(lastfn);
    161                 while (*p != '\\' && p >= lastfn) p--;
    162                 strcpy(title,++p);
     166                if(tag_file == 0)
     167                        tag_file = new TagLib::FileRef(lastfn, false);
     168
     169                if (tag_file->isNull() || !tag_file->tag()) {
     170                        char *p = lastfn + strlen(lastfn);
     171                        while (*p != '\\' && p >= lastfn) p--;
     172                        strcpy(title,++p);
     173                } else {
     174                        TagLib::Tag *tag = tag_file->tag();
     175                        sprintf(title, "%s - %s", tag->artist().toCString(), tag->title().toCString());
     176                        //tag->artist()
     177                        //tag->album()
     178                        //tag->year()
     179                        //tag->comment()
     180                        //tag->track()
     181                        //tag->genre()
     182                }
    163183        }
    164184}
Note: See TracChangeset for help on using the changeset viewer.