--- wxMusik-0.4.2.2/MUSIKEngine/MUSIKEngine/src/flacdecoder.h	2005-11-21 20:43:47.000000000 +0100
+++ wxMusik-0.4.2.2.new/MUSIKEngine/MUSIKEngine/src/flacdecoder.h	2007-04-11 16:31:44.000000000 +0200
@@ -27,7 +27,7 @@
 #define FLACDECODER_H
 
 #include <FLAC/format.h>
-#include <FLAC/file_decoder.h>
+#include <FLAC/stream_decoder.h>
 #include <plugin_common/defs.h>
 extern "C"
 {
@@ -62,7 +62,7 @@ class MUSIKFLACDecoder :public MUSIKDeco
 	} output_config_t;
 	struct FLACStreamInfo
 	{
-		FLAC__FileDecoder					*Decoder;
+		FLAC__StreamDecoder					*Decoder;
 		FLAC__StreamMetadata_StreamInfo		streaminfo;	/* FLAC: metadata infos */
 		FLAC__uint64						pos_sample; /* FLAC: position is sample */
 		bool								flac_abort;	/* FLAC: abort flac when an error occured */
@@ -117,24 +117,24 @@ protected:
 	int DecodeBlocks(unsigned char *buff,int len);
 	bool DoSeek(int nTimeMS);
 
-	static FLAC__StreamDecoderWriteStatus FLACWriteCallback(const FLAC__FileDecoder *decoder, 
+	static FLAC__StreamDecoderWriteStatus FLACWriteCallback(const FLAC__StreamDecoder *decoder, 
 		const FLAC__Frame *frame, 
 		const FLAC__int32 * const buffer[], void *client_data);
-	static void FLACMetaCallback(const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
-	static void FLACErrorCallback(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
+	static void FLACMetaCallback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
+	static void FLACErrorCallback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
 
 private:
 	void safe_decoder_finish_()
 	{
-		if(m_FlacInfo.Decoder && FLAC__file_decoder_get_state(m_FlacInfo.Decoder) != FLAC__FILE_DECODER_UNINITIALIZED)
-			FLAC__file_decoder_finish(m_FlacInfo.Decoder );
+		if(m_FlacInfo.Decoder && FLAC__stream_decoder_get_state(m_FlacInfo.Decoder) != FLAC__STREAM_DECODER_UNINITIALIZED)
+			FLAC__stream_decoder_finish(m_FlacInfo.Decoder );
 	}
 
 	void safe_decoder_delete_()
 	{
 		if(m_FlacInfo.Decoder ) {
 			safe_decoder_finish_();
-			FLAC__file_decoder_delete(m_FlacInfo.Decoder );
+			FLAC__stream_decoder_delete(m_FlacInfo.Decoder );
 		}
 		m_FlacInfo.Decoder = NULL;
 	}
--- wxMusik-0.4.2.2/MUSIKEngine/MUSIKEngine/src/flacdecoder.cpp	2005-11-21 20:43:47.000000000 +0100
+++ wxMusik-0.4.2.2.new/MUSIKEngine/MUSIKEngine/src/flacdecoder.cpp	2007-04-11 16:43:48.000000000 +0200
@@ -51,21 +51,21 @@ bool MUSIKFLACDecoder::OpenMedia(const c
 	m_FlacInfo.pos_sample =0;
 	m_FlacInfo.flac_abort = false;
 	m_Info.LengthMS = 0;
-	FLAC__FileDecoder *decoder  = FLAC__file_decoder_new();
+
+	FLAC__StreamDecoder *decoder  = FLAC__stream_decoder_new();
 	m_FlacInfo.Decoder = decoder;
-	FLAC__file_decoder_set_client_data(decoder,(void *)&m_FlacInfo);
-	FLAC__file_decoder_set_md5_checking(decoder, false);
-	FLAC__file_decoder_set_filename(decoder, FileName);
-	FLAC__file_decoder_set_metadata_ignore_all(decoder);
-	FLAC__file_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_STREAMINFO);
-	FLAC__file_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT);
-	FLAC__file_decoder_set_metadata_callback(decoder, FLACMetaCallback);
-	FLAC__file_decoder_set_write_callback(decoder, FLACWriteCallback);
-	FLAC__file_decoder_set_error_callback(decoder,FLACErrorCallback);
-	FLAC__FileDecoderState nRetVal = FLAC__file_decoder_init(decoder);
-	if (nRetVal == FLAC__FILE_DECODER_OK)
+	FLAC__stream_decoder_set_md5_checking(decoder, false);
+	FLAC__stream_decoder_set_metadata_ignore_all(decoder);
+	FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_STREAMINFO);
+	FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT);
+
+	FLAC__StreamDecoderInitStatus nRetVal = FLAC__stream_decoder_init_file(decoder,
+           FileName, FLACWriteCallback, FLACMetaCallback, FLACErrorCallback,
+           &m_FlacInfo);
+
+	if (nRetVal == FLAC__STREAM_DECODER_INIT_STATUS_OK)
 	{
-		FLAC__file_decoder_process_until_end_of_metadata(decoder);
+		FLAC__stream_decoder_process_until_end_of_metadata(decoder);
 
 		int decoder_buffer_size = (FLAC_SAMPLES_PER_WRITE * m_FlacInfo.streaminfo.channels * m_FlacInfo.streaminfo.bits_per_sample)*4;
 		/* convert from samples to ms */
@@ -99,11 +99,11 @@ int MUSIKFLACDecoder::DecodeBlocks(unsig
 
 	while(m_FlacInfo.wide_samples_in_reservoir_ < FLAC_SAMPLES_PER_WRITE) 
 	{
-		if(FLAC__file_decoder_get_state(m_FlacInfo.Decoder) == FLAC__FILE_DECODER_END_OF_FILE) {
+		if(FLAC__stream_decoder_get_state(m_FlacInfo.Decoder) == FLAC__STREAM_DECODER_END_OF_STREAM) {
 			return 0;
 		}
-		else if(!FLAC__file_decoder_process_single(m_FlacInfo.Decoder)) {
-			//show_error("Error while processing frame (%s).", FLAC__FileDecoderStateString[FLAC__file_decoder_get_state(m_FlacInfo.Decoder)]);
+		else if(!FLAC__stream_decoder_process_single(m_FlacInfo.Decoder)) {
+			//show_error("Error while processing frame (%s).", FLAC__StreamDecoderStateString[FLAC__stream_decoder_get_state(m_FlacInfo.Decoder)]);
 			return 0;
 		}
 	}
@@ -163,7 +163,7 @@ int MUSIKFLACDecoder::DecodeBlocks(unsig
 	}
 	return 0;
 }
-FLAC__StreamDecoderWriteStatus MUSIKFLACDecoder::FLACWriteCallback(const FLAC__FileDecoder *decoder, 
+FLAC__StreamDecoderWriteStatus MUSIKFLACDecoder::FLACWriteCallback(const FLAC__StreamDecoder *decoder, 
 																	const FLAC__Frame *frame, 
 																	const FLAC__int32 * const buffer[], void *client_data)
 {
@@ -182,7 +182,7 @@ FLAC__StreamDecoderWriteStatus MUSIKFLAC
 	return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
 }
 
-void MUSIKFLACDecoder::FLACMetaCallback(const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
+void MUSIKFLACDecoder::FLACMetaCallback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
 {
 	/* TO-DO: Meta data */
 	FLACStreamInfo *pFlacInfo=(FLACStreamInfo *)client_data;
@@ -205,7 +205,7 @@ void MUSIKFLACDecoder::FLACMetaCallback(
 }
 
 
-void MUSIKFLACDecoder::FLACErrorCallback(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) 
+void MUSIKFLACDecoder::FLACErrorCallback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) 
 {
 	/* TO-DO: Error handling */
 	FLACStreamInfo *pFlacInfo=(FLACStreamInfo *)client_data;
@@ -223,7 +223,7 @@ bool MUSIKFLACDecoder::DoSeek(int nTimeM
 	int done  = 0;
 	const double distance = (double)nTimeMS / (double)m_Info.LengthMS;
 	const unsigned target_sample = (unsigned)(distance * (double)m_FlacInfo.streaminfo.total_samples);
-	if(FLAC__file_decoder_seek_absolute(m_FlacInfo.Decoder, (FLAC__uint64)target_sample)) {
+	if(FLAC__stream_decoder_seek_absolute(m_FlacInfo.Decoder, (FLAC__uint64)target_sample)) {
 		SetDecodePos(nTimeMS);
 		done = 0;
 	}
@@ -233,7 +233,7 @@ bool MUSIKFLACDecoder::DoSeek(int nTimeM
 bool MUSIKFLACDecoder::Close()
 {
 	MUSIKDecoder::Close();
-	FLAC__file_decoder_delete(m_FlacInfo.Decoder);
+	FLAC__stream_decoder_delete(m_FlacInfo.Decoder);
 	return true;
 }
 
--- wxMusik-0.4.2.2/MUSIKEngine/3rd-Party/grabbag/replaygain.c	2005-11-21 20:43:46.000000000 +0100
+++ wxMusik-0.4.2.2.new/MUSIKEngine/3rd-Party/grabbag/replaygain.c	2007-04-11 16:50:55.000000000 +0200
@@ -19,7 +19,7 @@
 #include "share/grabbag.h"
 #include "share/replaygain_analysis.h"
 #include "FLAC/assert.h"
-#include "FLAC/file_decoder.h"
+#include "FLAC/stream_decoder.h"
 #include "FLAC/metadata.h"
 #include <locale.h>
 #include <math.h>
@@ -266,7 +266,7 @@ typedef struct {
 	FLAC__bool error;
 } DecoderInstance;
 
-static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
+static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
 {
 	DecoderInstance *instance = (DecoderInstance*)client_data;
 	const unsigned bits_per_sample = frame->header.bits_per_sample;
@@ -295,7 +295,7 @@ static FLAC__StreamDecoderWriteStatus wr
 		return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
 }
 
-static void metadata_callback_(const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
+static void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
 {
 	DecoderInstance *instance = (DecoderInstance*)client_data;
 
@@ -318,7 +318,7 @@ static void metadata_callback_(const FLA
 	}
 }
 
-static void error_callback_(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
+static void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
 {
 	DecoderInstance *instance = (DecoderInstance*)client_data;
 
@@ -330,7 +330,7 @@ static void error_callback_(const FLAC__
 const char *grabbag__replaygain_analyze_file(const char *filename, float *title_gain, float *title_peak)
 {
 	DecoderInstance instance;
-	FLAC__FileDecoder *decoder = FLAC__file_decoder_new();
+	FLAC__StreamDecoder *decoder = FLAC__stream_decoder_new();
 
 	if(0 == decoder)
 		return "memory allocation error";
@@ -338,27 +338,23 @@ const char *grabbag__replaygain_analyze_
 	instance.error = false;
 
 	/* It does these three by default but lets be explicit: */
-	FLAC__file_decoder_set_md5_checking(decoder, false);
-	FLAC__file_decoder_set_metadata_ignore_all(decoder);
-	FLAC__file_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_STREAMINFO);
-
-	FLAC__file_decoder_set_filename(decoder, filename);
-	FLAC__file_decoder_set_write_callback(decoder, write_callback_);
-	FLAC__file_decoder_set_metadata_callback(decoder, metadata_callback_);
-	FLAC__file_decoder_set_error_callback(decoder, error_callback_);
-	FLAC__file_decoder_set_client_data(decoder, &instance);
-
-	if(FLAC__file_decoder_init(decoder) != FLAC__FILE_DECODER_OK) {
-		FLAC__file_decoder_delete(decoder);
+	FLAC__stream_decoder_set_md5_checking(decoder, false);
+	FLAC__stream_decoder_set_metadata_ignore_all(decoder);
+	FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_STREAMINFO);
+
+	if(FLAC__stream_decoder_init_file(decoder, filename, write_callback_,
+                metadata_callback_, error_callback_, &instance)
+            != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
+		FLAC__stream_decoder_delete(decoder);
 		return "initializing decoder";
 	}
 
-	if(!FLAC__file_decoder_process_until_end_of_file(decoder) || instance.error) {
-		FLAC__file_decoder_delete(decoder);
+	if(!FLAC__stream_decoder_process_until_end_of_stream(decoder) || instance.error) {
+		FLAC__stream_decoder_delete(decoder);
 		return "decoding file";
 	}
 
-	FLAC__file_decoder_delete(decoder);
+	FLAC__stream_decoder_delete(decoder);
 
 	grabbag__replaygain_get_title(title_gain, title_peak);
 
