SBSMS library/effect changes. Apparently resolves bug #170. Incorporated optimizations with minor quality changes. Returned optimization flags to build (introduced in a patch). The audacity SBSMS branch is now a trimmed down version without associated programs. Includes (untested) changes to the windows .vcproj.

This commit is contained in:
clayton.otey@gmail.com 2010-06-07 06:41:32 +00:00
parent e628adb922
commit 299c327a71
65 changed files with 3055 additions and 10326 deletions

View File

@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.10.2 from Makefile.am.
# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006 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.
@ -127,7 +127,6 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAD_LIBS = @MAD_LIBS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
@ -144,24 +143,15 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PORTAUDIO_CFLAGS = @PORTAUDIO_CFLAGS@
PORTAUDIO_LIBS = @PORTAUDIO_LIBS@
RANLIB = @RANLIB@
SBSMS_BIN = @SBSMS_BIN@
SBSMS_PROGS = @SBSMS_PROGS@
SBSMS_CFLAGS = @SBSMS_CFLAGS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHARED_VERSION_INFO = @SHARED_VERSION_INFO@
SHELL = @SHELL@
SHLIB_VERSION_ARG = @SHLIB_VERSION_ARG@
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
SNDFILE_LIBS = @SNDFILE_LIBS@
STRIP = @STRIP@
VERSION = @VERSION@
WX_CFLAGS = @WX_CFLAGS@
WX_CONFIG = @WX_CONFIG@
WX_LIBS = @WX_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
@ -216,7 +206,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = src
@ -273,7 +262,7 @@ clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool config.lt
-rm -f libtool
install-pkgconfigDATA: $(pkgconfig_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
@ -367,8 +356,8 @@ ID: $(HEADERS) $(SOURCES) $(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; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
@ -393,8 +382,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
$(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) \
@ -404,12 +393,13 @@ ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
$(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
@ -480,10 +470,6 @@ dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
@ -510,8 +496,6 @@ distcheck: dist
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
@ -666,8 +650,8 @@ uninstall-am: uninstall-pkgconfigDATA
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \
distclean distclean-generic distclean-libtool distclean-tags \
dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-generic distclean-libtool distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \

4930
lib-src/sbsms/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -52,10 +52,10 @@ CFLAGS="$cflags_save"
CPPFLAGS="$cppflags_save"
CXXFLAGS="$cxxflags_save"
AC_CHECK_FUNCS(malloc calloc free memcpy)
AC_CHECK_FUNCS(malloc calloc free memcpy memmove)
AC_CHECK_LIB([m],floor)
AC_CHECK_FUNCS(floor sqrt log)
AC_CHECK_FUNCS(floor sqrt log exp sin cos)
AC_C99_FUNC_LRINT()
AC_C99_FUNC_LRINTF()
@ -63,88 +63,18 @@ AC_C99_FUNC_LRINTF()
AC_SUBST(SHLIB_VERSION_ARG)
AC_SUBST(SHARED_VERSION_INFO)
SBSMS_EXTRA_OBJ=""
SBSMS_BIN=""
AC_ARG_ENABLE(universal_binary,[ --enable-universal_binary enable universal binary build: (default: disable)],[enable_universal_binary=$enableval],[enable_universal_binary=no])
AC_ARG_ENABLE(static,[ --enable-static enable static build: (default: disable)],[enable_static=$enableval],[enable_static=no])
AC_ARG_ENABLE(multithreaded,[ --enable-multithreaded enable multithreaded build: (default: disable)],[enable_multithreaded=$enableval],[enable_multithreaded=no])
AC_ARG_ENABLE(debug,[ --enable-debug enable debug build: (default: disable)],[enable_debug=$enableval],[enable_debug=no])
AC_ARG_ENABLE(sndfile,[ --enable-sndfile enable sndfile support: (default: disable)],[enable_sndfile=$enableval],[enable_sndfile=no])
SBSMS_CFLAGS="-ffast-math -fstrict-aliasing"
AC_ARG_ENABLE(mp3,[ --enable-mp3 enable mp3 support (default: disable)],[enable_mp3=$enableval],[enable_mp3=no])
AC_ARG_ENABLE(portaudio,[ --enable-portaudio enable portaudio support: (default: disable)],[enable_portaudio=$enableval],[enable_portaudio=no])
AC_ARG_ENABLE(wx,[ --enable-wx enable wxWidgets support (default: disable)],[enable_wx=$enableval],[enable_wx=no])
AC_ARG_ENABLE(programs,[ --enable-programs Build SBSMS programs as well as library (default: enable)],[enable_progs=$enableval],[enable_progs=yes])
if test x$enable_mp3 = xyes; then
enable_sndfile=yes;
AC_CHECK_LIB(mad,mad_stream_init,[mad_libs="-lmad"; SBSMS_EXTRA_OBJ="mp3.lo mp3tech.lo audiobuffer.lo"; use_libmad=yes],[echo "Sorry, you need libmad for mp3 support. Install libmad or ./configure --disable-mp3"; exit -1])
if test x$use_libmad = xyes; then
if test x$MAD_LIBS = x; then
MAD_LIBS=$mad_libs
fi
AC_SUBST(MAD_LIBS)
AC_DEFINE(HAVE_MAD,1,[Define to use libmad])
fi
else
MAD_LIBS=""
fi
AM_CONDITIONAL(ENABLE_MP3, test x$enable_mp3 = xyes)
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.2, ac_cv_sndfile=1, ac_cv_sndfile=0)
if test x$enable_sndfile = xyes; then
# check for presence of libsndfile
if test "$ac_cv_sndfile" = "0"; then
echo "Sorry, you need libsndfile to --enable-sndfile. Install libsndfile or --disable-sndfile"
exit -1;
else
AC_SUBST(SNDFILE_CFLAGS)
AC_SUBST(SNDFILE_LIBS)
AC_DEFINE(HAVE_SNDFILE,1,[Define to use libsndfile])
fi
else
SNDFILE_LIBS=""
fi
AM_CONDITIONAL(ENABLE_SNDFILE, test x$enable_sndfile = xyes)
PKG_CHECK_MODULES(PORTAUDIO, portaudio-2.0 >= 0.0.19, ac_cv_portaudio=1, ac_cv_portaudio=0)
if test x$enable_portaudio = xyes; then
# check for presence of libportaudio
if test "$ac_cv_portaudio" = "0"; then
echo "Sorry, you need libportaudio-2.0 to --enable-portaudio. Install libportaudio or --disable-portaudio"
exit -1;
else
AC_SUBST(PORTAUDIO_CFLAGS)
AC_SUBST(PORTAUDIO_LIBS)
AC_DEFINE(HAVE_PORTAUDIO,1,[Define to use libportaudio])
fi
else
PORTAUDIO_LIBS=""
fi
AM_CONDITIONAL(ENABLE_PORTAUDIO, test x$enable_portaudio = xyes)
# legitimately we can add -g to flags for debug builds, because they won't
# be much use otherwise
if test x$enable_debug = xyes; then
CXXFLAGS="$CXXFLAGS -g"
fi
if test x$enable_static = xyes; then
CXXFLAGS="$CXXFLAGS"
else
case "$target_os" in
if test x$enable_static = xno; then
case "$target_os" in
darwin*)
CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
SBSMS_CFLAGS="$SBSMS_CLFAGS -mdynamic-no-pic"
;;
*)
;;
@ -154,13 +84,11 @@ fi
if test x$enable_universal_binary = xyes; then
case "$target_os" in
darwin*)
CXXFLAGS="$CXXFLAGS -mmacosx-version-min=10.4 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
SBSMS_CFLAGS="$SBSMS_CFLAGS -mmacosx-version-min=10.4 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
;;
*)
;;
esac
else
CXXFLAGS="$CXXFLAGS"
fi
case "$target_os" in
@ -172,77 +100,15 @@ case "$target_os" in
;;
esac
AC_SUBST(SBSMS_BIN)
if test x$enable_wx = xyes; then
wxconfigargs=""
if test x$enable_static = xyes; then
wxconfigargs="$wxconfigargs --static=yes"
else
wxconfigargs="$wxconfigargs --static=no"
fi
if test x$enable_debug = xyes; then
wxconfigargs="$wxconfigargs --debug=yes"
else
wxconfigargs="$wxconfigargs --debug=no"
fi
AC_PATH_PROG(WX_CONFIG, wx-config, no, $PATH:/usr/local/bin )
if [[ "$WX_CONFIG" = "no" ]] ; then
AC_MSG_ERROR("Could not find wx-config: is wxWidgets installed? is wx-config in your path?")
fi
AC_MSG_NOTICE([Checking that the chosen version of wxWidgets is 2.8.x])
wx_version=`${WX_CONFIG} --version`
case "${wx_version}" in
2.8.*)
echo "Great, you're using wxWidgets ${wx_version}!"
;;
*)
wx_list=`${WX_CONFIG} --list`
AC_MSG_ERROR([Unable to locate a suitable configuration of wxWidgets v2.8.x or higher.
The currently available configurations are listed below. If necessary, either
install the package for your distribution or download the latest version of
wxWidgets from http://wxwidgets.org. ${wx_list}])
esac
WX_LIBS="`$WX_CONFIG $wxconfigargs --libs`"
WX_CFLAGS="`$WX_CONFIG $wxconfigargs --cxxflags`"
AC_SUBST(WX_LIBS)
AC_SUBST(WX_CFLAGS)
fi
AM_CONDITIONAL(ENABLE_WX, test x$enable_wx = xyes)
AM_CONDITIONAL(MACOSX, test "$macosx" = "yes")
if test x$enable_progs = xyes; then
# we would like programs, so work out which ones can be built
# sbsms can always be built (doesn't need optional libs)
SBSMS_PROGS="sbsms"
if test x$enable_portaudio = xyes; then
# portaudio available, build sbsmsplay
SBSMS_PROGS="$SBSMS_PROGS sbsmsplay"
if test x$enable_wx = xyes; then
# wx available, build wxsbsmsplayer
SBSMS_PROGS="$SBSMS_PROGS wxsbsmsplayer"
fi
fi
if test x$enable_debug = xyes; then
SBSMS_CFLAGS="$SBSMS_CFLAGS -g"
else
# no progs please
SBSMS_PROGS=""
SBSMS_CFLAGS="$SBSMS_CFLAGS -O3"
fi
AC_SUBST(SBSMS_PROGS)
AC_SUBST(SBSMS_CFLAGS)
if test x$enable_multithreaded = xyes; then
AC_DEFINE(MULTITHREADED,1,[Define to compile multithreaded sbsms])
fi
AM_INIT_AUTOMAKE([])
AM_INIT_AUTOMAKE(libsbsms, "$LIBSBSMS_RELEASE_MAJOR.$LIBSBSMS_RELEASE_MINOR.$LIBSBSMS_RELEASE_BUILD")
dnl Audacity policy: don't enable automatic rebuild of configure et al if
dnl sources change
AM_MAINTAINER_MODE([enabled])
AC_CONFIG_FILES([Makefile src/Makefile libsbsms.spec sbsms.pc])

View File

@ -9,76 +9,72 @@ namespace _sbsms_ {
typedef float real;
typedef real interleaved[2];
typedef interleaved audio;
}
#define SBSMS_WINDOW SBSMS_HANN
extern _sbsms_::real SBSMS_P1;
extern _sbsms_::real SBSMS_Q1;
#define SBSMS_S 4
#define SBSMS_MAX_BANDS 7
#define SBSMS_QUALITIES 3
#define SBSMS_MAX_STRETCH 12
#define SBSMS_MIN_STRETCH 1.0/12.0
extern int SBSMS_BANDS[SBSMS_QUALITIES];
extern int SBSMS_M_MAX[SBSMS_QUALITIES];
extern int SBSMS_FRAME_SIZE[SBSMS_QUALITIES];
extern int SBSMS_MAX_FRAME_SIZE[SBSMS_QUALITIES];
extern int SBSMS_H[SBSMS_QUALITIES][5];
extern _sbsms_::real SBSMS_PAD[SBSMS_QUALITIES][SBSMS_MAX_BANDS];
extern int SBSMS_RES[SBSMS_QUALITIES][SBSMS_MAX_BANDS];
extern int SBSMS_N[SBSMS_QUALITIES][SBSMS_MAX_BANDS];
struct sbsms_quality {
long inframesize;
long maxoutframesize;
real minrate;
real maxrate;
int bands;
int M_MAX;
int H[5];
int N[8];
int S[8];
int res[8];
real pad[8];
real P[8];
real Q[8];
};
extern const sbsms_quality sbsms_quality_standard;
extern const sbsms_quality sbsms_quality_fast;
struct sbsms_resample_frame {
_sbsms_::real ratio0;
_sbsms_::real ratio1;
_sbsms_::audio *in;
real ratio0;
real ratio1;
audio *in;
long size;
};
typedef long (*sbsms_cb)(_sbsms_::audio *buf, long n, void *data);
typedef _sbsms_::real (*sbsms_stretch_cb)(long nProcessed, void *data);
typedef _sbsms_::real (*sbsms_ratio_cb)(long nProcessed, void *data);
typedef long (*sbsms_cb)(audio *buf, long n, void *data);
typedef real (*sbsms_rate_cb)(long nProcessed, void *data);
typedef real (*sbsms_pitch_cb)(long nProcessed, void *data);
typedef long (*sbsms_resample_cb)(void *cb_data, sbsms_resample_frame *frame);
namespace _sbsms_ {
class subband;
class TrackAllocator;
class PeakAllocator;
}
class subband;
class TrackAllocator;
class PeakAllocator;
struct sbsms {
FILE *fp;
sbsms_cb getSamplesCB;
sbsms_stretch_cb getStretchCB;
sbsms_ratio_cb getRatioCB;
_sbsms_::subband *top;
_sbsms_::TrackAllocator *ta;
_sbsms_::PeakAllocator *pa;
sbsms_rate_cb getRateCB;
sbsms_pitch_cb getPitchCB;
subband *top;
TrackAllocator *ta;
PeakAllocator *pa;
long n_prepad, n_postpad, n_prespent, n_processed;
bool bWritingComplete;
int quality, channels;
long bufsize;
long chunksize;
_sbsms_::audio *ina;
sbsms_quality quality;
int channels;
audio *ina;
void *threadData;
};
namespace _sbsms_ {
class SampleBufBase {
public:
SampleBufBase() {};
virtual ~SampleBufBase() {};
virtual long read(_sbsms_::audio *buf, long n)=0;
virtual long read(audio *buf, long n)=0;
virtual void advance(long n)=0;
virtual long n_readable()=0;
};
class grain;
class SampleBuf {
public:
SampleBuf() {};
//SampleBuf() {};
SampleBuf(int N);
SampleBuf(int N, long delay);
void init(int N, long delay);
@ -88,7 +84,7 @@ class SampleBuf {
void grow(long pos);
long write(audio *buf, long n);
long write(grain* g, int h);
virtual long read(_sbsms_::audio *buf, long n);
virtual long read(audio *buf, long n);
virtual void advance(long n);
virtual long n_readable();
audio *getReadBuf();
@ -101,16 +97,12 @@ class SampleBuf {
audio *buf;
};
}
using namespace _sbsms_;
class Resampler {
public:
Resampler(sbsms_resample_cb func, void *data);
Resampler(SampleBuf *in, real ratio);
Resampler(SampleBuf *in, real pitch);
~Resampler();
long read(_sbsms_::audio *audioOut, long frames);
long read(audio *audioOut, long frames);
void writingComplete();
void reset();
void init();
@ -120,11 +112,11 @@ class Resampler {
sbsms_resample_frame frame;
long startAbs;
long midAbs;
_sbsms_::real midAbsf;
real midAbsf;
long endAbs;
long writePosAbs;
bool bInput;
_sbsms_::SampleBuf *out;
SampleBuf *out;
sbsms_resample_cb cb;
void *data;
bool bPull;
@ -134,22 +126,13 @@ class Resampler {
bool bWritingComplete;
};
struct pitcher {
void *sbsmsData;
sbsms *sbsmser;
_sbsms_::real ratio;
Resampler *postResampler;
_sbsms_::audio *buf;
long bufsize;
};
void sbsms_init(int n);
void sbsms_reset(sbsms *sbsmser);
void sbsms_seek(sbsms *sbsmser, long framePos, long samplePos);
sbsms* sbsms_create(sbsms_cb getSamplesCB, sbsms_stretch_cb getStretchCB, sbsms_ratio_cb getRatioCB, int channels, int quality, bool bPreAnalyze, bool bSynthesize);
sbsms* sbsms_create(FILE *fp, sbsms_stretch_cb getStretchCB, sbsms_ratio_cb getRatioCB);
sbsms* sbsms_create(sbsms_cb getSamplesCB, sbsms_rate_cb getRateCB, sbsms_pitch_cb getPitchCB, int channels, sbsms_quality *quality, bool bPreAnalyze, bool bSynthesize);
sbsms* sbsms_create(FILE *fp, sbsms_rate_cb getRateCB, sbsms_pitch_cb getPitchCB);
void sbsms_destroy(sbsms* sbsmser);
long sbsms_read_frame(_sbsms_::audio *out, void *data, sbsms *sbsmer, _sbsms_::real *ratio0, _sbsms_::real *ratio1);
long sbsms_read_frame(audio *out, void *data, sbsms *sbsmer, real *pitch0, real *pitch1);
long sbsms_write_frame(FILE *fp, void *data, sbsms *sbsmser);
long sbsms_samples_processed(sbsms *sbsmser);
long sbsms_pre_analyze(sbsms_cb getSamplesCB, void *data, sbsms *sbsmser);
@ -167,27 +150,23 @@ FILE *sbsms_open_read(const char *fileName);
long sbsms_get_samples_to_process(FILE *fp);
long sbsms_get_frames_to_process(FILE *fp);
long sbsms_get_channels(FILE *fp);
long sbsms_get_quality(FILE *fp);
void sbsms_get_quality(FILE *fp, sbsms_quality *quality);
void sbsms_seek_start_data(FILE *fp);
pitcher *pitch_create(sbsms *sbsmser, void *sbsmsData, _sbsms_::real ratio);
void pitch_reset(pitcher *pitch);
void pitch_destroy(pitcher *pitch);
long pitch_process(_sbsms_::audio *out, long n, pitcher *pitch);
long pitch_get_samples_queued(pitcher *pitch);
struct sbsmsInfo {
float stretch0, stretch1;
float ratio0, ratio1;
real rate0, rate1;
real pitch0, pitch1;
long samplesToProcess;
long samplesToGenerate;
Resampler *rs;
};
real stretchCBLinear(long nProcessed, void *userData);
real stretchCBConstant(long nProcessed, void *userData);
real ratioCBLinear(long nProcessed, void *userData);
real ratioCBConstant(long nProcessed, void *userData);
long getLinearOutputSamples(sbsmsInfo *si);
real rateCBLinear(long nProcessed, void *userData);
real rateCBConstant(long nProcessed, void *userData);
real pitchCBLinear(long nProcessed, void *userData);
real pitchCBConstant(long nProcessed, void *userData);
}
#endif

View File

@ -1,48 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>SBSMS</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>sbsms</string>
</array>
</dict>
</array>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleIconFile</key>
<string>sbsms.icns</string>
<key>CFBundleIdentifier</key>
<string>net.sourceforge.sbsms</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>wxsbsmsplayer</string>
<key>CFBundleName</key>
<string>SBSMS</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>sbsms</string>
<key>CFBundleVersion</key>
<string>1.6.0</string>
<key>CFBundleShortVersionString</key>
<string>1.6.0</string>
<key>CFBundleGetInfoString</key>
<string>SBSMS version 1.6.0</string>
<key>CFBundleLongVersionString</key>
<string>Version 1.6.0</string>
<key>NSHumanReadableCopyright</key>
<string>Audacity version 1.3.4</string>
<key>LSRequiresCarbon</key>
<true/>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>

Binary file not shown.

View File

@ -1,197 +0,0 @@
/* XPM */
static char *Pause_xpm[] = {
/* columns rows colors chars-per-pixel */
"28 25 166 2",
" c black",
". c #010101",
"X c gray3",
"o c #090909",
"O c #222222",
"+ c #232323",
"@ c #252525",
"# c gray15",
"$ c gray16",
"% c #2A2A2A",
"& c gray17",
"* c #2C2C2C",
"= c #2D2D2D",
"- c gray18",
"; c #484848",
": c gray29",
"> c #626262",
", c gray40",
"< c #6C6B6C",
"1 c #727272",
"2 c gray45",
"3 c #7C7C7C",
"4 c gray49",
"5 c #7E7E7E",
"6 c gray53",
"7 c #8E8E8E",
"8 c #909090",
"9 c #939393",
"0 c #949394",
"q c gray58",
"w c #959595",
"e c #979797",
"r c #999799",
"t c #9A999A",
"y c #9B9B9B",
"u c gray62",
"i c gray63",
"p c #A2A2A2",
"a c #A7A7A7",
"s c #A8A7A8",
"d c gray66",
"f c #A9A9A9",
"g c #AAAAAA",
"h c #ACABAB",
"j c #ACACAC",
"k c gray68",
"l c #AEAEAE",
"z c #B2B2B2",
"x c #C1C1C1",
"c c #C2C2C3",
"v c #C5C5C5",
"b c #C6C6C6",
"n c #C7C6C7",
"m c gray78",
"M c #C8C9C8",
"N c #C9C8C9",
"B c gray79",
"V c #CACACA",
"C c #CBCCCC",
"Z c #CCCBCC",
"A c gray80",
"S c gray81",
"D c #D0CFD0",
"F c #D0D0D0",
"G c #D1D0D1",
"H c #D2D2D2",
"J c #D2D2D3",
"K c #D3D2D2",
"L c #D3D2D3",
"P c LightGray",
"I c #D4D3D4",
"U c gray83",
"Y c #D5D5D5",
"T c #D5D5D6",
"R c gray84",
"E c #D6D7D6",
"W c #D7D6D7",
"Q c #D7D7D7",
"! c #D8D8D8",
"~ c gray85",
"^ c #DADADA",
"/ c #DADBDB",
"( c #DBDBDA",
") c gray86",
"_ c gainsboro",
"` c #DDDDDC",
"' c #DDDDDD",
"] c #DEDDDE",
"[ c #DEDEDD",
"{ c gray87",
"} c #DFDFDF",
"| c #DFDFE0",
" . c #DFE0E0",
".. c gray88",
"X. c #E0E0E1",
"o. c #E1E1E1",
"O. c #E2E1E1",
"+. c #E2E2E2",
"@. c #E3E2E3",
"#. c gray89",
"$. c #E3E3E4",
"%. c #E3E4E4",
"&. c #E4E3E3",
"*. c #E4E3E4",
"=. c #E4E4E3",
"-. c #E4E4E4",
";. c gray90",
":. c #E5E6E6",
">. c #E6E6E5",
",. c #E6E6E6",
"<. c #E6E6E7",
"1. c #E6E7E6",
"2. c #E6E7E7",
"3. c #E7E6E6",
"4. c #E7E7E6",
"5. c #E7E7E7",
"6. c #E7E7E8",
"7. c gray91",
"8. c #E9E9E9",
"9. c #E9E9EA",
"0. c #E9EAE9",
"q. c #E9EAEA",
"w. c #EAE9E9",
"e. c #EAE9EA",
"r. c #EAEAE9",
"t. c #EAEAEA",
"y. c gray92",
"u. c #EBEBEC",
"i. c #EBECEB",
"p. c #EBECEC",
"a. c #ECEBEB",
"s. c #ECEBEC",
"d. c #ECECEB",
"f. c #ECECEC",
"g. c #ECECED",
"h. c #ECEDEC",
"j. c gray93",
"k. c #EDEDEE",
"l. c #EEEEEE",
"z. c #EEEEEF",
"x. c #EEEFEE",
"c. c #EEEFEF",
"v. c #EFEEEE",
"b. c #EFEEEF",
"n. c #EFEFEE",
"m. c #EFEFEF",
"M. c #EFEFF0",
"N. c gray94",
"B. c #F0F0F1",
"V. c #F0F1F0",
"C. c #F0F1F1",
"Z. c #F1F0F0",
"A. c #F1F0F1",
"S. c #F1F1F0",
"D. c #F1F1F1",
"F. c gray95",
"G. c #F3F3F3",
"H. c #F4F4F4",
"J. c gray96",
"K. c #F6F6F6",
"L. c gray97",
"P. c #F8F8F8",
"I. c #F9F8F8",
"U. c #F9F9F9",
"Y. c gray100",
"T. c None",
/* pixels */
"T.T.6 r e 9 9 0 0 0 9 9 9 9 0 0 9 9 0 0 0 0 9 r r 6 T.T.",
"T.r 3 < , , , , , , , , , , , , , , , , , , , , < 3 r T.",
"e 3 d U y.y.y.y.y.y.y.y.y.7.y.y.y.4.y.y.y.y.y.y.U d 3 e ",
"e d y.y.y.y.y.d.a.y.y.y.y.y.y.y.y.y.y.y.a.y.y.y.y.a.u e ",
"2 U d.a.d.k.d.d.a.y.a.k.a.y.u.a.d.d.k.k.a.i.i.d.u.i.c 2 ",
", k.k.d.d.d.k.d.d.k.d.d.a.a.k.a.d.d.d.d.k.d.k.k.k.y.M , ",
", k.k.k.k.k.k.d.k.k.k.d.k.k.k.k.d.k.k.k.k.k.k.k.k._ c , ",
", k.k.n.k.k.k.k.k.k.>.% + Q k.; + z k.4.k.k.k.k.>.S b , ",
", m.m.m.m.m.m.m.n.n.>. U m.# d S.m.m.m.m.m.~ M M , ",
", m.S.m.m.S.S.S.S.S.>.o U S.= d S.S.S.m.m._ Z Z Z , ",
", F.F.S.S.S.S.S.S.S.<.o U S.= d S.S.S.u._ D S S S , ",
", F.F.F.F.F.G.G.S.F.<.o W F.= s A.y.| W I J P D K , ",
", F.H.F.G.G.G.G.G.G.y.o D m.* i _ W U Q Q Q U U ~ , ",
", H.H.J.G.G.L.G.y.$.D X N | % y _ _ } | _ ~ _ _ ~ , ",
", J.J.J.L.G.k.y.| } U X m | % u | o.>.>.=.| } | _ , ",
", J.J.J.G.k.=.| | | E X M #.* i 7.>.>.>.4.| | | | , ",
", U.J.P.m.#.#.#.o.o.^ M $.# i <.<.2.7.>.o.o.$.$., ",
", U.P.S.<.<.2.2.<.>.| $ + D <.; O l <.>.7.>.2.<.>.>.5., ",
", U.J.u.y.y.y.y.y.y.y.u.u.y.7.u.y.y.7.u.>.y.u.u.y.y.y., ",
", U.F.u.i.u.u.i.a.a.u.a.a.k.a.a.y.a.a.a.k.k.y.k.i.k.k., ",
"2 | S.k.k.c.c.k.m.m.k.k.k.k.m.m.m.m.m.S.k.k.k.A.m.A.~ 2 ",
"e l S.S.n.S.S.S.S.S.A.A.S.A.S.A.m.S.m.S.S.A.m.S.S.S.d r ",
"9 6 d _ F.F.S.F.F.F.F.F.F.F.F.F.F.F.F.F.F.F.S.S.~ d 6 9 ",
"T.q 9 2 , , , , , , , , , , , , , , , , , , , , 2 9 0 T.",
"T.T.> 7 9 e c M M M M V M V M V M M V M V M n y 7 > T.T."
};

View File

@ -1,288 +0,0 @@
/* XPM */
static char *PauseDown_xpm[] = {
/* columns rows colors chars-per-pixel */
"28 25 257 2",
" c black",
". c #000101",
"X c #010101",
"o c #040708",
"O c #060708",
"+ c #171C23",
"@ c #141E24",
"# c #191F26",
"$ c #142027",
"% c #17232B",
"& c #15222C",
"* c #16232D",
"= c #17242D",
"- c #1B2229",
"; c #1E252C",
": c #1E252D",
"> c #1E262D",
", c #1F272D",
"< c #293E4B",
"1 c #2F3B48",
"2 c #626262",
"3 c gray40",
"4 c #6C6B6C",
"5 c #727272",
"6 c gray45",
"7 c #73777D",
"8 c #74787E",
"9 c #7C7C7C",
"0 c #537FA4",
"q c #5180A6",
"w c #5585A7",
"e c #5686A7",
"r c #7E8588",
"t c #6C87A5",
"y c #6F8AA7",
"u c #6E8CA8",
"i c #6195B5",
"p c #7085A4",
"a c #708AA7",
"s c #728CA8",
"d c #7B8CA6",
"f c #7C8DA6",
"g c #728EB0",
"h c #7BA0B0",
"j c #7CA1B0",
"k c #518DDB",
"l c #5592DD",
"z c #5997DF",
"x c #5D93DC",
"c c #5D9CE1",
"v c #6B93CB",
"b c #659CE0",
"n c #65A0CF",
"m c #69A5D1",
"M c #6DAAD4",
"N c #70ADD4",
"B c #76B6DB",
"V c #62A2E3",
"C c #66A7E5",
"Z c #67A7E5",
"A c #66A8E5",
"S c #67A8E5",
"D c #67A8E6",
"F c #6BADE7",
"G c #6BAEE7",
"H c #6CADE7",
"J c #6CAEE7",
"K c #74A8E3",
"L c #7BA8E3",
"P c #7BAFE6",
"I c #72B2E1",
"U c #76B0E7",
"Y c #74B7E3",
"T c #72B3E9",
"R c #71B4EA",
"E c #71B5EA",
"W c #72B4EA",
"Q c #74B0E8",
"! c #74B1E8",
"~ c #76B3E8",
"^ c #74B8EB",
"/ c #75B8EB",
"( c #77B9EB",
") c #74B8EC",
"_ c #76BAEC",
"` c #76BBEC",
"' c #77BBED",
"] c #7CB1E8",
"[ c #79BBE5",
"{ c #79BDED",
"} c #79BDEE",
"| c #79BEEE",
" . c #7ABFEE",
".. c #7BBFEF",
"X. c #7CBCEC",
"o. c #7CBCED",
"O. c #7AC0EE",
"+. c #7BC0EE",
"@. c #7BC0EF",
"#. c #7FC1E9",
"$. c #7CC1EE",
"%. c #7DC1EF",
"&. c #7EC4F0",
"*. c #7EC4F1",
"=. c #7FC4F0",
"-. c #7FC4F1",
";. c #7FC5F0",
":. c gray53",
">. c #8E8E8E",
",. c #909090",
"<. c #939393",
"1. c #949394",
"2. c gray58",
"3. c #959595",
"4. c #979797",
"5. c #999799",
"6. c #9A999A",
"7. c #87A4B0",
"8. c gray67",
"9. c #B2B2B2",
"0. c #88A5D1",
"q. c #89AAD0",
"w. c #8BA9D2",
"e. c #89ABD4",
"r. c #8CAED2",
"t. c #8EAFD3",
"y. c #90B3D3",
"u. c #90B5D6",
"i. c #81B5E1",
"p. c #8FB2E6",
"a. c #8EB6E8",
"s. c #88BAEB",
"d. c #8EBEEC",
"f. c #91B3E6",
"g. c #93B7E2",
"h. c #90B5E7",
"j. c #91B4E6",
"k. c #92B6E7",
"l. c #92B6E8",
"z. c #94B8E0",
"x. c #96BAE1",
"c. c #94B8E8",
"v. c #95B8E8",
"b. c #96BBE9",
"n. c #97BBE9",
"m. c #98BDE2",
"M. c #98BDEB",
"N. c #99BDEB",
"B. c #98BEEA",
"V. c #98BEEB",
"C. c #99BEEA",
"Z. c #99BEEB",
"A. c #99BFEB",
"S. c #87C4DF",
"D. c #8BC4EF",
"F. c #8BC9E2",
"G. c #82C3F0",
"H. c #80C5F0",
"J. c #80C7F2",
"K. c #81C8F2",
"L. c #82C9F2",
"P. c #82C9F3",
"I. c #83C8F2",
"U. c #83C9F2",
"Y. c #83C9F3",
"T. c #83CAF2",
"R. c #84C9F2",
"E. c #84C9F3",
"W. c #85CBF2",
"Q. c #84CCF4",
"!. c #86CDF4",
"~. c #86CEF4",
"^. c #87CEF4",
"/. c #87CEF5",
"(. c #87CFF5",
"). c #87CFF6",
"_. c #88CEF5",
"`. c #88CFF4",
"'. c #88CFF5",
"]. c #89CFF5",
"[. c #89D0F4",
"{. c #89D2F6",
"}. c #8AD2F6",
"|. c #8AD3F6",
" X c #8BD2F6",
".X c #8BD2F7",
"XX c #8BD3F6",
"oX c #8FD1F6",
"OX c #8DD6F7",
"+X c #8DD7F7",
"@X c #8ED6F7",
"#X c #8DD6F8",
"$X c #8ED6F8",
"%X c #8FD9F9",
"&X c #8FDAF9",
"*X c #92C5EE",
"=X c #95C3ED",
"-X c #97C1EC",
";X c #9AC0E4",
":X c #9CC1E5",
">X c #9BC1EB",
",X c #9BC1EC",
"<X c #9CC3ED",
"1X c #9DC3ED",
"2X c #9CC4ED",
"3X c #9EC4EC",
"4X c #9EC4ED",
"5X c #9FC5ED",
"6X c #9FC5EE",
"7X c #9FC7EE",
"8X c #99CDF2",
"9X c #9FCEF3",
"0X c #90D7F8",
"qX c #90D9F9",
"wX c #91D9F8",
"eX c #91D9F9",
"rX c #90DAF9",
"tX c #91DAF9",
"yX c #92DCFA",
"uX c #93DCFA",
"iX c #99D0F3",
"pX c #9CDAF7",
"aX c #A0C6EE",
"sX c #A0C7EE",
"dX c #A1C7EE",
"fX c #A5CEE2",
"gX c #A1C8EE",
"hX c #A2C9EF",
"jX c #A3CBEF",
"kX c #A4CAEF",
"lX c #A4CBEF",
"zX c #A2CCF1",
"xX c #A4CBF0",
"cX c #A5CEF1",
"vX c #A6CDF0",
"bX c #A6CEF1",
"nX c #A7CEF1",
"mX c #A0D6F6",
"MX c #A9D1F2",
"NX c #AAD1F2",
"BX c #ACD5F4",
"VX c #ADD5F4",
"CX c #ACD6F4",
"ZX c #ABDDF7",
"AX c #AFD8F5",
"SX c #AFD9F5",
"DX c #B2DCF6",
"FX c #B2DCF7",
"GX c #B4DFF8",
"HX c #B5DFF8",
"JX c #B6E2F8",
"KX c #B9E4FA",
"LX c #C6C6C6",
"PX c #C8C8C8",
"IX c gray79",
"UX c gray100",
"YX c None",
/* pixels */
"YXYX:.5.6.3.<.<.<.<.1.1.1.1.1.1.2.2.1.1.1.1.1.6.5.:.YXYX",
"YX5.9 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 9 5.YX",
"3.8 d 0.p.p.p.p.f.f.p.p.p.p.p.p.p.p.p.p.p.p.p.p.0.d 7 3.",
"3.f j.j.j.p.j.j.f.f.f.l.j.j.j.p.j.j.j.j.j.j.j.j.j.j.p 3.",
"6 w.l.l.l.j.l.l.c.j.c.j.l.l.j.l.j.c.l.j.j.l.l.l.l.l.v 6 ",
"3 v.v.v.v.v.v.v.c.c.c.v.v.v.v.v.v.v.c.c.v.c.v.v.c.l.x 3 ",
"3 n.n.v.n.n.n.n.n.n.n.n.n.n.n.n.n.n.n.v.n.n.v.n.n.L k 3 ",
"3 A.A.A.>XV.V.V.-Xn.g.- @ e.n.1 @ g V.>Xn.>XV.V.a.b l 3 ",
"3 A.4XA.-X>X4X>X>X-Xm.X X w.-X# X t >X>X>X>X>XV.K z z 3 ",
"3 4X4XaX4X4X4X5X3XaXu.O X t.4X: X y 4X>X5X5X5XP c c c 3 ",
"3 aXdXdXaXaXgXaXaXaXm.O X t.aX: X y 5X5X5X-X] V V V V 3 ",
"3 lXlXlXlXlXlXgXgXaX;XO X y.xX: X s 7X5Xd.Q C C C C C 3 ",
"3 nXnXxXxXMXxXnXjXjX;XO X u.mX, X y *Xs.Q H G G G H H 3 ",
"3 NXMXNXMXMXMXNXzX*Xi.o X v E & X 0 Q Q T E E E E E E 3 ",
"3 BXBXBXBXBX9XD.X.X.I o X m ` & X 0 ) ) ( ( ' ( ' ( ( 3 ",
"3 AXAXDXAX8XG.....O.Y o X M O.= X w ' } ( ....O.O.O...3 ",
"3 FXFXFX8X%.;.%.&.&.[ X X N %.& X e O.%.%.T.%.T.&.G.;.3 ",
"3 HXHXmXT.T.T.Q.T.Y.X.% @ B E.< @ i T.E.E.^.T.T.E.E.Y.3 ",
"3 JXZXoX|.Q.(.Q.Q.|.`.`.Q.`.`.Q.`.Q.|.(.(.(.(.Q.Q.Q.`.3 ",
"3 KXpX|.|.XXXXXX(.oX|.oXXXXXoX|.|.oX|.oXXXXXXXXX.X.X.X3 ",
"6 fX$XOXOXOXOXOXOX$X$X$X0X0X0X$X$X$XOXOXOXOXOXOXOXOXF.6 ",
"5.7.&X%X%X%X&X&X&X&X&X$X&X&XwX&XuX$X&X%X&X&X&XuX&X&Xh <.",
"<.r h F.uXuXuXuXuXuXuX&XuXuX&XuXuXuXuXuXuXuXuXuXF.h r <.",
"YX3.,.5 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 5 ,.<.YX",
"YXYX2 8.LXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIX9.<.>.2 YXYX"
};

View File

@ -1,192 +0,0 @@
/* XPM */
static char *Play_xpm[] = {
/* columns rows colors chars-per-pixel */
"28 25 161 2",
" c black",
". c #010101",
"X c #040404",
"o c gray2",
"O c #070707",
"+ c gray3",
"@ c #131413",
"# c #1B1B1B",
"$ c gray11",
"% c #1D1D1D",
"& c #1F201F",
"* c #626262",
"= c gray40",
"- c #6C6B6C",
"; c #727272",
": c gray45",
"> c gray46",
", c #7C7C7C",
"< c gray49",
"1 c #7E7E7E",
"2 c gray50",
"3 c #818181",
"4 c gray51",
"5 c gray53",
"6 c #8E8E8E",
"7 c #909090",
"8 c #939393",
"9 c #949394",
"0 c gray58",
"q c #959595",
"w c #979797",
"e c #999799",
"r c #9A999A",
"t c gray63",
"y c gray66",
"u c #A9A9A9",
"i c #ACABAB",
"p c #ACACAC",
"a c #AEAEAE",
"s c #B2B2B2",
"d c gray71",
"f c #B6B6B6",
"g c #B7B7B7",
"h c #B9B9B9",
"j c gray73",
"k c #C1C1C1",
"l c gray76",
"z c #C2C2C3",
"x c #C3C3C3",
"c c #C6C6C6",
"v c gray78",
"b c #C8C8C8",
"n c #C8C9C8",
"m c #C9C8C9",
"M c gray79",
"N c #CACACA",
"B c #CBCCCC",
"V c #CCCBCC",
"C c gray80",
"Z c gray81",
"A c #D0CFD0",
"S c #D2D2D2",
"D c #D2D2D3",
"F c #D3D2D2",
"G c #D3D2D3",
"H c LightGray",
"J c gray83",
"K c #D5D5D6",
"L c gray84",
"P c #D7D6D7",
"I c #D7D7D7",
"U c #D8D8D8",
"Y c #DADADA",
"T c #DADBDB",
"R c #DBDBDA",
"E c gray86",
"W c gainsboro",
"Q c #DDDDDC",
"! c #DDDDDD",
"~ c #DEDDDE",
"^ c #DEDEDD",
"/ c gray87",
"( c #DFDFDF",
") c #DFDFE0",
"_ c #DFE0E0",
"` c gray88",
"' c #E0E0E1",
"] c #E1E1E1",
"[ c #E1E2E1",
"{ c #E2E1E1",
"} c #E2E2E2",
"| c #E3E2E3",
" . c gray89",
".. c #E3E3E4",
"X. c #E3E4E3",
"o. c #E3E4E4",
"O. c #E4E3E3",
"+. c #E4E3E4",
"@. c #E4E4E3",
"#. c #E4E4E4",
"$. c gray90",
"%. c #E5E6E6",
"&. c #E6E6E5",
"*. c #E6E6E6",
"=. c #E6E6E7",
"-. c #E6E7E6",
";. c #E6E7E7",
":. c #E7E6E6",
">. c #E7E7E6",
",. c #E7E7E7",
"<. c #E7E7E8",
"1. c gray91",
"2. c #E9E9E9",
"3. c #E9E9EA",
"4. c #E9EAE9",
"5. c #E9EAEA",
"6. c #EAE9E9",
"7. c #EAE9EA",
"8. c #EAEAE9",
"9. c #EAEAEA",
"0. c gray92",
"q. c #EBEBEC",
"w. c #EBECEB",
"e. c #EBECEC",
"r. c #ECEBEB",
"t. c #ECEBEC",
"y. c #ECECEB",
"u. c #ECECEC",
"i. c #ECECED",
"p. c #ECEDEC",
"a. c gray93",
"s. c #EDEDEE",
"d. c #EEEDEE",
"f. c #EEEEEE",
"g. c #EEEEEF",
"h. c #EEEFEE",
"j. c #EEEFEF",
"k. c #EFEEEE",
"l. c #EFEEEF",
"z. c #EFEFEE",
"x. c #EFEFEF",
"c. c #EFEFF0",
"v. c gray94",
"b. c #F0F0F1",
"n. c #F0F1F0",
"m. c #F0F1F1",
"M. c #F1F0F0",
"N. c #F1F0F1",
"B. c #F1F1F0",
"V. c #F1F1F1",
"C. c gray95",
"Z. c #F3F3F3",
"A. c #F4F4F4",
"S. c gray96",
"D. c #F6F6F6",
"F. c gray97",
"G. c #F8F8F8",
"H. c #F9F8F8",
"J. c #F9F9F9",
"K. c gray100",
"L. c None",
/* pixels */
"L.L.5 e w 8 8 9 9 9 8 8 8 8 9 9 8 8 8 9 9 9 9 w w 5 L.L.",
"L.e , - = = = = = = = = = = = = = = = = = = = * - , e L.",
"w , y J 0.0.0.0.0.0.0.0.0.1.0.0.0.1.0.0.0.0.0.0.J y , w ",
"w y 0.0.0.0.0.y.r.0.0.0.0.0.0.0.0.0.0.r.r.0.0.0.0.0.t w ",
": J y.r.y.s.y.y.s.0.r.y.r.0.q.r.y.y.s.s.r.0.r.r.q.w.z : ",
"= s.s.y.y.y.s.y.r.y.s.y.r.r.s.r.y.y.y.y.s.s.y.s.r.0.m = ",
"= s.s.s.s.s.s.y.s.s.s.1.y.s.s.s.y.s.s.s.s.y.s.s.s.! z = ",
"= s.s.z.s.s.s.s.s.s.z.x 4 s.s.s.s.h.s.1.s.s.z.s.0.N v = ",
"= c.c.c.s.c.c.c.z.z.c.z X > c.s.c.c.z.c.z.c.z.s.Y m m = ",
"= B.c.c.B.B.B.B.B.z.B.v X . 2 B.B.c.c.B.B.c.c.! N N N = ",
"= B.B.B.B.B.B.B.B.B.B.v O . . 3 B.Z.B.B.B.r.! Z S Z Z = ",
"= B.Z.Z.B.Z.Z.Z.B.Z.Z.m O . . X 3 s.c.r.( U G G S S F = ",
"= A.Z.Z.Z.Z.Z.Z.Z.Z.Z.m O . . . & P ! J J J U J J J I = ",
"= Z.Z.Z.Z.Z.Z.F.0. .! d O . . # s R R ! ( } ! Y Q E Y = ",
"= Z.D.D.Z.F.c.%.} ! ! h O . # d } ( } . .%.} ! ! ! ! = ",
"= D.D.D.Z.s. .} ! } } h . @ s } | %.%.>.%.%.%.} } } } = ",
"= F.D.F.c.%.} .| | %.d % a . .%.>.%.1.=.1. . .| | | = ",
"= F.D.B.=.%.=.>.%. .%.m h 0.%.%.>.1.=.=.>.>.=.1.%.%.>.= ",
"= J.D.q.1.0.0.0.0.0.0.0.0.0.0.0.1.r.q.q.0.q.q.0.0.0.0.= ",
"= J.Z.s.w.s.w.w.r.0.0.s.r.r.q.q.r.r.r.r.0.r.r.q.y.s.s.= ",
": ) c.s.s.c.h.s.c.s.s.c.s.h.h.h.c.s.c.c.s.c.s.c.s.c.Y : ",
"w a B.B.z.B.B.B.c.c.B.B.B.B.B.c.B.B.c.c.c.c.B.B.B.B.y w ",
"8 5 y ! Z.B.B.Z.Z.Z.B.Z.A.B.Z.Z.B.B.B.Z.Z.Z.B.B.Y i 5 8 ",
"L.0 8 : = = = = = = = = = = = = = = = = = = = = : 6 w L.",
"L.L.* 6 8 w y v m m m m m m n n m m m n n N m w 6 * L.L."
};

View File

@ -1,284 +0,0 @@
/* XPM */
static char *PlayDown_xpm[] = {
/* columns rows colors chars-per-pixel */
"28 25 253 2",
" c black",
". c #010101",
"X c #020304",
"o c #030304",
"O c #030405",
"+ c #040607",
"@ c #050607",
"# c #050608",
"$ c #0B1115",
"% c #0E171D",
"& c #10191E",
"* c #161C21",
"= c #4C5F74",
"- c #54687D",
"; c #626262",
": c gray40",
"> c #6C6B6C",
", c #727272",
"< c gray45",
"1 c #73777D",
"2 c #74787E",
"3 c #7C7C7C",
"4 c #536880",
"5 c #566A80",
"6 c #576C81",
"7 c #5E91BB",
"8 c #5F96BF",
"9 c #7E8588",
"0 c #7F8588",
"q c #6196B8",
"w c #6097BB",
"e c #7085A4",
"r c #7B8CA6",
"t c #7C8DA6",
"y c #7BA0B0",
"u c #7CA1B0",
"i c #518DDB",
"p c #5592DD",
"a c #5997DF",
"s c #5D93DC",
"d c #5D9CE1",
"f c #629AC4",
"g c #669AC2",
"h c #669DC1",
"j c #669EC5",
"k c #6B93CB",
"l c #7D9CC0",
"z c #7E9DC0",
"x c #659CE0",
"c c #69A2C3",
"v c #73B0D4",
"b c #62A2E3",
"n c #66A7E5",
"m c #67A7E5",
"M c #66A8E5",
"N c #67A8E5",
"B c #67A8E6",
"V c #6BADE7",
"C c #6BAEE7",
"Z c #6CADE7",
"A c #6CAEE7",
"S c #74A8E3",
"D c #7BA8E3",
"F c #7BAFE6",
"G c #76B0E7",
"H c #72B3E9",
"J c #71B4EA",
"K c #71B5EA",
"L c #72B4EA",
"P c #73B6EB",
"I c #74B0E8",
"U c #74B1E8",
"Y c #76B3E8",
"T c #76B4E9",
"R c #74B8EB",
"E c #75B8EB",
"W c #77B9EB",
"Q c #74B8EC",
"! c #75B9EC",
"~ c #76BAEC",
"^ c #76BBEC",
"/ c #77BBED",
"( c #7CB1E8",
") c #78BBEC",
"_ c #78BCED",
"` c #79BDED",
"' c #79BDEE",
"] c #79BEEE",
"[ c #7ABFEE",
"{ c #7BBFEE",
"} c #7BBFEF",
"| c #7CBCEC",
" . c #7CBCED",
".. c #7AC0EE",
"X. c #7BC0EE",
"o. c #7BC0EF",
"O. c #7CC1EE",
"+. c #7DC1EF",
"@. c #7EC2EF",
"#. c #7EC4F0",
"$. c #7EC4F1",
"%. c #7FC4F0",
"&. c #7FC4F1",
"*. c #7FC5F0",
"=. c gray53",
"-. c #8E8E8E",
";. c #909090",
":. c #939393",
">. c #949394",
",. c gray58",
"<. c #959595",
"1. c #979797",
"2. c #999799",
"3. c #9A999A",
"4. c #87A4B0",
"5. c gray67",
"6. c #B2B2B2",
"7. c #82A1C3",
"8. c #84A5C5",
"9. c #88A8C6",
"0. c #89A9C7",
"q. c #88A5D1",
"w. c #8BA9D2",
"e. c #87BEEC",
"r. c #8FB2E6",
"t. c #8EB6E8",
"y. c #88BAEB",
"u. c #8EBEEC",
"i. c #91B3E6",
"p. c #90B5E7",
"a. c #91B4E6",
"s. c #93B7E4",
"d. c #92B6E7",
"f. c #92B6E8",
"g. c #93BAE0",
"h. c #94B8E8",
"j. c #95B8E8",
"k. c #96BBE9",
"l. c #97BBE9",
"z. c #98BDEB",
"x. c #99BDEB",
"c. c #98BEEA",
"v. c #98BEEB",
"b. c #99BEEA",
"n. c #99BEEB",
"m. c #99BFEB",
"M. c #87C4DF",
"N. c #8BC4EF",
"B. c #8BC9E2",
"V. c #82C3F0",
"C. c #80C5F0",
"Z. c #81C7F1",
"A. c #80C7F2",
"S. c #81C8F2",
"D. c #83C8F1",
"F. c #82C9F2",
"G. c #82C9F3",
"H. c #83C8F2",
"J. c #83C9F2",
"K. c #83C9F3",
"L. c #83CAF2",
"P. c #83CAF3",
"I. c #84C9F2",
"U. c #84C9F3",
"Y. c #85CBF2",
"T. c #84CCF4",
"R. c #86CDF4",
"E. c #86CEF4",
"W. c #87CEF4",
"Q. c #87CEF5",
"!. c #87CFF5",
"~. c #87CFF6",
"^. c #88CEF5",
"/. c #88CFF4",
"(. c #88CFF5",
"). c #89CFF5",
"_. c #89D0F4",
"`. c #89D2F6",
"'. c #8AD2F6",
"]. c #8AD3F6",
"[. c #8BD2F6",
"{. c #8BD2F7",
"}. c #8BD3F6",
"|. c #8FD1F6",
" X c #8DD6F7",
".X c #8DD7F7",
"XX c #8ED6F7",
"oX c #8DD6F8",
"OX c #8ED6F8",
"+X c #8FD9F9",
"@X c #8FDAF9",
"#X c #92C5EE",
"$X c #95C3ED",
"%X c #97C1EC",
"&X c #9BC1EB",
"*X c #9BC1EC",
"=X c #9CC3ED",
"-X c #9DC3EC",
";X c #9DC3ED",
":X c #9CC4ED",
">X c #9EC4EC",
",X c #9EC4ED",
"<X c #9EC5ED",
"1X c #9FC5ED",
"2X c #9FC5EE",
"3X c #9FC6ED",
"4X c #9FC7EE",
"5X c #99CDF2",
"6X c #9FCEF3",
"7X c #90D7F8",
"8X c #90D9F9",
"9X c #91D9F8",
"0X c #91D9F9",
"qX c #90DAF9",
"wX c #91DAF9",
"eX c #92DCFA",
"rX c #93DCFA",
"tX c #99D0F3",
"yX c #9CDAF7",
"uX c #A0C6EE",
"iX c #A0C7EE",
"pX c #A1C7EE",
"aX c #A5CEE2",
"sX c #A1C8EE",
"dX c #A2C9EF",
"fX c #A3CBEF",
"gX c #A4CAEF",
"hX c #A4CBEF",
"jX c #A2CCF1",
"kX c #A4CBF0",
"lX c #A6CDF0",
"zX c #A6CEF1",
"xX c #A7CEF1",
"cX c #A0D6F6",
"vX c #A9D1F2",
"bX c #AAD1F2",
"nX c #ACD5F4",
"mX c #ADD5F4",
"MX c #ACD6F4",
"NX c #ABDDF7",
"BX c #AFD8F5",
"VX c #AFD9F5",
"CX c #B2DCF6",
"ZX c #B2DCF7",
"AX c #B4DFF8",
"SX c #B5DFF8",
"DX c #B6E2F8",
"FX c #B9E4FA",
"GX c #C6C6C6",
"HX c #C8C8C8",
"JX c gray79",
"KX c gray100",
"LX c None",
/* pixels */
"LXLX=.2.3.<.:.:.:.:.>.>.>.>.>.>.<.>.>.>.>.>.>.3.2.=.LXLX",
"LX2.3 > : : : : : : : : : : : : : : : : : : : : > 3 2.LX",
"<.2 r q.r.r.r.r.i.i.r.r.r.r.r.r.r.r.r.r.r.r.r.r.q.t 1 <.",
"<.t a.a.a.r.a.a.i.i.i.f.a.a.a.r.a.a.a.a.a.a.a.a.a.a.e <.",
"< w.f.f.f.a.f.f.s.f.f.f.f.f.a.f.a.f.a.f.f.f.f.f.f.f.k < ",
": j.j.j.j.j.j.j.j.f.j.j.j.j.j.j.j.s.j.j.j.j.j.j.j.a.s : ",
": l.l.j.l.l.l.l.l.l.j.s.l.l.l.l.j.b.l.v.l.l.l.j.l.D i : ",
": m.m.m.&Xv.v.v.m.%Xm.l - v.%Xl.b.v.v.v.v.v.v.v.t.x p : ",
": *X*X%X*X*X*X%X%X*X-Xy # = m.m.%X*X*X*X*X-X%Xm.S a a : ",
": 1X1X>X>X>X>X>X>X1X*X7.# X - 2X2X>X*X1X*X1X>XF d d d : ",
": 1X1XdXpXpXdX>X1X1X1X8.+ . . 5 >X>X1XuXdX$XF b b b b : ",
": gXgXgXgXxXdXdXdX1XgX0.+ . . X 6 pXuX%Xu.F n m m m m : ",
": xXxXxXxXxXxXxXfXhXhX0.# . . . * g.$Xy.I A A A C A A : ",
": bXbXbXbXbXbXbXjX#Xe.g + . . % 7 T T I L L K K K K L : ",
": nXnXnXnXnX6XN.| | ^ f O . % 8 ~ P P ~ P W ^ ~ ^ ~ ~ : ",
": BXBXBXBX5XV.[ [ } [ j . $ 8 [ [ W [ ] W [ o.[ [ [ [ : ",
": ZXZXZX5XV.$.$.$.$.$.h & q $.V.O.[ O.O.O.V.F.$.V.$.$.: ",
": DXSXyXU.U.F.F.K.K.U.v c F.U.U.F.F.Z.U.Y.^.Q.F.K.A.K.: ",
": DXNX|.Q.Q.E.E.Q.Q.^.^.Q.^.^.^.^.^.^.].Q.Q.Q.Q.Q.Q.~.: ",
": FXyX`.].].].].`.|.`.`.].[.].].].[.[.[.].].].].`.`.`.: ",
"< aX7X XXXXX X X X7X X7X X7X X X7X7X X7XXX X X X XoXB., ",
"2.4.@X@X+X+X@X+X@X@X7X7X@XrX@X@X@X7X@X@X@X@X@X@X+X+Xy <.",
";.=.u B.eXeXeXeXrXrXrX@XrXrXeXeXrXrXrXrXeXeXrXrXB.y =.;.",
"LX,.;., : : : : : : : : : : : : : : : : : : : : , -.>.LX",
"LXLX; 5.GXHXHXJXJXJXJXJXJXJXJXJXJXJXJXJXJXJX6.>.-.; LXLX"
};

View File

@ -1,68 +1,7 @@
AM_CXXFLAGS = -funroll-loops -I../include -fstrict-aliasing $(SNDFILE_CFLAGS) $(PORTAUDIO_CFLAGS) $(WX_CFLAGS)
AM_CXXFLAGS = -I../include @SBSMS_CFLAGS@
libsbsmsincludedir = $(includedir)
libsbsmsinclude_HEADERS = ../include/sbsms.h
lib_LTLIBRARIES = libsbsms.la
libsbsms_la_SOURCES = pitch.cpp peak.cpp sms.cpp track.cpp trackpoint.cpp utils.cpp audio.cpp resample.cpp sbsms.cpp fft.cpp grain.cpp buffer.cpp subband.cpp audio.h buffer.h fft.h utils.h defs.h peak.h trackpoint.h grain.h pitch.h real.h resample.h ../include/sbsms.h sms.h subband.h track.h
libsbsms_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@ @SHLIB_VERSION_ARG@
bin_PROGRAMS = @SBSMS_PROGS@
EXTRA_PROGRAMS = sbsms sbsmsplay wxsbsmsplayer
sbsms_LDADD = libsbsms.la $(SNDFILE_LIBS) $(MAD_LIBS)
sbsms_LDFLAGS = $(os_ldflags)
if ENABLE_PORTAUDIO
sbsmsplay_LDADD = libsbsms.la $(PORTAUDIO_LIBS)
sbsmsplay_LDFLAGS = $(os_ldflags)
sbsmsplay_SOURCES = testplay.cpp play.cpp play.h audiobuffer.cpp audiobuffer.h
endif
if ENABLE_PORTAUDIO
if ENABLE_WX
wxsbsmsplayer_LDADD = libsbsms.la $(PORTAUDIO_LIBS) $(SNDFILE_LIBS) $(MAD_LIBS) $(WX_LIBS)
wxsbsmsplayer_LDFLAGS = $(os_ldflags) $(PORTAUDIO_CFLAGS) $(SNDFILE_CFLAGS)
endif
endif
if ENABLE_SNDFILE
if ENABLE_MP3
sbsms_SOURCES = test.cpp mp3.cpp mp3.h mp3tech.cpp mp3tech.h audiobuffer.cpp audiobuffer.h import.cpp import.h pcm.cpp pcm.h convert.cpp convert.h
else
sbsms_SOURCES = test.cpp import.cpp import.h pcm.cpp pcm.h convert.cpp convert.h
endif
else
sbsms_SOURCES = test.cpp convert.cpp convert.h
endif
if ENABLE_SNDFILE
if ENABLE_MP3
wxsbsmsplayer_SOURCES = wxplayer.cpp wxplayer.h wxplayerframe.cpp wxplayerframe.h wxplayctrl.cpp wxplayctrl.h wxconvertdlg.cpp wxconvertdlg.h play.cpp play.h convert.cpp convert.h mp3.cpp mp3.h mp3tech.cpp mp3tech.h import.cpp import.h pcm.cpp pcm.h audiobuffer.cpp audiobuffer.h
else
wxsbsmsplayer_SOURCES = wxplayer.cpp wxplayer.h wxplayerframe.cpp wxplayerframe.h wxplayctrl.cpp wxplayctrl.h wxconvertdlg.cpp wxconvertdlg.h play.cpp play.h convert.cpp convert.h import.cpp import.h pcm.cpp pcm.h audiobuffer.cpp audiobuffer.h
endif
else
wxsbsmsplayer_SOURCES = wxplayer.cpp wxplayer.h wxplayerframe.cpp wxplayerframe.h wxplayctrl.cpp wxplayctrl.h wxconvertdlg.cpp wxconvertdlg.h play.cpp play.h convert.cpp convert.h audiobuffer.cpp audiobuffer.h
endif
if ENABLE_WX
if ENABLE_PORTAUDIO
if MACOSX
clean: cleanapproot clean-am
cleanapproot:
sudo rm -rf $(top_builddir)/approot
all: $(top_builddir)/approot/Applications/wxsbsmsplayer.app $(top_builddir)/mac/Info.plist $(top_builddir)/mac/sbsms.icns
$(top_builddir)/approot/Applications/wxsbsmsplayer.app: wxsbsmsplayer
sudo strip -u -r wxsbsmsplayer
sudo mkdir -p $(top_builddir)/approot/Applications/wxsbsmsplayer.app/Contents/MacOS
sudo mkdir -p $(top_builddir)/approot/Applications/wxsbsmsplayer.app/Contents/Resources
sudo cp -f wxsbsmsplayer $(top_builddir)/approot/Applications/wxsbsmsplayer.app/Contents/MacOS/wxsbsmsplayer
sudo cp -f $(top_builddir)/mac/Info.plist $(top_builddir)/approot/Applications/wxsbsmsplayer.app/Contents
sudo cp -f $(top_builddir)/mac/sbsms.icns $(top_builddir)/approot/Applications/wxsbsmsplayer.app/Contents/Resources
sudo sh -c "echo sbsms > $(top_builddir)/approot/Applications/wxsbsmsplayer.app/Contents/PkgInfo"
sudo chown -R root:admin $(top_builddir)/approot/Applications
endif
endif
endif
libsbsms_la_SOURCES = peak.cpp sms.cpp track.cpp trackpoint.cpp utils.cpp audio.cpp resample.cpp sbsms.cpp fft.cpp grain.cpp buffer.cpp subband.cpp audio.h buffer.h fft.h utils.h peak.h trackpoint.h grain.h real.h resample.h ../include/sbsms.h sms.h subband.h track.h

View File

@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.10.2 from Makefile.am.
# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006 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.
@ -15,7 +15,6 @@
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@ -35,8 +34,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
EXTRA_PROGRAMS = sbsms$(EXEEXT) sbsmsplay$(EXEEXT) \
wxsbsmsplayer$(EXEEXT)
subdir = src
DIST_COMMON = $(libsbsmsinclude_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in
@ -57,97 +54,15 @@ am__vpath_adj = case $$p in \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
am__installdirs = "$(DESTDIR)$(libdir)" \
"$(DESTDIR)$(libsbsmsincludedir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
libsbsms_la_LIBADD =
am_libsbsms_la_OBJECTS = pitch.lo peak.lo sms.lo track.lo \
trackpoint.lo utils.lo audio.lo resample.lo sbsms.lo fft.lo \
grain.lo buffer.lo subband.lo
am_libsbsms_la_OBJECTS = peak.lo sms.lo track.lo trackpoint.lo \
utils.lo audio.lo resample.lo sbsms.lo fft.lo grain.lo \
buffer.lo subband.lo
libsbsms_la_OBJECTS = $(am_libsbsms_la_OBJECTS)
libsbsms_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(libsbsms_la_LDFLAGS) $(LDFLAGS) -o $@
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am__sbsms_SOURCES_DIST = test.cpp import.cpp import.h pcm.cpp pcm.h \
convert.cpp convert.h mp3.cpp mp3.h mp3tech.cpp mp3tech.h \
audiobuffer.cpp audiobuffer.h
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@am_sbsms_OBJECTS = \
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@ test.$(OBJEXT) \
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@ import.$(OBJEXT) \
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@ pcm.$(OBJEXT) \
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@ convert.$(OBJEXT)
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@am_sbsms_OBJECTS = \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ test.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ mp3.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ mp3tech.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ audiobuffer.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ import.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ pcm.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ convert.$(OBJEXT)
@ENABLE_SNDFILE_FALSE@am_sbsms_OBJECTS = test.$(OBJEXT) \
@ENABLE_SNDFILE_FALSE@ convert.$(OBJEXT)
sbsms_OBJECTS = $(am_sbsms_OBJECTS)
am__DEPENDENCIES_1 =
sbsms_DEPENDENCIES = libsbsms.la $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
sbsms_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(sbsms_LDFLAGS) $(LDFLAGS) -o $@
am__sbsmsplay_SOURCES_DIST = testplay.cpp play.cpp play.h \
audiobuffer.cpp audiobuffer.h
@ENABLE_PORTAUDIO_TRUE@am_sbsmsplay_OBJECTS = testplay.$(OBJEXT) \
@ENABLE_PORTAUDIO_TRUE@ play.$(OBJEXT) audiobuffer.$(OBJEXT)
sbsmsplay_OBJECTS = $(am_sbsmsplay_OBJECTS)
@ENABLE_PORTAUDIO_TRUE@sbsmsplay_DEPENDENCIES = libsbsms.la \
@ENABLE_PORTAUDIO_TRUE@ $(am__DEPENDENCIES_1)
sbsmsplay_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(sbsmsplay_LDFLAGS) $(LDFLAGS) -o $@
am__wxsbsmsplayer_SOURCES_DIST = wxplayer.cpp wxplayer.h \
wxplayerframe.cpp wxplayerframe.h wxplayctrl.cpp wxplayctrl.h \
wxconvertdlg.cpp wxconvertdlg.h play.cpp play.h convert.cpp \
convert.h import.cpp import.h pcm.cpp pcm.h audiobuffer.cpp \
audiobuffer.h mp3.cpp mp3.h mp3tech.cpp mp3tech.h
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@am_wxsbsmsplayer_OBJECTS = \
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@ wxplayer.$(OBJEXT) \
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@ wxplayerframe.$(OBJEXT) \
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@ wxplayctrl.$(OBJEXT) \
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@ wxconvertdlg.$(OBJEXT) \
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@ play.$(OBJEXT) \
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@ convert.$(OBJEXT) \
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@ import.$(OBJEXT) \
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@ pcm.$(OBJEXT) \
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@ audiobuffer.$(OBJEXT)
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@am_wxsbsmsplayer_OBJECTS = \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ wxplayer.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ wxplayerframe.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ wxplayctrl.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ wxconvertdlg.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ play.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ convert.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ mp3.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ mp3tech.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ import.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ pcm.$(OBJEXT) \
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@ audiobuffer.$(OBJEXT)
@ENABLE_SNDFILE_FALSE@am_wxsbsmsplayer_OBJECTS = wxplayer.$(OBJEXT) \
@ENABLE_SNDFILE_FALSE@ wxplayerframe.$(OBJEXT) \
@ENABLE_SNDFILE_FALSE@ wxplayctrl.$(OBJEXT) \
@ENABLE_SNDFILE_FALSE@ wxconvertdlg.$(OBJEXT) play.$(OBJEXT) \
@ENABLE_SNDFILE_FALSE@ convert.$(OBJEXT) audiobuffer.$(OBJEXT)
wxsbsmsplayer_OBJECTS = $(am_wxsbsmsplayer_OBJECTS)
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@wxsbsmsplayer_DEPENDENCIES = \
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@ libsbsms.la \
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@ $(am__DEPENDENCIES_1) \
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@ $(am__DEPENDENCIES_1) \
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@ $(am__DEPENDENCIES_1) \
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@ $(am__DEPENDENCIES_1)
wxsbsmsplayer_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(wxsbsmsplayer_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@ -169,11 +84,8 @@ CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(libsbsms_la_SOURCES) $(sbsms_SOURCES) $(sbsmsplay_SOURCES) \
$(wxsbsmsplayer_SOURCES)
DIST_SOURCES = $(libsbsms_la_SOURCES) $(am__sbsms_SOURCES_DIST) \
$(am__sbsmsplay_SOURCES_DIST) \
$(am__wxsbsmsplayer_SOURCES_DIST)
SOURCES = $(libsbsms_la_SOURCES)
DIST_SOURCES = $(libsbsms_la_SOURCES)
libsbsmsincludeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(libsbsmsinclude_HEADERS)
ETAGS = etags
@ -220,7 +132,6 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAD_LIBS = @MAD_LIBS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
@ -237,24 +148,15 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PORTAUDIO_CFLAGS = @PORTAUDIO_CFLAGS@
PORTAUDIO_LIBS = @PORTAUDIO_LIBS@
RANLIB = @RANLIB@
SBSMS_BIN = @SBSMS_BIN@
SBSMS_PROGS = @SBSMS_PROGS@
SBSMS_CFLAGS = @SBSMS_CFLAGS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHARED_VERSION_INFO = @SHARED_VERSION_INFO@
SHELL = @SHELL@
SHLIB_VERSION_ARG = @SHLIB_VERSION_ARG@
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
SNDFILE_LIBS = @SNDFILE_LIBS@
STRIP = @STRIP@
VERSION = @VERSION@
WX_CFLAGS = @WX_CFLAGS@
WX_CONFIG = @WX_CONFIG@
WX_LIBS = @WX_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
@ -309,29 +211,13 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CXXFLAGS = -funroll-loops -I../include -fstrict-aliasing $(SNDFILE_CFLAGS) $(PORTAUDIO_CFLAGS) $(WX_CFLAGS)
AM_CXXFLAGS = -I../include @SBSMS_CFLAGS@
libsbsmsincludedir = $(includedir)
libsbsmsinclude_HEADERS = ../include/sbsms.h
lib_LTLIBRARIES = libsbsms.la
libsbsms_la_SOURCES = pitch.cpp peak.cpp sms.cpp track.cpp trackpoint.cpp utils.cpp audio.cpp resample.cpp sbsms.cpp fft.cpp grain.cpp buffer.cpp subband.cpp audio.h buffer.h fft.h utils.h defs.h peak.h trackpoint.h grain.h pitch.h real.h resample.h ../include/sbsms.h sms.h subband.h track.h
libsbsms_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@ @SHLIB_VERSION_ARG@
bin_PROGRAMS = @SBSMS_PROGS@
sbsms_LDADD = libsbsms.la $(SNDFILE_LIBS) $(MAD_LIBS)
sbsms_LDFLAGS = $(os_ldflags)
@ENABLE_PORTAUDIO_TRUE@sbsmsplay_LDADD = libsbsms.la $(PORTAUDIO_LIBS)
@ENABLE_PORTAUDIO_TRUE@sbsmsplay_LDFLAGS = $(os_ldflags)
@ENABLE_PORTAUDIO_TRUE@sbsmsplay_SOURCES = testplay.cpp play.cpp play.h audiobuffer.cpp audiobuffer.h
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@wxsbsmsplayer_LDADD = libsbsms.la $(PORTAUDIO_LIBS) $(SNDFILE_LIBS) $(MAD_LIBS) $(WX_LIBS)
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@wxsbsmsplayer_LDFLAGS = $(os_ldflags) $(PORTAUDIO_CFLAGS) $(SNDFILE_CFLAGS)
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@sbsms_SOURCES = test.cpp import.cpp import.h pcm.cpp pcm.h convert.cpp convert.h
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@sbsms_SOURCES = test.cpp mp3.cpp mp3.h mp3tech.cpp mp3tech.h audiobuffer.cpp audiobuffer.h import.cpp import.h pcm.cpp pcm.h convert.cpp convert.h
@ENABLE_SNDFILE_FALSE@sbsms_SOURCES = test.cpp convert.cpp convert.h
@ENABLE_MP3_FALSE@@ENABLE_SNDFILE_TRUE@wxsbsmsplayer_SOURCES = wxplayer.cpp wxplayer.h wxplayerframe.cpp wxplayerframe.h wxplayctrl.cpp wxplayctrl.h wxconvertdlg.cpp wxconvertdlg.h play.cpp play.h convert.cpp convert.h import.cpp import.h pcm.cpp pcm.h audiobuffer.cpp audiobuffer.h
@ENABLE_MP3_TRUE@@ENABLE_SNDFILE_TRUE@wxsbsmsplayer_SOURCES = wxplayer.cpp wxplayer.h wxplayerframe.cpp wxplayerframe.h wxplayctrl.cpp wxplayctrl.h wxconvertdlg.cpp wxconvertdlg.h play.cpp play.h convert.cpp convert.h mp3.cpp mp3.h mp3tech.cpp mp3tech.h import.cpp import.h pcm.cpp pcm.h audiobuffer.cpp audiobuffer.h
@ENABLE_SNDFILE_FALSE@wxsbsmsplayer_SOURCES = wxplayer.cpp wxplayer.h wxplayerframe.cpp wxplayerframe.h wxplayctrl.cpp wxplayctrl.h wxconvertdlg.cpp wxconvertdlg.h play.cpp play.h convert.cpp convert.h audiobuffer.cpp audiobuffer.h
libsbsms_la_SOURCES = peak.cpp sms.cpp track.cpp trackpoint.cpp utils.cpp audio.cpp resample.cpp sbsms.cpp fft.cpp grain.cpp buffer.cpp subband.cpp audio.h buffer.h fft.h utils.h peak.h trackpoint.h grain.h real.h resample.h ../include/sbsms.h sms.h subband.h track.h
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
@ -341,8 +227,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
@ -389,8 +275,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
@ -398,8 +284,8 @@ uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLTLIBRARIES:
@ -411,44 +297,7 @@ clean-libLTLIBRARIES:
rm -f "$${dir}/so_locations"; \
done
libsbsms.la: $(libsbsms_la_OBJECTS) $(libsbsms_la_DEPENDENCIES)
$(libsbsms_la_LINK) -rpath $(libdir) $(libsbsms_la_OBJECTS) $(libsbsms_la_LIBADD) $(LIBS)
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) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --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
sbsms$(EXEEXT): $(sbsms_OBJECTS) $(sbsms_DEPENDENCIES)
@rm -f sbsms$(EXEEXT)
$(sbsms_LINK) $(sbsms_OBJECTS) $(sbsms_LDADD) $(LIBS)
sbsmsplay$(EXEEXT): $(sbsmsplay_OBJECTS) $(sbsmsplay_DEPENDENCIES)
@rm -f sbsmsplay$(EXEEXT)
$(sbsmsplay_LINK) $(sbsmsplay_OBJECTS) $(sbsmsplay_LDADD) $(LIBS)
wxsbsmsplayer$(EXEEXT): $(wxsbsmsplayer_OBJECTS) $(wxsbsmsplayer_DEPENDENCIES)
@rm -f wxsbsmsplayer$(EXEEXT)
$(wxsbsmsplayer_LINK) $(wxsbsmsplayer_OBJECTS) $(wxsbsmsplayer_LDADD) $(LIBS)
$(CXXLINK) -rpath $(libdir) $(libsbsms_la_OBJECTS) $(libsbsms_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@ -457,31 +306,17 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiobuffer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fft.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grain.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/import.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp3.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp3tech.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/peak.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pitch.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/play.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resample.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sbsms.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sms.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subband.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testplay.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trackpoint.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wxconvertdlg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wxplayctrl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wxplayer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wxplayerframe.Po@am__quote@
.cpp.o:
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -532,8 +367,8 @@ ID: $(HEADERS) $(SOURCES) $(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; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
@ -545,8 +380,8 @@ TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
$(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) \
@ -556,12 +391,13 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(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; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
$(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
@ -602,11 +438,9 @@ distdir: $(DISTFILES)
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) config.h
install-binPROGRAMS: install-libLTLIBRARIES
all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libsbsmsincludedir)"; do \
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libsbsmsincludedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@ -633,14 +467,10 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
@ENABLE_PORTAUDIO_FALSE@clean: clean-am
clean: clean-am
@ENABLE_WX_FALSE@clean: clean-am
@MACOSX_FALSE@clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
clean-libtool mostlyclean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
@ -662,7 +492,7 @@ install-data-am: install-libsbsmsincludeHEADERS
install-dvi: install-dvi-am
install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
install-exec-am: install-libLTLIBRARIES
install-html: install-html-am
@ -694,41 +524,27 @@ ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES \
uninstall-am: uninstall-libLTLIBRARIES \
uninstall-libsbsmsincludeHEADERS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic clean-libLTLIBRARIES clean-libtool ctags \
distclean distclean-compile distclean-generic distclean-hdr \
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool ctags distclean \
distclean-compile distclean-generic distclean-hdr \
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-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-libLTLIBRARIES \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-libLTLIBRARIES \
install-libsbsmsincludeHEADERS install-man install-pdf \
install-pdf-am install-ps install-ps-am 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-libLTLIBRARIES uninstall-libsbsmsincludeHEADERS
tags uninstall uninstall-am uninstall-libLTLIBRARIES \
uninstall-libsbsmsincludeHEADERS
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@@MACOSX_TRUE@clean: cleanapproot clean-am
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@@MACOSX_TRUE@cleanapproot:
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@@MACOSX_TRUE@ sudo rm -rf $(top_builddir)/approot
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@@MACOSX_TRUE@all: $(top_builddir)/approot/Applications/wxsbsmsplayer.app $(top_builddir)/mac/Info.plist $(top_builddir)/mac/sbsms.icns
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@@MACOSX_TRUE@$(top_builddir)/approot/Applications/wxsbsmsplayer.app: wxsbsmsplayer
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@@MACOSX_TRUE@ sudo strip -u -r wxsbsmsplayer
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@@MACOSX_TRUE@ sudo mkdir -p $(top_builddir)/approot/Applications/wxsbsmsplayer.app/Contents/MacOS
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@@MACOSX_TRUE@ sudo mkdir -p $(top_builddir)/approot/Applications/wxsbsmsplayer.app/Contents/Resources
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@@MACOSX_TRUE@ sudo cp -f wxsbsmsplayer $(top_builddir)/approot/Applications/wxsbsmsplayer.app/Contents/MacOS/wxsbsmsplayer
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@@MACOSX_TRUE@ sudo cp -f $(top_builddir)/mac/Info.plist $(top_builddir)/approot/Applications/wxsbsmsplayer.app/Contents
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@@MACOSX_TRUE@ sudo cp -f $(top_builddir)/mac/sbsms.icns $(top_builddir)/approot/Applications/wxsbsmsplayer.app/Contents/Resources
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@@MACOSX_TRUE@ sudo sh -c "echo sbsms > $(top_builddir)/approot/Applications/wxsbsmsplayer.app/Contents/PkgInfo"
@ENABLE_PORTAUDIO_TRUE@@ENABLE_WX_TRUE@@MACOSX_TRUE@ sudo chown -R root:admin $(top_builddir)/approot/Applications
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,209 +0,0 @@
#include <stdlib.h>
#include "audiobuffer.h"
#include "audio.h"
#include "sbsms.h"
#include <pthread.h>
#include <string.h>
#include "utils.h"
namespace _sbsms_ {
void AudioBuffer :: copy(float *out, long outOffset, float *in, long inOffset, long n)
{
if(channels==1)
memcpy(out+outOffset,in+inOffset,n*sizeof(float));
else if(channels==2)
memcpy(out+(outOffset<<1),in+(inOffset<<1),(n<<1)*sizeof(float));
}
AudioBuffer :: AudioBuffer(long size, int channels)
{
pthread_cond_init(&importWriteCondition, NULL);
pthread_mutex_init(&importWriteMutex, NULL);
pthread_cond_init(&importReadCondition, NULL);
pthread_mutex_init(&importReadMutex, NULL);
pthread_mutex_init(&importMutex, NULL);
shareBufStart = 0;
shareBufEnd = 0;
readBlockSize = 0;
n_done = 0;
bWritingComplete = false;
this->channels = channels;
shareBuf = new float[channels*size];
shareBufSize = size;
halfShareBufSize = size/2;
importWriteReady = true;
importReadReady = false;
}
AudioBuffer :: ~AudioBuffer()
{
delete [] shareBuf;
pthread_cond_destroy(&importWriteCondition);
pthread_mutex_destroy(&importWriteMutex);
pthread_cond_destroy(&importReadCondition);
pthread_mutex_destroy(&importReadMutex);
pthread_mutex_destroy(&importMutex);
}
long AudioBuffer :: read(float *outputBuffer, long block_size)
{
long n_toread = block_size;
long n_done_now = 0;
if(pthread_mutex_lock(&importReadMutex) == 0) {
readBlockSize = block_size;
if(pthread_mutex_lock(&importMutex) == 0) {
importReadReady = isReadReady();
pthread_mutex_unlock(&importMutex);
}
while(!importReadReady) {
pthread_cond_wait(&importReadCondition, &importReadMutex);
}
readBlockSize = 0;
pthread_mutex_unlock(&importReadMutex);
}
if(pthread_mutex_lock(&importMutex) == 0) {
if(shareBufStart <= shareBufEnd) {
n_toread = min(n_toread, shareBufEnd-shareBufStart);
copy(outputBuffer,0,shareBuf,shareBufStart,n_toread);
n_done_now += n_toread;
} else {
n_toread = min(n_toread, shareBufSize-shareBufStart);
copy(outputBuffer,0,shareBuf,shareBufStart,n_toread);
n_done_now += n_toread;
n_toread = block_size - n_done_now;
n_toread = min(n_toread, shareBufEnd);
copy(outputBuffer,n_done_now,shareBuf,0,n_toread);
n_done_now += n_toread;
}
shareBufStart += n_done_now;
shareBufStart %= shareBufSize;
importWriteReady = isWriteReady();
if(importWriteReady) {
pthread_cond_broadcast(&importWriteCondition);
}
pthread_mutex_unlock(&importMutex);
}
n_done += n_done_now;
return n_done_now;
}
void AudioBuffer :: writingComplete()
{
if(pthread_mutex_lock(&importMutex) == 0) {
bWritingComplete = true;
importReadReady = isReadReady();
if(importReadReady) {
pthread_cond_broadcast(&importReadCondition);
}
pthread_mutex_unlock(&importMutex);
}
}
void AudioBuffer :: flush()
{
if(pthread_mutex_lock(&importMutex) == 0) {
shareBufStart = 0;
shareBufEnd = 0;
readBlockSize = 0;
bWritingComplete = false;
pthread_mutex_unlock(&importMutex);
}
}
long AudioBuffer :: n_readable()
{
long n = 0;
if(pthread_mutex_lock(&importMutex) == 0) {
if(shareBufStart <= shareBufEnd)
n = (shareBufEnd-shareBufStart);
else
n = (shareBufSize-shareBufStart + shareBufEnd);
pthread_mutex_unlock(&importMutex);
}
return n;
}
bool AudioBuffer :: isReadReady()
{
if(bWritingComplete)
return true;
if(shareBufStart <= shareBufEnd)
return (shareBufEnd-shareBufStart >= readBlockSize);
else
return (shareBufSize-shareBufStart + shareBufEnd >= readBlockSize);
}
bool AudioBuffer :: isWriteReady()
{
bool importWriteReady;
if(shareBufStart <= shareBufEnd) {
importWriteReady = (shareBufEnd-shareBufStart < halfShareBufSize);
} else {
importWriteReady = (shareBufStart-shareBufEnd >= halfShareBufSize);
}
return importWriteReady;
}
bool AudioBuffer :: isFull()
{
bool bFull = false;
if(pthread_mutex_lock(&importMutex) == 0) {
bFull = !isWriteReady();
pthread_mutex_unlock(&importMutex);
}
return bFull;
}
long AudioBuffer :: write(float *buf, long n)
{
if(n>=halfShareBufSize) {
abort();
}
if(pthread_mutex_lock(&importWriteMutex) == 0) {
if(pthread_mutex_lock(&importMutex) == 0) {
importWriteReady = isWriteReady();
pthread_mutex_unlock(&importMutex);
}
while(!importWriteReady) {
pthread_cond_wait(&importWriteCondition, &importWriteMutex);
}
pthread_mutex_unlock(&importWriteMutex);
}
long n_written=0, n_towrite=0;
if(pthread_mutex_lock(&importMutex) == 0) {
n_towrite = min(n,shareBufSize-shareBufEnd);
copy(shareBuf,shareBufEnd,buf,n_written,n_towrite);
shareBufEnd += n_towrite;
n_written = n_towrite;
n_towrite = n - n_written;
if(n_towrite) {
shareBufEnd = 0;
copy(shareBuf,shareBufEnd,buf,n_written,n_towrite);
shareBufEnd += n_towrite;
n_written += n_towrite;
}
shareBufEnd %= shareBufSize;
importReadReady = isReadReady();
if(importReadReady) {
pthread_cond_broadcast(&importReadCondition);
}
pthread_mutex_unlock(&importMutex);
}
return n_written;
}
}

View File

@ -1,46 +0,0 @@
#ifndef RINGBUFFER_H
#define RINGBUFFER_H
#include <pthread.h>
namespace _sbsms_ {
class AudioBuffer {
public:
AudioBuffer(long size, int channels);
~AudioBuffer();
long n_readable();
long read(float *outputBuffer, long block_size);
long write(float *buf, long n);
void writingComplete();
void flush();
bool isFull();
protected:
bool isWriteReady();
bool isReadReady();
void copy(float *out, long outOffset, float *in, long inOffset, long n);
pthread_cond_t importWriteCondition;
pthread_mutex_t importWriteMutex;
pthread_cond_t importReadCondition;
pthread_mutex_t importReadMutex;
pthread_mutex_t importMutex;
bool importWriteReady;
bool importReadReady;
bool bWritingComplete;
int channels;
float *shareBuf;
long readBlockSize;
long shareBufStart;
long shareBufEnd;
long shareBufSize;
long halfShareBufSize;
long n_done;
};
}
#endif

View File

@ -1,31 +0,0 @@
#include "BtnDown.h"
//-------------------//
//--- CBtnDownEvt ---//
//-------------------//
BEGIN_EVENT_TABLE(CBtnDownEvt, wxEvtHandler)
EVT_LEFT_DOWN (CBtnDownEvt::OnLeftDown)
EVT_LEFT_UP (CBtnDownEvt::OnLeftUp)
EVT_MOTION (CBtnDownEvt::OnMouseMove)
END_EVENT_TABLE()
void CBtnDownEvt::OnLeftDown( wxMouseEvent& event )
{
pParent->SetBitmapLabel( *pBtnDown );
pParent->Refresh();
event.Skip();
}
void CBtnDownEvt::OnLeftUp( wxMouseEvent& event )
{
pParent->SetBitmapLabel( *pBtnUp );
pParent->Refresh();
event.Skip();
}
void CBtnDownEvt::OnMouseMove( wxMouseEvent& event )
{
if ( event.LeftIsDown() )
pParent->SetBitmapLabel( *pBtnUp );
event.Skip();
}

View File

@ -1,23 +0,0 @@
#ifndef MUSIK_BTNDOWN_EVT
#define MUSIK_BTNDOWN_EVT
#include "wx/wx.h"
class CBtnDownEvt : public wxEvtHandler
{
public:
CBtnDownEvt( wxBitmapButton *parent, wxBitmap *down, wxBitmap *up ){ pParent = parent; pBtnDown = down; pBtnUp = up; };
~CBtnDownEvt(){};
void OnLeftDown ( wxMouseEvent& event );
void OnLeftUp ( wxMouseEvent& event );
void OnMouseMove( wxMouseEvent& event );
void OnEraseBackground(wxEraseEvent& ) {}
DECLARE_EVENT_TABLE()
private:
wxBitmapButton *pParent;
wxBitmap *pBtnDown;
wxBitmap *pBtnUp;
};
#endif

View File

@ -3,10 +3,13 @@
#include <assert.h>
#include "buffer.h"
#include "sbsms.h"
#include "utils.h"
#include <algorithm>
using namespace std;
namespace _sbsms_ {
#define INIT_SAMPLEBUF_LENGTH 65536
#define INIT_SAMPLEBUF_LENGTH 8192
#define INIT_GRAINBUF_LENGTH 128
#define INIT_TPLBUF_LENGTH 128
@ -76,7 +79,7 @@ long SampleBuf :: write(grain *g, int h)
for(int c=0;c<2;c++) {
int j = 0;
for(int k=writePos; k<writePos+g->N; k++) {
buf[k][c] += g->time[j++][c] * f;
buf[k][c] += g->x[j++][c] * f;
}
}
writePos += h;
@ -134,21 +137,20 @@ void SampleBuf :: clear()
GrainBuf :: GrainBuf(int N, int h)
{
init(N,h,1,SBSMS_HANN);
init(N,h,1);
}
GrainBuf :: GrainBuf(int N, int h, real pad, int wintype)
GrainBuf :: GrainBuf(int N, int h, real pad)
{
init(N,h,pad,wintype);
init(N,h,pad);
}
void GrainBuf :: init(int N, int h, real pad, int wintype)
void GrainBuf :: init(int N, int h, real pad)
{
this->length = INIT_GRAINBUF_LENGTH;
this->buf = (grain**) calloc(2*length,sizeof(grain*));
this->iBuf = (audio*) calloc(N,sizeof(audio));
this->wintype = wintype;
this->pad = pad;
this->N = N;
this->h = h;
@ -197,8 +199,8 @@ long GrainBuf :: write(audio *buf2, long n)
void GrainBuf :: convert(audio *timebuf)
{
grain *g = grain::create(N,pad,wintype);
memcpy(g->time,timebuf,N*sizeof(audio));
grain *g = grain::create(N,pad);
memcpy(g->x,timebuf,N*sizeof(audio));
g->analyze();
g->h = h;
write(g);

View File

@ -122,10 +122,10 @@ class TrackPointListBuffer {
class GrainBuf {
public:
GrainBuf(int N, int h);
GrainBuf(int N, int h, real pad, int type);
GrainBuf(int N, int h, real pad);
~GrainBuf();
void init(int N, int h, real pad, int type);
void init(int N, int h, real pad);
long write(audio *buf, long n);
void write(grain *g);
void advance(long n);
@ -135,7 +135,7 @@ class GrainBuf {
long length;
long readPos, writePos;
int N,h,wintype;
int N,h;
real pad;
protected:

View File

@ -1,320 +0,0 @@
#include "config.h"
#include <math.h>
#include "convert.h"
#include "sbsms.h"
#include <stdlib.h>
#include "audio.h"
#ifdef HAVE_SNDFILE
#include "import.h"
#include "pcm.h"
#define BWAV 1
#endif
struct resampleBuf {
float *buf;
audio *abuf;
double ratio;
long samplesIn;
long block;
#ifdef BWAV
AudioDecoder *decoder;
#else
FILE *decoder;
#endif
};
long resampleCB(void *cb_data, sbsms_resample_frame *data)
{
resampleBuf *r = (resampleBuf*) cb_data;
#ifdef BWAV
long n_read_in = r->decoder->read(r->buf,r->block);
audio_convert_to(r->abuf,0,r->buf,0,n_read_in);
#else
long n_read_in = 0;
for(int k=0;k<r->block;k++) {
if(fscanf(r->decoder,"%g %g\n",&(r->abuf[k][0]),&(r->abuf[k][1])) == EOF)
break;
n_read_in++;
}
#endif
r->samplesIn += n_read_in;
data->size = n_read_in;
data->ratio0 = r->ratio;
data->ratio1 = r->ratio;
data->in = r->abuf;
return n_read_in;
}
long samplesCB(audio *chdata, long numFrames, void *userData)
{
sbsmsInfo *si = (sbsmsInfo*) userData;
long n_read = si->rs->read(chdata, numFrames);
return n_read;
}
#ifndef BWAV
long lineCount(FILE *fp) {
long n = 0;
char c = 0;
do {
c = fgetc(fp);
if (c == '\n') n++;
} while (c != EOF);
fseek(fp,0,SEEK_SET);
return n;
}
#endif
bool sbsms_convert(const char *filenameIn, const char *filenameOut, bool bAnalyzeOnly, bool bSynthesizeOnly, bool bPreAnalyze, int quality, progress_cb progressCB, void *data, real stretch0, real stretch1, real ratio0, real ratio1, real volume)
{
bool status = true;
real srOut = 44100.0f;
int channels;
long samplesToProcess;
long samplesIn;
sbsmsInfo si;
sbsms *sbsmser = NULL;
Resampler *resampler = NULL;
Resampler *resamplerPre = NULL;
resampleBuf rb;
rb.buf = NULL;
rb.abuf = NULL;
resampleBuf rbPre;
rbPre.buf = NULL;
rbPre.abuf = NULL;
FILE *sbsmsIn = NULL;
FILE *sbsmsOut = NULL;
float *fbuf = NULL;
audio *abuf = NULL;
pitcher *pitch = NULL;
float srIn;
real stretch2;
long samplesOut;
#ifdef BWAV
AudioDecoder *decoder = NULL;
AudioDecoder *decoderPre = NULL;
#else
FILE *decoder = NULL;
FILE *decoderPre = NULL;
#endif
if(bSynthesizeOnly) {
sbsmsIn = sbsms_open_read(filenameIn);
if(!sbsmsIn) {
printf("Cannot open file: :%s\n",filenameIn);
status = false;
goto cleanup;
}
samplesIn = 0;
samplesToProcess = sbsms_get_samples_to_process(sbsmsIn);
channels = sbsms_get_channels(sbsmsIn);
quality = sbsms_get_quality(sbsmsIn);
sbsmser = sbsms_create(sbsmsIn,&stretchCBLinear,&ratioCBLinear);
decoder = NULL;
} else {
#ifdef BWAV
decoder = import(filenameIn);
if(!decoder) {
printf("File: %s cannot be opened\n",filenameIn);
exit(-1);
}
srIn = (float) decoder->getSampleRate();
channels = decoder->getChannels();
samplesIn = decoder->getFrames();
#else
decoder = fopen(filenameIn,"r");
if(!decoder) {
printf("File: %s cannot be opened\n",filenameIn);
status = false;
goto cleanup;
}
srIn = 44100.0;
channels = 2;
samplesIn = lineCount(decoder);
#endif
samplesToProcess = (long) (samplesIn*srOut/srIn);
rb.ratio = (float)srOut / (float)srIn;
rb.decoder = decoder;
rb.block = SBSMS_FRAME_SIZE[quality];
rb.samplesIn = 0;
rb.buf = (float*)calloc(rb.block*2,sizeof(float));
rb.abuf = (audio*)calloc(rb.block,sizeof(audio));
resampler = new Resampler(resampleCB, &rb);
si.rs = resampler;
sbsmser = sbsms_create(&samplesCB,&stretchCBLinear,&ratioCBLinear,channels,quality,bPreAnalyze,!bAnalyzeOnly);
}
if(bPreAnalyze && !bSynthesizeOnly) {
#ifdef BWAV
decoderPre = import(filenameIn);
if(!decoderPre) {
printf("File: %s cannot be opened\n",filenameIn);
status = false;
goto cleanup;
}
#else
decoderPre = fopen(filenameIn,"r");
if(!decoderPre) {
printf("File: %s cannot be opened\n",filenameIn);
status = false;
goto cleanup;
}
#endif
rbPre.ratio = (float)srOut / (float)srIn;
rbPre.decoder = decoderPre;
rbPre.block = SBSMS_FRAME_SIZE[quality];
rbPre.samplesIn = 0;
rbPre.buf = (float*)calloc(rbPre.block*2,sizeof(float));
rbPre.abuf = (audio*)calloc(rbPre.block,sizeof(audio));
resamplerPre = new Resampler(resampleCB, &rbPre);
si.rs = resamplerPre;
}
if(stretch0 == stretch1)
stretch2 = 1.0/stretch0;
else
stretch2 = log(stretch1/stretch0)/(stretch1-stretch0);
samplesOut = samplesToProcess * stretch2;
si.samplesToProcess = samplesToProcess;
si.samplesToGenerate = samplesOut;
si.stretch0 = stretch0;
si.stretch1 = stretch1;
si.ratio0 = ratio0;
si.ratio1 = ratio1;
if(bPreAnalyze && !bSynthesizeOnly) {
long pos = 0;
long lastPos = 0;
long ret = 0;
while(lastPos<samplesToProcess) {
long lastPercent=0;
ret = sbsms_pre_analyze(&samplesCB,&si,sbsmser);
lastPos = pos;
pos += ret;
int percent = 100.*(real)lastPos/(real)samplesToProcess;
//progressCB(percent,"Analysis",data);
}
sbsms_pre_analyze_complete(sbsmser);
sbsms_reset(sbsmser);
si.rs = resampler;
}
if(bAnalyzeOnly) {
long pos = 0;
long lastPos = 0;
long ret = -1;
sbsmsOut = sbsms_open_write(filenameOut, sbsmser, samplesToProcess);
if(!sbsmsOut) {
printf("File: %s cannot be opened\n",filenameOut);
status = false;
goto cleanup;
}
while(lastPos<samplesToProcess && ret) {
long lastPercent=0;
ret = sbsms_write_frame(sbsmsOut,&si,sbsmser);
lastPos = pos;
pos += ret;
int percent = 100.*(real)lastPos/(real)samplesToProcess;
progressCB(percent,"Progress",data);
}
} else {
fbuf = (float*)calloc(SBSMS_MAX_FRAME_SIZE[quality]*2,sizeof(float));
abuf = (audio*)calloc(SBSMS_MAX_FRAME_SIZE[quality],sizeof(audio));
pitch = pitch_create(sbsmser,&si,1.0);
long blockSize = SBSMS_FRAME_SIZE[quality];
#ifdef BWAV
PcmWriter writer(filenameOut,samplesOut,(int)srOut,channels);
if(writer.isError()) {
printf("File: %s cannot be opened\n",filenameOut);
status = false;
goto cleanup;
}
#else
FILE *OUT = fopen(filenameOut,"w");
if(!OUT) {
printf("File: %s cannot be opened\n",filenameOut);
status = false;
goto cleanup;
}
#endif
long pos = 0;
long ret = -1;
while(pos<samplesOut && ret) {
long frames;
long lastPercent=0;
if(pos+blockSize>samplesOut) {
frames = samplesOut - pos;
} else {
frames = blockSize;
}
ret = pitch_process(abuf, frames, pitch);
audio_convert_from(fbuf,0,abuf,0,ret);
if(channels==1) {
for(int k=0;k<ret;k++) {
int k2 = k<<1;
fbuf[k] = volume*fbuf[k2];
}
} else if(channels==2) {
for(int k=0;k<ret;k++) {
int k2 = k<<1;
fbuf[k2] = volume*fbuf[k2];
fbuf[k2+1] = volume*fbuf[k2+1];
}
}
#ifdef BWAV
writer.write(fbuf, ret);
#else
for(int k=0;k<ret;k++)
fprintf(OUT,"%g %g\n",fbuf[2*k],fbuf[2*k+1]);
#endif
pos += ret;
int percent = 100.*(real)pos / (real)samplesOut;
progressCB(percent,"Progress",data);
}
#ifdef BWAV
writer.close();
#else
if(OUT) fclose(OUT);
#endif
}
cleanup:
#ifdef BWAV
if(decoderPre) delete decoderPre;
if(decoder) delete decoder;
#else
if(decoderPre) fclose(decoderPre);
if(decoder) fclose(decoder);
#endif
if(fbuf) free(fbuf);
if(abuf) free(abuf);
if(pitch) pitch_destroy(pitch);
if(sbsmsIn) sbsms_close_read(sbsmsIn);
if(sbsmsOut) sbsms_close_write(sbsmsOut,sbsmser);
if(resampler) delete resampler;
if(resamplerPre) delete resamplerPre;
if(rb.buf) free(rb.buf);
if(rb.abuf) free(rb.abuf);
if(rbPre.buf) free(rbPre.buf);
if(rbPre.abuf) free(rbPre.abuf);
if(sbsmser) sbsms_destroy(sbsmser);
return status;
}

View File

@ -1,10 +0,0 @@
#ifndef CONVERT_H
#define CONVERT_H
#include "sbsms.h"
typedef bool (*progress_cb)(int progress, const char *msg, void *data);
bool sbsms_convert(const char *filenameIn, const char *filenameOut, bool bAnalyzeOnly, bool bSynthesizeOnly, bool bPreAnalyze, int quality, progress_cb progressCB, void *data, real stretch0, real stretch1, real ratio0, real ratio1, real volume);
#endif

View File

@ -1,16 +0,0 @@
#ifndef SBSMS_DEFS_H
#define SBSMS_DEFS_H
#ifdef SBSMS_REAL_FLOAT
#define ONEOVERPI 0.31830988618379f
#define ONEOVERTWOPI 0.15915494309190f
#define PI 3.14159265358979323846264338327950288f
#define TWOPI 6.28318530717958647692528676655900576f
#else
#define ONEOVERPI 0.31830988618379
#define ONEOVERTWOPI 0.15915494309190
#define PI 3.14159265358979323846264338327950288
#define TWOPI 6.28318530717958647692528676655900576
#endif
#endif

View File

@ -242,8 +242,8 @@ void fft2(t_fft *x, int n1, int N1, int r, t_fft *t, int dir)
x1[1] = IMAG(t10,t11,y0,y1);
}
#define T300 (real)0.5
#define T301 (real)0.86602540378444
#define T300 0.5f
#define T301 0.86602540378444f
void fft3(t_fft *x, int n1, int N1, int r, t_fft *t, int dir)
{
int i = r+n1;
@ -341,10 +341,10 @@ void fft4(t_fft *x, int n1, int N1, int r, t_fft *t, int dir)
x3[1] = IMAG(t30,t31,y30,y31);
}
#define T500 (real)0.95105651629515
#define T501 (real)0.58778525229247
#define T510 (real)0.55901699437495
#define T511 (real)0.25
#define T500 0.95105651629515f
#define T501 0.58778525229247f
#define T510 0.55901699437495f
#define T511 0.25f
void fft5(t_fft *x, int n1, int N1, int r, t_fft *t, int dir)
{
@ -438,8 +438,8 @@ void fft5(t_fft *x, int n1, int N1, int r, t_fft *t, int dir)
x4[1] = IMAG(t40,t41,y40,y41);
}
#define T600 (real)0.86602540378444
#define T601 (real)0.5
#define T600 0.86602540378444f
#define T601 0.5f
void fft6(t_fft *x, int n1, int N1, int r, t_fft *t, int dir)
{
int i = r+n1;
@ -544,14 +544,14 @@ void fft6(t_fft *x, int n1, int N1, int r, t_fft *t, int dir)
x5[1] = IMAG(t50,t51,y50,y51);
}
#define C71 (real)-1.16666666666667
#define C72 (real)0.79015646852540
#define C73 (real)0.05585426728965
#define C74 (real)0.73430220123575
#define C75 (real)0.44095855184410
#define C76 (real)0.34087293062393
#define C77 (real)-0.53396936033773
#define C78 (real)0.87484229096166
#define C71 -1.16666666666667f
#define C72 0.79015646852540f
#define C73 0.05585426728965f
#define C74 0.73430220123575f
#define C75 0.44095855184410f
#define C76 0.34087293062393f
#define C77 -0.53396936033773f
#define C78 0.87484229096166f
void fft7(t_fft *x, int n1, int N1, int r, t_fft *t, int dir)
{

View File

@ -3,28 +3,23 @@
#include <cstring>
#include "grain.h"
#include "sbsms.h"
#include "defs.h"
#include "real.h"
#include "utils.h"
#include <map>
using namespace std;
using namespace _sbsms_;
map<int, map<int, map<real, real*> > > wwMap;
map<int, map<int, map<real, audio*> > > peakMap;
namespace _sbsms_ {
map<int, map<real, real*> > wwMap;
map<int, map<real, audio*> > peakMap;
map<int, fftplan*> fftPlanMap;
map<int, fftplan*> ifftPlanMap;
long grain :: count = 0;
grain* grain :: create(int N,real pad,int wintype)
grain* grain :: create(int N,real pad)
{
grain *g = new grain(N,pad,wintype);
g->refCount = 0;
g->time = (audio*) malloc(N*sizeof(audio));
g->freq = (audio*) malloc(N*sizeof(audio));
grain *g = new grain(N,pad);
return g;
}
@ -43,41 +38,37 @@ void grain :: forget(grain *g)
void grain :: destroy(grain *g)
{
free_audio_buf(g->time);
free_audio_buf(g->freq);
free_audio_buf(g->x);
delete g;
}
grain :: grain(int N, real pad, int type)
grain :: grain(int N, real pad)
{
this->type = type;
this->N = N;
this->pad = pad;
calc_plans();
calc_windows();
refCount = 0;
x = (audio*) malloc(N*sizeof(audio));
}
void grain :: analyze()
{
for(int k=0;k<N;k++) {
for(int c=0;c<2;c++) {
freq[k][c] = time[k][c] * ww[k];
x[k][c] *= ww[k];
}
}
FFT(fftPlan,freq);
FFT(fftPlan,x);
}
void grain :: synthesize()
{
memcpy(time,freq,N*sizeof(audio));
IFFT(ifftPlan,time);
IFFT(ifftPlan,x);
real f = pad/(real)N;
for(int c=0;c<2;c++) {
for(int k=0;k<N;k++) {
time[k][c] *= ww[k] * f;
for(int k=0;k<N;k++) {
for(int c=0;c<2;c++) {
x[k][c] *= ww[k] * f;
}
}
}
@ -98,23 +89,19 @@ void grain :: calc_plans()
void grain :: calc_windows()
{
int N2 = round2int(N/pad);
ww = wwMap[type][N][pad];
ww = wwMap[N][pad];
if(ww == NULL) {
wwMap[type][N][pad] = (ww = (real*)calloc(N,sizeof(real)));
wwMap[N][pad] = (ww = (real*)calloc(N,sizeof(real)));
for(int k=0;k<N2;k++) {
if(type==SBSMS_HANN)
ww[k+(N-N2)/2] = .5*(1.0 - cos((real)k/(real)N2*TWOPI));
else if(type==SBSMS_HAMMING)
ww[k+(N-N2)/2] = .53836 - .46164*cos((real)k/(real)N2*TWOPI);
ww[k+(N-N2)/2] = .5*(1.0 - cos((real)k/(real)N2*TWOPI));
}
}
peak = peakMap[type][N][pad];
peak = peakMap[N][pad];
if(peak == NULL) {
peakMap[type][N][pad] = (peak = (audio*) malloc(N*sizeof(audio)));
peakMap[N][pad] = (peak = (audio*) calloc(N,sizeof(audio)));
for(int k=0;k<N;k++) {
peak[k][0] = ww[k]/(real)(N2/2);
peak[k][1] = 0;
}
FFT(fftPlan,peak);
}
@ -122,61 +109,38 @@ void grain :: calc_windows()
grain* grain :: upsample()
{
grain *g2 = grain::create(2*N,pad,type);
grain *g2 = grain::create(2*N,pad);
grain *g = this;
for(int c=0;c<2;c++) {
for(int k=0;k<=N/2;k++)
g2->freq[k][c] = g->freq[k][c];
g2->x[k][c] = g->x[k][c];
for(int k=N/2+1;k<=N/2+N;k++)
g2->freq[k][c] = 0;
g2->x[k][c] = 0;
for(int k=N/2+N+1;k<2*N;k++)
g2->freq[k][c] = g->freq[k-N][c];
g2->x[k][c] = g->x[k-N][c];
}
return g2;
}
grain* grain :: downsample()
{
grain *g2 = grain::create(N/2,pad,type);
grain *g2 = grain::create(N/2,pad);
grain *g = this;
for(int c=0;c<2;c++) {
for(int k=0;k<=N/4-1;k++)
g2->freq[k][c] = g->freq[k][c];
g2->x[k][c] = g->x[k][c];
g2->freq[N/4][c] = 0.5*(g->freq[N/4][c] + g->freq[N-N/4][c] );
g2->x[N/4][c] = 0.5*(g->x[N/4][c] + g->x[N-N/4][c] );
for(int k=N/4+1;k<N/2;k++)
g2->freq[k][c] = g->freq[k+N/2][c];
g2->x[k][c] = g->x[k+N/2][c];
}
return g2;
}
grain *grain :: lpfilter()
{
grain *g = this;
for(int c=0;c<2;c++) {
for(int k=N/4+1;k<=N-N/4-1;k++)
g->freq[k][c] = 0;
}
return this;
}
//destructive
grain *grain :: hpfilter()
{
grain *g = this;
for(int c=0;c<2;c++) {
for(int k=0;k<=N/4;k++)
g->freq[k][c] = 0;
for(int k=N-N/4;k<N;k++)
g->freq[k][c] = 0;
}
return this;
}

View File

@ -5,40 +5,31 @@
#include "audio.h"
#include "sbsms.h"
#define SBSMS_HANN 0
#define SBSMS_HAMMING 1
namespace _sbsms_ {
class grain {
public:
static long count;
static grain* create(int N, real pad, int wintype);
static grain* create(int N, real pad);
static void destroy(grain *g);
static void referenced(grain *g);
static void forget(grain *g);
t_fft *time;
t_fft *freq;
int N, type, h;
t_fft *x;
int N;
int h;
real pad;
int refCount;
audio *peak;
void analyze();
void synthesize();
grain* upsample();
grain* downsample();
grain* lpfilter();
grain* hpfilter();
audio *peak;
protected:
grain(int N,real q,int wintype);
void calc_windows();
grain(int N,real pad);
void calc_plans();
void calc_windows();
real *ww;
fftplan *fftPlan, *ifftPlan;
};

View File

@ -1,48 +0,0 @@
#include <iostream>
#include "sbsms.h"
#include "import.h"
#include "config.h"
#include "pcm.h"
#ifdef HAVE_MAD
#include "mp3.h"
#endif
#include <map>
#include <string>
using namespace std;
namespace _sbsms_ {
string lower(string strToConvert)
{
for(unsigned int i=0;i<strToConvert.length();i++) {
strToConvert[i] = tolower(strToConvert[i]);
}
return strToConvert;
}
AudioDecoder *import(const char *filename)
{
string fname(filename);
int i = fname.find(".");
AudioDecoder *decoder = NULL;
if(i) {
string ext = fname.substr(i+1);
string extl = lower(ext);
if(!extl.compare("wav") || !extl.compare("aif") || !extl.compare("aiff")) {
decoder = new PcmReader(filename);
#ifdef HAVE_MAD
} else if (!extl.compare("mp3")) {
decoder = new MP3Reader(filename);
#endif
} else {
perror("Error importing file");
return NULL;
}
}
return decoder;
}
}

View File

@ -1,23 +0,0 @@
#ifndef IMPORT_H
#define IMPORT_H
namespace _sbsms_ {
typedef int (*audio_in_cb)(float *buf, long n, int Fs, void *data);
class AudioDecoder {
public:
virtual long read(float *buf, long block_size) = 0 ;
virtual bool done() = 0;
virtual int getSampleRate() = 0;
virtual long getFrames() = 0;
virtual int getChannels() = 0;
virtual bool isError() = 0;
virtual ~AudioDecoder() {};
};
AudioDecoder *import(const char *filename);
}
#endif

View File

@ -1,247 +0,0 @@
# include <stdio.h>
//# include <unistd.h>
# include <sys/stat.h>
#include "mp3tech.h"
#include "audio.h"
#include "import.h"
#include "audiobuffer.h"
#include <iostream>
#include <fstream>
#include "mp3.h"
namespace _sbsms_ {
#define MP3_INPUT_BUFFER_SIZE 4096
#define MP3_OUTPUT_BUFFER_SIZE 4096
#define MP3_OUTPUT_OVERFLOW_BUFFER_SIZE 4096
#define MP3_AUDIO_BUFFER_SIZE 65536
using namespace std;
static
enum mad_flow input(void *_data,
struct mad_stream *stream)
{
MP3Reader *data = (MP3Reader*) _data;
long input_buffer_size = MP3_INPUT_BUFFER_SIZE;
if(data->file->eof()) {
data->rb->writingComplete();
return MAD_FLOW_STOP;
}
/* "Each time you refill your buffer, you need to preserve the data in
* your existing buffer from stream.next_frame to the end.
*
* This usually amounts to calling memmove() on this unconsumed portion
* of the buffer and appending new data after it, before calling
* mad_stream_buffer()"
* -- Rob Leslie, on the mad-dev mailing list */
unsigned int unconsumedBytes;
if(stream->next_frame) {
unconsumedBytes = data->inputBuffer + input_buffer_size - stream->next_frame;
memmove(data->inputBuffer, stream->next_frame, unconsumedBytes);
}
else
unconsumedBytes = 0;
//use read instead of readsome so eof is reached
long start = data->file->tellg();
data->file->read((char*)data->inputBuffer + unconsumedBytes,
(input_buffer_size - unconsumedBytes));
long end = data->file->tellg();
long read = end - start;
mad_stream_buffer(stream, data->inputBuffer, read + unconsumedBytes);
return MAD_FLOW_CONTINUE;
}
inline float scale(mad_fixed_t sample)
{
return (float) (sample / (float) (1L << MAD_F_FRACBITS));
}
static long copy_mad_audio(float *out, struct mad_pcm *pcm, unsigned int nsamples)
{
unsigned int nchannels = pcm->channels;
mad_fixed_t *ch;
ch = pcm->samples[0];
for(unsigned int k = 0;k<nsamples;k++) {
out[2*k] = scale( *(ch++) );
}
if(nchannels==2) {
ch = pcm->samples[1];
for(unsigned int k = 0;k<nsamples;k++) {
out[2*k+1] = scale( *(ch++) );
}
} else {
ch = pcm->samples[0];
for(unsigned int k = 0;k<nsamples;k++) {
out[2*k+1] = scale( *(ch++) );
}
}
return nsamples;
}
/*
* This is the output callback function. It is called after each frame of
* MPEG audio data has been completely decoded. The purpose of this callback
* is to output (or play) the decoded PCM audio.
*/
static
enum mad_flow output(void *_data,
struct mad_header const *header,
struct mad_pcm *pcm)
{
MP3Reader *data = (MP3Reader*) _data;
data->channels = pcm->channels;
audio_in_cb cb = data->cb;
unsigned int nsamples = pcm->length;
float *out = data->getOutputBuffer(nsamples);
copy_mad_audio(out,pcm,nsamples);
if(cb) {
cb(out,nsamples,pcm->samplerate,data->data);
}
return MAD_FLOW_CONTINUE;
}
/*
* This is the error callback function. It is called whenever a decoding
* error occurs. The error is indicated by stream->error; the list of
* possible MAD_ERROR_* errors can be found in the mad.h (or stream.h)
* header file.
*/
static
enum mad_flow error(void *_data,
struct mad_stream *stream,
struct mad_frame *frame)
{
fprintf(stderr, "decoding error 0x%04x (%s) at stream frame %u\n",
stream->error, mad_stream_errorstr(stream),
(unsigned int)stream->this_frame );
/* return MAD_FLOW_BREAK here to stop decoding (and propagate an error) */
return MAD_FLOW_CONTINUE;
}
/*
* It instantiates a decoder object and configures it with the input,
* output, and error callback functions above. A single call to
* mad_decoder_run() continues until a callback function returns
* MAD_FLOW_STOP (to stop decoding) or MAD_FLOW_BREAK (to stop decoding and
* signal an error).
*/
int read_cb(float *buf, long n, int Fs, void *data)
{
MP3Reader *decoder = (MP3Reader*)data;
return decoder->rb->write(buf,n);
}
void *mp3importThreadCB(void *data)
{
/* start decoding */
MP3Reader *reader = (MP3Reader*)data;
mad_decoder_run(&(reader->decoder), MAD_DECODER_MODE_SYNC);
reader->bDone = true;
return NULL;
}
long MP3Reader :: read(float *outputBuffer, long block_size)
{
// on first call, start the decoder
if(bFirst) {
bFirst = false;
this->data = this;
this->cb = read_cb;
pthread_create(&importThread, NULL, mp3importThreadCB, this);
}
return rb->read(outputBuffer, block_size);
}
float* MP3Reader :: getOutputBuffer(long nsamples)
{
return outputBuffer;
}
bool MP3Reader :: done()
{
return bDone;
}
bool MP3Reader :: isError()
{
return bError;
}
MP3Reader :: MP3Reader(const char *filename)
{
bError = false;
file = new ifstream();
file->open(filename, ios::in | ios::binary);
if (!file->is_open()) {
bError = true;
}
mp3info mp3;
mp3.file = fopen(filename,"rb");
mp3.filename = filename;
get_mp3_info(&mp3);
this->samples = mp3.samples;
this->sampleRate = mp3.sample_rate;
fclose(mp3.file);
this->n_done = 0;
this->bFirst = true;
this->bDone = false;
/* configure input, output, and error functions */
mad_decoder_init(&decoder, this,
input, 0 /* header */, 0 /* filter */, output,
error, 0 /* message */);
this->outputBuffer = new float[MP3_OUTPUT_BUFFER_SIZE<<1];
this->inputBuffer = new unsigned char [MP3_INPUT_BUFFER_SIZE];
this->rb = new AudioBuffer(MP3_AUDIO_BUFFER_SIZE,2);
}
long MP3Reader :: getFrames()
{
return samples;
}
int MP3Reader :: getSampleRate()
{
return sampleRate;
}
int MP3Reader :: getChannels()
{
return 2;
}
MP3Reader :: ~MP3Reader()
{
file->close();
delete file;
mad_decoder_finish(&decoder);
delete outputBuffer;
delete inputBuffer;
delete rb;
}
}

View File

@ -1,45 +0,0 @@
#ifndef MP3_H
#define MP3_H
#include <iostream>
#include <fstream>
#include "import.h"
#include "mad.h"
#include "audiobuffer.h"
using namespace std;
#include <pthread.h>
namespace _sbsms_ {
class MP3Reader : public AudioDecoder {
public:
MP3Reader(const char *filename);
~MP3Reader();
bool isError();
long read(float *buf, long block_size);
int getSampleRate();
int getChannels();
long getFrames();
bool done();
float* getOutputBuffer(long nsamples);
bool bError;
int channels;
int sampleRate;
long samples;
float *outputBuffer;
unsigned char *inputBuffer;
bool bFirst;
long n_done;
AudioBuffer *rb;
bool bDone;
struct mad_decoder decoder;
pthread_t importThread;
ifstream *file;
audio_in_cb cb;
void *data;
};
}
#endif

View File

@ -1,304 +0,0 @@
/*
mp3tech.c - Functions for handling MP3 files and most MP3 data
structure manipulation.
Copyright (C) 2000-2006 Cedric Tefft <cedric@phreaker.net>
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., 675 Mass Ave, Cambridge, MA 02139, USA.
***************************************************************************
This file is based in part on:
* MP3Info 0.5 by Ricardo Cerqueira <rmc@rccn.net>
* MP3Stat 0.9 by Ed Sweetman <safemode@voicenet.com> and
Johannes Overmann <overmann@iname.com>
*/
#include "mp3tech.h"
#include <sys/stat.h>
#include <string.h>
#include <ctype.h>
namespace _sbsms_ {
int layer_tab[4]= {0, 3, 2, 1};
int frequencies[3][4] = {
{22050,24000,16000,50000}, /* MPEG 2.0 */
{44100,48000,32000,50000}, /* MPEG 1.0 */
{11025,12000,8000,50000} /* MPEG 2.5 */
};
int bitrate[2][3][15] = {
{ /* MPEG 2.0 */
{0,32,48,56,64,80,96,112,128,144,160,176,192,224,256}, /* layer 1 */
{0,8,16,24,32,40,48,56,64,80,96,112,128,144,160}, /* layer 2 */
{0,8,16,24,32,40,48,56,64,80,96,112,128,144,160} /* layer 3 */
},
{ /* MPEG 1.0 */
{0,32,64,96,128,160,192,224,256,288,320,352,384,416,448}, /* layer 1 */
{0,32,48,56,64,80,96,112,128,160,192,224,256,320,384}, /* layer 2 */
{0,32,40,48,56,64,80,96,112,128,160,192,224,256,320} /* layer 3 */
}
};
int frame_samples_index[] = {384,1152,1152};
int frame_size_index[] = {24000, 72000, 72000};
char *mode_text[] = {
"stereo", "joint stereo", "dual channel", "mono"
};
char *emphasis_text[] = {
"none", "50/15 microsecs", "reserved", "CCITT J 17"
};
int get_mp3_info(mp3info *mp3)
{
int had_error = 0;
int frame_type[15]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int samples = 0;
int bitrate;
int frames=0,frame_types=0,frames_so_far=0;
int counter=0;
mp3header header;
struct stat filestat;
off_t data_start=0;
int scantype = SCAN_FULL;
stat(mp3->filename,&filestat);
mp3->datasize=filestat.st_size;
get_id3(mp3);
if(scantype == SCAN_FULL) {
if(get_first_header(mp3,0L)) {
data_start=ftell(mp3->file);
while((bitrate=get_next_header(mp3))) {
frame_type[15-bitrate]++;
frames++;
}
memcpy(&header,&(mp3->header),sizeof(mp3header));
for(counter=0;counter<15;counter++) {
if(frame_type[counter]) {
frame_types++;
header.bitrate=counter;
frames_so_far += frame_type[counter];
samples += frame_samples(&mp3->header)*frame_type[counter];
mp3->sample_rate = header_frequency(&mp3->header);
}
}
mp3->samples = samples - frame_samples_index[2];
}
}
return had_error;
}
int get_first_header(mp3info *mp3, long startpos)
{
int k, l=0,c;
mp3header h, h2;
long valid_start=0;
fseek(mp3->file,startpos,SEEK_SET);
while (1) {
while((c=fgetc(mp3->file)) != 255 && (c != EOF));
if(c == 255) {
ungetc(c,mp3->file);
valid_start=ftell(mp3->file);
if((l=get_header(mp3->file,&h))) {
fseek(mp3->file,l-FRAME_HEADER_SIZE,SEEK_CUR);
for(k=1; (k < MIN_CONSEC_GOOD_FRAMES) && (mp3->datasize-ftell(mp3->file) >= FRAME_HEADER_SIZE); k++) {
if(!(l=get_header(mp3->file,&h2))) break;
if(!sameConstant(&h,&h2)) break;
fseek(mp3->file,l-FRAME_HEADER_SIZE,SEEK_CUR);
}
if(k == MIN_CONSEC_GOOD_FRAMES) {
fseek(mp3->file,valid_start,SEEK_SET);
memcpy(&(mp3->header),&h2,sizeof(mp3header));
mp3->header_isvalid=1;
return 1;
}
}
} else {
return 0;
}
}
return 0;
}
/* get_next_header() - read header at current position or look for
the next valid header if there isn't one at the current position
*/
int get_next_header(mp3info *mp3)
{
int l=0,c,skip_bytes=0;
mp3header h;
while(1) {
while((c=fgetc(mp3->file)) != 255 && (ftell(mp3->file) < mp3->datasize)) skip_bytes++;
if(c == 255) {
ungetc(c,mp3->file);
if((l=get_header(mp3->file,&h))) {
fseek(mp3->file,l-FRAME_HEADER_SIZE,SEEK_CUR);
return 15-h.bitrate;
} else {
skip_bytes += FRAME_HEADER_SIZE;
}
} else {
return 0;
}
}
}
/* Get next MP3 frame header.
Return codes:
positive value = Frame Length of this header
0 = No, we did not retrieve a valid frame header
*/
int get_header(FILE *file,mp3header *header)
{
unsigned char buffer[FRAME_HEADER_SIZE];
int fl;
if(fread(&buffer,FRAME_HEADER_SIZE,1,file)<1) {
header->sync=0;
return 0;
}
header->sync=(((int)buffer[0]<<4) | ((int)(buffer[1]&0xE0)>>4));
if(buffer[1] & 0x10) header->version=(buffer[1] >> 3) & 1;
else header->version=2;
header->layer=(buffer[1] >> 1) & 3;
header->bitrate=(buffer[2] >> 4) & 0x0F;
if((header->sync != 0xFFE) || (header->layer != 1) || (header->bitrate == 0xF)) {
header->sync=0;
return 0;
}
header->crc=buffer[1] & 1;
header->freq=(buffer[2] >> 2) & 0x3;
header->padding=(buffer[2] >>1) & 0x1;
header->extension=(buffer[2]) & 0x1;
header->mode=(buffer[3] >> 6) & 0x3;
header->mode_extension=(buffer[3] >> 4) & 0x3;
header->copyright=(buffer[3] >> 3) & 0x1;
header->original=(buffer[3] >> 2) & 0x1;
header->emphasis=(buffer[3]) & 0x3;
/* Final sanity checks: bitrate 1111b and frequency 11b are reserved (invalid) */
if (header->bitrate == 0x0F || header->freq == 0x3) {
return 0;
}
return ((fl=frame_length(header)) >= MIN_FRAME_SIZE ? fl : 0);
}
int frame_samples(mp3header *header) {
return frame_samples_index[3-header->layer];
}
int frame_length(mp3header *header) {
return header->sync == 0xFFE ?
(frame_size_index[3-header->layer]*((header->version&1)+1)*
header_bitrate(header)/header_frequency(header))+
header->padding : 1;
}
int header_layer(mp3header *h) {return layer_tab[h->layer];}
int header_bitrate(mp3header *h) {
return bitrate[h->version & 1][3-h->layer][h->bitrate];
}
int header_frequency(mp3header *h) {
return frequencies[h->version][h->freq];
}
char *header_emphasis(mp3header *h) {
return emphasis_text[h->emphasis];
}
char *header_mode(mp3header *h) {
return mode_text[h->mode];
}
int sameConstant(mp3header *h1, mp3header *h2) {
if((*(uint*)h1) == (*(uint*)h2)) return 1;
if((h1->version == h2->version ) &&
(h1->layer == h2->layer ) &&
(h1->crc == h2->crc ) &&
(h1->freq == h2->freq ) &&
(h1->mode == h2->mode ) &&
(h1->copyright == h2->copyright ) &&
(h1->original == h2->original ) &&
(h1->emphasis == h2->emphasis ))
return 1;
else return 0;
}
int get_id3(mp3info *mp3) {
int retcode=0;
char fbuf[4];
if(mp3->datasize >= 128) {
if(fseek(mp3->file, -128, SEEK_END )) {
fprintf(stderr,"ERROR: Couldn't read last 128 bytes of %s!!\n",mp3->filename);
retcode |= 4;
} else {
fread(fbuf,1,3,mp3->file); fbuf[3] = '\0';
mp3->id3.genre[0]=255;
if (!strcmp((const char *)"TAG",(const char *)fbuf)) {
mp3->id3_isvalid=1;
mp3->datasize -= 128;
fseek(mp3->file, -125, SEEK_END);
fread(mp3->id3.title,1,30,mp3->file); mp3->id3.title[30] = '\0';
fread(mp3->id3.artist,1,30,mp3->file); mp3->id3.artist[30] = '\0';
fread(mp3->id3.album,1,30,mp3->file); mp3->id3.album[30] = '\0';
fread(mp3->id3.year,1,4,mp3->file); mp3->id3.year[4] = '\0';
fread(mp3->id3.comment,1,30,mp3->file); mp3->id3.comment[30] = '\0';
if(mp3->id3.comment[28] == '\0') {
mp3->id3.track[0] = mp3->id3.comment[29];
}
fread(mp3->id3.genre,1,1,mp3->file);
unpad(mp3->id3.title);
unpad(mp3->id3.artist);
unpad(mp3->id3.album);
unpad(mp3->id3.year);
unpad(mp3->id3.comment);
}
}
}
return retcode;
}
char *unpad(char *string) {
char *pos=string+strlen(string)-1;
while(isspace(pos[0])) (pos--)[0]=0;
return string;
}
}

View File

@ -1,103 +0,0 @@
/*
mp3tech.h - Headers for mp3tech.c
Copyright (C) 2000-2006 Cedric Tefft <cedric@phreaker.net>
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., 675 Mass Ave, Cambridge, MA 02139, USA.
***************************************************************************
This file is based in part on:
* MP3Info 0.5 by Ricardo Cerqueira <rmc@rccn.net>
* MP3Stat 0.9 by Ed Sweetman <safemode@voicenet.com> and
Johannes Overmann <overmann@iname.com>
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
namespace _sbsms_ {
typedef unsigned int uint;
/* MIN_CONSEC_GOOD_FRAMES defines how many consecutive valid MP3 frames
we need to see before we decide we are looking at a real MP3 file */
#define MIN_CONSEC_GOOD_FRAMES 4
#define FRAME_HEADER_SIZE 4
#define MIN_FRAME_SIZE 21
#define NUM_SAMPLES 4
enum VBR_REPORT { VBR_VARIABLE, VBR_AVERAGE, VBR_MEDIAN };
enum SCANTYPE { SCAN_NONE, SCAN_QUICK, SCAN_FULL };
typedef struct {
unsigned long sync;
unsigned int version;
unsigned int layer;
unsigned int crc;
unsigned int bitrate;
unsigned int freq;
unsigned int padding;
unsigned int extension;
unsigned int mode;
unsigned int mode_extension;
unsigned int copyright;
unsigned int original;
unsigned int emphasis;
} mp3header;
typedef struct {
char title[31];
char artist[31];
char album[31];
char year[5];
char comment[31];
unsigned char track[1];
unsigned char genre[1];
} id3tag;
class mp3info {
public:
const char *filename;
FILE *file;
off_t datasize;
int header_isvalid;
mp3header header;
int id3_isvalid;
id3tag id3;
int samples;
int sample_rate;
};
int get_header(FILE *file,mp3header *header);
int frame_samples(mp3header *header);
int frame_length(mp3header *header);
int header_layer(mp3header *h);
int header_bitrate(mp3header *h);
int sameConstant(mp3header *h1, mp3header *h2);
int get_mp3_info(mp3info *mp3);
int get_id3(mp3info *mp3);
int header_frequency(mp3header *h);
char *header_emphasis(mp3header *h);
char *header_mode(mp3header *h);
int get_first_header(mp3info *mp3,long startpos);
int get_next_header(mp3info *mp3);
char *unpad(char *string);
}

View File

@ -1,125 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include "pcm.h"
#include "utils.h"
namespace _sbsms_ {
long PcmReader :: read(float *buf, long block_size) {
if(info.channels == 1) {
float srcbuf[2*PCM_READ_BUF_SIZE];
long nread = -1;
long nreadTotal = 0;
while(nreadTotal < block_size && nread) {
long ntoread = min((long)PCM_READ_BUF_SIZE,block_size-nreadTotal);
nread = sf_readf_float(in, srcbuf, ntoread);
for(int i=0;i<nread;i++) {
int i2 = (nreadTotal+i)<<1;
buf[i2] = buf[i2+1] = srcbuf[i];
}
nreadTotal += nread;
}
if(nreadTotal == 0)
bDone = true;
return nreadTotal;
} else if(info.channels == 2) {
long nread = sf_readf_float(in, buf, block_size);
if(nread == 0)
bDone = true;
return nread;
} else {
abort();
return 0;
}
}
bool PcmReader :: done()
{
return bDone;
}
PcmReader :: PcmReader(const char *filename)
{
total = 0;
bDone = false;
in = sf_open(filename, SFM_READ, &info);
bError = false;
if (!in) {
perror("cannot open file for reading");
bError = true;
}
}
bool PcmReader :: isError()
{
return bError;
}
int PcmReader :: getSampleRate()
{
return info.samplerate;
}
long PcmReader :: getFrames()
{
return info.frames;
}
int PcmReader :: getChannels()
{
return info.channels;
}
PcmReader :: ~PcmReader()
{
sf_close(in);
}
PcmWriter :: PcmWriter(const char *filename, long size, int samplerate, int channels)
{
total = 0;
info.format = SF_FORMAT_WAV | SF_FORMAT_FLOAT;
info.frames = size;
info.samplerate = samplerate;
info.channels = channels;
info.sections = 1;
info.seekable = 0;
if (!sf_format_check(&info))
info.format = (info.format & SF_FORMAT_TYPEMASK);
out = sf_open(filename, SFM_WRITE, &info);
bError = false;
if (!sf_format_check(&info)) {
bError = true;
perror("bad format for writing pcm");
}
if (!out) {
perror("cannot open file for writing");
bError = true;
}
}
bool PcmWriter :: isError()
{
return bError;
}
long PcmWriter :: write(float *data, long n)
{
return sf_writef_float(out, (float *)data, n);
}
PcmWriter :: ~PcmWriter()
{
}
void PcmWriter :: close()
{
if(out) sf_close(out);
}
}

View File

@ -1,57 +0,0 @@
#ifndef PCM_H
#define PCM_H
#include "config.h"
#ifdef HAVE_SNDFILE
#include <sndfile.h>
#include "import.h"
namespace _sbsms_ {
#define PCM_READ_BUF_SIZE 4096
#define PCM_WRITE_BUF_SIZE 4096
class PcmReader : public AudioDecoder {
public:
PcmReader(const char *filename);
~PcmReader();
long decode(audio_in_cb, long block_size, void *data);
long read(float *buf, long block_size);
int getChannels();
int getSampleRate();
long getFrames();
bool isError();
bool done();
protected:
bool bError;
bool bDone;
long total;
SF_INFO info;
SNDFILE *in;
};
class PcmWriter {
public:
PcmWriter(const char *filename,long,int,int);
~PcmWriter();
long write(float *buf, long block_size);
void close();
bool isError();
protected:
bool bError;
long total;
SF_INFO info;
SNDFILE *out;
};
}
#endif
#endif

View File

@ -1,51 +0,0 @@
#include <stdlib.h>
#include <string.h>
#include "sbsms.h"
using namespace _sbsms_;
long pitchCB(void *cb_data, sbsms_resample_frame *frame)
{
pitcher *pitch = (pitcher*) cb_data;
long n_read = sbsms_read_frame(pitch->buf,pitch->sbsmsData,pitch->sbsmser,&(frame->ratio0),&(frame->ratio1));
frame->ratio0 *= pitch->ratio;
frame->ratio1 *= pitch->ratio;
frame->size = n_read;
frame->in = pitch->buf;
return n_read;
}
pitcher *pitch_create(sbsms *sbsmser, void *sbsmsData, real ratio)
{
pitcher *pitch = (pitcher*)calloc(1,sizeof(pitcher));
pitch->ratio = ratio;
pitch->bufsize = sbsmser->bufsize;
pitch->buf = (audio*)calloc(pitch->bufsize,sizeof(audio));
pitch->postResampler = new Resampler(&pitchCB, pitch);
pitch->sbsmsData = sbsmsData;
pitch->sbsmser = sbsmser;
return pitch;
}
void pitch_destroy(pitcher *pitch)
{
delete pitch->postResampler;
free(pitch->buf);
free(pitch);
}
void pitch_reset(pitcher *pitch)
{
pitch->postResampler->reset();
}
long pitch_process(audio *out, long n, pitcher *pitch)
{
return pitch->postResampler->read(out, n);
}
long pitch_get_samples_queued(pitcher *pitch)
{
long queued = sbsms_get_samples_queued(pitch->sbsmser);
long output = pitch->postResampler->samplesInOutput();
return queued + output;
}

View File

@ -1,485 +0,0 @@
#include "config.h"
#ifdef HAVE_PORTAUDIO
#include "sbsms.h"
#include "play.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "audiobuffer.h"
void *writeThreadCB(void *data) {
sbsmsplayer *player = (sbsmsplayer*)data;
while(player->isPlaying()) {
player->writeframe();
}
player->rb->flush();
player->rb->writingComplete();
pitch_reset(player->pitch);
sbsms_reset(player->sbsmser);
pthread_exit(NULL);
return NULL;
}
static int audioCB(const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* timeInfo,
PaStreamCallbackFlags statusFlags,
void *userData )
{
sbsmsplayer *player = (sbsmsplayer*)userData;
float *out = (float*)outputBuffer;
int channels = player->channels;
unsigned long pos = 0;
long ret = player->isStarted()?1:0;
long chunk = framesPerBuffer;
while(pos<framesPerBuffer && ret) {
chunk = framesPerBuffer-pos;
ret = player->readframe(out+pos*channels,chunk);
pos += ret;
}
if(!ret) {
memset(out+pos*channels,0,sizeof(float)*chunk*channels);
}
return paContinue;
}
sbsmsplayer :: sbsmsplayer()
{
init();
bLinear = false;
}
void sbsmsplayer :: init()
{
rb = NULL;
fbuf = NULL;
abuf = NULL;
nullBuf = NULL;
sbsmsIn = NULL;
Fs = 44100;
sbsms_init(4096);
PaError err;
err = Pa_Initialize();
if( err != paNoError ) abort();
frameOffset = 0;
bPlaying = false;
bStarted = false;
bOpen = false;
stream = NULL;
bWriteThread = false;
pthread_mutex_init(&playMutex, NULL);
pthread_mutex_init(&writeMutex, NULL);
playPos = 0;
stopPos = 0;
volume = 0.9f;
rate = 1.0f;
ratio = 1.0f;
}
sbsmsplayer :: sbsmsplayer(const char *filenameIn, real stretch0, real stretch1, real ratio0, real ratio1)
{
init();
si.stretch0 = stretch0;
si.stretch1 = stretch1;
si.ratio0 = ratio0;
si.ratio1 = ratio1;
bLinear = true;
open(filenameIn);
}
sbsmsplayer :: ~sbsmsplayer()
{
PaError err;
err = Pa_Terminate();
if( err != paNoError ) abort();
}
void sbsmsplayer :: writeframe()
{
long n_towrite = 0;
long n_todrop = 0;
if(pthread_mutex_lock(&writeMutex) == 0) {
frameSize = pitch_process(abuf, blockSize, pitch);
n_towrite = frameSize;
n_todrop = 0;
if(frameOffset) {
n_todrop = min(frameOffset,frameSize);
frameOffset -= n_todrop;
n_towrite -= n_todrop;
}
pthread_mutex_unlock(&writeMutex);
if(n_towrite) {
audio_convert_from(fbuf,0,abuf+n_todrop,0,n_towrite);
if(channels==1) {
for(int k=0;k<n_towrite;k++) {
int k2 = k<<1;
fbuf[k] = volume*fbuf[k2];
}
} else if(channels==2) {
for(int k=0;k<n_towrite;k++) {
int k2 = k<<1;
fbuf[k2] = volume*fbuf[k2];
fbuf[k2+1] = volume*fbuf[k2+1];
}
}
rb->write(fbuf,n_towrite);
}
}
}
bool sbsmsplayer :: play()
{
if(!bOpen) return false;
if(isPlaying()) {
return false;
}
bDonePlaying = false;
bPlaying = true;
stopPos = samplesOut;
int rc = pthread_create(&writeThread, NULL, writeThreadCB, (void*)this);
if(rc) {
fprintf(stderr,"ERROR; return code from pthread_create() is %d\n", rc);
exit(-1);
}
bWriteThread = true;
while(!rb->isFull()) {
Pa_Sleep(64);
}
bStarted = true;
return true;
}
bool sbsmsplayer :: pause()
{
if(!isPlaying())
return false;
if(pthread_mutex_lock(&playMutex) == 0) {
stopPos = playPos;
pthread_mutex_unlock(&playMutex);
}
if(bWriteThread) {
pthread_join(writeThread,NULL);
bWriteThread = false;
}
bStarted = false;
bPlaying = false;
setPos(getPos());
return true;
}
void sbsmsplayer :: close()
{
if(rb) { delete rb; rb = NULL; }
if(fbuf) { free(fbuf); fbuf = NULL; }
if(abuf) { free(abuf); abuf = NULL; }
if(nullBuf) { free(nullBuf); nullBuf = NULL; }
if(sbsmsIn) { fclose(sbsmsIn); sbsmsIn = NULL; }
if(stream) {
PaError err;
err = Pa_StopStream( stream );
if( err != paNoError ) abort();
err = Pa_CloseStream( stream );
if( err != paNoError ) abort();
stream = NULL;
}
vSamples.clear();
vSampleOffset.clear();
vByteOffset.clear();
bOpen = false;
bPlaying = false;
bStarted = false;
}
bool sbsmsplayer :: open(const char *filenameIn)
{
sbsmsIn = sbsms_open_read(filenameIn);
if(!sbsmsIn) {
printf("Cannot open file %s\n",filenameIn);
return false;
}
samplesToProcess = sbsms_get_samples_to_process(sbsmsIn);
framesToProcess = sbsms_get_frames_to_process(sbsmsIn);
channels = sbsms_get_channels(sbsmsIn);
quality = sbsms_get_quality(sbsmsIn);
rb = new AudioBuffer(Fs/2,channels);
bDonePlaying = false;
if(bLinear) {
real stretch2;
if(si.stretch0 == si.stretch1)
stretch2 = 1.0/si.stretch0;
else
stretch2 = log(si.stretch1/si.stretch0)/(si.stretch1-si.stretch0);
samplesOut = (long)(samplesToProcess * stretch2);
si.samplesToProcess = samplesToProcess;
si.samplesToGenerate = samplesOut;
sbsmser = sbsms_create(sbsmsIn,&stretchCBLinear,&ratioCBLinear);
} else {
samplesOut = samplesToProcess;
si.stretch0 = 1.0f;
si.ratio0 = 1.0f;
sbsmser = sbsms_create(sbsmsIn,&stretchCBConstant,&ratioCBConstant);
readFooter(sbsmsIn);
}
sbsms_seek_start_data(sbsmsIn);
pitch = pitch_create(sbsmser,&si,1.0);
fbuf = (float*)calloc(SBSMS_MAX_FRAME_SIZE[quality]*2,sizeof(float));
abuf = (audio*)calloc(SBSMS_MAX_FRAME_SIZE[quality],sizeof(audio));
nullBuf = (float*)calloc(SBSMS_MAX_FRAME_SIZE[quality]*2,sizeof(float));
blockSize = SBSMS_FRAME_SIZE[quality];
bOpen = true;
playPos = 0;
frameOffset = 0;
PaError err;
PaStreamParameters outputParameters;
outputParameters.device = Pa_GetDefaultOutputDevice();
outputParameters.channelCount = channels;
outputParameters.sampleFormat = paFloat32;
outputParameters.suggestedLatency = .1;
outputParameters.hostApiSpecificStreamInfo = NULL;
PaStreamFlags flags = paNoFlag;
err = Pa_OpenStream( &stream,
NULL,
&outputParameters,
Fs,
blockSize,
flags,
audioCB,
this);
if( err != paNoError ) {
printf("pa error %d\n",err);
exit(-1);
}
err = Pa_StartStream( stream );
if( err != paNoError ) {
printf("pa error %d\n",err);
exit(-1);
}
setRate(rate);
setRatio(ratio);
return true;
}
long sbsmsplayer :: readframe(float *buf, long n)
{
long ret = 0;
if(pthread_mutex_lock(&playMutex) == 0) {
ret = rb->read(buf,n);
playPos += ret;
if(playPos >= stopPos) {
bPlaying = false;
bDonePlaying = true;
}
pthread_mutex_unlock(&playMutex);
}
return ret;
}
bool sbsmsplayer :: isStarted()
{
return bStarted;
}
bool sbsmsplayer :: isPlaying()
{
return bPlaying;
}
bool sbsmsplayer :: isDonePlaying()
{
return bDonePlaying;
}
real sbsmsplayer :: getPos()
{
real pos = 0.0f;
if(pthread_mutex_lock(&playMutex) == 0) {
pos = (real)playPos/(real)samplesOut;
pthread_mutex_unlock(&playMutex);
}
return pos;
}
real sbsmsplayer :: getTime()
{
real t = 0.0f;
if(pthread_mutex_lock(&playMutex) == 0) {
t = (real)playPos/(real)Fs;
pthread_mutex_unlock(&playMutex);
}
return t;
}
void sbsmsplayer :: readFooter(FILE *fp)
{
long frames = sbsms_get_frames_to_process(fp);
long footerFrameSize = 2*sizeof(long);
long footerSize = frames*footerFrameSize;
fseek(fp,-footerSize,SEEK_END);
long samplesAcc = 0;
for(int k=0;k<frames;k++) {
long offset;
long samples;
fread(&offset,sizeof(long),1,fp);
fread(&samples,sizeof(long),1,fp);
vByteOffset.push_back(offset);
vSamples.push_back(samples);
vSampleOffset.push_back(samplesAcc);
samplesAcc += samples;
}
}
long sbsmsplayer :: getFrameIndexForSamplePos(long samplePos)
{
if(samplePos<0) samplePos = 0;
else if(samplePos>=samplesToProcess) samplePos = samplesToProcess-1;
long i = vSampleOffset.size()>>1;
long imin = 0;
long imax = (long)vSampleOffset.size()-1;
bool bDone = false;
do {
bDone = (i==0 || i==(long)vSampleOffset.size()-1 ||
(vSampleOffset[i]<=samplePos && vSampleOffset[i+1] > samplePos));
if(!bDone) {
if(vSampleOffset[i] < samplePos) {
imin = i;
if(imin+1==imax)
i = imax;
else
i = (imin+imax)>>1;
} else {
imax = i;
if(imin+1==imax)
i = imin;
else
i = (imin+imax)>>1;
}
}
} while(!bDone);
return i;
}
bool sbsmsplayer :: setPos(real pos)
{
if(isPlaying())
return false;
bDonePlaying = false;
bStarted = false;
if(bOpen) {
long samplePos = (long)(pos*samplesToProcess);
long i = getFrameIndexForSamplePos(samplePos);
if(bWriteThread) {
pthread_join(writeThread,NULL);
bWriteThread = false;
}
sbsms_seek(sbsmser,i,vSampleOffset[i]);
fseek(sbsmsIn,vByteOffset[i],SEEK_SET);
real stretch = 1.0f;
if(pthread_mutex_lock(&writeMutex) == 0) {
stretch = 1.0f/si.stretch0;
frameOffset = (long)(stretch*(real)(samplePos - vSampleOffset[i]));
pthread_mutex_unlock(&writeMutex);
}
if(pthread_mutex_lock(&playMutex) == 0) {
samplesOut =(long)(samplesToProcess*stretch);
stopPos = samplesOut;
playPos = (long)(pos*samplesToProcess*stretch);
pthread_mutex_unlock(&playMutex);
}
}
return true;
}
void sbsmsplayer :: setLength()
{
real stretch = 1.0f;
long nFramesQueued = 0;
long nSamplesQueued = 0;
long nSamplesReadable = 0;
long inputFrameSize = 0;
long framePos = 0;
if(pthread_mutex_lock(&writeMutex) == 0) {
stretch = 1.0f/si.stretch0;
nFramesQueued = sbsms_get_frames_queued(sbsmser);
nSamplesQueued = pitch_get_samples_queued(pitch);
nSamplesReadable = rb->n_readable();
inputFrameSize = sbsms_get_last_input_frame_size(sbsmser);
framePos = sbsms_get_frame_pos(sbsmser);
pthread_mutex_unlock(&writeMutex);
}
long nSamplesLeft = (long)((samplesToProcess-(framePos+nFramesQueued)*inputFrameSize)*stretch);
long newSamplesOut = playPos + nSamplesReadable + nSamplesQueued + nSamplesLeft;
if(pthread_mutex_lock(&playMutex) == 0) {
samplesOut = newSamplesOut;
stopPos = newSamplesOut;
pthread_mutex_unlock(&playMutex);
}
}
real sbsmsplayer :: getDuration()
{
return (real)(samplesOut)/(real)(Fs);
}
void sbsmsplayer :: setVolume(real vol)
{
this->volume = vol;
}
void sbsmsplayer :: setRate(real rate)
{
this->rate = rate;
if(pthread_mutex_lock(&writeMutex) == 0) {
this->si.stretch0 = rate;
pthread_mutex_unlock(&writeMutex);
}
setLength();
}
void sbsmsplayer :: setRatio(real ratio)
{
this->ratio = ratio;
if(pthread_mutex_lock(&writeMutex) == 0) {
this->si.ratio0 = ratio;
this->si.ratio1 = ratio;
pthread_mutex_unlock(&writeMutex);
}
}
real sbsmsplayer :: getVolume()
{
return volume;
}
real sbsmsplayer :: getRate()
{
return rate;
}
real sbsmsplayer :: getRatio()
{
return ratio;
}
#endif

View File

@ -1,95 +0,0 @@
#include "config.h"
#ifdef HAVE_PORTAUDIO
#ifndef SBSMSPLAY_H
#define SBSMSPLAY_H
#include "portaudio.h"
#include "audio.h"
#include "utils.h"
#include <pthread.h>
#include "audiobuffer.h"
#include <stdio.h>
#include "sbsms.h"
#include <vector>
using namespace std;
class sbsmsplayer {
public:
sbsmsplayer();
sbsmsplayer(const char *filenameIn, real stretch0, real stretch1, real ratio0, real ratio1);
~sbsmsplayer();
bool play();
bool pause();
void close();
bool open(const char *filename);
real getPos();
bool setPos(real pos);
real getTime();
real getDuration();
void setVolume(real vol);
void setRate(real rate);
void setRatio(real ratio);
real getVolume();
real getRate();
real getRatio();
void readFooter(FILE *fp);
long getFrameIndexForSamplePos(long samplePos);
long readframe(float *buf, long n);
bool isPlaying();
bool isStarted();
bool isDonePlaying();
void writeframe();
int channels;
AudioBuffer *rb;
sbsms *sbsmser;
pitcher *pitch;
protected:
void setLength();
real ratio;
real volume;
real rate;
long playPos;
long stopPos;
long frameSize;
long frameOffset;
long samplesToProcess;
long framesToProcess;
long samplesOut;
bool bWriteThread;
bool bOpen;
bool bStarted;
bool bPlaying;
bool bDonePlaying;
bool bLinear;
FILE *sbsmsIn;
void init();
PaStream *stream;
int quality;
int Fs;
pthread_t writeThread;
pthread_mutex_t playMutex;
pthread_mutex_t writeMutex;
vector<long> vByteOffset;
vector<long> vSampleOffset;
vector<long> vSamples;
long blockSize;
float *fbuf;
audio *abuf;
float *nullBuf;
sbsmsInfo si;
};
#endif
#endif

View File

@ -5,10 +5,12 @@
#include "sincCoeffs.h"
#include "real.h"
#include "utils.h"
#include <algorithm>
using namespace std;
using namespace _sbsms_;
namespace _sbsms_ {
#define SBSMS_RESAMPLE_CHUNK_SIZE ((long)8192)
#define SBSMS_RESAMPLE_CHUNK_SIZE 8192L
Resampler :: Resampler(sbsms_resample_cb cb, void *data)
{
@ -224,3 +226,5 @@ Resampler :: ~Resampler()
{
delete out;
}
}

View File

@ -16,19 +16,29 @@
#include <pthread.h>
#endif
using namespace _sbsms_;
namespace _sbsms_ {
real SBSMS_P1 = 2.0f;
real SBSMS_Q1 = (4.0f/3.0f);
int SBSMS_FRAME_SIZE[SBSMS_QUALITIES] = {512,512,512};
int SBSMS_BANDS[SBSMS_QUALITIES] = {7,7,7};
int SBSMS_MAX_FRAME_SIZE[SBSMS_QUALITIES] = {SBSMS_MAX_STRETCH*512,SBSMS_MAX_STRETCH*512,SBSMS_MAX_STRETCH*512};
int SBSMS_H[SBSMS_QUALITIES][5] = {{8,12,16,24,32},{6,8,8,8,12},{4,6,8,12,16}};
int SBSMS_M_MAX[SBSMS_QUALITIES] = {64,64,64};
int SBSMS_RES[SBSMS_QUALITIES][SBSMS_MAX_BANDS] = {{1,1,1,2,2,1,1}, {1,1,2,2,1,2,1}, {1,1,2,2,2,2,1}};
real SBSMS_PAD[SBSMS_QUALITIES][SBSMS_MAX_BANDS] = {{2,2,4,4,4,4,4},{2,2,4,4,4,4,6},{4,4,4,4,4,6}};
int SBSMS_N[SBSMS_QUALITIES][SBSMS_MAX_BANDS] = {{384,384,576,480,384,288,252},{384,384,576,480,384,288,336},{768,768,576,480,384,288,288}};
const sbsms_quality sbsms_quality_standard = {
512,6400,0.08f,12.5f,7,64,
{6,8,8,8,12},
{384,384,576,480,384,288,336,NULL},
{4,4,4,4,4,4,4,NULL},
{1,1,2,2,1,2,1,NULL},
{2.00f,2.00f,4.00f,4.00f,4.00f,4.00f,6.00f,NULL},
{2.00f,2.00f,2.00f,2.00f,2.00f,2.00f,2.00f,NULL},
{0.75f,0.75f,0.75f,0.75f,0.75f,0.75f,0.75f,NULL}
};
const sbsms_quality sbsms_quality_fast = {
512,6400,0.08f,12.5f,7,64,
{6,8,8,8,12},
{192,192,288,240,192,144,168,NULL},
{4,4,4,4,4,4,4,NULL},
{1,1,2,2,1,2,1,NULL},
{2.00f,2.00f,2.00f,2.00f,2.00f,2.00f,3.00f,NULL},
{2.00f,2.00f,2.00f,2.00f,2.00f,2.00f,2.00f,NULL},
{0.50f,0.50f,0.75f,0.75f,0.75f,0.75f,0.75f,NULL}
};
#ifdef MULTITHREADED
@ -301,10 +311,7 @@ void sbsms_init(int n) {
void sbsms_private_init(sbsms *sbsmser, bool bAnalyze, bool bSynthesize)
{
sbsmser->bufsize = SBSMS_MAX_FRAME_SIZE[sbsmser->quality];
sbsmser->chunksize = SBSMS_FRAME_SIZE[sbsmser->quality];
sbsmser->n_postpad = LONG_MAX;
sbsmser->ina = make_audio_buf(sbsmser->bufsize);
sbsmser->ina = make_audio_buf(sbsmser->quality.maxoutframesize);
sbsms_init_threads(sbsmser,bAnalyze,bSynthesize);
}
@ -313,12 +320,13 @@ void sbsms_reset(sbsms *sbsmser)
sbsmser->ta->init();
sbsmser->n_processed = 0;
sbsmser->bWritingComplete = false;
if(sbsmser->getSamplesCB) {
sbsmser->n_prepad = SBSMS_N[sbsmser->quality][SBSMS_BANDS[sbsmser->quality]-1]*SBSMS_M_MAX[sbsmser->quality];
sbsmser->n_prespent = SBSMS_N[sbsmser->quality][SBSMS_BANDS[sbsmser->quality]-1]/SBSMS_H[sbsmser->quality][2]/2;
sbsmser->n_prepad = sbsmser->quality.N[sbsmser->quality.bands-1] * sbsmser->quality.M_MAX;
sbsmser->n_prespent = sbsmser->quality.N[sbsmser->quality.bands-1] / sbsmser->quality.H[2] / 2;
} else {
sbsmser->n_prepad = SBSMS_N[sbsmser->quality][SBSMS_BANDS[sbsmser->quality]-1]/SBSMS_H[sbsmser->quality][2]/2;
sbsmser->n_prespent = SBSMS_N[sbsmser->quality][SBSMS_BANDS[sbsmser->quality]-1]/SBSMS_H[sbsmser->quality][2]/2;
sbsmser->n_prepad = 0;
sbsmser->n_prespent = 0;
}
sbsmser->top->reset();
}
@ -329,7 +337,7 @@ void sbsms_seek(sbsms *sbsmser, long framePos, long samplePos)
sbsmser->top->seek(framePos);
}
sbsms* sbsms_create(FILE *fp, sbsms_stretch_cb getStretchCB, sbsms_ratio_cb getRatioCB)
sbsms* sbsms_create(FILE *fp, sbsms_rate_cb getRateCB, sbsms_pitch_cb getPitchCB)
{
sbsms *sbsmser = (sbsms*) calloc(1,sizeof(sbsms));
// samples, frames
@ -338,33 +346,33 @@ sbsms* sbsms_create(FILE *fp, sbsms_stretch_cb getStretchCB, sbsms_ratio_cb getR
fread(&samples,sizeof(long),1,fp);
fread(&frames,sizeof(long),1,fp);
fread(&(sbsmser->channels),sizeof(int),1,fp);
fread(&(sbsmser->quality),sizeof(int),1,fp);
fread(&(sbsmser->quality),sizeof(sbsms_quality),1,fp);
unsigned short maxtrackindex;
fread(&maxtrackindex,sizeof(unsigned short),1,fp);
sbsmser->fp = fp;
sbsmser->getSamplesCB = NULL;
sbsmser->getStretchCB = getStretchCB;
sbsmser->getRatioCB = getRatioCB;
sbsmser->getRateCB = getRateCB;
sbsmser->getPitchCB = getPitchCB;
sbsmser->ta = new TrackAllocator(false,maxtrackindex);
sbsmser->pa = new PeakAllocator();
sbsmser->top = new subband(NULL,1,sbsmser->channels,sbsmser->quality,2,false,sbsmser->ta,sbsmser->pa);
sbsmser->top = new subband(NULL,1,sbsmser->channels,&sbsmser->quality,2,false,sbsmser->ta,sbsmser->pa);
sbsmser->top->setFramesInFile(frames);
sbsms_private_init(sbsmser,false,false);
sbsms_reset(sbsmser);
return sbsmser;
}
sbsms* sbsms_create(sbsms_cb getSamplesCB, sbsms_stretch_cb getStretchCB, sbsms_ratio_cb getRatioCB, int channels, int quality, bool bPreAnalyze, bool bSynthesize)
sbsms* sbsms_create(sbsms_cb getSamplesCB, sbsms_rate_cb getRateCB, sbsms_pitch_cb getPitchCB, int channels, sbsms_quality *quality, bool bPreAnalyze, bool bSynthesize)
{
sbsms *sbsmser = (sbsms*) calloc(1,sizeof(sbsms));
sbsmser->channels = channels;
sbsmser->quality = quality;
sbsmser->quality = *quality;
sbsmser->getSamplesCB = getSamplesCB;
sbsmser->getStretchCB = getStretchCB;
sbsmser->getRatioCB = getRatioCB;
sbsmser->getRateCB = getRateCB;
sbsmser->getPitchCB = getPitchCB;
sbsmser->ta = new TrackAllocator(true);
sbsmser->pa = new PeakAllocator();
sbsmser->top = new subband(NULL,1,sbsmser->channels,sbsmser->quality,6,bPreAnalyze,sbsmser->ta,sbsmser->pa);
sbsmser->top = new subband(NULL,1,sbsmser->channels,&sbsmser->quality,6,bPreAnalyze,sbsmser->ta,sbsmser->pa);
sbsms_private_init(sbsmser,true,bSynthesize);
sbsms_reset(sbsmser);
return sbsmser;
@ -390,34 +398,27 @@ void sbsms_pre_analyze_complete(sbsms *sbsmser)
long sbsms_pre_analyze(sbsms_cb getSamplesCB, void *data, sbsms *sbsmser)
{
long n_towrite = 0;
real stretch = (sbsmser->getStretchCB)(sbsmser->n_processed,data);
real ratio = (sbsmser->getRatioCB)(sbsmser->n_processed,data);
real a = 1.0/(ratio*stretch);
real rate = (sbsmser->getRateCB)(sbsmser->n_processed,data);
real pitch = (sbsmser->getPitchCB)(sbsmser->n_processed,data);
real a = 1.0f/rate;
if(sbsmser->n_prepad) {
a = 1.0;
n_towrite = min(sbsmser->chunksize,sbsmser->n_prepad);
n_towrite = min(sbsmser->quality.inframesize,sbsmser->n_prepad);
memset(sbsmser->ina,0,n_towrite*sizeof(audio));
sbsmser->n_prepad -= n_towrite;
} else {
n_towrite = getSamplesCB(sbsmser->ina,sbsmser->chunksize,data);
n_towrite = getSamplesCB(sbsmser->ina,sbsmser->quality.inframesize,data);
sbsmser->n_processed += n_towrite;
if(n_towrite == 0) {
if(sbsmser->n_postpad) {
n_towrite = min(sbsmser->chunksize,sbsmser->n_postpad);
memset(sbsmser->ina,0,n_towrite*sizeof(audio));
sbsmser->n_postpad -= n_towrite;
}
}
if(n_towrite==0) {
sbsmser->bWritingComplete = true;
sbsmser->top->writingComplete();
n_towrite = sbsmser->quality.inframesize;
memset(sbsmser->ina,0,n_towrite*sizeof(audio));
}
}
return sbsmser->top->preAnalyze(sbsmser->ina, n_towrite, a, ratio);
return sbsmser->top->preAnalyze(sbsmser->ina, n_towrite, a, pitch);
}
long sbsms_read_frame(audio *buf, void *data, sbsms *sbsmser, real *ratio0, real *ratio1)
long sbsms_read_frame(audio *buf, void *data, sbsms *sbsmser, real *pitch0, real *pitch1)
{
long n_read = 0;
long n_write = 0;
@ -426,16 +427,16 @@ long sbsms_read_frame(audio *buf, void *data, sbsms *sbsmser, real *ratio0, real
#endif
do {
real stretch = (sbsmser->getStretchCB)(sbsmser->n_processed,data);
real ratio = (sbsmser->getRatioCB)(sbsmser->n_processed,data);
real a = 1.0/(ratio*stretch);
real rate = (sbsmser->getRateCB)(sbsmser->n_processed,data);
real pitch = (sbsmser->getPitchCB)(sbsmser->n_processed,data);
real a = 1.0f/rate;
if(sbsmser->n_prespent) {
n_read = sbsmser->top->read(NULL, ratio0, ratio1);
n_read = sbsmser->top->read(NULL, pitch0, pitch1);
if(n_read) sbsmser->n_prespent--;
n_read = 0;
} else {
n_read = sbsmser->top->read(buf, ratio0, ratio1);
n_read = sbsmser->top->read(buf, pitch0, pitch1);
}
n_write = 0;
@ -449,46 +450,34 @@ long sbsms_read_frame(audio *buf, void *data, sbsms *sbsmser, real *ratio0, real
if(n_read == 0) {
#ifdef MULTITHREADED
if(!sbsmser->top->isWriteReady()) {
pthread_mutex_lock(&threadData->writeMutex);
pthread_cond_wait(&threadData->writeCond,&threadData->writeMutex);
pthread_mutex_unlock(&threadData->writeMutex);
pthread_mutex_lock(&threadData->writeMutex);
pthread_cond_wait(&threadData->writeCond,&threadData->writeMutex);
pthread_mutex_unlock(&threadData->writeMutex);
}
#endif
long n_towrite = 0;
if(sbsmser->getSamplesCB) {
if(sbsmser->n_prepad) {
a = 1.0;
n_towrite = min(sbsmser->chunksize,sbsmser->n_prepad);
memset(sbsmser->ina,0,n_towrite*sizeof(audio));
sbsmser->n_prepad -= n_towrite;
} else {
n_towrite = (sbsmser->getSamplesCB)(sbsmser->ina,sbsmser->chunksize,data);
sbsmser->n_processed += n_towrite;
if(n_towrite == 0) {
if(sbsmser->n_postpad) {
n_towrite = min(sbsmser->chunksize,sbsmser->n_postpad);
memset(sbsmser->ina,0,n_towrite*sizeof(audio));
sbsmser->n_postpad -= n_towrite;
}
}
if(n_towrite==0) {
sbsmser->bWritingComplete = true;
sbsmser->top->writingComplete();
}
}
n_write = sbsmser->top->write(sbsmser->ina, n_towrite, a, ratio);
if(sbsmser->n_prepad) {
a = 1.0;
n_towrite = min(sbsmser->quality.inframesize,sbsmser->n_prepad);
memset(sbsmser->ina,0,n_towrite*sizeof(audio));
sbsmser->n_prepad -= n_towrite;
} else {
n_towrite = (sbsmser->getSamplesCB)(sbsmser->ina,sbsmser->quality.inframesize,data);
sbsmser->n_processed += n_towrite;
if(n_towrite == 0) {
n_towrite = sbsmser->quality.inframesize;
memset(sbsmser->ina,0,n_towrite*sizeof(audio));
}
}
n_write = sbsmser->top->write(sbsmser->ina, n_towrite, a, pitch);
} else {
if(sbsmser->n_prepad) {
n_write = sbsmser->top->zeroPad();
sbsmser->n_prepad--;
} else {
n_write = sbsmser->top->readFromFile(sbsmser->fp, a, ratio);
sbsmser->n_processed += n_write;
if(n_write == 0) {
sbsmser->bWritingComplete = true;
sbsmser->top->writingComplete();
}
}
n_write = sbsmser->top->readFromFile(sbsmser->fp, a, pitch);
sbsmser->n_processed += n_write;
if(n_write == 0) {
sbsmser->bWritingComplete = true;
sbsmser->top->writingComplete();
}
}
}
#ifdef MULTITHREADED
@ -513,6 +502,7 @@ long sbsms_read_frame(audio *buf, void *data, sbsms *sbsmser, real *ratio0, real
pthread_mutex_unlock(&threadData->assignMutex);
}
#endif
if(sbsmser->bWritingComplete &&
!sbsmser->top->isframe_readable() &&
sbsmser->top->getFramesAtBack() == 0) {
@ -531,9 +521,9 @@ long sbsms_write_frame(FILE *fp, void *data, sbsms *sbsmser)
#endif
do {
real stretch = (sbsmser->getStretchCB)(sbsmser->n_processed,data);
real ratio = (sbsmser->getRatioCB)(sbsmser->n_processed,data);
real a = 1.0/(ratio*stretch);
real rate = (sbsmser->getRateCB)(sbsmser->n_processed,data);
real pitch = (sbsmser->getPitchCB)(sbsmser->n_processed,data);
real a = 1.0f/rate;
n_tofile = sbsmser->top->getFramesWrittenToFile();
@ -548,32 +538,27 @@ long sbsms_write_frame(FILE *fp, void *data, sbsms *sbsmser)
if(n_tofile == 0) {
#ifdef MULTITHREADED
if(!sbsmser->top->isWriteReady()) {
pthread_mutex_lock(&threadData->writeMutex);
pthread_cond_wait(&threadData->writeCond,&threadData->writeMutex);
pthread_mutex_unlock(&threadData->writeMutex);
pthread_mutex_lock(&threadData->writeMutex);
pthread_cond_wait(&threadData->writeCond,&threadData->writeMutex);
pthread_mutex_unlock(&threadData->writeMutex);
}
#endif
if(sbsmser->top->isWriteReady()) {
long n_towrite = 0;
if(sbsmser->n_prepad) {
a = 1.0;
n_towrite = min(sbsmser->chunksize,sbsmser->n_prepad);
memset(sbsmser->ina,0,n_towrite*sizeof(audio));
sbsmser->n_prepad -= n_towrite;
} else {
n_towrite = (sbsmser->getSamplesCB)(sbsmser->ina,sbsmser->chunksize,data);
sbsmser->n_processed += n_towrite;
if(n_towrite == 0) {
if(sbsmser->n_postpad) {
n_towrite = min(sbsmser->chunksize,sbsmser->n_postpad);
memset(sbsmser->ina,0,n_towrite*sizeof(audio));
sbsmser->n_postpad -= n_towrite;
}
}
if(!sbsmser->n_postpad)
sbsmser->top->writingComplete();
}
n_write = sbsmser->top->write(sbsmser->ina, n_towrite, a, ratio);
long n_towrite = 0;
if(sbsmser->n_prepad) {
a = 1.0;
n_towrite = min(sbsmser->quality.inframesize,sbsmser->n_prepad);
memset(sbsmser->ina,0,n_towrite*sizeof(audio));
sbsmser->n_prepad -= n_towrite;
} else {
n_towrite = (sbsmser->getSamplesCB)(sbsmser->ina,sbsmser->quality.inframesize,data);
sbsmser->n_processed += n_towrite;
if(n_towrite == 0) {
n_towrite = sbsmser->quality.inframesize;
memset(sbsmser->ina,0,n_towrite*sizeof(audio));
}
}
n_write = sbsmser->top->write(sbsmser->ina, n_towrite, a, pitch);
}
}
#ifdef MULTITHREADED
@ -625,10 +610,9 @@ FILE *sbsms_open_write(const char *fileName, sbsms *sbsmser, long samples_to_pro
long nframes = 0;
fwrite(&nframes,sizeof(long),1,fp);
fwrite(&(sbsmser->channels),sizeof(int),1,fp);
fwrite(&(sbsmser->quality),sizeof(int),1,fp);
fwrite(&(sbsmser->quality),sizeof(sbsms_quality),1,fp);
unsigned short maxtrackindex = 0;
fwrite(&maxtrackindex,sizeof(unsigned short),1,fp);
sbsmser->top->fp = fp;
return fp;
}
@ -666,20 +650,19 @@ long sbsms_get_channels(FILE *fp)
return channels;
}
long sbsms_get_quality(FILE *fp)
void sbsms_get_quality(FILE *fp, sbsms_quality *quality)
{
//samples, frames, channels
long offset = 2*sizeof(long) + sizeof(int);
fseek(fp,offset,SEEK_SET);
int quality;
fread(&quality,sizeof(int),1,fp);
return quality;
fread(quality,sizeof(sbsms_quality),1,fp);
}
void sbsms_seek_start_data(FILE *fp)
{
// samples, frames, channels, quality, maxtrackindex
long offset = 2*sizeof(long) + 2*sizeof(int) + sizeof(unsigned short);
long offset = 2*sizeof(long) + sizeof(int) + sizeof(sbsms_quality) + sizeof(unsigned short);
fseek(fp,offset,SEEK_SET);
}
@ -708,38 +691,56 @@ long sbsms_get_frame_pos(sbsms *sbsmser)
return sbsmser->top->getFramePos();
}
real stretchCBLinear(long nProcessed, void *userData)
real rateCBLinear(long nProcessed, void *userData)
{
sbsmsInfo *si = (sbsmsInfo*) userData;
real t0 = (real)nProcessed/(real)si->samplesToProcess;
real stretch = si->stretch0 + (si->stretch1-si->stretch0)*t0;
return stretch;
if(t0 > 1.0) t0 = 1.0;
real rate = si->rate0 + (si->rate1-si->rate0)*t0;
return rate;
}
real stretchCBConstant(long nProcessed, void *userData)
real rateCBConstant(long nProcessed, void *userData)
{
sbsmsInfo *si = (sbsmsInfo*) userData;
return si->stretch0;
return si->rate0;
}
real ratioCBLinear(long nProcessed, void *userData)
long getLinearOutputSamples(sbsmsInfo *si)
{
real s;
if(si->rate0 == si->rate1) {
s = 1.0f / si->rate0;
} else {
s = log(si->rate1/si->rate0)/(si->rate1-si->rate0);
}
return (long) (s * si->samplesToProcess);
}
real pitchCBLinear(long nProcessed, void *userData)
{
sbsmsInfo *si = (sbsmsInfo*) userData;
real t0 = (real)nProcessed/(real)si->samplesToProcess;
real stretch = si->stretch0 + (si->stretch1-si->stretch0)*t0;
real t1;
if(stretch == si->stretch0)
t1 = 1.0/stretch;
if(t0 > 1.0f) t0 = 1.0f;
real rate = si->rate0 + (si->rate1-si->rate0)*t0;
real stretch;
if(rate == si->rate0)
stretch = 1.0/rate;
else
t1 = log(stretch/si->stretch0)/(stretch-si->stretch0);
stretch = log(rate/si->rate0)/(rate-si->rate0);
real t1 = stretch * (real)nProcessed/(real)si->samplesToGenerate;
if(t1 > 1.0f) t1 = 1.0f;
real ratio = si->ratio0 + (si->ratio1-si->ratio0)*t1*(real)nProcessed/(real)si->samplesToGenerate;
return ratio;
real pitch = si->pitch0 + (si->pitch1-si->pitch0)*t1;
return pitch;
}
real ratioCBConstant(long nProcessed, void *userData)
real pitchCBConstant(long nProcessed, void *userData)
{
sbsmsInfo *si = (sbsmsInfo*) userData;
return si->ratio0;
return si->pitch0;
}
}

View File

@ -3,20 +3,20 @@
#include <math.h>
#include "sms.h"
#include "buffer.h"
#include "defs.h"
#include "limits.h"
#include <limits.h>
using namespace std;
namespace _sbsms_ {
#define SMS_BUF_SIZE 4096
sms :: sms(int N, unsigned short M, unsigned short M_MAX, int res, int latency, real p, real q, real pad, int Nlo, int channels, TrackAllocator *ta, PeakAllocator *pa) {
sms :: sms(int N, unsigned short M, unsigned short M_MAX, int res, int latency, real p, real q, real pad, int Nlo, int channels, TrackAllocator *ta, PeakAllocator *pa)
{
this->N = N;
this->M = M;
Nover2 = N/2;
this->p = 1.0/p;
this->q = q;
this->q = 1.0/q;
this->res = res;
this->m = (real)M/(real)M_MAX;
this->channels = channels;
@ -29,64 +29,57 @@ sms :: sms(int N, unsigned short M, unsigned short M_MAX, int res, int latency,
// Phase lock channels
bPhaseLock = 0;
// Stitch bands together
bStitch = 1;
// Threshold (relative to maximum magnitude) for finding peaks
// Threshold (relative to max magnitude) for finding peaks
peakThresh = .000005;
// Threshold (in trackpoint units) for starting a track
startThresh = 8.0*sqrt(pad/(real)N) * peakThresh;
// Maximum figure of merit for continuing a track (see merit)
// Max figure of merit for continuing a track (see merit)
maxMerit2 = square(.11);
// Maximum differency in frequency for continuing a track
// Max differency in frequency for continuing a track
maxDF2 = square(.08);
// Coefficient for dB magnitude changes in figure of merit for continuing a track
dMCoeff = 0.01;
// Maximum increase in dB for continuing a track
// Max increase in dB for continuing a track
maxdBIncr = (12.0 - 6.0*m);
// Maximum difference in dB for stitching two subband tracks together
// Max difference in dB for stitching two subband tracks together
maxdBIncrStitch = (12.0 - 6.0*m);
// Maximum figure of merit for matching tracks for phase locking
// Max figure of merit for matching tracks for phase locking
maxMerit2PhaseLock = square(.01);
// Maximum differene in frequency for matching tracks for phase locking
// Max differene in frequency for matching tracks for phase locking
maxDF2PhaseLock = square(.005);
// Coefficient for dB magnitude changes in figure of merit for phase locking
dMCoeffPhaseLock = 0.0005;
// Maximum figure of merit for matching peaks for band stitching
// Max figure of merit for matching peaks for band stitching
maxMerit2Match = square(.08);
// Maximum difference in frequency for matching peaks for band stitching
// Max difference in frequency for matching peaks for band stitching
maxDF2Match = square(.04);
// Coefficient for dB magnitude changes in figure of merit for band stitching
dMCoeffMatch = 0.02;
// Minimum number of trackpoints in a track for synthesis
// Min number of trackpoints in a track for synthesis
minNpts = 4;
// Maximum width of a peak for determining spectral energy
// Max width of a peak for determining spectral energy
peakWidth = 2*((round2int(pad*(real)N/96.0)+1)/2);
// Beginning and end of band
if(terminal) kStart = 1;
else kStart = N/4-(int)(0.5*round2int((real)peakWidth*(real)N/(real)Nlo)+6);
if(M==1) kEnd = N/2;
else kEnd = N/2-peakWidth;
// Maximum frequency for matching peaks for band stitching
maxFMatch = (0.5*kEnd+8.0)*TWOPI/(real)N;
// Minimum frequency for matching peaks for band stitching
minFMatch = (2.0*kStart-16.0)*TWOPI/(real)N;
// Minimum ratio of peak "top" to total peak energy
// Max frequency for matching peaks for band stitching
maxFMatch = (0.5*kEnd+5.0)*TWOPI/(real)N;
// Min frequency for matching peaks for band stitching
minFMatch = (2.0*kStart-10.0)*TWOPI/(real)N;
// Min ratio of peak "top" to total peak energy
minPeakTopRatio = 0.05;
// Minimum ratio of low frequency resolution/high frequency resolution peaks for determining peaks
// Min ratio of low frequency resolution/high frequency resolution peaks for determining peaks
// Ratio for favoring continuing a track in local band over stitching to another band
localFavorRatio = 1.1;
// Maximum ratio of (peak energy given to other peaks) to (peak energy)
// Max ratio of (peak energy given to other peaks) to (peak energy)
maxDecRatio = 1.5;
// Normalization from spectrum energy to peak amplitude
if(SBSMS_WINDOW == SBSMS_HANN)
mNorm = 1.0/6.0 * pad * square(8.0 / (real)(N));
else if(SBSMS_WINDOW == SBSMS_HAMMING)
mNorm = 0.18141196440283 * pad * square(8.0 / (real)(N));
else
abort();
mNorm = 1.0/6.0 * pad * square(8.0 / (real)(N));
// maximum magnitude (for determining peaks)
// max magnitude (for determining peaks)
magmax = 0;
assigntime[0] = 0;
@ -110,18 +103,18 @@ sms :: sms(int N, unsigned short M, unsigned short M_MAX, int res, int latency,
trackPointListBuffer[0] = new TrackPointListBuffer();
trackPointListBuffer[1] = new TrackPointListBuffer();
h2cum = 0;
h2cum = 0.0f;
sines2 = new SampleBuf(0);
outMixer = sines2;
x0[0] = grain :: create(N,1,SBSMS_WINDOW);
x0[1] = grain :: create(N,1,SBSMS_WINDOW);
x0[0] = grain :: create(N,1);
x0[1] = grain :: create(N,1);
x1[0] = grain :: create(N,1,SBSMS_WINDOW);
x1[1] = grain :: create(N,1,SBSMS_WINDOW);
x1[0] = grain :: create(N,1);
x1[1] = grain :: create(N,1);
x2[0] = grain :: create(N,1,SBSMS_WINDOW);
x2[1] = grain :: create(N,1,SBSMS_WINDOW);
x2[0] = grain :: create(N,1);
x2[1] = grain :: create(N,1);
bPeakSet = false;
@ -179,7 +172,7 @@ void sms :: reset()
marktime[1] = 0;
currtime = 0;
synthtime = 0;
h2cum = 0;
h2cum = 0.0f;
samplePos = 0;
for(int c=0;c<channels;c++) {
@ -200,11 +193,8 @@ void sms :: reset()
sines2->clear();
}
//1/65535
#define LOG_MIN (-11.09033963005365f)
//4
#define LOG_MAX 1.38629436111989f
#define LOG_MIN -16.0f
#define LOG_MAX 0.0f
unsigned short sms :: encodeRealLog(real x)
{
@ -474,11 +464,12 @@ long sms :: addTrackPoints(grain *g0, grain *g1, grain *g2)
return 1;
}
real sms :: merit(trackpoint *tp0, trackpoint *tp1, real m0, real m1, real dti2, real dMCoeff, real *df, real maxDF2)
inline real sms :: merit(trackpoint *tp0, trackpoint *tp1, real m0, real m1, real dti2, real dMCoeff, real *df, real maxDF2)
{
(*df) = m1*tp1->f - m0*tp0->f;
real df2 = square(*df);
if(df2 > maxDF2) return df2;
if(tp0->y==0.0f || tp1->y==0.0f) return df2;
real dM = dBApprox((m1*tp1->y)/(m0*tp0->y));
return (df2+square(dMCoeff*dM));
}
@ -508,22 +499,14 @@ bool sms :: nearestTrackPoint(tplist *tpl, trackpoint *tp0, real m0, real m1, re
bool sms :: contTrack(track *t, trackpoint *tp, int c)
{
bool allowCont = true;
trackpoint *last = t->back();
real dbIncr = dBApprox(tp->y/last->y);
#ifdef MULTITHREADED
pthread_mutex_lock(&trackMutex[c]);
#endif
if(dbIncr > maxdBIncr) {
tp->y0 = last->y;
t->push_back(tp);
} else {
t->push_back(tp);
}
t->push_back(tp);
#ifdef MULTITHREADED
pthread_mutex_unlock(&trackMutex[c]);
#endif
return allowCont;
return true;
}
bool sms :: adoptTrack(track *precursor,
@ -540,24 +523,13 @@ bool sms :: adoptTrack(track *precursor,
#ifdef MULTITHREADED
pthread_mutex_unlock(&lender->trackMutex[c]);
#endif
real dbIncr = dBApprox((m*tp->y)/last->y);
bool bDiscont;
if(dbIncr > maxdBIncrStitch) {
bDiscont = true;
} else {
bDiscont = false;
}
if(tp->M>last->M) {
if(dt==1.0) {
if(lender->res==2) {
trackpoint *tp0 = new trackpoint();
tp0->h = tp->h*2/lender->res;
tp0->y = 0.5*tp->y;
if(bDiscont)
tp0->y0 = last->y;
else
tp0->y0 = tp0->y;
tp0->y0 = tp0->y;
tp0->f = 0.5*tp->f;
tp0->ph = tp->ph;
tp0->time = last->time+1;
@ -600,8 +572,6 @@ bool sms :: adoptTrack(track *precursor,
pthread_mutex_unlock(&lender->trackMutex[c]);
#endif
t->startTrack(tp0,false);
if(bDiscont)
tp->y0 = 2.0*last->y;
t->push_back(tp);
addTrack(c,t);
}
@ -610,10 +580,6 @@ bool sms :: adoptTrack(track *precursor,
trackpoint *tpend0 = new trackpoint();
trackpoint *tpend1 = new trackpoint();
trackpoint *tp0 = new trackpoint();
if(bDiscont)
tp->y0 = 2.0*last->y;
tp0->h = (last->h*lender->res)/2;
tp0->y = 0;
tp0->y0 = 0;
@ -657,9 +623,6 @@ bool sms :: adoptTrack(track *precursor,
} else {
track *t = ta->create(precursor,this,res);
if(bDiscont)
tp->y0 = 0.5f*last->y;
trackpoint *tp0 = new trackpoint();
trackpoint *tpend = new trackpoint();
@ -764,7 +727,7 @@ void sms :: markDuplicatesLo(long offset, sms *lo, long offsetlo, int c)
}
}
if(trackPointsL1 && bStitch) {
if(trackPointsL1) {
for(tplist::reverse_iterator tpi = trackPointsL1->rbegin();
tpi!=trackPointsL1->rend();
tpi++) {
@ -1025,7 +988,7 @@ long sms :: assignTrackPoints_(long offset, sms *hi, sms *lo, real dtlo, long of
else (*tpi)->cont = NULL;
}
if(trackPointsL1 && bStitch) {
if(trackPointsL1) {
for(tplist::reverse_iterator tpi = trackPointsL1->rbegin();
tpi!=trackPointsL1->rend();
tpi++) {
@ -1039,7 +1002,7 @@ long sms :: assignTrackPoints_(long offset, sms *hi, sms *lo, real dtlo, long of
}
}
if(trackPointsH1 && bStitch) {
if(trackPointsH1) {
for(tplist::iterator tpi = trackPointsH1->begin();
tpi!=trackPointsH1->end();
tpi++) {
@ -1066,8 +1029,7 @@ long sms :: assignTrackPoints_(long offset, sms *hi, sms *lo, real dtlo, long of
tplist::iterator minH0; bool minH0Set = nearestTrackPoint(trackPointsH1,*tpi,1.0,2.0,1.0,&minH0,&FH0,maxMerit2,maxDF2);
if(minM0Set &&
(!bStitch
||(FM0<=FH0 && FM0<=FL0)
((FM0<=FH0 && FM0<=FL0)
||(minL0Set && FL0<=FH0 && FL0<=FM0 && (*minL0)->dup[1-offsetlo] == (*minM0))
||(minH0Set && FH0<=FL0 && FH0<=FM0 && (*minH0)->dup[1] == (*minM0)))
) {
@ -1079,14 +1041,14 @@ long sms :: assignTrackPoints_(long offset, sms *hi, sms *lo, real dtlo, long of
(*tpi)->contF = FM0;
(*tpi)->cont = *minM0;
nToCont++;
} else if(bStitch && minL0Set && FL0<=FM0 && FL0<=FH0) {
} else if(minL0Set && FL0<=FM0 && FL0<=FH0) {
if(minM0Set && (*minL0)->dup[1-offsetlo] == (*minM0)) {
(*tpi)->dupcont = *minM0;
}
(*tpi)->contF = FL0;
(*tpi)->cont = *minL0;
nToCont++;
} else if(bStitch && minH0Set && FH0<=FM0 && FH0<=FL0) {
} else if(minH0Set && FH0<=FM0 && FH0<=FL0) {
if(minM0Set && (*minH0)->dup[1] == (*minM0)) {
(*tpi)->dupcont = *minM0;
}
@ -1403,7 +1365,7 @@ void sms :: phaseLock(trackpoint *tp0, trackpoint *tp1, long time)
tp1->f = f;
}
void sms :: synthTracks(real a)
void sms :: synthTracks(real a, real f0, real f1)
{
#ifdef MULTITHREADED
pthread_mutex_lock(&dataMutex);
@ -1413,6 +1375,12 @@ void sms :: synthTracks(real a)
pthread_mutex_unlock(&dataMutex);
#endif
real h2 = (a*(real)h1);
real fScale0, fScale1;
real mScale;
h2 *= (real)M;
mScale = 1.0f / (real)M;
fScale0 = f0 * mScale;
fScale1 = f1 * mScale;
h2cum += h2;
int h2i = round2int(h2cum);
h2cum -= h2i;
@ -1433,23 +1401,22 @@ void sms :: synthTracks(real a)
pthread_mutex_lock(&trackMutex[c]);
#endif
for(list<track*>::iterator tt=trax[c]->begin();
tt!=trax[c]->end(); ) {
tt!=trax[c]->end(); ) {
track *t = (*tt);
if(t->end <= synthtime) {
if(!t->descendant||t->descendant->isDone()) {
list<track*>::iterator eraseMe = tt;
tt++;
trax[c]->erase(eraseMe);
ta->destroy(t);
} else {
tt++;
}
if(!t->descendant||t->descendant->isDone()) {
list<track*>::iterator eraseMe = tt;
tt++;
trax[c]->erase(eraseMe);
ta->destroy(t);
} else {
tt++;
}
} else if(synthtime >= t->start) {
trackpoint *tp = t->getTrackPoint(synthtime);
t->synth(sines2,sines2->writePos,c,synthtime,h2i);
tt++;
t->synth(sines2,sines2->writePos,c,synthtime,h2i,fScale0,fScale1,mScale);
tt++;
} else {
break;
break;
}
}
#ifdef MULTITHREADED
@ -1512,13 +1479,13 @@ void sms :: advance(long n)
}
void sms :: c2evenodd(grain *eo, grain *even, grain *odd) {
_c2evenodd(eo->freq, even->freq, odd->freq, eo->N);
_c2evenodd(eo->x, even->x, odd->x, eo->N);
}
void sms :: calcmags(real *mag, grain *g, real q) {
real q2 = 1.0/q;
for(int k=0;k<=Nover2;k++) {
real m = norm2(g->freq[k])*q2;
real m = norm2(g->x[k])*q2;
mag[k] = m;
if(magmax < m) magmax = m;
}
@ -1629,7 +1596,7 @@ void sms :: adjustPeaks(list<peak*> &peaks,
if(k0 < tp->x) {
real m0 = ((mag2[k0])+(mag2[k0+1]))*(1.0-kf0);
m += m0;
mtop += max(0.0f,(m0 - mbase)*(1.0-kf0));
mtop += max(0.0,(m0 - mbase)*(1.0-kf0));
} else {
real m0 = ((mag2[k0])+(mag2[k0+1]));
m += m0;
@ -1642,14 +1609,14 @@ void sms :: adjustPeaks(list<peak*> &peaks,
if(k2 < tn->x) {
real m0 = ((mag2[k2-1])+(mag2[k2]));
m += m0;
mtop += max(0.0,m0 - mbase);
mtop += max(0.0f,m0 - mbase);
m0 = ((mag2[k2])+(mag2[k2+1]))*kf2;
m += m0;
mtop += max(0.0f,(m0 - mbase)*kf2);
} else {
real m0 = ((mag2[k2-1])+(mag2[k2]))*(1.0-kf2);
m += m0;
mtop += max(0.0f,(m0 - mbase)*(1.0-kf2));
mtop += max(0.0,(m0 - mbase)*(1.0-kf2));
}
for(int k=k0+1;k<k2-1;k++) {
@ -1830,8 +1797,8 @@ void sms :: extractTrackPoints(grain *g,
{
real thmin = square(peakThresh)*magmax;
list<peak*> peaks;
list<peak*> troughs1;
list<peak*> troughs2;
peak* trough1 = NULL;
peak* trough2 = NULL;
peak *t0 = pa->create();
t0->k = 1;
@ -1853,7 +1820,7 @@ void sms :: extractTrackPoints(grain *g,
t1->tn = NULL;
t1->tn2 = NULL;
troughs2.push_back(t0);
trough2 = t0;
int k00=0;
int k01=Nover2-1;
@ -1863,34 +1830,36 @@ void sms :: extractTrackPoints(grain *g,
for(int k=1;k<Nover2-1;k++) {
if( (mag2[k] > thmin)
&&
(mag2[k] > mag2[k-1])
&&
(mag2[k] >= mag2[k+1])
) {
&&
(mag2[k] > mag2[k-1])
&&
(mag2[k] >= mag2[k+1])
) {
kp = k;
if(k>=kStart-peakWidth && k<=kEnd+peakWidth) {
peak *p = makePeak(mag1,mag2,k);
p->tn2 = t1;
if(!troughs1.empty() && troughs1.back()->tn == NULL) {
p->tp = troughs1.back();
troughs1.back()->tn = p;
}
if(!troughs2.empty() && troughs2.back()->tn2 == NULL) {
p->tp2 = troughs2.back();
troughs2.back()->tn2 = p;
}
peaks.push_back(p);
peak *p = makePeak(mag1,mag2,k);
p->tn2 = t1;
if(trough1 && trough1->tn == NULL) {
p->tp = trough1;
trough1->tn = p;
}
if(trough2 && trough2->tn2 == NULL) {
p->tp2 = trough2;
trough2->tn2 = p;
}
peaks.push_back(p);
}
} else if((mag2[k] <= mag2[k-1])
&&
(mag2[k] <= mag2[k+1])
) {
&&
(mag2[k] <= mag2[k+1])
) {
peak *p = makePeak(mag1,mag2,k);
troughs2.push_back(p);
trough2 = p;
if(!peaks.empty()) {
peaks.back()->tn2 = p;
p->tp2 = peaks.back();
peaks.back()->tn2 = p;
p->tp2 = peaks.back();
}
}
if((mag0[k] <= mag0[k-1])
@ -1898,23 +1867,23 @@ void sms :: extractTrackPoints(grain *g,
(mag0[k] <= mag0[k+1])
) {
if(peaks.empty())
k00 = k;
k00 = k;
if(kp <= kEnd)
k01 = k;
k01 = k;
}
if((mag1[k] <= mag1[k-1])
&&
(mag1[k] <= mag1[k+1])
) {
if(peaks.empty())
k10 = k;
k10 = k;
if(kp <= kEnd)
k11 = k;
k11 = k;
peak *p = makePeak(mag1,mag1,k);
troughs1.push_back(p);
trough1 = p;
if(!peaks.empty() && peaks.back()->tn == NULL) {
peaks.back()->tn = p;
p->tp = peaks.back();
peaks.back()->tn = p;
p->tp = peaks.back();
}
}
}

View File

@ -16,7 +16,9 @@ using namespace std;
namespace _sbsms_ {
class renderer;
class sms : public SampleBufBase {
friend class renderer;
public:
sms(int N, unsigned short M, unsigned short M_MAX, int res, int latency, real p, real q, real pad, int Nlo, int channels, TrackAllocator *ta, PeakAllocator *pa);
void reset();
@ -29,7 +31,7 @@ class sms : public SampleBufBase {
void markDuplicates(long offset, sms *hi, sms *lo, int c);
bool connectTrackPoints(trackpoint *tp0, trackpoint *tp1, sms *hi, sms *lo, real dtlo, int c);
bool adoptTrack(track *precursor, sms *lender, trackpoint *tp, real m, real dt, int c);
void synthTracks(real a);
void synthTracks(real a, real f0, real f1);
void advanceTrackPoints(int c);
long nTrackPoints();
long read(audio *out, long n);
@ -41,8 +43,6 @@ class sms : public SampleBufBase {
bool bPhaseLock;
bool bStitch;
bool bConserveEnergy;
int res;
int N;
unsigned short M;

View File

@ -2,6 +2,8 @@
#include "real.h"
#include "sbsms.h"
#include "utils.h"
#include <algorithm>
using namespace std;
namespace _sbsms_ {
@ -42,26 +44,24 @@ bool subband :: isSynthReady()
return synthInit(false)?true:false;
}
subband :: subband(subband *parent, unsigned short M, int channels, int quality, int latency, bool bPreAnalyze, TrackAllocator *ta, PeakAllocator *pa)
subband :: subband(subband *parent, unsigned short M, int channels, sbsms_quality *quality, int latency, bool bPreAnalyze, TrackAllocator *ta, PeakAllocator *pa)
{
this->quality = quality;
this->ta = ta;
this->pa = pa;
this->fp = NULL;
int k = ilog2(M);
this->channels = channels;
this->quality = quality;
this->parent = parent;
this->N = SBSMS_N[quality][k];
this->N = quality->N[k];
this->M = M;
this->s = SBSMS_S;
this->res = SBSMS_RES[quality][k];
real pad = SBSMS_PAD[quality][k];
if(M<SBSMS_M_MAX[quality])
this->s = quality->S[k];
this->res = quality->res[k];
real pad = quality->pad[k];
if(M<quality->M_MAX)
sub = new subband(this,M*2,channels,quality,latency,bPreAnalyze,ta,pa);
else
sub = NULL;
int Nlo = sub?SBSMS_N[quality][k+1]:0;
int Nlo = sub?quality->N[k+1]:0;
nGrainsPerFrame = res;
if(sub) nGrainsPerFrame *= sub->nGrainsPerFrame;
@ -75,37 +75,36 @@ subband :: subband(subband *parent, unsigned short M, int channels, int quality,
init();
// sms
in0 = new GrainBuf(N, h, pad*SBSMS_P1, SBSMS_WINDOW);
in1 = new GrainBuf(N, h, pad, SBSMS_WINDOW);
in2 = new GrainBuf(N, h, pad/SBSMS_Q1, SBSMS_WINDOW);
in0 = new GrainBuf(N, h, pad*quality->P[k]);
in1 = new GrainBuf(N, h, pad);
in2 = new GrainBuf(N, h, pad*quality->Q[k]);
// synthesize
smser = new sms(N,(short)M,(short)(SBSMS_M_MAX[quality]),res,latency,SBSMS_P1,SBSMS_Q1,pad,Nlo,channels,ta,pa);
smser = new sms(N,(short)M,(short)quality->M_MAX,res,latency,quality->P[k],quality->Q[k],pad,Nlo,channels,ta,pa);
if(!parent && bPreAnalyze) {
this->bPreAnalyze = true;
inPre = new GrainBuf(N, h, 2, SBSMS_WINDOW);
x1[0] = grain :: create(N,pad,SBSMS_WINDOW);
x1[1] = grain :: create(N,pad,SBSMS_WINDOW);
x2[0] = grain :: create(N,pad,SBSMS_WINDOW);
x2[1] = grain :: create(N,pad,SBSMS_WINDOW);
inPre = new GrainBuf(N, h, 2);
x1[0] = grain :: create(N,pad);
x1[1] = grain :: create(N,pad);
x2[0] = grain :: create(N,pad);
x2[1] = grain :: create(N,pad);
} else {
this->bPreAnalyze = false;
inPre = NULL;
}
if(sub) {
subOut = new GrainBuf(N, N/s, 1, SBSMS_HANN);
usSubOut = new SampleBuf(2*N);
subOut = new SampleBuf(0);
// receive
in = new GrainBuf(N, N/s, 1, SBSMS_HANN);
in = new GrainBuf(N, N/s, 1);
// samples to sub
subIn = new SampleBuf(N/2);
// output samples
outMixer = new Mixer(smser,usSubOut);
outMixer = new Mixer(smser,subOut);
} else {
outMixer = smser;
}
@ -141,6 +140,7 @@ void subband :: reset() {
outputFrameSize.clear();
aForH.clear();
aSynth.clear();
fSynth.clear();
frameRatio.clear();
in0->clear();
in1->clear();
@ -149,23 +149,19 @@ void subband :: reset() {
in->clear();
subIn->clear();
subOut->clear();
usSubOut->clear();
}
smser->reset();
}
void subband :: init()
{
int ssms = (N*nGrainsPerFrame)/(resTotal*SBSMS_H[quality][2]);
int ssms = (N*nGrainsPerFrame)/(resTotal*quality->H[2]);
h = N/ssms;
lastInputFrameSize = h*nGrainsPerFrame;
lastFrameA = 1.0;
lastFrameRatio = 1.0;
lastFrameA = 1.0f;
lastFrameRatio = 1.0f;
nLatency = nLatencyOriginal;
nToDrop = (SBSMS_N[quality][SBSMS_BANDS[quality]-1]/SBSMS_H[quality][2]*nGrainsPerFrame-ssms)/2;
nToDrop = (quality->N[quality->bands-1]/quality->H[2]*nGrainsPerFrame-ssms)/2;
nDropped = 0;
nFramesSkipped = 0;
nFramesWritten = 0;
@ -212,7 +208,6 @@ subband :: ~subband()
delete in;
delete subIn;
delete subOut;
delete usSubOut;
delete outMixer;
}
}
@ -228,21 +223,22 @@ void subband :: setFrameSize(int iFrameSize, real a, real ratio)
lastInputFrameSize = iFrameSize;
lastOutputFrameSize = oFrameSizei;
samplesQueued += oFrameSizei * ratio;
//samplesQueued += oFrameSizei;
}
void subband :: setH(real ratio)
{
real a = aForH.read(aForH.readPos);
if(a > 4.0)
h = SBSMS_H[quality][0];
h = quality->H[0];
else if(a > 2.0 && a <= 4.0)
h = SBSMS_H[quality][1];
h = quality->H[1];
else if(a >= 0.5 && a <= 2.0)
h = SBSMS_H[quality][2];
h = quality->H[2];
else if(a >= 0.25 && a < 0.5)
h = SBSMS_H[quality][3];
h = quality->H[3];
else
h = SBSMS_H[quality][4];
h = quality->H[4];
h = (h*resTotal)/nGrainsPerFrame;
in0->h = h;
@ -267,6 +263,12 @@ void subband :: setA(real a)
lastFrameA = a;
}
void subband :: setF(real f)
{
fSynth.write(f);
if(sub) sub->setF(f);
}
void subband :: setAMod(real a)
{
aMod.write(a);
@ -298,20 +300,17 @@ void subband :: write_(audio *inBuf, long n, real a, real ratio)
nDropped++;
} else {
if(!parent && nTrackPointsWritten%nGrainsPerFrame == 0) {
if(bPreAnalyze) {
if(aPreAnalysis.n_readable()) {
real aMod = aPreAnalysis.read(aPreAnalysis.readPos);
setAMod(aMod);
setA(1.0f+aMod*(a-1.0f));
aPreAnalysis.advance(1);
} else {
setAMod(1.0f);
setA(a);
}
real amod;
if(bPreAnalyze && aPreAnalysis.n_readable()) {
amod = aPreAnalysis.read(aPreAnalysis.readPos);
aPreAnalysis.advance(1);
} else {
setA(a);
amod = 1.0f;
}
setA(1.0f+amod*(a-1.0f));
setAMod(amod);
setRatio(ratio);
setF(1.0f/ratio);
}
if(!parent && (nTrackPointsWritten+1)%nGrainsPerFrame == 0) {
setAForH(a);
@ -376,7 +375,9 @@ void subband :: stepSynthFrame()
#ifdef MULTITHREADED
pthread_mutex_lock(&dataMutex);
#endif
if(!parent) aMod.advance(1);
aSynth.advance(1);
fSynth.advance(1);
nFramesSynthed++;
#ifdef MULTITHREADED
pthread_mutex_unlock(&dataMutex);
@ -472,9 +473,9 @@ void subband :: markDuplicates(int c)
long ndone = 0;
while(ndone<ntodo) {
smser->markDuplicates(nTrackPointsMarked[c],
parent?parent->smser:NULL,
sub?sub->smser:NULL,
c);
parent?parent->smser:NULL,
sub?sub->smser:NULL,
c);
if(nTrackPointsMarked[c]%res==1 || res==1) {
if(sub) sub->markDuplicates(c);
}
@ -496,11 +497,11 @@ long subband :: assignInit(bool bSet, int c)
nTrackPointsToAssign[c] = n;
if(nTrackPointsToAssign[c]) {
if(nFramesAssigned[c]==0) {
smser->assignTrackPoints(nTrackPointsAssigned[c]++,
parent?parent->smser:NULL,
sub?sub->smser:NULL,
c);
smser->startNewTracks(nTrackPointsStarted[c]++,c);
smser->assignTrackPoints(nTrackPointsAssigned[c]++,
parent?parent->smser:NULL,
sub?sub->smser:NULL,
c);
smser->startNewTracks(nTrackPointsStarted[c]++,c);
}
}
}
@ -518,19 +519,19 @@ long subband :: assignTrackPoints(int c)
if(nTrackPointsAssigned[c]%res==0) {
if(sub) sub->assignTrackPoints(c);
smser->assignTrackPoints(nTrackPointsAssigned[c]++,
parent?parent->smser:NULL,
sub?sub->smser:NULL,
c);
parent?parent->smser:NULL,
sub?sub->smser:NULL,
c);
if(!parent) startNewTracks(c);
} else {
smser->assignTrackPoints(nTrackPointsAssigned[c]++,
parent?parent->smser:NULL,
sub?sub->smser:NULL,
c);
parent?parent->smser:NULL,
sub?sub->smser:NULL,
c);
}
if(parent && parent->res != 1)
parent->smser->startNewTracks(parent->nTrackPointsStarted[c]++,c);
ndone++;
}
@ -628,6 +629,7 @@ void subband :: readTrackPointsFromFile(FILE *fp)
}
}
long subband :: writeTrackPointsToFile(FILE *fp)
{
long ntodo = parent?1:nTrackPointsToSynth;
@ -669,6 +671,12 @@ void subband :: synthTracks()
pthread_mutex_lock(&dataMutex);
#endif
real a = aSynth.read(aSynth.readPos);
real f0 = fSynth.read(fSynth.readPos);
real f1;
if(fSynth.n_readable()>=2)
f1 = fSynth.read(fSynth.readPos+1);
else
f1 = f0;
#ifdef MULTITHREADED
pthread_mutex_unlock(&dataMutex);
#endif
@ -677,8 +685,9 @@ void subband :: synthTracks()
while(ndone<ntodo) {
if(nTrackPointsSynthed%res==0)
if(sub) sub->synthTracks();
smser->synthTracks(a);
if(sub) sub->synthTracks();
real df = (f1-f0)/(real)nTrackPointsToSynth;
smser->synthTracks(a,f0+nTrackPointsSynthed*df,f0+(nTrackPointsSynthed+1)*df);
nTrackPointsSynthed++;
ndone++;
}
@ -690,24 +699,11 @@ void subband :: readSubSamples()
if(sub) {
audio fromSub[SUB_BUF_SIZE];
long n_fromsub = 0;
do {
n_fromsub = min((long)SUB_BUF_SIZE,sub->n_readable());
n_fromsub = sub->read(fromSub,n_fromsub);
//write samples to grains
subOut->write(fromSub, n_fromsub);
} while(n_fromsub>0);
// upsample grains to samples
long ng_read_subOut = 0;
for(int k=subOut->readPos;k<subOut->writePos;k++) {
ng_read_subOut++;
int h = 2*N/s;
grain *gup = subOut->read(k)->upsample();
usSubOut->write(gup,h);
grain :: destroy(gup);
}
subOut->advance(ng_read_subOut);
}
}
@ -767,9 +763,11 @@ long subband :: readFromFile(FILE *fp, real a, real ratio)
stepAssignFrame(c);
samples += framesize;
#ifdef MULTITHREADED
pthread_mutex_lock(&dataMutex);
pthread_mutex_lock(&dataMutex);
#endif
setA(1.0f+amod*(a-1.0f));
setAMod(amod);
setF(1.0f/ratio);
setRatio(ratio);
setFrameSize(framesize,a,ratio);
#ifdef MULTITHREADED
@ -783,7 +781,7 @@ void subband :: writeFramePositionsToFile(FILE *fp)
{
long frames = 0;
// samples, frames, channels, quality
long offset = 2*sizeof(long) + 2*sizeof(int);
long offset = 2*sizeof(long) + sizeof(int) + sizeof(sbsms_quality);
unsigned short maxtrackindex = ta->size();
fseek(fp,offset,SEEK_SET);
fwrite(&maxtrackindex,sizeof(unsigned short),1,fp); offset += sizeof(unsigned short);
@ -838,13 +836,7 @@ long subband :: writeTracksToFile(FILE *fp)
return 0;
}
int framesize = inputFrameSize.read(nFramesSynthed);
real amod;
if(aMod.n_readable()) {
amod = aMod.read(aMod.readPos);
aMod.advance(1);
} else {
amod = 1.0f;
}
real amod = aMod.read(aMod.readPos);
#ifdef MULTITHREADED
pthread_mutex_unlock(&dataMutex);
#endif
@ -858,7 +850,8 @@ long subband :: writeTracksToFile(FILE *fp)
}
bytes += writeTrackPointsToFile(fp);
frameBytes.write(bytes);
frameRatio.advance(1);
outputFrameSize.advance(1);
return samples;
}
@ -1021,7 +1014,7 @@ long subband :: read(audio *buf, real *ratio0, real *ratio1)
pthread_mutex_unlock(&dataMutex);
#endif
if(buf) {
stepReadFrame();
stepReadFrame();
}
n = read(buf, n);
} else {
@ -1202,15 +1195,15 @@ void subband :: calculateA(long kstart, long kend)
real subband :: calculateOnset(grain *g1, grain *g2)
{
_c2evenodd(g2->freq, x2[0]->freq, x2[1]->freq, g2->N);
_c2evenodd(g2->x, x2[0]->x, x2[1]->x, g2->N);
real o = 1.0f;
if(g1!=NULL) {
int Nover2 = N/2;
int nOnset = 0;
int nThresh = 0;
for(int k=0;k<Nover2;k++) {
real m2 = norm2(x2[0]->freq[k]) + norm2(x2[1]->freq[k]);
real m1 = norm2(x1[0]->freq[k]) + norm2(x1[1]->freq[k]);
real m2 = norm2(x2[0]->x[k]) + norm2(x2[1]->x[k]);
real m1 = norm2(x1[0]->x[k]) + norm2(x1[1]->x[k]);
bool bThresh = (m2 > 1e-6);
bool bOnset = (m2 > 2.0f*m1) && bThresh;
if(bOnset) nOnset++;
@ -1221,8 +1214,8 @@ real subband :: calculateOnset(grain *g1, grain *g2)
else
o = (real)nOnset/(real)nThresh;
}
memcpy(x1[0]->freq,x2[0]->freq,g2->N*sizeof(audio));
memcpy(x1[1]->freq,x2[1]->freq,g2->N*sizeof(audio));
memcpy(x1[0]->x,x2[0]->x,g2->N*sizeof(audio));
memcpy(x1[1]->x,x2[1]->x,g2->N*sizeof(audio));
return o;
}

View File

@ -13,9 +13,12 @@
namespace _sbsms_ {
class renderer;
class subband {
friend class renderer;
public:
subband(subband *parent, unsigned short M, int channels, int quality, int latency, bool bPreAnalysis, TrackAllocator *ta, PeakAllocator *pa);
subband(subband *parent, unsigned short M, int channels, sbsms_quality *quality, int latency, bool bPreAnalysis, TrackAllocator *ta, PeakAllocator *pa);
~subband();
long write(audio *buf, long n, real a, real ratio);
@ -64,6 +67,7 @@ class subband {
void setAMod(real a);
void setAForH(real a);
void setH(real ratio);
void setF(real f);
void setFrameSize(int inputSize, real a, real ratio);
void setRatio(real ratio);
void setFramesInFile(long frames);
@ -98,11 +102,12 @@ class subband {
TrackAllocator *ta;
PeakAllocator *pa;
RingBuffer<real> aPreAnalysis;
RingBuffer<real> aMod;
RingBuffer<real> aSynth;
RingBuffer<real> aForH;
RingBuffer<real> fSynth;
RingBuffer<int> inputFrameSize;
RingBuffer<int> outputFrameSize;
RingBuffer<real> frameRatio;
@ -118,7 +123,7 @@ class subband {
real lastFrameRatio;
real totalSizef;
bool bPreAnalyze;
int quality;
sbsms_quality *quality;
int channels;
int N;
int h;
@ -156,11 +161,10 @@ class subband {
subband *parent;
subband *sub;
GrainBuf *in0,*in1,*in2;
SampleBuf *usSubOut;
SampleBufBase *outMixer;
sms *smser;
SampleBuf *subIn;
GrainBuf *subOut;
SampleBuf *subOut;
GrainBuf *in;
GrainBuf *inPre;

View File

@ -1,76 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "convert.h"
#include <unistd.h>
bool progressCB(int percent, const char *msg, void *data) {
static int lastPercent = 0;
if (lastPercent != percent) {
printf("\r%s: %3i%% [%-40s] ", msg, percent>100?100:percent, &"||||||||||||||||||||||||||||||||||||||||"[40 - ((percent>100)?40:(2*percent/5))] );
lastPercent = percent;
fflush(stdout);
}
return true;
}
int main(int argc, char **argv)
{
if(argc<7) {
printf("usage: sbsms infile<.wav|.aif|.mp3|.sbsms> outfile<.wav|.aif|.mp3|.sbsms> rate-start[0.2:5] rate-end[0.2:5] halfsteps-start[-12:12] halfsteps-end[-12:12] <quality[0-2](default 1) <0:1 for pre-analysis>\n");
exit(-1);
}
float srOut = 44100.0;
bool bAnalyzeOnly = false;
bool bSynthesizeOnly = false;
char *filenameIn = argv[1];
char *filenameOut = argv[2];
if(strstr(filenameIn,".sbsms")) {
bSynthesizeOnly = true;
}
if(strstr(filenameOut,".sbsms")) {
bAnalyzeOnly = true;
}
if(bAnalyzeOnly && bSynthesizeOnly) {
printf("Can't convert from .sbsms to .sbsms format\n");
exit(-1);
}
float stretch0 = atof(argv[3]);
float stretch1 = atof(argv[4]);
float halfsteps0 = atof(argv[5]);
float halfsteps1 = atof(argv[6]);
if(stretch0 < 0.2 || stretch0 > 5) {
printf("rate-start out of bounds\n");
exit(-1);
}
if(stretch1 < 0.2 || stretch1 > 5) {
printf("rate-end out of bounds\n");
exit(-1);
}
if(halfsteps0 < -12 || halfsteps0 > 12) {
printf("halfsteps-start out of bounds\n");
exit(-1);
}
if(halfsteps1 < -12 || halfsteps1 > 12) {
printf("halfsteps-end out of bounds\n");
exit(-1);
}
int quality = 1;
if(argc >= 8) quality = atoi(argv[7]);
bool bPreAnalyze = false;
if(argc >= 9) bPreAnalyze = atoi(argv[8])?true:false;
real ratio0 = pow(2.0,-halfsteps0/12.0);
real ratio1 = pow(2.0,-halfsteps1/12.0);
sbsms_init(4096);
sbsms_convert(filenameIn, filenameOut, bAnalyzeOnly, bSynthesizeOnly, bPreAnalyze, quality, progressCB, NULL, stretch0, stretch1, ratio0, ratio1, 1.0f);
printf("\n");
}

View File

@ -1,52 +0,0 @@
#include "config.h"
#ifdef HAVE_PORTAUDIO
#include "play.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
int main(int argc, char **argv)
{
if(argc<6) {
printf("usage: sbsmsplay infile.sbsms rate-start[0.2:5] rate-end[0.2:5] halfsteps-start[-12:12] halfsteps-end[-12:12] <quality[0-2](default 2 highest)>\n");
exit(-1);
}
char *filenameIn = argv[1];
float stretch0 = atof(argv[2]);
float stretch1 = atof(argv[3]);
float halfsteps0 = atof(argv[4]);
float halfsteps1 = atof(argv[5]);
if(stretch0 < 0.2 || stretch0 > 5) {
printf("rate-start out of bounds\n");
exit(-1);
}
if(stretch1 < 0.2 || stretch1 > 5) {
printf("rate-end out of bounds\n");
exit(-1);
}
if(halfsteps0 < -12 || halfsteps0 > 12) {
printf("halfsteps-start out of bounds\n");
exit(-1);
}
if(halfsteps1 < -12 || halfsteps1 > 12) {
printf("halfsteps-end out of bounds\n");
exit(-1);
}
int quality = 1;
if(argc == 7) quality = atoi(argv[6]);
real ratio0 = pow(2.0,-halfsteps0/12.0);
real ratio1 = pow(2.0,-halfsteps1/12.0);
sbsmsplayer *player = new sbsmsplayer(filenameIn,stretch0,stretch1,ratio0,ratio1);
player->play();
while(player->isPlaying())
Pa_Sleep(100);
player->close();
delete player;
}
#endif

View File

@ -4,8 +4,6 @@
#include "real.h"
#include "sbsms.h"
#include "sms.h"
#include <assert.h>
#include <stack>
#include <vector>
using namespace std;
@ -113,7 +111,7 @@ void track :: endTrack(bool bTail)
{
end = back()->time;
if(bTail) {
this->fall = min(1.5f,.25 + back()->y / point[point.size()-2]->y);
this->fall = min(1.5,.25 + back()->y / point[point.size()-2]->y);
tailEnd = 1;
end++;
trackpoint *f = new trackpoint(back());
@ -122,39 +120,14 @@ void track :: endTrack(bool bTail)
}
}
real track :: advance(long synthtime, int steps)
{
long k = synthtime - start;
tpoint *tp0 = point[k];
tpoint *tp1 = point[k+1];
real w0 = tp0->f;
real w1 = tp1->f;
real ph0 = tp0->ph;
real ph1 = tp1->ph;
real h = tp0->h;
real dp = ph1 - ph0;
if(dp>PI) dp-=TWOPI;
else if(dp<-PI) dp+=TWOPI;
real dp0 = 0.5f*h*(w0 + w1);
real deltadp = canon(dp - dp0);
if(k==0) {
if(precursor) {
m_p = precursor->m_pDescendant;
} else {
deltadp = 0;
}
}
dp = (real)steps/h*(dp0+deltadp);
return dp;
}
void track :: synth(SampleBuf *out,
long writePos,
int c,
long synthtime,
int steps) {
long writePos,
int c,
long synthtime,
int steps,
real fScale0,
real fScale1,
real mScale) {
if(point.size()==0) return;
long k = synthtime - start;
if(k>=(long)point.size()-1) return;
@ -167,68 +140,93 @@ void track :: synth(SampleBuf *out,
real w0 = tp0->f;
real w1 = tp1->f;
real dp = advance(synthtime,steps);
real dt = (real)steps;
w1 = 2.0f/dt*dp - w0;
real b = (w1 - w0)/(2.0f*dt);
real ph0 = tp0->ph;
real ph1 = tp1->ph;
real h = tp0->h;
real dp = ph1 - ph0;
if(dp>PI) dp-=TWOPI;
else if(dp<-PI) dp+=TWOPI;
real dp0 = 0.5f*h*(w0 + w1);
real dw = canon(dp - dp0)/h;
if(k==0) {
if(precursor) {
m_p = precursor->m_pDescendant;
} else {
dw = 0;
}
}
real dt = (real)steps;
w0 = (w0+dw);
w1 = (w1+dw);
w0 = w0*fScale0;
w1 = w1*fScale1;
dp = dt*0.5f*(w0 + w1);
real b = (w1 - w0)/(2.0f*dt);
bool bEnd = (k1==(long)point.size()-1);
bool bStart = (k==0);
if(bStart && tailStart) {
real ph = m_p;
int rise = round2int(this->rise * (real)steps);
real dm = tp1->y/(real)rise;
real m = tp1->y - dm;
for(int i=steps-1;i>=steps-rise+1;i--) {
ph -= w0;
if(ph>PI) ph -= TWOPI;
else if(ph<-PI) ph += TWOPI;
out->buf[writePos+i][c] += m * COS(ph);
m -= dm;
if(w0 < PI && w0 > -PI) {
real ph = m_p;
int rise = round2int(this->rise * (real)steps);
real dm = mScale*tp1->y/(real)rise;
real m = mScale*tp1->y - dm;
for(int i=steps-1;i>=steps-rise+1;i--) {
ph -= w0;
if(ph<-PI) ph += TWOPI;
else if(ph>PI) ph -= TWOPI;
out->buf[writePos+i][c] += m * COS(ph);
m -= dm;
}
}
} else if(bEnd && tailEnd) {
real ph = m_p;
int fall = round2int(this->fall * (real)steps);
real dm = tp0->y/(real)fall;
real m = tp0->y;
for(int i=0;i<fall;i++) {
out->buf[writePos+i][c] += m * COS(ph);
ph += w0;
if(ph>PI) ph -= TWOPI;
else if(ph<-PI) ph += TWOPI;
m -= dm;
if(w0 < PI && w0 > -PI) {
real ph = m_p;
int fall = round2int(this->fall * (real)steps);
real dm = mScale*tp0->y/(real)fall;
real m = mScale*tp0->y;
for(int i=0;i<fall;i++) {
out->buf[writePos+i][c] += m * COS(ph);
ph += w0;
if(ph<-PI) ph += TWOPI;
else if(ph>PI) ph -= TWOPI;
m -= dm;
}
}
} else {
real m = tp0->y;
real dm;
dm = (tp1->y0 - tp0->y)/dt;
real m = mScale*tp0->y;
real dm = mScale*(tp1->y0 - tp0->y)/dt;
real ph = m_p;
real b2tt1 = b;
real b2 = 2.0f*b;
real dph;
audio *o = &(out->buf[writePos]);
for(int i=0;i<steps;i++) {
(*o)[c] += m * COS(ph);
ph += w0 + b2tt1;
if(ph>PI) ph -= TWOPI;
else if(ph<-PI) ph += TWOPI;
dph = w0 + b2tt1;
if(dph < PI && dph > -PI) (*o)[c] += m * COS(ph);
ph += dph;
if(ph<-PI) ph += TWOPI;
else if(ph>PI) ph -= TWOPI;
b2tt1 += b2;
m += dm;
o++;
}
}
//}
if(bEnd) {
if(descendant && descendant->back()->M < tp0->M) {
m_pDescendant = canon(m_p + dp/dt*(real)(descendant->owner->samplePos/2 + 0.5f*(descendant->owner->samplePos%2) - owner->samplePos));
m_pDescendant = canon(m_p + dp/dt*(real)(descendant->owner->samplePos - owner->samplePos));
}
} else if(bStart && tailStart) {
} else {
m_p = canon(m_p + dp);
if(descendant && descendant->back()->M > tp0->M && (k1+res==(long)point.size()-1)) {
m_pDescendant = canon(m_p + dp/dt*(real)(descendant->owner->samplePos*2 - (owner->samplePos+steps)));
m_pDescendant = canon(m_p + dp/dt*(real)(descendant->owner->samplePos - (owner->samplePos+steps)));
}
}
}

View File

@ -14,8 +14,10 @@ using namespace std;
namespace _sbsms_ {
class sms;
class renderer;
class track {
friend class renderer;
public:
void endTrack(bool bTail);
bool isEnded();
@ -23,13 +25,15 @@ class track {
void startTrack(trackpoint *p, bool bTail);
void push_back(trackpoint *p);
void push_back_tpoint(tpoint *p);
real advance(long time, int steps);
long size();
void synth(SampleBuf *out,
long writePos,
int c,
long synthtime,
int steps);
long writePos,
int c,
long synthtime,
int steps,
real fScale0,
real fScale1,
real mScale);
trackpoint *getTrackPoint(long time);
bool isStart(long synthtime);
bool isEnd(long synthtime);

View File

@ -4,7 +4,6 @@
#include "track.h"
#include "trackpoint.h"
#include "grain.h"
#include "defs.h"
namespace _sbsms_ {
@ -36,10 +35,10 @@ trackpoint :: trackpoint(grain *g, real x, real y, int N, short M, short h, long
int ki = round2int(k);
real kf = ki<k?k-ki:ki-k;
real norm0 = square(g->freq[ki][0]) + square(g->freq[ki][1]);
real norm0 = square(g->x[ki][0]) + square(g->x[ki][1]);
real ph0;
if(norm0 > 0.0f) {
ph0 = atan2(g->freq[ki][1],g->freq[ki][0]);
ph0 = atan2(g->x[ki][1],g->x[ki][0]);
} else {
ph0 = 0.0f;
}
@ -50,9 +49,9 @@ trackpoint :: trackpoint(grain *g, real x, real y, int N, short M, short h, long
norm1 = norm0;
ph1 = ph0;
} else {
norm1 = square(g->freq[ki1][0]) + square(g->freq[ki1][1]);
norm1 = square(g->x[ki1][0]) + square(g->x[ki1][1]);
if(norm1 > 0.0f) {
ph1 = atan2(g->freq[ki1][1],g->freq[ki1][0]);
ph1 = atan2(g->x[ki1][1],g->x[ki1][0]);
} else {
ph1 = 0.0f;
}

View File

@ -1,10 +1,9 @@
#include <math.h>
#include "utils.h"
#include "real.h"
#include "defs.h"
namespace _sbsms_ {
real *COSTABLE_ = NULL;
int COSSIZE;
real *COSTABLE = NULL;
real COSFACTOR;
@ -56,12 +55,12 @@ void _c2evenodd(audio *eo, audio *even, audio *odd, int N)
}
void cosinit(int size) {
COSFACTOR = (real)(size-1)/PI;
if(COSTABLE_) free(COSTABLE_);
COSTABLE_ = (real*)malloc(size*sizeof(real));
COSSIZE = size;
COSFACTOR = (double)(COSSIZE-1)/PI;
if(COSTABLE) free(COSTABLE);
COSTABLE = (real*)malloc(size*sizeof(real));
for(int k=0;k<size;k++)
COSTABLE_[k] = cos((real)k/(real)(size-1)*PI);
COSTABLE = COSTABLE_;
COSTABLE[k] = cos((double)k/(double)(COSSIZE-1)*PI);
}
void _c2magphase(audio *g, int N)
@ -79,8 +78,8 @@ void _magphase2c(audio *g, int N)
for(int k=0;k<N;k++) {
real mag = g[k][0];
real phi = g[k][1];
real re = mag * COS(phi);
real im = mag * SIN(phi);
real re = mag * cos(phi);
real im = mag * sin(phi);
g[k][0] = re;
g[k][1] = im;

View File

@ -3,21 +3,23 @@
#include "real.h"
#include "sbsms.h"
#include "defs.h"
#include <math.h>
#include <limits.h>
#include <stdlib.h>
namespace _sbsms_ {
#define ONEOVERTWOPI 0.15915494309189533576888376337251f
#define PI 3.1415926535897932384626433832795f
#define TWOPI 6.28318530717958647692528676655900576f
extern int COSSIZE;
extern real COSFACTOR;
extern real *COSTABLE_;
extern real *COSTABLE;
void cosinit(int size);
void _evenodd2c(audio *eo, audio *even, audio *odd, int N);
void _c2evenodd(audio *eo, audio *even, audio *odd, int N);
inline real SIN(real x);
inline real COS(real x);
inline real square(real x);
void _c2magphase(audio *g, int N);
@ -26,8 +28,6 @@ inline real canon(real ph);
inline real norm(audio x);
inline real norm2(audio x);
inline real sign(real x);
inline real min(real a, real b);
inline long min(long a, long b);
inline real dBApprox(real x);
int *factor(int n);
void factor(int n, int *f, int m);
@ -44,44 +44,9 @@ inline int ilog2(int x)
inline real dBApprox(real x)
{
real u = (x-1.0)/(x+1.0);
real u = (x-1.0f)/(x+1.0f);
real u2 = u*u;
return 17.37177927613007*u*(1.0 + u2*(0.333333333333333 + u2*(0.2 + u2*0.14285714285714)));
}
inline real min(real a, real b)
{
return ((a)<(b)?(a):(b));
}
inline real max(real a, real b)
{
return ((a)>(b)?(a):(b));
}
inline long min(long a, long b)
{
return ((a)<(b)?(a):(b));
}
inline long max(long a, long b)
{
return ((a)>(b)?(a):(b));
}
inline int min(int a, int b)
{
return ((a)<(b)?(a):(b));
}
inline int max(int a, int b)
{
return ((a)>(b)?(a):(b));
}
inline real sign(real x)
{
return x<0?-1:1;
return 17.37177927613007f*u*(1.0f + u2*(0.333333333333333f + u2*(0.2f + u2*0.14285714285714f)));
}
inline real canon(real ph)
@ -99,11 +64,6 @@ inline real norm(audio x)
return sqrt(norm2(x));
}
inline real SIN(real x)
{
return sin(x);
}
inline real COS(real x)
{
return COSTABLE[round2int(COSFACTOR*fabsf(x))];

View File

@ -1,45 +0,0 @@
#include "wxconvertdlg.h"
#define QUALITY 9998
#define QUALITYTEXT 9997
#define PREANALYZE 9996
ConvertDialog :: ConvertDialog(wxWindow *parent) :
wxDialog(parent, wxID_ANY, _("Convert"), wxDefaultPosition, wxDefaultSize)
{
mQualityText = new wxStaticText(this,QUALITYTEXT,_("Quality"));
mQuality = new wxSlider(this,QUALITY,1,0,2);
mPreAnalyze = new wxCheckBox(this,PREANALYZE,_("Pre-Analysis"));
wxBoxSizer *mSizer = new wxBoxSizer(wxVERTICAL);
wxStdDialogButtonSizer *bs = new wxStdDialogButtonSizer();
wxButton *b;
b = new wxButton( this, wxID_OK );
b->SetDefault();
bs->AddButton( b );
bs->AddButton( new wxButton( this, wxID_CANCEL ) );
bs->AddStretchSpacer();
bs->Realize();
mSizer->Add(mQualityText);
mSizer->Add(mQuality);
mSizer->Add(mPreAnalyze);
mSizer->Add(bs);
SetSizer(mSizer);
mSizer->Fit(this);
}
ConvertDialog :: ~ConvertDialog()
{
}
int ConvertDialog :: getQuality()
{
return mQuality->GetValue();
}
bool ConvertDialog :: getPreAnalyze()
{
return mPreAnalyze->GetValue();
}

View File

@ -1,20 +0,0 @@
#ifndef CONVERTDLG_H
#define CONVERTDLG_H
#include "wx/wx.h"
class ConvertDialog : public wxDialog
{
public:
ConvertDialog(wxWindow *parent);
~ConvertDialog();
wxStaticText *mQualityText;
wxSlider *mQuality;
wxCheckBox *mPreAnalyze;
int getQuality();
bool getPreAnalyze();
};
#endif

View File

@ -1,281 +0,0 @@
#include "wxplayctrl.h"
#include "wxplayer.h"
#include "wxplayerframe.h"
#include "../resource/Play.xpm"
#include "../resource/PlayDown.xpm"
#include "../resource/Pause.xpm"
#include "../resource/PauseDown.xpm"
#define PLAYPAUSE 10000
#define TIMER 10001
#define SEEK 10002
#define RATE 10003
#define PITCH 10004
#define VOLUME 10005
#define RATE_MAX 200
#define RATE_MIN 25
#define RATE_DEFAULT 100
#define PITCH_MIN -12
#define PITCH_DEFAULT 0
#define PITCH_MAX 12
#define SEEK_MAX 512
BEGIN_EVENT_TABLE(PlayCtrl, wxPanel)
EVT_BUTTON(PLAYPAUSE,PlayCtrl::OnPlayPause)
EVT_TIMER(TIMER,PlayCtrl::OnTimer)
EVT_SCROLL_THUMBTRACK(PlayCtrl::OnTrack)
EVT_SCROLL_THUMBRELEASE(PlayCtrl::OnRelease)
END_EVENT_TABLE()
BEGIN_EVENT_TABLE(wxStaticText_NoFlicker,wxStaticText)
EVT_ERASE_BACKGROUND(wxStaticText_NoFlicker::OnEraseBackground)
END_EVENT_TABLE()
PlayCtrl :: PlayCtrl(wxWindow *parent, sbsmsplayer *player)
: wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxCLIP_CHILDREN| wxTAB_TRAVERSAL )
{
this->parent = (wxPlayerFrame*)parent;
this->player = player;
bmPlay = wxBitmap(Play_xpm);
bmPlayDown = wxBitmap(PlayDown_xpm);
bmPause = wxBitmap(Pause_xpm);
bmPauseDown = wxBitmap(PlayDown_xpm);
btnPlayPause = new wxBitmapButton(this, PLAYPAUSE, bmPlay,wxDefaultPosition,wxDefaultSize,0);
#ifndef __WXMSW__
btnPlayPause->SetBitmapFocus( bmPlayDown );
#else
pPlayEvt = new CBtnDownEvt( btnPlayPause, &bmPlayDown, &bmPlay );
pPauseEvt = new CBtnDownEvt( btnPlayPause, &bmPauseDown, &bmPause );
btnPlayPause->PushEventHandler( pPlayEvt );
#endif
slVolume = new wxSlider( this,VOLUME,90,0,100);
slSeek = new wxSlider( this,SEEK,0,0,SEEK_MAX);
slSeek->Connect(wxEVT_RIGHT_DOWN,wxMouseEventHandler(PlayCtrl::OnClickTimeDisplay),NULL,this);
slRate = new wxSlider( this,RATE,RATE_DEFAULT,RATE_MIN,RATE_MAX);
slPitch = new wxSlider( this,PITCH,PITCH_DEFAULT,PITCH_MIN,PITCH_MAX);
stVolume = new wxStaticText_NoFlicker( this, -1, wxT("Volume: 90\%"), wxDefaultPosition, wxDefaultSize, 0 );
stRate = new wxStaticText_NoFlicker( this, -1, wxT("Rate: 100\%"), wxDefaultPosition, wxDefaultSize, 0 );
stPitch = new wxStaticText_NoFlicker( this, -1, wxT("Pitch: 0 "), wxDefaultPosition, wxDefaultSize, 0 );
wxGridSizer *hsButtons = new wxGridSizer(1);
hsButtons->Add( btnPlayPause ,0,wxALIGN_CENTRE_HORIZONTAL | wxLEFT ,1);
stCurtime = new wxStaticText_NoFlicker( this, -1, wxT(""), wxDefaultPosition, wxDefaultSize, 0 );
nTimeDisplayMode = 0;
wxBoxSizer *hsPlay = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer *vsPlay = new wxBoxSizer( wxVERTICAL );
hsPlay->Add( hsButtons, 1, wxEXPAND|wxALL, 2 );
hsPlay->AddSpacer(10);
hsPlay->Add( slSeek, 0, wxALIGN_CENTER );
hsPlay->AddSpacer(10);
hsPlay->Add( stCurtime );
wxFlexGridSizer *gsControls = new wxFlexGridSizer(3,2,10,10);
gsControls->Add(stVolume);
gsControls->Add(slVolume);
gsControls->Add(stRate);
gsControls->Add(slRate);
gsControls->Add(stPitch);
gsControls->Add(slPitch);
vsPlay->AddSpacer(10);
vsPlay->Add(gsControls);
vsPlay->AddSpacer(10);
vsPlay->Add(hsPlay);
vsPlay->AddSpacer(10);
SetSizer( vsPlay);
pSecTimer = NULL;
UpdateTime();
StartTimer();
bPlay = false;
bWasPlaying = false;
vsPlay->Fit(this);
Layout();
}
PlayCtrl::~PlayCtrl()
{
KillTimer();
#ifdef __WXMSW__
btnPlayPause->PopEventHandler();
delete pPlayEvt;
delete pPauseEvt;
#endif
}
void PlayCtrl::OnTrack(wxScrollEvent &event)
{
if(event.GetId() == SEEK) {
if(player->isPlaying()) {
bWasPlaying = true;
KillTimer();
player->pause();
}
} else if(event.GetId() == RATE) {
int intval = slVolume->GetValue();
stVolume->SetLabel( wxString::Format( wxT("volume: %d"),intval) + wxT("\%") );
} else if(event.GetId() == RATE) {
int intval = slRate->GetValue();
stRate->SetLabel( wxString::Format( wxT("Rate: %d"),intval) + wxT("\%") );
} else if(event.GetId() == PITCH) {
int intval = slPitch->GetValue();
stPitch->SetLabel( wxString::Format( wxT("Pitch: %s%d"),intval>0?wxT("+"):wxT(""),intval) );
}
}
void PlayCtrl::OnRelease(wxScrollEvent &event)
{
if(event.GetId() == SEEK) {
real fPos = (real)slSeek->GetValue()/SEEK_MAX;
player->setPos(fPos);
if(bWasPlaying) {
player->play();
StartTimer();
bWasPlaying = false;
}
} else if(event.GetId() == VOLUME) {
int intval = slVolume->GetValue();
real val = (real)intval*.01f;
player->setVolume(val);
stVolume->SetLabel( wxString::Format( wxT("Volume: %d"),intval) + wxT("\%") );
} else if(event.GetId() == RATE) {
int intval = slRate->GetValue();
real val = (real)intval*.01f;
player->setRate(val);
stRate->SetLabel( wxString::Format( wxT("Rate: %d"),intval) + wxT("\%") );
} else if(event.GetId() == PITCH) {
int intval = slPitch->GetValue();
real val = (real)intval;
real ratio = pow(2.0,-val/12.0);
player->setRatio(ratio);
stPitch->SetLabel( wxString::Format( wxT("Pitch: %s%d"),intval>0?wxT("+"):wxT(""),intval) );
}
}
void PlayCtrl::OnTimer( wxTimerEvent& WXUNUSED(event) )
{
if( player->isPlaying() ) {
UpdateTime();
} else if( player->isDonePlaying() ){
parent->OnPause();
player->setPos(0.0f);
UpdateTime();
PauseBtnToPlayBtn();
bPlay = false;
}
}
void PlayCtrl::StartTimer()
{
if ( pSecTimer == NULL ) {
pSecTimer = new wxTimer(this, TIMER );
pSecTimer->Start( 100, false );
}
}
void PlayCtrl::KillTimer()
{
if(pSecTimer) {
pSecTimer->Stop();
delete pSecTimer;
pSecTimer = NULL;
}
}
void PlayCtrl::PlayBtnToPauseBtn()
{
#ifndef __WXMSW__
btnPlayPause->SetBitmapLabel( bmPause );
btnPlayPause->SetBitmapFocus( bmPauseDown );
#else
btnPlayPause->SetBitmapLabel( bmPause );
btnPlayPause->PopEventHandler();
btnPlayPause->PushEventHandler( pPauseEvt );
#endif
btnPlayPause->Refresh();
}
void PlayCtrl::PauseBtnToPlayBtn()
{
#ifndef __WXMSW__
btnPlayPause->SetBitmapLabel( bmPlay );
btnPlayPause->SetBitmapFocus( bmPlayDown );
#else
btnPlayPause->SetBitmapLabel( bmPlay );
btnPlayPause->PopEventHandler();
btnPlayPause->PushEventHandler( pPlayEvt );
#endif
btnPlayPause->Refresh();
}
void PlayCtrl::OnPlayPause( wxCommandEvent& WXUNUSED(event) )
{
if(bPlay) {
if(player->pause()) {
parent->OnPause();
bPlay = false;
PauseBtnToPlayBtn();
KillTimer();
}
} else {
if(player->play()) {
parent->OnPlay();
bPlay = true;
PlayBtnToPauseBtn();
StartTimer();
}
}
}
void PlayCtrl::OnClickTimeDisplay(wxMouseEvent & WXUNUSED(event))
{
++nTimeDisplayMode %= 2;
}
wxString PlayCtrl::getTime(real time)
{
int h = (int)(time/3600.0f);
time -= h*3600.0f;
int m = (int)(time/60.0f);
time -= m*60.0f;
int s = (int)time;
time -= s;
int cs = (int)(time*100.0f);
return wxString::Format( wxT("%.2d:%.2d:%.2d"),m,s,cs);
}
wxString PlayCtrl::getTimeLeft(real time, real duration)
{
return getTime(duration-time);
}
void PlayCtrl::UpdateTime()
{
real duration = player->getDuration();
real time = player->getTime();
real fPos = duration?SEEK_MAX*time/duration : 0;
#ifdef __WXGTK__
if ( fPos < 2.0f )
fPos = 2.0f;
#endif
slSeek->SetValue( (int)fPos );
if(nTimeDisplayMode == 0) {
stCurtime->SetLabel(wxT(" ") + getTime(time));
} else {
stCurtime->SetLabel(wxT("-") + getTimeLeft(time,duration));
}
}

View File

@ -1,74 +0,0 @@
#ifndef PLAYCTRL_H
#define PLAYCTRL_H
#include "wx/wx.h"
#include "btndown.h"
#include "play.h"
class wxPlayerFrame;
class wxStaticText_NoFlicker : public wxStaticText
{
public:
wxStaticText_NoFlicker(wxWindow* parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name= wxStaticTextNameStr )
:wxStaticText(parent,id,label,pos,size,style,name){}
void OnEraseBackground(wxEraseEvent& ) {}
DECLARE_EVENT_TABLE()
};
class PlayCtrl : public wxPanel
{
public:
PlayCtrl(wxWindow *parent, sbsmsplayer *player);
~PlayCtrl();
void OnPlayPause( wxCommandEvent& WXUNUSED(event) );
void OnTrack( wxScrollEvent &event);
void OnRelease( wxScrollEvent &event);
void OnTimer( wxTimerEvent& WXUNUSED(event) );
void OnClickTimeDisplay( wxMouseEvent& event );
wxBitmap bmPlay, bmPlayDown;
wxBitmap bmPause, bmPauseDown;
wxPlayerFrame *parent;
wxBitmapButton *btnPlayPause;
wxSlider *slVolume;
wxSlider *slSeek;
wxSlider *slRate;
wxSlider *slPitch;
wxStaticText_NoFlicker *stVolume;
wxStaticText_NoFlicker *stRate;
wxStaticText_NoFlicker *stPitch;
wxStaticText_NoFlicker *stCurtime;
#ifdef __WXMSW__
CBtnDownEvt *pPlayEvt;
CBtnDownEvt *pPauseEvt;
#endif
DECLARE_EVENT_TABLE()
protected:
wxString getTime(real time);
wxString getTimeLeft(real time, real duration);
bool bWasPlaying;
bool bPlay;
sbsmsplayer *player;
int nTimeDisplayMode;
void PlayBtnToPauseBtn();
void PauseBtnToPlayBtn();
void UpdateTime();
void StartTimer();
void KillTimer();
wxTimer *pSecTimer;
};
#endif

View File

@ -1,27 +0,0 @@
#include "wxplayer.h"
#include "wxplayerframe.h"
#include "wx/filename.h"
IMPLEMENT_APP(wxPlayerApp)
bool wxPlayerApp::OnInit()
{
#ifdef _WIN32
int status = pthread_win32_process_attach_np();
#endif
sbsmsplayer *player = new sbsmsplayer();
wxImage::AddHandler(new wxPNGHandler);
wxPlayerFrame *pMain = new wxPlayerFrame(player);
SetTopWindow( pMain );
pMain->Show();
return true;
}
int wxPlayerApp::OnExit()
{
#ifdef _WIN32
int status = pthread_win32_process_detach_np();
#endif
return 0;
}

View File

@ -1,19 +0,0 @@
#ifndef WXPLAYER_H
#define WXPLAYER_H
#include "wx/wx.h"
#include "play.h"
class wxPlayerApp : public wxApp
{
public:
wxPlayerApp() {}
~wxPlayerApp() {};
bool OnInit();
int OnExit();
};
DECLARE_APP(wxPlayerApp);
#endif

View File

@ -1,122 +0,0 @@
#include "wxplayerframe.h"
#include <wx/progdlg.h>
#include <wx/filename.h>
#include "wxconvertdlg.h"
#include "convert.h"
BEGIN_EVENT_TABLE(wxPlayerFrame, wxFrame)
EVT_MENU(wxID_OPEN,wxPlayerFrame::OnOpen)
EVT_MENU(wxID_SAVE,wxPlayerFrame::OnSave)
EVT_MENU(wxID_EXIT,wxPlayerFrame::OnExit)
END_EVENT_TABLE()
bool progressCB(int progress, const char *msg, void *data)
{
wxProgressDialog *progressDlg = (wxProgressDialog*)data;
return progressDlg->Update(progress);
}
void wxPlayerFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
{
wxFileDialog dlg(this, wxT("Choose a file"), wxT("."), wxT(""), wxT("All filetypes (*.sbsms;*.mp3;*.wav;*.aif;*.aiff;*.pcm)|*.sbsms;*.mp3;*.wav;*.aif;*.aiff;*.pcm"),wxOPEN);
if(dlg.ShowModal() == wxID_OK) {
wxString pathStr = dlg.GetPath();
wxFileName path(pathStr);
player->close();
if(path.GetExt().Cmp(wxT("sbsms")) == 0) {
if(player->open(path.GetFullPath().fn_str()))
openFileName = path.GetFullPath();
} else {
ConvertDialog convertDlg(this);
if(convertDlg.ShowModal() == wxID_OK) {
bool bPreAnalyze = convertDlg.getPreAnalyze();
int quality = convertDlg.getQuality();
wxFileName sbsmsPath(path.GetPath(wxPATH_GET_VOLUME|wxPATH_GET_SEPARATOR) + path.GetName() + wxT(".sbsms"));
wxProgressDialog progress(wxT("Progress"),wxT("Converting to ") + sbsmsPath.GetFullName());
bool status = sbsms_convert(path.GetFullPath().fn_str(),sbsmsPath.GetFullPath().fn_str(),true,false,bPreAnalyze,quality,progressCB,&progress,1.0f,1.0f,1.0f,1.0f,1.0f);
if(status) {
if(player->open(sbsmsPath.GetFullPath().fn_str()))
openFileName = sbsmsPath.GetFullPath();
} else {
wxMessageDialog msg(this,wxT("Conversion Failed"),wxT(""),wxOK);
}
}
}
}
}
void wxPlayerFrame::OnSave(wxCommandEvent& WXUNUSED(event))
{
if(openFileName.Cmp(wxT("")) != 0) {
wxFileDialog dlg(this, wxT("Choose a file"), wxT("."), wxT(""), wxT("*.wav"),wxSAVE|wxOVERWRITE_PROMPT);
if(dlg.ShowModal() == wxID_OK) {
wxString pathStr = dlg.GetPath();
wxFileName path(pathStr);
wxProgressDialog progress(wxT("Progress"),wxT("Converting to ") + path.GetFullName());
real rate = player->getRate();
real ratio = player->getRatio();
real volume = player->getVolume();
bool status = sbsms_convert(openFileName.fn_str(),path.GetFullPath().fn_str(),false,true,false,1,progressCB,&progress,rate,rate,ratio,ratio,volume);
if(!status) {
wxMessageDialog msg(this,wxT("Conversion Failed"),wxT(""),wxOK);
}
}
}
}
void wxPlayerFrame::OnExit(wxCommandEvent& WXUNUSED(event))
{
Close();
}
wxPlayerFrame::wxPlayerFrame(sbsmsplayer *player)
: wxFrame( (wxFrame*)NULL, -1, wxT("SBSMS"))
{
this->player = player;
openFileName = wxT("");
wxMenu* file_menu = new wxMenu;
file_menu->Append( wxID_OPEN, _("Open") );
file_menu->AppendSeparator();
file_menu->Append( wxID_SAVE, _("Save") );
file_menu->AppendSeparator();
file_menu->Append( wxID_EXIT, _("Exit") );
wxMenuBar *menu_bar = new wxMenuBar;
menu_bar->Append( file_menu, _("&File") );
SetMenuBar( menu_bar );
#ifdef __WXMSW__
wxIcon ic(wxICON(SBSMSLogo));
SetIcon(ic);
#endif
wxBoxSizer *hs = new wxBoxSizer( wxHORIZONTAL );
playCtrl = new PlayCtrl(this,player);
playCtrl->Show(true);
hs->Add(playCtrl);
SetSizer(hs);
hs->Fit(this);
Layout();
}
void wxPlayerFrame :: OnPause()
{
GetMenuBar()->Enable(wxID_OPEN,true);
GetMenuBar()->Enable(wxID_SAVE,true);
GetMenuBar()->Enable(wxID_EXIT,true);
}
void wxPlayerFrame :: OnPlay()
{
GetMenuBar()->Enable(wxID_OPEN,false);
GetMenuBar()->Enable(wxID_SAVE,false);
GetMenuBar()->Enable(wxID_EXIT,false);
}
wxPlayerFrame::~wxPlayerFrame()
{
}

View File

@ -1,27 +0,0 @@
#ifndef WXPLAYERFRAME_H
#define WXPLAYERFRAME_H
#include "wx/wx.h"
#include "play.h"
#include "wxplayctrl.h"
class wxPlayerFrame : public wxFrame
{
public:
wxPlayerFrame(sbsmsplayer *player);
~wxPlayerFrame();
void OnPause();
void OnPlay();
void OnOpen(wxCommandEvent& WXUNUSED(event));
void OnSave(wxCommandEvent& WXUNUSED(event));
void OnExit(wxCommandEvent& WXUNUSED(event));
DECLARE_EVENT_TABLE()
protected:
wxString openFileName;
sbsmsplayer *player;
PlayCtrl *playCtrl;
};
#endif

View File

@ -1,304 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="libmad"
ProjectGUID="{74635DE6-DD14-4BAD-B820-A7531766D78E}"
RootNamespace="libmad"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\libmad\msvc++"
PreprocessorDefinitions="FPM_DEFAULT;_LIB;HAVE_CONFIG_H;ASO_ZEROCHECK;WIN32;_DEBUG;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
PrecompiledHeaderFile=".\Debug/libmad.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
SuppressStartupBanner="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile=".\Debug\libmad.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\Debug/libmad.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\libmad\msvc++"
PreprocessorDefinitions="NDEBUG;FPM_INTEL;WIN32;_LIB;HAVE_CONFIG_H;ASO_ZEROCHECK"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\Release/libmad.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile=".\Release\libmad.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\Release/libmad.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="c"
>
<File
RelativePath="..\..\..\libmad\bit.c"
>
</File>
<File
RelativePath="..\..\..\libmad\decoder.c"
>
</File>
<File
RelativePath="..\..\..\libmad\fixed.c"
>
</File>
<File
RelativePath="..\..\..\libmad\frame.c"
>
</File>
<File
RelativePath="..\..\..\libmad\huffman.c"
>
</File>
<File
RelativePath="..\..\..\libmad\layer12.c"
>
</File>
<File
RelativePath="..\..\..\libmad\layer3.c"
>
</File>
<File
RelativePath="..\..\..\libmad\stream.c"
>
</File>
<File
RelativePath="..\..\..\libmad\synth.c"
>
</File>
<File
RelativePath="..\..\..\libmad\timer.c"
>
</File>
<File
RelativePath="..\..\..\libmad\version.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h"
>
<File
RelativePath="..\..\..\libmad\bit.h"
>
</File>
<File
RelativePath="..\..\..\libmad\decoder.h"
>
</File>
<File
RelativePath="..\..\..\libmad\fixed.h"
>
</File>
<File
RelativePath="..\..\..\libmad\frame.h"
>
</File>
<File
RelativePath="..\..\..\libmad\global.h"
>
</File>
<File
RelativePath="..\..\..\libmad\huffman.h"
>
</File>
<File
RelativePath="..\..\..\libmad\layer12.h"
>
</File>
<File
RelativePath="..\..\..\libmad\layer3.h"
>
</File>
<File
RelativePath="..\..\..\libmad\mad.h"
>
</File>
<File
RelativePath="..\..\..\libmad\stream.h"
>
</File>
<File
RelativePath="..\..\..\libmad\synth.h"
>
</File>
<File
RelativePath="..\..\..\libmad\timer.h"
>
</File>
<File
RelativePath="..\..\..\libmad\version.h"
>
</File>
</Filter>
<Filter
Name="Data Files"
Filter="dat"
>
<File
RelativePath="..\..\..\libmad\D.dat"
>
</File>
<File
RelativePath="..\..\..\libmad\imdct_s.dat"
>
</File>
<File
RelativePath="..\..\..\libmad\qc_table.dat"
>
</File>
<File
RelativePath="..\..\..\libmad\rq_table.dat"
>
</File>
<File
RelativePath="..\..\..\libmad\sf_table.dat"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,945 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="libsndfile"
ProjectGUID="{F4B4A272-4ED3-4951-A6EE-B7BAAC1C4952}"
RootNamespace="libsndfile"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\$(ConfigurationName)"
IntermediateDirectory=".\$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\libsndfile\Win32;..\..\..\libsndfile\include;..\..\..\libsndfile\src"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;inline=__inline"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\$(ConfigurationName)/libsndfile.pch"
AssemblerListingLocation=".\$(ConfigurationName)/"
ObjectFile=".\$(ConfigurationName)/"
ProgramDataBaseFileName=".\$(ConfigurationName)/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="sndfiled.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\$(ConfigurationName)"
IntermediateDirectory=".\$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/O2"
Optimization="2"
InlineFunctionExpansion="2"
AdditionalIncludeDirectories="..\..\..\libsndfile\Win32;..\..\..\libsndfile\include;..\..\..\libsndfile\src"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;inline=__inline"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\$(ConfigurationName)/libsndfile.pch"
AssemblerListingLocation=".\$(ConfigurationName)/"
ObjectFile=".\$(ConfigurationName)/"
ProgramDataBaseFileName=".\$(ConfigurationName)/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="sndfile.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Unicode_Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".,include,../src"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;inline=__inline"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\$(ConfigurationName)/libsndfile.pch"
AssemblerListingLocation=".\$(ConfigurationName)/"
ObjectFile=".\$(ConfigurationName)/"
ProgramDataBaseFileName=".\$(ConfigurationName)/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="sndfileud.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Unicode_Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/O2"
Optimization="2"
InlineFunctionExpansion="2"
AdditionalIncludeDirectories=".,include,../src"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;inline=__inline"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\$(ConfigurationName)/libsndfile.pch"
AssemblerListingLocation=".\$(ConfigurationName)/"
ObjectFile=".\$(ConfigurationName)/"
ProgramDataBaseFileName=".\$(ConfigurationName)/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="sndfileu.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug DLL|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".,include,../src"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;inline=__inline"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\$(ConfigurationName)/libsndfile.pch"
AssemblerListingLocation=".\$(ConfigurationName)/"
ObjectFile=".\$(ConfigurationName)/"
ProgramDataBaseFileName=".\$(ConfigurationName)/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="sndfiled.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug wx284|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".,include,../src"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;inline=__inline"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\$(ConfigurationName)/libsndfile.pch"
AssemblerListingLocation=".\$(ConfigurationName)/"
ObjectFile=".\$(ConfigurationName)/"
ProgramDataBaseFileName=".\$(ConfigurationName)/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="sndfiled.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Modular_Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/O2"
Optimization="2"
InlineFunctionExpansion="2"
AdditionalIncludeDirectories=".,include,../src"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;inline=__inline"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\$(ConfigurationName)/libsndfile.pch"
AssemblerListingLocation=".\$(ConfigurationName)/"
ObjectFile=".\$(ConfigurationName)/"
ProgramDataBaseFileName=".\$(ConfigurationName)/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="sndfile.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\..\..\libsndfile\src\aiff.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\alaw.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\au.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\avr.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\broadcast.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\caf.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\command.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\common.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\dither.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\double64.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\dwd.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\dwvw.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\file_io.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\flac.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\float32.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\g72x.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Unicode_Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Unicode_Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug DLL|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug wx284|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Modular_Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\libsndfile\src\gsm610.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\htk.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\ima_adpcm.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\interleave.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\ircam.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\macbinary3.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\macos.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\mat4.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\mat5.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\ms_adpcm.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\nist.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\ogg.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\paf.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\pcm.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\pvf.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\raw.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\rx2.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\sd2.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\sds.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\sndfile.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\strings.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\svx.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\txw.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\ulaw.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\voc.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\vox_adpcm.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\w64.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\wav.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\wav_w64.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\wve.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\xi.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\..\..\libsndfile\src\common.h"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\float_cast.h"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\sf_unistd.h"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\sfconfig.h"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\sfendian.h"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\wav_w64.h"
>
</File>
</Filter>
<Filter
Name="G72X"
>
<File
RelativePath="..\..\..\libsndfile\src\G72x\g721.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\G72x\g723_16.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\G72x\g723_24.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\G72x\g723_40.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\G72x\g72x.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\G72x\g72x.h"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\G72x\g72x_priv.h"
>
</File>
</Filter>
<Filter
Name="GSM610"
>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\add.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\code.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\config.h"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\decode.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\gsm.h"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\gsm610_priv.h"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\gsm_create.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\gsm_decode.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\gsm_destroy.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\gsm_encode.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\gsm_option.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\long_term.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\lpc.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\preprocess.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\rpe.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\short_term.c"
>
</File>
<File
RelativePath="..\..\..\libsndfile\src\GSM610\table.c"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,543 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="portaudio-v19"
ProjectGUID="{7ABA0F80-94AE-4E82-AB89-2E1258212D59}"
RootNamespace="portaudio-v19"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Unicode Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="echo // Automatically generated file &gt;&quot;$(InputDir)/$(ConfigurationName)/config.h&quot;&#x0D;&#x0A;IF &quot;%DXSDK_DIR%&quot; == &quot;&quot; echo #define PA_NO_DS &gt;&gt;&quot;$(InputDir)/$(ConfigurationName)/config.h&quot;&#x0D;&#x0A;IF &quot;%ASIOSDK_DIR%&quot; == &quot;&quot; echo #define PA_NO_ASIO &gt;&gt;&quot;$(InputDir)/$(ConfigurationName)/config.h&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\lib-src\portaudio-v19\include;..\..\..\lib-src\portaudio-v19\src\common"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
CompileAs="0"
DisableSpecificWarnings="4996"
ForcedIncludeFiles="$(ProjectDir)\$(ConfigurationName)\config.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="set BASE=&quot;../../../lib-src/portaudio-v19&quot;&#x0D;&#x0A;set CFLAGS=/O2 /GL /I &quot;%BASE%/include&quot; /I &quot;%BASE%/src/common&quot; /I &quot;%BASE%/src/os/win&quot; /D &quot;WIN32&quot; /D &quot;NDEBUG&quot; /D &quot;_LIB&quot; /D &quot;_MBCS&quot; /GF /FD /EHsc /MD /Gy /Fo&quot;$(IntDir)/&quot; /Fd&quot;$(IntDir)/&quot; /W3 /nologo /c /wd4996 /FI &quot;$(InputDir)/$(ConfigurationName)/config.h&quot; /errorReport:prompt&#x0D;&#x0A;set LIBS=&#x0D;&#x0A;&#x0D;&#x0A;if &quot;%DXSDK_DIR%&quot;==&quot;&quot; goto NoDX&#x0D;&#x0A;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%DXSDK_DIR%/include&quot; &quot;%BASE%/src/hostapi/dsound/pa_win_ds.c&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%DXSDK_DIR%/include&quot; &quot;%BASE%/src/hostapi/dsound/pa_win_ds_dynlink.c&quot;&#x0D;&#x0A;&#x0D;&#x0A;set LIBS=&quot;%DXSDK_DIR%/lib/x86\dxguid.lib&quot;&#x0D;&#x0A;&#x0D;&#x0A;:NoDX&#x0D;&#x0A;&#x0D;&#x0A;if &quot;%ASIOSDK_DIR%&quot;==&quot;&quot; goto NoASIO&#x0D;&#x0A;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%BASE%/src/hostapi/asio/pa_asio.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%BASE%/src/hostapi/asio/iasiothiscallresolver.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%ASIOSDK_DIR%/common/asio.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%ASIOSDK_DIR%/host/asiodrivers.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%ASIOSDK_DIR%/host/pc/asiolist.cpp&quot;&#x0D;&#x0A;&#x0D;&#x0A;:NoASIO&#x0D;&#x0A;&#x0D;&#x0A;lib /OUT:&quot;$(TargetPath)&quot; &quot;$(IntDir)/*.obj&quot; %LIBS%&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Unicode Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="echo // Automatically generated file &gt;&quot;$(InputDir)/$(ConfigurationName)/config.h&quot;&#x0D;&#x0A;IF &quot;%DXSDK_DIR%&quot; == &quot;&quot; echo #define PA_NO_DS &gt;&gt;&quot;$(InputDir)/$(ConfigurationName)/config.h&quot;&#x0D;&#x0A;IF &quot;%ASIOSDK_DIR%&quot; == &quot;&quot; echo #define PA_NO_ASIO &gt;&gt;&quot;$(InputDir)/$(ConfigurationName)/config.h&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\lib-src\portaudio-v19\include;..\..\..\lib-src\portaudio-v19\src\common"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
StringPooling="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
CompileAs="0"
DisableSpecificWarnings="4996"
ForcedIncludeFiles="$(ProjectDir)\$(ConfigurationName)\config.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="set BASE=&quot;../../../lib-src/portaudio-v19&quot;&#x0D;&#x0A;set CFLAGS=/Od /I &quot;%BASE%/include&quot; /I &quot;%BASE%/src/common&quot; /I &quot;%BASE%/src/os/win&quot; /D &quot;WIN32&quot; /D &quot;_DEBUG&quot; /D &quot;_LIB&quot; /D &quot;_MBCS&quot; /GF /FD /EHsc /RTC1 /MDd /Gy /Fo&quot;$(IntDir)/&quot; /Fd&quot;$(IntDir)/&quot; /W3 /nologo /c /ZI /wd4996 /FI &quot;$(InputDir)/$(ConfigurationName)/config.h&quot; /errorReport:prompt&#x0D;&#x0A;set LIBS=&#x0D;&#x0A;&#x0D;&#x0A;if &quot;%DXSDK_DIR%&quot;==&quot;&quot; goto NoDX&#x0D;&#x0A;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%DXSDK_DIR%/include&quot; &quot;%BASE%/src/hostapi/dsound/pa_win_ds.c&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%DXSDK_DIR%/include&quot; &quot;%BASE%/src/hostapi/dsound/pa_win_ds_dynlink.c&quot;&#x0D;&#x0A;&#x0D;&#x0A;set LIBS=&quot;%DXSDK_DIR%/lib/x86\dxguid.lib&quot;&#x0D;&#x0A;&#x0D;&#x0A;:NoDX&#x0D;&#x0A;&#x0D;&#x0A;if &quot;%ASIOSDK_DIR%&quot;==&quot;&quot; goto NoASIO&#x0D;&#x0A;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%BASE%/src/hostapi/asio/pa_asio.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%BASE%/src/hostapi/asio/iasiothiscallresolver.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%ASIOSDK_DIR%/common/asio.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%ASIOSDK_DIR%/host/asiodrivers.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%ASIOSDK_DIR%/host/pc/asiolist.cpp&quot;&#x0D;&#x0A;&#x0D;&#x0A;:NoASIO&#x0D;&#x0A;&#x0D;&#x0A;lib /OUT:&quot;$(TargetPath)&quot; &quot;$(IntDir)/*.obj&quot; %LIBS%&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="echo // Automatically generated file &gt;&quot;$(InputDir)/$(ConfigurationName)/config.h&quot;&#x0D;&#x0A;IF &quot;%DXSDK_DIR%&quot; == &quot;&quot; echo #define PA_NO_DS &gt;&gt;&quot;$(InputDir)/$(ConfigurationName)/config.h&quot;&#x0D;&#x0A;IF &quot;%ASIOSDK_DIR%&quot; == &quot;&quot; echo #define PA_NO_ASIO &gt;&gt;&quot;$(InputDir)/$(ConfigurationName)/config.h&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;..\..\..\portaudio-v19\include&quot;;&quot;..\..\..\portaudio-v19\src\common&quot;;&quot;..\..\..\portaudio-v19\src\os\win&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
StringPooling="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
CompileAs="0"
DisableSpecificWarnings="4996"
ForcedIncludeFiles="$(ProjectDir)\$(ConfigurationName)\config.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="set BASE=&quot;../../../portaudio-v19&quot;&#x0D;&#x0A;set CFLAGS=/O2 /GL /I &quot;%BASE%/include&quot; /I &quot;%BASE%/src/common&quot; /I &quot;%BASE%/src/os/win&quot; /D &quot;WIN32&quot; /D &quot;NDEBUG&quot; /D &quot;_LIB&quot; /D &quot;_MBCS&quot; /GF /FD /EHsc /MD /Gy /Fo&quot;$(IntDir)/&quot; /Fd&quot;$(IntDir)/&quot; /W3 /nologo /c /wd4996 /FI &quot;$(InputDir)/$(ConfigurationName)/config.h&quot; /errorReport:prompt&#x0D;&#x0A;set LIBS=&#x0D;&#x0A;&#x0D;&#x0A;if &quot;%DXSDK_DIR%&quot;==&quot;&quot; goto NoDX&#x0D;&#x0A;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%DXSDK_DIR%/include&quot; &quot;%BASE%/src/hostapi/dsound/pa_win_ds.c&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%DXSDK_DIR%/include&quot; &quot;%BASE%/src/hostapi/dsound/pa_win_ds_dynlink.c&quot;&#x0D;&#x0A;&#x0D;&#x0A;set LIBS=&quot;%DXSDK_DIR%/lib/x86\dxguid.lib&quot;&#x0D;&#x0A;&#x0D;&#x0A;:NoDX&#x0D;&#x0A;&#x0D;&#x0A;if &quot;%ASIOSDK_DIR%&quot;==&quot;&quot; goto NoASIO&#x0D;&#x0A;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%BASE%/src/hostapi/asio/pa_asio.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%BASE%/src/hostapi/asio/iasiothiscallresolver.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%ASIOSDK_DIR%/common/asio.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%ASIOSDK_DIR%/host/asiodrivers.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%ASIOSDK_DIR%/host/pc/asiolist.cpp&quot;&#x0D;&#x0A;&#x0D;&#x0A;:NoASIO&#x0D;&#x0A;&#x0D;&#x0A;lib /OUT:&quot;$(TargetPath)&quot; &quot;$(IntDir)/*.obj&quot; %LIBS%&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="echo // Automatically generated file &gt;&quot;$(InputDir)/$(ConfigurationName)/config.h&quot;&#x0D;&#x0A;IF &quot;%DXSDK_DIR%&quot; == &quot;&quot; echo #define PA_NO_DS &gt;&gt;&quot;$(InputDir)/$(ConfigurationName)/config.h&quot;&#x0D;&#x0A;IF &quot;%ASIOSDK_DIR%&quot; == &quot;&quot; echo #define PA_NO_ASIO &gt;&gt;&quot;$(InputDir)/$(ConfigurationName)/config.h&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..\..\..\portaudio-v19\include&quot;;&quot;..\..\..\portaudio-v19\src\common&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
CompileAs="0"
DisableSpecificWarnings="4996"
ForcedIncludeFiles="$(ProjectDir)\$(ConfigurationName)\config.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="set BASE=&quot;../../../portaudio-v19&quot;&#x0D;&#x0A;set CFLAGS=/O2 /GL /I &quot;%BASE%/include&quot; /I &quot;%BASE%/src/common&quot; /I &quot;%BASE%/src/os/win&quot; /D &quot;WIN32&quot; /D &quot;NDEBUG&quot; /D &quot;_LIB&quot; /D &quot;_MBCS&quot; /GF /FD /EHsc /MD /Gy /Fo&quot;$(IntDir)/&quot; /Fd&quot;$(IntDir)/&quot; /W3 /nologo /c /wd4996 /FI &quot;$(InputDir)/$(ConfigurationName)/config.h&quot; /errorReport:prompt&#x0D;&#x0A;set LIBS=&#x0D;&#x0A;&#x0D;&#x0A;if &quot;%DXSDK_DIR%&quot;==&quot;&quot; goto NoDX&#x0D;&#x0A;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%DXSDK_DIR%/include&quot; &quot;%BASE%/src/hostapi/dsound/pa_win_ds.c&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%DXSDK_DIR%/include&quot; &quot;%BASE%/src/hostapi/dsound/pa_win_ds_dynlink.c&quot;&#x0D;&#x0A;&#x0D;&#x0A;set LIBS=&quot;%DXSDK_DIR%/lib/x86\dxguid.lib&quot;&#x0D;&#x0A;&#x0D;&#x0A;:NoDX&#x0D;&#x0A;&#x0D;&#x0A;if &quot;%ASIOSDK_DIR%&quot;==&quot;&quot; goto NoASIO&#x0D;&#x0A;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%BASE%/src/hostapi/asio/pa_asio.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%BASE%/src/hostapi/asio/iasiothiscallresolver.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%ASIOSDK_DIR%/common/asio.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%ASIOSDK_DIR%/host/asiodrivers.cpp&quot;&#x0D;&#x0A;cl %CFLAGS% /I &quot;%ASIOSDK_DIR%/common&quot; /I &quot;%ASIOSDK_DIR%/host&quot; /I &quot;%ASIOSDK_DIR%/host/pc&quot; &quot;%ASIOSDK_DIR%/host/pc/asiolist.cpp&quot;&#x0D;&#x0A;&#x0D;&#x0A;:NoASIO&#x0D;&#x0A;&#x0D;&#x0A;lib /OUT:&quot;$(TargetPath)&quot; &quot;$(IntDir)/*.obj&quot; %LIBS%&#x0D;&#x0A;"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
>
<Filter
Name="common"
>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_allocation.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_allocation.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_converters.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_converters.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_cpuload.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_cpuload.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_debugprint.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_debugprint.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_dither.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_dither.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_endianness.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_front.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_hostapi.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_memorybarrier.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_process.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_process.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_ringbuffer.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_ringbuffer.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_skeleton.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_stream.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_stream.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_trace.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_trace.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_types.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\common\pa_util.h"
>
</File>
</Filter>
<Filter
Name="hostapi"
>
<Filter
Name="wmme"
>
<File
RelativePath="..\..\..\portaudio-v19\src\hostapi\wmme\pa_win_wmme.c"
>
</File>
</Filter>
<Filter
Name="wdmks"
>
</Filter>
<Filter
Name="dsound"
>
<File
RelativePath="..\..\..\portaudio-v19\src\hostapi\dsound\pa_win_ds.c"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\hostapi\dsound\pa_win_ds_dynlink.c"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\hostapi\dsound\pa_win_ds_dynlink.h"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="asio"
>
</Filter>
</Filter>
<Filter
Name="os"
>
<File
RelativePath="..\..\..\portaudio-v19\src\os\win\pa_win_hostapis.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\os\win\pa_win_util.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\os\win\pa_win_waveformat.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\include\pa_win_waveformat.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\os\win\pa_win_wdmks_utils.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\os\win\pa_win_wdmks_utils.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\os\win\pa_x86_plain_converters.c"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\src\os\win\pa_x86_plain_converters.h"
>
</File>
</Filter>
</Filter>
<Filter
Name="Header Files"
>
<File
RelativePath="..\..\..\portaudio-v19\include\pa_win_ds.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\include\pa_win_wmme.h"
>
</File>
<File
RelativePath="..\..\..\portaudio-v19\include\portaudio.h"
>
</File>
</Filter>
<Filter
Name=".Has Custom Build."
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,224 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="pthread"
ProjectGUID="{2D6A5EE8-179C-43AB-B92F-00057911E102}"
RootNamespace="pthread"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\."
IntermediateDirectory=".\."
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\./pthread.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\pthread\pthreads.2"
PreprocessorDefinitions="__CLEANUP_C;WIN32;NDEBUG;_WINDOWS;_USRDLL;PTW32_BUILD;PTW32_STATIC_LIB"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\./pthread.pch"
AssemblerListingLocation=".\./"
ObjectFile=".\./"
ProgramDataBaseFileName=".\./"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG,PTW32_RC_MSC"
Culture="1033"
AdditionalIncludeDirectories="."
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\./pthread.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\."
IntermediateDirectory=".\."
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\./pthread.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\pthread\pthreads.2"
PreprocessorDefinitions="__CLEANUP_C;WIN32;_DEBUG;_WINDOWS;_USRDLL;PTW32_BUILD;PTW32_STATIC_LIB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\./pthread.pch"
AssemblerListingLocation=".\./"
ObjectFile=".\./"
ProgramDataBaseFileName=".\./"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG,PTW32_RC_MSC"
Culture="1033"
AdditionalIncludeDirectories="."
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\./pthread.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\..\..\pthread\pthreads.2\pthread.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\..\..\pthread\pthreads.2\implement.h"
>
</File>
<File
RelativePath="..\..\..\pthread\pthreads.2\pthread.h"
>
</File>
<File
RelativePath="..\..\..\pthread\pthreads.2\sched.h"
>
</File>
<File
RelativePath="..\..\..\pthread\pthreads.2\semaphore.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
<File
RelativePath="..\..\..\pthread\pthreads.2\version.rc"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -32,7 +32,6 @@ public:
rightBuffer = NULL;
sbsmser = NULL;
pitch = NULL;
outBuf = NULL;
outputLeftBuffer = NULL;
outputRightBuffer = NULL;
@ -46,7 +45,6 @@ public:
if(buf) free(buf);
if(leftBuffer) free(leftBuffer);
if(rightBuffer) free(rightBuffer);
if(pitch) pitch_destroy(pitch);
if(sbsmser) sbsms_destroy(sbsmser);
if(outBuf) free(outBuf);
if(outputLeftBuffer) free(outputLeftBuffer);
@ -68,7 +66,6 @@ public:
// Not required by callbacks, but makes for easier cleanup
sbsms *sbsmser;
pitcher *pitch;
audio *outBuf;
float *outputLeftBuffer;
float *outputRightBuffer;
@ -84,37 +81,12 @@ long samplesCB(audio *chdata, long numFrames, void *userData)
return n_read;
}
real stretchCB(long nProcessed, void *userData)
{
sbsmsInfo *si = (sbsmsInfo*) userData;
real t0 = (real)nProcessed/(real)si->samplesToProcess;
real stretch = si->stretch0 + (si->stretch1-si->stretch0)*t0;
return stretch;
}
real ratioCB(long nProcessed, void *userData)
{
sbsmsInfo *si = (sbsmsInfo*) userData;
real t0 = (real)nProcessed/(real)si->samplesToProcess;
real stretch = si->stretch0 + (si->stretch1-si->stretch0)*t0;
real t1;
if(stretch == si->stretch0)
t1 = 1.0/stretch;
else
t1 = log(stretch/si->stretch0)/(stretch-si->stretch0);
real ratio = si->ratio0 + (si->ratio1-si->ratio0)*t1*(real)nProcessed/(real)si->samplesToGenerate;
return ratio;
}
void EffectSBSMS :: setParameters(double rateStart, double rateEnd, double pitchStart, double pitchEnd, int quality, bool bPreAnalyze)
void EffectSBSMS :: setParameters(double rateStart, double rateEnd, double pitchStart, double pitchEnd, bool bPreAnalyze)
{
this->rateStart = rateStart;
this->rateEnd = rateEnd;
this->pitchStart = pitchStart;
this->pitchEnd = pitchEnd;
this->quality = quality;
this->bPreAnalyze = bPreAnalyze;
}
@ -173,7 +145,7 @@ bool EffectSBSMS::ProcessLabelTrack(Track *t)
bool EffectSBSMS::Process()
{
if(!bInit) {
sbsms_init(4096);
sbsms_init(8192);
bInit = TRUE;
}
@ -296,13 +268,13 @@ bool EffectSBSMS::Process()
si.rs = rb.resampler;
si.samplesToProcess = samplesToProcess;
si.samplesToGenerate = samplesToGenerate;
si.stretch0 = rateStart;
si.stretch1 = rateEnd;
si.ratio0 = pitchStart;
si.ratio1 = pitchEnd;
si.rate0 = rateStart;
si.rate1 = rateEnd;
si.pitch0 = pitchStart;
si.pitch1 = pitchEnd;
rb.sbsmser = sbsms_create(&samplesCB,&stretchCB,&ratioCB,rightTrack?2:1,quality,bPreAnalyze,true);
rb.pitch = pitch_create(rb.sbsmser,&si,srIn/srSBSMS);
sbsms_quality quality = sbsms_quality_fast;
rb.sbsmser = sbsms_create(&samplesCB,&rateCBLinear,&pitchCBLinear,rightTrack?2:1,&quality,bPreAnalyze,true);
rb.outputLeftTrack = mFactory->NewWaveTrack(leftTrack->GetSampleFormat(),
leftTrack->GetRate());
@ -311,7 +283,7 @@ bool EffectSBSMS::Process()
rightTrack->GetRate());
sampleCount blockSize = SBSMS_FRAME_SIZE[quality];
sampleCount blockSize = quality.maxoutframesize;
rb.outBuf = (audio*)calloc(blockSize,sizeof(audio));
rb.outputLeftBuffer = (float*)calloc(blockSize*2,sizeof(float));
if(rightTrack)
@ -355,14 +327,11 @@ bool EffectSBSMS::Process()
// process
while(pos<samplesOut && outputCount) {
long frames;
if(pos+blockSize>samplesOut) {
frames = samplesOut - pos;
} else {
frames = blockSize;
outputCount = sbsms_read_frame(rb.outBuf, &si, rb.sbsmser, NULL, NULL);
if(pos+outputCount>samplesOut) {
outputCount = samplesOut - pos;
}
outputCount = pitch_process(rb.outBuf, frames, rb.pitch);
for(int i = 0; i < outputCount; i++) {
rb.outputLeftBuffer[i] = rb.outBuf[i][0];
if(rightTrack)

View File

@ -18,14 +18,8 @@
#include "Effect.h"
// Soundtouch defines these as well, so get rid of them before including
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#undef PACKAGE_BUGREPORT
#include "sbsms.h"
using namespace _sbsms_;
class WaveTrack;
@ -33,12 +27,11 @@ class EffectSBSMS : public Effect {
public:
static bool bInit;
virtual bool Process();
void setParameters(double rateStart, double rateEnd, double pitchStart, double pitchEnd, int quality, bool bPreAnalyze);
void setParameters(double rateStart, double rateEnd, double pitchStart, double pitchEnd, bool bPreAnalyze);
private:
bool ProcessLabelTrack(Track *track);
double rateStart, rateEnd, pitchStart, pitchEnd;
int quality;
bool bPreAnalyze;
int mCurTrackNum;
double mCurT0;

View File

@ -40,10 +40,12 @@
EffectTimeScale::EffectTimeScale()
{
m_RateStart = 0;
m_RateEnd = 0;
m_HalfStepsStart = 0;
m_HalfStepsEnd = 0;
m_RatePercentChangeStart = 0;
m_RatePercentChangeEnd = 0;
m_PitchHalfStepsStart = 0;
m_PitchHalfStepsEnd = 0;
m_PitchPercentChangeStart = 0;
m_PitchPercentChangeEnd = 0;
m_PreAnalyze = false;
}
@ -60,10 +62,12 @@ bool EffectTimeScale::Init()
bool EffectTimeScale::PromptUser()
{
TimeScaleDialog dlog(this, mParent);
dlog.m_RateStart = m_RateStart;
dlog.m_RateEnd = m_RateEnd;
dlog.m_HalfStepsStart = m_HalfStepsStart;
dlog.m_HalfStepsEnd = m_HalfStepsEnd;
dlog.m_RatePercentChangeStart = m_RatePercentChangeStart;
dlog.m_RatePercentChangeEnd = m_RatePercentChangeEnd;
dlog.m_PitchHalfStepsStart = m_PitchHalfStepsStart;
dlog.m_PitchHalfStepsEnd = m_PitchHalfStepsEnd;
dlog.m_PitchPercentChangeStart = m_PitchPercentChangeStart;
dlog.m_PitchPercentChangeEnd = m_PitchPercentChangeEnd;
dlog.m_PreAnalyze = m_PreAnalyze;
// Don't need to call TransferDataToWindow, although other
@ -76,10 +80,12 @@ bool EffectTimeScale::PromptUser()
if (dlog.GetReturnCode() == wxID_CANCEL)
return false;
m_RateStart = dlog.m_RateStart;
m_RateEnd = dlog.m_RateEnd;
m_HalfStepsStart = dlog.m_HalfStepsStart;
m_HalfStepsEnd = dlog.m_HalfStepsEnd;
m_RatePercentChangeStart = dlog.m_RatePercentChangeStart;
m_RatePercentChangeEnd = dlog.m_RatePercentChangeEnd;
m_PitchHalfStepsStart = dlog.m_PitchHalfStepsStart;
m_PitchHalfStepsEnd = dlog.m_PitchHalfStepsEnd;
m_PitchPercentChangeStart = dlog.m_PitchPercentChangeStart;
m_PitchPercentChangeEnd = dlog.m_PitchPercentChangeEnd;
m_PreAnalyze = dlog.m_PreAnalyze;
return true;
@ -87,22 +93,38 @@ bool EffectTimeScale::PromptUser()
bool EffectTimeScale::TransferParameters( Shuttle & shuttle )
{
shuttle.TransferDouble(wxT("RateStart"),m_RateStart,0.0);
shuttle.TransferDouble(wxT("RateEnd"),m_RateEnd,0.0);
shuttle.TransferDouble(wxT("HalfStepsStart"),m_HalfStepsStart,0.0);
shuttle.TransferDouble(wxT("HalfStepsEnd"),m_HalfStepsEnd,0.0);
shuttle.TransferDouble(wxT("RatePercentChangeStart"),m_RatePercentChangeStart,0.0);
shuttle.TransferDouble(wxT("RatePercentChangeEnd"),m_RatePercentChangeEnd,0.0);
shuttle.TransferDouble(wxT("PitchHalfStepsStart"),m_PitchHalfStepsStart,0.0);
shuttle.TransferDouble(wxT("PitchHalfStepsEnd"),m_PitchHalfStepsEnd,0.0);
shuttle.TransferDouble(wxT("PitchPercentChangeStart"),m_PitchPercentChangeStart,0.0);
shuttle.TransferDouble(wxT("PitchPercentChangeEnd"),m_PitchPercentChangeEnd,0.0);
shuttle.TransferBool(wxT("PreAnalyze"),m_PreAnalyze,false);
return true;
}
inline double PercentChangeToRatio(double percentChange)
{
return 1.0 + percentChange / 100.0;
}
inline double HalfStepsToPercentChange(double halfSteps)
{
return 100.0 * (pow(2.0,halfSteps/12.0) - 1.0);
}
inline double PercentChangeToHalfSteps(double percentChange)
{
return 12.0 * log2(PercentChangeToRatio(percentChange));
}
bool EffectTimeScale::Process()
{
double pitchStart = pow(2.0,-(m_HalfStepsStart)/12.0);
double pitchEnd = pow(2.0,-(m_HalfStepsEnd)/12.0);
double rateStart = (100.0+m_RateStart)/100.0;
double rateEnd = (100.0+m_RateEnd)/100.0;
int quality = 1;
this->EffectSBSMS::setParameters(rateStart,rateEnd,pitchStart,pitchEnd,quality,m_PreAnalyze);
double pitchStart = PercentChangeToRatio(m_PitchPercentChangeStart);
double pitchEnd = PercentChangeToRatio(m_PitchPercentChangeEnd);
double rateStart = PercentChangeToRatio(m_RatePercentChangeStart);
double rateEnd = PercentChangeToRatio(m_RatePercentChangeEnd);
this->EffectSBSMS::setParameters(rateStart,rateEnd,pitchStart,pitchEnd,m_PreAnalyze);
return this->EffectSBSMS::Process();
}
@ -110,29 +132,38 @@ bool EffectTimeScale::Process()
// TimeScaleDialog
//----------------------------------------------------------------------------
#define RATE_MAX 150
#define RATE_DEFAULT 0
#define RATE_MIN -75
#define HALFSTEPS_MIN -12
#define HALFSTEPS_MAX 12
#define RATE_PERCENTCHANGE_MAX_SLIDER 150
#define RATE_PERCENTCHANGE_MIN_SLIDER -75
#define RATE_PERCENTCHANGE_MAX_TEXT 500
#define RATE_PERCENTCHANGE_MIN_TEXT -90
#define RATE_PERCENTCHANGE_DEFAULT 0
#define PITCH_HALFSTEPS_MIN_TEXT -12
#define PITCH_HALFSTEPS_MAX_TEXT 12
#define PITCH_PERCENTCHANGE_MIN_TEXT -50
#define PITCH_PERCENTCHANGE_MAX_TEXT 100
#define ID_TEXT_RATE_START 10001
#define ID_TEXT_RATE_END 10002
#define ID_TEXT_HALFSTEPS_START 10003
#define ID_TEXT_HALFSTEPS_END 10004
#define ID_SLIDER_RATE_START 10007
#define ID_SLIDER_RATE_END 10008
#define ID_TEXT_RATE_PERCENTCHANGE_START 10001
#define ID_TEXT_RATE_PERCENTCHANGE_END 10002
#define ID_TEXT_PITCH_HALFSTEPS_START 10003
#define ID_TEXT_PITCH_HALFSTEPS_END 10004
#define ID_TEXT_PITCH_PERCENTCHANGE_START 10005
#define ID_TEXT_PITCH_PERCENTCHANGE_END 10006
#define ID_SLIDER_RATE_PERCENTCHANGE_START 10007
#define ID_SLIDER_RATE_PERCENTCHANGE_END 10008
#define ID_CHECKBOX_PREANALYZE 10009
// event table for TimeScaleDialog
BEGIN_EVENT_TABLE(TimeScaleDialog, EffectDialog)
EVT_TEXT(ID_TEXT_RATE_START, TimeScaleDialog::OnText_RateStart)
EVT_TEXT(ID_TEXT_RATE_END, TimeScaleDialog::OnText_RateEnd)
EVT_TEXT(ID_TEXT_HALFSTEPS_START, TimeScaleDialog::OnText_HalfStepsStart)
EVT_TEXT(ID_TEXT_HALFSTEPS_END, TimeScaleDialog::OnText_HalfStepsEnd)
EVT_SLIDER(ID_SLIDER_RATE_START, TimeScaleDialog::OnSlider_RateStart)
EVT_SLIDER(ID_SLIDER_RATE_END, TimeScaleDialog::OnSlider_RateEnd)
EVT_TEXT(ID_TEXT_RATE_PERCENTCHANGE_START, TimeScaleDialog::OnText_RatePercentChangeStart)
EVT_TEXT(ID_TEXT_RATE_PERCENTCHANGE_END, TimeScaleDialog::OnText_RatePercentChangeEnd)
EVT_TEXT(ID_TEXT_PITCH_HALFSTEPS_START, TimeScaleDialog::OnText_PitchHalfStepsStart)
EVT_TEXT(ID_TEXT_PITCH_HALFSTEPS_END, TimeScaleDialog::OnText_PitchHalfStepsEnd)
EVT_TEXT(ID_TEXT_PITCH_PERCENTCHANGE_START, TimeScaleDialog::OnText_PitchPercentChangeStart)
EVT_TEXT(ID_TEXT_PITCH_PERCENTCHANGE_END, TimeScaleDialog::OnText_PitchPercentChangeEnd)
EVT_SLIDER(ID_SLIDER_RATE_PERCENTCHANGE_START, TimeScaleDialog::OnSlider_RatePercentChangeStart)
EVT_SLIDER(ID_SLIDER_RATE_PERCENTCHANGE_END, TimeScaleDialog::OnSlider_RatePercentChangeEnd)
EVT_CHECKBOX(ID_CHECKBOX_PREANALYZE, TimeScaleDialog::OnCheckBox_PreAnalyze)
END_EVENT_TABLE()
@ -146,19 +177,23 @@ TimeScaleDialog::TimeScaleDialog(EffectTimeScale *effect, wxWindow *parent)
// event table handlers get called during this method, and those handlers that
// can cause trouble check for NULL.
m_pTextCtrl_RateStart = NULL;
m_pTextCtrl_RateEnd = NULL;
m_pSlider_RateStart = NULL;
m_pSlider_RateEnd = NULL;
m_pTextCtrl_HalfStepsStart = NULL;
m_pTextCtrl_HalfStepsEnd = NULL;
m_pTextCtrl_RatePercentChangeStart = NULL;
m_pTextCtrl_RatePercentChangeEnd = NULL;
m_pSlider_RatePercentChangeStart = NULL;
m_pSlider_RatePercentChangeEnd = NULL;
m_pTextCtrl_PitchPercentChangeStart = NULL;
m_pTextCtrl_PitchPercentChangeEnd = NULL;
m_pTextCtrl_PitchHalfStepsStart = NULL;
m_pTextCtrl_PitchHalfStepsEnd = NULL;
m_pCheckBox_PreAnalyze = NULL;
// effect parameters
m_RateStart = 0;
m_RateEnd = 0;
m_HalfStepsStart = 0;
m_HalfStepsEnd = 0;
m_RatePercentChangeStart = 0;
m_RatePercentChangeEnd = 0;
m_PitchPercentChangeStart = 0;
m_PitchPercentChangeEnd = 0;
m_PitchHalfStepsStart = 0;
m_PitchHalfStepsEnd = 0;
m_PreAnalyze = false;
Init();
@ -180,58 +215,90 @@ void TimeScaleDialog::PopulateOrExchange(ShuttleGui & S)
S.EndHorizontalLay();
S.SetBorder(5);
// Rate Text
S.StartMultiColumn(2, wxCENTER);
// Rate Start
S.StartStatic(_("Initial Tempo Change (%)"));
{
m_pTextCtrl_RateStart = S.Id(ID_TEXT_RATE_START)
.AddTextBox(_("Initial Tempo Change (%):"), wxT(""), 12);
m_pTextCtrl_RateStart->SetValidator(numvld);
m_pTextCtrl_RateEnd = S.Id(ID_TEXT_RATE_END)
.AddTextBox(_("Final Tempo Change (%):"), wxT(""), 12);
m_pTextCtrl_RateEnd->SetValidator(numvld);
S.StartMultiColumn(1, wxCENTER);
{
m_pTextCtrl_RatePercentChangeStart = S.Id(ID_TEXT_RATE_PERCENTCHANGE_START)
.AddTextBox(_(""), wxT(""), 12);
m_pTextCtrl_RatePercentChangeStart->SetValidator(numvld);
}
S.EndMultiColumn();
S.StartHorizontalLay(wxEXPAND,0);
{
S.SetStyle(wxSL_HORIZONTAL);
m_pSlider_RatePercentChangeStart = S.Id(ID_SLIDER_RATE_PERCENTCHANGE_START)
.AddSlider(wxT(""), (int)RATE_PERCENTCHANGE_DEFAULT, (int)RATE_PERCENTCHANGE_MAX_SLIDER, (int)RATE_PERCENTCHANGE_MIN_SLIDER);
}
S.EndHorizontalLay();
}
S.EndMultiColumn();
// Rate Slider
S.StartHorizontalLay(wxEXPAND);
{
S.SetStyle(wxSL_HORIZONTAL);
m_pSlider_RateStart = S.Id(ID_SLIDER_RATE_START)
.AddSlider(wxT(""), (int)RATE_DEFAULT, (int)RATE_MAX, (int)RATE_MIN);
m_pSlider_RateStart->SetName(_("Initial Tempo Change (%)"));
}
S.EndHorizontalLay();
S.StartHorizontalLay(wxEXPAND);
{
S.SetStyle(wxSL_HORIZONTAL);
m_pSlider_RateEnd = S.Id(ID_SLIDER_RATE_END)
.AddSlider(wxT(""), (int)RATE_DEFAULT, (int)RATE_MAX, (int)RATE_MIN);
m_pSlider_RateEnd->SetName(_("Final Tempo Change (%)"));
}
S.EndHorizontalLay();
// HalfStep Text
S.StartMultiColumn(2, wxCENTER);
{
m_pTextCtrl_HalfStepsStart = S.Id(ID_TEXT_HALFSTEPS_START)
.AddTextBox(_("Initial Pitch Shift (semitones) [-12 to 12]:"), wxT(""), 12);
m_pTextCtrl_HalfStepsStart->SetValidator(numvld);
S.EndStatic();
m_pTextCtrl_HalfStepsEnd = S.Id(ID_TEXT_HALFSTEPS_END)
.AddTextBox(_("Final Pitch Shift (semitones) [-12 to 12]:"), wxT(""), 12);
m_pTextCtrl_HalfStepsEnd->SetValidator(numvld);
}
S.EndMultiColumn();
S.StartHorizontalLay(wxEXPAND);
S.StartStatic(_("Final Tempo Change (%)"));
{
S.SetStyle(wxSL_HORIZONTAL);
m_pCheckBox_PreAnalyze = S.Id(ID_CHECKBOX_PREANALYZE)
.AddCheckBox(wxT("Dynamic Transient Sharpening"), wxT("Dynamic Transient Sharpening"));
S.StartMultiColumn(1, wxCENTER);
{
m_pTextCtrl_RatePercentChangeEnd = S.Id(ID_TEXT_RATE_PERCENTCHANGE_END)
.AddTextBox(_(""), wxT(""), 12);
m_pTextCtrl_RatePercentChangeEnd->SetValidator(numvld);
}
S.EndMultiColumn();
S.StartHorizontalLay(wxEXPAND,0);
{
S.SetStyle(wxSL_HORIZONTAL);
m_pSlider_RatePercentChangeEnd = S.Id(ID_SLIDER_RATE_PERCENTCHANGE_END)
.AddSlider(wxT(""), (int)RATE_PERCENTCHANGE_DEFAULT, (int)RATE_PERCENTCHANGE_MAX_SLIDER, (int)RATE_PERCENTCHANGE_MIN_SLIDER);
}
S.EndHorizontalLay();
}
S.EndHorizontalLay();
S.EndStatic();
// Pitch Start
S.StartStatic(_("Initial Pitch Shift"));
{
S.StartMultiColumn(2, wxCENTER);
{
m_pTextCtrl_PitchHalfStepsStart = S.Id(ID_TEXT_PITCH_HALFSTEPS_START)
.AddTextBox(_("(semitones) [-12 to 12]:"), wxT(""), 12);
m_pTextCtrl_PitchHalfStepsStart->SetValidator(numvld);
m_pTextCtrl_PitchPercentChangeStart = S.Id(ID_TEXT_PITCH_PERCENTCHANGE_START)
.AddTextBox(_("(%) [-50 to 100]:"), wxT(""), 12);
m_pTextCtrl_PitchPercentChangeStart->SetValidator(numvld);
}
S.EndMultiColumn();
}
S.EndStatic();
// Pitch End
S.StartStatic(_("Final Pitch Shift"));
{
S.StartMultiColumn(2, wxCENTER);
{
m_pTextCtrl_PitchHalfStepsEnd = S.Id(ID_TEXT_PITCH_HALFSTEPS_END)
.AddTextBox(_("(semitones) [-12 to 12]:"), wxT(""), 12);
m_pTextCtrl_PitchHalfStepsEnd->SetValidator(numvld);
m_pTextCtrl_PitchPercentChangeEnd = S.Id(ID_TEXT_PITCH_PERCENTCHANGE_END)
.AddTextBox(_("(%) [-50 to 100]:"), wxT(""), 12);
m_pTextCtrl_PitchPercentChangeEnd->SetValidator(numvld);
}
S.EndMultiColumn();
}
S.EndStatic();
S.StartStatic(_("Options"));
{
S.StartHorizontalLay(wxEXPAND);
{
S.SetStyle(wxSL_HORIZONTAL);
m_pCheckBox_PreAnalyze = S.Id(ID_CHECKBOX_PREANALYZE)
.AddCheckBox(wxT("Dynamic Transient Sharpening"), wxT("Dynamic Transient Sharpening"));
}
S.EndHorizontalLay();
}
S.EndStatic();
return;
}
@ -240,12 +307,14 @@ bool TimeScaleDialog::TransferDataToWindow()
{
m_bLoopDetect = true;
this->Update_Text_RateStart();
this->Update_Slider_RateStart();
this->Update_Text_RateEnd();
this->Update_Slider_RateEnd();
this->Update_Text_HalfStepsStart();
this->Update_Text_HalfStepsEnd();
this->Update_Text_RatePercentChangeStart();
this->Update_Text_RatePercentChangeEnd();
this->Update_Slider_RatePercentChangeStart();
this->Update_Slider_RatePercentChangeEnd();
this->Update_Text_PitchHalfStepsStart();
this->Update_Text_PitchHalfStepsEnd();
this->Update_Text_PitchPercentChangeStart();
this->Update_Text_PitchPercentChangeEnd();
this->Update_CheckBox_PreAnalyze();
m_bLoopDetect = false;
@ -257,32 +326,46 @@ bool TimeScaleDialog::TransferDataFromWindow()
{
wxString str;
if (m_pTextCtrl_RateStart) {
str = m_pTextCtrl_RateStart->GetValue();
if (m_pTextCtrl_RatePercentChangeStart) {
str = m_pTextCtrl_RatePercentChangeStart->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_RateStart = newValue;
m_RatePercentChangeStart = newValue;
}
if (m_pTextCtrl_RateEnd) {
str = m_pTextCtrl_RateEnd->GetValue();
if (m_pTextCtrl_RatePercentChangeEnd) {
str = m_pTextCtrl_RatePercentChangeEnd->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_RateEnd = newValue;
m_RatePercentChangeEnd = newValue;
}
if (m_pTextCtrl_HalfStepsStart) {
str = m_pTextCtrl_HalfStepsStart->GetValue();
if (m_pTextCtrl_PitchHalfStepsStart) {
str = m_pTextCtrl_PitchHalfStepsStart->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_HalfStepsStart = newValue;
m_PitchHalfStepsStart = newValue;
}
if (m_pTextCtrl_HalfStepsEnd) {
str = m_pTextCtrl_HalfStepsEnd->GetValue();
if (m_pTextCtrl_PitchHalfStepsEnd) {
str = m_pTextCtrl_PitchHalfStepsEnd->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_HalfStepsEnd = newValue;
m_PitchHalfStepsEnd = newValue;
}
if (m_pTextCtrl_PitchPercentChangeStart) {
str = m_pTextCtrl_PitchPercentChangeStart->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_PitchPercentChangeStart = newValue;
}
if (m_pTextCtrl_PitchPercentChangeEnd) {
str = m_pTextCtrl_PitchPercentChangeEnd->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_PitchPercentChangeEnd = newValue;
}
if(m_pCheckBox_PreAnalyze) {
@ -295,105 +378,171 @@ bool TimeScaleDialog::TransferDataFromWindow()
bool TimeScaleDialog::CheckParameters()
{
return
(m_RateStart >= -90.0 && m_RateStart <= 500.0)
(m_RatePercentChangeStart >= RATE_PERCENTCHANGE_MIN_TEXT &&
m_RatePercentChangeStart <= RATE_PERCENTCHANGE_MAX_TEXT)
&&
(m_RateEnd >= -90.0 && m_RateEnd <= 500.0)
(m_RatePercentChangeEnd >= RATE_PERCENTCHANGE_MIN_TEXT &&
m_RatePercentChangeEnd <= RATE_PERCENTCHANGE_MAX_TEXT)
&&
(m_HalfStepsStart >= -12 && m_HalfStepsStart <=12)
(m_PitchHalfStepsStart >= PITCH_HALFSTEPS_MIN_TEXT &&
m_PitchHalfStepsStart <= PITCH_HALFSTEPS_MAX_TEXT)
&&
(m_HalfStepsEnd >= -12 && m_HalfStepsEnd <=12);
(m_PitchHalfStepsEnd >= PITCH_HALFSTEPS_MIN_TEXT &&
m_PitchHalfStepsEnd <= PITCH_HALFSTEPS_MAX_TEXT)
&&
(m_PitchPercentChangeStart >= PITCH_PERCENTCHANGE_MIN_TEXT &&
m_PitchPercentChangeStart <= PITCH_PERCENTCHANGE_MAX_TEXT)
&&
(m_PitchPercentChangeEnd >= PITCH_PERCENTCHANGE_MIN_TEXT &&
m_PitchPercentChangeEnd <= PITCH_PERCENTCHANGE_MAX_TEXT);
}
// handler implementations for TimeScaleDialog
void TimeScaleDialog::OnText_RateStart(wxCommandEvent & event)
void TimeScaleDialog::OnText_RatePercentChangeStart(wxCommandEvent & event)
{
if (m_bLoopDetect)
return;
if (m_pTextCtrl_RateStart) {
wxString str = m_pTextCtrl_RateStart->GetValue();
if (m_pTextCtrl_RatePercentChangeStart) {
wxString str = m_pTextCtrl_RatePercentChangeStart->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_RateStart = newValue;
m_RatePercentChangeStart = newValue;
m_bLoopDetect = true;
this->Update_Slider_RateStart();
this->Update_Slider_RatePercentChangeStart();
m_bLoopDetect = false;
FindWindow(wxID_OK)->Enable(CheckParameters());
}
}
void TimeScaleDialog::OnText_RateEnd(wxCommandEvent & event)
void TimeScaleDialog::OnText_RatePercentChangeEnd(wxCommandEvent & event)
{
if (m_bLoopDetect)
return;
if (m_pTextCtrl_RateEnd) {
wxString str = m_pTextCtrl_RateEnd->GetValue();
if (m_pTextCtrl_RatePercentChangeEnd) {
wxString str = m_pTextCtrl_RatePercentChangeEnd->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_RateEnd = newValue;
m_RatePercentChangeEnd = newValue;
m_bLoopDetect = true;
this->Update_Slider_RateEnd();
this->Update_Slider_RatePercentChangeEnd();
m_bLoopDetect = false;
FindWindow(wxID_OK)->Enable(CheckParameters());
}
}
void TimeScaleDialog::OnSlider_RateStart(wxCommandEvent & event)
void TimeScaleDialog::OnSlider_RatePercentChangeStart(wxCommandEvent & event)
{
if (m_bLoopDetect)
return;
if (m_pSlider_RateStart) {
m_RateStart = (double)(m_pSlider_RateStart->GetValue());
if (m_pSlider_RatePercentChangeStart) {
m_RatePercentChangeStart = (double)(m_pSlider_RatePercentChangeStart->GetValue());
m_bLoopDetect = true;
this->Update_Text_RateStart();
this->Update_Text_RatePercentChangeStart();
m_bLoopDetect = false;
}
}
void TimeScaleDialog::OnSlider_RateEnd(wxCommandEvent & event)
void TimeScaleDialog::OnSlider_RatePercentChangeEnd(wxCommandEvent & event)
{
if (m_bLoopDetect)
return;
if (m_pSlider_RateEnd) {
m_RateEnd = (double)(m_pSlider_RateEnd->GetValue());
if (m_pSlider_RatePercentChangeEnd) {
m_RatePercentChangeEnd = (double)(m_pSlider_RatePercentChangeEnd->GetValue());
m_bLoopDetect = true;
this->Update_Text_RateEnd();
this->Update_Text_RatePercentChangeEnd();
m_bLoopDetect = false;
}
}
void TimeScaleDialog::OnText_HalfStepsStart(wxCommandEvent & event)
void TimeScaleDialog::OnText_PitchHalfStepsStart(wxCommandEvent & event)
{
if (m_pTextCtrl_HalfStepsStart) {
wxString str = m_pTextCtrl_HalfStepsStart->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_HalfStepsStart = newValue;
if (m_bLoopDetect)
return;
FindWindow(wxID_OK)->Enable(CheckParameters());
}
if (m_pTextCtrl_PitchHalfStepsStart) {
wxString str = m_pTextCtrl_PitchHalfStepsStart->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_PitchHalfStepsStart = newValue;
m_PitchPercentChangeStart = HalfStepsToPercentChange(newValue);
m_bLoopDetect = true;
this->Update_Text_PitchPercentChangeStart();
m_bLoopDetect = false;
FindWindow(wxID_OK)->Enable(CheckParameters());
}
}
void TimeScaleDialog::OnText_HalfStepsEnd(wxCommandEvent & event)
void TimeScaleDialog::OnText_PitchHalfStepsEnd(wxCommandEvent & event)
{
if (m_pTextCtrl_HalfStepsEnd) {
wxString str = m_pTextCtrl_HalfStepsEnd->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_HalfStepsEnd = newValue;
FindWindow(wxID_OK)->Enable(CheckParameters());
}
if (m_bLoopDetect)
return;
if (m_pTextCtrl_PitchHalfStepsEnd) {
wxString str = m_pTextCtrl_PitchHalfStepsEnd->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_PitchHalfStepsEnd = newValue;
m_PitchPercentChangeEnd = HalfStepsToPercentChange(newValue);
m_bLoopDetect = true;
this->Update_Text_PitchPercentChangeEnd();
m_bLoopDetect = false;
FindWindow(wxID_OK)->Enable(CheckParameters());
}
}
void TimeScaleDialog::OnText_PitchPercentChangeStart(wxCommandEvent & event)
{
if (m_bLoopDetect)
return;
if (m_pTextCtrl_PitchPercentChangeStart) {
wxString str = m_pTextCtrl_PitchPercentChangeStart->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_PitchPercentChangeStart = newValue;
m_PitchHalfStepsStart = PercentChangeToHalfSteps(newValue);
m_bLoopDetect = true;
this->Update_Text_PitchHalfStepsStart();
m_bLoopDetect = false;
FindWindow(wxID_OK)->Enable(CheckParameters());
}
}
void TimeScaleDialog::OnText_PitchPercentChangeEnd(wxCommandEvent & event)
{
if (m_bLoopDetect)
return;
if (m_pTextCtrl_PitchPercentChangeEnd) {
wxString str = m_pTextCtrl_PitchPercentChangeEnd->GetValue();
double newValue = 0;
str.ToDouble(&newValue);
m_PitchPercentChangeEnd = newValue;
m_PitchHalfStepsEnd = PercentChangeToHalfSteps(newValue);
m_bLoopDetect = true;
this->Update_Text_PitchHalfStepsEnd();
m_bLoopDetect = false;
FindWindow(wxID_OK)->Enable(CheckParameters());
}
}
void TimeScaleDialog::OnCheckBox_PreAnalyze(wxCommandEvent & event)
@ -403,53 +552,71 @@ void TimeScaleDialog::OnCheckBox_PreAnalyze(wxCommandEvent & event)
}
}
void TimeScaleDialog::Update_Text_RateStart()
void TimeScaleDialog::Update_Text_RatePercentChangeStart()
{
if (m_pTextCtrl_RateStart) {
if (m_pTextCtrl_RatePercentChangeStart) {
wxString str;
str.Printf(wxT("%.3f"), m_RateStart);
m_pTextCtrl_RateStart->SetValue(str);
str.Printf(wxT("%.3f"), m_RatePercentChangeStart);
m_pTextCtrl_RatePercentChangeStart->SetValue(str);
}
}
void TimeScaleDialog::Update_Text_RateEnd()
void TimeScaleDialog::Update_Text_RatePercentChangeEnd()
{
if (m_pTextCtrl_RateEnd) {
if (m_pTextCtrl_RatePercentChangeEnd) {
wxString str;
str.Printf(wxT("%.3f"), m_RateEnd);
m_pTextCtrl_RateEnd->SetValue(str);
str.Printf(wxT("%.3f"), m_RatePercentChangeEnd);
m_pTextCtrl_RatePercentChangeEnd->SetValue(str);
}
}
void TimeScaleDialog::Update_Slider_RateStart()
void TimeScaleDialog::Update_Slider_RatePercentChangeStart()
{
if (m_pSlider_RateStart) {
m_pSlider_RateStart->SetValue((int)(m_RateStart + 0.5));
if (m_pSlider_RatePercentChangeStart) {
m_pSlider_RatePercentChangeStart->SetValue((int)(m_RatePercentChangeStart + 0.5));
}
}
void TimeScaleDialog::Update_Slider_RateEnd()
void TimeScaleDialog::Update_Slider_RatePercentChangeEnd()
{
if (m_pSlider_RateEnd) {
m_pSlider_RateEnd->SetValue((int)(m_RateEnd + 0.5));
if (m_pSlider_RatePercentChangeEnd) {
m_pSlider_RatePercentChangeEnd->SetValue((int)(m_RatePercentChangeEnd + 0.5));
}
}
void TimeScaleDialog::Update_Text_HalfStepsStart()
void TimeScaleDialog::Update_Text_PitchHalfStepsStart()
{
if (m_pTextCtrl_HalfStepsStart) {
if (m_pTextCtrl_PitchHalfStepsStart) {
wxString str;
str.Printf(wxT("%.3f"), m_HalfStepsStart);
m_pTextCtrl_HalfStepsStart->SetValue(str);
str.Printf(wxT("%.3f"), m_PitchHalfStepsStart);
m_pTextCtrl_PitchHalfStepsStart->SetValue(str);
}
}
void TimeScaleDialog::Update_Text_HalfStepsEnd()
void TimeScaleDialog::Update_Text_PitchHalfStepsEnd()
{
if (m_pTextCtrl_HalfStepsEnd) {
if (m_pTextCtrl_PitchHalfStepsEnd) {
wxString str;
str.Printf(wxT("%.3f"), m_HalfStepsEnd);
m_pTextCtrl_HalfStepsEnd->SetValue(str);
str.Printf(wxT("%.3f"), m_PitchHalfStepsEnd);
m_pTextCtrl_PitchHalfStepsEnd->SetValue(str);
}
}
void TimeScaleDialog::Update_Text_PitchPercentChangeStart()
{
if (m_pTextCtrl_PitchPercentChangeStart) {
wxString str;
str.Printf(wxT("%.3f"), m_PitchPercentChangeStart);
m_pTextCtrl_PitchPercentChangeStart->SetValue(str);
}
}
void TimeScaleDialog::Update_Text_PitchPercentChangeEnd()
{
if (m_pTextCtrl_PitchPercentChangeEnd) {
wxString str;
str.Printf(wxT("%.3f"), m_PitchPercentChangeEnd);
m_pTextCtrl_PitchPercentChangeEnd->SetValue(str);
}
}

View File

@ -57,10 +57,12 @@ class EffectTimeScale : public EffectSBSMS {
virtual bool Process();
private:
double m_RateStart;
double m_RateEnd;
double m_HalfStepsStart;
double m_HalfStepsEnd;
double m_RatePercentChangeStart;
double m_RatePercentChangeEnd;
double m_PitchHalfStepsStart;
double m_PitchHalfStepsEnd;
double m_PitchPercentChangeStart;
double m_PitchPercentChangeEnd;
bool m_PreAnalyze;
friend class TimeScaleDialog;
@ -81,22 +83,26 @@ class TimeScaleDialog:public EffectDialog {
private:
// handlers
void OnText_RateStart(wxCommandEvent & event);
void OnText_RateEnd(wxCommandEvent & event);
void OnText_HalfStepsStart(wxCommandEvent & event);
void OnText_HalfStepsEnd(wxCommandEvent & event);
void OnSlider_RateStart(wxCommandEvent & event);
void OnSlider_RateEnd(wxCommandEvent & event);
void OnText_RatePercentChangeStart(wxCommandEvent & event);
void OnText_RatePercentChangeEnd(wxCommandEvent & event);
void OnText_PitchPercentChangeStart(wxCommandEvent & event);
void OnText_PitchPercentChangeEnd(wxCommandEvent & event);
void OnText_PitchHalfStepsStart(wxCommandEvent & event);
void OnText_PitchHalfStepsEnd(wxCommandEvent & event);
void OnSlider_RatePercentChangeStart(wxCommandEvent & event);
void OnSlider_RatePercentChangeEnd(wxCommandEvent & event);
void OnCheckBox_PreAnalyze(wxCommandEvent & event);
// helper fns
bool CheckParameters();
void Update_Text_RateStart();
void Update_Text_RateEnd();
void Update_Text_HalfStepsStart();
void Update_Text_HalfStepsEnd();
void Update_Slider_RateStart();
void Update_Slider_RateEnd();
void Update_Text_RatePercentChangeStart();
void Update_Text_RatePercentChangeEnd();
void Update_Text_PitchPercentChangeStart();
void Update_Text_PitchPercentChangeEnd();
void Update_Text_PitchHalfStepsStart();
void Update_Text_PitchHalfStepsEnd();
void Update_Slider_RatePercentChangeStart();
void Update_Slider_RatePercentChangeEnd();
void Update_CheckBox_PreAnalyze();
private:
@ -104,19 +110,23 @@ class TimeScaleDialog:public EffectDialog {
bool m_bLoopDetect;
// controls
wxTextCtrl *m_pTextCtrl_RateStart;
wxSlider *m_pSlider_RateStart;
wxTextCtrl *m_pTextCtrl_RateEnd;
wxSlider *m_pSlider_RateEnd;
wxTextCtrl *m_pTextCtrl_HalfStepsStart;
wxTextCtrl *m_pTextCtrl_HalfStepsEnd;
wxTextCtrl *m_pTextCtrl_RatePercentChangeStart;
wxTextCtrl *m_pTextCtrl_RatePercentChangeEnd;
wxSlider *m_pSlider_RatePercentChangeStart;
wxSlider *m_pSlider_RatePercentChangeEnd;
wxTextCtrl *m_pTextCtrl_PitchHalfStepsStart;
wxTextCtrl *m_pTextCtrl_PitchHalfStepsEnd;
wxTextCtrl *m_pTextCtrl_PitchPercentChangeStart;
wxTextCtrl *m_pTextCtrl_PitchPercentChangeEnd;
wxCheckBox *m_pCheckBox_PreAnalyze;
public:
double m_RateStart;
double m_RateEnd;
double m_HalfStepsStart;
double m_HalfStepsEnd;
double m_RatePercentChangeStart;
double m_RatePercentChangeEnd;
double m_PitchHalfStepsStart;
double m_PitchHalfStepsEnd;
double m_PitchPercentChangeStart;
double m_PitchPercentChangeEnd;
bool m_PreAnalyze;
private:

View File

@ -304,10 +304,6 @@
RelativePath="..\..\..\lib-src\sbsms\src\peak.cpp"
>
</File>
<File
RelativePath="..\..\..\lib-src\sbsms\src\pitch.cpp"
>
</File>
<File
RelativePath="..\..\..\lib-src\sbsms\src\resample.cpp"
>
@ -350,10 +346,6 @@
RelativePath="..\..\..\lib-src\sbsms\src\buffer.h"
>
</File>
<File
RelativePath="..\..\..\lib-src\sbsms\src\defs.h"
>
</File>
<File
RelativePath="..\..\..\lib-src\sbsms\src\fft.h"
>