Project_Dep_Name flac_ren\r
End Project Dependency\r
Begin Project Dependency\r
- Project_Dep_Name file_utils\r
+ Project_Dep_Name grabbag\r
End Project Dependency\r
Begin Project Dependency\r
Project_Dep_Name gain_analysis\r
Package=<4>\r
{{{\r
Begin Project Dependency\r
- Project_Dep_Name file_utils\r
+ Project_Dep_Name grabbag\r
End Project Dependency\r
Begin Project Dependency\r
Project_Dep_Name gain_analysis\r
\r
###############################################################################\r
\r
-Project: "file_utils"=.\src\share\file_utils\file_utils.dsp - Package Owner=<4>\r
+Project: "gain_analysis"=.\src\share\gain_analysis\gain_analysis.dsp - Package Owner=<4>\r
\r
Package=<5>\r
{{{\r
\r
###############################################################################\r
\r
-Project: "gain_analysis"=.\src\share\gain_analysis\gain_analysis.dsp - Package Owner=<4>\r
+Project: "getopt"=.\src\share\getopt\getopt.dsp - Package Owner=<4>\r
\r
Package=<5>\r
{{{\r
\r
###############################################################################\r
\r
-Project: "getopt"=.\src\share\getopt\getopt.dsp - Package Owner=<4>\r
+Project: "grabbag"=.\src\share\grabbag\grabbag.dsp - Package Owner=<4>\r
\r
Package=<5>\r
{{{\r
\r
Package=<4>\r
{{{\r
+ Begin Project Dependency\r
+ Project_Dep_Name libFLAC\r
+ End Project Dependency\r
}}}\r
\r
###############################################################################\r
(cd src/$@ ; $(MAKE) -f Makefile.lite $(CONFIG))
share:
- (cd src/$@/file_utils ; $(MAKE) -f Makefile.lite $(CONFIG))
(cd src/$@/gain_analysis ; $(MAKE) -f Makefile.lite $(CONFIG))
(cd src/$@/getopt ; $(MAKE) -f Makefile.lite $(CONFIG))
- (cd src/$@/replaygain ; $(MAKE) -f Makefile.lite $(CONFIG))
+ (cd src/$@/grabbag ; $(MAKE) -f Makefile.lite $(CONFIG))
(cd src/$@/utf8 ; $(MAKE) -f Makefile.lite $(CONFIG))
flac: libFLAC libOggFLAC share
-(cd src/libFLAC++ ; $(MAKE) -f Makefile.lite clean)
-(cd src/libOggFLAC ; $(MAKE) -f Makefile.lite clean)
-(cd src/libOggFLAC++ ; $(MAKE) -f Makefile.lite clean)
- -(cd src/share/file_utils ; $(MAKE) -f Makefile.lite clean)
-(cd src/share/gain_analysis ; $(MAKE) -f Makefile.lite clean)
-(cd src/share/getopt ; $(MAKE) -f Makefile.lite clean)
- -(cd src/share/replaygain ; $(MAKE) -f Makefile.lite clean)
+ -(cd src/share/grabbag ; $(MAKE) -f Makefile.lite clean)
-(cd src/share/utf8 ; $(MAKE) -f Makefile.lite clean)
-(cd src/flac ; $(MAKE) -f Makefile.lite clean)
-(cd src/metaflac ; $(MAKE) -f Makefile.lite clean)
AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - xmms support will not be built]))
AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x)
-SHARE_LIBS='$(top_builddir)/src/share/libreplaygain.a $(top_builddir)/src/share/libgain_analysis.a $(top_builddir)/src/share/libgetopt.a $(top_builddir)/src/share/libutf8.a $(top_builddir)/src/share/libfile_utils.a'
+SHARE_LIBS='$(top_builddir)/src/share/libgrabbag.a $(top_builddir)/src/share/libgain_analysis.a $(top_builddir)/src/share/libgetopt.a $(top_builddir)/src/share/libutf8.a'
dnl check for i18n(internationalization); these are from libiconv/gettext
AM_ICONV
src/plugin_winamp3/Makefile \
src/plugin_xmms/Makefile \
src/share/Makefile \
- src/share/file_utils/Makefile \
src/share/gain_analysis/Makefile \
src/share/getopt/Makefile \
- src/share/replaygain/Makefile \
+ src/share/grabbag/Makefile \
src/share/utf8/Makefile \
src/test_libFLAC/Makefile \
src/test_libFLAC++/Makefile \
include/OggFLAC/Makefile \
include/OggFLAC++/Makefile \
include/share/Makefile \
+ include/share/grabbag/Makefile \
doc/Makefile \
doc/html/Makefile \
doc/html/images/Makefile \
AUTOMAKE_OPTIONS = foreign
+SUBDIRS = grabbag
+
EXTRA_DIST = \
- file_utils.h \
gain_analysis.h \
getopt.h \
+ grabbag.h \
utf8.h
PROGRAM_NAME = flac
ifeq ($(DARWIN_BUILD),yes)
INCLUDES = -I./include -I$(topdir)/include
-LIBS = -lreplaygain -lFLAC -lgain_analysis -lgetopt -lutf8 -lfile_utils -lc -lm
+LIBS = -lgrabbag -lFLAC -lgain_analysis -lgetopt -lutf8 -lc -lm
else
#@@@ TODO: conditionalize ogg includes, defines, and -logg
ifeq ($(SOLARIS_BUILD),yes)
INCLUDES = -I./include -I$(topdir)/include -I$(HOME)/local/include -DFLAC__HAS_OGG
-LIBS = -lreplaygain -lOggFLAC -lFLAC -lgain_analysis -lgetopt -lutf8 -lfile_utils -lm -L$(HOME)/local/lib -logg
+LIBS = -lgrabbag -lOggFLAC -lFLAC -lgain_analysis -lgetopt -lutf8 -lm -L$(HOME)/local/lib -logg
else
#@@@ TODO: conditionalize ogg includes, defines, and -logg
INCLUDES = -I./include -I$(topdir)/include -I$(HOME)/local/include -DFLAC__HAS_OGG
-LIBS = -lreplaygain -lOggFLAC -lFLAC -lgain_analysis -lgetopt -lutf8 -lfile_utils -lm -L$(HOME)/local/lib -logg
+LIBS = -lgrabbag -lOggFLAC -lFLAC -lgain_analysis -lgetopt -lutf8 -lm -L$(HOME)/local/lib -logg
endif
endif
all: flac.exe\r
\r
flac.exe: $(OBJS)\r
- link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) replaygain.lib libOggFLAC.lib libFLAC.lib ogg_static.lib gain_analysis.lib getopt.lib utf8.lib file_utils.lib\r
+ link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) grabbag.lib libOggFLAC.lib libFLAC.lib ogg_static.lib gain_analysis.lib getopt.lib utf8.lib\r
\r
clean:\r
-del *.obj *.pch\r
#include <stdio.h> /* for FILE et al. */
#include <string.h> /* for strcmp() */
#include "FLAC/all.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
#include "decode.h"
#ifdef FLAC__HAS_OGG
d->aopts = aopts;
d->skip = skip;
- d->inbasefilename = FLAC__file_utils_get_basename(infilename);
+ d->inbasefilename = grabbag__file_get_basename(infilename);
d->outfilename = outfilename;
d->samples_processed = 0;
if(!d->test_only) {
if(0 == strcmp(outfilename, "-")) {
- d->fout = FLAC__file_utils_get_binary_stdout();
+ d->fout = grabbag__file_get_binary_stdout();
}
else {
if(0 == (d->fout = fopen(outfilename, "wb"))) {
#ifdef FLAC__HAS_OGG
if(d->is_ogg) {
if (0 == strcmp(infilename, "-")) {
- d->fin = FLAC__file_utils_get_binary_stdin();
+ d->fin = grabbag__file_get_binary_stdin();
} else {
if (0 == (d->fin = fopen(infilename, "rb"))) {
fprintf(stderr, "%s: ERROR: can't open input file %s\n", d->inbasefilename, infilename);
#include <stdlib.h> /* for malloc */
#include <string.h> /* for strcmp() */
#include "FLAC/all.h"
-#include "share/file_utils.h"
-#include "share/replaygain.h"
+#include "share/grabbag.h"
#include "encode.h"
#ifdef HAVE_CONFIG_H
static int EncoderSession_finish_error(EncoderSession *e);
static FLAC__bool EncoderSession_init_encoder(EncoderSession *e, encode_options_t options, unsigned channels, unsigned bps, unsigned sample_rate);
static FLAC__bool EncoderSession_process(EncoderSession *e, const FLAC__int32 * const buffer[], unsigned samples);
-static FLAC__bool convert_to_seek_table_template(char *requested_seek_points, int num_requested_seek_points, EncoderSession *e);
+static FLAC__bool convert_to_seek_table_template(const char *requested_seek_points, int num_requested_seek_points, EncoderSession *e);
static void format_input(FLAC__int32 *dest[], unsigned wide_samples, FLAC__bool is_big_endian, FLAC__bool is_unsigned_samples, unsigned channels, unsigned bps);
#ifdef FLAC__HAS_OGG
static FLAC__StreamEncoderWriteStatus ogg_stream_encoder_write_callback(const OggFLAC__StreamEncoder *encoder, const FLAC__byte buffer[], unsigned bytes, unsigned samples, unsigned current_frame, void *client_data);
FLAC__ASSERT(!options.common.sector_align || infilesize >= 0);
FLAC__ASSERT(!options.common.replay_gain || options.common.skip == 0);
FLAC__ASSERT(!options.common.replay_gain || options.channels <= 2);
- FLAC__ASSERT(!options.common.replay_gain || FLAC__replaygain_is_valid_sample_frequency(options.sample_rate));
+ FLAC__ASSERT(!options.common.replay_gain || grabbag__replaygain_is_valid_sample_frequency(options.sample_rate));
if(!
EncoderSession_construct(
e->is_stdout = (0 == strcmp(outfilename, "-"));
- e->inbasefilename = FLAC__file_utils_get_basename(infilename);
+ e->inbasefilename = grabbag__file_get_basename(infilename);
e->outfilename = outfilename;
e->unencoded_size = 0;
e->seek_table_template = 0;
if(e->is_stdout) {
- e->fout = FLAC__file_utils_get_binary_stdout();
+ e->fout = grabbag__file_get_binary_stdout();
}
#ifdef FLAC__HAS_OGG
else {
fprintf(stderr, "%s: ERROR, number of channels (%u) must be 1 or 2 for --replay-gain\n", e->inbasefilename, channels);
return false;
}
- if(!FLAC__replaygain_is_valid_sample_frequency(sample_rate)) {
+ if(!grabbag__replaygain_is_valid_sample_frequency(sample_rate)) {
fprintf(stderr, "%s: ERROR, invalid sample rate (%u) for --replay-gain\n", e->inbasefilename, sample_rate);
return false;
}
if(options.is_first_file) {
- if(!FLAC__replaygain_init(sample_rate)) {
+ if(!grabbag__replaygain_init(sample_rate)) {
fprintf(stderr, "%s: ERROR initializing ReplayGain stage\n", e->inbasefilename);
return false;
}
FLAC__bool EncoderSession_process(EncoderSession *e, const FLAC__int32 * const buffer[], unsigned samples)
{
if(e->replay_gain) {
- if(!FLAC__replaygain_analyze(buffer, e->channels==2, e->bits_per_sample, samples))
+ if(!grabbag__replaygain_analyze(buffer, e->channels==2, e->bits_per_sample, samples))
fprintf(stderr, "%s: WARNING, error while calculating ReplayGain\n", e->inbasefilename);
}
}
}
-FLAC__bool convert_to_seek_table_template(char *requested_seek_points, int num_requested_seek_points, EncoderSession *e)
+FLAC__bool convert_to_seek_table_template(const char *requested_seek_points, int num_requested_seek_points, EncoderSession *e)
{
- unsigned i;
- char *pt = requested_seek_points, *q;
- FLAC__bool only_placeholders = false;
- FLAC__bool needs_warning = false;
+ FLAC__bool only_placeholders;
+ FLAC__bool has_real_points;
if(num_requested_seek_points == 0)
return true;
- if(num_requested_seek_points < 0) {
- strcpy(requested_seek_points, "100x<");
- num_requested_seek_points = 1;
- }
+ if(num_requested_seek_points < 0)
+ requested_seek_points = "100x;";
- if(e->is_stdout) {
+ if(e->is_stdout)
only_placeholders = true;
- }
-#ifdef HAS_OGG
- else if(e->is_ogg) {
+#ifdef FLAC__HAS_OGG
+ else if(e->use_ogg)
only_placeholders = true;
- }
#endif
+ else
+ only_placeholders = false;
- for(i = 0; i < (unsigned)num_requested_seek_points; i++) {
- q = strchr(pt, '<');
- FLAC__ASSERT(0 != q);
- *q++ = '\0';
-
- if(0 == strcmp(pt, "X")) { /* -S X */
- if(!FLAC__metadata_object_seektable_template_append_placeholders(e->seek_table_template, 1))
- return false;
- }
- else if(!only_placeholders) {
- if(pt[strlen(pt)-1] == 'x') { /* -S #x */
- if(e->total_samples_to_encode > 0) { /* we can only do these if we know the number of samples to encode up front */
- if(!FLAC__metadata_object_seektable_template_append_spaced_points(e->seek_table_template, atoi(pt), e->total_samples_to_encode))
- return false;
- }
- }
- else { /* -S # */
- FLAC__uint64 n = (unsigned)atoi(pt);
- if(!FLAC__metadata_object_seektable_template_append_point(e->seek_table_template, n))
- return false;
- }
- }
- else
- needs_warning = true;
-
- pt = q;
- }
-
- if(!FLAC__metadata_object_seektable_template_sort(e->seek_table_template, /*compact=*/true))
+ if(!grabbag__seektable_convert_specification_to_template(requested_seek_points, only_placeholders, e->total_samples_to_encode, e->sample_rate, e->seek_table_template, &has_real_points))
return false;
- if(needs_warning) {
- if(e->is_stdout) {
- fprintf(stderr, "%s: WARNING, cannot write back seektable when encoding to stdout\n", e->inbasefilename);
- }
-#ifdef HAS_OGG
- else if(e->is_ogg) {
- fprintf(stderr, "%s: WARNING, cannot write back seektable when encoding to Ogg\n", e->inbasefilename);
- }
+ if(has_real_points) {
+ if(e->is_stdout)
+ fprintf(stderr, "%s: WARNING, cannot write back seekpoints when encoding to stdout\n", e->inbasefilename);
+#ifdef FLAC__HAS_OGG
+ else if(e->use_ogg)
+ fprintf(stderr, "%s: WARNING, cannot write back seekpoints when encoding to Ogg\n", e->inbasefilename);
#endif
- else {
- FLAC__ASSERT(0);
- }
}
return true;
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# 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\r
-# ADD LINK32 ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\ogg_static.lib ..\..\obj\lib\replaygain.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\ogg_static.lib ..\..\obj\lib\grabbag.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /machine:I386\r
\r
!ELSEIF "$(CFG)" == "flac - Win32 Debug"\r
\r
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# 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\r
-# ADD LINK32 ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\ogg_static.lib ..\..\obj\lib\replaygain.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\ogg_static.lib ..\..\obj\lib\grabbag.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
\r
!ENDIF \r
\r
PROGRAM_NAME = metaflac
INCLUDES = -I./include -I$(topdir)/include
-LIBS = -lreplaygain -lFLAC -lgain_analysis -lgetopt -lutf8 -lfile_utils -lm
+LIBS = -lgrabbag -lFLAC -lgain_analysis -lgetopt -lutf8 -lm
OBJS = \
main.o
all: metaflac.exe\r
\r
metaflac.exe: $(OBJS)\r
- link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) replaygain.lib libFLAC.lib gain_analysis.lib getopt.lib utf8.lib file_utils.lib\r
+ link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) grabbag.lib libFLAC.lib gain_analysis.lib getopt.lib utf8.lib\r
\r
clean:\r
-del *.obj *.pch\r
#include "FLAC/assert.h"
#include "FLAC/metadata.h"
-#include "share/replaygain.h"
+#include "share/grabbag.h"
#include "share/utf8.h"
#include <ctype.h>
#include <locale.h>
#endif
/*
- FLAC__share__getopt format struct; note we don't use short options so we just
+ share__getopt format struct; note we don't use short options so we just
set the 'val' field to 0 everywhere to indicate a valid option.
*/
-static struct FLAC__share__option long_options_[] = {
+static struct share__option long_options_[] = {
/* global options */
{ "preserve-modtime", 0, 0, 0 },
{ "with-filename", 0, 0, 0 },
int option_index = 1;
FLAC__bool had_error = false;
- while ((ret = FLAC__share__getopt_long(argc, argv, "", long_options_, &option_index)) != -1) {
+ while ((ret = share__getopt_long(argc, argv, "", long_options_, &option_index)) != -1) {
switch (ret) {
case 0:
- had_error |= !parse_option(option_index, FLAC__share__optarg, options);
+ had_error |= !parse_option(option_index, share__optarg, options);
break;
case '?':
case ':':
}
if(options->prefix_with_filename == 2)
- options->prefix_with_filename = (argc - FLAC__share__optind > 1);
+ options->prefix_with_filename = (argc - share__optind > 1);
- if(FLAC__share__optind >= argc && !options->show_long_help && !options->show_version) {
+ if(share__optind >= argc && !options->show_long_help && !options->show_version) {
fprintf(stderr,"ERROR: you must specify at least one FLAC file;\n");
fprintf(stderr," metaflac cannot be used as a pipe\n");
had_error = true;
}
- options->num_files = argc - FLAC__share__optind;
+ options->num_files = argc - share__optind;
if(options->num_files > 0) {
unsigned i = 0;
if(0 == (options->filenames = malloc(sizeof(char *) * options->num_files)))
die("out of memory allocating space for file names list");
- while(FLAC__share__optind < argc)
- options->filenames[i++] = local_strdup(argv[FLAC__share__optind++]);
+ while(share__optind < argc)
+ options->filenames[i++] = local_strdup(argv[share__optind++]);
}
if(options->args.checks.num_major_ops > 0) {
return false;
}
}
- if(!FLAC__replaygain_is_valid_sample_frequency(sample_rate)) {
+ if(!grabbag__replaygain_is_valid_sample_frequency(sample_rate)) {
fprintf(stderr, "%s: ERROR: sample rate of %u Hz is not supported\n", filenames[i], sample_rate);
return false;
}
}
FLAC__ASSERT(bits_per_sample >= FLAC__MIN_BITS_PER_SAMPLE && bits_per_sample <= FLAC__MAX_BITS_PER_SAMPLE);
- if(!FLAC__replaygain_init(sample_rate))
+ if(!grabbag__replaygain_init(sample_rate))
FLAC__ASSERT(0);
if(
die("out of memory allocating space for title gains/peaks");
for(i = 0; i < num_files; i++) {
- if(0 != (error = FLAC__replaygain_analyze_file(filenames[i], title_gains+i, title_peaks+i))) {
+ if(0 != (error = grabbag__replaygain_analyze_file(filenames[i], title_gains+i, title_peaks+i))) {
fprintf(stderr, "%s: ERROR: during analysis (%s)\n", filenames[i], error);
free(title_gains);
free(title_peaks);
return false;
}
}
- FLAC__replaygain_get_album(&album_gain, &album_peak);
+ grabbag__replaygain_get_album(&album_gain, &album_peak);
for(i = 0; i < num_files; i++) {
- if(0 != (error = FLAC__replaygain_store_to_file(filenames[i], album_gain, album_peak, title_gains[i], title_peaks[i], preserve_modtime))) {
+ if(0 != (error = grabbag__replaygain_store_to_file(filenames[i], album_gain, album_peak, title_gains[i], title_peaks[i], preserve_modtime))) {
fprintf(stderr, "%s: ERROR: writing tags (%s)\n", filenames[i], error);
free(title_gains);
free(title_peaks);
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# 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\r
-# ADD LINK32 ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\replaygain.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\grabbag.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /machine:I386\r
\r
!ELSEIF "$(CFG)" == "metaflac - Win32 Debug"\r
\r
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# 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\r
-# ADD LINK32 ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\replaygain.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\grabbag.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
\r
!ENDIF \r
\r
LIB_NAME = libxmms-flac
INCLUDES = $(shell xmms-config --cflags) -I./include -I$(topdir)/include -I..
-LIBS = $(topdir)/obj/lib/libFLAC.a $(topdir)/obj/lib/libplugin_common.a $(topdir)/obj/lib/libreplaygain.a $(topdir)/obj/lib/libgain_analysis.a $(topdir)/obj/lib/libfile_utils.a $(HOME)/local/lib/libid3.a -lstdc++ -lz
+LIBS = $(topdir)/obj/lib/libFLAC.a $(topdir)/obj/lib/libplugin_common.a $(topdir)/obj/lib/libgrabbag.a $(topdir)/obj/lib/libgain_analysis.a $(HOME)/local/lib/libid3.a -lstdc++ -lz
OBJS = \
charset.o \
#include "FLAC/all.h"
#include "plugin_common/all.h"
-#include "share/replaygain.h"
+#include "share/grabbag.h"
#include "configure.h"
#include "wrap_id3.h"
#include "charset.h"
}
else if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) {
double gain, peak;
- if(FLAC__replaygain_load_from_vorbiscomment(metadata, flac_cfg.output.replaygain.album_mode, &gain, &peak)) {
+ if(grabbag__replaygain_load_from_vorbiscomment(metadata, flac_cfg.output.replaygain.album_mode, &gain, &peak)) {
file_info_.has_replaygain = true;
- file_info_.replay_scale = FLAC__replaygain_compute_scale_factor(peak, gain, (double)flac_cfg.output.replaygain.preamp, /*prevent_clipping=*/!flac_cfg.output.replaygain.hard_limit);
+ file_info_.replay_scale = grabbag__replaygain_compute_scale_factor(peak, gain, (double)flac_cfg.output.replaygain.preamp, /*prevent_clipping=*/!flac_cfg.output.replaygain.hard_limit);
}
}
}
test_libFLAC++.dsp
noinst_PROGRAMS = test_libFLAC++
-test_libFLAC___LDADD = $(top_builddir)/src/libFLAC++/libFLAC++.la $(top_builddir)/src/libFLAC/libFLAC.la -lm
+test_libFLAC___LDADD = \
+ $(top_builddir)/src/share/grabbag/grabbag.la \
+ $(top_builddir)/src/libFLAC++/libFLAC++.la \
+ $(top_builddir)/src/libFLAC/libFLAC.la \
+ -lm
test_libFLAC___SOURCES = \
decoders.cpp \
encoders.cpp \
PROGRAM_NAME = test_libFLAC++
INCLUDES = -I$(topdir)/include
-LIBS = -lFLAC++ -lFLAC -lfile_utils -lm
+LIBS = -lgrabbag -lFLAC++ -lFLAC -lm
OBJS = \
decoders.o \
encoders.o \
all: test_libFLAC++.exe\r
\r
test_libFLAC++.exe: $(C_OBJS) $(CPP_OBJS)\r
- link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(CPP_OBJS) $(C_OBJS) libFLAC++.lib libFLAC.lib file_utils.lib\r
+ link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(CPP_OBJS) $(C_OBJS) grabbag.lib libFLAC++.lib libFLAC.lib\r
\r
clean:\r
-del *.obj *.pch\r
#include "FLAC/assert.h"
#include "FLAC/metadata.h" // for ::FLAC__metadata_object_is_equal()
#include "FLAC++/decoder.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
if(!test_file_decoder())
return false;
- (void) FLAC__file_utils_remove_file(flacfilename_);
+ (void) grabbag__file_remove_file(flacfilename_);
free_metadata_blocks_();
return true;
#include "FLAC/assert.h"
#include "FLAC++/decoder.h"
#include "FLAC++/metadata.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
#include <stdio.h>
#include <stdlib.h> /* for malloc() */
#include <string.h> /* for memcpy()/memset() */
static bool change_stats_(const char *filename, bool read_only)
{
- if(!FLAC__file_utils_change_stats(filename, read_only))
- return die_("during FLAC__file_utils_change_stats()");
+ if(!grabbag__file_change_stats(filename, read_only))
+ return die_("during grabbag__file_change_stats()");
return true;
}
while(our_metadata_.num_blocks > 0)
delete_from_our_metadata_(0);
- if(!FLAC__file_utils_remove_file(filename))
+ if(!grabbag__file_remove_file(filename))
return die_("removing file");
return true;
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# 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\r
-# ADD LINK32 ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
\r
!ELSEIF "$(CFG)" == "test_libFLAC++ - Win32 Debug"\r
\r
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# 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\r
-# ADD LINK32 ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
\r
!ENDIF \r
\r
INCLUDES = -I$(top_srcdir)/src/libFLAC/include
noinst_PROGRAMS = test_libFLAC
-test_libFLAC_LDADD = $(top_builddir)/src/libFLAC/libFLAC.la -lm
+test_libFLAC_LDADD = \
+ $(top_builddir)/src/share/grabbag/grabbag.la \
+ $(top_builddir)/src/libFLAC/libFLAC.la \
+ -lm
test_libFLAC_SOURCES = \
bitbuffer.c \
decoders.c \
PROGRAM_NAME = test_libFLAC
INCLUDES = -I../libFLAC/include -I$(topdir)/include
-LIBS = -lFLAC -lfile_utils -lm
+LIBS = -lgrabbag -lFLAC -lm
OBJS = \
bitbuffer.o \
decoders.o \
all: test_libFLAC.exe\r
\r
test_libFLAC.exe: $(OBJS)\r
- link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) libFLAC.lib file_utils.lib\r
+ link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) file_utils.lib libFLAC.lib\r
\r
clean:\r
-del *.obj *.pch\r
#include "FLAC/file_decoder.h"
#include "FLAC/seekable_stream_decoder.h"
#include "FLAC/stream_decoder.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
if(!test_file_decoder())
return false;
- (void) FLAC__file_utils_remove_file(flacfilename_);
+ (void) grabbag__file_remove_file(flacfilename_);
free_metadata_blocks_();
return true;
#include "FLAC/file_encoder.h"
#include "FLAC/seekable_stream_encoder.h"
#include "FLAC/stream_encoder.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
if(!test_file_encoder())
return false;
- (void) FLAC__file_utils_remove_file(flacfilename_);
+ (void) grabbag__file_remove_file(flacfilename_);
free_metadata_blocks_();
return true;
#include "FLAC/assert.h"
#include "FLAC/file_decoder.h"
#include "FLAC/metadata.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
#include <stdio.h>
#include <stdlib.h> /* for malloc() */
static FLAC__bool change_stats_(const char *filename, FLAC__bool read_only)
{
- if(!FLAC__file_utils_change_stats(filename, read_only))
- return die_("during FLAC__file_utils_change_stats()");
+ if(!grabbag__file_change_stats(filename, read_only))
+ return die_("during grabbag__file_change_stats()");
return true;
}
while(our_metadata_.num_blocks > 0)
delete_from_our_metadata_(0);
- if(!FLAC__file_utils_remove_file(filename))
+ if(!grabbag__file_remove_file(filename))
return die_("removing file");
return true;
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# 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\r
-# ADD LINK32 ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
\r
!ELSEIF "$(CFG)" == "test_libFLAC - Win32 Debug"\r
\r
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# 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\r
-# ADD LINK32 ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
\r
!ENDIF \r
\r
CFLAGS = @CFLAGS@ @OGG_CFLAGS@
noinst_PROGRAMS = test_libOggFLAC++
-test_libOggFLAC___LDADD = $(top_builddir)/src/libOggFLAC++/libOggFLAC++.la $(top_builddir)/src/libOggFLAC/libOggFLAC.la $(top_builddir)/src/libFLAC/libFLAC.la @OGG_LIBS@ -lm
+test_libOggFLAC___LDADD = \
+ $(top_builddir)/src/share/grabbag/grabbag.la \
+ $(top_builddir)/src/libOggFLAC++/libOggFLAC++.la \
+ $(top_builddir)/src/libOggFLAC/libOggFLAC.la \
+ $(top_builddir)/src/libFLAC/libFLAC.la \
+ @OGG_LIBS@ \
+ -lm
test_libOggFLAC___SOURCES = \
decoders.cpp \
encoders.cpp \
PROGRAM_NAME = test_libOggFLAC++
#@@@ TODO: conditionalize ogg lib path and -logg
INCLUDES = -I$(topdir)/include
-LIBS = -lOggFLAC++ -lOggFLAC -lFLAC -L$(HOME)/local/lib -logg -lfile_utils -lm
+LIBS = -lgrabbag -lOggFLAC++ -lOggFLAC -lFLAC -L$(HOME)/local/lib -logg -lm
OBJS = \
decoders.o \
encoders.o \
all: test_libOggFLAC++.exe\r
\r
test_libOggFLAC++.exe: $(C_OBJS) $(CPP_OBJS)\r
- link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(CPP_OBJS) $(C_OBJS) libOggFLAC++.lib libOggFLAC.lib libFLAC.lib ogg_static.lib file_utils.lib\r
+ link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(CPP_OBJS) $(C_OBJS) file_utils.lib libOggFLAC++.lib libOggFLAC.lib libFLAC.lib ogg_static.lib\r
\r
clean:\r
-del *.obj *.pch\r
#include "FLAC/assert.h"
#include "FLAC/metadata.h" // for ::FLAC__metadata_object_is_equal()
#include "OggFLAC++/decoder.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
if(!test_stream_decoder())
return false;
- (void) FLAC__file_utils_remove_file(oggflacfilename_);
+ (void) grabbag__file_remove_file(oggflacfilename_);
free_metadata_blocks_();
return true;
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# 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\r
-# ADD LINK32 ..\..\obj\lib\libOggFLAC++.lib ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libOggFLAC++.lib ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
\r
!ELSEIF "$(CFG)" == "test_libOggFLAC++ - Win32 Debug"\r
\r
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# 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\r
-# ADD LINK32 ..\..\obj\lib\libOggFLAC++.lib ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libOggFLAC++.lib ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
\r
!ENDIF \r
\r
INCLUDES =
noinst_PROGRAMS = test_libOggFLAC
-test_libOggFLAC_LDADD = $(top_builddir)/src/libOggFLAC/libOggFLAC.la $(top_builddir)/src/libFLAC/libFLAC.la @OGG_LIBS@ -lm
+test_libOggFLAC_LDADD = \
+ $(top_builddir)/src/share/grabbag/grabbag.la \
+ $(top_builddir)/src/libOggFLAC/libOggFLAC.la \
+ $(top_builddir)/src/libFLAC/libFLAC.la \
+ @OGG_LIBS@ \
+ -lm
test_libOggFLAC_SOURCES = \
decoders.c \
encoders.c \
PROGRAM_NAME = test_libOggFLAC
#@@@ TODO: conditionalize ogg lib path and -logg
INCLUDES = -I$(topdir)/include
-LIBS = -lOggFLAC -lFLAC -L$(HOME)/local/lib -logg -lfile_utils -lm
+LIBS = -lgrabbag -lOggFLAC -lFLAC -L$(HOME)/local/lib -logg -lm
OBJS = \
decoders.o \
encoders.o \
all: test_libOggFLAC.exe\r
\r
test_libOggFLAC.exe: $(OBJS)\r
- link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) libOggFLAC.lib libFLAC.lib ogg_static.lib file_utils.lib\r
+ link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) file_utils.lib libOggFLAC.lib libFLAC.lib ogg_static.lib\r
\r
clean:\r
-del *.obj *.pch\r
#include "metadata_utils.h"
#include "FLAC/assert.h"
#include "OggFLAC/stream_decoder.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
if(!test_stream_decoder())
return false;
- (void) FLAC__file_utils_remove_file(oggflacfilename_);
+ (void) grabbag__file_remove_file(oggflacfilename_);
free_metadata_blocks_();
return true;
#include "file_utils.h"
#include "FLAC/assert.h"
#include "OggFLAC/stream_encoder.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
if(!test_stream_encoder())
return false;
- (void) FLAC__file_utils_remove_file(oggflacfilename_);
+ (void) grabbag__file_remove_file(oggflacfilename_);
free_metadata_blocks_();
return true;
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# 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\r
-# ADD LINK32 ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
\r
!ELSEIF "$(CFG)" == "test_libOggFLAC - Win32 Debug"\r
\r
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# 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\r
-# ADD LINK32 ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
\r
!ENDIF \r
\r