Universal Binary

CQTexperiment
vspader 2006-04-17 12:55:10 +00:00
parent b7f5cee744
commit cd6b8dabf9
25 changed files with 7658 additions and 0 deletions

View File

@ -0,0 +1 @@
# dummy

View File

@ -0,0 +1 @@
# dummy

View File

@ -0,0 +1 @@
# dummy

View File

@ -0,0 +1 @@
# dummy

View File

@ -0,0 +1 @@
# dummy

View File

@ -0,0 +1 @@
# dummy

View File

@ -0,0 +1 @@
# dummy

View File

@ -0,0 +1,577 @@
# Makefile.in generated by automake 1.8.5 from Makefile.am.
# src/flac/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 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.
# flac - Command-line FLAC encoder/decoder
# Copyright (C) 2000,2001,2002,2003,2004,2005 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.
SOURCES = $(flac_SOURCES)
srcdir = .
top_srcdir = ../..
pkgdatadir = $(datadir)/flac
pkglibdir = $(libdir)/flac
pkgincludedir = $(includedir)/flac
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/install -c
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 = powerpc-apple-darwin8.4.0
bin_PROGRAMS = flac$(EXEEXT)
subdir = src/flac
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_flac_OBJECTS = analyze.$(OBJEXT) decode.$(OBJEXT) encode.$(OBJEXT) \
main.$(OBJEXT) local_string_utils.$(OBJEXT) utils.$(OBJEXT) \
vorbiscomment.$(OBJEXT)
flac_OBJECTS = $(am_flac_OBJECTS)
#am__DEPENDENCIES_1 = $(top_builddir)/src/libOggFLAC/libOggFLAC.la
flac_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/getopt/libgetopt.a \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \
$(top_builddir)/src/share/utf8/libutf8.la \
$(top_builddir)/src/libFLAC/libFLAC.la
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
DEP_FILES = ./$(DEPDIR)/analyze.Po ./$(DEPDIR)/decode.Po \
./$(DEPDIR)/encode.Po \
./$(DEPDIR)/local_string_utils.Po \
./$(DEPDIR)/main.Po ./$(DEPDIR)/utils.Po \
./$(DEPDIR)/vorbiscomment.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(flac_SOURCES)
DIST_SOURCES = $(flac_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} /Users/me/Development/Frameworks/flac/flac-src/missing --run aclocal-1.8
AMDEP_FALSE = #
AMDEP_TRUE =
AMTAR = ${SHELL} /Users/me/Development/Frameworks/flac/flac-src/missing --run tar
AS = as
AUTOCONF = ${SHELL} /Users/me/Development/Frameworks/flac/flac-src/missing --run autoconf
AUTOHEADER = ${SHELL} /Users/me/Development/Frameworks/flac/flac-src/missing --run autoheader
AUTOMAKE = ${SHELL} /Users/me/Development/Frameworks/flac/flac-src/missing --run automake-1.8
AWK = awk
CC = gcc
CCAS = gcc
CCASFLAGS = -g -O2
CCDEPMODE = depmode=gcc3
CFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include -O2 -DNDEBUG -O3 -fomit-frame-pointer -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__ -g -O2
CPP = gcc -E
CPPFLAGS =
CXX = g++
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include -O2 -DNDEBUG -O3 -fomit-frame-pointer -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__ -g -O2
CYGPATH_W = echo
DEBUG_FALSE =
DEBUG_TRUE = #
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DOCBOOK_TO_MAN =
DOXYGEN =
ECHO = echo
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = grep -E
EXEEXT =
FLaC__CPU_IA32_FALSE =
FLaC__CPU_IA32_TRUE = #
FLaC__CPU_PPC_FALSE = #
FLaC__CPU_PPC_TRUE =
FLaC__CPU_SPARC_FALSE =
FLaC__CPU_SPARC_TRUE = #
FLaC__EXHAUSTIVE_TESTS_FALSE =
FLaC__EXHAUSTIVE_TESTS_TRUE = #
FLaC__HAS_AS_FALSE = #
FLaC__HAS_AS_TRUE =
FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE =
FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = #
FLaC__HAS_DOCBOOK_TO_MAN_FALSE =
FLaC__HAS_DOCBOOK_TO_MAN_TRUE = #
FLaC__HAS_DOXYGEN_FALSE =
FLaC__HAS_DOXYGEN_TRUE = #
FLaC__HAS_GAS_FALSE =
FLaC__HAS_GAS_TRUE = #
FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE =
FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = #
FLaC__HAS_NASM_FALSE = #
FLaC__HAS_NASM_TRUE =
FLaC__HAS_OGG_FALSE =
FLaC__HAS_OGG_TRUE = #
FLaC__HAS_XMMS_FALSE =
FLaC__HAS_XMMS_TRUE = #
FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE =
FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = #
FLaC__NO_ASM_FALSE =
FLaC__NO_ASM_TRUE = #
FLaC__SSE_OS_FALSE =
FLaC__SSE_OS_TRUE = #
FLaC__SYS_DARWIN_FALSE = #
FLaC__SYS_DARWIN_TRUE =
FLaC__SYS_LINUX_FALSE =
FLaC__SYS_LINUX_TRUE = #
FLaC__USE_3DNOW_FALSE = #
FLaC__USE_3DNOW_TRUE =
FLaC__USE_ALTIVEC_FALSE = #
FLaC__USE_ALTIVEC_TRUE =
FLaC__VALGRIND_TESTING_FALSE =
FLaC__VALGRIND_TESTING_TRUE = #
GAS =
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
LDFLAGS =
LIBICONV = -liconv
LIBOBJS =
LIBS =
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LN_S = ln -s
LTLIBICONV = -liconv
LTLIBOBJS =
MAINT = #
MAINTAINER_MODE_FALSE =
MAINTAINER_MODE_TRUE = #
MAKEINFO = ${SHELL} /Users/me/Development/Frameworks/flac/flac-src/missing --run makeinfo
NASM = nasm
OBJEXT = o
OBJ_FORMAT = elf
OGG_CFLAGS =
OGG_LIBS =
PACKAGE = flac
PACKAGE_BUGREPORT =
PACKAGE_NAME =
PACKAGE_STRING =
PACKAGE_TARNAME =
PACKAGE_VERSION =
PATH_SEPARATOR = :
RANLIB = ranlib
SET_MAKE =
SHELL = /bin/sh
STRIP = strip
VERSION = 1.1.2
XMMS_CFLAGS =
XMMS_CONFIG = no
XMMS_DATA_DIR =
XMMS_EFFECT_PLUGIN_DIR =
XMMS_GENERAL_PLUGIN_DIR =
XMMS_INPUT_PLUGIN_DIR =
XMMS_LIBS =
XMMS_OUTPUT_PLUGIN_DIR =
XMMS_PLUGIN_DIR =
XMMS_VERSION =
XMMS_VISUALIZATION_PLUGIN_DIR =
ac_ct_CC = gcc
ac_ct_CXX = g++
ac_ct_RANLIB = ranlib
ac_ct_STRIP = strip
am__fastdepCC_FALSE = #
am__fastdepCC_TRUE =
am__fastdepCXX_FALSE = #
am__fastdepCXX_TRUE =
am__include = include
am__leading_dot = .
am__quote =
bindir = ${exec_prefix}/bin
build = powerpc-apple-darwin8.4.0
build_alias =
build_cpu = powerpc
build_os = darwin8.4.0
build_vendor = apple
datadir = ${prefix}/share
exec_prefix = ${prefix}
host = powerpc-apple-darwin8.4.0
host_alias =
host_cpu = powerpc
host_os = darwin8.4.0
host_vendor = apple
includedir = ${prefix}/include
infodir = ${prefix}/info
install_sh = /Users/me/Development/Frameworks/flac/flac-src/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localstatedir = ${prefix}/var
mandir = ${prefix}/man
mkdir_p = $(install_sh) -d
oldincludedir = /usr/include
prefix = /usr/local
program_transform_name = s,x,x,
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
sysconfdir = ${prefix}/etc
target_alias =
AM_CFLAGS =
#NEED_OGGFLAC_LIB = $(top_builddir)/src/libOggFLAC/libOggFLAC.la
EXTRA_DIST = \
Makefile.lite \
flac.dsp
flac_SOURCES = \
analyze.c \
decode.c \
encode.c \
main.c \
local_string_utils.c \
utils.c \
vorbiscomment.c \
analyze.h \
decode.h \
encode.h \
local_string_utils.h \
utils.h \
vorbiscomment.h
flac_LDADD = \
$(NEED_OGGFLAC_LIB) \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/getopt/libgetopt.a \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \
$(top_builddir)/src/share/utf8/libutf8.la \
$(top_builddir)/src/libFLAC/libFLAC.la \
\
-liconv \
-lm
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/flac/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign src/flac/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: # $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
flac$(EXEEXT): $(flac_OBJECTS) $(flac_DEPENDENCIES)
@rm -f flac$(EXEEXT)
$(LINK) $(flac_LDFLAGS) $(flac_OBJECTS) $(flac_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/analyze.Po
include ./$(DEPDIR)/decode.Po
include ./$(DEPDIR)/encode.Po
include ./$(DEPDIR)/local_string_utils.Po
include ./$(DEPDIR)/main.Po
include ./$(DEPDIR)/utils.Po
include ./$(DEPDIR)/vorbiscomment.Po
.c.o:
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=no \
# depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
# $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c $<
.c.obj:
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=no \
# depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
# $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=yes \
# depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' \
# $(CCDEPMODE) $(depcomp) \
# $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
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
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; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
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
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"; \
$(mkdir_p) "$(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 $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
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-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-binPROGRAMS
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic clean-libtool ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS 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-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags uninstall uninstall-am \
uninstall-binPROGRAMS 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

@ -0,0 +1,55 @@
# flac - Command-line FLAC encoder/decoder
# Copyright (C) 2000,2001,2002,2003,2004,2005 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.
bin_PROGRAMS = flac
AM_CFLAGS = @OGG_CFLAGS@
if FLaC__HAS_OGG
NEED_OGGFLAC_LIB = $(top_builddir)/src/libOggFLAC/libOggFLAC.la
endif
EXTRA_DIST = \
Makefile.lite \
flac.dsp
flac_SOURCES = \
analyze.c \
decode.c \
encode.c \
main.c \
local_string_utils.c \
utils.c \
vorbiscomment.c \
analyze.h \
decode.h \
encode.h \
local_string_utils.h \
utils.h \
vorbiscomment.h
flac_LDADD = \
$(NEED_OGGFLAC_LIB) \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/getopt/libgetopt.a \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \
$(top_builddir)/src/share/utf8/libutf8.la \
$(top_builddir)/src/libFLAC/libFLAC.la \
@OGG_LIBS@ \
@LIBICONV@ \
-lm

View File

@ -0,0 +1,577 @@
# Makefile.in generated by automake 1.8.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 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@
# flac - Command-line FLAC encoder/decoder
# Copyright (C) 2000,2001,2002,2003,2004,2005 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.
SOURCES = $(flac_SOURCES)
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@
bin_PROGRAMS = flac$(EXEEXT)
subdir = src/flac
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_flac_OBJECTS = analyze.$(OBJEXT) decode.$(OBJEXT) encode.$(OBJEXT) \
main.$(OBJEXT) local_string_utils.$(OBJEXT) utils.$(OBJEXT) \
vorbiscomment.$(OBJEXT)
flac_OBJECTS = $(am_flac_OBJECTS)
@FLaC__HAS_OGG_TRUE@am__DEPENDENCIES_1 = $(top_builddir)/src/libOggFLAC/libOggFLAC.la
flac_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/getopt/libgetopt.a \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \
$(top_builddir)/src/share/utf8/libutf8.la \
$(top_builddir)/src/libFLAC/libFLAC.la
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/analyze.Po ./$(DEPDIR)/decode.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/encode.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/local_string_utils.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/main.Po ./$(DEPDIR)/utils.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/vorbiscomment.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(flac_SOURCES)
DIST_SOURCES = $(flac_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
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@
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@
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__EXHAUSTIVE_TESTS_FALSE = @FLaC__EXHAUSTIVE_TESTS_FALSE@
FLaC__EXHAUSTIVE_TESTS_TRUE = @FLaC__EXHAUSTIVE_TESTS_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__VALGRIND_TESTING_FALSE = @FLaC__VALGRIND_TESTING_FALSE@
FLaC__VALGRIND_TESTING_TRUE = @FLaC__VALGRIND_TESTING_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@
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_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
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@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
AM_CFLAGS = @OGG_CFLAGS@
@FLaC__HAS_OGG_TRUE@NEED_OGGFLAC_LIB = $(top_builddir)/src/libOggFLAC/libOggFLAC.la
EXTRA_DIST = \
Makefile.lite \
flac.dsp
flac_SOURCES = \
analyze.c \
decode.c \
encode.c \
main.c \
local_string_utils.c \
utils.c \
vorbiscomment.c \
analyze.h \
decode.h \
encode.h \
local_string_utils.h \
utils.h \
vorbiscomment.h
flac_LDADD = \
$(NEED_OGGFLAC_LIB) \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/getopt/libgetopt.a \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \
$(top_builddir)/src/share/utf8/libutf8.la \
$(top_builddir)/src/libFLAC/libFLAC.la \
@OGG_LIBS@ \
@LIBICONV@ \
-lm
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/flac/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign src/flac/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
flac$(EXEEXT): $(flac_OBJECTS) $(flac_DEPENDENCIES)
@rm -f flac$(EXEEXT)
$(LINK) $(flac_LDFLAGS) $(flac_OBJECTS) $(flac_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/analyze.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decode.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encode.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/local_string_utils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vorbiscomment.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
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
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; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
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
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"; \
$(mkdir_p) "$(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 $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
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-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-binPROGRAMS
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic clean-libtool ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS 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-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags uninstall uninstall-am \
uninstall-binPROGRAMS 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

@ -0,0 +1,46 @@
# flac - Command-line FLAC encoder/decoder
# Copyright (C) 2000,2001,2002,2003,2004,2005 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.
#
# GNU makefile
#
topdir = ../..
libdir = $(topdir)/obj/$(BUILD)/lib
PROGRAM_NAME = flac
INCLUDES = -I./include -I$(topdir)/include -I$(OGG_INCLUDE_DIR)
ifeq ($(DARWIN_BUILD),yes)
EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libOggFLAC.a $(libdir)/libFLAC.a $(libdir)/libreplaygain_analysis.a $(libdir)/libreplaygain_synthesis.a $(libdir)/libgetopt.a $(libdir)/libutf8.a $(OGG_LIB_DIR)/libogg.a -L$(ICONV_LIB_DIR) -liconv -lm
else
LIBS = -lgrabbag -lOggFLAC -lFLAC -lreplaygain_analysis -lreplaygain_synthesis -lgetopt -lutf8 -L$(OGG_LIB_DIR) -logg -L$(ICONV_LIB_DIR) -liconv -lm
endif
SRCS_C = \
analyze.c \
decode.c \
encode.c \
local_string_utils.c \
main.c \
utils.c \
vorbiscomment.c
include $(topdir)/build/exe.mk
# DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -0,0 +1,234 @@
/* flac - Command-line FLAC encoder/decoder
* Copyright (C) 2000,2001,2002,2003,2004,2005 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.
*/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "FLAC/all.h"
#include "analyze.h"
typedef struct {
FLAC__int32 residual;
unsigned count;
} pair_t;
typedef struct {
pair_t buckets[FLAC__MAX_BLOCK_SIZE];
int peak_index;
unsigned nbuckets;
unsigned nsamples;
double sum, sos;
double variance;
double mean;
double stddev;
} subframe_stats_t;
static subframe_stats_t all_;
static void init_stats(subframe_stats_t *stats);
static void update_stats(subframe_stats_t *stats, FLAC__int32 residual, unsigned incr);
static void compute_stats(subframe_stats_t *stats);
static FLAC__bool dump_stats(const subframe_stats_t *stats, const char *filename);
void flac__analyze_init(analysis_options aopts)
{
if(aopts.do_residual_gnuplot) {
init_stats(&all_);
}
}
void flac__analyze_frame(const FLAC__Frame *frame, unsigned frame_number, analysis_options aopts, FILE *fout)
{
const unsigned channels = frame->header.channels;
char outfilename[1024];
subframe_stats_t stats;
unsigned i, channel;
/* do the human-readable part first */
fprintf(fout, "frame=%u\tblocksize=%u\tsample_rate=%u\tchannels=%u\tchannel_assignment=%s\n", frame_number, frame->header.blocksize, frame->header.sample_rate, channels, FLAC__ChannelAssignmentString[frame->header.channel_assignment]);
for(channel = 0; channel < channels; channel++) {
const FLAC__Subframe *subframe = frame->subframes+channel;
fprintf(fout, "\tsubframe=%u\twasted_bits=%u\ttype=%s", channel, subframe->wasted_bits, FLAC__SubframeTypeString[subframe->type]);
switch(subframe->type) {
case FLAC__SUBFRAME_TYPE_CONSTANT:
fprintf(fout, "\tvalue=%d\n", subframe->data.constant.value);
break;
case FLAC__SUBFRAME_TYPE_FIXED:
FLAC__ASSERT(subframe->data.fixed.entropy_coding_method.type == FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE);
fprintf(fout, "\torder=%u\tpartition_order=%u\n", subframe->data.fixed.order, subframe->data.fixed.entropy_coding_method.data.partitioned_rice.order);
for(i = 0; i < subframe->data.fixed.order; i++)
fprintf(fout, "\t\twarmup[%u]=%d\n", i, subframe->data.fixed.warmup[i]);
if(aopts.do_residual_text) {
const unsigned partitions = (1u << subframe->data.fixed.entropy_coding_method.data.partitioned_rice.order);
for(i = 0; i < partitions; i++) {
unsigned parameter = subframe->data.fixed.entropy_coding_method.data.partitioned_rice.contents->parameters[i];
if(parameter == FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER)
fprintf(fout, "\t\tparameter[%u]=ESCAPE, raw_bits=%u\n", i, subframe->data.fixed.entropy_coding_method.data.partitioned_rice.contents->raw_bits[i]);
else
fprintf(fout, "\t\tparameter[%u]=%u\n", i, parameter);
}
for(i = 0; i < frame->header.blocksize-subframe->data.fixed.order; i++)
fprintf(fout, "\t\tresidual[%u]=%d\n", i, subframe->data.fixed.residual[i]);
}
break;
case FLAC__SUBFRAME_TYPE_LPC:
FLAC__ASSERT(subframe->data.lpc.entropy_coding_method.type == FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE);
fprintf(fout, "\torder=%u\tpartition_order=%u\tqlp_coeff_precision=%u\tquantization_level=%d\n", subframe->data.lpc.order, subframe->data.lpc.entropy_coding_method.data.partitioned_rice.order, subframe->data.lpc.qlp_coeff_precision, subframe->data.lpc.quantization_level);
for(i = 0; i < subframe->data.lpc.order; i++)
fprintf(fout, "\t\twarmup[%u]=%d\n", i, subframe->data.lpc.warmup[i]);
if(aopts.do_residual_text) {
const unsigned partitions = (1u << subframe->data.lpc.entropy_coding_method.data.partitioned_rice.order);
for(i = 0; i < partitions; i++) {
unsigned parameter = subframe->data.lpc.entropy_coding_method.data.partitioned_rice.contents->parameters[i];
if(parameter == FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER)
fprintf(fout, "\t\tparameter[%u]=ESCAPE, raw_bits=%u\n", i, subframe->data.lpc.entropy_coding_method.data.partitioned_rice.contents->raw_bits[i]);
else
fprintf(fout, "\t\tparameter[%u]=%u\n", i, parameter);
}
for(i = 0; i < frame->header.blocksize-subframe->data.lpc.order; i++)
fprintf(fout, "\t\tresidual[%u]=%d\n", i, subframe->data.lpc.residual[i]);
}
break;
case FLAC__SUBFRAME_TYPE_VERBATIM:
fprintf(fout, "\n");
break;
}
}
/* now do the residual distributions if requested */
if(aopts.do_residual_gnuplot) {
for(channel = 0; channel < channels; channel++) {
const FLAC__Subframe *subframe = frame->subframes+channel;
unsigned residual_samples;
init_stats(&stats);
switch(subframe->type) {
case FLAC__SUBFRAME_TYPE_FIXED:
residual_samples = frame->header.blocksize - subframe->data.fixed.order;
for(i = 0; i < residual_samples; i++)
update_stats(&stats, subframe->data.fixed.residual[i], 1);
break;
case FLAC__SUBFRAME_TYPE_LPC:
residual_samples = frame->header.blocksize - subframe->data.lpc.order;
for(i = 0; i < residual_samples; i++)
update_stats(&stats, subframe->data.lpc.residual[i], 1);
break;
default:
break;
}
/* update all_ */
for(i = 0; i < stats.nbuckets; i++) {
update_stats(&all_, stats.buckets[i].residual, stats.buckets[i].count);
}
/* write the subframe */
sprintf(outfilename, "f%06u.s%u.gp", frame_number, channel);
compute_stats(&stats);
(void)dump_stats(&stats, outfilename);
}
}
}
void flac__analyze_finish(analysis_options aopts)
{
if(aopts.do_residual_gnuplot) {
compute_stats(&all_);
(void)dump_stats(&all_, "all");
}
}
void init_stats(subframe_stats_t *stats)
{
stats->peak_index = -1;
stats->nbuckets = 0;
stats->nsamples = 0;
stats->sum = 0.0;
stats->sos = 0.0;
}
void update_stats(subframe_stats_t *stats, FLAC__int32 residual, unsigned incr)
{
unsigned i;
const double r = (double)residual, a = r*incr;
stats->nsamples += incr;
stats->sum += a;
stats->sos += (a*r);
for(i = 0; i < stats->nbuckets; i++) {
if(stats->buckets[i].residual == residual) {
stats->buckets[i].count += incr;
goto find_peak;
}
}
/* not found, make a new bucket */
i = stats->nbuckets;
stats->buckets[i].residual = residual;
stats->buckets[i].count = incr;
stats->nbuckets++;
find_peak:
if(stats->peak_index < 0 || stats->buckets[i].count > stats->buckets[stats->peak_index].count)
stats->peak_index = i;
}
void compute_stats(subframe_stats_t *stats)
{
stats->mean = stats->sum / (double)stats->nsamples;
stats->variance = (stats->sos - (stats->sum * stats->sum / stats->nsamples)) / stats->nsamples;
stats->stddev = sqrt(stats->variance);
}
FLAC__bool dump_stats(const subframe_stats_t *stats, const char *filename)
{
FILE *outfile;
unsigned i;
const double m = stats->mean;
const double s1 = stats->stddev, s2 = s1*2, s3 = s1*3, s4 = s1*4, s5 = s1*5, s6 = s1*6;
const double p = stats->buckets[stats->peak_index].count;
outfile = fopen(filename, "w");
if(0 == outfile) {
fprintf(stderr, "ERROR opening %s\n", filename);
return false;
}
fprintf(outfile, "plot '-' title 'PDF', '-' title 'mean' with impulses, '-' title '1-stddev' with histeps, '-' title '2-stddev' with histeps, '-' title '3-stddev' with histeps, '-' title '4-stddev' with histeps, '-' title '5-stddev' with histeps, '-' title '6-stddev' with histeps\n");
for(i = 0; i < stats->nbuckets; i++) {
fprintf(outfile, "%d %u\n", stats->buckets[i].residual, stats->buckets[i].count);
}
fprintf(outfile, "e\n");
fprintf(outfile, "%f %f\ne\n", stats->mean, p);
fprintf(outfile, "%f %f\n%f %f\ne\n", m-s1, p*0.8, m+s1, p*0.8);
fprintf(outfile, "%f %f\n%f %f\ne\n", m-s2, p*0.7, m+s2, p*0.7);
fprintf(outfile, "%f %f\n%f %f\ne\n", m-s3, p*0.6, m+s3, p*0.6);
fprintf(outfile, "%f %f\n%f %f\ne\n", m-s4, p*0.5, m+s4, p*0.5);
fprintf(outfile, "%f %f\n%f %f\ne\n", m-s5, p*0.4, m+s5, p*0.4);
fprintf(outfile, "%f %f\n%f %f\ne\n", m-s6, p*0.3, m+s6, p*0.3);
fprintf(outfile, "pause -1 'waiting...'\n");
fclose(outfile);
return true;
}

View File

@ -0,0 +1,31 @@
/* flac - Command-line FLAC encoder/decoder
* Copyright (C) 2000,2001,2002,2003,2004,2005 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.
*/
#ifndef flac__analyze_h
#define flac__analyze_h
typedef struct {
FLAC__bool do_residual_text;
FLAC__bool do_residual_gnuplot;
} analysis_options;
void flac__analyze_init(analysis_options aopts);
void flac__analyze_frame(const FLAC__Frame *frame, unsigned frame_number, analysis_options aopts, FILE *fout);
void flac__analyze_finish(analysis_options aopts);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,69 @@
/* flac - Command-line FLAC encoder/decoder
* Copyright (C) 2000,2001,2002,2003,2004,2005 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.
*/
#ifndef flac__decode_h
#define flac__decode_h
#include "analyze.h"
#include "utils.h"
#include "share/replaygain_synthesis.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
typedef struct {
FLAC__bool apply;
FLAC__bool use_album_gain; /* false => use track gain */
enum { RGSS_LIMIT__NONE, RGSS_LIMIT__PEAK, RGSS_LIMIT__HARD} limiter;
NoiseShaping noise_shaping;
double preamp;
} replaygain_synthesis_spec_t;
typedef struct {
FLAC__bool continue_through_decode_errors;
replaygain_synthesis_spec_t replaygain_synthesis_spec;
#ifdef FLAC__HAS_OGG
FLAC__bool is_ogg;
FLAC__bool use_first_serial_number;
long serial_number;
#endif
utils__SkipUntilSpecification skip_specification;
utils__SkipUntilSpecification until_specification;
FLAC__bool has_cue_specification;
utils__CueSpecification cue_specification;
} decode_options_t;
/* used for AIFF also */
typedef struct {
decode_options_t common;
} wav_decode_options_t;
typedef struct {
decode_options_t common;
FLAC__bool is_big_endian;
FLAC__bool is_unsigned_samples;
} raw_decode_options_t;
/* outfile == 0 => test only */
int flac__decode_aiff(const char *infilename, const char *outfilename, FLAC__bool analysis_mode, analysis_options aopts, wav_decode_options_t options);
int flac__decode_wav(const char *infilename, const char *outfilename, FLAC__bool analysis_mode, analysis_options aopts, wav_decode_options_t options);
int flac__decode_raw(const char *infilename, const char *outfilename, FLAC__bool analysis_mode, analysis_options aopts, raw_decode_options_t options);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,90 @@
/* flac - Command-line FLAC encoder/decoder
* Copyright (C) 2000,2001,2002,2003,2004,2005 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.
*/
#ifndef flac__encode_h
#define flac__encode_h
#include "FLAC/metadata.h"
#include "utils.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
typedef struct {
utils__SkipUntilSpecification skip_specification;
utils__SkipUntilSpecification until_specification;
FLAC__bool verify;
#ifdef FLAC__HAS_OGG
FLAC__bool use_ogg;
long serial_number;
#endif
FLAC__bool lax;
FLAC__bool do_mid_side;
FLAC__bool loose_mid_side;
FLAC__bool do_exhaustive_model_search;
FLAC__bool do_escape_coding;
FLAC__bool do_qlp_coeff_prec_search;
unsigned min_residual_partition_order;
unsigned max_residual_partition_order;
unsigned rice_parameter_search_dist;
unsigned max_lpc_order;
unsigned blocksize;
unsigned qlp_coeff_precision;
int padding;
char *requested_seek_points;
int num_requested_seek_points;
const char *cuesheet_filename;
FLAC__bool cued_seekpoints;
/* options related to --replay-gain and --sector-align */
FLAC__bool is_first_file;
FLAC__bool is_last_file;
FLAC__int32 **align_reservoir;
unsigned *align_reservoir_samples;
FLAC__bool replay_gain;
FLAC__bool sector_align;
FLAC__StreamMetadata *vorbis_comment;
struct {
FLAC__bool disable_constant_subframes;
FLAC__bool disable_fixed_subframes;
FLAC__bool disable_verbatim_subframes;
} debug;
} encode_options_t;
typedef struct {
encode_options_t common;
} wav_encode_options_t;
typedef struct {
encode_options_t common;
FLAC__bool is_big_endian;
FLAC__bool is_unsigned_samples;
unsigned channels;
unsigned bps;
unsigned sample_rate;
} raw_encode_options_t;
int flac__encode_aif(FILE *infile, long infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, wav_encode_options_t options);
int flac__encode_wav(FILE *infile, long infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, wav_encode_options_t options);
int flac__encode_raw(FILE *infile, long infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, raw_encode_options_t options);
#endif

View File

@ -0,0 +1,148 @@
# Microsoft Developer Studio Project File - Name="flac" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=flac - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "flac.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "flac.mak" CFG="flac - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "flac - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "flac - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "flac - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "..\..\obj\release\bin"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\include" /D "NDEBUG" /D "FLAC__NO_DLL" /D "FLAC__HAS_OGG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\libOggFLAC_static.lib ..\..\obj\release\lib\libFLAC_static.lib ..\..\obj\release\lib\replaygain_analysis_static.lib ..\..\obj\release\lib\replaygain_synthesis_static.lib ..\..\obj\release\lib\getopt_static.lib ..\..\obj\release\lib\utf8_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "flac - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "..\..\obj\debug\bin"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "..\..\include" /D "_DEBUG" /D "FLAC__NO_DLL" /D "FLAC__HAS_OGG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\libOggFLAC_static.lib ..\..\obj\debug\lib\libFLAC_static.lib ..\..\obj\debug\lib\replaygain_analysis_static.lib ..\..\obj\debug\lib\replaygain_synthesis_static.lib ..\..\obj\debug\lib\getopt_static.lib ..\..\obj\debug\lib\utf8_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "flac - Win32 Release"
# Name "flac - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\analyze.c
# End Source File
# Begin Source File
SOURCE=.\decode.c
# End Source File
# Begin Source File
SOURCE=.\encode.c
# End Source File
# Begin Source File
SOURCE=.\main.c
# End Source File
# Begin Source File
SOURCE=.\local_string_utils.c
# End Source File
# Begin Source File
SOURCE=.\utils.c
# End Source File
# Begin Source File
SOURCE=.\vorbiscomment.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\analyze.h
# End Source File
# Begin Source File
SOURCE=.\decode.h
# End Source File
# Begin Source File
SOURCE=.\encode.h
# End Source File
# Begin Source File
SOURCE=.\local_string_utils.h
# End Source File
# Begin Source File
SOURCE=.\utils.h
# End Source File
# Begin Source File
SOURCE=.\vorbiscomment.h
# End Source File
# End Group
# End Target
# End Project

View File

@ -0,0 +1,104 @@
/* flac - Command-line FLAC encoder/decoder
*/
#include <string.h>
#include "utils.h"
/* $OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp $
*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred.
*/
size_t
flac__strlcpy(char *dst, const char *src, size_t siz)
{
register char *d = dst;
register const char *s = src;
register size_t n = siz;
/* Copy as many bytes as will fit */
if (n != 0 && --n != 0) {
do {
if ((*d++ = *s++) == 0)
break;
} while (--n != 0);
}
/* Not enough room in dst, add NUL and traverse rest of src */
if (n == 0) {
if (siz != 0)
*d = '\0'; /* NUL-terminate dst */
while (*s++)
;
}
return(s - src - 1); /* count does not include NUL */
}
/* $OpenBSD: strlcat.c,v 1.11 2003/06/17 21:56:24 millert Exp $
*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*
* Appends src to string dst of size siz (unlike strncat, siz is the
* full size of dst, not space left). At most siz-1 characters
* will be copied. Always NUL terminates (unless siz <= strlen(dst)).
* Returns strlen(src) + MIN(siz, strlen(initial dst)).
* If retval >= siz, truncation occurred.
*/
size_t
flac__strlcat(char *dst, const char *src, size_t siz)
{
register char *d = dst;
register const char *s = src;
register size_t n = siz;
size_t dlen;
/* Find the end of dst and adjust bytes left but don't go past end */
while (n-- != 0 && *d != '\0')
d++;
dlen = d - dst;
n = siz - dlen;
if (n == 0)
return(dlen + strlen(s));
while (*s != '\0') {
if (n != 1) {
*d++ = *s;
n--;
}
s++;
}
*d = '\0';
return(dlen + (s - src)); /* count does not include NUL */
}

View File

@ -0,0 +1,27 @@
/* flac - Command-line FLAC encoder/decoder
* Copyright (C) 2002,2003,2004,2005 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.
*/
#ifndef flac__local_string_utils_h
#define flac__local_string_utils_h
#include <stdlib.h> /* for size_t */
size_t flac__strlcpy(char *dst, const char *src, size_t siz);
size_t flac__strlcat(char *dst, const char *src, size_t siz);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,271 @@
/* flac - Command-line FLAC encoder/decoder
* Copyright (C) 2002,2003,2004,2005 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.
*/
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "utils.h"
#include "FLAC/assert.h"
#include <math.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
int flac__utils_verbosity_ = 2;
static FLAC__bool local__parse_uint64_(const char *s, FLAC__uint64 *value)
{
FLAC__uint64 ret = 0;
char c;
if(*s == '\0')
return false;
while('\0' != (c = *s++))
if(c >= '0' && c <= '9')
ret = ret * 10 + (c - '0');
else
return false;
*value = ret;
return true;
}
static FLAC__bool local__parse_timecode_(const char *s, double *value)
{
double ret;
unsigned i;
char c;
/* parse [0-9][0-9]*: */
c = *s++;
if(c >= '0' && c <= '9')
i = (c - '0');
else
return false;
while(':' != (c = *s++)) {
if(c >= '0' && c <= '9')
i = i * 10 + (c - '0');
else
return false;
}
ret = (double)i * 60.;
/* parse [0-9]*[.]?[0-9]* i.e. a sign-less rational number */
if(strspn(s, "1234567890.") != strlen(s))
return false;
{
const char *p = strchr(s, '.');
if(p && 0 != strchr(++p, '.'))
return false;
}
ret += atof(s);
*value = ret;
return true;
}
static FLAC__bool local__parse_cue_(const char *s, const char *end, unsigned *track, unsigned *index)
{
FLAC__bool got_track = false, got_index = false;
unsigned t = 0, i = 0;
char c;
while(end? s < end : *s != '\0') {
c = *s++;
if(c >= '0' && c <= '9') {
t = t * 10 + (c - '0');
got_track = true;
}
else if(c == '.')
break;
else
return false;
}
while(end? s < end : *s != '\0') {
c = *s++;
if(c >= '0' && c <= '9') {
i = i * 10 + (c - '0');
got_index = true;
}
else
return false;
}
*track = t;
*index = i;
return got_track && got_index;
}
/*
* @@@ this only works with sorted cuesheets (the spec strongly recommends but
* does not require sorted cuesheets). but if it's not sorted, picking a
* nearest cue point has no significance.
*/
static FLAC__uint64 local__find_closest_cue_(const FLAC__StreamMetadata_CueSheet *cuesheet, unsigned track, unsigned index, FLAC__uint64 total_samples, FLAC__bool look_forward)
{
int t, i;
if(look_forward) {
for(t = 0; t < (int)cuesheet->num_tracks; t++)
for(i = 0; i < (int)cuesheet->tracks[t].num_indices; i++)
if(cuesheet->tracks[t].number > track || (cuesheet->tracks[t].number == track && cuesheet->tracks[t].indices[i].number >= index))
return cuesheet->tracks[t].offset + cuesheet->tracks[t].indices[i].offset;
return total_samples;
}
else {
for(t = (int)cuesheet->num_tracks - 1; t >= 0; t--)
for(i = (int)cuesheet->tracks[t].num_indices - 1; i >= 0; i--)
if(cuesheet->tracks[t].number < track || (cuesheet->tracks[t].number == track && cuesheet->tracks[t].indices[i].number <= index))
return cuesheet->tracks[t].offset + cuesheet->tracks[t].indices[i].offset;
return 0;
}
}
void flac__utils_printf(FILE *stream, int level, const char *format, ...)
{
if(flac__utils_verbosity_ >= level) {
va_list args;
FLAC__ASSERT(0 != format);
va_start(args, format);
(void) vfprintf(stream, format, args);
va_end(args);
}
}
#ifdef FLAC__VALGRIND_TESTING
size_t flac__utils_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
{
size_t ret = fwrite(ptr, size, nmemb, stream);
if(!ferror(stream))
fflush(stream);
return ret;
}
#endif
FLAC__bool flac__utils_parse_skip_until_specification(const char *s, utils__SkipUntilSpecification *spec)
{
FLAC__uint64 val;
FLAC__bool is_negative = false;
FLAC__ASSERT(0 != spec);
spec->is_relative = false;
spec->value_is_samples = true;
spec->value.samples = 0;
if(0 != s) {
if(s[0] == '-') {
is_negative = true;
spec->is_relative = true;
s++;
}
else if(s[0] == '+') {
spec->is_relative = true;
s++;
}
if(local__parse_uint64_(s, &val)) {
spec->value_is_samples = true;
spec->value.samples = (FLAC__int64)val;
if(is_negative)
spec->value.samples = -(spec->value.samples);
}
else {
double d;
if(!local__parse_timecode_(s, &d))
return false;
spec->value_is_samples = false;
spec->value.seconds = d;
if(is_negative)
spec->value.seconds = -(spec->value.seconds);
}
}
return true;
}
void flac__utils_canonicalize_skip_until_specification(utils__SkipUntilSpecification *spec, unsigned sample_rate)
{
FLAC__ASSERT(0 != spec);
if(!spec->value_is_samples) {
spec->value.samples = (FLAC__int64)(spec->value.seconds * (double)sample_rate);
spec->value_is_samples = true;
}
}
FLAC__bool flac__utils_parse_cue_specification(const char *s, utils__CueSpecification *spec)
{
const char *start = s, *end = 0;
FLAC__ASSERT(0 != spec);
spec->has_start_point = spec->has_end_point = false;
s = strchr(s, '-');
if(0 != s) {
if(s == start)
start = 0;
end = s+1;
if(*end == '\0')
end = 0;
}
if(start) {
if(!local__parse_cue_(start, s, &spec->start_track, &spec->start_index))
return false;
spec->has_start_point = true;
}
if(end) {
if(!local__parse_cue_(end, 0, &spec->end_track, &spec->end_index))
return false;
spec->has_end_point = true;
}
return true;
}
void flac__utils_canonicalize_cue_specification(const utils__CueSpecification *cue_spec, const FLAC__StreamMetadata_CueSheet *cuesheet, FLAC__uint64 total_samples, utils__SkipUntilSpecification *skip_spec, utils__SkipUntilSpecification *until_spec)
{
FLAC__ASSERT(0 != cue_spec);
FLAC__ASSERT(0 != cuesheet);
FLAC__ASSERT(0 != total_samples);
FLAC__ASSERT(0 != skip_spec);
FLAC__ASSERT(0 != until_spec);
skip_spec->is_relative = false;
skip_spec->value_is_samples = true;
until_spec->is_relative = false;
until_spec->value_is_samples = true;
if(cue_spec->has_start_point)
skip_spec->value.samples = local__find_closest_cue_(cuesheet, cue_spec->start_track, cue_spec->start_index, total_samples, /*look_forward=*/false);
else
skip_spec->value.samples = 0;
if(cue_spec->has_end_point)
until_spec->value.samples = local__find_closest_cue_(cuesheet, cue_spec->end_track, cue_spec->end_index, total_samples, /*look_forward=*/true);
else
until_spec->value.samples = total_samples;
}

View File

@ -0,0 +1,56 @@
/* flac - Command-line FLAC encoder/decoder
* Copyright (C) 2002,2003,2004,2005 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.
*/
#ifndef flac__utils_h
#define flac__utils_h
#include "FLAC/ordinals.h"
#include "FLAC/format.h" /* for FLAC__StreamMetadata_CueSheet */
#include <stdio.h> /* for FILE */
typedef struct {
FLAC__bool is_relative; /* i.e. specification string started with + or - */
FLAC__bool value_is_samples;
union {
double seconds;
FLAC__int64 samples;
} value;
} utils__SkipUntilSpecification;
typedef struct {
FLAC__bool has_start_point, has_end_point;
unsigned start_track, start_index;
unsigned end_track, end_index;
} utils__CueSpecification;
#ifdef FLAC__VALGRIND_TESTING
size_t flac__utils_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
#else
#define flac__utils_fwrite fwrite
#endif
extern int flac__utils_verbosity_;
void flac__utils_printf(FILE *stream, int level, const char *format, ...);
FLAC__bool flac__utils_parse_skip_until_specification(const char *s, utils__SkipUntilSpecification *spec);
void flac__utils_canonicalize_skip_until_specification(utils__SkipUntilSpecification *spec, unsigned sample_rate);
FLAC__bool flac__utils_parse_cue_specification(const char *s, utils__CueSpecification *spec);
void flac__utils_canonicalize_cue_specification(const utils__CueSpecification *cue_spec, const FLAC__StreamMetadata_CueSheet *cuesheet, FLAC__uint64 total_samples, utils__SkipUntilSpecification *skip_spec, utils__SkipUntilSpecification *until_spec);
#endif

View File

@ -0,0 +1,177 @@
/* flac - Command-line FLAC encoder/decoder
* Copyright (C) 2002,2003,2004,2005 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.
*/
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "vorbiscomment.h"
#include "FLAC/assert.h"
#include "FLAC/metadata.h"
#include "share/utf8.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* This struct and the following 4 static functions are copied from
* ../metaflac/main.c. Maybe someday there will be a convenience
* library for Vorbis comment parsing.
*/
typedef struct {
char *field; /* the whole field as passed on the command line, i.e. "NAME=VALUE" */
char *field_name;
/* according to the vorbis spec, field values can contain \0 so simple C strings are not enough here */
unsigned field_value_length;
char *field_value;
} Argument_VcField;
static void die(const char *message)
{
FLAC__ASSERT(0 != message);
fprintf(stderr, "ERROR: %s\n", message);
exit(1);
}
static char *local_strdup(const char *source)
{
char *ret;
FLAC__ASSERT(0 != source);
if(0 == (ret = strdup(source)))
die("out of memory during strdup()");
return ret;
}
static FLAC__bool parse_vorbis_comment_field(const char *field_ref, char **field, char **name, char **value, unsigned *length, const char **violation)
{
static const char * const violations[] = {
"field name contains invalid character",
"field contains no '=' character"
};
char *p, *q, *s;
if(0 != field)
*field = local_strdup(field_ref);
s = local_strdup(field_ref);
if(0 == (p = strchr(s, '='))) {
free(s);
*violation = violations[1];
return false;
}
*p++ = '\0';
for(q = s; *q; q++) {
if(*q < 0x20 || *q > 0x7d || *q == 0x3d) {
free(s);
*violation = violations[0];
return false;
}
}
*name = local_strdup(s);
*value = local_strdup(p);
*length = strlen(p);
free(s);
return true;
}
/* slight modification: no 'filename' arg, and errors are passed back in 'violation' instead of printed to stderr */
static FLAC__bool set_vc_field(FLAC__StreamMetadata *block, const Argument_VcField *field, FLAC__bool *needs_write, FLAC__bool raw, const char **violation)
{
FLAC__StreamMetadata_VorbisComment_Entry entry;
char *converted;
FLAC__bool needs_free = false;
FLAC__ASSERT(0 != block);
FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT);
FLAC__ASSERT(0 != field);
FLAC__ASSERT(0 != needs_write);
if(raw) {
entry.entry = (FLAC__byte *)field->field;
}
else if(utf8_encode(field->field, &converted) >= 0) {
entry.entry = (FLAC__byte *)converted;
needs_free = true;
}
else {
*violation = "couldn't convert comment to UTF-8";
return false;
}
entry.length = strlen((const char *)entry.entry);
if(!FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/true)) {
if(needs_free)
free(converted);
*violation = "memory allocation failure";
return false;
}
else {
*needs_write = true;
if(needs_free)
free(converted);
return true;
}
}
/*
* The rest of the code is novel
*/
static void free_field(Argument_VcField *obj)
{
if(0 != obj->field)
free(obj->field);
if(0 != obj->field_name)
free(obj->field_name);
if(0 != obj->field_value)
free(obj->field_value);
}
FLAC__bool flac__vorbiscomment_add(FLAC__StreamMetadata *block, const char *comment, const char **violation)
{
Argument_VcField parsed;
FLAC__bool dummy;
FLAC__ASSERT(0 != block);
FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT);
FLAC__ASSERT(0 != comment);
memset(&parsed, 0, sizeof(parsed));
if(!parse_vorbis_comment_field(comment, &(parsed.field), &(parsed.field_name), &(parsed.field_value), &(parsed.field_value_length), violation)) {
free_field(&parsed);
return false;
}
if(!set_vc_field(block, &parsed, &dummy, /*raw=*/false, violation)) {
free_field(&parsed);
return false;
}
else {
free_field(&parsed);
return true;
}
}

View File

@ -0,0 +1,26 @@
/* flac - Command-line FLAC encoder/decoder
* Copyright (C) 2002,2003,2004,2005 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.
*/
#ifndef flac__vorbiscomment_h
#define flac__vorbiscomment_h
#include "FLAC/metadata.h"
FLAC__bool flac__vorbiscomment_add(FLAC__StreamMetadata *block, const char *comment, const char **violation);
#endif