Changeset 189


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.

Location:
winamp-musepack/trunk/winamp-musepack
Files:
3 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}
  • winamp-musepack/trunk/winamp-musepack/mpc_player.h

    r188 r189  
    22
    33#include <mpcdec/mpcdec.h>
     4#include <fileref.h>
    45
    56// post this to the main window at end of file (after playback as stopped)
     
    3031        mpc_reader reader;
    3132        mpc_demux* demux;
     33        TagLib::FileRef * tag_file;
     34
    3235    MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH];
    3336
  • winamp-musepack/trunk/winamp-musepack/winamp-musepack.vcproj

    r188 r189  
    3838                                Name="VCCLCompilerTool"
    3939                                Optimization="0"
    40                                 AdditionalIncludeDirectories="..\..\libmpc\include"
     40                                AdditionalIncludeDirectories="..\..\libmpc\include;C:\Program Files\taglib\include\taglib"
    4141                                PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
    4242                                DebugInformationFormat="1"
     
    5353                        <Tool
    5454                                Name="VCLinkerTool"
    55                                 AdditionalDependencies="User32.lib libmpcdec_d.lib libcommon_d.lib"
     55                                AdditionalDependencies="User32.lib libmpcdec_d.lib libcommon_d.lib tag.lib"
    5656                                OutputFile="E:\Program Files\Winamp\Plugins\in_mpc.dll"
    57                                 AdditionalLibraryDirectories="..\..\libmpc\win32\Debug"
     57                                AdditionalLibraryDirectories="..\..\libmpc\win32\Debug;C:\Program Files\taglib\lib"
    5858                                IgnoreAllDefaultLibraries="false"
    59                                 IgnoreDefaultLibraryNames="LIBCMTD"
     59                                IgnoreDefaultLibraryNames="LIBCMTD;MSVCRT"
    6060                                GenerateDebugInformation="true"
    6161                        />
Note: See TracChangeset for help on using the changeset viewer.