another big glob of changes/fixes
[platform/upstream/flac.git] / src / plugin_winamp3 / flacpcm.cpp
index 98e5eb1..d2eeaae 100644 (file)
@@ -1,5 +1,5 @@
 /* FLAC input plugin for Winamp3\r
- * Copyright (C) 2000,2001  Josh Coalson\r
+ * Copyright (C) 2000,2001,2002  Josh Coalson\r
  *\r
  * This program is free software; you can redistribute it and/or\r
  * modify it under the terms of the GNU General Public License\r
@@ -48,7 +48,7 @@
 \r
 #include "flacpcm.h"\r
 extern "C" {\r
-#include "FLAC/utility.h"\r
+#include "FLAC/metadata.h"\r
 };\r
 \r
 \r
@@ -89,12 +89,11 @@ int FlacPcm::getInfos(MediaInfo *infos)
        if(!reader) return 0;\r
 \r
        //@@@ to be really "clean" we should go through the reader instead of directly to the file...\r
-       if(!FLAC__utility_get_streaminfo(infos->getFilename(), &stream_info))\r
+       if(!FLAC__metadata_get_streaminfo(infos->getFilename(), &stream_info))\r
                return 1;\r
 \r
        id3v1_struct tag;\r
 \r
-       //@@@ ditto here...\r
        bool has_tag = get_id3v1_tag_(infos->getFilename(), &tag);\r
 \r
        infos->setLength(lengthInMsec());\r
@@ -264,7 +263,7 @@ FLAC__StreamDecoderWriteStatus FlacPcm::writeCallback_(const FLAC__SeekableStrea
        (void)decoder;\r
 \r
        if(instance->abort_flag)\r
-               return FLAC__STREAM_DECODER_WRITE_ABORT;\r
+               return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;\r
 \r
        for(sample = instance->samples_in_reservoir*channels, wide_sample = 0; wide_sample < wide_samples; wide_sample++)\r
                for(channel = 0; channel < channels; channel++, sample++)\r
@@ -272,10 +271,10 @@ FLAC__StreamDecoderWriteStatus FlacPcm::writeCallback_(const FLAC__SeekableStrea
 \r
        instance->samples_in_reservoir += wide_samples;\r
 \r
-       return FLAC__STREAM_DECODER_WRITE_CONTINUE;\r
+       return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;\r
 }\r
 \r
-void FlacPcm::metadataCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetaData *metadata, void *client_data)\r
+void FlacPcm::metadataCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)\r
 {\r
        FlacPcm *instance = (FlacPcm*)client_data;\r
        (void)decoder;\r
@@ -294,7 +293,7 @@ void FlacPcm::errorCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__S
 {\r
        FlacPcm *instance = (FlacPcm*)client_data;\r
        (void)decoder;\r
-       if(status != FLAC__STREAM_DECODER_ERROR_LOST_SYNC)\r
+       if(status != FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC)\r
                instance->abort_flag = true;\r
 }\r
 \r
@@ -307,10 +306,13 @@ bool get_id3v1_tag_(const char *filename, id3v1_struct *tag)
        const char *temp;\r
        FILE *f = fopen(filename, "rb");\r
        memset(tag, 0, sizeof(id3v1_struct));\r
+#if 0\r
+@@@@\r
 strcpy(tag->title,"Sonata K.42");\r
 strcpy(tag->artist,"Domenico Scarlatti");\r
 strcpy(tag->album,"Narcisso Yepes Plays Scarlatti");\r
 sprintf(tag->description, "%s - %s", tag->artist, tag->title);\r
+#endif\r
 \r
        /* set the title and description to the filename by default */\r
        temp = strrchr(filename, '/');\r