FLAC Decoder is operational again.

This commit is contained in:
Casey Langen 2016-05-28 13:51:54 -07:00
parent 273b67076f
commit 6e83b103a3
39 changed files with 281 additions and 9827 deletions

View File

@ -56,4 +56,5 @@ add_subdirectory(src/musikbox)
add_subdirectory(src/contrib/taglib_plugin)
add_subdirectory(src/contrib/oggdecoder)
add_subdirectory(src/contrib/mpg123decoder)
add_subdirectory(src/contrib/flacdecoder)
add_subdirectory(src/contrib/coreaudioout)

View File

@ -1,38 +1,13 @@
set ( flacdecoder_SOURCES
FLACDecoder.cpp
FLACSourceSupplier.cpp
flacdecoder_plugin.cpp
stdafx.cpp
)
set (flacdecoder_SOURCES
stdafx.cpp
flacdecoder_plugin.cpp
FlacDecoderFactory.cpp
FLACDecoder.cpp
)
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
add_definitions(-DWIN32)
if(NOT DEFINED MINGW)
endif(NOT DEFINED MINGW)
else(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -fpermissive)
endif(CMAKE_SYSTEM_NAME MATCHES "Windows")
add_definitions(
-DXML_STATIC
-D_CRT_SECURE_NO_DEPRECATE
add_definitions(
-D_DEBUG
)
include_directories( ${musikCube_SOURCE_DIR}/src/contrib/flacdecoder/include )
find_package(flac)
if (flac_found)
message(STATUS "FLAC found. Using system lib")
link_directories ( flac_link_dirs )
else (flac_found)
message(STATUS "FLAC not found")
if (${MSVC90})
message(STATUS "Using MSVC2008 (MSVC9.0) Prebuilt dll")
link_directories ( ${musikCube_SOURCE_DIR}/src/contrib/flacdecoder/lib/VS2008/ )
endif (${MSVC90})
endif (flac_found)
add_library( flacdecoder SHARED ${flacdecoder_SOURCES} )
target_link_libraries( flacdecoder ${musikCube_LINK_LIBS} FLAC FLAC++)
add_library(flacdecoder SHARED ${flacdecoder_SOURCES})
target_link_libraries(flacdecoder ${musikbox_LINK_LIBS} flac)

View File

@ -30,101 +30,128 @@
// POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "FLACDecoder.h"
#include "FlacDecoder.h"
#include <complex>
#ifndef WIN32
#include <string.h> //needed for mempcpy
#endif
FLACDecoder::FLACDecoder()
:decoder(NULL)
,outputBufferSize(0)
,outputBuffer(NULL)
,channels(0)
,sampleRate(0)
,bps(0)
,totalSamples(0)
{
this->decoder = FLAC__stream_decoder_new();
static inline void copy(float* dst, float* src, size_t count) {
#ifdef WIN32
CopyMemory(dst, src, count * sizeof(float));
#else
memcpy(dst, src, count * sizeof(float));
#endif
}
FlacDecoder::FlacDecoder()
: decoder(NULL)
, outputBufferSize(0)
, outputBuffer(NULL)
, channels(0)
, sampleRate(0)
, bitsPerSample(0)
, totalSamples(0) {
this->decoder = FLAC__stream_decoder_new();
}
FLACDecoder::~FLACDecoder(){
if(this->decoder){
FlacDecoder::~FlacDecoder() {
if (this->decoder) {
FLAC__stream_decoder_delete(this->decoder);
this->decoder = NULL;
}
if(this->outputBuffer){
delete this->outputBuffer;
this->outputBuffer = NULL;
this->decoder = NULL;
}
if(this->outputBuffer) {
delete this->outputBuffer;
this->outputBuffer = NULL;
}
}
FLAC__StreamDecoderReadStatus FLACDecoder::FlacRead(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[],size_t *bytes,void *clientData){
size_t readBytes = (size_t)((FLACDecoder*)clientData)->fileStream->Read(buffer,(long)(*bytes));
*bytes = readBytes;
if(readBytes==0){
FLAC__StreamDecoderReadStatus FlacDecoder::FlacRead(
const FLAC__StreamDecoder *decoder,
FLAC__byte buffer[],
size_t *bytes,
void *clientData)
{
size_t readBytes = (size_t)((FlacDecoder*) clientData)->stream->Read(buffer,(long)(*bytes));
*bytes = readBytes;
if (readBytes == 0) {
return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
}
if(readBytes<0){
else if(readBytes == (size_t) -1) {
return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
}
return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
}
FLAC__bool FLACDecoder::FlacEof(const FLAC__StreamDecoder *decoder, void *clientData){
if( ((FLACDecoder*)clientData)->fileStream->Eof() ){
return 1;
}
return 0;
FLAC__bool FlacDecoder::FlacEof(const FLAC__StreamDecoder *decoder, void *clientData) {
return ((FlacDecoder*) clientData)->stream->Eof() ? 1 : 0;
}
FLAC__StreamDecoderSeekStatus FLACDecoder::FlacSeek(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *clientData){
if( ((FLACDecoder*)clientData)->fileStream->SetPosition((long)absolute_byte_offset)){
FLAC__StreamDecoderSeekStatus FlacDecoder::FlacSeek(
const FLAC__StreamDecoder *decoder,
FLAC__uint64 absolute_byte_offset,
void *clientData)
{
if(((FlacDecoder*) clientData)->stream->SetPosition((long) absolute_byte_offset)) {
return FLAC__STREAM_DECODER_SEEK_STATUS_OK;
}
// Unsuccessfull
return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
}
FLAC__StreamDecoderTellStatus FlacDecoder::FlacTell(
const FLAC__StreamDecoder *decoder,
FLAC__uint64 *absolute_byte_offset,
void *clientData)
{
*absolute_byte_offset = (FLAC__uint64)((FlacDecoder*) clientData)->stream->Position();
FLAC__StreamDecoderTellStatus FLACDecoder::FlacTell(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *clientData){
*absolute_byte_offset = (FLAC__uint64)((FLACDecoder*)clientData)->fileStream->Position();
if(*absolute_byte_offset>=0){
return FLAC__STREAM_DECODER_TELL_STATUS_OK;
if(*absolute_byte_offset == (FLAC__uint64) -1) {
return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
}
return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
return FLAC__STREAM_DECODER_TELL_STATUS_OK;
}
FLAC__StreamDecoderLengthStatus FLACDecoder::FlacFileSize(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *clientData){
*stream_length = (FLAC__uint64)((FLACDecoder*)clientData)->fileStream->Filesize();
if(*stream_length<=0){
FLAC__StreamDecoderLengthStatus FlacDecoder::FlacFileSize(
const FLAC__StreamDecoder *decoder,
FLAC__uint64 *stream_length,
void *clientData)
{
*stream_length = (FLAC__uint64)((FlacDecoder*) clientData)->stream->Length();
if(*stream_length <= 0) {
return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR;
}
return FLAC__STREAM_DECODER_LENGTH_STATUS_OK;
}
bool FLACDecoder::Open(musik::core::filestreams::IFileStream *fileStream){
this->fileStream = fileStream;
bool FlacDecoder::Open(musik::core::io::IDataStream *stream){
this->stream = stream;
FLAC__StreamDecoderInitStatus init_status = FLAC__stream_decoder_init_stream(this->decoder,
FLACDecoder::FlacRead,
FLACDecoder::FlacSeek,
FLACDecoder::FlacTell,
FLACDecoder::FlacFileSize,
FLACDecoder::FlacEof,
FLACDecoder::FlacWrite,
FLACDecoder::FlacMeta,
FLACDecoder::FlacError,
this);
FLAC__StreamDecoderInitStatus init_status =
FLAC__stream_decoder_init_stream(
this->decoder,
FlacDecoder::FlacRead,
FlacDecoder::FlacSeek,
FlacDecoder::FlacTell,
FlacDecoder::FlacFileSize,
FlacDecoder::FlacEof,
FlacDecoder::FlacWrite,
FlacDecoder::FlacMetadata,
FlacDecoder::FlacError,
this);
if(init_status == FLAC__STREAM_DECODER_INIT_STATUS_OK) {
// Process until we have metadata
if (init_status == FLAC__STREAM_DECODER_INIT_STATUS_OK) {
FLAC__stream_decoder_process_until_end_of_metadata(this->decoder);
return true;
}
@ -132,53 +159,64 @@ bool FLACDecoder::Open(musik::core::filestreams::IFileStream *fileStream){
return false;
}
void FLACDecoder::FlacError(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *clientData){
void FlacDecoder::FlacError(
const FLAC__StreamDecoder *decoder,
FLAC__StreamDecoderErrorStatus status,
void *clientData)
{
/* nothing for us to do here... */
}
void FLACDecoder::FlacMeta(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *clientData){
FLACDecoder *thisPtr = (FLACDecoder*)clientData;
void FlacDecoder::FlacMetadata(
const FLAC__StreamDecoder *decoder,
const FLAC__StreamMetadata *metadata,
void *clientData)
{
FlacDecoder *fdec = (FlacDecoder*)clientData;
if(metadata->type == FLAC__METADATA_TYPE_STREAMINFO) {
thisPtr->totalSamples = metadata->data.stream_info.total_samples;
thisPtr->sampleRate = metadata->data.stream_info.sample_rate;
thisPtr->channels = metadata->data.stream_info.channels;
thisPtr->bps = metadata->data.stream_info.bits_per_sample;
if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO) {
fdec->totalSamples = metadata->data.stream_info.total_samples;
fdec->sampleRate = metadata->data.stream_info.sample_rate;
fdec->channels = metadata->data.stream_info.channels;
fdec->bitsPerSample = metadata->data.stream_info.bits_per_sample;
}
}
FLAC__StreamDecoderWriteStatus FlacDecoder::FlacWrite(
const FLAC__StreamDecoder *decoder,
const FLAC__Frame *frame,
const FLAC__int32 *const buffer[],
void *clientData)
{
FlacDecoder *fdec = (FlacDecoder*) clientData;
int sampleCount = fdec->channels * frame->header.blocksize;
FLAC__StreamDecoderWriteStatus FLACDecoder::FlacWrite(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame,const FLAC__int32 *const buffer[], void *clientData){
FLACDecoder *thisPtr = (FLACDecoder*)clientData;
int nofSamples = thisPtr->channels*frame->header.blocksize;
// First, lets create a buffer
// If there is already a buffer, delete it
if(thisPtr->outputBufferSize==0){
delete thisPtr->outputBuffer;
thisPtr->outputBuffer = NULL;
thisPtr->outputBufferSize = 0;
thisPtr->outputBuffer = new float[nofSamples];
/* initialize the output buffer if it doesn't exist */
if (fdec->outputBufferSize == 0) {
delete fdec->outputBuffer;
fdec->outputBuffer = NULL;
fdec->outputBufferSize = 0;
fdec->outputBuffer = new float[sampleCount];
}
if(thisPtr->outputBuffer && thisPtr->outputBufferSize>0){
float *oldBuffer = thisPtr->outputBuffer;
thisPtr->outputBuffer = new float[nofSamples+thisPtr->outputBufferSize];
#ifdef WIN32 CopyMemory(thisPtr->outputBuffer, oldBuffer, thisPtr->outputBufferSize * sizeof(float));
#else /*GNU*/ mempcpy(thisPtr->outputBuffer, oldBuffer, thisPtr->outputBufferSize * sizeof(float));
#endif //WIN32
/* if we already have a buffer with an offset, let's append to it. realloc
the buffer so there's enough room */
if (fdec->outputBuffer && fdec->outputBufferSize > 0) {
float *oldBuffer = fdec->outputBuffer;
fdec->outputBuffer = new float[sampleCount + fdec->outputBufferSize];
copy(fdec->outputBuffer, oldBuffer, fdec->outputBufferSize);
delete oldBuffer;
}
/* we need to convert the fixed point samples to floating point samples. figure
out the maximum amplitude of the fixed point samples based on the resolution */
float maxAmplitude = pow(2.0f, (fdec->bitsPerSample - 1));
// What is the max amplitude
float maxAmplitude = pow(2.0f,(thisPtr->bps-1));
// Convert the buffer (16bit int) to the outputBuffer (float)
for(unsigned int i(0); i<frame->header.blocksize; ++i){
for(int j(0); j<thisPtr->channels; ++j){
thisPtr->outputBuffer[thisPtr->outputBufferSize] = (((float)buffer[j][i])/maxAmplitude);
thisPtr->outputBufferSize++;
/* run the conversion */
for (unsigned int i = 0; i < frame->header.blocksize; ++i) {
for (int j = 0; j < fdec->channels; ++j) {
fdec->outputBuffer[fdec->outputBufferSize] = (((float) buffer[j][i]) / maxAmplitude);
fdec->outputBufferSize++;
}
}
@ -186,67 +224,29 @@ FLAC__StreamDecoderWriteStatus FLACDecoder::FlacWrite(const FLAC__StreamDecoder
}
void FLACDecoder::Destroy(void){
void FlacDecoder::Destroy() {
delete this;
}
/*bool FLACDecoder::GetFormat(unsigned long * SampleRate, unsigned long * Channels){
*SampleRate = this->sampleRate;
*Channels = this->channels;
double FlacDecoder::SetPosition(double seconds) {
FLAC__uint64 seekToSample = (FLAC__uint64)(this->sampleRate * seconds);
if(*SampleRate && *Channels){
return true;
}
return false;
}
bool FLACDecoder::GetLength(unsigned long * MS){
if(this->totalSamples && this->sampleRate){
*MS = (this->totalSamples*1000)/this->sampleRate;
return true;
}
return false;
}
*/
double FLACDecoder::SetPosition(double seconds,double totalLength){
FLAC__uint64 seekToSample = (FLAC__uint64)(this->sampleRate * seconds) ;
if(FLAC__stream_decoder_seek_absolute(this->decoder,seekToSample)){
if (FLAC__stream_decoder_seek_absolute(this->decoder, seekToSample)) {
return seconds;
}
return -1;
}
//bool FLACDecoder::GetBuffer(float ** ppBuffer, unsigned long * NumSamples){
bool FLACDecoder::GetBuffer(IBuffer *buffer){
bool FlacDecoder::GetBuffer(IBuffer *buffer) {
buffer->SetSampleRate(this->sampleRate);
buffer->SetChannels(this->channels);
if(this->outputBuffer && this->outputBufferSize>0){
buffer->SetSamples(this->outputBufferSize/this->channels);
// Copy buffer
float *buf = buffer->BufferPointer();
for(long i(0);i<this->outputBufferSize;++i){
buf[i] = this->outputBuffer[i];
}
this->outputBufferSize = 0;
return true;
}
if( FLAC__stream_decoder_process_single(this->decoder) ){
if(this->outputBuffer && this->outputBufferSize>0){
buffer->SetSamples(this->outputBufferSize/this->channels);
// Copy buffer
float *buf = buffer->BufferPointer();
for(long i(0);i<this->outputBufferSize;++i){
buf[i] = this->outputBuffer[i];
}
/* read the next chunk */
if (FLAC__stream_decoder_process_single(this->decoder)) {
if(this->outputBuffer && this->outputBufferSize > 0) {
buffer->SetSamples(this->outputBufferSize / this->channels);
copy(buffer->BufferPointer(), this->outputBuffer, this->outputBufferSize);
this->outputBufferSize = 0;
return true;
}

View File

@ -32,57 +32,75 @@
//////////////////////////////////////////////////////////////////////////////
#pragma once
#include <core/audio/IDecoder.h>
#include <core/sdk/IDecoder.h>
#include <core/sdk/IDataStream.h>
#include <FLAC/stream_decoder.h>
#include <stddef.h>
using namespace musik::core::audio;
class FLACDecoder : public IDecoder
{
class FlacDecoder : public musik::core::audio::IDecoder {
public:
FlacDecoder();
virtual ~FlacDecoder();
public:
FLACDecoder();
~FLACDecoder();
public:
virtual void Destroy();
virtual double SetPosition(double seconds);
virtual bool GetBuffer(IBuffer *buffer);
virtual bool Open(musik::core::io::IDataStream *stream);
public:
virtual void Destroy();
virtual double SetPosition(double seconds,double totalLength);
virtual bool GetBuffer(IBuffer *buffer);
virtual bool Open(musik::core::filestreams::IFileStream *fileStream);
private:
static FLAC__StreamDecoderReadStatus FlacRead(
const FLAC__StreamDecoder *decoder,
FLAC__byte buffer[],
size_t *bytes,
void *clientData);
public:
// FLAC callbacks
//static size_t FlacRead(void *buffer, size_t nofParts, size_t partSize, void *datasource);
static FLAC__StreamDecoderReadStatus FlacRead(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[],size_t *bytes,void *clientData);
//static int FlacSeek(void *datasource, FLAC__int64 offset, int whence);
static FLAC__StreamDecoderSeekStatus FlacSeek(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *clientData);
//static FLAC__int64 FlacTell(void *datasource);
static FLAC__StreamDecoderTellStatus FlacTell(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *clientData);
//static int FlacEof(void *datasource);
static FLAC__bool FlacEof(const FLAC__StreamDecoder *decoder, void *clientData);
//static int FlacFileSize(void *datasource);
static FLAC__StreamDecoderLengthStatus FlacFileSize(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *clientData);
static FLAC__StreamDecoderSeekStatus FlacSeek(
const FLAC__StreamDecoder *decoder,
FLAC__uint64 absolute_byte_offset,
void *clientData);
static FLAC__StreamDecoderTellStatus FlacTell(
const FLAC__StreamDecoder *decoder,
FLAC__uint64 *absolute_byte_offset,
void *clientData);
static FLAC__StreamDecoderWriteStatus FlacWrite(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame,const FLAC__int32 *const buffer[], void *clientData);
static void FlacMeta(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *clientData);
static void FlacError(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *clientData);
static FLAC__bool FlacEof(
const FLAC__StreamDecoder *decoder,
void *clientData);
static FLAC__StreamDecoderLengthStatus FlacFileSize(
const FLAC__StreamDecoder *decoder,
FLAC__uint64 *stream_length,
void *clientData);
protected:
musik::core::filestreams::IFileStream *fileStream;
FLAC__StreamDecoder *decoder;
static FLAC__StreamDecoderWriteStatus FlacWrite(
const FLAC__StreamDecoder *decoder,
const FLAC__Frame *frame,
const FLAC__int32 *const buffer[],
void *clientData);
long channels;
long sampleRate;
UINT64 totalSamples;
int bps;
static void FlacMetadata(
const FLAC__StreamDecoder *decoder,
const FLAC__StreamMetadata *metadata,
void *clientData);
float *outputBuffer;
unsigned long outputBufferSize;
static void FlacError(
const FLAC__StreamDecoder *decoder,
FLAC__StreamDecoderErrorStatus status,
void *clientData);
// FLAC__IOCallbacks flacCallbacks;
protected:
musik::core::io::IDataStream *stream;
FLAC__StreamDecoder *decoder;
long channels;
long sampleRate;
UINT64 totalSamples;
int bitsPerSample;
float *outputBuffer;
unsigned long outputBufferSize;
};

View File

@ -1,69 +1,64 @@
//////////////////////////////////////////////////////////////////////////////
// Copyright © 2007, Daniel Önnerby
// Copyright <EFBFBD> 2007, Daniel <20>nnerby
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of the author nor the names of other contributors may
// be used to endorse or promote products derived from this software
// without specific prior written permission.
// * Neither the name of the author nor the names of other contributors may
// be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include <cctype>
#include <algorithm>
#include "FLACSourceSupplier.h"
#include "FlacDecoderFactory.h"
#include "FLACDecoder.h"
FLACSourceSupplier::FLACSourceSupplier()
{
using namespace musik::core::audio;
FlacDecoderFactory::FlacDecoderFactory() {
}
FLACSourceSupplier::~FLACSourceSupplier()
{
FlacDecoderFactory::~FlacDecoderFactory() {
}
void FLACSourceSupplier::Destroy()
{
void FlacDecoderFactory::Destroy() {
delete this;
}
IDecoder* FLACSourceSupplier::CreateDecoder()
{
return new FLACDecoder();
IDecoder* FlacDecoderFactory::CreateDecoder() {
return new FlacDecoder();
}
bool FLACSourceSupplier::CanHandle(const utfchar* type) const
{
if(type){
utfstring typeString(type);
if(typeString.find(UTF("flac"))!=utfstring::npos){
return true;
}
}
return false;
bool FlacDecoderFactory::CanHandle(const char* type) const {
std::string str(type);
std::transform(str.begin(), str.end(), str.begin(), tolower);
return
str.find(".flac") != std::string::npos ||
str.find("audio/flag") != std::string::npos;
}

View File

@ -1,48 +1,46 @@
//////////////////////////////////////////////////////////////////////////////
// Copyright © 2007, Daniel Önnerby
// Copyright <EFBFBD> 2007, Daniel <20>nnerby
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of the author nor the names of other contributors may
// be used to endorse or promote products derived from this software
// without specific prior written permission.
// * Neither the name of the author nor the names of other contributors may
// be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////////
#pragma once
#include <core/audio/IDecoderFactory.h>
#include <core/sdk/IDecoderFactory.h>
using namespace musik::core::audio;
class FlacDecoderFactory : public musik::core::audio::IDecoderFactory {
public:
FlacDecoderFactory();
virtual ~FlacDecoderFactory();
class FLACSourceSupplier : public IDecoderFactory
{
public: FLACSourceSupplier();
public: ~FLACSourceSupplier();
public: IDecoder* CreateDecoder();
public: void Destroy();
public: bool CanHandle(const utfchar* type) const;
musik::core::audio::IDecoder* CreateDecoder();
void Destroy();
bool CanHandle(const char* type) const;
};

View File

@ -2,7 +2,7 @@
//
// License Agreement:
//
// The following are Copyright <20> 2008, Daniel <EFBFBD>nnerby
// The following are Copyright <20> 2008, Daniel Önnerby
//
// All rights reserved.
//
@ -36,48 +36,32 @@
#include "stdafx.h"
#include <core/IPlugin.h>
#include "FLACSourceSupplier.h"
#include <core/sdk/IPlugin.h>
#include "FlacDecoderFactory.h"
#ifdef WIN32
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT
#endif
#ifdef WIN32
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
return true;
}
#endif //WIN32
#endif
class FLACDecoderPlugin : public musik::core::IPlugin
{
class FlacPlugin : public musik::core::IPlugin {
void Destroy() { delete this; };
const utfchar* Name() { return UTF("FLAC decoder"); };
const utfchar* Version() { return UTF("1"); };
const utfchar* Author() { return UTF("Daniel <20>nnerby"); };
const char* Name() { return "FLAC IDecoder"; }
const char* Version() { return "0.2"; }
const char* Author() { return "Daniel Önnerby, clangen"; }
};
#ifdef WIN32
extern "C" __declspec(dllexport)
#else //WIN32
extern "C" {
#endif //WIN32
musik::core::IPlugin* GetPlugin()
{
return new FLACDecoderPlugin();
extern "C" DLLEXPORT musik::core::IPlugin* GetPlugin() {
return new FlacPlugin();
}
#ifndef WIN32
}
#endif
#ifdef WIN32
extern "C" __declspec(dllexport)
#else //WIN32
extern "C" {
#endif //WIN32
IDecoderFactory* GetDecoderFactory()
{
return new FLACSourceSupplier();
extern "C" DLLEXPORT musik::core::audio::IDecoderFactory* GetDecoderFactory() {
return new FlacDecoderFactory();
}
#ifndef WIN32
}
#endif

View File

@ -1,42 +0,0 @@
# libFLAC - Free Lossless Audio Codec library
# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# - Neither the name of the Xiph.org Foundation nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
flaccincludedir = $(includedir)/FLAC
flaccinclude_HEADERS = \
all.h \
assert.h \
callback.h \
export.h \
format.h \
metadata.h \
ordinals.h \
stream_decoder.h \
stream_encoder.h

View File

@ -1,467 +0,0 @@
# Makefile.in generated by automake 1.7.9 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# libFLAC - Free Lossless Audio Codec library
# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# - Neither the name of the Xiph.org Foundation nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_triplet = @host@
ACLOCAL = @ACLOCAL@
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEBUG_FALSE = @DEBUG_FALSE@
DEBUG_TRUE = @DEBUG_TRUE@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@
DOXYGEN = @DOXYGEN@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@
FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@
FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@
FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@
FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@
FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@
FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@
FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@
FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@
FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@
FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@
FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@
FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@
FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@
FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@
FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@
FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@
FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@
FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@
FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@
FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@
FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@
FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@
FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@
FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@
FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@
FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@
FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@
FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@
FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@
FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@
FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@
FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@
FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@
FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@
FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@
FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@
FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@
FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@
FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@
FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@
FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@
GAS = @GAS@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@
NASM = @NASM@
OBJEXT = @OBJEXT@
OBJ_FORMAT = @OBJ_FORMAT@
OGG_CFLAGS = @OGG_CFLAGS@
OGG_LIBS = @OGG_LIBS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XMMS_CFLAGS = @XMMS_CFLAGS@
XMMS_CONFIG = @XMMS_CONFIG@
XMMS_DATA_DIR = @XMMS_DATA_DIR@
XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@
XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@
XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@
XMMS_LIBS = @XMMS_LIBS@
XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@
XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@
XMMS_VERSION = @XMMS_VERSION@
XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
flaccincludedir = $(includedir)/FLAC
flaccinclude_HEADERS = \
all.h \
assert.h \
callback.h \
export.h \
format.h \
metadata.h \
ordinals.h \
stream_decoder.h \
stream_encoder.h
subdir = include/FLAC
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
HEADERS = $(flaccinclude_HEADERS)
DIST_COMMON = $(flaccinclude_HEADERS) $(srcdir)/Makefile.in Makefile.am
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu include/FLAC/Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
flaccincludeHEADERS_INSTALL = $(INSTALL_HEADER)
install-flaccincludeHEADERS: $(flaccinclude_HEADERS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(flaccincludedir)
@list='$(flaccinclude_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f="`echo $$p | sed -e 's|^.*/||'`"; \
echo " $(flaccincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(flaccincludedir)/$$f"; \
$(flaccincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(flaccincludedir)/$$f; \
done
uninstall-flaccincludeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(flaccinclude_HEADERS)'; for p in $$list; do \
f="`echo $$p | sed -e 's|^.*/||'`"; \
echo " rm -f $(DESTDIR)$(flaccincludedir)/$$f"; \
rm -f $(DESTDIR)$(flaccincludedir)/$$f; \
done
ETAGS = etags
ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(HEADERS)
installdirs:
$(mkinstalldirs) $(DESTDIR)$(flaccincludedir)
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am: install-flaccincludeHEADERS
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-flaccincludeHEADERS uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool ctags distclean distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am info \
info-am install install-am install-data install-data-am \
install-exec install-exec-am install-flaccincludeHEADERS \
install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-flaccincludeHEADERS uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,370 +0,0 @@
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of the Xiph.org Foundation nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef FLAC__ALL_H
#define FLAC__ALL_H
#include "export.h"
#include "assert.h"
#include "callback.h"
#include "format.h"
#include "metadata.h"
#include "ordinals.h"
#include "stream_decoder.h"
#include "stream_encoder.h"
/** \mainpage
*
* \section intro Introduction
*
* This is the documentation for the FLAC C and C++ APIs. It is
* highly interconnected; this introduction should give you a top
* level idea of the structure and how to find the information you
* need. As a prerequisite you should have at least a basic
* knowledge of the FLAC format, documented
* <A HREF="../format.html">here</A>.
*
* \section c_api FLAC C API
*
* The FLAC C API is the interface to libFLAC, a set of structures
* describing the components of FLAC streams, and functions for
* encoding and decoding streams, as well as manipulating FLAC
* metadata in files. The public include files will be installed
* in your include area (for example /usr/include/FLAC/...).
*
* By writing a little code and linking against libFLAC, it is
* relatively easy to add FLAC support to another program. The
* library is licensed under <A HREF="../license.html">Xiph's BSD license</A>.
* Complete source code of libFLAC as well as the command-line
* encoder and plugins is available and is a useful source of
* examples.
*
* Aside from encoders and decoders, libFLAC provides a powerful
* metadata interface for manipulating metadata in FLAC files. It
* allows the user to add, delete, and modify FLAC metadata blocks
* and it can automatically take advantage of PADDING blocks to avoid
* rewriting the entire FLAC file when changing the size of the
* metadata.
*
* libFLAC usually only requires the standard C library and C math
* library. In particular, threading is not used so there is no
* dependency on a thread library. However, libFLAC does not use
* global variables and should be thread-safe.
*
* libFLAC also supports encoding to and decoding from Ogg FLAC.
* However the metadata editing interfaces currently have limited
* read-only support for Ogg FLAC files.
*
* \section cpp_api FLAC C++ API
*
* The FLAC C++ API is a set of classes that encapsulate the
* structures and functions in libFLAC. They provide slightly more
* functionality with respect to metadata but are otherwise
* equivalent. For the most part, they share the same usage as
* their counterparts in libFLAC, and the FLAC C API documentation
* can be used as a supplement. The public include files
* for the C++ API will be installed in your include area (for
* example /usr/include/FLAC++/...).
*
* libFLAC++ is also licensed under
* <A HREF="../license.html">Xiph's BSD license</A>.
*
* \section getting_started Getting Started
*
* A good starting point for learning the API is to browse through
* the <A HREF="modules.html">modules</A>. Modules are logical
* groupings of related functions or classes, which correspond roughly
* to header files or sections of header files. Each module includes a
* detailed description of the general usage of its functions or
* classes.
*
* From there you can go on to look at the documentation of
* individual functions. You can see different views of the individual
* functions through the links in top bar across this page.
*
* If you prefer a more hands-on approach, you can jump right to some
* <A HREF="../documentation_example_code.html">example code</A>.
*
* \section porting_guide Porting Guide
*
* Starting with FLAC 1.1.3 a \link porting Porting Guide \endlink
* has been introduced which gives detailed instructions on how to
* port your code to newer versions of FLAC.
*
* \section embedded_developers Embedded Developers
*
* libFLAC has grown larger over time as more functionality has been
* included, but much of it may be unnecessary for a particular embedded
* implementation. Unused parts may be pruned by some simple editing of
* src/libFLAC/Makefile.am. In general, the decoders, encoders, and
* metadata interface are all independent from each other.
*
* It is easiest to just describe the dependencies:
*
* - All modules depend on the \link flac_format Format \endlink module.
* - The decoders and encoders depend on the bitbuffer.
* - The decoder is independent of the encoder. The encoder uses the
* decoder because of the verify feature, but this can be removed if
* not needed.
* - Parts of the metadata interface require the stream decoder (but not
* the encoder).
* - Ogg support is selectable through the compile time macro
* \c FLAC__HAS_OGG.
*
* For example, if your application only requires the stream decoder, no
* encoder, and no metadata interface, you can remove the stream encoder
* and the metadata interface, which will greatly reduce the size of the
* library.
*
* Also, there are several places in the libFLAC code with comments marked
* with "OPT:" where a #define can be changed to enable code that might be
* faster on a specific platform. Experimenting with these can yield faster
* binaries.
*/
/** \defgroup porting Porting Guide for New Versions
*
* This module describes differences in the library interfaces from
* version to version. It assists in the porting of code that uses
* the libraries to newer versions of FLAC.
*
* One simple facility for making porting easier that has been added
* in FLAC 1.1.3 is a set of \c #defines in \c export.h of each
* library's includes (e.g. \c include/FLAC/export.h). The
* \c #defines mirror the libraries'
* <A HREF="http://www.gnu.org/software/libtool/manual.html#Libtool-versioning">libtool version numbers</A>,
* e.g. in libFLAC there are \c FLAC_API_VERSION_CURRENT,
* \c FLAC_API_VERSION_REVISION, and \c FLAC_API_VERSION_AGE.
* These can be used to support multiple versions of an API during the
* transition phase, e.g.
*
* \code
* #if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7
* legacy code
* #else
* new code
* #endif
* \endcode
*
* The the source will work for multiple versions and the legacy code can
* easily be removed when the transition is complete.
*
* Another available symbol is FLAC_API_SUPPORTS_OGG_FLAC (defined in
* include/FLAC/export.h), which can be used to determine whether or not
* the library has been compiled with support for Ogg FLAC. This is
* simpler than trying to call an Ogg init function and catching the
* error.
*/
/** \defgroup porting_1_1_2_to_1_1_3 Porting from FLAC 1.1.2 to 1.1.3
* \ingroup porting
*
* \brief
* This module describes porting from FLAC 1.1.2 to FLAC 1.1.3.
*
* The main change between the APIs in 1.1.2 and 1.1.3 is that they have
* been simplified. First, libOggFLAC has been merged into libFLAC and
* libOggFLAC++ has been merged into libFLAC++. Second, both the three
* decoding layers and three encoding layers have been merged into a
* single stream decoder and stream encoder. That is, the functionality
* of FLAC__SeekableStreamDecoder and FLAC__FileDecoder has been merged
* into FLAC__StreamDecoder, and FLAC__SeekableStreamEncoder and
* FLAC__FileEncoder into FLAC__StreamEncoder. Only the
* FLAC__StreamDecoder and FLAC__StreamEncoder remain. What this means
* is there is now a single API that can be used to encode or decode
* streams to/from native FLAC or Ogg FLAC and the single API can work
* on both seekable and non-seekable streams.
*
* Instead of creating an encoder or decoder of a certain layer, now the
* client will always create a FLAC__StreamEncoder or
* FLAC__StreamDecoder. The old layers are now differentiated by the
* initialization function. For example, for the decoder,
* FLAC__stream_decoder_init() has been replaced by
* FLAC__stream_decoder_init_stream(). This init function takes
* callbacks for the I/O, and the seeking callbacks are optional. This
* allows the client to use the same object for seekable and
* non-seekable streams. For decoding a FLAC file directly, the client
* can use FLAC__stream_decoder_init_file() and pass just a filename
* and fewer callbacks; most of the other callbacks are supplied
* internally. For situations where fopen()ing by filename is not
* possible (e.g. Unicode filenames on Windows) the client can instead
* open the file itself and supply the FILE* to
* FLAC__stream_decoder_init_FILE(). The init functions now returns a
* FLAC__StreamDecoderInitStatus instead of FLAC__StreamDecoderState.
* Since the callbacks and client data are now passed to the init
* function, the FLAC__stream_decoder_set_*_callback() functions and
* FLAC__stream_decoder_set_client_data() are no longer needed. The
* rest of the calls to the decoder are the same as before.
*
* There are counterpart init functions for Ogg FLAC, e.g.
* FLAC__stream_decoder_init_ogg_stream(). All the rest of the calls
* and callbacks are the same as for native FLAC.
*
* As an example, in FLAC 1.1.2 a seekable stream decoder would have
* been set up like so:
*
* \code
* FLAC__SeekableStreamDecoder *decoder = FLAC__seekable_stream_decoder_new();
* if(decoder == NULL) do_something;
* FLAC__seekable_stream_decoder_set_md5_checking(decoder, true);
* [... other settings ...]
* FLAC__seekable_stream_decoder_set_read_callback(decoder, my_read_callback);
* FLAC__seekable_stream_decoder_set_seek_callback(decoder, my_seek_callback);
* FLAC__seekable_stream_decoder_set_tell_callback(decoder, my_tell_callback);
* FLAC__seekable_stream_decoder_set_length_callback(decoder, my_length_callback);
* FLAC__seekable_stream_decoder_set_eof_callback(decoder, my_eof_callback);
* FLAC__seekable_stream_decoder_set_write_callback(decoder, my_write_callback);
* FLAC__seekable_stream_decoder_set_metadata_callback(decoder, my_metadata_callback);
* FLAC__seekable_stream_decoder_set_error_callback(decoder, my_error_callback);
* FLAC__seekable_stream_decoder_set_client_data(decoder, my_client_data);
* if(FLAC__seekable_stream_decoder_init(decoder) != FLAC__SEEKABLE_STREAM_DECODER_OK) do_something;
* \endcode
*
* In FLAC 1.1.3 it is like this:
*
* \code
* FLAC__StreamDecoder *decoder = FLAC__stream_decoder_new();
* if(decoder == NULL) do_something;
* FLAC__stream_decoder_set_md5_checking(decoder, true);
* [... other settings ...]
* if(FLAC__stream_decoder_init_stream(
* decoder,
* my_read_callback,
* my_seek_callback, // or NULL
* my_tell_callback, // or NULL
* my_length_callback, // or NULL
* my_eof_callback, // or NULL
* my_write_callback,
* my_metadata_callback, // or NULL
* my_error_callback,
* my_client_data
* ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) do_something;
* \endcode
*
* or you could do;
*
* \code
* [...]
* FILE *file = fopen("somefile.flac","rb");
* if(file == NULL) do_somthing;
* if(FLAC__stream_decoder_init_FILE(
* decoder,
* file,
* my_write_callback,
* my_metadata_callback, // or NULL
* my_error_callback,
* my_client_data
* ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) do_something;
* \endcode
*
* or just:
*
* \code
* [...]
* if(FLAC__stream_decoder_init_file(
* decoder,
* "somefile.flac",
* my_write_callback,
* my_metadata_callback, // or NULL
* my_error_callback,
* my_client_data
* ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) do_something;
* \endcode
*
* Another small change to the decoder is in how it handles unparseable
* streams. Before, when the decoder found an unparseable stream
* (reserved for when the decoder encounters a stream from a future
* encoder that it can't parse), it changed the state to
* \c FLAC__STREAM_DECODER_UNPARSEABLE_STREAM. Now the decoder instead
* drops sync and calls the error callback with a new error code
* \c FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM. This is
* more robust. If your error callback does not discriminate on the the
* error state, your code does not need to be changed.
*
* The encoder now has a new setting:
* FLAC__stream_encoder_set_apodization(). This is for setting the
* method used to window the data before LPC analysis. You only need to
* add a call to this function if the default is not suitable. There
* are also two new convenience functions that may be useful:
* FLAC__metadata_object_cuesheet_calculate_cddb_id() and
* FLAC__metadata_get_cuesheet().
*
* The \a bytes parameter to FLAC__StreamDecoderReadCallback,
* FLAC__StreamEncoderReadCallback, and FLAC__StreamEncoderWriteCallback
* is now \c size_t instead of \c unsigned.
*/
/** \defgroup porting_1_1_3_to_1_1_4 Porting from FLAC 1.1.3 to 1.1.4
* \ingroup porting
*
* \brief
* This module describes porting from FLAC 1.1.3 to FLAC 1.1.4.
*
* There were no changes to any of the interfaces from 1.1.3 to 1.1.4.
* There was a slight change in the implementation of
* FLAC__stream_encoder_set_metadata(); the function now makes a copy
* of the \a metadata array of pointers so the client no longer needs
* to maintain it after the call. The objects themselves that are
* pointed to by the array are still not copied though and must be
* maintained until the call to FLAC__stream_encoder_finish().
*/
/** \defgroup porting_1_1_4_to_1_2_0 Porting from FLAC 1.1.4 to 1.2.0
* \ingroup porting
*
* \brief
* This module describes porting from FLAC 1.1.4 to FLAC 1.2.0.
*
* There were only very minor changes to the interfaces from 1.1.4 to 1.2.0.
* In libFLAC, \c FLAC__format_sample_rate_is_subset() was added.
* In libFLAC++, \c FLAC::Decoder::Stream::get_decode_position() was added.
*
* Finally, value of the constant \c FLAC__FRAME_HEADER_RESERVED_LEN
* has changed to reflect the conversion of one of the reserved bits
* into active use. It used to be \c 2 and now is \c 1. However the
* FLAC frame header length has not changed, so to skip the proper
* number of bits, use \c FLAC__FRAME_HEADER_RESERVED_LEN +
* \c FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN
*/
/** \defgroup flac FLAC C API
*
* The FLAC C API is the interface to libFLAC, a set of structures
* describing the components of FLAC streams, and functions for
* encoding and decoding streams, as well as manipulating FLAC
* metadata in files.
*
* You should start with the format components as all other modules
* are dependent on it.
*/
#endif

View File

@ -1,45 +0,0 @@
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of the Xiph.org Foundation nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef FLAC__ASSERT_H
#define FLAC__ASSERT_H
/* we need this since some compilers (like MSVC) leave assert()s on release code (and we don't want to use their ASSERT) */
#ifdef DEBUG
#include <assert.h>
#define FLAC__ASSERT(x) assert(x)
#define FLAC__ASSERT_DECLARATION(x) x
#else
#define FLAC__ASSERT(x)
#define FLAC__ASSERT_DECLARATION(x)
#endif
#endif

View File

@ -1,184 +0,0 @@
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2004,2005,2006,2007 Josh Coalson
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of the Xiph.org Foundation nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef FLAC__CALLBACK_H
#define FLAC__CALLBACK_H
#include "ordinals.h"
#include <stdlib.h> /* for size_t */
/** \file include/FLAC/callback.h
*
* \brief
* This module defines the structures for describing I/O callbacks
* to the other FLAC interfaces.
*
* See the detailed documentation for callbacks in the
* \link flac_callbacks callbacks \endlink module.
*/
/** \defgroup flac_callbacks FLAC/callback.h: I/O callback structures
* \ingroup flac
*
* \brief
* This module defines the structures for describing I/O callbacks
* to the other FLAC interfaces.
*
* The purpose of the I/O callback functions is to create a common way
* for the metadata interfaces to handle I/O.
*
* Originally the metadata interfaces required filenames as the way of
* specifying FLAC files to operate on. This is problematic in some
* environments so there is an additional option to specify a set of
* callbacks for doing I/O on the FLAC file, instead of the filename.
*
* In addition to the callbacks, a FLAC__IOHandle type is defined as an
* opaque structure for a data source.
*
* The callback function prototypes are similar (but not identical) to the
* stdio functions fread, fwrite, fseek, ftell, feof, and fclose. If you use
* stdio streams to implement the callbacks, you can pass fread, fwrite, and
* fclose anywhere a FLAC__IOCallback_Read, FLAC__IOCallback_Write, or
* FLAC__IOCallback_Close is required, and a FILE* anywhere a FLAC__IOHandle
* is required. \warning You generally CANNOT directly use fseek or ftell
* for FLAC__IOCallback_Seek or FLAC__IOCallback_Tell since on most systems
* these use 32-bit offsets and FLAC requires 64-bit offsets to deal with
* large files. You will have to find an equivalent function (e.g. ftello),
* or write a wrapper. The same is true for feof() since this is usually
* implemented as a macro, not as a function whose address can be taken.
*
* \{
*/
#ifdef __cplusplus
extern "C" {
#endif
/** This is the opaque handle type used by the callbacks. Typically
* this is a \c FILE* or address of a file descriptor.
*/
typedef void* FLAC__IOHandle;
/** Signature for the read callback.
* The signature and semantics match POSIX fread() implementations
* and can generally be used interchangeably.
*
* \param ptr The address of the read buffer.
* \param size The size of the records to be read.
* \param nmemb The number of records to be read.
* \param handle The handle to the data source.
* \retval size_t
* The number of records read.
*/
typedef size_t (*FLAC__IOCallback_Read) (void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle);
/** Signature for the write callback.
* The signature and semantics match POSIX fwrite() implementations
* and can generally be used interchangeably.
*
* \param ptr The address of the write buffer.
* \param size The size of the records to be written.
* \param nmemb The number of records to be written.
* \param handle The handle to the data source.
* \retval size_t
* The number of records written.
*/
typedef size_t (*FLAC__IOCallback_Write) (const void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle);
/** Signature for the seek callback.
* The signature and semantics mostly match POSIX fseek() WITH ONE IMPORTANT
* EXCEPTION: the offset is a 64-bit type whereas fseek() is generally 'long'
* and 32-bits wide.
*
* \param handle The handle to the data source.
* \param offset The new position, relative to \a whence
* \param whence \c SEEK_SET, \c SEEK_CUR, or \c SEEK_END
* \retval int
* \c 0 on success, \c -1 on error.
*/
typedef int (*FLAC__IOCallback_Seek) (FLAC__IOHandle handle, FLAC__int64 offset, int whence);
/** Signature for the tell callback.
* The signature and semantics mostly match POSIX ftell() WITH ONE IMPORTANT
* EXCEPTION: the offset is a 64-bit type whereas ftell() is generally 'long'
* and 32-bits wide.
*
* \param handle The handle to the data source.
* \retval FLAC__int64
* The current position on success, \c -1 on error.
*/
typedef FLAC__int64 (*FLAC__IOCallback_Tell) (FLAC__IOHandle handle);
/** Signature for the EOF callback.
* The signature and semantics mostly match POSIX feof() but WATCHOUT:
* on many systems, feof() is a macro, so in this case a wrapper function
* must be provided instead.
*
* \param handle The handle to the data source.
* \retval int
* \c 0 if not at end of file, nonzero if at end of file.
*/
typedef int (*FLAC__IOCallback_Eof) (FLAC__IOHandle handle);
/** Signature for the close callback.
* The signature and semantics match POSIX fclose() implementations
* and can generally be used interchangeably.
*
* \param handle The handle to the data source.
* \retval int
* \c 0 on success, \c EOF on error.
*/
typedef int (*FLAC__IOCallback_Close) (FLAC__IOHandle handle);
/** A structure for holding a set of callbacks.
* Each FLAC interface that requires a FLAC__IOCallbacks structure will
* describe which of the callbacks are required. The ones that are not
* required may be set to NULL.
*
* If the seek requirement for an interface is optional, you can signify that
* a data sorce is not seekable by setting the \a seek field to \c NULL.
*/
typedef struct {
FLAC__IOCallback_Read read;
FLAC__IOCallback_Write write;
FLAC__IOCallback_Seek seek;
FLAC__IOCallback_Tell tell;
FLAC__IOCallback_Eof eof;
FLAC__IOCallback_Close close;
} FLAC__IOCallbacks;
/* \} */
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,91 +0,0 @@
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of the Xiph.org Foundation nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef FLAC__EXPORT_H
#define FLAC__EXPORT_H
/** \file include/FLAC/export.h
*
* \brief
* This module contains #defines and symbols for exporting function
* calls, and providing version information and compiled-in features.
*
* See the \link flac_export export \endlink module.
*/
/** \defgroup flac_export FLAC/export.h: export symbols
* \ingroup flac
*
* \brief
* This module contains #defines and symbols for exporting function
* calls, and providing version information and compiled-in features.
*
* If you are compiling with MSVC and will link to the static library
* (libFLAC.lib) you should define FLAC__NO_DLL in your project to
* make sure the symbols are exported properly.
*
* \{
*/
#if defined(FLAC__NO_DLL) || !defined(_MSC_VER)
#define FLAC_API
#else
#ifdef FLAC_API_EXPORTS
#define FLAC_API _declspec(dllexport)
#else
#define FLAC_API _declspec(dllimport)
#endif
#endif
/** These #defines will mirror the libtool-based library version number, see
* http://www.gnu.org/software/libtool/manual.html#Libtool-versioning
*/
#define FLAC_API_VERSION_CURRENT 10
#define FLAC_API_VERSION_REVISION 0 /**< see above */
#define FLAC_API_VERSION_AGE 2 /**< see above */
#ifdef __cplusplus
extern "C" {
#endif
/** \c 1 if the library has been compiled with support for Ogg FLAC, else \c 0. */
extern FLAC_API int FLAC_API_SUPPORTS_OGG_FLAC;
#ifdef __cplusplus
}
#endif
/* \} */
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,80 +0,0 @@
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of the Xiph.org Foundation nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef FLAC__ORDINALS_H
#define FLAC__ORDINALS_H
#if !(defined(_MSC_VER) || defined(__BORLANDC__) || defined(__EMX__))
#include <inttypes.h>
#endif
typedef signed char FLAC__int8;
typedef unsigned char FLAC__uint8;
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int16 FLAC__int16;
typedef __int32 FLAC__int32;
typedef __int64 FLAC__int64;
typedef unsigned __int16 FLAC__uint16;
typedef unsigned __int32 FLAC__uint32;
typedef unsigned __int64 FLAC__uint64;
#elif defined(__EMX__)
typedef short FLAC__int16;
typedef long FLAC__int32;
typedef long long FLAC__int64;
typedef unsigned short FLAC__uint16;
typedef unsigned long FLAC__uint32;
typedef unsigned long long FLAC__uint64;
#else
typedef int16_t FLAC__int16;
typedef int32_t FLAC__int32;
typedef int64_t FLAC__int64;
typedef uint16_t FLAC__uint16;
typedef uint32_t FLAC__uint32;
typedef uint64_t FLAC__uint64;
#endif
typedef int FLAC__bool;
typedef FLAC__uint8 FLAC__byte;
#ifdef true
#undef true
#endif
#ifdef false
#undef false
#endif
#ifndef __cplusplus
#define true 1
#define false 0
#endif
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +0,0 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = foreign
SUBDIRS = grabbag
EXTRA_DIST = \
alloc.h \
getopt.h \
grabbag.h \
replaygain_analysis.h \
replaygain_synthesis.h \
utf8.h

View File

@ -1,514 +0,0 @@
# Makefile.in generated by automake 1.7.9 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_triplet = @host@
ACLOCAL = @ACLOCAL@
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEBUG_FALSE = @DEBUG_FALSE@
DEBUG_TRUE = @DEBUG_TRUE@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@
DOXYGEN = @DOXYGEN@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@
FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@
FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@
FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@
FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@
FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@
FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@
FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@
FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@
FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@
FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@
FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@
FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@
FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@
FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@
FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@
FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@
FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@
FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@
FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@
FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@
FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@
FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@
FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@
FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@
FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@
FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@
FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@
FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@
FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@
FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@
FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@
FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@
FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@
FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@
FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@
FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@
FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@
FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@
FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@
FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@
FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@
GAS = @GAS@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@
NASM = @NASM@
OBJEXT = @OBJEXT@
OBJ_FORMAT = @OBJ_FORMAT@
OGG_CFLAGS = @OGG_CFLAGS@
OGG_LIBS = @OGG_LIBS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XMMS_CFLAGS = @XMMS_CFLAGS@
XMMS_CONFIG = @XMMS_CONFIG@
XMMS_DATA_DIR = @XMMS_DATA_DIR@
XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@
XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@
XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@
XMMS_LIBS = @XMMS_LIBS@
XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@
XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@
XMMS_VERSION = @XMMS_VERSION@
XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = grabbag
EXTRA_DIST = \
alloc.h \
getopt.h \
grabbag.h \
replaygain_analysis.h \
replaygain_synthesis.h \
utf8.h
subdir = include/share
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
ps-recursive install-info-recursive uninstall-info-recursive \
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive
DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
DIST_SUBDIRS = $(SUBDIRS)
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign include/share/Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ETAGS = etags
ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if (etags --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
else \
include_option=--include; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" \
distdir=../$(distdir)/$$subdir \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags
dvi: dvi-recursive
dvi-am:
info: info-recursive
info-am:
install-data-am:
install-exec-am:
install-info: install-info-recursive
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
clean-generic clean-libtool clean-recursive ctags \
ctags-recursive distclean distclean-generic distclean-libtool \
distclean-recursive distclean-tags distdir dvi dvi-am \
dvi-recursive info info-am info-recursive install install-am \
install-data install-data-am install-data-recursive \
install-exec install-exec-am install-exec-recursive \
install-info install-info-am install-info-recursive install-man \
install-recursive install-strip installcheck installcheck-am \
installdirs installdirs-am installdirs-recursive \
maintainer-clean maintainer-clean-generic \
maintainer-clean-recursive mostlyclean mostlyclean-generic \
mostlyclean-libtool mostlyclean-recursive pdf pdf-am \
pdf-recursive ps ps-am ps-recursive tags tags-recursive \
uninstall uninstall-am uninstall-info-am \
uninstall-info-recursive uninstall-recursive
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,212 +0,0 @@
/* alloc - Convenience routines for safely allocating memory
* Copyright (C) 2007 Josh Coalson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef FLAC__SHARE__ALLOC_H
#define FLAC__SHARE__ALLOC_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
/* WATCHOUT: for c++ you may have to #define __STDC_LIMIT_MACROS 1 real early
* before #including this file, otherwise SIZE_MAX might not be defined
*/
#include <limits.h> /* for SIZE_MAX */
#if !defined _MSC_VER && !defined __MINGW32__ && !defined __EMX__
#include <stdint.h> /* for SIZE_MAX in case limits.h didn't get it */
#endif
#include <stdlib.h> /* for size_t, malloc(), etc */
#ifndef SIZE_MAX
# ifndef SIZE_T_MAX
# ifdef _MSC_VER
# define SIZE_T_MAX UINT_MAX
# else
# error
# endif
# endif
# define SIZE_MAX SIZE_T_MAX
#endif
#ifndef FLaC__INLINE
#define FLaC__INLINE
#endif
/* avoid malloc()ing 0 bytes, see:
* https://www.securecoding.cert.org/confluence/display/seccode/MEM04-A.+Do+not+make+assumptions+about+the+result+of+allocating+0+bytes?focusedCommentId=5407003
*/
static FLaC__INLINE void *safe_malloc_(size_t size)
{
/* malloc(0) is undefined; FLAC src convention is to always allocate */
if(!size)
size++;
return malloc(size);
}
static FLaC__INLINE void *safe_calloc_(size_t nmemb, size_t size)
{
if(!nmemb || !size)
return malloc(1); /* malloc(0) is undefined; FLAC src convention is to always allocate */
return calloc(nmemb, size);
}
/*@@@@ there's probably a better way to prevent overflows when allocating untrusted sums but this works for now */
static FLaC__INLINE void *safe_malloc_add_2op_(size_t size1, size_t size2)
{
size2 += size1;
if(size2 < size1)
return 0;
return safe_malloc_(size2);
}
static FLaC__INLINE void *safe_malloc_add_3op_(size_t size1, size_t size2, size_t size3)
{
size2 += size1;
if(size2 < size1)
return 0;
size3 += size2;
if(size3 < size2)
return 0;
return safe_malloc_(size3);
}
static FLaC__INLINE void *safe_malloc_add_4op_(size_t size1, size_t size2, size_t size3, size_t size4)
{
size2 += size1;
if(size2 < size1)
return 0;
size3 += size2;
if(size3 < size2)
return 0;
size4 += size3;
if(size4 < size3)
return 0;
return safe_malloc_(size4);
}
static FLaC__INLINE void *safe_malloc_mul_2op_(size_t size1, size_t size2)
#if 0
needs support for cases where sizeof(size_t) != 4
{
/* could be faster #ifdef'ing off SIZEOF_SIZE_T */
if(sizeof(size_t) == 4) {
if ((double)size1 * (double)size2 < 4294967296.0)
return malloc(size1*size2);
}
return 0;
}
#else
/* better? */
{
if(!size1 || !size2)
return malloc(1); /* malloc(0) is undefined; FLAC src convention is to always allocate */
if(size1 > SIZE_MAX / size2)
return 0;
return malloc(size1*size2);
}
#endif
static FLaC__INLINE void *safe_malloc_mul_3op_(size_t size1, size_t size2, size_t size3)
{
if(!size1 || !size2 || !size3)
return malloc(1); /* malloc(0) is undefined; FLAC src convention is to always allocate */
if(size1 > SIZE_MAX / size2)
return 0;
size1 *= size2;
if(size1 > SIZE_MAX / size3)
return 0;
return malloc(size1*size3);
}
/* size1*size2 + size3 */
static FLaC__INLINE void *safe_malloc_mul2add_(size_t size1, size_t size2, size_t size3)
{
if(!size1 || !size2)
return safe_malloc_(size3);
if(size1 > SIZE_MAX / size2)
return 0;
return safe_malloc_add_2op_(size1*size2, size3);
}
/* size1 * (size2 + size3) */
static FLaC__INLINE void *safe_malloc_muladd2_(size_t size1, size_t size2, size_t size3)
{
if(!size1 || (!size2 && !size3))
return malloc(1); /* malloc(0) is undefined; FLAC src convention is to always allocate */
size2 += size3;
if(size2 < size3)
return 0;
return safe_malloc_mul_2op_(size1, size2);
}
static FLaC__INLINE void *safe_realloc_add_2op_(void *ptr, size_t size1, size_t size2)
{
size2 += size1;
if(size2 < size1)
return 0;
return realloc(ptr, size2);
}
static FLaC__INLINE void *safe_realloc_add_3op_(void *ptr, size_t size1, size_t size2, size_t size3)
{
size2 += size1;
if(size2 < size1)
return 0;
size3 += size2;
if(size3 < size2)
return 0;
return realloc(ptr, size3);
}
static FLaC__INLINE void *safe_realloc_add_4op_(void *ptr, size_t size1, size_t size2, size_t size3, size_t size4)
{
size2 += size1;
if(size2 < size1)
return 0;
size3 += size2;
if(size3 < size2)
return 0;
size4 += size3;
if(size4 < size3)
return 0;
return realloc(ptr, size4);
}
static FLaC__INLINE void *safe_realloc_mul_2op_(void *ptr, size_t size1, size_t size2)
{
if(!size1 || !size2)
return realloc(ptr, 0); /* preserve POSIX realloc(ptr, 0) semantics */
if(size1 > SIZE_MAX / size2)
return 0;
return realloc(ptr, size1*size2);
}
/* size1 * (size2 + size3) */
static FLaC__INLINE void *safe_realloc_muladd2_(void *ptr, size_t size1, size_t size2, size_t size3)
{
if(!size1 || (!size2 && !size3))
return realloc(ptr, 0); /* preserve POSIX realloc(ptr, 0) semantics */
size2 += size3;
if(size2 < size3)
return 0;
return safe_realloc_mul_2op_(ptr, size1, size2);
}
#endif

View File

@ -1,184 +0,0 @@
/*
NOTE:
I cannot get the vanilla getopt code to work (i.e. compile only what
is needed and not duplicate symbols found in the standard library)
on all the platforms that FLAC supports. In particular the gating
of code with the ELIDE_CODE #define is not accurate enough on systems
that are POSIX but not glibc. If someone has a patch that works on
GNU/Linux, Darwin, AND Solaris please submit it on the project page:
http://sourceforge.net/projects/flac
In the meantime I have munged the global symbols and removed gates
around code, while at the same time trying to touch the original as
little as possible.
*/
/* Declarations for getopt.
Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef SHARE__GETOPT_H
#define SHARE__GETOPT_H
/*[JEC] was:#ifndef __need_getopt*/
/*[JEC] was:# define _GETOPT_H 1*/
/*[JEC] was:#endif*/
#ifdef __cplusplus
extern "C" {
#endif
/* For communication from `share__getopt' to the caller.
When `share__getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
extern char *share__optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `share__getopt'.
On entry to `share__getopt', zero means this is the first call; initialize.
When `share__getopt' returns -1, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `share__optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
extern int share__optind;
/* Callers store zero here to inhibit the error message `share__getopt' prints
for unrecognized options. */
extern int share__opterr;
/* Set to an option character which was unrecognized. */
extern int share__optopt;
/*[JEC] was:#ifndef __need_getopt */
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to share__getopt_long or share__getopt_long_only is a vector
of `struct share__option' terminated by an element containing a name which is
zero.
The field `has_arg' is:
share__no_argument (or 0) if the option does not take an argument,
share__required_argument (or 1) if the option requires an argument,
share__optional_argument (or 2) if the option takes an optional argument.
If the field `flag' is not NULL, it points to a variable that is set
to the value given in the field `val' when the option is found, but
left unchanged if the option is not found.
To have a long-named option do something other than set an `int' to
a compiled-in constant, such as set a value from `share__optarg', set the
option's `flag' field to zero and its `val' field to a nonzero
value (the equivalent single-letter option character, if there is
one). For long options that have a zero `flag' field, `share__getopt'
returns the contents of the `val' field. */
struct share__option
{
# if defined __STDC__ && __STDC__
const char *name;
# else
char *name;
# endif
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
int *flag;
int val;
};
/* Names for the values of the `has_arg' field of `struct share__option'. */
# define share__no_argument 0
# define share__required_argument 1
# define share__optional_argument 2
/*[JEC] was:#endif*/ /* need getopt */
/* Get definitions and prototypes for functions to process the
arguments in ARGV (ARGC of them, minus the program name) for
options given in OPTS.
Return the option character from OPTS just read. Return -1 when
there are no more options. For unrecognized options, or options
missing arguments, `share__optopt' is set to the option letter, and '?' is
returned.
The OPTS string is a list of characters which are recognized option
letters, optionally followed by colons, specifying that that letter
takes an argument, to be placed in `share__optarg'.
If a letter in OPTS is followed by two colons, its argument is
optional. This behavior is specific to the GNU `share__getopt'.
The argument `--' causes premature termination of argument
scanning, explicitly telling `share__getopt' that there are no more
options.
If OPTS begins with `--', then non-option arguments are treated as
arguments to the option '\0'. This behavior is specific to the GNU
`share__getopt'. */
/*[JEC] was:#if defined __STDC__ && __STDC__*/
/*[JEC] was:# ifdef __GNU_LIBRARY__*/
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int share__getopt (int argc, char *const *argv, const char *shortopts);
/*[JEC] was:# else*/ /* not __GNU_LIBRARY__ */
/*[JEC] was:extern int getopt ();*/
/*[JEC] was:# endif*/ /* __GNU_LIBRARY__ */
/*[JEC] was:# ifndef __need_getopt*/
extern int share__getopt_long (int argc, char *const *argv, const char *shortopts,
const struct share__option *longopts, int *longind);
extern int share__getopt_long_only (int argc, char *const *argv,
const char *shortopts,
const struct share__option *longopts, int *longind);
/* Internal only. Users should not call this directly. */
extern int share___getopt_internal (int argc, char *const *argv,
const char *shortopts,
const struct share__option *longopts, int *longind,
int long_only);
/*[JEC] was:# endif*/
/*[JEC] was:#else*/ /* not __STDC__ */
/*[JEC] was:extern int getopt ();*/
/*[JEC] was:# ifndef __need_getopt*/
/*[JEC] was:extern int getopt_long ();*/
/*[JEC] was:extern int getopt_long_only ();*/
/*[JEC] was:extern int _getopt_internal ();*/
/*[JEC] was:# endif*/
/*[JEC] was:#endif*/ /* __STDC__ */
#ifdef __cplusplus
}
#endif
/* Make sure we later can get all the definitions and declarations. */
/*[JEC] was:#undef __need_getopt*/
#endif /* getopt.h */

View File

@ -1,29 +0,0 @@
/* grabbag - Convenience lib for various routines common to several tools
* Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SHARE__GRABBAG_H
#define SHARE__GRABBAG_H
/* These can't be included by themselves, only from within grabbag.h */
#include "grabbag/cuesheet.h"
#include "grabbag/file.h"
#include "grabbag/picture.h"
#include "grabbag/replaygain.h"
#include "grabbag/seektable.h"
#endif

View File

@ -1,10 +0,0 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = \
cuesheet.h \
file.h \
picture.h \
replaygain.h \
seektable.h

View File

@ -1,362 +0,0 @@
# Makefile.in generated by automake 1.7.9 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_triplet = @host@
ACLOCAL = @ACLOCAL@
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEBUG_FALSE = @DEBUG_FALSE@
DEBUG_TRUE = @DEBUG_TRUE@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@
DOXYGEN = @DOXYGEN@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@
FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@
FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@
FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@
FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@
FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@
FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@
FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@
FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@
FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@
FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@
FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@
FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@
FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@
FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@
FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@
FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@
FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@
FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@
FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@
FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@
FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@
FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@
FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@
FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@
FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@
FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@
FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@
FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@
FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@
FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@
FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@
FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@
FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@
FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@
FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@
FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@
FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@
FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@
FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@
FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@
FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@
GAS = @GAS@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@
NASM = @NASM@
OBJEXT = @OBJEXT@
OBJ_FORMAT = @OBJ_FORMAT@
OGG_CFLAGS = @OGG_CFLAGS@
OGG_LIBS = @OGG_LIBS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XMMS_CFLAGS = @XMMS_CFLAGS@
XMMS_CONFIG = @XMMS_CONFIG@
XMMS_DATA_DIR = @XMMS_DATA_DIR@
XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@
XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@
XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@
XMMS_LIBS = @XMMS_LIBS@
XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@
XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@
XMMS_VERSION = @XMMS_VERSION@
XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = \
cuesheet.h \
file.h \
picture.h \
replaygain.h \
seektable.h
subdir = include/share/grabbag
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign include/share/grabbag/Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ../../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am info info-am install install-am install-data \
install-data-am install-exec install-exec-am install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,42 +0,0 @@
/* grabbag - Convenience lib for various routines common to several tools
* Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* This .h cannot be included by itself; #include "share/grabbag.h" instead. */
#ifndef GRABBAG__CUESHEET_H
#define GRABBAG__CUESHEET_H
#include <stdio.h>
#include "FLAC/metadata.h"
#ifdef __cplusplus
extern "C" {
#endif
unsigned grabbag__cuesheet_msf_to_frame(unsigned minutes, unsigned seconds, unsigned frames);
void grabbag__cuesheet_frame_to_msf(unsigned frame, unsigned *minutes, unsigned *seconds, unsigned *frames);
FLAC__StreamMetadata *grabbag__cuesheet_parse(FILE *file, const char **error_message, unsigned *last_line_read, FLAC__bool is_cdda, FLAC__uint64 lead_out_offset);
void grabbag__cuesheet_emit(FILE *file, const FLAC__StreamMetadata *cuesheet, const char *file_reference);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,63 +0,0 @@
/* grabbag - Convenience lib for various routines common to several tools
* Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* Convenience routines for manipulating files */
/* This .h cannot be included by itself; #include "share/grabbag.h" instead. */
#ifndef GRABAG__FILE_H
#define GRABAG__FILE_H
/* needed because of off_t */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h> /* for off_t */
#include <stdio.h> /* for FILE */
#include "FLAC/ordinals.h"
#ifdef __cplusplus
extern "C" {
#endif
void grabbag__file_copy_metadata(const char *srcpath, const char *destpath);
off_t grabbag__file_get_filesize(const char *srcpath);
const char *grabbag__file_get_basename(const char *srcpath);
/* read_only == false means "make file writable by user"
* read_only == true means "make file read-only for everyone"
*/
FLAC__bool grabbag__file_change_stats(const char *filename, FLAC__bool read_only);
/* returns true iff stat() succeeds for both files and they have the same device and inode. */
/* on windows, uses GetFileInformationByHandle() to compare */
FLAC__bool grabbag__file_are_same(const char *f1, const char *f2);
/* attempts to make writable before unlinking */
FLAC__bool grabbag__file_remove_file(const char *filename);
/* these will forcibly set stdin/stdout to binary mode (for OSes that require it) */
FILE *grabbag__file_get_binary_stdin(void);
FILE *grabbag__file_get_binary_stdout(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,46 +0,0 @@
/* grabbag - Convenience lib for various routines common to several tools
* Copyright (C) 2006,2007 Josh Coalson
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* This .h cannot be included by itself; #include "share/grabbag.h" instead. */
#ifndef GRABBAG__PICTURE_H
#define GRABBAG__PICTURE_H
#include "FLAC/metadata.h"
#ifdef __cplusplus
extern "C" {
#endif
/* spec should be of the form "[TYPE]|MIME_TYPE|[DESCRIPTION]|[WIDTHxHEIGHTxDEPTH[/COLORS]]|FILE", e.g.
* "|image/jpeg|||cover.jpg"
* "4|image/jpeg||300x300x24|backcover.jpg"
* "|image/png|description|300x300x24/71|cover.png"
* "-->|image/gif||300x300x24/71|http://blah.blah.blah/cover.gif"
*
* empty type means default to FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER
* empty resolution spec means to get from the file (cannot get used with "-->" linked images)
* spec and error_message must not be NULL
*/
FLAC__StreamMetadata *grabbag__picture_parse_specification(const char *spec, const char **error_message);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,72 +0,0 @@
/* grabbag - Convenience lib for various routines common to several tools
* Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* This wraps the replaygain_analysis lib, which is LGPL. This wrapper
* allows analysis of different input resolutions by automatically
* scaling the input signal
*/
/* This .h cannot be included by itself; #include "share/grabbag.h" instead. */
#ifndef GRABBAG__REPLAYGAIN_H
#define GRABBAG__REPLAYGAIN_H
#include "FLAC/metadata.h"
#ifdef __cplusplus
extern "C" {
#endif
extern const unsigned GRABBAG__REPLAYGAIN_MAX_TAG_SPACE_REQUIRED;
extern const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_REFERENCE_LOUDNESS; /* = "REPLAYGAIN_REFERENCE_LOUDNESS" */
extern const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_TITLE_GAIN; /* = "REPLAYGAIN_TRACK_GAIN" */
extern const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_TITLE_PEAK; /* = "REPLAYGAIN_TRACK_PEAK" */
extern const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_ALBUM_GAIN; /* = "REPLAYGAIN_ALBUM_GAIN" */
extern const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_ALBUM_PEAK; /* = "REPLAYGAIN_ALBUM_PEAK" */
FLAC__bool grabbag__replaygain_is_valid_sample_frequency(unsigned sample_frequency);
FLAC__bool grabbag__replaygain_init(unsigned sample_frequency);
/* 'bps' must be valid for FLAC, i.e. >=4 and <= 32 */
FLAC__bool grabbag__replaygain_analyze(const FLAC__int32 * const input[], FLAC__bool is_stereo, unsigned bps, unsigned samples);
void grabbag__replaygain_get_album(float *gain, float *peak);
void grabbag__replaygain_get_title(float *gain, float *peak);
/* These three functions return an error string on error, or NULL if successful */
const char *grabbag__replaygain_analyze_file(const char *filename, float *title_gain, float *title_peak);
const char *grabbag__replaygain_store_to_vorbiscomment(FLAC__StreamMetadata *block, float album_gain, float album_peak, float title_gain, float title_peak);
const char *grabbag__replaygain_store_to_vorbiscomment_reference(FLAC__StreamMetadata *block);
const char *grabbag__replaygain_store_to_vorbiscomment_album(FLAC__StreamMetadata *block, float album_gain, float album_peak);
const char *grabbag__replaygain_store_to_vorbiscomment_title(FLAC__StreamMetadata *block, float title_gain, float title_peak);
const char *grabbag__replaygain_store_to_file(const char *filename, float album_gain, float album_peak, float title_gain, float title_peak, FLAC__bool preserve_modtime);
const char *grabbag__replaygain_store_to_file_reference(const char *filename, FLAC__bool preserve_modtime);
const char *grabbag__replaygain_store_to_file_album(const char *filename, float album_gain, float album_peak, FLAC__bool preserve_modtime);
const char *grabbag__replaygain_store_to_file_title(const char *filename, float title_gain, float title_peak, FLAC__bool preserve_modtime);
FLAC__bool grabbag__replaygain_load_from_vorbiscomment(const FLAC__StreamMetadata *block, FLAC__bool album_mode, FLAC__bool strict, double *reference, double *gain, double *peak);
double grabbag__replaygain_compute_scale_factor(double peak, double gain, double preamp, FLAC__bool prevent_clipping);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,38 +0,0 @@
/* grabbag - Convenience lib for various routines common to several tools
* Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* Convenience routines for working with seek tables */
/* This .h cannot be included by itself; #include "share/grabbag.h" instead. */
#ifndef GRABAG__SEEKTABLE_H
#define GRABAG__SEEKTABLE_H
#include "FLAC/format.h"
#ifdef __cplusplus
extern "C" {
#endif
FLAC__bool grabbag__seektable_convert_specification_to_template(const char *spec, FLAC__bool only_explicit_placeholders, FLAC__uint64 total_samples_to_encode, unsigned sample_rate, FLAC__StreamMetadata *seektable_template, FLAC__bool *spec_has_real_points);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,59 +0,0 @@
/*
* ReplayGainAnalysis - analyzes input samples and give the recommended dB change
* Copyright (C) 2001 David Robinson and Glen Sawyer
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* concept and filter values by David Robinson (David@Robinson.org)
* -- blame him if you think the idea is flawed
* coding by Glen Sawyer (glensawyer@hotmail.com) 442 N 700 E, Provo, UT 84606 USA
* -- blame him if you think this runs too slowly, or the coding is otherwise flawed
* minor cosmetic tweaks to integrate with FLAC by Josh Coalson
*
* For an explanation of the concepts and the basic algorithms involved, go to:
* http://www.replaygain.org/
*/
#ifndef GAIN_ANALYSIS_H
#define GAIN_ANALYSIS_H
#include <stddef.h>
#define GAIN_NOT_ENOUGH_SAMPLES -24601
#define GAIN_ANALYSIS_ERROR 0
#define GAIN_ANALYSIS_OK 1
#define INIT_GAIN_ANALYSIS_ERROR 0
#define INIT_GAIN_ANALYSIS_OK 1
#ifdef __cplusplus
extern "C" {
#endif
typedef float Float_t; /* Type used for filtering */
extern Float_t ReplayGainReferenceLoudness; /* in dB SPL, currently == 89.0 */
int InitGainAnalysis ( long samplefreq );
int AnalyzeSamples ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels );
int ResetSampleFrequency ( long samplefreq );
Float_t GetTitleGain ( void );
Float_t GetAlbumGain ( void );
#ifdef __cplusplus
}
#endif
#endif /* GAIN_ANALYSIS_H */

View File

@ -1,51 +0,0 @@
/* replaygain_synthesis - Routines for applying ReplayGain to a signal
* Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef FLAC__SHARE__REPLAYGAIN_SYNTHESIS_H
#define FLAC__SHARE__REPLAYGAIN_SYNTHESIS_H
#include <stdlib.h> /* for size_t */
#include "FLAC/ordinals.h"
#define FLAC_SHARE__MAX_SUPPORTED_CHANNELS 2
typedef enum {
NOISE_SHAPING_NONE = 0,
NOISE_SHAPING_LOW = 1,
NOISE_SHAPING_MEDIUM = 2,
NOISE_SHAPING_HIGH = 3
} NoiseShaping;
typedef struct {
const float* FilterCoeff;
FLAC__uint64 Mask;
double Add;
float Dither;
float ErrorHistory [FLAC_SHARE__MAX_SUPPORTED_CHANNELS] [16]; /* 16th order Noise shaping */
float DitherHistory [FLAC_SHARE__MAX_SUPPORTED_CHANNELS] [16];
int LastRandomNumber [FLAC_SHARE__MAX_SUPPORTED_CHANNELS];
unsigned LastHistoryIndex;
NoiseShaping ShapingType;
} DitherContext;
void FLAC__replaygain_synthesis__init_dither_context(DitherContext *dither, int bits, int shapingtype);
/* scale = (float) pow(10., (double)replaygain * 0.05); */
size_t FLAC__replaygain_synthesis__apply_gain(FLAC__byte *data_out, FLAC__bool little_endian_data_out, FLAC__bool unsigned_data_out, const FLAC__int32 * const input[], unsigned wide_samples, unsigned channels, const unsigned source_bps, const unsigned target_bps, const double scale, const FLAC__bool hard_limit, FLAC__bool do_dithering, DitherContext *dither_context);
#endif

View File

@ -1,25 +0,0 @@
#ifndef SHARE__UTF8_H
#define SHARE__UTF8_H
/*
* Convert a string between UTF-8 and the locale's charset.
* Invalid bytes are replaced by '#', and characters that are
* not available in the target encoding are replaced by '?'.
*
* If the locale's charset is not set explicitly then it is
* obtained using nl_langinfo(CODESET), where available, the
* environment variable CHARSET, or assumed to be US-ASCII.
*
* Return value of conversion functions:
*
* -1 : memory allocation failed
* 0 : data was converted exactly
* 1 : valid data was converted approximately (using '?')
* 2 : input was invalid (but still converted, using '#')
* 3 : unknown encoding (but still converted, using '?')
*/
int utf8_encode(const char *from, char **to);
int utf8_decode(const char *from, char **to);
#endif