diff options
Diffstat (limited to 'akode')
123 files changed, 24543 insertions, 0 deletions
diff --git a/akode/Makefile.am b/akode/Makefile.am new file mode 100644 index 0000000..99455d5 --- /dev/null +++ b/akode/Makefile.am @@ -0,0 +1,3 @@ +bin_SCRIPTS = akode-config + +SUBDIRS= lib plugins akodeplay diff --git a/akode/Makefile.in b/akode/Makefile.in new file mode 100644 index 0000000..0809453 --- /dev/null +++ b/akode/Makefile.in @@ -0,0 +1,679 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = akode +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/akode-config.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/akode/lib/akode_export.h +CONFIG_CLEAN_FILES = akode-config +am__installdirs = "$(DESTDIR)$(bindir)" +binSCRIPT_INSTALL = $(INSTALL_SCRIPT) +SCRIPTS = $(bin_SCRIPTS) +SOURCES = +DIST_SOURCES = +#>- RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ +#>- html-recursive info-recursive install-data-recursive \ +#>- install-exec-recursive install-info-recursive \ +#>- install-recursive installcheck-recursive installdirs-recursive \ +#>- pdf-recursive ps-recursive uninstall-info-recursive \ +#>- uninstall-recursive +#>+ 6 +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive nmcheck-recursive bcheck-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AKODE_LIBDL = @AKODE_LIBDL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVCODEC_CFLAGS = @AVCODEC_CFLAGS@ +AVCODEC_LDFLAGS = @AVCODEC_LDFLAGS@ +AVCODEC_LIBADD = @AVCODEC_LIBADD@ +AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ +AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ +AVFORMAT_LIBADD = @AVFORMAT_LIBADD@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBADD = @JACK_LIBADD@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBFLAC = @LIBFLAC@ +LIBOBJS = @LIBOBJS@ +LIBOGGFLAC = @LIBOGGFLAC@ +LIBOSSAUDIO = @LIBOSSAUDIO@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSAMPLERATE = @LIBSAMPLERATE@ +LIBSEM = @LIBSEM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MADLIBS = @MADLIBS@ +MAKEINFO = @MAKEINFO@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POLYP_CFLAGS = @POLYP_CFLAGS@ +POLYP_LDFLAGS = @POLYP_LDFLAGS@ +POLYP_LIBADD = @POLYP_LIBADD@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXLIBS = @SPEEXLIBS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +VERSION = @VERSION@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +akode_SUBDIR_included_FALSE = @akode_SUBDIR_included_FALSE@ +akode_SUBDIR_included_TRUE = @akode_SUBDIR_included_TRUE@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_alsa_sink_FALSE = @include_alsa_sink_FALSE@ +include_alsa_sink_TRUE = @include_alsa_sink_TRUE@ +include_ffmpeg_decoder_FALSE = @include_ffmpeg_decoder_FALSE@ +include_ffmpeg_decoder_TRUE = @include_ffmpeg_decoder_TRUE@ +include_jack_sink_FALSE = @include_jack_sink_FALSE@ +include_jack_sink_TRUE = @include_jack_sink_TRUE@ +include_mpeg_decoder_FALSE = @include_mpeg_decoder_FALSE@ +include_mpeg_decoder_TRUE = @include_mpeg_decoder_TRUE@ +include_oss_sink_FALSE = @include_oss_sink_FALSE@ +include_oss_sink_TRUE = @include_oss_sink_TRUE@ +include_polyp_sink_FALSE = @include_polyp_sink_FALSE@ +include_polyp_sink_TRUE = @include_polyp_sink_TRUE@ +include_src_resampler_FALSE = @include_src_resampler_FALSE@ +include_src_resampler_TRUE = @include_src_resampler_TRUE@ +include_sun_sink_FALSE = @include_sun_sink_FALSE@ +include_sun_sink_TRUE = @include_sun_sink_TRUE@ +include_xiph_decoder_FALSE = @include_xiph_decoder_FALSE@ +include_xiph_decoder_TRUE = @include_xiph_decoder_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +bin_SCRIPTS = akode-config +SUBDIRS = lib plugins akodeplay +#>- all: all-recursive +#>+ 1 +all: docs-am all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu akode/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +akode-config: $(top_builddir)/config.status $(srcdir)/akode-config.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ + else :; fi; \ + done + +uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(bin_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(SCRIPTS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-recursive +#>+ 1 +clean: kde-rpo-clean clean-recursive + +#>- clean-am: clean-generic clean-libtool mostlyclean-am +#>+ 1 +clean-am: clean-bcheck clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: install-binSCRIPTS + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binSCRIPTS uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-generic clean-libtool clean-recursive ctags \ + ctags-recursive distclean distclean-generic distclean-libtool \ + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binSCRIPTS \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-binSCRIPTS uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +#>+ 2 +KDE_DIST=configure.in.bot Makefile.in akode-config.in configure.in.in Makefile.am PACKAGING + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-recursive + +bcheck-am: + @for i in ; do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXX) $(DEFS) -I. -I$(srcdir) -I$(top_builddir) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 3 +final: + $(MAKE) all-am + +#>+ 3 +final-install: + $(MAKE) install-am + +#>+ 3 +no-final: + $(MAKE) all-am + +#>+ 3 +no-final-install: + $(MAKE) install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/akode/PACKAGING b/akode/PACKAGING new file mode 100644 index 0000000..da75139 --- /dev/null +++ b/akode/PACKAGING @@ -0,0 +1,15 @@ +The plugins are designed for being packaged and installed separately of akodelib. + +Take especially note of the following: +- Do not install mpeg_decoder if you have software patent concerns +- Do not install src_resampler and mpeg_decoder if you want a pure LGPL + library since they are both derived of GPL libraries. +- If you wish to install plugins in a non-standard place, you can change the + AKODE_SEARCHDIR definition in lib/pluginhandler.cpp. +- You SHOULD not install sinks for backends you don't use. Thus jack_sink + should only be installed when jackd is available, polyp_sink only when + the polypaudio server is used and alsa_sink only when using a Linux kernel + with ALSA drivers. + When using direct aKode playback sinks will be autodetected by loading and + probing plugins in this order: polyp, jack, alsa, oss + diff --git a/akode/akode-config.in b/akode/akode-config.in new file mode 100644 index 0000000..b4263be --- /dev/null +++ b/akode/akode-config.in @@ -0,0 +1,55 @@ +#!/bin/sh + +usage() +{ + echo "usage: $0 [OPTIONS]" +cat << EOH + +options: + [--libs] + [--cflags] + [--version] + [--prefix] +EOH + exit 1; +} + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +flags="" + +if test $# -eq 0 ; then + usage +fi + +while test $# -gt 0 +do + case $1 in + --libs) + flags="$flags -L$libdir -lakode" + ;; + --cflags) + flags="$flags -I$includedir" + ;; + --version) + echo 2.0.2 + ;; + --prefix) + echo $prefix + ;; + *) + echo "$0: unknown option $1" + echo + usage + ;; + esac + shift +done + +if test -n "$flags" +then + echo $flags +fi diff --git a/akode/akodeplay/Makefile.am b/akode/akodeplay/Makefile.am new file mode 100644 index 0000000..899d570 --- /dev/null +++ b/akode/akodeplay/Makefile.am @@ -0,0 +1,9 @@ +INCLUDES= -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(all_includes) + +bin_PROGRAMS = akodeplay + +akodeplay_SOURCES = akodeplay.cpp +akodeplay_LDFLAGS = $(all_libraries) +akodeplay_LDADD = ../lib/libakode.la + +EXTRA_DIST = diff --git a/akode/akodeplay/Makefile.in b/akode/akodeplay/Makefile.in new file mode 100644 index 0000000..f2b3ef0 --- /dev/null +++ b/akode/akodeplay/Makefile.in @@ -0,0 +1,633 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +bin_PROGRAMS = akodeplay$(EXEEXT) +subdir = akode/akodeplay +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/akode/lib/akode_export.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_akodeplay_OBJECTS = akodeplay.$(OBJEXT) +#>- akodeplay_OBJECTS = $(am_akodeplay_OBJECTS) +#>+ 1 +akodeplay_OBJECTS = akodeplay.$(OBJEXT) +akodeplay_DEPENDENCIES = ../lib/libakode.la +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/akode/lib +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 2 +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ +#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +#>- $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 3 +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +CXXLD = $(CXX) +#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ +#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +#>+ 2 +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(akodeplay_SOURCES) +DIST_SOURCES = $(akodeplay_SOURCES) +ETAGS = etags +CTAGS = ctags +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AKODE_LIBDL = @AKODE_LIBDL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVCODEC_CFLAGS = @AVCODEC_CFLAGS@ +AVCODEC_LDFLAGS = @AVCODEC_LDFLAGS@ +AVCODEC_LIBADD = @AVCODEC_LIBADD@ +AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ +AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ +AVFORMAT_LIBADD = @AVFORMAT_LIBADD@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBADD = @JACK_LIBADD@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBFLAC = @LIBFLAC@ +LIBOBJS = @LIBOBJS@ +LIBOGGFLAC = @LIBOGGFLAC@ +LIBOSSAUDIO = @LIBOSSAUDIO@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSAMPLERATE = @LIBSAMPLERATE@ +LIBSEM = @LIBSEM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MADLIBS = @MADLIBS@ +MAKEINFO = @MAKEINFO@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POLYP_CFLAGS = @POLYP_CFLAGS@ +POLYP_LDFLAGS = @POLYP_LDFLAGS@ +POLYP_LIBADD = @POLYP_LIBADD@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXLIBS = @SPEEXLIBS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +VERSION = @VERSION@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +akode_SUBDIR_included_FALSE = @akode_SUBDIR_included_FALSE@ +akode_SUBDIR_included_TRUE = @akode_SUBDIR_included_TRUE@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_alsa_sink_FALSE = @include_alsa_sink_FALSE@ +include_alsa_sink_TRUE = @include_alsa_sink_TRUE@ +include_ffmpeg_decoder_FALSE = @include_ffmpeg_decoder_FALSE@ +include_ffmpeg_decoder_TRUE = @include_ffmpeg_decoder_TRUE@ +include_jack_sink_FALSE = @include_jack_sink_FALSE@ +include_jack_sink_TRUE = @include_jack_sink_TRUE@ +include_mpeg_decoder_FALSE = @include_mpeg_decoder_FALSE@ +include_mpeg_decoder_TRUE = @include_mpeg_decoder_TRUE@ +include_oss_sink_FALSE = @include_oss_sink_FALSE@ +include_oss_sink_TRUE = @include_oss_sink_TRUE@ +include_polyp_sink_FALSE = @include_polyp_sink_FALSE@ +include_polyp_sink_TRUE = @include_polyp_sink_TRUE@ +include_src_resampler_FALSE = @include_src_resampler_FALSE@ +include_src_resampler_TRUE = @include_src_resampler_TRUE@ +include_sun_sink_FALSE = @include_sun_sink_FALSE@ +include_sun_sink_TRUE = @include_sun_sink_TRUE@ +include_xiph_decoder_FALSE = @include_xiph_decoder_FALSE@ +include_xiph_decoder_TRUE = @include_xiph_decoder_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(all_includes) +akodeplay_SOURCES = akodeplay.cpp +akodeplay_LDFLAGS = $(all_libraries) +akodeplay_LDADD = ../lib/libakode.la +EXTRA_DIST = +#>- all: all-am +#>+ 1 +all: docs-am all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/akodeplay/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu akode/akodeplay/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/akodeplay/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/akodeplay/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/akodeplay/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +akodeplay$(EXEEXT): $(akodeplay_OBJECTS) $(akodeplay_DEPENDENCIES) + @rm -f akodeplay$(EXEEXT) + $(CXXLINK) $(akodeplay_LDFLAGS) $(akodeplay_OBJECTS) $(akodeplay_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/akodeplay.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-am +#>+ 1 +clean: kde-rpo-clean clean-am + +#>- clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am +#>+ 1 +clean-am: clean-bcheck clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +#>+ 2 +KDE_DIST=Makefile.in Makefile.am + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/akodeplay/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/akodeplay/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/akodeplay/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-am + +bcheck-am: + @for i in ; do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 3 +final: + $(MAKE) all-am + +#>+ 3 +final-install: + $(MAKE) install-am + +#>+ 3 +no-final: + $(MAKE) all-am + +#>+ 3 +no-final-install: + $(MAKE) install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/akode/akodeplay/akodeplay.cpp b/akode/akodeplay/akodeplay.cpp new file mode 100644 index 0000000..321f189 --- /dev/null +++ b/akode/akodeplay/akodeplay.cpp @@ -0,0 +1,135 @@ +/* aKode-utils: akodeplay + + Copyright (C) 2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <iostream> + +#include "../lib/akodelib.h" +#include "../lib/player.h" +#include "../lib/sink.h" +#include "../lib/decoder.h" + +#ifdef HAVE_GNU_GETOPT + #include <getopt.h> +#else + #include <unistd.h> +#endif + +using namespace std; +using namespace aKode; + +void usage() { + cout << "Usage: akodeplay [-s sink] [-r resampler] [-d decoder] filenames.." << endl; +} + +void list_sinks() { + cout << "Available sinks:" << endl; + list<string> sinks = SinkPluginHandler::listSinkPlugins(); + for(list<string>::const_iterator s = sinks.begin(); s != sinks.end(); s++) + cout << "\t" << *s << endl; +} + +void list_decoders() { + cout << "Available decoders:" << endl; + list<string> plugins = DecoderPluginHandler::listDecoderPlugins(); + for(list<string>::const_iterator s = plugins.begin(); s != plugins.end(); s++) + cout << "\t" << *s << endl; +} + +#ifdef HAVE_GNU_GETOPT +static struct option longoptions[] = { + {"resampler", 1, 0, 'r'}, + {"decoder", 1, 0, 'd'}, + {"sink", 1, 0, 's'}, + {0, 0, 0, 0} +}; +#endif + +int main(int argc, char** argv) { + const char* resampler_plugin = 0; + const char* decoder_plugin = 0; + const char* sink_plugin = 0; + const char* filename = 0; + + if (argc <= 1) { + usage(); + exit(1); + } + + int opt; +#ifdef HAVE_GNU_GETOPT + while ((opt = getopt_long(argc, argv, "r:d:s:", longoptions, 0)) != -1) +#else + while ((opt = getopt(argc, argv, "r:d:s:")) != -1) +#endif + { + switch (opt) { + case 'r': + resampler_plugin = ::optarg; + continue; + case 'd': + decoder_plugin = ::optarg; + continue; + case 's': + sink_plugin = ::optarg; + continue; + default: + usage(); + exit(1); + } + } + + aKode::Player player; + + if (!sink_plugin) sink_plugin = "auto"; + + if (decoder_plugin) + player.setDecoderPlugin(decoder_plugin); + + if (resampler_plugin) + player.setResamplerPlugin(resampler_plugin); + + if (!player.open(sink_plugin)) { + cout << "Could not load sink-plugin: " << sink_plugin << endl; + list_sinks(); + exit(1); + } + + while (::optind < argc) { + filename = argv[::optind++]; + + if (!player.load(filename)) { + cout << "Could not load file: " << filename << endl; + exit(1); + } + + player.play(); + player.wait(); + /* + player.play(); + player.wait(); + player.play(); + player.wait(); +*/ + player.unload(); + } + player.close(); + + return 0; +} diff --git a/akode/configure.in.bot b/akode/configure.in.bot new file mode 100644 index 0000000..1e2196e --- /dev/null +++ b/akode/configure.in.bot @@ -0,0 +1,57 @@ +if test "x$have_libFLAC" = "xno"; then + echo ">" + echo "> You do not seem to have a recent enough libFLAC" + echo "> installed. Without it aKode and aRts" + echo "> will not be able to play FLAC files." + echo "> You need atleast libFLAC 1.0.3 or newer." + echo ">" +fi + +if test "x$have_libOggFLAC" = "xno"; then + echo ">" + echo "> You do not seem to have libOggFLAC installed." + echo "> Without it aKode and aRts will not be" + echo "> able to play Ogg-files with embedded FLAC streams" + echo "> You need atleast libOggFLAC 1.1.1 or newer." + echo ">" +fi + +if test "x$have_libSPEEX" = "xno"; then + echo ">" + echo "> You do not seem to have libspeex installed." + echo "> Without it aKode and aRts will not be" + echo "> able to play speex-files and -stream." + echo ">" +fi + +if test "x$have_oggvorbis" = "xno"; then + echo ">" + echo "> You do not seem to have libvorbisfile installed." + echo "> Without it aKode will not be able to play" + echo "> Ogg-files with embedded Vorbis streams" + echo "> You need atleast libvorbisfile 1.0 or newer." + echo ">" +fi + +if test "x$have_libMAD" = "xno"; then + echo ">" + echo "> You do not seem to have MADlib installed." + echo "> Without it aKode will not be able to play" + echo "> MPEG-audio this includes the common MP3 format" + echo ">" +fi + +if test "x$AKODE_LIBDL" = "x" ; then + echo ">" + echo "> You do not seem to have any dynamic-library manipulation" + echo "> library installed. aKode will not be compiled." + echo ">" +fi + +#if test "x$have_libltdl" = "xno"; then +# echo ">" +# echo "> You do not seem to have libltdl installed." +# echo "> Without it aKode will not work on some platforms." +# echo "> Recent Linux, BSDs and Solaris will still work" +# echo ">" +#fi diff --git a/akode/configure.in.in b/akode/configure.in.in new file mode 100644 index 0000000..f18e6c5 --- /dev/null +++ b/akode/configure.in.in @@ -0,0 +1,503 @@ +dnl don't remove the below +dnl AC_OUTPUT(akode/akode-config) + +AM_CONFIG_HEADER(akode/lib/akode_export.h) + +AC_DEFUN([AC_CHECK_LIBFLAC], +[ + AC_LANG_SAVE + AC_LANG_C + have_libFLAC=no + KDE_CHECK_HEADER(FLAC/seekable_stream_decoder.h, + [ + KDE_CHECK_LIB(FLAC,FLAC__seekable_stream_decoder_process_single, + have_libFLAC=yes) + + ]) + if test "x$have_libFLAC" = "xyes"; then + LIBFLAC="-lFLAC" + AC_DEFINE(HAVE_LIBFLAC, 1, + [Define if you have libFLAC 1.1.1 or 1.1.2]) + fi + AC_SUBST(LIBFLAC) + AC_LANG_RESTORE +]) + +AC_DEFUN([AC_CHECK_LIBFLAC113], +[ + AC_LANG_SAVE + AC_LANG_C + have_libFLAC=no + KDE_CHECK_HEADER(FLAC/metadata.h, + [ + KDE_CHECK_LIB(FLAC,FLAC__stream_decoder_seek_absolute, + have_libFLAC=yes,,[-lFLAC -logg]) + + ]) + if test "x$have_libFLAC" = "xyes"; then + LIBFLAC="-lFLAC -logg" + AC_DEFINE(HAVE_LIBFLAC113, 1, + [Define if you have libFLAC 1.1.3]) + fi + AC_SUBST(LIBFLAC) + AC_LANG_RESTORE +]) + +AC_DEFUN([AC_CHECK_LIBOGGFLAC], +[ + AC_LANG_SAVE + AC_LANG_C + have_libOggFLAC=no + KDE_CHECK_HEADER(OggFLAC/seekable_stream_decoder.h, + [ + KDE_CHECK_LIB(OggFLAC,OggFLAC__seekable_stream_decoder_process_single, + have_libOggFLAC=yes,,[-lm -lOggFLAC -lFLAC]) + + ]) + if test "x$have_libOggFLAC" = "xyes"; then + LIBOGGFLAC="-lOggFLAC" + AC_DEFINE(HAVE_LIBOGGFLAC, 1, + [Define if you have libOggFLAC (required for loading OggFLAC files)]) + fi + AC_SUBST(LIBOGGFLAC) + AC_LANG_RESTORE +]) + +AC_DEFUN([KDE_CHECK_OGGVORBIS], +[ + have_oggvorbis=yes + + KDE_CHECK_LIB(ogg, ogg_page_version, + [:], [have_oggvorbis=no]) + + KDE_CHECK_HEADER(vorbis/vorbisfile.h, + [:], [have_oggvorbis=no]) + + KDE_CHECK_LIB(vorbis, vorbis_info_init, + [:], [have_oggvorbis=no], -logg) + + KDE_CHECK_LIB(vorbisfile, ov_open, + [:], [have_oggvorbis=no], -lvorbis -logg) + + if test "x$have_oggvorbis" = xyes; then + VORBIS_LIBS="-lvorbis -logg" + VORBISFILE_LIBS="-lvorbisfile" + + # for akode/plugins/xiph_decoder/ + AC_DEFINE_UNQUOTED(HAVE_OGG_VORBIS, 1, [Define if you have ogg/vorbis installed]) + + fi + + AC_SUBST(VORBIS_LIBS) + AC_SUBST(VORBISFILE_LIBS) +]) + +AC_DEFUN([KDE_CHECK_SEM], +[ + have_sem=no + + AC_CHECK_HEADERS([semaphore.h], + [have_sem=yes]) + + dnl Solaris requires -lrt + AC_CHECK_LIB(rt, sem_init, [LIBSEM="-lrt"]) + AC_SUBST(LIBSEM) +]) + +AC_DEFUN([KDE_CHECK_OSS], +[ + have_oss=no + + AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], + [have_oss=yes]) + + dnl OpenBSD requires an -lossaudio and soundcard.h to provide OSS audio I/O + AC_CHECK_LIB(ossaudio, _oss_ioctl, [LIBOSSAUDIO="-lossaudio"]) + AC_SUBST(LIBOSSAUDIO) +]) + +AC_DEFUN([KDE_CHECK_SUN], +[ + have_sun=no + + AC_CHECK_HEADERS([sys/audioio.h], [have_sun=yes]) +]) + +AC_DEFUN([KDE_CHECK_ALSA], +[ + PKG_CHECK_MODULES([ALSA], [alsa >= 0.9], [have_alsa=yes], [have_alsa=no]) + + if test "x$have_alsa" = "xyes"; then + AC_DEFINE(HAVE_LIBASOUND2, 1, [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)]) + fi +]) + +AC_ARG_WITH(flac,AC_HELP_STRING([--with-flac],[Enable FLAC support @<:@default=check@:>@]),[flac_test="$withval"],[flac_test="yes"]) + +if test "x$flac_test" = "xyes" ; then + AC_CHECK_LIBFLAC113 + if test "x$have_libFLAC" = "xno"; then + AC_CHECK_LIBFLAC + AC_CHECK_LIBOGGFLAC + fi +fi + +AC_ARG_WITH(speex,AC_HELP_STRING([--with-speex],[Enable speex support @<:@default=check@:>@]),[speex_test="$withval"],[speex_test="yes"]) + +if test "x$speex_test" = "xyes" ; then +AC_MSG_CHECKING(for speex headers) +have_libspeex=no +kde_save_akode_cflags="$CFLAGS" +kde_save_akode_libs="$LIBS" +LIBS="$all_libraries $USER_LDFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" +AC_TRY_COMPILE([ + #include <speex.h> + #include <speex_callbacks.h> + #include <ogg/ogg.h> + ],[ + ],[ + have_libspeex=yes + ]) +AC_MSG_RESULT($have_libspeex) +if test x$have_libspeex = xyes; then + KDE_CHECK_LIB(speex,speex_decoder_ctl,, + have_libspeex=no,[-lspeex -logg]) +fi +CFLAGS="$kde_save_akode_cflags" +LIBS="$kde_save_akode_libs" +AC_MSG_CHECKING(for speex11 headers) +have_libspeex11=no +kde_save_akode_cflags="$CFLAGS" +kde_save_akode_libs="$LIBS" +LIBS="$all_libraries $USER_LDFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" +AC_TRY_COMPILE([ + #include <speex.h> + #include <speex_callbacks.h> + #include <speex_echo.h> + #include <speex_preprocess.h> + #include <ogg/ogg.h> + ],[ + ],[ + have_libspeex11=yes + ]) +AC_MSG_RESULT($have_libspeex11) +if test x$have_libspeex11 = xyes; then + KDE_CHECK_LIB(speex,speex_decode_int,, + broken_libspeex11=yes,[-lspeex -logg]) +fi + +if test x$have_libspeex = xyes; then + AC_DEFINE(HAVE_SPEEX,1,[Define if you have speex installed]) + SPEEXLIBS="-lspeex -logg" +fi +CFLAGS="$kde_save_akode_cflags" +LIBS="$kde_save_akode_libs" +AC_SUBST(SPEEXLIBS) + +if test x$have_libspeex11 = xyes; then + AC_DEFINE(HAVE_SPEEX11,1,[Define if you have libspeex 1.1.x installed]) + if test x$broken_libspeex11 = xyes; then + AC_DEFINE(BROKEN_SPEEX11,1,[Define if you have one of the broken libspeex 1.1.x < 1.1.5]) + fi +fi +fi + +AC_ARG_WITH(libmad,AC_HELP_STRING([--with-libmad],[Enable libmad support @<:@default=check@:>@]),[libmad_test="$withval"],[libmad_test="yes"]) + +if test "x$libmad_test" = "xyes" ; then +AC_MSG_CHECKING(for MADlib header) +have_libMAD=no +kde_save_akode_cflags="$CFLAGS" +kde_save_akode_libs="$LIBS" +LIBS="$all_libraries $USER_LDFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" +AC_TRY_COMPILE([ + #include <mad.h> + ],[ + ],[ + have_libMAD=yes + ]) +AC_MSG_RESULT($have_libMAD) +if test x$have_libMAD = xyes; then + KDE_CHECK_LIB(mad,mad_decoder_run,MAD_lib=yes, + have_libMAD=no,[-lmad]) +fi +if test x$have_libMAD = xyes; then + AC_DEFINE(HAVE_MAD,1,[Define if you have MADlib installed]) + MADLIBS="-lmad" +fi +CFLAGS="$kde_save_akode_cflags" +LIBS="$kde_save_akode_libs" +AC_SUBST(MADLIBS) +fi + +AC_ARG_WITH(libsamplerate,AC_HELP_STRING([--with-libsamplerate],[Enable libsamplerate support @<:@default=check@:>@]),[libsamplerate_test="$withval"],[libsamplerate_test="yes"]) + +if test "x$libsamplerate_test" = "xyes" ; then +LIBSAMPLERATE="" +KDE_CHECK_HEADERS(samplerate.h, [ + KDE_CHECK_LIB(samplerate, src_simple, [ + have_libsamplerate=yes + LIBSAMPLERATE="-lsamplerate" + AC_DEFINE(HAVE_LIBSAMPLERATE,1,[defined if you have libsamplerate library and header]) + ]) +]) +AC_SUBST(LIBSAMPLERATE) +fi + +dnl Check for pkg-config +AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + +AC_ARG_WITH(jack,AC_HELP_STRING([--with-jack],[Enable Jack Audio Connection Kit support @<:@default=check@:>@]),[jack_test="$withval"],[jack_test="yes"]) + +if test "x$jack_test" = "xyes" ; then +AC_MSG_CHECKING(for Jack Audio Connection Kit) +if $PKG_CONFIG --atleast-version 0.90 jack >/dev/null 2>&1 ; then + JACK_CFLAGS="`$PKG_CONFIG --cflags jack`" + JACK_LIBADD="`$PKG_CONFIG --libs-only-l jack`" + JACK_LDFLAGS="`$PKG_CONFIG --libs-only-L jack`" + have_jack=yes + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_LIBJACK, 1, + [Define if you have libjack (required if you want Jack support)]) +else + AC_MSG_RESULT(not installed) +fi +AC_SUBST(JACK_CFLAGS) +AC_SUBST(JACK_LIBADD) +AC_SUBST(JACK_LDFLAGS) +fi + +AC_ARG_WITH(polypaudio,AC_HELP_STRING([--with-polypaudio],[Enable Polypaudio server support @<:@default=check@:>@]),[polypaudio_test="$withval"],[polypaudio_test="yes"]) + +if test "x$polypaudio_test" = "xyes" ; then +AC_MSG_CHECKING(for Polypaudio 0.7 or later) +if $PKG_CONFIG --atleast-version 0.7 polyplib-simple >/dev/null 2>&1 ; then + POLYP_CFLAGS="`$PKG_CONFIG --cflags polyplib-simple`" + POLYP_LIBADD="`$PKG_CONFIG --libs-only-l polyplib-simple`" + POLYP_LDFLAGS="`$PKG_CONFIG --libs-only-L polyplib-simple`" + have_polyp=yes + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_LIBPOLYP, 1, + [Define if you have polyplib (required if you want Polypaudio server support)]) +else + AC_MSG_RESULT(not installed) +fi +AC_SUBST(POLYP_CFLAGS) +AC_SUBST(POLYP_LIBADD) +AC_SUBST(POLYP_LDFLAGS) +fi + +AC_ARG_WITH(ffmpeg,AC_HELP_STRING([--with-ffmpeg],[Enable experimental FFMPEG decoder support @<:@default=check@:>@]),[ffmpeg_test="$withval"],[ffmpeg_test="yes"]) + +if test "x$ffmpeg_test" = "xyes" ; then +AC_MSG_CHECKING(for FFMPEG 0.5.0 or later) +if $PKG_CONFIG --atleast-version 50 libavformat >/dev/null 2>&1 ; then +if $PKG_CONFIG --atleast-version 50 libavcodec >/dev/null 2>&1 ; then + AVFORMAT_CFLAGS="`$PKG_CONFIG --cflags libavformat`" + AVCODEC_CFLAGS="`$PKG_CONFIG --cflags libavcodec`" + AVFORMAT_LIBADD="`$PKG_CONFIG --libs-only-l libavformat`" + AVCODEC_LIBADD="`$PKG_CONFIG --libs-only-l libavcodec`" + AVFORMAT_LDFLAGS="`$PKG_CONFIG --libs-only-L libavformat`" + AVCODEC_LDFLAGS="`$PKG_CONFIG --libs-only-L libavcodec`" + have_ffmpeg=yes + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_FFMPEG, 1, + [Define if you have libavcodec and libavformat from FFMPEG (required for WMA and RealAudio decoding)]) +else + AC_MSG_RESULT(not installed) +fi +else + AC_MSG_RESULT(not installed) +fi +AC_SUBST(AVCODEC_CFLAGS) +AC_SUBST(AVCODEC_LIBADD) +AC_SUBST(AVCODEC_LDFLAGS) +AC_SUBST(AVFORMAT_CFLAGS) +AC_SUBST(AVFORMAT_LIBADD) +AC_SUBST(AVFORMAT_LDFLAGS) +fi + +AKODE_LIBDL=-ldl + +AC_ARG_WITH( + libltdl, + AC_HELP_STRING([--without-libltdl], + [Use libdl to load akode-plugins @<:@default=use libltdl@:>@]), + [libltdl_test="$withval"], + [libltdl_test="yes"]) + +have_libltdl=no +if test x$libltdl_test = xyes; then + KDE_CHECK_HEADERS(ltdl.h, [ + KDE_CHECK_LIB(ltdl, lt_dlopen, [ + have_libltdl=yes + AKODE_LIBDL="-lltdl" + AC_DEFINE(HAVE_LIBLTDL,1,[defined if you have libltdl library and header]) + ]) + ]) +fi + +if test "yes" = "$have_libltdl" ; then + # Do nothing, since we've already called CHECK_LIB + : +else + KDE_CHECK_LIB(dl, dlopen, + [],[ + AKODE_LIBDL="" + DO_NOT_COMPILE="akode $DO_NOT_COMPILE" + ] + ) +fi + +AC_SUBST(AKODE_LIBDL) + +KDE_CHECK_LIBPTHREAD +KDE_CHECK_SEM + +AC_CHECK_LIB(c, posix_madvise, have_posix_madvise=yes) +AC_CHECK_LIB(c, posix_fadvise, have_posix_fadvise=yes) +AC_CHECK_LIB(c, madvise, have_madvise=yes) +AC_CHECK_LIB(c, fadvise, have_fadvise=yes) + +if test x$have_madvise = xyes; then + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_MSG_CHECKING([if madvise needs prototype]) + AC_TRY_COMPILE([ + #include <sys/types.h> + #include <sys/mman.h> + ],[ + ::madvise((char*)0,0, MADV_SEQUENTIAL); + ],[ + madvise_needs_prototype=no + AC_MSG_RESULT(no) + ],[ + madvise_needs_prototype=yes + AC_MSG_RESULT(yes) + ]) + AC_LANG_RESTORE + AC_DEFINE(HAVE_MADVISE,1,[Define if your platform has madvise]) + if test x$madvise_needs_prototype = xyes; then + AC_DEFINE(NEED_MADVISE_PROTOTYPE,1,[Define if madvise has no usefull prototype]) + fi + +fi + +if test x$have_fadvise = xyes; then + AC_DEFINE(HAVE_FADVISE,1,[Define if your platform has fadvise]) +fi + +if test x$have_posix_madvise = xyes; then + AC_DEFINE(HAVE_POSIX_MADVISE,1,[Define if your platform has posix_madvise]) +fi + +if test x$have_posix_fadvise = xyes; then + AC_DEFINE(HAVE_POSIX_FADVISE,1,[Define if your platform has posix_fadvise]) +fi + +AC_CHECK_HEADERS(getopt.h, have_getopt_h=yes) +if test x$have_getopt_h = xyes; then + AC_CHECK_LIB(c, getopt_long, have_gnu_getopt=yes) + if test x$have_gnu_getopt = xyes; then + AC_DEFINE(HAVE_GNU_GETOPT,1,[Define if your platform has getopt_long from glibc]) + fi +fi + +#AC_CHECK_HEADERS(features.h, have_features_h=yes) +# +#if test x$have_features_h=xyes; then +# AC_DEFINE(HAVE_FEATURES_H, 1, [Define if your platform has the features.h header]) +#fi + +#AC_ARG_ENABLE(akodelib, +# [ --enable-akodelib Compile and install akodelib and akode_artsplugin (default yes)], enable_akodelib="$enableval",enable_akodelib=no) + +AM_CONDITIONAL(include_mpeg_decoder, test x$have_libMAD = xyes) + +AC_ARG_WITH(oss, + [AS_HELP_STRING(--with-oss, + [enable support for OSS output @<:@default=check@:>@])], + [], with_oss=check) + +if test "x$with_oss" != xno; then + KDE_CHECK_OSS + + if test "x$with_oss" != xcheck && test "x$have_oss" != xyes; then + AC_MSG_FAILURE([--with-oss was given, but test for oss failed]) + fi +fi + +AC_ARG_WITH(sun, + [AS_HELP_STRING(--with-sun, + [enable support for Sun Audio output @<:@default=check@:>@])], + [], with_sun=check) + +if test "x$with_sun" != xno; then + KDE_CHECK_SUN + + if test "x$with_sun" != xcheck && test "x$have_sun" != xyes; then + AC_MSG_FAILURE([--with-sun was given, but test for Sun Audio failed]) + fi +fi + +AC_ARG_WITH(alsa, + [AS_HELP_STRING(--with-alsa, + [enable support for ALSA output @<:@default=check@:>@])], + [], with_alsa=check) + +have_alsa=no +if test "x$with_alsa" != xno; then + KDE_CHECK_ALSA + + if test "x$with_alsa" != xcheck && test "x$have_alsa" != xyes; then + AC_MSG_FAILURE([--with-alsa was given, but test for ALSA failed]) + fi +fi + +AC_ARG_WITH(vorbis, + [AS_HELP_STRING(--with-vorbis, + [enable support for Ogg Vorbis @<:@default=check@:>@])], + [], with_vorbis=check) + +have_oggvorbis=no +if test "x$with_vorbis" != xno; then + KDE_CHECK_OGGVORBIS + + if test "x$with_vorbis" != xcheck && test "x$have_oggvorbis" != xyes; then + AC_MSG_FAILURE([--with-vorbis was given, but test for Ogg Vorbis failed]) + fi +fi + +usefull_xiph_decoder=yes +if test x$have_libFLAC$have_libOggFLAC$have_oggvorbis$have_libspeex = xnononono; then + usefull_xiph_decoder=no +fi + +AM_CONDITIONAL(include_xiph_decoder, test x$usefull_xiph_decoder = xyes) +AM_CONDITIONAL(include_src_resampler, test x$have_libsamplerate = xyes) +AM_CONDITIONAL(include_alsa_sink, test x$have_alsa = xyes) +AM_CONDITIONAL(include_oss_sink, test x$have_oss = xyes) +AM_CONDITIONAL(include_sun_sink, test x$have_sun = xyes) +AM_CONDITIONAL(include_jack_sink, test x$have_jack = xyes) +AM_CONDITIONAL(include_polyp_sink, test x$have_polyp = xyes) +AM_CONDITIONAL(include_ffmpeg_decoder, test x$have_ffmpeg = xyes) + +AC_MSG_CHECKING(for compilable aKode) + +COMPILE_AKODE=yes +if test x$have_PTHREAD = xno; then + COMPILE_AKODE=no +fi + +AC_MSG_RESULT($COMPILE_AKODE) + +if test "x$COMPILE_AKODE" = "xno"; then +DO_NOT_COMPILE="$DO_NOT_COMPILE akode" +fi + +#if test "x$COMPILE_AKODE$enable_akodelib" = "xyesno"; then +#DO_NOT_COMPILE="$DO_NOT_COMPILE akode" +#fi diff --git a/akode/lib/Makefile.am b/akode/lib/Makefile.am new file mode 100644 index 0000000..48bae9f --- /dev/null +++ b/akode/lib/Makefile.am @@ -0,0 +1,25 @@ +INCLUDES = $(all_includes) + +lib_LTLIBRARIES = libakode.la + +libakode_la_SOURCES = bytebuffer.cpp audiobuffer.cpp pluginhandler.cpp \ + decoderpluginhandler.cpp resamplerpluginhandler.cpp \ + sinkpluginhandler.cpp encoderpluginhandler.cpp \ + fast_resampler.cpp crossfader.cpp volumefilter.cpp \ + localfile.cpp mmapfile.cpp \ + wav_decoder.cpp auto_sink.cpp void_sink.cpp \ + converter.cpp buffered_decoder.cpp \ + player.cpp magic.cpp + +AM_CPPFLAGS = -DAKODE_SEARCHDIR=\"$(libdir)\" + +libakode_la_LDFLAGS = -no-undefined -version-info 2:0:0 $(all_libraries) +libakode_la_LIBADD = $(LIBPTHREAD) $(AKODE_LIBDL) $(LIBSEM) + +libakode_includedir = $(includedir)/akode +libakode_include_HEADERS = akode_export.h akodelib.h decoder.h sink.h encoder.h \ + audioconfiguration.h audioframe.h audiobuffer.h bytebuffer.h \ + file.h localfile.h mmapfile.h pluginhandler.h \ + crossfader.h volumefilter.h resampler.h fast_resampler.h \ + buffered_decoder.h wav_decoder.h auto_sink.h void_sink.h \ + player.h magic.h converter.h framedecoder.h diff --git a/akode/lib/Makefile.in b/akode/lib/Makefile.in new file mode 100644 index 0000000..6a8f6e7 --- /dev/null +++ b/akode/lib/Makefile.in @@ -0,0 +1,764 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = akode/lib +DIST_COMMON = $(libakode_include_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/akode_export.h.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h akode_export.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" \ + "$(DESTDIR)$(libakode_includedir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libakode_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libakode_la_OBJECTS = bytebuffer.lo audiobuffer.lo pluginhandler.lo \ + decoderpluginhandler.lo resamplerpluginhandler.lo \ + sinkpluginhandler.lo encoderpluginhandler.lo fast_resampler.lo \ + crossfader.lo volumefilter.lo localfile.lo mmapfile.lo \ + wav_decoder.lo auto_sink.lo void_sink.lo converter.lo \ + buffered_decoder.lo player.lo magic.lo +#>- libakode_la_OBJECTS = $(am_libakode_la_OBJECTS) +#>+ 9 +libakode_la_final_OBJECTS = libakode_la.all_cpp.lo +libakode_la_nofinal_OBJECTS = bytebuffer.lo audiobuffer.lo pluginhandler.lo \ + decoderpluginhandler.lo resamplerpluginhandler.lo \ + sinkpluginhandler.lo encoderpluginhandler.lo fast_resampler.lo \ + crossfader.lo volumefilter.lo localfile.lo mmapfile.lo \ + wav_decoder.lo auto_sink.lo void_sink.lo converter.lo \ + buffered_decoder.lo player.lo magic.lo +@KDE_USE_FINAL_FALSE@libakode_la_OBJECTS = $(libakode_la_nofinal_OBJECTS) +@KDE_USE_FINAL_TRUE@libakode_la_OBJECTS = $(libakode_la_final_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I. +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 2 +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ +#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +#>- $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 3 +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +CXXLD = $(CXX) +#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ +#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +#>+ 2 +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libakode_la_SOURCES) +DIST_SOURCES = $(libakode_la_SOURCES) +libakode_includeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(libakode_include_HEADERS) +ETAGS = etags +CTAGS = ctags +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AKODE_LIBDL = @AKODE_LIBDL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVCODEC_CFLAGS = @AVCODEC_CFLAGS@ +AVCODEC_LDFLAGS = @AVCODEC_LDFLAGS@ +AVCODEC_LIBADD = @AVCODEC_LIBADD@ +AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ +AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ +AVFORMAT_LIBADD = @AVFORMAT_LIBADD@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBADD = @JACK_LIBADD@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBFLAC = @LIBFLAC@ +LIBOBJS = @LIBOBJS@ +LIBOGGFLAC = @LIBOGGFLAC@ +LIBOSSAUDIO = @LIBOSSAUDIO@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSAMPLERATE = @LIBSAMPLERATE@ +LIBSEM = @LIBSEM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MADLIBS = @MADLIBS@ +MAKEINFO = @MAKEINFO@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POLYP_CFLAGS = @POLYP_CFLAGS@ +POLYP_LDFLAGS = @POLYP_LDFLAGS@ +POLYP_LIBADD = @POLYP_LIBADD@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXLIBS = @SPEEXLIBS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +VERSION = @VERSION@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +akode_SUBDIR_included_FALSE = @akode_SUBDIR_included_FALSE@ +akode_SUBDIR_included_TRUE = @akode_SUBDIR_included_TRUE@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_alsa_sink_FALSE = @include_alsa_sink_FALSE@ +include_alsa_sink_TRUE = @include_alsa_sink_TRUE@ +include_ffmpeg_decoder_FALSE = @include_ffmpeg_decoder_FALSE@ +include_ffmpeg_decoder_TRUE = @include_ffmpeg_decoder_TRUE@ +include_jack_sink_FALSE = @include_jack_sink_FALSE@ +include_jack_sink_TRUE = @include_jack_sink_TRUE@ +include_mpeg_decoder_FALSE = @include_mpeg_decoder_FALSE@ +include_mpeg_decoder_TRUE = @include_mpeg_decoder_TRUE@ +include_oss_sink_FALSE = @include_oss_sink_FALSE@ +include_oss_sink_TRUE = @include_oss_sink_TRUE@ +include_polyp_sink_FALSE = @include_polyp_sink_FALSE@ +include_polyp_sink_TRUE = @include_polyp_sink_TRUE@ +include_src_resampler_FALSE = @include_src_resampler_FALSE@ +include_src_resampler_TRUE = @include_src_resampler_TRUE@ +include_sun_sink_FALSE = @include_sun_sink_FALSE@ +include_sun_sink_TRUE = @include_sun_sink_TRUE@ +include_xiph_decoder_FALSE = @include_xiph_decoder_FALSE@ +include_xiph_decoder_TRUE = @include_xiph_decoder_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +INCLUDES = $(all_includes) +lib_LTLIBRARIES = libakode.la +libakode_la_SOURCES = bytebuffer.cpp audiobuffer.cpp pluginhandler.cpp \ + decoderpluginhandler.cpp resamplerpluginhandler.cpp \ + sinkpluginhandler.cpp encoderpluginhandler.cpp \ + fast_resampler.cpp crossfader.cpp volumefilter.cpp \ + localfile.cpp mmapfile.cpp \ + wav_decoder.cpp auto_sink.cpp void_sink.cpp \ + converter.cpp buffered_decoder.cpp \ + player.cpp magic.cpp + +AM_CPPFLAGS = -DAKODE_SEARCHDIR=\"$(libdir)\" +#>- libakode_la_LDFLAGS = -no-undefined -version-info 2:0:0 $(all_libraries) +#>+ 1 +libakode_la_LDFLAGS = -no-undefined $(KDE_NO_UNDEFINED) -version-info 2:0:0 $(all_libraries) +libakode_la_LIBADD = $(LIBPTHREAD) $(AKODE_LIBDL) $(LIBSEM) +libakode_includedir = $(includedir)/akode +libakode_include_HEADERS = akode_export.h akodelib.h decoder.h sink.h encoder.h \ + audioconfiguration.h audioframe.h audiobuffer.h bytebuffer.h \ + file.h localfile.h mmapfile.h pluginhandler.h \ + crossfader.h volumefilter.h resampler.h fast_resampler.h \ + buffered_decoder.h wav_decoder.h auto_sink.h void_sink.h \ + player.h magic.h converter.h framedecoder.h + +#>- all: akode_export.h +#>+ 1 +all: docs-am akode_export.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/lib/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu akode/lib/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/lib/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/lib/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/lib/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +akode_export.h: stamp-h2 + @if test ! -f $@; then \ + rm -f stamp-h2; \ + $(MAKE) stamp-h2; \ + else :; fi + +stamp-h2: $(srcdir)/akode_export.h.in $(top_builddir)/config.status + @rm -f stamp-h2 + cd $(top_builddir) && $(SHELL) ./config.status akode/lib/akode_export.h +$(srcdir)/akode_export.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h2 + touch $@ + +distclean-hdr: + -rm -f akode_export.h stamp-h2 +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + 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 + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +#>- libakode.la: $(libakode_la_OBJECTS) $(libakode_la_DEPENDENCIES) +#>+ 2 +@KDE_USE_CLOSURE_TRUE@libakode.la: libakode.la.closure $(libakode_la_OBJECTS) $(libakode_la_DEPENDENCIES) +@KDE_USE_CLOSURE_FALSE@libakode.la: $(libakode_la_OBJECTS) $(libakode_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libakode_la_LDFLAGS) $(libakode_la_OBJECTS) $(libakode_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiobuffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auto_sink.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffered_decoder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bytebuffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/converter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crossfader.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decoderpluginhandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encoderpluginhandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fast_resampler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localfile.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/magic.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmapfile.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pluginhandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resamplerpluginhandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sinkpluginhandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/void_sink.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/volumefilter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wav_decoder.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-libakode_includeHEADERS: $(libakode_include_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(libakode_includedir)" || $(mkdir_p) "$(DESTDIR)$(libakode_includedir)" + @list='$(libakode_include_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(libakode_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libakode_includedir)/$$f'"; \ + $(libakode_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libakode_includedir)/$$f"; \ + done + +uninstall-libakode_includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libakode_include_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(libakode_includedir)/$$f'"; \ + rm -f "$(DESTDIR)$(libakode_includedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) akode_export.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) akode_export.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; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) akode_export.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) akode_export.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; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) akode_export.h +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libakode_includedir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-am +#>+ 1 +clean: kde-rpo-clean clean-am + +#>- clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ +#>- mostlyclean-am +#>+ 2 +clean-am: clean-closures clean-bcheck clean-final clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-libakode_includeHEADERS + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ + uninstall-libakode_includeHEADERS + +.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-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-libLTLIBRARIES \ + install-libakode_includeHEADERS install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES uninstall-libakode_includeHEADERS + +# 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: + +#>+ 8 +libakode.la.closure: $(libakode_la_OBJECTS) $(libakode_la_DEPENDENCIES) + @echo "int main() {return 0;}" > libakode_la_closure.cpp + @$(LTCXXCOMPILE) -c libakode_la_closure.cpp + $(CXXLINK) libakode_la_closure.lo $(libakode_la_LDFLAGS) $(libakode_la_OBJECTS) $(libakode_la_LIBADD) $(LIBS) + @rm -f libakode_la_closure.* libakode.la.closure + @echo "timestamp" > libakode.la.closure + + +#>+ 2 +KDE_DIST=thread.h akode_export.h.in Makefile.in arithmetic.h Makefile.am + +#>+ 3 +clean-closures: + -rm -f libakode.la.closure + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/lib/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/lib/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/lib/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-am + +bcheck-am: + @for i in $(libakode_include_HEADERS); do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 11 +libakode_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/bytebuffer.cpp $(srcdir)/audiobuffer.cpp $(srcdir)/pluginhandler.cpp $(srcdir)/decoderpluginhandler.cpp $(srcdir)/resamplerpluginhandler.cpp $(srcdir)/sinkpluginhandler.cpp $(srcdir)/encoderpluginhandler.cpp $(srcdir)/fast_resampler.cpp $(srcdir)/crossfader.cpp $(srcdir)/volumefilter.cpp $(srcdir)/localfile.cpp $(srcdir)/mmapfile.cpp $(srcdir)/wav_decoder.cpp $(srcdir)/auto_sink.cpp $(srcdir)/void_sink.cpp $(srcdir)/converter.cpp $(srcdir)/buffered_decoder.cpp $(srcdir)/player.cpp $(srcdir)/magic.cpp + @echo 'creating libakode_la.all_cpp.cpp ...'; \ + rm -f libakode_la.all_cpp.files libakode_la.all_cpp.final; \ + echo "#define KDE_USE_FINAL 1" >> libakode_la.all_cpp.final; \ + for file in bytebuffer.cpp audiobuffer.cpp pluginhandler.cpp decoderpluginhandler.cpp resamplerpluginhandler.cpp sinkpluginhandler.cpp encoderpluginhandler.cpp fast_resampler.cpp crossfader.cpp volumefilter.cpp localfile.cpp mmapfile.cpp wav_decoder.cpp auto_sink.cpp void_sink.cpp converter.cpp buffered_decoder.cpp player.cpp magic.cpp ; do \ + echo "#include \"$$file\"" >> libakode_la.all_cpp.files; \ + test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libakode_la.all_cpp.final; \ + done; \ + cat libakode_la.all_cpp.final libakode_la.all_cpp.files > libakode_la.all_cpp.cpp; \ + rm -f libakode_la.all_cpp.final libakode_la.all_cpp.files + +#>+ 3 +clean-final: + -rm -f libakode_la.all_cpp.cpp + +#>+ 3 +final: + $(MAKE) libakode_la_OBJECTS="$(libakode_la_final_OBJECTS)" all-am + +#>+ 3 +final-install: + $(MAKE) libakode_la_OBJECTS="$(libakode_la_final_OBJECTS)" install-am + +#>+ 3 +no-final: + $(MAKE) libakode_la_OBJECTS="$(libakode_la_nofinal_OBJECTS)" all-am + +#>+ 3 +no-final-install: + $(MAKE) libakode_la_OBJECTS="$(libakode_la_nofinal_OBJECTS)" install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/akode/lib/akode_export.h.in b/akode/lib/akode_export.h.in new file mode 100644 index 0000000..100c01b --- /dev/null +++ b/akode/lib/akode_export.h.in @@ -0,0 +1,53 @@ +/* This file is part of the KDE libraries + Copyright (c) 2002-2003 KDE Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef AKODE_EXPORT_H +#define AKODE_EXPORT_H + +#undef __KDE_HAVE_GCC_VISIBILITY + +/** + * The ARTS_NO_EXPORT macro marks the symbol of the given variable + * to be hidden. A hidden symbol is stripped during the linking step, + * so it can't be used from outside the resulting library, which is similar + * to static. However, static limits the visibility to the current + * compilation unit. hidden symbols can still be used in multiple compilation + * units. + * + * \code + * int AKODE_NO_EXPORT foo; + * int AKODE_EXPORT bar; + * \end + */ + +#if defined(__KDE_HAVE_GCC_VISIBILITY) +/* Visibility is available for GCC newer than 3.4. + * See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9283 + */ +#define AKODE_NO_EXPORT __attribute__ ((visibility("hidden"))) +#define AKODE_EXPORT __attribute__ ((visibility("default"))) +#elif defined(_WIN32) +#define AKODE_NO_EXPORT +#define AKODE_EXPORT __declspec(dllexport) +#else +#define AKODE_NO_EXPORT +#define AKODE_EXPORT +#endif + +#endif /* AKODE_EXPORTS */ diff --git a/akode/lib/akodelib.h b/akode/lib/akodelib.h new file mode 100644 index 0000000..032f537 --- /dev/null +++ b/akode/lib/akodelib.h @@ -0,0 +1,46 @@ +/* aKode: Root header + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_AKODELIB_H +#define _AKODE_AKODELIB_H + +#define AKODELIB_MAJOR_VERSION 2 +#define AKODELIB_MINOR_VERSION 0 + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_STDINT_H +#include <stdint.h> +#elif defined(HAVE_INTTYPES_H) +#include <inttypes.h> +#else +typedef signed char int8_t; +typedef unsigned char int8_t; +typedef signed short int16_t; +typedef unsigned short int16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +#endif + +#endif diff --git a/akode/lib/arithmetic.h b/akode/lib/arithmetic.h new file mode 100644 index 0000000..bd51859 --- /dev/null +++ b/akode/lib/arithmetic.h @@ -0,0 +1,60 @@ +/* aKode Arithmetics + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef _AKODE_ARITHMETIC_H +#define _AKODE_ARITHMETIC_H + +// Parametirize the difference in aritmetics between floating point and integer. +template<typename S> +struct Arithm_FP { + static inline S div(S value, S divisor) { + return value/divisor; + } + static inline S rem(S, S) { + return 0.0; + } + static inline S muldiv(S value, S multiplier, S divisor) { + return (value*multiplier)/divisor; + } + static inline S max(int) { + return 1.0; + } +}; + +template<typename S> +struct Arithm_Int { + static inline S div(S value, S divisor) { + return value / divisor; + } + static inline S rem(S value, S divisor) { + return value % divisor; + } + // A multiplication and division that avoids overflow + static inline S muldiv(S value, S multiplier, S divisor) { + S out = Arithm_Int<S>::div(value, divisor)*multiplier; + S rem = Arithm_Int<S>::rem(value, divisor)*multiplier; + out += div(rem, divisor); + return out; + } + static inline S max(int bits) { + return (((S)1)<<(bits-1))-1; + } +}; + +#endif diff --git a/akode/lib/audiobuffer.cpp b/akode/lib/audiobuffer.cpp new file mode 100644 index 0000000..f1565fe --- /dev/null +++ b/akode/lib/audiobuffer.cpp @@ -0,0 +1,148 @@ +/* aKode AudioBuffer + + Copyright (C) 2004-2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "audiobuffer.h" +#include "audioframe.h" + +namespace aKode { + +AudioBuffer::AudioBuffer(unsigned int len) : length(len), readPos(0), writePos(0), + flushed(false), released(false), paused(false), m_eof(false) +{ + buffer = new AudioFrame[len]; +} + +AudioBuffer::~AudioBuffer() { + delete[] buffer; +} + +bool AudioBuffer::put(AudioFrame* buf, bool blocking) { + mutex.lock(); + if (released) goto fail; + flushed = false; + if ((writePos+1) % length == readPos) { + if (blocking) { + not_full.wait(&mutex); + if (flushed || released) goto fail; + } + else + goto fail; + } + + swapFrames(&buffer[writePos], buf); + writePos = (writePos+1) % length; + + not_empty.signal(); + mutex.unlock(); + return true; +fail: + mutex.unlock(); + return false; +} + +bool AudioBuffer::get(AudioFrame* buf, bool blocking) { + mutex.lock(); + if (released) goto fail; + if (readPos == writePos || paused) { + if (blocking && !m_eof) { + not_empty.wait(&mutex); + if (released) goto fail; + if (empty()) goto fail; + } + else + goto fail; + } + + swapFrames(buf, &buffer[readPos]); + readPos = (readPos+1) % length; + + not_full.signal(); + mutex.unlock(); + return true; +fail: + mutex.unlock(); + return false; +} + +long AudioBuffer::position() { + long out = -1; + mutex.lock(); + if (!empty() && !released) + out = buffer[readPos].pos; + mutex.unlock(); + return out; +} + +bool AudioBuffer::empty() { + return (readPos == writePos); +} + +bool AudioBuffer::full() { + return (readPos == (writePos+1) % length); +} + +void AudioBuffer::setEOF() { + mutex.lock(); + m_eof = true; + not_empty.signal(); + mutex.unlock(); +} + +bool AudioBuffer::eof() { + return m_eof && empty(); +} + +void AudioBuffer::reset() { + // We assume all processes have been released at this point + readPos = writePos = 0; + flushed = released = paused = m_eof = false; +} + +void AudioBuffer::flush() { + mutex.lock(); + // Don't free the frames, most likely this is just a seek + // and the same buffer-sizes will be needed afterwards. + readPos = writePos = 0; + flushed = true; + not_full.signal(); + mutex.unlock(); +} + +void AudioBuffer::release() { + mutex.lock(); + released = true; + not_full.signal(); + not_empty.signal(); + mutex.unlock(); +} + +void AudioBuffer::pause() { + paused = true; +} + +void AudioBuffer::resume() { + mutex.lock(); + paused = false; + if (!empty()) + not_empty.signal(); + mutex.unlock(); +} + +} // namespace diff --git a/akode/lib/audiobuffer.h b/akode/lib/audiobuffer.h new file mode 100644 index 0000000..b718897 --- /dev/null +++ b/akode/lib/audiobuffer.h @@ -0,0 +1,116 @@ +/* aKode AudioBuffer + + Copyright (C) 2004-2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_AUDIOBUFFER_H +#define _AKODE_AUDIOBUFFER_H + +#include "audioframe.h" +#include "akode_export.h" +#include "thread.h" + +namespace aKode { + +//! A reentrant circular buffer of AudioFrames + +/*! + * A buffer of AudioFrame to synchronize audio between two threads, one putting and one getting. + */ +class AKODE_EXPORT AudioBuffer { + const unsigned int length; + AudioFrame* buffer; + volatile unsigned int readPos; + volatile unsigned int writePos; + Mutex mutex; + Condition not_empty; + Condition not_full; + volatile bool flushed, released, paused, m_eof; +public: + /*! + * Constructs a buffer with \a len AudioFrames. + */ + AudioBuffer(unsigned int len); + ~AudioBuffer(); + + /*! + * Puts the AudioFrame \a buf into the buffer. If blocking is set to true, + * put will block until the buffer is not full. + * Returns true if succesfull. + * + * \note That put will fail even if blocking is set, if flush or release is called. + */ + bool put(AudioFrame* buf, bool blocking = false); + /*! + * Gets one AudioFrame from the buffer. If blocking is set to true, + * get will block until the buffer is not empty. + * Returns true if succesfull. + * + * \note That get will fail even if blocking is set if release is called. + */ + bool get(AudioFrame* buf, bool blocking = false); + + /*! + * Returns the position of the next audioFrame in the buffer + */ + long position(); + + /*! + * Returns true if the buffer is empty. + */ + bool empty(); + /*! + * Returns true if the buffer is full. + */ + bool full(); + + /*! + * Sets EOF for the incomming stream. Releases any blocking get-calls. + */ + void setEOF(); + /*! + * Returns true if the sender has set the EOF flag. + */ + bool eof(); + + /*! + * Resets the buffer to be as good as new. + */ + void reset(); + /*! + * Flushes the buffer and releases any blocking put-calls. + */ + void flush(); + /*! + * Releases all blocking threads and prepares the buffer for deletion. + * Use reset to make the buffer usable again. + */ + void release(); + /*! + * Blocks the buffer for reading. + */ + void pause(); + /*! + * Un-blocks the buffer for reading. + */ + void resume(); +}; + +} // namespace + +#endif diff --git a/akode/lib/audioconfiguration.h b/akode/lib/audioconfiguration.h new file mode 100644 index 0000000..fe1b471 --- /dev/null +++ b/akode/lib/audioconfiguration.h @@ -0,0 +1,102 @@ +/* aKode AudioConfiguration + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_AUDIOCONFIGURATION_H +#define _AKODE_AUDIOCONFIGURATION_H + +#include "akodelib.h" + +namespace aKode { + +enum ChannelConfiguration { + MultiChannel = 0, // any number of independent channels + MonoStereo = 1, // 1-2 channels + Surround = 2 // 1-7 channels + // Two extra flags will make it here sometime + // One for Dolby Pro (make 3 front channels out of 2) + // and Dolby Digital ES (make an extra back channel from the two surround) + // and one for Dolby Surround (make 4 channels surround out of stereo). +}; + +struct SurroundConfiguration { + SurroundConfiguration() : front_channels(0) + , rear_channels(0) + , side_channels(0) + , LFE_channel(0) + , reserved(0) {}; + SurroundConfiguration(uint8_t val) { *(uint8_t*)(this) = val; }; + uint8_t front_channels : 3; // 1-5 + uint8_t rear_channels : 2; // 0-3 + uint8_t side_channels : 1; // 0,2 + uint8_t LFE_channel : 1; + uint8_t reserved : 1; + operator uint8_t() const { + return *(uint8_t*)(this); + } +}; +// Channel ordering: +// front(, rear)(, side)(, LFE) +// (left, right(,)) (center)(, left-of-center, right-of-center) +// +// front channels: +// 1 -> center +// 2 -> left, right +// 3 -> left, right, center +// 4 -> left, right, left-of-center, right-of-center +// 5 -> left, right, center, left-of-center, right-of-center +// +// rear channels: +// 1 -> center +// 2 -> left, right +// 3 -> left, right, center + +// 8 bytes of configuration +struct AudioConfiguration { +public: + AudioConfiguration() : channels(0), + channel_config(0), + surround_config(0), + sample_width(0), + sample_rate(0) {}; + // 0-255 channels (0 means no audio) + uint8_t channels; + // enum ChannelConfiguration + uint8_t channel_config; + // struct SurroundConfiguration + uint8_t surround_config; + // 8, 16, 24 and 32 for signed integer samples + // -32 for 32bit float + int8_t sample_width; + // Sample-rate in Hz + uint32_t sample_rate; + + bool operator==(const AudioConfiguration& b) const + { + // abusing that we are only 8 bytes long + const uint32_t *you = (const uint32_t*)(&b); + const uint32_t *me = (const uint32_t*)(this); + + return (you[0] == me[0]) && (you[1] == me[1]); + } +}; + +} // namespace + +#endif diff --git a/akode/lib/audioframe.h b/akode/lib/audioframe.h new file mode 100644 index 0000000..d4cd09b --- /dev/null +++ b/akode/lib/audioframe.h @@ -0,0 +1,148 @@ +/* aKode AudioFrame + + Copyright (C) 2004,2006 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_AUDIOFRAME_H +#define _AKODE_AUDIOFRAME_H + +#include "akodelib.h" +#include "audioconfiguration.h" +#include <assert.h> + +namespace aKode { + +#define AKODE_POS_UNKNOWN -1 +#define AKODE_POS_EOF -2 +#define AKODE_POS_ERROR -3 + +//! The internal audio format + +/*! + * AudioFrames are used through-out akodelib as the mean of audiotransport. + * It derives from AudioConfiguration because it caries its own interpretation + * around with it. + */ +struct AudioFrame : public AudioConfiguration { +public: + AudioFrame() : length(0), max(0), data(0) {}; + ~AudioFrame() { freeSpace(); } + /*! + * Reserves space in the frame for atleast \a iLength samples of the + * configuration \a config. + */ + void reserveSpace(const AudioConfiguration *config, long iLength) { + reserveSpace(config->channels, iLength, config->sample_width); + sample_rate = config->sample_rate; + channel_config = config->channel_config; + surround_config = config->surround_config; + } + void reserveSpace(uint8_t iChannels, long iLength, int8_t iWidth) { + // Sanity + assert(iChannels > 0); + assert(iWidth != 0 && iWidth >= -64 && iWidth <= 32); + + // No reallocation needed + if ( data != 0 && channels == iChannels && + max >= iLength && sample_width == iWidth) + { + length = iLength; + return; + } + + // Reallocate + freeSpace(); + channels = iChannels; + length = max = iLength; + sample_width = iWidth; + if (length == 0) { + data = 0; + return; + } + data = new int8_t*[channels+1]; + int bytes = 0; + if (sample_width < 0) { + if (sample_width == -32) + bytes = 4; + else + if (sample_width == -64) + bytes = 8; + else + assert(false); + } + else { + bytes = (sample_width+7) / 8; + if (bytes == 3) bytes = 4; // 24bit uses 4 bytes + } + + for(int i=0; i<iChannels; i++) + data[i] = new int8_t[length*bytes]; + data[iChannels] = 0; + } + /*! + * Frees the space allocated for the buffer. + */ + void freeSpace() + { + if (!data) return; + int8_t** tmp = data; + while(*tmp) { + delete[] *tmp; + tmp++; + } + delete[] data; + pos = 0; + data = 0; + channels = 0; + length = 0; + max = 0; + } + /*! + * The current position in stream (measured in milliseconds) + * -1 if unknown + */ + long pos; + /*! + * The length of the frame in samples. + */ + long length; + /*! + * The maximum number of samples currently reserved in the frame. + */ + long max; + /*! + * The buffer is accessed according sample-width + * 1-8bit: int8_t, 9-16bit: int16_t, 17-32bit: int32_t + * -32bit: float, -64bit: double + */ + int8_t** data; +}; + +// evil function to swap the contents of two frames +inline void swapFrames(AudioFrame* toFrame, AudioFrame* fromFrame) { + AudioFrame tmpFrame; + + tmpFrame = *toFrame; + *toFrame = *fromFrame; + *fromFrame = tmpFrame; + tmpFrame.data = 0; +} + +} // namespace + +#endif diff --git a/akode/lib/auto_sink.cpp b/akode/lib/auto_sink.cpp new file mode 100644 index 0000000..7d120f9 --- /dev/null +++ b/akode/lib/auto_sink.cpp @@ -0,0 +1,111 @@ +/* aKode: Auto-Sink + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "audioframe.h" +#include "auto_sink.h" + +#include <iostream> + +namespace aKode { + +extern "C" { AutoSinkPlugin auto_sink; } + +struct AutoSink::private_data +{ + private_data() : sink(0) {}; + SinkPluginHandler plugin_handler; + Sink* sink; + + bool tryOpen(const string plugin) { + if (plugin_handler.load(plugin)) { + sink = plugin_handler.openSink(); + if (sink) { + if (sink->open()) + return true; + delete sink; + sink = 0; + } + plugin_handler.unload(); + } else + std::cout << "auto_sink: Could not load " << plugin << std::endl; + return false; + } +}; + +AutoSink::AutoSink() +{ + m_data = new private_data; +} + +AutoSink::~AutoSink() +{ + close(); + delete m_data->sink; + delete m_data; +} + +bool AutoSink::open() +{ + // Try Polypaudio + if (getenv("POLYP_SERVER")) + if (m_data->tryOpen("polyp")) return true; + // Try Jack + if (m_data->tryOpen("jack")) return true; + // Try ALSA + if (m_data->tryOpen("alsa")) return true; + // Try OSS + if (m_data->tryOpen("oss")) return true; + // Try Sun Audio + if (m_data->tryOpen("sun")) return true; + // Fail + return false; +} + +void AutoSink::close() +{ + if (m_data->sink) + m_data->sink->close(); +} + +int AutoSink::setAudioConfiguration(const AudioConfiguration* config) +{ + if (!m_data->sink) + return -1; + else + return m_data->sink->setAudioConfiguration(config); +} + +const AudioConfiguration* AutoSink::audioConfiguration() const +{ + if (!m_data->sink) + return 0; + else + return m_data->sink->audioConfiguration(); +} + +bool AutoSink::writeFrame(AudioFrame* frame) +{ + if (!m_data->sink) + return false; + else + return m_data->sink->writeFrame(frame); +} + +} // namespace diff --git a/akode/lib/auto_sink.h b/akode/lib/auto_sink.h new file mode 100644 index 0000000..abba38e --- /dev/null +++ b/akode/lib/auto_sink.h @@ -0,0 +1,58 @@ +/* aKode: Auto-Sink + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_AUTO_SINK_H +#define _AKODE_AUTO_SINK_H + +#include "sink.h" + +namespace aKode { + +class AudioConfiguration; +class AudioFrame; + +class AutoSink : public Sink { +public: + AutoSink(); + ~AutoSink(); + bool open(); + void close(); + int setAudioConfiguration(const AudioConfiguration *config); + const AudioConfiguration* audioConfiguration() const; + // Writes blocking + bool writeFrame(AudioFrame *frame); + + struct private_data; +private: + private_data *m_data; +}; + +class AutoSinkPlugin : public SinkPlugin { +public: + virtual AutoSink* openSink() { + return new AutoSink(); + } +}; + +extern "C" AutoSinkPlugin auto_sink; + +} // namespace + +#endif diff --git a/akode/lib/buffered_decoder.cpp b/akode/lib/buffered_decoder.cpp new file mode 100644 index 0000000..7bba728 --- /dev/null +++ b/akode/lib/buffered_decoder.cpp @@ -0,0 +1,298 @@ +/* aKode: Buffered Decoder + + Copyright (C) 2004-2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <pthread.h> +#include <assert.h> + +#include "audioframe.h" +#include "audiobuffer.h" +#include "decoder.h" +#include "crossfader.h" +#include "buffered_decoder.h" + +namespace aKode { + +// States are used to ensure we always have a welldefined state +enum BufferedDecoderStatus { Closed, Open, Playing, Paused, XFadingSeek }; + +struct BufferedDecoder::private_data +{ + private_data() : buffer(0) + , decoder(0) + , xfader(0) + , fading_time(50) + , buffer_size(16) + , blocking(false) + , running(false) + , state(Closed) + , halt(false) + , seek_pos(-1) {}; + AudioBuffer *buffer; + Decoder *decoder; + CrossFader *xfader; + unsigned int fading_time, buffer_size; + bool blocking; + bool running; + BufferedDecoderStatus state; + + // Thread controls + volatile bool halt; + volatile long seek_pos; + pthread_t thread; +}; + +// The decoder-thread. It is controlled through the two variables +// halt and seek_pos in d +static void* run_decoder(void* arg) { + BufferedDecoder::private_data *d = (BufferedDecoder::private_data*)arg; + + AudioFrame frame; + bool no_error; + + while(true) { + if (d->halt) break; + if (d->seek_pos>=0) { + d->decoder->seek(d->seek_pos); + d->seek_pos = -1; + } + + no_error = d->decoder->readFrame(&frame); + if (no_error) + d->buffer->put(&frame, true); + else { + if (d->decoder->error() || d->decoder->eof()) { + break; + } + } + } + + d->buffer->setEOF(); + + return (void*)0; +} + +BufferedDecoder::BufferedDecoder(){ + d = new private_data; +} + +BufferedDecoder::~BufferedDecoder() { + if (d->state != Closed) closeDecoder(); + delete d; +} + +void BufferedDecoder::openDecoder(Decoder *decoder) { + if (d->state != Closed) closeDecoder(); + + d->decoder = decoder; + d->buffer = new AudioBuffer(d->buffer_size); + d->state = Open; +} + +void BufferedDecoder::closeDecoder() { + if (d->state == Closed) return; + if (d->state != Open) stop(); + + delete d->buffer; + d->buffer = 0; + d->decoder = 0; + d->state = Closed; +} + +void BufferedDecoder::start() +{ + if (d->state != Open) return; + + d->halt = false; + d->seek_pos = -1; + + d->buffer->reset(); + + if (pthread_create(&d->thread, 0, run_decoder, d) == 0) { + d->running = true; + } + + d->state = Playing; +} + +void BufferedDecoder::stop() { + if (d->state == Closed || d->state == Open) return; + + if (d->state != Playing) { + // Stop fading + delete d->xfader; + d->xfader = 0; + } + + d->buffer->release(); + + if (d->running) { + d->halt = true; + pthread_join(d->thread, 0); + d->running = false; + } + + d->state = Open; +} + +bool BufferedDecoder::readFrame(AudioFrame* frame) +{ + if (d->state == Closed || eof()) return false; + if (d->state == Open) start(); + + // Potentially blocking.. + if (d->buffer->get(frame, d->blocking)) { + if (d->state == XFadingSeek) { + if(!d->xfader->doFrame(frame)) { + delete d->xfader; + d->xfader = 0; + d->state = Playing; + } + } + return true; + } + else + return false; +} + +long BufferedDecoder::length() { + if (d->decoder) + return d->decoder->length(); + else + return -1; +} + +long BufferedDecoder::position() { + long pos = -1; + pos = d->seek_pos; + if (pos > 0) return pos; + if (d->buffer) { + pos = d->buffer->position(); + if (pos > 0) return pos; + } + if (d->decoder) { + pos = d->decoder->position(); + } + return pos; +} + +bool BufferedDecoder::eof() { + return d->buffer && d->buffer->eof(); +} + +bool BufferedDecoder::error() { + return d->decoder && d->decoder->error(); +} + +bool BufferedDecoder::seekable() { + if (d->decoder) + return d->decoder->seekable(); + else + return false; +} + +bool BufferedDecoder::seek(long pos) { + if (d->state == Closed) return false; + if (!d->decoder->seekable()) return false; + if (d->state == Open) { + return d->decoder->seek(pos); + } + + if (d->fading_time > 0 && !d->buffer->empty()) { + d->xfader = new CrossFader(d->fading_time*2); + fillFader(); + d->state = XFadingSeek; + } + + d->seek_pos = pos; + d->buffer->flush(); + + // we have to assume the seek will go well at this point + return true; +} + +void BufferedDecoder::pause() { + if (d->state == Closed || d->state == Open || d->state == Paused) return; + /* + if (d->state == Playing && !d->buffer->empty()) { + d->xfader = new CrossFader(d->fading_time); + fillFader(); + d->state = FadingOut; + } */ + + d->buffer->pause(); + + d->state = Paused; +} + +void BufferedDecoder::resume() { + if (d->state != Paused); + /* + if (d->state == Playing || d->state == Paused || d->state == FadingOut) { + d->xfader = new CrossFader(d->fading_time); + d->state = FadingIn; + } */ + + d->buffer->resume(); + + d->state = Playing; +} + + +void BufferedDecoder::setBufferSize(int size) { + d->buffer_size = size; + if (d->state == Open) { + delete d->buffer; + d->buffer = new AudioBuffer(d->buffer_size); + } + +} + +void BufferedDecoder::setFadingTime(int time) { + d->fading_time = time; +} + +void BufferedDecoder::setBlockingRead(bool block) { + d->blocking = block; +} + +AudioBuffer * BufferedDecoder::buffer() const { + return d->buffer; +} + +const AudioConfiguration* BufferedDecoder::audioConfiguration() { + // ### Might the buffer contain a different configuration? + if (d->decoder) + return d->decoder->audioConfiguration(); + else + return 0; +} + +void BufferedDecoder::fillFader() { + if (!d->xfader) return; + + AudioFrame frame; + while (true) // fill the crossfader with what might be in buffer + { + if (!d->buffer->get(&frame, false)) break; + if (!d->xfader->writeFrame(&frame)) break; + } +} + +} // namespace diff --git a/akode/lib/buffered_decoder.h b/akode/lib/buffered_decoder.h new file mode 100644 index 0000000..374057f --- /dev/null +++ b/akode/lib/buffered_decoder.h @@ -0,0 +1,78 @@ +/* aKode: Buffered Decoder + + Copyright (C) 2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_BUFFERED_DECODER_H +#define _AKODE_BUFFERED_DECODER_H + +#include "decoder.h" +#include "akode_export.h" + +namespace aKode { + +class AudioBuffer; +class AudioConfiguration; + +class AKODE_EXPORT BufferedDecoder : public Decoder { +public: + BufferedDecoder(); + virtual ~BufferedDecoder(); + + void openDecoder(Decoder*); + void closeDecoder(); + + void start(); + void stop(); + + void pause(); + void resume(); + + virtual bool readFrame(AudioFrame*); + virtual bool seek(long pos); + + virtual long length(); + virtual long position(); + virtual bool seekable(); + + virtual bool eof(); + virtual bool error(); + + void setBlockingRead(bool block); + + void setBufferSize(int size); + void setFadingTime(int time); + +// void setFadeInSeek(bool fade); +// void setFadeToStop(bool fade); + + AudioBuffer* buffer() const; + + virtual const AudioConfiguration* audioConfiguration(); + + struct private_data; +private: + private_data *d; + +protected: + void fillFader(); +}; + +} // namespace + +#endif diff --git a/akode/lib/bytebuffer.cpp b/akode/lib/bytebuffer.cpp new file mode 100644 index 0000000..84b2914 --- /dev/null +++ b/akode/lib/bytebuffer.cpp @@ -0,0 +1,168 @@ +/* aKode: ByteBuffer + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include <string.h> + +#include "bytebuffer.h" + +namespace aKode { + +ByteBuffer::ByteBuffer(unsigned int len) + : length(len) + , readPos(0) + , writePos(0) + , flushed(false) + , released(false) + , closed(false) +{ + pthread_cond_init(¬_empty, 0); + pthread_cond_init(¬_full, 0); + pthread_mutex_init(&mutex, 0); + buffer = new char[length]; +} + +ByteBuffer::~ByteBuffer() { + delete[] buffer; +} + +int ByteBuffer::write(char* buf, unsigned int len, bool blocking) +{ + pthread_mutex_lock(&mutex); + if (released) len = 0; + + flushed = closed = false; + while (space() < len) { + if (blocking) { + pthread_cond_wait(¬_full, &mutex); + if (flushed || released) len = 0; + } + else + len = space(); + } + + unsigned int base = len, rem = 0; + if (writePos+len > length) { + base = length-writePos; + rem = len-base; + } + + memcpy(buffer+writePos, buf, base); + memcpy(buffer, buf+base, rem); + + writePos = (writePos+len) % length; + + pthread_cond_signal(¬_empty); + pthread_mutex_unlock(&mutex); + return len; +} + +int ByteBuffer::read(char* buf, unsigned int len, bool blocking) +{ + pthread_mutex_lock(&mutex); + if (released) len = 0; + if (closed) blocking = false; + + while (content() < len) { + if (blocking) { + pthread_cond_wait(¬_empty, &mutex); + if (released) + len = 0; + else if (closed) + len = content(); + } + else + len = content(); + } + + unsigned int base = len, rem = 0; + if (readPos+len > length) { + base = length-readPos; + rem = len-base; + } + + memcpy(buf, buffer+readPos, base); + memcpy(buf+base, buffer, rem); + + readPos = (readPos+len) % length; + + pthread_cond_signal(¬_full); + pthread_mutex_unlock(&mutex); + return len; +} + +void ByteBuffer::close() { + pthread_mutex_lock(&mutex); + closed = true; + pthread_cond_signal(¬_empty); + pthread_mutex_unlock(&mutex); +} + + +bool ByteBuffer::eof() { + return empty() && closed; +} + +bool ByteBuffer::empty() { + return (readPos == writePos); +} + +bool ByteBuffer::full() { + return (readPos == (writePos+1) % length); +} + +unsigned int ByteBuffer::content() { + unsigned int cn; + if (readPos <= writePos) + cn=writePos-readPos; + else + cn=writePos+length-readPos; + return cn; +} + +unsigned int ByteBuffer::space() { + unsigned int sp = length - content() - 1; + return sp; +} + +void ByteBuffer::reset() { + // We assume all processes have been released at this point + readPos = writePos = 0; + flushed = released = closed = false; +} + +void ByteBuffer::flush() { + pthread_mutex_lock(&mutex); + readPos = writePos = 0; + flushed = true; + pthread_cond_signal(¬_full); + pthread_mutex_unlock(&mutex); +} + +void ByteBuffer::release() { + pthread_mutex_lock(&mutex); + released = true; + pthread_cond_signal(¬_empty); + pthread_cond_signal(¬_full); + pthread_mutex_unlock(&mutex); +} + +} // namespace + diff --git a/akode/lib/bytebuffer.h b/akode/lib/bytebuffer.h new file mode 100644 index 0000000..c737380 --- /dev/null +++ b/akode/lib/bytebuffer.h @@ -0,0 +1,111 @@ +/* aKode: ByteBuffer + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_BYTEBUFFER_H +#define _AKODE_BYTEBUFFER_H + +#include <pthread.h> + +#include "akode_export.h" + +namespace aKode { + +//! A reentrant circular buffer of bytes + +/*! + * A buffer of bytes to synchronize I/O between two threads, one reading and one writing. + */ +class AKODE_EXPORT ByteBuffer { + const unsigned int length; + char* buffer; + volatile unsigned int readPos; + volatile unsigned int writePos; + pthread_cond_t not_empty; + pthread_cond_t not_full; + pthread_mutex_t mutex; + volatile bool flushed, released, closed; +public: + /*! + * Constructs a buffer with \a len bytes. + */ + ByteBuffer(unsigned int len); + ~ByteBuffer(); + + /*! + * Write \a len bytes from \a buf into the buffer. If blocking is set to true, + * write will block until all bytes have been writen or release() or flush() + * is called. + * Returns the number of bytes writen. + */ + int write(char* buf, unsigned int len, bool blocking = false); + /*! + * Read \a len bytes from the buffer into \a buf. If blocking is set to true, + * read will block until \a len bytes have been read or release() + * is called. + * Returns the number of bytes read. + */ + int read(char* buf, unsigned int len, bool blocking = false); + + /*! + * Called by the writing thread to denote EOF + */ + void close(); + + /*! + * Returns true if the stream is empty and closed + */ + bool eof(); + + /*! + * Returns true if the buffer is empty + */ + bool empty(); + /*! + * Returns true if the buffer is full + */ + bool full(); + + /*! + * Returns the number of bytes that can be read without blocking + */ + unsigned int content(); + /*! + * Returns the number of bytes that can be writen without blocking + */ + unsigned int space(); + + /*! + * Flushes the buffer and releases any blocking write-calls. + */ + void flush() ; + /*! + * Releases all blocking threads and prepares the buffer for deletion. + * Use reset to make the buffer usable again. + */ + void release(); + /*! + * Resets the buffer to be as good as new. Assumes all threads are released. + */ + void reset(); +}; + +} // namespace + +#endif diff --git a/akode/lib/converter.cpp b/akode/lib/converter.cpp new file mode 100644 index 0000000..2169868 --- /dev/null +++ b/akode/lib/converter.cpp @@ -0,0 +1,148 @@ +/* aKode: Converter + + Copyright (C) 2005,2006 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "arithmetic.h" +#include "audioframe.h" +#include "converter.h" + +namespace aKode { + +Converter::Converter(int sample_width) : m_sample_width(sample_width) {} + +template<typename T, typename S, template<typename T> class ArithmT, template<typename S> class ArithmS> +static bool __doFrameFP(AudioFrame* in, AudioFrame* out, int sample_width) +{ + AudioConfiguration config = *in; + config.sample_width = sample_width; + + if (out) + out->reserveSpace(&config, in->length); + else + out = in; + + // ### Use doubles if double sized or 32bit samples are used. + float scale = 1.0; + scale = ArithmS<S>::max(sample_width)/(float)ArithmT<T>::max(in->sample_width); + + int channels = in->channels; + int length = in->length; + + T** indata = (T**)in->data; + S** outdata = (S**)out->data; + for(int i=0; i<channels; i++) + for(int j=0; j<length; j++) + outdata[i][j] = (S)(scale*indata[i][j]); + + return true; +} + +template<typename T, typename S> +static bool __doFrame(AudioFrame* in, AudioFrame* out, int sample_width) +{ + AudioConfiguration config = *in; + config.sample_width = sample_width; + + if (out) + out->reserveSpace(&config, in->length); + else + out = in; + + int width_T = sizeof(T)*8; + int shift = width_T - sample_width; + + int channels = in->channels; + uint32_t length = in->length; + + T** indata = (T**)in->data; + S** outdata = (S**)out->data; + for(int i=0; i<channels; i++) + for(uint32_t j=0; j<length; j++) + outdata[i][j] = (S)(indata[i][j] >> shift); + + out->sample_width = sample_width; + return true; +} + +template<typename T> +static inline bool _doFrameFP(AudioFrame* in, AudioFrame* out, int sample_width) +{ + if (in->sample_width == -64) { + return __doFrameFP<double, T, Arithm_FP, Arithm_FP>(in, out, sample_width); + } else + if (in->sample_width == -32) { + return __doFrameFP<float, T, Arithm_FP, Arithm_FP>(in, out, sample_width); + } else + if (in->sample_width <= 8) { + return __doFrameFP<int8_t, T, Arithm_Int, Arithm_FP>(in, out, sample_width); + } else + if (in->sample_width <= 16) { + return __doFrameFP<int16_t, T, Arithm_Int, Arithm_FP>(in, out, sample_width); + } else + return __doFrameFP<int32_t, T, Arithm_Int, Arithm_FP>(in, out, sample_width); + +} + +template<typename T> +static inline bool _doFrame(AudioFrame* in, AudioFrame* out, int sample_width) +{ + if (in->sample_width == -64) { + return __doFrameFP<double, T, Arithm_FP, Arithm_Int>(in, out, sample_width); + } else + if (in->sample_width == -32) { + return __doFrameFP<float, T, Arithm_FP, Arithm_Int>(in, out, sample_width); + } else + if (in->sample_width <= 8) { + return __doFrame<int8_t, T>(in, out, sample_width); + } else + if (in->sample_width <= 16) { + return __doFrame<int16_t, T>(in, out, sample_width); + } else + return __doFrame<int32_t, T>(in, out, sample_width); +} + +bool Converter::doFrame(AudioFrame* in, AudioFrame* out) +{ + if (m_sample_width == 0) return false; + if (!out && in->sample_width == m_sample_width) return true; + + if (m_sample_width < 0) { + if (m_sample_width == -64) + return _doFrameFP<double>(in, out, m_sample_width); + else + return _doFrameFP<float>(in, out, m_sample_width); + } else + if (m_sample_width <= 8) { + return _doFrame<int8_t>(in, out, m_sample_width); + } else + if (m_sample_width <= 16) { + return _doFrame<int16_t>(in, out, m_sample_width); + } else + return _doFrame<int32_t>(in, out, m_sample_width); + + return false; +} + +void Converter::setSampleWidth(int sample_width) +{ + m_sample_width = sample_width; +} + + +} // namespace diff --git a/akode/lib/converter.h b/akode/lib/converter.h new file mode 100644 index 0000000..31e95bd --- /dev/null +++ b/akode/lib/converter.h @@ -0,0 +1,39 @@ +/* aKode: Converter + + Copyright (C) 2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef _AKODE_CONVERTER_H +#define _AKODE_CONVERTER_H + +#include "akode_export.h" + +namespace aKode { + +class AudioFrame; + +class AKODE_EXPORT Converter { + int m_sample_width; +public: + Converter(int sample_width = 0); + bool doFrame(AudioFrame* in, AudioFrame* out=0); + void setSampleWidth(int sample_width); +}; + +} // namespace + +#endif diff --git a/akode/lib/crossfader.cpp b/akode/lib/crossfader.cpp new file mode 100644 index 0000000..8e5b970 --- /dev/null +++ b/akode/lib/crossfader.cpp @@ -0,0 +1,195 @@ +/* aKode Cross-fader + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "audioframe.h" +#include "arithmetic.h" +#include "crossfader.h" + +namespace aKode { + +CrossFader::CrossFader(unsigned int time) : time(time),pos(0) {} + +// T is the input/output type, S is the fast arithmetics type, Div is a division method +template<typename T, typename S, template<typename S> class Arithm> +static bool _doFrame(AudioFrame* in, int& pos, AudioFrame* frame) +{ + T** indata1 = (T**)in->data; + T** indata2 = (T**)frame->data; + //T** outdata = (T**)in->data; + + long length; + long max = frame->length; + if (pos >= max) return false; + if (in->channels != frame->channels) return false; + if (in->sample_width != frame->sample_width) return false; + + if (in->length > max-pos) + length = in->length = max-pos; + else + length = in->length; + + S orgw; // weight of original + S neww; // weight of new + for(int j=0; j<length && pos<max; j++,pos++) { + neww = pos; + orgw = max-pos; + + for(int i=0; i<in->channels; i++) { + S signal = 0; + S remainder = 0; + signal += Arithm<S>::div(indata1[i][j],max)*neww; + remainder += Arithm<S>::rem(indata1[i][j],max)*neww; + signal += Arithm<S>::div(indata2[i][pos],max)*orgw; + remainder += Arithm<S>::rem(indata2[i][pos],max)*orgw; + + indata1[i][j] = (T)(signal+Arithm<S>::div(remainder,max)); + } + } + return true; +} + +// T is the input/output type, S is the fast arithmetics type, Arithm defines devisions +template<typename T, typename S, template<typename S> class Arithm> +static bool _readFrame(AudioFrame* in, int& pos, AudioFrame* frame) +{ + T** indata = (T**)frame->data; + T** outdata = (T**)in->data; + + S length; + S max = frame->length; + if (max-pos <= 1024) + length = max-pos; + else + length = 1024; + + if (pos >= max) return false; + in->reserveSpace(frame, (long)length); + + S weight; + for(int j=0; j<length && pos<max; j++,pos++) { + weight = (max-pos); + + for(int i=0; i<in->channels; i++) { + S signal = Arithm<S>::div(indata[i][pos],max)*weight; + S remainder = Arithm<S>::rem(indata[i][pos],max)*weight; + + outdata[i][j] = (T)(signal+Arithm<S>::div(remainder,max)); + } + } + return true; +} + +template<typename T> +static void _writeFrame(AudioFrame* in, AudioFrame* source) +{ + T** indata = (T**)in->data; + T** outdata = (T**)source->data; + + int tpos = source->length; + for (int i=0; i<in->channels; i++) { + tpos = source->length; + for(int j = 0; j<in->length && tpos < source->max; j++,tpos++) + { + outdata[i][tpos] = indata[i][j]; + } + } + source->length = tpos; +} + +// This codes abuses the internal working of AudioFrame, and will need an +// update if AudioFrame is changed. +bool CrossFader::writeFrame(AudioFrame* in) +{ + if (source.max==0) { + long length = (in->sample_rate*time)/1000; + source.reserveSpace(in, length); + source.length = 0; + } + if (source.length >= source.max) return false; + if (in->sample_width < -32) { + _writeFrame<double>(in, &source); + } else + if (in->sample_width < 0) { + _writeFrame<float>(in, &source); + } else + if (in->sample_width <= 8) { + _writeFrame<int8_t>(in, &source); + } else + if (in->sample_width <= 16) { + _writeFrame<int16_t>(in, &source); + } else + _writeFrame<int32_t>(in, &source); + return true; +} + +bool CrossFader::doFrame(AudioFrame* in) +{ + if (in->sample_width < -32) { + return _doFrame<double, double, Arithm_FP>(in, pos, &source); + } else + if (in->sample_width < 0) { + return _doFrame<float, float, Arithm_FP>(in, pos, &source); + } else + if (in->sample_width <= 8) { + return _doFrame<int8_t, int32_t, Arithm_Int>(in, pos, &source); + } else + if (in->sample_width <= 16) { + return _doFrame<int16_t, int32_t, Arithm_Int>(in, pos, &source); + } else + if (in->sample_width <= 24) { + return _doFrame<int32_t, int32_t, Arithm_Int>(in, pos, &source); + } else + return _doFrame<int32_t, int64_t, Arithm_Int>(in, pos, &source); +} + +bool CrossFader::readFrame(AudioFrame* in) +{ + if (in->sample_width < -32) { + return _readFrame<double, double, Arithm_FP>(in, pos, &source); + } else + if (in->sample_width < 0) { + return _readFrame<float, float, Arithm_FP>(in, pos, &source); + } else + if (in->sample_width <= 8) { + return _readFrame<int8_t, int32_t, Arithm_Int>(in, pos, &source); + } else + if (in->sample_width <= 16) { + return _readFrame<int16_t, int32_t, Arithm_Int>(in, pos, &source); + } else + if (in->sample_width <= 24) { + return _readFrame<int32_t, int32_t, Arithm_Int>(in, pos, &source); + } else + return _readFrame<int32_t, int64_t, Arithm_Int>(in, pos, &source); +} + +void CrossFader::setLength(unsigned int new_time) { + time = new_time; +} + +bool CrossFader::full() { + return source.max <= source.length; +} + +bool CrossFader::done() { + return source.max > 0 && pos >= source.length; +} + + +} // namespace diff --git a/akode/lib/crossfader.h b/akode/lib/crossfader.h new file mode 100644 index 0000000..ddcb796 --- /dev/null +++ b/akode/lib/crossfader.h @@ -0,0 +1,44 @@ +/* aKode: Cross-fader + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef _AKODE_CROSSFADER_H +#define _AKODE_CROSSFADER_H + +namespace aKode { + +class AudioFrame; + +class CrossFader { + int time; + int pos; + AudioFrame source; +public: + // Set number of milliseconds the crosslap should last + CrossFader(unsigned int time = 100); + bool writeFrame(AudioFrame* frame); + bool doFrame(AudioFrame* frame); + bool readFrame(AudioFrame* frame); + void setLength(unsigned int time); + bool full(); + bool done(); +}; + +} // namespace + +#endif diff --git a/akode/lib/decoder.h b/akode/lib/decoder.h new file mode 100644 index 0000000..a32049d --- /dev/null +++ b/akode/lib/decoder.h @@ -0,0 +1,135 @@ +/* aKode: Decoder abstract-type + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_DECODER_H +#define _AKODE_DECODER_H + +#include "pluginhandler.h" +#include "akode_export.h" + +namespace aKode { + +class AudioConfiguration; +class File; +class AudioFrame; + +//! A generic interface for all decoders + +/*! + * The Decoder works by decoding one audio-frame at a time. It is up to + * the decoder itself to decide how large a frame is. + */ +class AKODE_EXPORT Decoder { +public: + virtual ~Decoder() {}; + /*! + * Reads one frame from the decoder. + * It is advisable to reuse the the same frame for every readFrame()-call, + * as the frame size is likely to be constant in the same file, + * which saves re-allocations. + * + * If readFrame returns false, it can be one of three things: + * 1. End-of-File (check eof()). + * 2. Fatal error (check error()). + * 3. Recoverable error (call readFrame again) + */ + virtual bool readFrame(AudioFrame*) = 0; + /*! + * Returns the length of the file/stream in milliseconds. + * Returns -1 if the length is unknown. + */ + virtual long length() = 0; + /*! + * Returns the current position in file/stream in milliseconds. + * Returns -1 if the position is unknown. + */ + virtual long position() = 0; + /*! + * Attempts a seek to \a pos milliseconds into the file/stream. + * Returns true if succesfull. + */ + virtual bool seek(long pos) = 0; + /*! + * Returns true if the decoder is seekable + */ + virtual bool seekable() = 0; + /*! + * Returns true if the decoder has reached the end-of-file/stream + */ + virtual bool eof() = 0; + /*! + * Returns true if the decoder has encountered a non-recoverable error + */ + virtual bool error() = 0; + /*! + * Returns the configuration of the decoded stream. + * Returns 0 if unknown. + */ + virtual const AudioConfiguration* audioConfiguration() = 0; +}; + +/*! + * Parent class for decoder plugins + */ +class DecoderPlugin { +public: + /*! + * Asks the plugin to open a Decoder, returns 0 if the + * plugin could not. + */ + virtual Decoder* openDecoder(File *) { return 0; }; + /*! + * Old version version of openDecoder. + * \deprecated + */ + Decoder* openFrameDecoder(File *src) { return openDecoder(src); }; +}; + +/*! + * Handler for decoder-plugins. + */ +class AKODE_EXPORT DecoderPluginHandler : public PluginHandler, public DecoderPlugin { +public: + static list<string> listDecoderPlugins(); + + DecoderPluginHandler() : decoder_plugin(0) {}; + DecoderPluginHandler(const string name); + /*! + * Open a Decoder for the File \a src. Returns 0 if unsuccesfull + */ + Decoder* openDecoder(File *src); + /*! + * Old version version of openDecoder. + * \deprecated + */ + Decoder* openFrameDecoder(File *src) { return openDecoder(src); }; + /*! + * Loads a decoder-plugin named \a name (xiph, mpc, mpeg..) + */ + virtual bool load(const string name); + virtual void unload(); + bool isLoaded() { return decoder_plugin != 0; }; +protected: + DecoderPlugin* decoder_plugin; +}; + +} // namespace + +#endif diff --git a/akode/lib/decoderpluginhandler.cpp b/akode/lib/decoderpluginhandler.cpp new file mode 100644 index 0000000..d5dba2e --- /dev/null +++ b/akode/lib/decoderpluginhandler.cpp @@ -0,0 +1,71 @@ +/* aKode: DecoderPluginHandler + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "akodelib.h" +#include "decoder.h" +#include "wav_decoder.h" + +namespace aKode { + +list<string> DecoderPluginHandler::listDecoderPlugins() { + const list<string> plugin_list = PluginHandler::listPlugins(); + list<string> decoder_list; + for (list<string>::const_iterator i = plugin_list.begin(); i != plugin_list.end(); i++) + if (i->length() > 8 && i->substr(i->length()-8,8) == "_decoder") + decoder_list.push_back(i->substr(0,i->length()-8)); + return decoder_list; +} + +DecoderPluginHandler::DecoderPluginHandler(const string lib) : decoder_plugin(0) +{ + if (lib.size() > 0) + load(lib); +} + +bool DecoderPluginHandler::load(const string name) +{ + if (library_loaded) return false; + + bool res = PluginHandler::load(name+"_decoder"); + if (res) + decoder_plugin = (DecoderPlugin*)loadPlugin(name+"_decoder"); + else + if (name == "wav") { + decoder_plugin = &wav_decoder; + res = true; + } else + return false; + + return res; +} + +void DecoderPluginHandler::unload() { + decoder_plugin = 0; + PluginHandler::unload(); +} + +Decoder* DecoderPluginHandler::openDecoder(File *src) { + if (decoder_plugin) + return decoder_plugin->openDecoder(src); + else + return 0; +} + +} //namespace diff --git a/akode/lib/encoder.h b/akode/lib/encoder.h new file mode 100644 index 0000000..b416b3d --- /dev/null +++ b/akode/lib/encoder.h @@ -0,0 +1,82 @@ +/* aKode: Encoder abstract-type + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_ENCODER_H +#define _AKODE_ENCODER_H + +#include "pluginhandler.h" +#include "sink.h" + +namespace aKode { + +class File; + +//! A generic interface for all encoders + +/*! + * Encoders are specialized sinks that can write to files. Be aware that encoders in aKode 1.0 + * cannot handle tags. So the files should be tagged with TagLib after encoding. + */ +class Encoder : public Sink { +public: + /*! + * Returns the current position in file/stream in milliseconds. + * Notice that this position is not the necessarely the same as the + * the one in the incoming stream. + * Returns -1 if the position is unknown. + */ + virtual long position() = 0; + /*! + * Returns true if the encoder has encountered a non-recoverable error + */ + virtual bool error() = 0; +}; + +/*! + * Parent class for encoder plugins + */ +class EncoderPlugin { +public: + /*! + * Asks the plugin to open a Encoder that writes to the file \a dst + */ + virtual Encoder* openEncoder(File *dst) = 0; +}; + +/*! + * Handler for encoder-plugins. + */ +class EncoderPluginHandler : public PluginHandler, public EncoderPlugin { +public: + EncoderPluginHandler() : encoder_plugin(0) {}; + EncoderPluginHandler(const string name); + Encoder* openEncoder(File *dst); + /*! + * Loads a encoder-plugin by the \a name (flac, vorbis, lame..) + */ + virtual bool load(const string name); + bool isLoaded() { return encoder_plugin != 0; }; +protected: + EncoderPlugin* encoder_plugin; +}; + +} // namespace + +#endif diff --git a/akode/lib/encoderpluginhandler.cpp b/akode/lib/encoderpluginhandler.cpp new file mode 100644 index 0000000..247d1aa --- /dev/null +++ b/akode/lib/encoderpluginhandler.cpp @@ -0,0 +1,50 @@ +/* aKode: EncopderPluginHandler + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "akodelib.h" +#include "encoder.h" + +namespace aKode { + +EncoderPluginHandler::EncoderPluginHandler(const string lib) : encoder_plugin(0) +{ + if (lib.size() > 0) + load(lib); +} + + +bool EncoderPluginHandler::load(const string name) +{ + bool res = PluginHandler::load(name+"_encoder"); + if (res) + encoder_plugin = (EncoderPlugin*)loadPlugin(name+"_encoder"); + + return res && encoder_plugin; +} + +Encoder* EncoderPluginHandler::openEncoder(File *dest) +{ + if (encoder_plugin) + return encoder_plugin->openEncoder(dest); + else + return 0; +} + +} //namespace diff --git a/akode/lib/fast_resampler.cpp b/akode/lib/fast_resampler.cpp new file mode 100644 index 0000000..e666e15 --- /dev/null +++ b/akode/lib/fast_resampler.cpp @@ -0,0 +1,156 @@ +/* aKode Resampler (fast) + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "audioframe.h" +#include "arithmetic.h" +#include "fast_resampler.h" + +#define FR_FIDELITY (1<<10) + +namespace aKode { + +FastResampler* FastResamplerPlugin::openResampler() { + return new FastResampler(); +} + +extern "C" { FastResamplerPlugin fast_resampler; } + +FastResampler::FastResampler() : speed(1.0), sample_rate(44100) {} + +// A fast resampling by linear interpolation +// I assume you know binary arithmetics and convertions if you're reading this +// T is the input/output type, Arithm defines the used arithmetic +template<typename T, typename S, template<typename S> class Arithm> +static bool _doBuffer(AudioFrame* in, AudioFrame* out, float speed, unsigned sample_rate) +{ + unsigned long vt_pos_start = 0; // virtual positions of new sample + unsigned long vt_pos_end;; + unsigned long real_pos_start, real_pos_end; + long start_fraction, end_fraction; + + unsigned long vt_end = in->length * 1024 -1; + + int int_speed; + unsigned long out_length; + { + float resample_speed = in->sample_rate/(float)sample_rate; + resample_speed *= speed; + int_speed = (unsigned int)(resample_speed*1024.0+0.5); + + out_length = (in->length/int_speed)*1024; + unsigned long out_rem = (in->length%int_speed)*1024 + (int_speed-1); + out_length += out_rem/int_speed; + + out->reserveSpace(in, out_length); + out->sample_rate = sample_rate; + } + vt_pos_end = int_speed; + + unsigned char channels = in->channels; // take copy to reduce alias-induced reads + unsigned long out_pos = 0; + + T** indata = (T**)in->data; // templating ;) + T** outdata = (T**)out->data; + + S sspeed = (S)int_speed; + S smax = Arithm<S>::max(in->sample_width); + + while(out_pos < out_length && vt_pos_start < vt_end) { + real_pos_start = vt_pos_start / 1024; start_fraction = vt_pos_start % 1024; + real_pos_end = vt_pos_end / 1024; end_fraction = vt_pos_end % 1024; + + if (real_pos_start == real_pos_end) { + for(int i=0; i<channels; i++) { + outdata[i][out_pos] = indata[i][real_pos_start]; + } + } else { + for(int i=0; i<channels; i++) { + S signal = 0; + S remainder = 0; + S temp; + + // add fraction from starting sample + temp = (S)indata[i][real_pos_start]; + signal += Arithm<S>::div(temp,sspeed) * (1024L-start_fraction); + remainder += Arithm<S>::rem(temp,sspeed) * (1024L-start_fraction); + + // add fraction from end sample + temp= (S)indata[i][real_pos_end]; + signal += Arithm<S>::div(temp,sspeed) * (end_fraction); + remainder += Arithm<S>::rem(temp,sspeed) * (end_fraction); + + // add all intermediate samples + for(unsigned long j = real_pos_start+1; j<real_pos_end; j++) { + temp= (S)indata[i][j]; + signal += Arithm<S>::div(temp,sspeed) * 1024L; + remainder += Arithm<S>::rem(temp,sspeed) * 1024L; + } + + // add accummulated remainder + signal += Arithm<S>::div(remainder,sspeed); + + // clip to maximum, just to be safe + if (signal > smax) signal = smax; + else + if (signal < -smax) signal = -smax; + + outdata[i][out_pos] = (T)signal; + } + } + out_pos++; + vt_pos_start = vt_pos_end; + vt_pos_end += int_speed; + if (vt_pos_end > vt_end) vt_pos_end = vt_end; + } + return true; +} + +bool FastResampler::doFrame(AudioFrame* in, AudioFrame* out) +{ + if (speed == 1.0 && in->sample_rate == sample_rate) { + swapFrames(out, in); + return true; + } + if (in->sample_width < 0) { + return _doBuffer<float, float, Arithm_FP>(in, out, speed, sample_rate); + } else + if (in->sample_width <= 8) { + return _doBuffer<int8_t, int32_t, Arithm_Int>(in, out, speed, sample_rate); + } else + if (in->sample_width <= 16) { + return _doBuffer<int16_t, int32_t, Arithm_Int>(in, out, speed, sample_rate); + } else + if (in->sample_width <= 24) { + return _doBuffer<int32_t, int32_t, Arithm_Int>(in, out, speed, sample_rate); + } else + return _doBuffer<int32_t, int64_t, Arithm_Int>(in, out, speed, sample_rate); +} + +void FastResampler::setSpeed(float _speed) +{ + speed = _speed; +} + +void FastResampler::setSampleRate(unsigned int rate) +{ + sample_rate = rate; +} + +} // namespace diff --git a/akode/lib/fast_resampler.h b/akode/lib/fast_resampler.h new file mode 100644 index 0000000..3c28f47 --- /dev/null +++ b/akode/lib/fast_resampler.h @@ -0,0 +1,60 @@ +/* aKode: Resampler (fast) + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef _AKODE_FAST_RESAMPLER_H +#define _AKODE_FAST_RESAMPLER_H + +#include "resampler.h" + +namespace aKode { + +class AudioFrame; + +//! Fast low quality resampler using linear interpolation + +/*! + * This is the default resampler, which excels over the SRCResampler + * in being LGPL, fast and integer only, but the result is more + * noisy. + * + * The quality of resampling most relevant to low signal samples. + * For samples of 44100Hz/16bit or more, it is mostly irrelevant. + */ + +class FastResampler : public Resampler { +public: + FastResampler(); + bool doFrame(AudioFrame* in, AudioFrame* out); + void setSampleRate(unsigned int rate); + void setSpeed(float speed); + + float speed; + unsigned int sample_rate; +}; + +class FastResamplerPlugin : public ResamplerPlugin { +public: + virtual FastResampler* openResampler(); +}; + +extern "C" FastResamplerPlugin fast_resampler; + +} // namespace + +#endif diff --git a/akode/lib/file.h b/akode/lib/file.h new file mode 100644 index 0000000..11a4fef --- /dev/null +++ b/akode/lib/file.h @@ -0,0 +1,121 @@ +/* aKode: File abstract-type + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_FILE_H +#define _AKODE_FILE_H + +extern "C" { +#include <sys/types.h> +#include <unistd.h> +} + +namespace aKode { + +//! The generic interface to aKode's virtualised files + +/*! + * An interface with the all the needed file/stream-operations + * the library needs. + */ +class File { +public: + /*! + * Creates a File with the given \a filename. + */ + File(const char* filename) : filename(filename) {}; + virtual ~File() {}; + /*! + * Opens the file as read-only. + * Returns whether the operation was succesfull. + */ + virtual bool openRO() { return false; }; + /*! + * Opens the file as read and write. + * Returns whether the operation was succesfull. + */ + virtual bool openRW() { return false; }; + /*! + * Open the file as write-only. + * Returns whether the operation was succesfull. + */ + virtual bool openWO() { return false; }; + /*! + * Closes the file. + */ + virtual void close() = 0; + /*! + * Reads \a num bytes from the file and places the data in \a ptr. + * Returns number of read characters. Returns 0 if end-of-file. + * Returns negative at errors. + */ + virtual long read(char* ptr, long num) = 0; + /*! + * Writes \a num bytes from \a ptr to the file. + * Returns number of writen characters. + * Returns negative at errors. + */ + virtual long write(const char* ptr, long num) = 0; + /*! + * Seeks to the position. + * Behaves semantically as lseek. + */ + virtual bool seek(long to, int whence = SEEK_SET) = 0; + /*! + * Returns current position in file, or negative if unknown. + */ + virtual long position() const = 0; + /*! + * Returns length of file, or negative if unknown. + */ + virtual long length() const = 0; + /*! + * Returns true if the file is seekable + */ + virtual bool seekable() const = 0; + /*! + * Returns true if the file is readable + */ + virtual bool readable() const = 0; + /*! + * Returns true if the file is writeable + */ + virtual bool writeable() const = 0; + /*! + * Returns whether the file has reached end-of-file. + */ + virtual bool eof() const = 0; + /*! + * Returns true if the file has entered a non-recoverable error-state + */ + virtual bool error() const = 0; + /*! + * Advises the OS (if possible), that the file will be read + * sequentially from the current position and forward. + */ + virtual void fadvise() = 0; + /*! + * The name of the file. + */ + const char *filename; +}; + +} //namespace + +#endif diff --git a/akode/lib/framedecoder.h b/akode/lib/framedecoder.h new file mode 100644 index 0000000..115784e --- /dev/null +++ b/akode/lib/framedecoder.h @@ -0,0 +1,14 @@ +#ifndef _AKODE_FRAMEDECODER_H +#define _AKODE_FRAMEDECODER_H + +#include "decoder.h" + +namespace aKode { +/* + class FrameDecoder : public Decoder + { + };*/ + typedef Decoder FrameDecoder; +} + +#endif diff --git a/akode/lib/localfile.cpp b/akode/lib/localfile.cpp new file mode 100644 index 0000000..ff92760 --- /dev/null +++ b/akode/lib/localfile.cpp @@ -0,0 +1,157 @@ +/* aKode: LocalFile + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "akodelib.h" + +extern "C" { + #ifdef HAVE_FEATURES_H + // Needed for older glibc versions. + #include <features.h> + #ifndef __USE_XOPEN2K + #define __USE_XOPEN2K + #endif + #endif + + #include <unistd.h> + #ifdef HAVE_SYS_TYPES_H + #include <sys/types.h> + #endif + #include <sys/stat.h> + #include <fcntl.h> +} + +#include "localfile.h" + +namespace aKode { + +LocalFile::LocalFile(const char* filename) : File(filename) + , _fd(-1), pos(0), len(0) + , m_readable(false), m_writeable(false) + , m_eof(false) + {} + +LocalFile::~LocalFile() { + close(); +} + +bool LocalFile::openRO() { + if(_fd != -1) { + return seek(0) && m_readable; + } + + struct stat stat; + _fd = ::open(filename, O_RDONLY); + if (fstat(_fd, &stat) < 0) return false; + len = stat.st_size; + + m_readable = true; + m_writeable = false; + m_eof = false; + return ( _fd != -1 ); +} + +bool LocalFile::openRW() { + if(_fd != -1) { + return seek(0) && m_readable && m_writeable; + } + + struct stat stat; + _fd = ::open(filename, O_RDWR); + if (fstat(_fd, &stat) < 0) return false; + len = stat.st_size; + + m_readable = true; + m_writeable = true; + return ( _fd != -1 ); +} + +bool LocalFile::openWO() { + if(_fd != -1) { + return seek(0) && m_writeable; + } + + _fd = ::open(filename, O_WRONLY); + + m_readable = false; + m_writeable = true; + return ( _fd != -1 ); +} + +void LocalFile::close() { + if(_fd != -1) ::close(_fd); + _fd = -1; +} + +long LocalFile::read(char* ptr, long num) { + if(_fd == -1 || !m_readable) return -1; + long n = ::read(_fd, ptr, num); + pos += n; + m_eof = (n == 0 && num != 0); + return n; +} + +long LocalFile::write(const char* ptr, long num) { + if(_fd == -1 || !m_writeable) return -1; + long n = ::write(_fd, ptr, num); + pos += n; + if (pos > len) len = pos; + return n; +} + +bool LocalFile::seek(long to, int whence) { + if(_fd == -1) return false; + int s = ::lseek(_fd, to, whence); + if (s >= 0) pos = s; + return (s >= 0); +} + +long LocalFile::position() const { + if(_fd == -1) return -1; + return pos; +} + +long LocalFile::length() const { + if(_fd == -1) return -1; + return len; +} + +bool LocalFile::eof() const { + if(_fd == -1) return true; + return m_eof || (pos >= len); +} + +bool LocalFile::error() const { + return (_fd == -1); +} + +int LocalFile::fd() const { + return _fd; +} + +void LocalFile::fadvise() { + if(_fd == -1) return; + #if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_SEQUENTIAL) + posix_fadvise(_fd, pos, len-pos, POSIX_FADV_SEQUENTIAL); + #elif defined(HAVE_FADVISE) && defined(FADV_SEQUENTIAL) + fadvise(_fd, pos, len-pos, FADV_SEQUENTIAL); + #endif +} + +} // namespace diff --git a/akode/lib/localfile.h b/akode/lib/localfile.h new file mode 100644 index 0000000..7f7c2c2 --- /dev/null +++ b/akode/lib/localfile.h @@ -0,0 +1,71 @@ +/* aKode: LocalFile-type + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_LOCALFILE_H +#define _AKODE_LOCALFILE_H + +#include "file.h" +#include "akode_export.h" +namespace aKode { + +//! An implementation of the File interface for local-file access + +/*! + * LocalFile uses the ordinary system-interfaces for file-access, and is + * thus capable of both reading, writing and seeking. + */ +class AKODE_EXPORT LocalFile : public File { + int _fd; + long pos; + long len; + bool m_readable; + bool m_writeable; + bool m_eof; +public: + LocalFile(const char* filename); + virtual ~LocalFile(); + + bool openRO(); + bool openRW(); + bool openWO(); + void close(); + + long read(char* ptr, long num); + long write(const char* ptr, long num); + + bool seek(long to, int whence = SEEK_SET); + long position() const; + long length() const; + + bool seekable() const { return true; }; + bool readable() const { return m_readable; }; + bool writeable() const { return m_writeable; }; + + bool error() const; + bool eof() const; + + void fadvise(); + + int fd() const; +}; + +} //namespace + +#endif diff --git a/akode/lib/magic.cpp b/akode/lib/magic.cpp new file mode 100644 index 0000000..072f3bf --- /dev/null +++ b/akode/lib/magic.cpp @@ -0,0 +1,201 @@ +/* aKode: Magic + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "akodelib.h" +#include "magic.h" +#include "file.h" +#include <iostream> +using std::cerr; + +namespace aKode { + namespace Magic { + + static int detectID3v2(File *src) + { + char header[6]; + unsigned char *buf = (unsigned char*)header; + if(src->read(header, 4)) { + // skip id3v2 headers + if (memcmp(header, "ID3", 3) == 0) { + src->read(header, 6); + int size = 10; + if (buf[1] & 0x10) size += 10; + if (buf[5] > 127 || buf[4] > 127 || buf[3] > 127 || buf[2] > 127) + { + size += buf[5]; + size += buf[4] << 8; + size += buf[3] << 18; + size += buf[2] << 24; + cerr << "Un-unsynchronized size\n"; + } + size += buf[5]; + size += buf[4] << 7; + size += buf[3] << 14; + size += buf[2] << 21; +// cerr << "ID3v2 header found(size="<< size << ")\n"; + return size; + } + } + return 0; + } +/* + struct OggMagic { + char magic[8]; + int len; + void *format; + } + + OggMagic ogg_magic = { + {"fLaC", 4, &oggflac_format}, + {"\x7fFLAC", 5, &oggflac_format}, + {"\x01vorbis", 7, &vorbis_format}, + {"Speex ", 7, &speex_format} + {"", 0, 0} + } + + Format* detectOgg(File *src, int skip) { + Format *res = 0; + char oggmagic[7]; + src->seek(skip+28); + src->read(oggmagic, 7); + + for (OggMagic *i = ogg_magic; i->len >0; i++) { + if (memcmp(oggmagic, i->magic, i->len) == 0) + return i->format; + } + + return res; + } */ + + string detectRIFF(File *src, int skip) { + string res; + char riffmagic[4]; + src->seek(skip+8); + src->read(riffmagic, 4); + if (memcmp(riffmagic, "WAVE",4) == 0) { + char wavmagic[2]; + src->seek(skip+20); + src->read(wavmagic, 2); + if (wavmagic[0] == 1) + res = "wav"; + else + if (wavmagic[0] == 80) + res = "mpeg"; + else + if (wavmagic[0] == 85) + res = "mpeg"; + } + return res; + } + + string detectMPEG(File *src, int skip) { + string res; + unsigned char mpegheader[2]; + src->seek(skip); + src->read((char*)mpegheader, 2); + + if (mpegheader[0] == 0xff && (mpegheader[1] & 0xe0) == 0xe0) // frame synchronizer + if((mpegheader[1] & 0x18) != 0x08) // support MPEG 1, 2 and 2.5 + if((mpegheader[1] & 0x06) != 0x00) // Layer I, II and III + res = "mpeg"; + + return res; + } + + string detectSuffix(string filename) { + // A lot of mp3s dont start with a synchronization + // so use some suffix matching as well. + + int len = filename.length(); + if (len < 4) return ""; + string end = filename.substr(len-4, 4); + + if (end == ".mp3") return "mpeg"; + if (end == ".ogg") return "xiph"; + if (end == ".wma") return "ffmpeg"; + if (end == ".m4a") return "ffmpeg"; + if (end == ".aac") return "ffmpeg"; + if (end == ".ac3") return "ffmpeg"; + return ""; + } + + string detectFile(File *src) { + string res; + if (!src->openRO()) + return res; + + int skip = detectID3v2(src); + char magic[4]; + src->seek(skip); + src->read(magic, 4); + + if (memcmp(magic, "fLaC", 4) == 0) + res = "xiph"; + else + if (memcmp(magic, "OggS", 4) == 0) + res = "xiph"; + else + if (memcmp(magic, "MP+", 3) == 0) + res = "mpc"; + else + if (memcmp(magic, "\x30\x26\xb2\x75", 4) == 0) // ASF + res = "ffmpeg"; + else + if (memcmp(magic, ".RMF", 4) == 0) // RealAudio + res = "ffmpeg"; + else + if (memcmp(magic, ".ra", 3) == 0) // Old RealAudio + res = "ffmpeg"; + else + if (memcmp(magic, "RIFF", 4) == 0) + res = detectRIFF(src, skip); + else + res = detectMPEG(src, skip); + + if (res.empty()) res = detectSuffix(src->filename); + + src->close(); + return res; + } + +/* + Format *detectStream(Stream *src) { + Format *res = 0; + if (!src->openRO()) + return 0; + + // Search for Ogg or MPEG synchronization header + char *page = new char[4096]; + src->read(page, 4096); + for (int i=0; i<4096; i++) { + if (page[i] == 'O' && page[i+1] == 'g' && page[i+1] == 'g' && page[i+1] == 'S') { + res = detectOgg(src, i); + if (res) break; + } + if (page[i] == 0xff && (page[i+1] & 0x80) == 0x80) { + res = detectMPEG(src, i); + if (res) break; + } + } + return res; + } */ + } // namespace + +} // namespace diff --git a/akode/lib/magic.h b/akode/lib/magic.h new file mode 100644 index 0000000..9d112d5 --- /dev/null +++ b/akode/lib/magic.h @@ -0,0 +1,39 @@ +/* aKode: Magic header + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_MAGIC_H +#define _AKODE_MAGIC_H + +#include <string> +using std::string; + +namespace aKode { + + class File; + + namespace Magic { + string detectFile(File *src); + string detectRIFF(File *src, int skip=0); + //string detectStream(Source *src); + + } // namespace +} // namespace + +#endif diff --git a/akode/lib/mmapfile.cpp b/akode/lib/mmapfile.cpp new file mode 100644 index 0000000..4c45603 --- /dev/null +++ b/akode/lib/mmapfile.cpp @@ -0,0 +1,150 @@ +/* aKode: MMapFile + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "akodelib.h" + +extern "C" { + #ifdef HAVE_FEATURES_H + // Needed for older glibc versions. + #include <features.h> + #ifndef __USE_XOPEN2K + #define __USE_XOPEN2K + #endif + #endif + + #include <unistd.h> + #ifdef HAVE_SYS_TYPES_H + #include <sys/types.h> + #endif + #include <sys/mman.h> + #include <sys/stat.h> + #include <fcntl.h> + #include <string.h> + + #if defined(HAVE_MADVISE) && defined(NEED_MADVISE_PROTOTYPE) + extern int madvise(void*,size_t,int); + #endif +} + +#include "mmapfile.h" + +namespace aKode { + +MMapFile::MMapFile(const char* filename) : File(filename), fd(-1), handle(0), len(0), pos(0) {} + +MMapFile::~MMapFile() { + close(); +} + +bool MMapFile::openRO() { + if(handle) return true; + struct stat stat; + + fd = ::open(filename, O_RDONLY); + if (fstat(fd, &stat) < 0) return false; + len = stat.st_size; + pos = 0; + + handle = mmap(0, len, PROT_READ, MAP_SHARED, fd, 0); + if (handle == MAP_FAILED) { + ::close(fd); + handle = 0; + return false; + } + + return true; +} + +void MMapFile::close() { + if(handle) { + munmap((char*)handle,len); + ::close(fd); + } + handle = 0; +} + +long MMapFile::read(char* ptr, long num) { + if(!handle) return -1; + + if (pos+num > len) num = len-pos; + memcpy(ptr, (char*)handle+pos, num); + pos += num; + + return num; +} + +long MMapFile::write(const char*, long) { + return false; +} + +bool MMapFile::seek(long to, int whence) { + if(!handle) return false; + + long newpos = 0; + switch (whence) { + case SEEK_SET: + newpos = to; + break; + case SEEK_CUR: + newpos = pos + to; + break; + case SEEK_END: + newpos = len + to; + break; + default: + return false; + } + if (newpos > len || newpos < 0) + return false; + pos = newpos; + return true; +} + +long MMapFile::position() const { + if(!handle) return -1; + + return pos; +} + +long MMapFile::length() const { + if(!handle) return -1; + + return len; +} + +bool MMapFile::error() const { + return (!handle); +} + +bool MMapFile::eof() const { + if(!handle) return true; + return pos >= len; +} + +void MMapFile::fadvise() { + if(!handle) return; + #if defined(HAVE_POSIX_MADVISE) && defined(POSIX_MADV_SEQUENTIAL) + posix_madvise((char*)handle+pos, len-pos, POSIX_MADV_SEQUENTIAL); + #elif defined(HAVE_MADVISE) && defined(MADV_SEQUENTIAL) + madvise((char*)handle+pos, len-pos, MADV_SEQUENTIAL); + #endif +} + +} //namespace diff --git a/akode/lib/mmapfile.h b/akode/lib/mmapfile.h new file mode 100644 index 0000000..80c5913 --- /dev/null +++ b/akode/lib/mmapfile.h @@ -0,0 +1,66 @@ +/* aKode: MMapFile-type + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_MMAPFILE_H +#define _AKODE_MMAPFILE_H + +#include "file.h" +#include "akode_export.h" +namespace aKode { + +//! An implementation of the File interface that uses mmap + +/*! + * MMapFile uses the mmap system-call for file-access. + * This is often faster than ordinary file-access. In return + * MMapFile does not provide writing capabilities. + */ +class AKODE_EXPORT MMapFile : public File { + int fd; + void* handle; + long len; + long pos; +public: + MMapFile(const char* filename); + virtual ~MMapFile(); + + bool openRO(); + void close(); + + long read(char* ptr, long num); + long write(const char*, long); + + bool seek(long to, int whence = SEEK_SET); + long position() const; + long length() const; + + bool seekable() const { return true; }; + bool readable() const { return true; }; + bool writeable() const { return false; }; + + bool eof() const; + bool error() const; + + void fadvise(); +}; + +} //namespace + +#endif diff --git a/akode/lib/player.cpp b/akode/lib/player.cpp new file mode 100644 index 0000000..c785569 --- /dev/null +++ b/akode/lib/player.cpp @@ -0,0 +1,650 @@ +/* aKode: Player + + Copyright (C) 2004-2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <pthread.h> +#include <semaphore.h> +#include <assert.h> + +#include "audioframe.h" +#include "audiobuffer.h" +#include "decoder.h" +#include "buffered_decoder.h" +#include "mmapfile.h" +#include "localfile.h" +#include "volumefilter.h" + +#include "sink.h" +#include "converter.h" +#include "resampler.h" +#include "magic.h" + +#include "player.h" + +#ifndef NDEBUG +#include <iostream> +#define AKODE_DEBUG(x) {std::cerr << "akode: " << x << "\n";} +#else +#define AKODE_DEBUG(x) { } +#endif + +namespace aKode { + +struct Player::private_data +{ + private_data() : src(0) + , frame_decoder(0) + , resampler(0) + , converter(0) + , volume_filter(0) + , sink(0) + , manager(0) + , monitor(0) + , decoder_plugin(0) + , resampler_plugin("fast") + , sample_rate(0) + , state(Closed) + , my_file(false) + , my_sink(false) + , start_pos(0) + , halt(false) + , pause(false) + , detached(false) + , running(false) + {}; + + File *src; + + Decoder *frame_decoder; + BufferedDecoder buffered_decoder; + Resampler *resampler; + Converter *converter; + // Volatile because it can be created and destroyed during playback + VolumeFilter* volatile volume_filter; + Sink *sink; + Player::Manager *manager; + Player::Monitor *monitor; + + const char* decoder_plugin; + const char* resampler_plugin; + + SinkPluginHandler sink_handler; + DecoderPluginHandler decoder_handler; + ResamplerPluginHandler resampler_handler; + + unsigned int sample_rate; + State state; + bool my_file; + bool my_sink; + int start_pos; + + volatile bool halt; + volatile bool pause; + volatile bool detached; + bool running; + pthread_t player_thread; + sem_t pause_sem; + + void setState(Player::State s) { + state = s; + if (manager) manager->stateChangeEvent(s); + } + // Called for detached players + void cleanup() { + buffered_decoder.stop(); + buffered_decoder.closeDecoder(); + + delete frame_decoder; + if (my_file) + delete src; + + frame_decoder = 0; + src = 0; + decoder_handler.unload(); + + delete resampler; + delete converter; + resampler = 0; + converter = 0; + + delete this; + } +}; + +// The player-thread. It is controlled through the two variables +// halt and seek_pos in d +static void* run_player(void* arg) { + Player::private_data *d = (Player::private_data*)arg; + + AudioFrame frame; + AudioFrame re_frame; + AudioFrame c_frame; + bool no_error = true; + + while(true) { + if (d->pause) { + d->sink->pause(); + sem_wait(&d->pause_sem); + d->sink->resume(); + } + if (d->halt) break; + + no_error = d->buffered_decoder.readFrame(&frame); + + if (!no_error) { + if (d->buffered_decoder.eof()) + goto eof; + else + if (d->buffered_decoder.error()) + goto error; + else + AKODE_DEBUG("Blip?"); + } + else { + AudioFrame* out_frame = &frame; + if (d->resampler) { + d->resampler->doFrame(out_frame, &re_frame); + out_frame = &re_frame; + } + + if (d->converter) { + d->converter->doFrame(out_frame, &c_frame); + out_frame = &c_frame; + } + + if (d->volume_filter) + d->volume_filter->doFrame(out_frame); + + no_error = d->sink->writeFrame(out_frame); + + if (d->monitor) + d->monitor->writeFrame(out_frame); + + if (!no_error) { + // ### Check type of error + goto error; + } + } + } + +// Stoped by Player::stop() +// d->buffered_decoder->stop(); + assert(!d->detached); + return (void*)0; + +error: + if (d->detached) d->cleanup(); + else { + d->buffered_decoder.stop(); + if (d->manager) + d->manager->errorEvent(); + } + return (void*)0; + +eof: + if (d->detached) d->cleanup(); + else { + d->buffered_decoder.stop(); + if (d->manager) + d->manager->eofEvent(); + } + return (void*)0; +} + +Player::Player() { + d = new private_data; + sem_init(&d->pause_sem,0,0); +} + +Player::~Player() { + close(); + sem_destroy(&d->pause_sem); + delete d; +} + +bool Player::open(const char* sinkname) { + if (state() != Closed) + close(); + + assert(state() == Closed); + + d->sink_handler.load(sinkname); + if (!d->sink_handler.isLoaded()) { + AKODE_DEBUG("Could not load " << sinkname << "-sink"); + return false; + } + d->sink = d->sink_handler.openSink(); + if (!d->sink) { + AKODE_DEBUG("Could not create " << sinkname << "-sink"); + return false; + } + if (!d->sink->open()) { + AKODE_DEBUG("Could not open " << sinkname << "-sink"); + delete d->sink; + d->sink = 0; + return false; + } + d->my_sink = true; + setState(Open); + return true; +} + +bool Player::open(Sink *sink) { + if (state() != Closed) + close(); + + assert(state() == Closed); + + d->sink = sink; + if (!d->sink->open()) { + AKODE_DEBUG("Could not open sink"); + d->sink = 0; + return false; + } + d->my_sink = false; + setState(Open); + return true; +} + +void Player::close() { + if (state() == Closed) return; + if (state() != Open) + unload(); + + assert(state() == Open); + + delete d->volume_filter; + d->volume_filter = 0; + + if (d->my_sink) delete d->sink; + d->sink = 0; + d->sink_handler.unload(); + setState(Closed); +} + +bool Player::load(const char* filename) { + if (state() == Closed) return false; + + if (state() == Paused || state() == Playing) + stop(); + + if (state() == Loaded) + unload(); + + assert(state() == Open); + + d->src = new MMapFile(filename); + // Test if the file _can_ be mmaped + if (!d->src->openRO()) { + delete d->src; + d->src = new LocalFile(filename); + if (!d->src->openRO()) { + AKODE_DEBUG("Could not open " << filename); + delete d->src; + d->src = 0; + return false; + } + } + // Some of the later code expects it to be closed + d->src->close(); + d->my_file = true; + + return load(); +} + +bool Player::load(File *file) { + if (state() == Closed) return false; + + if (state() == Paused || state() == Playing) + stop(); + + if (state() == Loaded) + unload(); + + assert(state() == Open); + + if (!file->openRO()) + return false; + file->close(); + + d->src = file; + d->my_file = false; + + return load(); +} + +bool Player::load() { + if (d->decoder_plugin) { + if (!d->decoder_handler.load(d->decoder_plugin)) + AKODE_DEBUG("Could not load " << d->decoder_plugin << "-decoder"); + } + + if (!d->decoder_handler.isLoaded()) { + string format = Magic::detectFile(d->src); + if (!format.empty()) + AKODE_DEBUG("Guessed format: " << format) + else { + AKODE_DEBUG("Cannot detect mimetype"); + delete d->src; + d->src = 0; + return false; + } + if (!d->decoder_handler.load(format)) + AKODE_DEBUG("Could not load " << format << "-decoder"); + } + + if (!d->decoder_handler.isLoaded()) { + delete d->src; + d->src = 0; + return false; + } + + d->frame_decoder = d->decoder_handler.openDecoder(d->src); + if (!d->frame_decoder) { + AKODE_DEBUG("Failed to open Decoder"); + d->decoder_handler.unload(); + delete d->src; + d->src = 0; + return false; + } + + AudioFrame first_frame; + + if (!d->frame_decoder->readFrame(&first_frame)) { + AKODE_DEBUG("Failed to decode first frame"); + delete d->frame_decoder; + d->frame_decoder = 0; + d->decoder_handler.unload(); + delete d->src; + d->src = 0; + return false; + } + + if (!loadResampler()) { + AKODE_DEBUG("The resampler failed to load"); + return false; + } + + int state = d->sink->setAudioConfiguration(&first_frame); + if (state < 0) { + AKODE_DEBUG("The sink could not be configured for this format"); + delete d->frame_decoder; + d->frame_decoder = 0; + d->decoder_handler.unload(); + delete d->src; + d->src = 0; + return false; + } + else + if (state > 0) { + // Configuration not 100% accurate + d->sample_rate = d->sink->audioConfiguration()->sample_rate; + if (d->sample_rate != first_frame.sample_rate) { + AKODE_DEBUG("Resampling to " << d->sample_rate); + d->resampler->setSampleRate(d->sample_rate); + } + int out_channels = d->sink->audioConfiguration()->channels; + int in_channels = first_frame.channels; + if (in_channels != out_channels) { + // ### We don't do mixing yet + AKODE_DEBUG("Sample has wrong number of channels"); + delete d->frame_decoder; + d->frame_decoder = 0; + d->decoder_handler.unload(); + delete d->src; + d->src = 0; + return false; + } + int out_width = d->sink->audioConfiguration()->sample_width; + int in_width = first_frame.sample_width; + if (in_width != out_width) { + AKODE_DEBUG("Converting to " << out_width << "bits"); + if (!d->converter) + d->converter = new Converter(out_width); + else + d->converter->setSampleWidth(out_width); + } + } + else + { + delete d->resampler; + delete d->converter; + d->resampler = 0; + d->converter = 0; + } + + // connect the streams to play + d->buffered_decoder.setBlockingRead(true); + d->buffered_decoder.openDecoder(d->frame_decoder); + d->buffered_decoder.buffer()->put(&first_frame); + + setState(Loaded); + + return true; +} + +bool Player::loadResampler() { + if (!d->resampler) { + d->resampler_handler.load(d->resampler_plugin); + d->resampler = d->resampler_handler.openResampler(); + } + return d->resampler != 0; +} + +void Player::unload() { + if (state() == Closed || state() == Open) return; + if (state() == Paused || state() == Playing) + stop(); + + assert(state() == Loaded); + + d->buffered_decoder.closeDecoder(); + + delete d->frame_decoder; + if (d->my_file) + delete d->src; + + d->frame_decoder = 0; + d->src = 0; + d->decoder_handler.unload(); + + delete d->resampler; + delete d->converter; + d->resampler = 0; + d->converter = 0; + + setState(Open); +} + +void Player::play() { + if (state() == Closed || state() == Open) return; + if (state() == Playing) return; + + if (state() == Paused) { + return resume(); + } + + assert(state() == Loaded); + + d->frame_decoder->seek(0); + + // Start buffering + d->buffered_decoder.start(); + + d->halt = d->pause = false; + + if (pthread_create(&d->player_thread, 0, run_player, d) == 0) { + d->running = true; + setState(Playing); + } else { + d->running = false; + setState(Loaded); + } +} + +void Player::detach() { + if (state() == Closed || state() == Open) return; + if (state() == Loaded) return; + + if (state() == Paused) resume(); + + assert(state() == Playing); + + if (d->running) { + pthread_detach(d->player_thread); + d->running = false; + } + + private_data * d_new = new private_data; + d_new->sink = d->sink; + d_new->volume_filter = d->volume_filter; + d_new->sample_rate = d->sample_rate; + d_new->state = d->state; + + d->detached = true; + d = d_new; + + setState(Open); +} + + +void Player::stop() { + if (state() == Closed || state() == Open) return; + if (state() == Loaded) return; + + // Needs to set halt first to avoid the paused thread playing a soundbite + d->halt = true; + if (state() == Paused) resume(); + + assert(state() == Playing); + + d->buffered_decoder.stop(); + + if (d->running) { + pthread_join(d->player_thread, 0); + d->running = false; + } + + setState(Loaded); +} + +// Much like stop except we don't send a halt signal +void Player::wait() { + if (state() == Closed || state() == Open) return; + if (state() == Loaded) return; + + if (state() == Paused) resume(); + + assert(state() == Playing); + + if (d->running) { + pthread_join(d->player_thread, 0); + d->running = false; + } + + setState(Loaded); +} + +void Player::pause() { + if (state() == Closed || state() == Open || state() == Loaded) return; + if (state() == Paused) return; + + assert(state() == Playing); + + //d->buffer->pause(); + d->pause = true; + setState(Paused); +} + +void Player::resume() { + if (state() != Paused) return; + + d->pause = false; + sem_post(&d->pause_sem); + + setState(Playing); +} + + +void Player::setVolume(float f) { + if (f < 0.0 || f > 1.0) return; + + if (f != 1.0 && !d->volume_filter) { + VolumeFilter *vf = new VolumeFilter(); + vf->setVolume(f); + d->volume_filter = vf; + } + else if (f != 1.0) { + d->volume_filter->setVolume(f); + } + else if (d->volume_filter) { + VolumeFilter *f = d->volume_filter; + d->volume_filter = 0; + delete f; + } +} + +float Player::volume() const { + if (!d->volume_filter) return 1.0; + else + return d->volume_filter->volume(); +} + +File* Player::file() const { + return d->src; +} + +Sink* Player::sink() const { + return d->sink; +} + +Decoder* Player::decoder() const { + return &d->buffered_decoder; +} + +Resampler* Player::resampler() const { + return d->resampler; +} + +Player::State Player::state() const { + return d->state; +} + +void Player::setDecoderPlugin(const char* plugin) { + if (plugin && strncmp(plugin, "auto", 4) == 0) plugin = 0; + d->decoder_plugin = plugin; +} + +void Player::setResamplerPlugin(const char* plugin) { + d->resampler_plugin = plugin; +} + +void Player::setManager(Manager *manager) { + d->manager = manager; +} + +void Player::setMonitor(Monitor *monitor) { + d->monitor = monitor; +} + +void Player::setState(Player::State state) { + d->setState(state); +} + +} // namespace diff --git a/akode/lib/player.h b/akode/lib/player.h new file mode 100644 index 0000000..ad4e3e0 --- /dev/null +++ b/akode/lib/player.h @@ -0,0 +1,240 @@ +/* aKode: Player class + + Copyright (C) 2004-2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_PLAYER_H +#define _AKODE_PLAYER_H + +#include "akode_export.h" + +namespace aKode { + +class File; +class Sink; +class Decoder; +class Resampler; +class AudioFrame; + + +//! An implementation of a multithreaded aKode-player + +/*! + * The Player interface provides a clean and simple interface to multithreaded playback. + * Notice however that the Player interface itself is not reentrant and should thus only + * be used by a single thread. + */ +class AKODE_EXPORT Player { +public: + Player(); + ~Player(); + + /*! + * Opens a player that outputs to the sink \a sinkname (the "auto"-sink is recommended). + * Returns false if the device cannot be opened. + * + * State: \a Closed -> \a Open + */ + bool open(const char* sinkname); + + /*! + * Opens a player that outputs to the sink \a sink + * Returns false if the device cannot be opened. + * + * The object is owned by and should be destroyed by the owner after close() + * State: \a Closed -> \a Open + */ + bool open(Sink* sink); + + /*! + * Closes the player and releases the sink + * Valid in all states. + * + * State: \a Open -> \a Closed + */ + void close(); + + /*! + * Loads the file \a filename and prepares for playing. + * Returns false if the file cannot be loaded or decoded. + * + * State: \a Open -> \a Loaded + */ + bool load(const char* filename); + + /*! + * Loads the file \a file and prepares for playing. + * Returns false if the file cannot be loaded or decoded. + * + * This version allows for overloaded aKode::File objects; usefull for streaming. + * + * State: \a Open -> \a Loaded + */ + bool load(File* file); + + /*! + * Unload the file and release any resources allocated while loaded + * + * State: \a Loaded -> \a Open + */ + void unload(); + + /*! + * Start playing. + * + * State: \a Loaded -> \a Playing + */ + void play(); + /*! + * Stop playing and release any resources allocated while playing. + * + * State: \a Playing -> \a Loaded + * \a Paused -> \a Loaded + */ + void stop(); + /*! + * Waits for the file to finish playing (eof or error) and calls stop. + * This blocks the calling thread, possibly indefinitely if the source is a radio stream. + * + * State: \a Playing -> \a Loaded + */ + void wait(); + /* Not implemented! + * Detach the playing file, and bring the player back to Open state. + * The detached file will stop and unload by itself when finished + * + * State: \a Playing -> \a Open + */ + void detach(); + /*! + * Pause the player. + * + * State: \a Playing -> \a Paused + */ + void pause(); + /*! + * Resume the player from paused. + * + * State: \a Paused -> \a Playing + */ + void resume(); + + /*! + * Set the software-volume to \a v. Use a number between 0.0 and 1.0. + * + * Valid in states \a Playing and \a Paused + */ + void setVolume(float v); + /*! + * Returns the current value of the software-volume. + * + * Valid in states \a Playing and \a Paused + */ + float volume() const; + + File* file() const; + Sink* sink() const; + /*! + * Returns the current decoder interface. + * Used for seek, position and length. + */ + Decoder* decoder() const; + /*! + * Returns the current resampler interface. + * Used for adjusting playback speed. + */ + Resampler* resampler() const; + + enum State { Closed = 0, + Open = 2, + Loaded = 4, + Playing = 8, + Paused = 12 }; + + /*! + * Returns the current state of the Player + */ + State state() const; + + /*! + * An interface for Player callbacks + * + * Beware the callbacks come from a private thread, and methods from + * the Player interface should not be called from the callback. + */ + class Manager { + Player* m_player; + public: + /*! + * Called for all user-generated state changes (User thread) + */ + virtual void stateChangeEvent(Player::State) {}; + /*! + * Called when a decoder halts because it has reached end of file (Local thread). + * The callee should effect a Player::stop() + */ + virtual void eofEvent() {}; + /*! + * Called when a decoder halts because of a fatal error (Local thread). + * The callee should effect a Player::stop() + */ + virtual void errorEvent() {}; + }; + + /*! + * Sets an associated callback interface. + * Can only be set before open() is called. + */ + void setManager(Manager *manager); + + /*! + * Sets the decoder plugin to use. Default is auto-detect. + */ + void setDecoderPlugin(const char* plugin); + /*! + * Sets the resampler plugin to use. Default is "fast". + */ + void setResamplerPlugin(const char* plugin); + + /*! + * A Monitor is sink-like device. + */ + class Monitor { + public: + virtual void writeFrame(AudioFrame* frame) = 0; + }; + + /*! + * Sets a secondary sink to monitor output + * Can only be set before play() is called. + */ + void setMonitor(Monitor *monitor); + + + struct private_data; +private: + private_data *d; + + bool load(); + void setState(State state); + bool loadResampler(); +}; + +} // namespace + +#endif diff --git a/akode/lib/pluginhandler.cpp b/akode/lib/pluginhandler.cpp new file mode 100644 index 0000000..5aaea56 --- /dev/null +++ b/akode/lib/pluginhandler.cpp @@ -0,0 +1,136 @@ +/* aKode: PluginHandler + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "akodelib.h" +#include "pluginhandler.h" +#include <dirent.h> +#include <iostream> + +#ifdef HAVE_LIBLTDL + #include <ltdl.h> +#else + #include <dlfcn.h> +#endif + +#ifdef HAVE_LIBLTDL + #define DLCLOSE(x) lt_dlclose((lt_dlhandle)(x)) + #define DLERROR() lt_dlerror() + #define DLSYM(x, y) lt_dlsym((lt_dlhandle)(x), (y)) + #define DLINIT() lt_dlinit() + #define DLEXIT() lt_dlexit() +#else + #define DLCLOSE dlclose + #define DLERROR dlerror + #define DLSYM dlsym + #define DLINIT() + #define DLEXIT() +#endif + + +namespace aKode { + +PluginHandler::PluginHandler() : library_loaded(false), handle(0) +{ + DLINIT(); + #ifdef HAVE_LIBLTDL + lt_dlsetsearchpath(AKODE_SEARCHDIR); + #endif +} + +PluginHandler::PluginHandler(const string lib) : library_loaded(false), handle(0) +{ + DLINIT(); + if (lib.size() > 0) + load(lib); +} + +PluginHandler::~PluginHandler() +{ + unload(); + DLEXIT(); +} + +list<string> PluginHandler::listPlugins() { + DIR *dir = opendir(AKODE_SEARCHDIR); + dirent *dp; + + if (!dir) return list<string>(); + + list<string> out; + + while ((dp = readdir (dir)) != 0) { + string name(dp->d_name); + if (name.length() < 15) continue; + if (name.substr(0,9) != "libakode_") continue; + #ifdef HAVE_LIBLTDL + int p = name.find(".la", 9); + #else + int p = name.find(".so", 9); + #endif + if (p == -1) continue; + string plugin = name.substr(9,p-9); + out.push_back(plugin); + } + return out; +} + +bool PluginHandler::load(const string lib) +{ + if (library_loaded) return false; + + #ifdef HAVE_LIBLTDL + const string library = string("libakode_") + lib; + handle = lt_dlopenext(library.c_str()); + #else + string library = "libakode_" + lib + ".so"; + handle = dlopen(library.c_str(), RTLD_NOW); + if (!handle) { // this seems the simplest way to extent the search-path + library = string(AKODE_SEARCHDIR) +"/"+ library; + handle = dlopen(library.c_str(), RTLD_NOW); + } + #endif + if (!handle) { + return false; + } + + library_loaded = true; + return true; +} + +void PluginHandler::unload() +{ + if (library_loaded) { + DLCLOSE(handle); + library_loaded = false; + } +} + +void* PluginHandler::loadPlugin(const string name) { + void *plugin; + if (!handle) return 0; + + DLERROR(); // clear errors + plugin = DLSYM(handle, name.c_str()); + if (DLERROR()) return 0; + + return plugin; +} + +} //namespace diff --git a/akode/lib/pluginhandler.h b/akode/lib/pluginhandler.h new file mode 100644 index 0000000..a44de5d --- /dev/null +++ b/akode/lib/pluginhandler.h @@ -0,0 +1,81 @@ +/* aKode: PluginHandler parent-type + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_PLUGINHANDLER_H +#define _AKODE_PLUGINHANDLER_H + +#include <string> +#include <list> + +#include "akode_export.h" + +namespace aKode { + +using std::string; +using std::list; + +//! The parent class of all plugin-handlers + +/*! + * Handles the loading and unloading of plugins, must be inherited from by all + * specialized plugins-handlers. + */ +class AKODE_EXPORT PluginHandler { +public: + static list<string> listPlugins(); + + /*! + * Default constructor that loads no library. + */ + PluginHandler(); + /*! + * The constructor loads the akode-library name \a lib. + */ + PluginHandler(const string lib); + /*! + * The destructor unloads the library. + */ + virtual ~PluginHandler(); + /*! + * Try to load the library \a lib + * Returns true if succesfull. + */ + virtual bool load(const string lib); + /*! + * Unloads the library + */ + virtual void unload(); + /*! + * Ask for a plugin in the library named \a plugin. + * Returns 0 on failure. + */ + void* loadPlugin(const string plugin); + /*! + * Returns whether the library was succesfully loaded or not + */ + bool isLoaded() { return library_loaded; }; +protected: + bool library_loaded; + void* handle; +}; + +} // namespace + +#endif diff --git a/akode/lib/resampler.h b/akode/lib/resampler.h new file mode 100644 index 0000000..c16548c --- /dev/null +++ b/akode/lib/resampler.h @@ -0,0 +1,77 @@ +/* aKode: Resampler abstract-type + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_RESAMPLER_H +#define _AKODE_RESAMPLER_H + +#include <string> + +#include "pluginhandler.h" +#include "akode_export.h" + +namespace aKode { + +using std::string; +class AudioFrame; + +//! A generic interface for all resamplers + +/*! + * Resamplers are used to change the samplerate of sample + */ +class AKODE_EXPORT Resampler { +public: + virtual ~Resampler() {}; + /*! + * Returns true if convertion was succesfull. + */ + virtual bool doFrame(AudioFrame *in, AudioFrame *out) = 0; + /*! + * Sets the output sample-rate to \a value. + */ + virtual void setSampleRate(unsigned int rate) = 0; + /*! + * Sets the resample speed to \a value. + */ + virtual void setSpeed(float value) = 0; +}; + +class ResamplerPlugin { +public: + virtual Resampler* openResampler() = 0; +}; + +class AKODE_EXPORT ResamplerPluginHandler : public PluginHandler, public ResamplerPlugin { +public: + ResamplerPluginHandler() : resampler_plugin(0) {}; + ResamplerPluginHandler(const string name); + Resampler* openResampler(); + /*! + * Loads a resampler-plugin by the \a name (src, fast..) + */ + virtual bool load(const string name); + bool isLoaded() { return resampler_plugin != 0; }; +protected: + ResamplerPlugin* resampler_plugin; +}; + +} // namespace + +#endif diff --git a/akode/lib/resamplerpluginhandler.cpp b/akode/lib/resamplerpluginhandler.cpp new file mode 100644 index 0000000..7f91097 --- /dev/null +++ b/akode/lib/resamplerpluginhandler.cpp @@ -0,0 +1,49 @@ +/* aKode: ResamplerPluginHandler + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "akodelib.h" +#include "resampler.h" +#include "fast_resampler.h" + +namespace aKode { + +ResamplerPluginHandler::ResamplerPluginHandler(const string lib) : resampler_plugin(0) +{ + if (lib.size() > 0) + load(lib); +} + +bool ResamplerPluginHandler::load(const string name) +{ + bool res = PluginHandler::load(name+"_resampler"); + if (res) + resampler_plugin = (ResamplerPlugin*)loadPlugin(name+"_resampler"); + else + if (name == "fast") + resampler_plugin = &fast_resampler; + + return res && resampler_plugin; +} + +Resampler* ResamplerPluginHandler::openResampler() { + return resampler_plugin->openResampler(); +} + +} //namespace diff --git a/akode/lib/sink.h b/akode/lib/sink.h new file mode 100644 index 0000000..9946127 --- /dev/null +++ b/akode/lib/sink.h @@ -0,0 +1,109 @@ +/* aKode: Sink abstract-type + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_SINK_H +#define _AKODE_SINK_H + +#include "pluginhandler.h" + +#include "akode_export.h" + +namespace aKode { + +class AudioFrame; +class AudioBuffer; +class AudioConfiguration; + + +//! A generic interface for all sinks + +/*! + * Sinks are where an audiostream goes. It can in aKodeLib be either an + * encoder or an audio-output such as ALSA or OSS. + */ +class AKODE_EXPORT Sink { +public: + virtual ~Sink() {}; + /*! + * Opens the sink for playing and returns true if succesfull. + */ + virtual bool open() = 0; + /*! + * Closes the sink and releases any held resources or processes. + */ + virtual void close() {}; + /*! + * Tries to configure the sink for the configuration \a config. + * Returns 0 if a perfect match was possible, positive if a close + * match was possible, and negative to indicate complete failure. + */ + virtual int setAudioConfiguration(const AudioConfiguration* config) = 0; + /*! + * Returns the configuration the sink currently expects. + */ + virtual const AudioConfiguration* audioConfiguration() const = 0; + /*! + * Writes one frame to the sink. If the frame has a different configuration + * than the sink expects, the result is undefined. + * + * Some sinks might handle automatic reconfiguration gracefully, but this + * will be plugin-specific and cannot be generally relied upon. + */ + virtual bool writeFrame(AudioFrame* frame) = 0; + /*! + * Pauses buffer-playback in the sink in case it has a buffer of significance. + * Notice that not all sinks are capable of precise pausing. + */ + virtual void pause() {}; + /*! + * Resume from a paused state + */ + virtual void resume() {}; +}; + +class SinkPlugin { +public: + /*! + * Asks the plugin to open a Sink, returns 0 if the + * plugin could not. + */ + virtual Sink* openSink() = 0; +}; + +class AKODE_EXPORT SinkPluginHandler : public PluginHandler, public SinkPlugin { +public: + static list<string> listSinkPlugins(); + + SinkPluginHandler() : sink_plugin(0) {}; + SinkPluginHandler(const string name); + Sink* openSink(); + /*! + * Loads the sink-plugin named \a name (alsa,oss..) + */ + virtual bool load(const string name); + virtual void unload(); + bool isLoaded() { return sink_plugin != 0; }; +protected: + SinkPlugin* sink_plugin; +}; + +} // namespace + +#endif diff --git a/akode/lib/sinkpluginhandler.cpp b/akode/lib/sinkpluginhandler.cpp new file mode 100644 index 0000000..222a44d --- /dev/null +++ b/akode/lib/sinkpluginhandler.cpp @@ -0,0 +1,77 @@ +/* aKode: SinkPluginHandler + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "akodelib.h" +#include "sink.h" +#include "auto_sink.h" +#include "void_sink.h" + +namespace aKode { + +list<string> SinkPluginHandler::listSinkPlugins() { + const list<string> plugin_list = listPlugins(); + list<string> sink_list; + for (list<string>::const_iterator i = plugin_list.begin(); i != plugin_list.end(); i++) + if (i->length() > 5 && i->substr(i->length()-5,5) == "_sink") + sink_list.push_back(i->substr(0,i->length()-5)); + sink_list.push_back("auto"); + sink_list.push_back("void"); + return sink_list; +} + + +SinkPluginHandler::SinkPluginHandler(const string lib) : sink_plugin(0) +{ + if (lib.size() > 0); + load(lib); +} + +bool SinkPluginHandler::load(const string name) +{ + if (library_loaded) return false; + + bool res = PluginHandler::load(name+"_sink"); + if (res) + sink_plugin = (SinkPlugin*)loadPlugin(name+"_sink"); + else + if (name == "auto") + sink_plugin = &auto_sink; + else + if (name == "void") + sink_plugin = &void_sink; + else + return false; // plugin not found + + return res; +} + +void SinkPluginHandler::unload() { + sink_plugin = 0; + PluginHandler::unload(); +} + +Sink* SinkPluginHandler::openSink() { + if (sink_plugin) + return sink_plugin->openSink(); + else + return 0; +} + +} //namespace diff --git a/akode/lib/thread.h b/akode/lib/thread.h new file mode 100644 index 0000000..0a6cfbf --- /dev/null +++ b/akode/lib/thread.h @@ -0,0 +1,82 @@ +/* AvKode: Multithreading classes + + Copyright (C) 2006 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_THREAD_H +#define _AKODE_THREAD_H + +#include <pthread.h> +#include <semaphore.h> + +namespace aKode { + +class Condition; + +class Mutex { + friend class Condition; +public: + Mutex() { + pthread_mutex_init(&mutex, 0); + } + void lock() { + pthread_mutex_lock(&mutex); + } + void unlock() { + pthread_mutex_unlock(&mutex); + } +private: + pthread_mutex_t mutex; +}; + +class Condition { +public: + Condition() { + pthread_cond_init(&cond, 0); + } + void wait(Mutex *mutex) { + pthread_cond_wait(&cond, &mutex->mutex); + } + void signal() { + pthread_cond_signal(&cond); + } +private: + pthread_cond_t cond; +}; + +class Semaphore { +public: + Semaphore(int i = 0) { + sem_init(&sem, 0, i); + } + ~Semaphore() { + sem_destroy(&sem); + } + void wait() { + sem_wait(&sem); + } + void signal() { + sem_post(&sem); + } +private: + sem_t sem; +}; + +} // namespace + +#endif diff --git a/akode/lib/void_sink.cpp b/akode/lib/void_sink.cpp new file mode 100644 index 0000000..893e728 --- /dev/null +++ b/akode/lib/void_sink.cpp @@ -0,0 +1,75 @@ +/* aKode: Void-Sink + + Copyright (C) 2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <config.h> + +#include <audioframe.h> +#include "void_sink.h" + +//#include <iostream> + +namespace aKode { + +extern "C" { VoidSinkPlugin void_sink; } + +struct VoidSink::private_data +{ + AudioConfiguration config; +}; + +VoidSink::VoidSink() +{ + m_data = new private_data; +} + +VoidSink::~VoidSink() +{ + close(); + delete m_data; +} + +bool VoidSink::open() +{ + return true; +} + + +void VoidSink::close() +{ +} + +int VoidSink::setAudioConfiguration(const AudioConfiguration* config) +{ + m_data->config = *config; + + return 0; +} + +const AudioConfiguration* VoidSink::audioConfiguration() const +{ + return &m_data->config; +} + +bool VoidSink::writeFrame(AudioFrame* /*frame*/) +{ + return true; +} + +} // namespace diff --git a/akode/lib/void_sink.h b/akode/lib/void_sink.h new file mode 100644 index 0000000..c46f362 --- /dev/null +++ b/akode/lib/void_sink.h @@ -0,0 +1,63 @@ +/* aKode: void-Sink + + Copyright (C) 2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_VOID_SINK_H +#define _AKODE_VOID_SINK_H + +#include "sink.h" + +#include "akode_export.h" + +namespace aKode { + +class AudioConfiguration; +class AudioFrame; + +class VoidSink : public Sink { +public: + VoidSink(); + ~VoidSink(); + bool open(); + void close(); + int setAudioConfiguration(const AudioConfiguration *config); + const AudioConfiguration* audioConfiguration() const; + // Writes blocking + bool writeFrame(AudioFrame *frame); + +// void pause(); +// void resume(); + + struct private_data; +private: + private_data *m_data; +}; + +class VoidSinkPlugin : public SinkPlugin { +public: + virtual VoidSink* openSink() { + return new VoidSink(); + } +}; + +extern "C" AKODE_EXPORT VoidSinkPlugin void_sink; + +} // namespace + +#endif diff --git a/akode/lib/volumefilter.cpp b/akode/lib/volumefilter.cpp new file mode 100644 index 0000000..c053453 --- /dev/null +++ b/akode/lib/volumefilter.cpp @@ -0,0 +1,91 @@ +/* aKode Volume-Filter + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "audioframe.h" +#include "arithmetic.h" +#include "volumefilter.h" + +#define VM_FIDELITY (1<<14) + +namespace aKode { + +VolumeFilter::VolumeFilter() : m_volume(0) {} + +// T is the input/output type, S is the fast arithmetics type, Arithm is a division definition +template<typename T, typename S, template<typename S> class Arithm> +static bool _doFrame(AudioFrame* in, AudioFrame* out, int volume) +{ + T** indata = (T**)in->data; + T** outdata = (T**)out->data; + + long length = in->length; + if (in->channels != out->channels) return false; + if (in->sample_width != out->sample_width) return false; + + S smax = Arithm<S>::max(in->sample_width); + + for(int i=0; i<in->channels; i++) { + for(int j=0; j<length; j++) { + S signal = Arithm<S>::muldiv(outdata[i][j], volume, VM_FIDELITY); + + if (signal > smax) signal = smax; + else + if (signal < -smax) signal = -smax; + + indata[i][j] = (T)(signal); + } + } + return true; +} + + +bool VolumeFilter::doFrame(AudioFrame* in, AudioFrame* out) +{ + if (!out) out = in; + + int volint = (int)(m_volume*VM_FIDELITY+0.5); + + if (in->sample_width < -32) { + return _doFrame<double, double, Arithm_FP>(in, out, volint); + } else + if (in->sample_width < 0) { + return _doFrame<float, float, Arithm_FP>(in, out, volint); + } else + if (in->sample_width <= 8) { + return _doFrame<int8_t, int32_t, Arithm_Int>(in, out, volint); + } else + if (in->sample_width <= 16) { + return _doFrame<int16_t, int32_t, Arithm_Int>(in, out, volint); + } else + if (in->sample_width <= 24) { + return _doFrame<int32_t, int32_t, Arithm_Int>(in, out, volint); + } else + return _doFrame<int32_t, int64_t, Arithm_Int>(in, out, volint); +} + +void VolumeFilter::setVolume(float volume) { + m_volume = volume; +} + +float VolumeFilter::volume() const { + return m_volume; +} + +} // namespace diff --git a/akode/lib/volumefilter.h b/akode/lib/volumefilter.h new file mode 100644 index 0000000..054a589 --- /dev/null +++ b/akode/lib/volumefilter.h @@ -0,0 +1,38 @@ +/* aKode: Volume-filter + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef _AKODE_VOLUMEFILTER_H +#define _AKODE_VOLUMEFILTER_H + +namespace aKode { + +class AudioFrame; + +class VolumeFilter { + float m_volume; +public: + VolumeFilter(); + bool doFrame(AudioFrame* in, AudioFrame* out = 0); + void setVolume(float volume); + float volume() const; +}; + +} // namespace + +#endif diff --git a/akode/lib/wav_decoder.cpp b/akode/lib/wav_decoder.cpp new file mode 100644 index 0000000..73f663c --- /dev/null +++ b/akode/lib/wav_decoder.cpp @@ -0,0 +1,236 @@ +/* aKode: Wav-Decoder + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <string.h> + +#include "audioframe.h" +#include "decoder.h" +#include "file.h" +#include "wav_decoder.h" + +#include <iostream> + +namespace aKode { + +bool WavDecoderPlugin::canDecode(File* src) { + char header[4]; + bool res = false; + src->openRO(); + if (src->read(header, 4) != 4 || memcmp(header, "RIFF",4) != 0 ) goto close; + src->seek(8); + if (src->read(header, 4) != 4 || memcmp(header, "WAVE",4) != 0 ) goto close; + src->seek(20); + if (src->read(header, 2) != 2 || memcmp(header, "\x01\0",2) != 0 ) goto close; + res = true; +close: + src->close(); + return res; + +} + +extern "C" { WavDecoderPlugin wav_decoder; } + +struct WavDecoder::private_data +{ + private_data() : valid(false), buffer_length(0), buffer(0) {}; + AudioConfiguration config; + bool valid; + long position; + + long pos; + long length; + + unsigned int buffer_length; + unsigned char *buffer; + + File *src; +}; + + +WavDecoder::WavDecoder(File *src) { + d = new private_data; + + openFile(src); +} + +bool WavDecoder::openFile(File* src) { + d->src = src; + src->openRO(); + src->fadvise(); + + // Get format information + unsigned char buffer[4]; + src->seek(4); + src->read((char*)buffer, 4); // size of stream + d->length = buffer[0] + buffer[1]*256 + buffer[2] * (1<<16) + buffer[3] * (1<<24) + 8; + + src->seek(16); + src->read((char*)buffer, 4); // should really be 16 + d->pos = 20 + buffer[0] + buffer[1]*256; + if (buffer[2] != 0 || buffer[3] != 0) goto invalid; + + src->read((char*)buffer, 2); // check for compression + if (*(short*)buffer != 1) goto invalid; + + src->read((char*)buffer, 2); + d->config.channels = buffer[0] + buffer[1]*256; + if (d->config.channels <=2) + d->config.channel_config = MonoStereo; + else + d->config.channel_config = MultiChannel; + + src->read((char*)buffer, 4); + d->config.sample_rate = buffer[0] + buffer[1]*256 + buffer[2] * (1<<16) + buffer[3] * (1<<24); + + src->seek(34); + src->read((char*)buffer, 2); + d->config.sample_width = buffer[0] + buffer[1]*256; + + // Various sanity checks + if (d->config.sample_width != 8 && d->config.sample_width != 16 && d->config.sample_width != 32) goto invalid; + if (d->config.sample_rate > 200000) goto invalid; + +find_data: + src->seek(d->pos); + src->read((char*)buffer, 4); + if (memcmp(buffer, "data", 4) != 0) + if (memcmp(buffer, "clm ", 4) != 0) + goto invalid; + else { + src->read((char*)buffer, 4); + d->pos = d->pos+ 8 + buffer[0] + buffer[1]*256; + goto find_data; + } + + src->seek(d->pos+8); // start of data + d->position = 0; + d->valid = true; + // 1024 samples: + d->buffer_length = 1024*((d->config.sample_width+7)/8)*d->config.channels; + d->buffer = new unsigned char[d->buffer_length]; + return true; + +invalid: + std::cerr << "Invalid WAV file\n"; + d->valid = false; + src->close(); + return false; +} + +void WavDecoder::close() { + d->src->close(); + delete[] d->buffer; + d->valid = false; +} + +WavDecoder::~WavDecoder() { + delete d; +} + +bool WavDecoder::readFrame(AudioFrame* frame) +{ + if (!d->valid || eof()) return false; + + unsigned long samples = 1024; + // read a frame + unsigned long length; + length = d->src->read((char*)d->buffer, d->buffer_length); + if (length != d->buffer_length) { + samples = length / (d->config.channels * ((d->config.sample_width+7)/8)); + } + d->pos += length; + d->position += samples; + // Ensure the frame is properly configured + frame->reserveSpace(&d->config, samples); + + int channels = d->config.channels; + if (d->config.sample_width == 8) { + // WAV 8bit is unsigned + uint8_t* buffer = (uint8_t*)d->buffer; + int8_t** data = (int8_t**)frame->data; + for(unsigned int i=0; i<samples; i++) + for(int j=0; j<channels; j++) + data[j][i] = (int(buffer[i*channels+j])) - 128; + } + else + if (d->config.sample_width == 16) { + int16_t* buffer = (int16_t*)d->buffer; + int16_t** data = (int16_t**)frame->data; + for(unsigned int i=0; i<samples; i++) + for(int j=0; j<channels; j++) + data[j][i] = buffer[i*channels+j]; + } else + if (d->config.sample_width == 32) { + int32_t* buffer = (int32_t*)d->buffer; + int32_t** data = (int32_t**)frame->data; + for(unsigned int i=0; i<samples; i++) + for(int j=0; j<channels; j++) + data[j][i] = buffer[i*channels+j]; + } else + return false; + + frame->pos = position(); + + return true; +} + +long WavDecoder::length() { + if (!d->valid) return -1; + long byterate = d->config.sample_rate * d->config.channels * ((d->config.sample_width+7)/8); + return (d->length-44)/byterate; +} + +long WavDecoder::position() { + if (!d->valid) return -1; + long div = (d->position / d->config.sample_rate) * 1000; + long rem = (d->position % d->config.sample_rate) * 1000; + return div + (rem / d->config.sample_rate); +} + +bool WavDecoder::eof() { + if (!d->src) return true; + else return d->src->eof(); +} + +bool WavDecoder::error() { + return !d->valid; +} + +bool WavDecoder::seek(long pos) { + int samplesize = d->config.channels * ((d->config.sample_width+7)/8); + long byterate = d->config.sample_rate * samplesize; + long sample_pos = (pos * byterate) / 1000; + long byte_pos = sample_pos * samplesize; + if (byte_pos+44 >= d->length) return false; + if (!d->src->seek(byte_pos+44)) return false; + d->pos = byte_pos + 44; + return true; +} + +bool WavDecoder::seekable() { + return d->src->seekable(); +} + +const AudioConfiguration* WavDecoder::audioConfiguration() { + if (!d->valid) return 0; + return &d->config; +} + +} // namespace diff --git a/akode/lib/wav_decoder.h b/akode/lib/wav_decoder.h new file mode 100644 index 0000000..a569de8 --- /dev/null +++ b/akode/lib/wav_decoder.h @@ -0,0 +1,66 @@ +/* aKode: Wav-Decoder + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_WAV_DECODER_H +#define _AKODE_WAV_DECODER_H + +#include "decoder.h" + +namespace aKode { + +class File; +class AudioFrame; + +class WavDecoder : public Decoder { +public: + WavDecoder(File* src); + virtual ~WavDecoder(); + + virtual bool openFile(File*); + virtual void close(); + virtual bool readFrame(AudioFrame*); + virtual long length(); + virtual long position(); + virtual bool eof(); + virtual bool error(); + virtual bool seek(long); + virtual bool seekable(); + + virtual const AudioConfiguration* audioConfiguration(); + + struct private_data; +private: + private_data *d; +}; + + +class WavDecoderPlugin : public DecoderPlugin { +public: + virtual bool canDecode(File*); + virtual WavDecoder* openDecoder(File* str) { + return new WavDecoder(str); + }; +}; + +extern "C" WavDecoderPlugin wav_decoder; + +} // namespace + +#endif diff --git a/akode/plugins/Makefile.am b/akode/plugins/Makefile.am new file mode 100644 index 0000000..74f27e5 --- /dev/null +++ b/akode/plugins/Makefile.am @@ -0,0 +1,43 @@ +AKODE_MPC_DECODER=mpc_decoder + +if include_xiph_decoder +AKODE_XIPH_DECODER=xiph_decoder +endif + +if include_mpeg_decoder +AKODE_MPEG_DECODER=mpeg_decoder +endif + +if include_ffmpeg_decoder +AKODE_FFMPEG_DECODER=ffmpeg_decoder +endif + +if include_src_resampler +AKODE_SRC_RESAMPLER=src_resampler +endif + +if include_alsa_sink +AKODE_ALSA_SINK=alsa_sink +endif + +if include_oss_sink +AKODE_OSS_SINK=oss_sink +endif + +if include_sun_sink +AKODE_SUN_SINK=sun_sink +endif + +if include_jack_sink +AKODE_JACK_SINK=jack_sink +endif + +if include_polyp_sink +AKODE_POLYP_SINK=polyp_sink +endif + +SUBDIRS= $(AKODE_MPC_DECODER) $(AKODE_XIPH_DECODER) \ + $(AKODE_MPEG_DECODER) $(AKODE_FFMPEG_DECODER) \ + $(AKODE_ALSA_SINK) $(AKODE_OSS_SINK) $(AKODE_SUN_SINK) \ + $(AKODE_JACK_SINK) $(AKODE_POLYP_SINK) \ + $(AKODE_SRC_RESAMPLER) diff --git a/akode/plugins/Makefile.in b/akode/plugins/Makefile.in new file mode 100644 index 0000000..598fd29 --- /dev/null +++ b/akode/plugins/Makefile.in @@ -0,0 +1,664 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = akode/plugins +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/akode/lib/akode_export.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +#>- RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ +#>- html-recursive info-recursive install-data-recursive \ +#>- install-exec-recursive install-info-recursive \ +#>- install-recursive installcheck-recursive installdirs-recursive \ +#>- pdf-recursive ps-recursive uninstall-info-recursive \ +#>- uninstall-recursive +#>+ 6 +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive nmcheck-recursive bcheck-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = mpc_decoder xiph_decoder mpeg_decoder ffmpeg_decoder \ + alsa_sink oss_sink sun_sink jack_sink polyp_sink src_resampler +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AKODE_LIBDL = @AKODE_LIBDL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVCODEC_CFLAGS = @AVCODEC_CFLAGS@ +AVCODEC_LDFLAGS = @AVCODEC_LDFLAGS@ +AVCODEC_LIBADD = @AVCODEC_LIBADD@ +AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ +AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ +AVFORMAT_LIBADD = @AVFORMAT_LIBADD@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBADD = @JACK_LIBADD@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBFLAC = @LIBFLAC@ +LIBOBJS = @LIBOBJS@ +LIBOGGFLAC = @LIBOGGFLAC@ +LIBOSSAUDIO = @LIBOSSAUDIO@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSAMPLERATE = @LIBSAMPLERATE@ +LIBSEM = @LIBSEM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MADLIBS = @MADLIBS@ +MAKEINFO = @MAKEINFO@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POLYP_CFLAGS = @POLYP_CFLAGS@ +POLYP_LDFLAGS = @POLYP_LDFLAGS@ +POLYP_LIBADD = @POLYP_LIBADD@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXLIBS = @SPEEXLIBS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +VERSION = @VERSION@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +akode_SUBDIR_included_FALSE = @akode_SUBDIR_included_FALSE@ +akode_SUBDIR_included_TRUE = @akode_SUBDIR_included_TRUE@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_alsa_sink_FALSE = @include_alsa_sink_FALSE@ +include_alsa_sink_TRUE = @include_alsa_sink_TRUE@ +include_ffmpeg_decoder_FALSE = @include_ffmpeg_decoder_FALSE@ +include_ffmpeg_decoder_TRUE = @include_ffmpeg_decoder_TRUE@ +include_jack_sink_FALSE = @include_jack_sink_FALSE@ +include_jack_sink_TRUE = @include_jack_sink_TRUE@ +include_mpeg_decoder_FALSE = @include_mpeg_decoder_FALSE@ +include_mpeg_decoder_TRUE = @include_mpeg_decoder_TRUE@ +include_oss_sink_FALSE = @include_oss_sink_FALSE@ +include_oss_sink_TRUE = @include_oss_sink_TRUE@ +include_polyp_sink_FALSE = @include_polyp_sink_FALSE@ +include_polyp_sink_TRUE = @include_polyp_sink_TRUE@ +include_src_resampler_FALSE = @include_src_resampler_FALSE@ +include_src_resampler_TRUE = @include_src_resampler_TRUE@ +include_sun_sink_FALSE = @include_sun_sink_FALSE@ +include_sun_sink_TRUE = @include_sun_sink_TRUE@ +include_xiph_decoder_FALSE = @include_xiph_decoder_FALSE@ +include_xiph_decoder_TRUE = @include_xiph_decoder_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +AKODE_MPC_DECODER = mpc_decoder +@include_xiph_decoder_TRUE@AKODE_XIPH_DECODER = xiph_decoder +@include_mpeg_decoder_TRUE@AKODE_MPEG_DECODER = mpeg_decoder +@include_ffmpeg_decoder_TRUE@AKODE_FFMPEG_DECODER = ffmpeg_decoder +@include_src_resampler_TRUE@AKODE_SRC_RESAMPLER = src_resampler +@include_alsa_sink_TRUE@AKODE_ALSA_SINK = alsa_sink +@include_oss_sink_TRUE@AKODE_OSS_SINK = oss_sink +@include_sun_sink_TRUE@AKODE_SUN_SINK = sun_sink +@include_jack_sink_TRUE@AKODE_JACK_SINK = jack_sink +@include_polyp_sink_TRUE@AKODE_POLYP_SINK = polyp_sink +SUBDIRS = $(AKODE_MPC_DECODER) $(AKODE_XIPH_DECODER) \ + $(AKODE_MPEG_DECODER) $(AKODE_FFMPEG_DECODER) \ + $(AKODE_ALSA_SINK) $(AKODE_OSS_SINK) $(AKODE_SUN_SINK) \ + $(AKODE_JACK_SINK) $(AKODE_POLYP_SINK) \ + $(AKODE_SRC_RESAMPLER) + +#>- all: all-recursive +#>+ 1 +all: docs-am all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu akode/plugins/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-recursive +#>+ 1 +clean: kde-rpo-clean clean-recursive + +#>- clean-am: clean-generic clean-libtool mostlyclean-am +#>+ 1 +clean-am: clean-bcheck clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-generic clean-libtool clean-recursive ctags \ + ctags-recursive distclean distclean-generic distclean-libtool \ + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-generic mostlyclean-libtool \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +#>+ 2 +KDE_DIST=Makefile.in Makefile.am + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-recursive + +bcheck-am: + @for i in ; do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXX) $(DEFS) -I. -I$(srcdir) -I$(top_builddir) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 3 +final: + $(MAKE) all-am + +#>+ 3 +final-install: + $(MAKE) install-am + +#>+ 3 +no-final: + $(MAKE) all-am + +#>+ 3 +no-final-install: + $(MAKE) install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/akode/plugins/alsa_sink/Makefile.am b/akode/plugins/alsa_sink/Makefile.am new file mode 100644 index 0000000..e1254f1 --- /dev/null +++ b/akode/plugins/alsa_sink/Makefile.am @@ -0,0 +1,7 @@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(all_includes) + +lib_LTLIBRARIES = libakode_alsa_sink.la + +libakode_alsa_sink_la_SOURCES = alsa_sink.cpp +libakode_alsa_sink_la_LDFLAGS = -module -avoid-version -no-undefined +libakode_alsa_sink_la_LIBADD = ../../lib/libakode.la $(ALSA_LIBS) diff --git a/akode/plugins/alsa_sink/Makefile.in b/akode/plugins/alsa_sink/Makefile.in new file mode 100644 index 0000000..d4dadc8 --- /dev/null +++ b/akode/plugins/alsa_sink/Makefile.in @@ -0,0 +1,659 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = akode/plugins/alsa_sink +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/akode/lib/akode_export.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libakode_alsa_sink_la_DEPENDENCIES = ../../lib/libakode.la \ + $(am__DEPENDENCIES_1) +am_libakode_alsa_sink_la_OBJECTS = alsa_sink.lo +#>- libakode_alsa_sink_la_OBJECTS = $(am_libakode_alsa_sink_la_OBJECTS) +#>+ 1 +libakode_alsa_sink_la_OBJECTS = alsa_sink.lo +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/akode/lib +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 2 +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ +#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +#>- $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 3 +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +CXXLD = $(CXX) +#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ +#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +#>+ 2 +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libakode_alsa_sink_la_SOURCES) +DIST_SOURCES = $(libakode_alsa_sink_la_SOURCES) +ETAGS = etags +CTAGS = ctags +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AKODE_LIBDL = @AKODE_LIBDL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVCODEC_CFLAGS = @AVCODEC_CFLAGS@ +AVCODEC_LDFLAGS = @AVCODEC_LDFLAGS@ +AVCODEC_LIBADD = @AVCODEC_LIBADD@ +AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ +AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ +AVFORMAT_LIBADD = @AVFORMAT_LIBADD@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBADD = @JACK_LIBADD@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBFLAC = @LIBFLAC@ +LIBOBJS = @LIBOBJS@ +LIBOGGFLAC = @LIBOGGFLAC@ +LIBOSSAUDIO = @LIBOSSAUDIO@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSAMPLERATE = @LIBSAMPLERATE@ +LIBSEM = @LIBSEM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MADLIBS = @MADLIBS@ +MAKEINFO = @MAKEINFO@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POLYP_CFLAGS = @POLYP_CFLAGS@ +POLYP_LDFLAGS = @POLYP_LDFLAGS@ +POLYP_LIBADD = @POLYP_LIBADD@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXLIBS = @SPEEXLIBS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +VERSION = @VERSION@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +akode_SUBDIR_included_FALSE = @akode_SUBDIR_included_FALSE@ +akode_SUBDIR_included_TRUE = @akode_SUBDIR_included_TRUE@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_alsa_sink_FALSE = @include_alsa_sink_FALSE@ +include_alsa_sink_TRUE = @include_alsa_sink_TRUE@ +include_ffmpeg_decoder_FALSE = @include_ffmpeg_decoder_FALSE@ +include_ffmpeg_decoder_TRUE = @include_ffmpeg_decoder_TRUE@ +include_jack_sink_FALSE = @include_jack_sink_FALSE@ +include_jack_sink_TRUE = @include_jack_sink_TRUE@ +include_mpeg_decoder_FALSE = @include_mpeg_decoder_FALSE@ +include_mpeg_decoder_TRUE = @include_mpeg_decoder_TRUE@ +include_oss_sink_FALSE = @include_oss_sink_FALSE@ +include_oss_sink_TRUE = @include_oss_sink_TRUE@ +include_polyp_sink_FALSE = @include_polyp_sink_FALSE@ +include_polyp_sink_TRUE = @include_polyp_sink_TRUE@ +include_src_resampler_FALSE = @include_src_resampler_FALSE@ +include_src_resampler_TRUE = @include_src_resampler_TRUE@ +include_sun_sink_FALSE = @include_sun_sink_FALSE@ +include_sun_sink_TRUE = @include_sun_sink_TRUE@ +include_xiph_decoder_FALSE = @include_xiph_decoder_FALSE@ +include_xiph_decoder_TRUE = @include_xiph_decoder_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(all_includes) +lib_LTLIBRARIES = libakode_alsa_sink.la +libakode_alsa_sink_la_SOURCES = alsa_sink.cpp +#>- libakode_alsa_sink_la_LDFLAGS = -module -avoid-version -no-undefined +#>+ 1 +libakode_alsa_sink_la_LDFLAGS = -module -avoid-version -no-undefined $(KDE_NO_UNDEFINED) +libakode_alsa_sink_la_LIBADD = ../../lib/libakode.la $(ALSA_LIBS) +#>- all: all-am +#>+ 1 +all: docs-am all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/alsa_sink/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu akode/plugins/alsa_sink/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/alsa_sink/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/alsa_sink/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/alsa_sink/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + 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 + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +#>- libakode_alsa_sink.la: $(libakode_alsa_sink_la_OBJECTS) $(libakode_alsa_sink_la_DEPENDENCIES) +#>+ 2 +@KDE_USE_CLOSURE_TRUE@libakode_alsa_sink.la: libakode_alsa_sink.la.closure $(libakode_alsa_sink_la_OBJECTS) $(libakode_alsa_sink_la_DEPENDENCIES) +@KDE_USE_CLOSURE_FALSE@libakode_alsa_sink.la: $(libakode_alsa_sink_la_OBJECTS) $(libakode_alsa_sink_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libakode_alsa_sink_la_LDFLAGS) $(libakode_alsa_sink_la_OBJECTS) $(libakode_alsa_sink_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsa_sink.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-am +#>+ 1 +clean: kde-rpo-clean clean-am + +#>- clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ +#>- mostlyclean-am +#>+ 2 +clean-am: clean-closures clean-bcheck clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES + +# 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: + +#>+ 8 +libakode_alsa_sink.la.closure: $(libakode_alsa_sink_la_OBJECTS) $(libakode_alsa_sink_la_DEPENDENCIES) + @echo "int main() {return 0;}" > libakode_alsa_sink_la_closure.cpp + @$(LTCXXCOMPILE) -c libakode_alsa_sink_la_closure.cpp + $(CXXLINK) libakode_alsa_sink_la_closure.lo $(libakode_alsa_sink_la_LDFLAGS) $(libakode_alsa_sink_la_OBJECTS) $(libakode_alsa_sink_la_LIBADD) $(LIBS) + @rm -f libakode_alsa_sink_la_closure.* libakode_alsa_sink.la.closure + @echo "timestamp" > libakode_alsa_sink.la.closure + + +#>+ 2 +KDE_DIST=alsa_sink.h Makefile.in Makefile.am + +#>+ 3 +clean-closures: + -rm -f libakode_alsa_sink.la.closure + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/alsa_sink/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/alsa_sink/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/alsa_sink/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-am + +bcheck-am: + @for i in ; do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 3 +final: + $(MAKE) all-am + +#>+ 3 +final-install: + $(MAKE) install-am + +#>+ 3 +no-final: + $(MAKE) all-am + +#>+ 3 +no-final-install: + $(MAKE) install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/akode/plugins/alsa_sink/alsa_sink.cpp b/akode/plugins/alsa_sink/alsa_sink.cpp new file mode 100644 index 0000000..2abad2e --- /dev/null +++ b/akode/plugins/alsa_sink/alsa_sink.cpp @@ -0,0 +1,311 @@ +/* aKode: ALSA Sink + + Copyright (C) 2004-2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <iostream> + +#include <alsa/asoundlib.h> +#include <alsa/pcm.h> + +#include <audioframe.h> +#include "alsa_sink.h" + +/* + * resume from suspend + */ +static int resume(snd_pcm_t *pcm) +{ + int res; + while ((res = snd_pcm_resume(pcm)) == -EAGAIN) + sleep(1); + if (! res) + return 0; + return snd_pcm_prepare(pcm); +} + +namespace aKode { + +extern "C" { ALSASinkPlugin alsa_sink; } + +struct ALSASink::private_data +{ + private_data() : pcm_playback(0), buffer(0), error(false), can_pause(false) {}; + + snd_pcm_t *pcm_playback; + + AudioConfiguration config; + int scale; + int filled, fragmentSize; + int sampleSize; + char* buffer; + bool error; + bool can_pause; +}; + +ALSASink::ALSASink() +{ + m_data = new private_data; +} + +ALSASink::~ALSASink() +{ + close(); + delete m_data; +} + +bool ALSASink::open() +{ + int err = 0; + // open is non-blocking to make it possible to fail when occupied + err = snd_pcm_open(&m_data->pcm_playback, "default", SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK); + if (err < 0) { + m_data->error = true; + return false; + } + + // Set to blocking + snd_pcm_nonblock(m_data->pcm_playback, 0); + + m_data->error = false; + return true; +} + +void ALSASink::close() +{ + if (m_data->pcm_playback) { + snd_pcm_drain(m_data->pcm_playback); + snd_pcm_close(m_data->pcm_playback); + } + m_data->pcm_playback = 0; + m_data->error = false; +} + +int ALSASink::setAudioConfiguration(const AudioConfiguration* config) +{ + if (m_data->error) return -1; + + // Get back to OPEN state (is SETUP state enough with snd_pcm_drop?) + snd_pcm_state_t state = snd_pcm_state( m_data->pcm_playback ); + if (state != SND_PCM_STATE_OPEN) { + close(); + if (!open()) return -1; + } + + int res = 0; + int wid = 1; + m_data->config = *config; + snd_pcm_hw_params_t *hw; + snd_pcm_hw_params_alloca(&hw); + snd_pcm_hw_params_any(m_data->pcm_playback, hw); + snd_pcm_hw_params_set_access(m_data->pcm_playback, hw, SND_PCM_ACCESS_RW_INTERLEAVED); + // Detect format: + snd_pcm_format_t format = SND_PCM_FORMAT_UNKNOWN; + // Test for float, 24 and 32 bit integer. Fall back to 16bit + if (m_data->config.sample_width<0) { + if (snd_pcm_hw_params_test_format(m_data->pcm_playback, hw, SND_PCM_FORMAT_FLOAT ) == 0) { + format = SND_PCM_FORMAT_FLOAT; + m_data->scale = 1; + wid = 4; + goto found_format; + } + // Try 16bit then + m_data->config.sample_width = 16; + res = 1; + } + if (m_data->config.sample_width > 24 && m_data->config.sample_width <=32) { + if (snd_pcm_hw_params_test_format(m_data->pcm_playback, hw, SND_PCM_FORMAT_S32) == 0) { + format = SND_PCM_FORMAT_S32; + m_data->scale = 1<<(32-config->sample_width); + wid = 4; + goto found_format; + } + // Try 24bit then + m_data->config.sample_width = 24; + res = 1; + } + if (m_data->config.sample_width > 16 && m_data->config.sample_width <= 24) { + if (snd_pcm_hw_params_test_format(m_data->pcm_playback, hw, SND_PCM_FORMAT_S24 ) == 0) { + format = SND_PCM_FORMAT_S24; + m_data->scale = 1<<(24-config->sample_width); + wid = 4; + goto found_format; + } + // Try 16bit then + m_data->config.sample_width = 16; + } + // If the driver doesnt support 8 or 16 bit, we will fail completly + if (m_data->config.sample_width<=8) { + format = SND_PCM_FORMAT_S8; + m_data->scale = 1<<(8-config->sample_width); + wid = 1; + goto found_format; + } + else + if (m_data->config.sample_width<=16) { + format = SND_PCM_FORMAT_S16; + m_data->scale = 1<<(16-config->sample_width); + wid = 2; + goto found_format; + } + +found_format: + if (format != SND_PCM_FORMAT_UNKNOWN) + snd_pcm_hw_params_set_format(m_data->pcm_playback, hw, format); + else + return -1; + + unsigned int rate = config->sample_rate; + snd_pcm_hw_params_set_rate_near(m_data->pcm_playback, hw, &rate, 0); + if (m_data->config.sample_rate != rate) { + m_data->config.sample_rate = rate; + res = 1; + } + + snd_pcm_hw_params_set_channels(m_data->pcm_playback, hw, config->channels); + + + m_data->fragmentSize = 1024; + snd_pcm_uframes_t period_size = m_data->fragmentSize / (wid*config->channels); + snd_pcm_hw_params_set_period_size_near(m_data->pcm_playback, hw, &period_size, 0); + + m_data->fragmentSize = period_size * (wid*config->channels); +// std::cerr << "akode: ALSA fragment-size: " << m_data->fragmentSize << "\n"; + + delete m_data->buffer; + m_data->buffer = new char [m_data->fragmentSize]; + m_data->filled = 0; + + if (snd_pcm_hw_params(m_data->pcm_playback, hw) < 0) { + return -1; + } + else { + m_data->can_pause = (snd_pcm_hw_params_can_pause(hw) == 1); + return res; + } +} + +const AudioConfiguration* ALSASink::audioConfiguration() const +{ + return &m_data->config; +} + +template<class T> +bool ALSASink::_writeFrame(AudioFrame* frame) +{ + int channels = m_data->config.channels; + + long i = 0; + T* buffer = (T*)m_data->buffer; + T** data = (T**)frame->data; + while(true) { + if (m_data->filled >= m_data->fragmentSize) + xrun: + { + int frames = snd_pcm_bytes_to_frames(m_data->pcm_playback, m_data->filled); + int status = snd_pcm_writei(m_data->pcm_playback, m_data->buffer, frames); + if (status == -EPIPE) { + snd_pcm_prepare(m_data->pcm_playback); + //std::cerr << "akode: ALSA xrun\n"; + goto xrun; + } + else if (status < 0) return false; + int bytes = snd_pcm_frames_to_bytes(m_data->pcm_playback, status); + if (m_data->filled != bytes) { + int rest = m_data->filled - bytes; + //std::cerr << "akode: ALSA write-remainder: " << rest << "\n"; + memmove(m_data->buffer, m_data->buffer + bytes, rest); + m_data->filled = rest; + } else + m_data->filled = 0; + + } + if (i >= frame->length) break; + for(int j=0; j<channels; j++) { + buffer[m_data->filled/sizeof(T)] = (data[j][i])*m_data->scale; + m_data->filled+=sizeof(T); + } + i++; + } + + if (snd_pcm_state( m_data->pcm_playback ) == SND_PCM_STATE_PREPARED) + snd_pcm_start(m_data->pcm_playback); + + return true; +} + +bool ALSASink::writeFrame(AudioFrame* frame) +{ + if (m_data->error) return false; + if (!frame) return false; + + if ( frame->sample_width != m_data->config.sample_width + || frame->channels != m_data->config.channels + || frame->sample_rate != m_data->config.sample_rate) + { + if (setAudioConfiguration(frame) < 0) + return false; + } + + if ( snd_pcm_state(m_data->pcm_playback) == SND_PCM_STATE_SUSPENDED ) { + int res = ::resume(m_data->pcm_playback); + if (res < 0) + return false; + } + else + if (snd_pcm_state( m_data->pcm_playback ) == SND_PCM_STATE_PAUSED) + snd_pcm_pause(m_data->pcm_playback, 0); + + if (snd_pcm_state( m_data->pcm_playback ) == SND_PCM_STATE_SETUP) + snd_pcm_prepare(m_data->pcm_playback); + + if (frame->sample_width<0) + return _writeFrame<float>(frame); + else + if (frame->sample_width<=8) + return _writeFrame<int8_t>(frame); + else + if (frame->sample_width<=16) + return _writeFrame<int16_t>(frame); + else + if (frame->sample_width<=32) + return _writeFrame<int32_t>(frame); + + return false; +} + +void ALSASink::pause() +{ + if (m_data->error) return; + + if (m_data->can_pause) { + snd_pcm_pause(m_data->pcm_playback, 1); + } + +} + +// Do not confuse this with snd_pcm_resume which is used to resume from a suspend +void ALSASink::resume() +{ + if (m_data->error) return; + + if (snd_pcm_state( m_data->pcm_playback ) == SND_PCM_STATE_PAUSED) + snd_pcm_pause(m_data->pcm_playback, 0); +} + +} // namespace diff --git a/akode/plugins/alsa_sink/alsa_sink.h b/akode/plugins/alsa_sink/alsa_sink.h new file mode 100644 index 0000000..cd8da4e --- /dev/null +++ b/akode/plugins/alsa_sink/alsa_sink.h @@ -0,0 +1,63 @@ +/* aKode: ALSA-Sink + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_ALSA_SINK_H +#define _AKODE_ALSA_SINK_H + +#include "sink.h" + +#include "akode_export.h" + +namespace aKode { + +class AudioConfiguration; +class AudioFrame; + +class ALSASink : public Sink { +public: + ALSASink(); + ~ALSASink(); + bool open(); + void close(); + int setAudioConfiguration(const AudioConfiguration *config); + const AudioConfiguration* audioConfiguration() const; + // Writes blocking + bool writeFrame(AudioFrame *frame); + void pause(); + void resume(); + + struct private_data; +private: + template<class T> bool _writeFrame(AudioFrame *frame); + private_data *m_data; +}; + +class ALSASinkPlugin : public SinkPlugin { +public: + virtual ALSASink* openSink() { + return new ALSASink(); + } +}; + +extern "C" AKODE_EXPORT ALSASinkPlugin alsa_sink; + +} // namespace + +#endif diff --git a/akode/plugins/ffmpeg_decoder/Makefile.am b/akode/plugins/ffmpeg_decoder/Makefile.am new file mode 100644 index 0000000..05021b8 --- /dev/null +++ b/akode/plugins/ffmpeg_decoder/Makefile.am @@ -0,0 +1,8 @@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(AVCODEC_CFLAGS) $(AVFORMAT_CFLAGS) $(all_includes) + +lib_LTLIBRARIES = libakode_ffmpeg_decoder.la + +libakode_ffmpeg_decoder_la_SOURCES = ffmpeg_decoder.cpp + +libakode_ffmpeg_decoder_la_LDFLAGS = -avoid-version -no-undefined $(AVCODEC_LDFLAGS) $(AVFORMAT_LDFLAGS) +libakode_ffmpeg_decoder_la_LIBADD = ../../lib/libakode.la $(AVCODEC_LIBADD) $(AVFORMAT_LIBADD) diff --git a/akode/plugins/ffmpeg_decoder/Makefile.in b/akode/plugins/ffmpeg_decoder/Makefile.in new file mode 100644 index 0000000..b7e749a --- /dev/null +++ b/akode/plugins/ffmpeg_decoder/Makefile.in @@ -0,0 +1,660 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = akode/plugins/ffmpeg_decoder +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/akode/lib/akode_export.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libakode_ffmpeg_decoder_la_DEPENDENCIES = ../../lib/libakode.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libakode_ffmpeg_decoder_la_OBJECTS = ffmpeg_decoder.lo +#>- libakode_ffmpeg_decoder_la_OBJECTS = \ +#>- $(am_libakode_ffmpeg_decoder_la_OBJECTS) +#>+ 1 +libakode_ffmpeg_decoder_la_OBJECTS = ffmpeg_decoder.lo +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/akode/lib +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 2 +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ +#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +#>- $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 3 +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +CXXLD = $(CXX) +#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ +#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +#>+ 2 +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libakode_ffmpeg_decoder_la_SOURCES) +DIST_SOURCES = $(libakode_ffmpeg_decoder_la_SOURCES) +ETAGS = etags +CTAGS = ctags +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AKODE_LIBDL = @AKODE_LIBDL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVCODEC_CFLAGS = @AVCODEC_CFLAGS@ +AVCODEC_LDFLAGS = @AVCODEC_LDFLAGS@ +AVCODEC_LIBADD = @AVCODEC_LIBADD@ +AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ +AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ +AVFORMAT_LIBADD = @AVFORMAT_LIBADD@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBADD = @JACK_LIBADD@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBFLAC = @LIBFLAC@ +LIBOBJS = @LIBOBJS@ +LIBOGGFLAC = @LIBOGGFLAC@ +LIBOSSAUDIO = @LIBOSSAUDIO@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSAMPLERATE = @LIBSAMPLERATE@ +LIBSEM = @LIBSEM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MADLIBS = @MADLIBS@ +MAKEINFO = @MAKEINFO@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POLYP_CFLAGS = @POLYP_CFLAGS@ +POLYP_LDFLAGS = @POLYP_LDFLAGS@ +POLYP_LIBADD = @POLYP_LIBADD@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXLIBS = @SPEEXLIBS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +VERSION = @VERSION@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +akode_SUBDIR_included_FALSE = @akode_SUBDIR_included_FALSE@ +akode_SUBDIR_included_TRUE = @akode_SUBDIR_included_TRUE@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_alsa_sink_FALSE = @include_alsa_sink_FALSE@ +include_alsa_sink_TRUE = @include_alsa_sink_TRUE@ +include_ffmpeg_decoder_FALSE = @include_ffmpeg_decoder_FALSE@ +include_ffmpeg_decoder_TRUE = @include_ffmpeg_decoder_TRUE@ +include_jack_sink_FALSE = @include_jack_sink_FALSE@ +include_jack_sink_TRUE = @include_jack_sink_TRUE@ +include_mpeg_decoder_FALSE = @include_mpeg_decoder_FALSE@ +include_mpeg_decoder_TRUE = @include_mpeg_decoder_TRUE@ +include_oss_sink_FALSE = @include_oss_sink_FALSE@ +include_oss_sink_TRUE = @include_oss_sink_TRUE@ +include_polyp_sink_FALSE = @include_polyp_sink_FALSE@ +include_polyp_sink_TRUE = @include_polyp_sink_TRUE@ +include_src_resampler_FALSE = @include_src_resampler_FALSE@ +include_src_resampler_TRUE = @include_src_resampler_TRUE@ +include_sun_sink_FALSE = @include_sun_sink_FALSE@ +include_sun_sink_TRUE = @include_sun_sink_TRUE@ +include_xiph_decoder_FALSE = @include_xiph_decoder_FALSE@ +include_xiph_decoder_TRUE = @include_xiph_decoder_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(AVCODEC_CFLAGS) $(AVFORMAT_CFLAGS) $(all_includes) +lib_LTLIBRARIES = libakode_ffmpeg_decoder.la +libakode_ffmpeg_decoder_la_SOURCES = ffmpeg_decoder.cpp +#>- libakode_ffmpeg_decoder_la_LDFLAGS = -avoid-version -no-undefined $(AVCODEC_LDFLAGS) $(AVFORMAT_LDFLAGS) +#>+ 1 +libakode_ffmpeg_decoder_la_LDFLAGS = -avoid-version -no-undefined $(KDE_NO_UNDEFINED) $(AVCODEC_LDFLAGS) $(AVFORMAT_LDFLAGS) +libakode_ffmpeg_decoder_la_LIBADD = ../../lib/libakode.la $(AVCODEC_LIBADD) $(AVFORMAT_LIBADD) +#>- all: all-am +#>+ 1 +all: docs-am all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/ffmpeg_decoder/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu akode/plugins/ffmpeg_decoder/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/ffmpeg_decoder/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/ffmpeg_decoder/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/ffmpeg_decoder/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + 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 + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +#>- libakode_ffmpeg_decoder.la: $(libakode_ffmpeg_decoder_la_OBJECTS) $(libakode_ffmpeg_decoder_la_DEPENDENCIES) +#>+ 2 +@KDE_USE_CLOSURE_TRUE@libakode_ffmpeg_decoder.la: libakode_ffmpeg_decoder.la.closure $(libakode_ffmpeg_decoder_la_OBJECTS) $(libakode_ffmpeg_decoder_la_DEPENDENCIES) +@KDE_USE_CLOSURE_FALSE@libakode_ffmpeg_decoder.la: $(libakode_ffmpeg_decoder_la_OBJECTS) $(libakode_ffmpeg_decoder_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libakode_ffmpeg_decoder_la_LDFLAGS) $(libakode_ffmpeg_decoder_la_OBJECTS) $(libakode_ffmpeg_decoder_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffmpeg_decoder.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-am +#>+ 1 +clean: kde-rpo-clean clean-am + +#>- clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ +#>- mostlyclean-am +#>+ 2 +clean-am: clean-closures clean-bcheck clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES + +# 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: + +#>+ 8 +libakode_ffmpeg_decoder.la.closure: $(libakode_ffmpeg_decoder_la_OBJECTS) $(libakode_ffmpeg_decoder_la_DEPENDENCIES) + @echo "int main() {return 0;}" > libakode_ffmpeg_decoder_la_closure.cpp + @$(LTCXXCOMPILE) -c libakode_ffmpeg_decoder_la_closure.cpp + $(CXXLINK) libakode_ffmpeg_decoder_la_closure.lo $(libakode_ffmpeg_decoder_la_LDFLAGS) $(libakode_ffmpeg_decoder_la_OBJECTS) $(libakode_ffmpeg_decoder_la_LIBADD) $(LIBS) + @rm -f libakode_ffmpeg_decoder_la_closure.* libakode_ffmpeg_decoder.la.closure + @echo "timestamp" > libakode_ffmpeg_decoder.la.closure + + +#>+ 2 +KDE_DIST=ffmpeg_decoder.h Makefile.in Makefile.am + +#>+ 3 +clean-closures: + -rm -f libakode_ffmpeg_decoder.la.closure + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/ffmpeg_decoder/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/ffmpeg_decoder/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/ffmpeg_decoder/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-am + +bcheck-am: + @for i in ; do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 3 +final: + $(MAKE) all-am + +#>+ 3 +final-install: + $(MAKE) install-am + +#>+ 3 +no-final: + $(MAKE) all-am + +#>+ 3 +no-final-install: + $(MAKE) install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/akode/plugins/ffmpeg_decoder/ffmpeg_decoder.cpp b/akode/plugins/ffmpeg_decoder/ffmpeg_decoder.cpp new file mode 100644 index 0000000..67156a1 --- /dev/null +++ b/akode/plugins/ffmpeg_decoder/ffmpeg_decoder.cpp @@ -0,0 +1,415 @@ +/* aKode: FFMPEG Decoder + + Copyright (C) 2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "akodelib.h" +// #ifdef HAVE_FFMPEG + +#include "file.h" +#include "audioframe.h" +#include "decoder.h" + +#include <assert.h> +#include <ffmpeg/avcodec.h> +#include <ffmpeg/avformat.h> +#include <ffmpeg/avio.h> + +#include "ffmpeg_decoder.h" +#include <iostream> + +// FFMPEG callbacks +extern "C" { + static int akode_read(void* opaque, unsigned char *buf, int size) + { + aKode::File *file = (aKode::File*)opaque; + return file->read((char*)buf, size); + } + static int akode_write(void* opaque, unsigned char *buf, int size) + { + aKode::File *file = (aKode::File*)opaque; + return file->write((char*)buf, size); + } + static offset_t akode_seek(void* opaque, offset_t pos, int whence) + { + aKode::File *file = (aKode::File*)opaque; + return file->seek(pos, whence); + } +} + +namespace aKode { + + +bool FFMPEGDecoderPlugin::canDecode(File* /*src*/) { + // ### FIXME + return true; +} +/* +void FFMPEGDecoderPlugin::initializeFFMPEG() { + av_register_all(); +}*/ + +extern "C" { FFMPEGDecoderPlugin ffmpeg_decoder; } + +#define FILE_BUFFER_SIZE 8192 + +struct FFMPEGDecoder::private_data +{ + private_data() : audioStream(-1), videoStream(-1), packetSize(0), position(0), + eof(false), error(false), initialized(false), retries(0) {}; + + AVFormatContext* ic; + AVCodec* codec; + AVInputFormat *fmt; + ByteIOContext stream; + + int audioStream; + int videoStream; + + AVPacket packet; + uint8_t* packetData; + int packetSize; + + File *src; + AudioConfiguration config; + + long position; + + bool eof, error; + bool initialized; + int retries; + + unsigned char file_buffer[FILE_BUFFER_SIZE]; + char buffer[AVCODEC_MAX_AUDIO_FRAME_SIZE]; + int buffer_size; +}; + +FFMPEGDecoder::FFMPEGDecoder(File *src) { + d = new private_data; + av_register_all(); + + d->src = src; +} + +FFMPEGDecoder::~FFMPEGDecoder() { + closeFile(); + delete d; +} + + +static bool setAudioConfiguration(AudioConfiguration *config, AVCodecContext *codec_context) +{ + config->sample_rate = codec_context->sample_rate; + config->channels = codec_context->channels; + // I do not know FFMPEGs surround channel ordering + if (config->channels > 2) return false; + config->channel_config = MonoStereo; + // avcodec.h says sample_fmt is not used. I guess it means it is always S16 + switch(codec_context->sample_fmt) { + case SAMPLE_FMT_U8: + config->sample_width = 8; // beware unsigned! + break; + case SAMPLE_FMT_S16: + config->sample_width = 16; + break; +/* disabled because I don't know byte ordering + case SAMPLE_FMT_S24: + config->sample_width = 24; + break; + */ + case SAMPLE_FMT_S32: + config->sample_width = 32; + break; + case SAMPLE_FMT_FLT: + config->sample_width = -32; + break; + default: + return false;; + } + return true; +} + + +bool FFMPEGDecoder::openFile() { + d->src->openRO(); + d->src->fadvise(); + + // The following duplicates what av_open_input_file would normally do + + // url_fdopen + init_put_byte(&d->stream, d->file_buffer, FILE_BUFFER_SIZE, 0, d->src, akode_read, akode_write, akode_seek); + d->stream.is_streamed = !d->src->seekable(); + d->stream.max_packet_size = FILE_BUFFER_SIZE; + + { + // 2048 is PROBE_BUF_SIZE from libavformat/utils.c + AVProbeData pd; + uint8_t buf[2048]; + pd.filename = d->src->filename; + pd.buf = buf; + pd.buf_size = 0; + pd.buf_size = get_buffer(&d->stream, buf, 2048); + d->fmt = av_probe_input_format(&pd, 1); + // Seek back to 0 + // copied from url_fseek + long offset1 = 0 - (d->stream.pos - (d->stream.buf_end - d->stream.buffer)); + if (offset1 >= 0 && offset1 <= (d->stream.buf_end - d->stream.buffer)) { + /* can do the seek inside the buffer */ + d->stream.buf_ptr = d->stream.buffer + offset1; + } else { + if (!d->src->seek(0)) { + d->src->close(); + return false; + } else { + d->stream.pos = 0; + d->stream.buf_ptr = d->file_buffer; + d->stream.buf_end = d->file_buffer; + } + } + } + if (!d->fmt) { + std::cerr << "akode: FFMPEG: Format not found\n"; + closeFile(); + return false; + } + + if (av_open_input_stream(&d->ic, &d->stream, d->src->filename, d->fmt, 0) != 0) + { + closeFile(); + return false; + } + + av_find_stream_info( d->ic ); + + // Find the first a/v streams + d->audioStream = -1; + d->videoStream = -1; + for (int i = 0; i < d->ic->nb_streams; i++) { + if (d->ic->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) + d->audioStream = i; + else + if (d->ic->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO) + d->videoStream = i; + } + if (d->audioStream == -1) + { + std::cerr << "akode: FFMPEG: Audio stream not found\n"; + // for now require an audio stream + closeFile(); + return false; + } + + // Set config + if (!setAudioConfiguration(&d->config, d->ic->streams[d->audioStream]->codec)) + { + closeFile(); + return false; + } + + d->codec = avcodec_find_decoder(d->ic->streams[d->audioStream]->codec->codec_id); + if (!d->codec) { + std::cerr << "akode: FFMPEG: Codec not found\n"; + closeFile(); + return false; + } + avcodec_open( d->ic->streams[d->audioStream]->codec, d->codec ); + + double ffpos = (double)d->ic->streams[d->audioStream]->start_time / (double)AV_TIME_BASE; + d->position = (long)(ffpos * d->config.sample_rate); + + return true; +} + +void FFMPEGDecoder::closeFile() { + if( d->packetSize > 0 ) { + av_free_packet( &d->packet ); + d->packetSize = 0; + } + + if( d->codec ) { + avcodec_close( d->ic->streams[d->audioStream]->codec ); + d->codec = 0; + } + if( d->ic ) { + // make sure av_close_input_file doesn't actually close the file + d->ic->iformat->flags = d->ic->iformat->flags | AVFMT_NOFILE; + av_close_input_file( d->ic ); + d->ic = 0; + } + if (d->src) { + d->src->close(); + } +} + +bool FFMPEGDecoder::readPacket() { + do { + av_init_packet(&d->packet); + if ( av_read_frame(d->ic, &d->packet) < 0 ) { + av_free_packet( &d->packet ); + d->packetSize = 0; + d->packetData = 0; + return false; + } + if (d->packet.stream_index == d->audioStream) { + d->packetSize = d->packet.size; + d->packetData = d->packet.data; + return true; + } + av_free_packet(&d->packet); + } while (true); + + return false; +} + +template<typename T> +static long demux(FFMPEGDecoder::private_data* d, AudioFrame* frame) { + int channels = d->config.channels; + long length = d->buffer_size/(channels*sizeof(T)); + frame->reserveSpace(&d->config, length); + + T offset = 0; + if (frame->sample_width == 8) offset = -128; // convert unsigned to signed + + // Demux into frame + T* buffer = (T*)d->buffer; + T** data = (T**)frame->data; + for(int i=0; i<length; i++) + for(int j=0; j<channels; j++) + data[j][i] = buffer[i*channels+j] + offset; + return length; +} + +bool FFMPEGDecoder::readFrame(AudioFrame* frame) +{ + if (!d->initialized) { + if (!openFile()) { + d->error = true; + return false; + } + d->initialized = true; + } + + if( d->packetSize <= 0 ) + if (!readPacket()) { + std::cerr << "akode: FFMPEG: EOF guessed\n"; + d->eof = true; + return false; + } + + assert(d->packet.stream_index == d->audioStream); + +retry: + int len = avcodec_decode_audio( d->ic->streams[d->audioStream]->codec, + (short*)d->buffer, &d->buffer_size, + d->packetData, d->packetSize ); + + if (len <= 0) { + d->retries++; + if (d->retries > 8) { + std::cerr << "akode: FFMPEG: Decoding failure\n"; + d->error = true; + return false; + } + goto retry; + } else + d->retries = 0; + + d->packetSize -= len; + d->packetData += len; + long length = 0; + switch (d->config.sample_width) { + case 8: + length = demux<int8_t>(d,frame); + break; + case 16: + length = demux<int16_t>(d,frame); + break; + case 32: + length = demux<int32_t>(d,frame); + break; + case -32: + length = demux<float>(d,frame); + break; + default: + assert(false); + } + if (length == 0) return readFrame(frame); + std::cout << "akode: FFMPEG: Frame length: " << length << "\n"; + + if( d->packetSize <= 0 ) + av_free_packet( &d->packet ); + + frame->pos = (d->position*1000)/d->config.sample_rate; + d->position += length; + return true; +} + +long FFMPEGDecoder::length() { + if (!d->initialized) return -1; + // ### Returns only the length of the first stream + double ffmpeglen = (double)d->ic->streams[d->audioStream]->duration / (double)AV_TIME_BASE; + return (long)(ffmpeglen*1000.0); +} + +long FFMPEGDecoder::position() { + if (!d->initialized) return -1; + // ### Replace with FFMPEG native call + return (d->position*1000)/d->config.sample_rate; +} + +bool FFMPEGDecoder::eof() { + return d->eof; +} + +bool FFMPEGDecoder::error() { + return d->error; +} + +bool FFMPEGDecoder::seekable() { + return d->src->seekable(); +} + +bool FFMPEGDecoder::seek(long pos) { + if (!d->initialized) return false; + AVRational time_base = d->ic->streams[d->audioStream]->time_base; + std::cout<< "time base is " << time_base.num << "/" << time_base.den << "\n"; + long ffpos = 0; + { + int div = (pos / (time_base.num*1000)) * time_base.den; + int rem = (pos % (time_base.num*1000)) * time_base.den; + ffpos = div + rem / (time_base.num*1000); + } + std::cout<< "seeking to " << pos << "ms\n"; +// long ffpos = (long)((pos/1000.0)*AV_TIME_BASE); + std::cout<< "seeking to " << ffpos << "pos\n"; + bool res = av_seek_frame(d->ic, d->audioStream, ffpos, 0); + if (res < 0) return false; + else { + d->position = (pos * d->config.sample_rate)/1000; + return true; + } +} + +const AudioConfiguration* FFMPEGDecoder::audioConfiguration() { + if (!d->initialized) return 0; + return &d->config; +} + +} // namespace + +// #endif // HAVE_FFMPEG diff --git a/akode/plugins/ffmpeg_decoder/ffmpeg_decoder.h b/akode/plugins/ffmpeg_decoder/ffmpeg_decoder.h new file mode 100644 index 0000000..1ffda6c --- /dev/null +++ b/akode/plugins/ffmpeg_decoder/ffmpeg_decoder.h @@ -0,0 +1,72 @@ +/* aKode: FFMPEG Decoder + + Copyright (C) 2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_FFMPEG_DECODER_H +#define _AKODE_FFMPEG_DECODER_H + +#include "akodelib.h" +// #ifdef HAVE_FFMPEG + +#include "decoder.h" + +namespace aKode { + +class File; +class AudioFrame; + +class FFMPEGDecoder : public Decoder { +public: + FFMPEGDecoder(File* src); + virtual ~FFMPEGDecoder(); + + virtual bool openFile(); + void closeFile(); + + virtual bool readFrame(AudioFrame*); + virtual long length(); + virtual long position(); + virtual bool seek(long); + virtual bool seekable(); + virtual bool eof(); + virtual bool error(); + + virtual const AudioConfiguration* audioConfiguration(); + + struct private_data; +private: + bool readPacket(); + private_data *d; +}; + + +class FFMPEGDecoderPlugin : public DecoderPlugin { +public: + virtual bool canDecode(File*); + virtual FFMPEGDecoder* openDecoder(File* src) { + return new FFMPEGDecoder(src); + }; +}; + +extern "C" FFMPEGDecoderPlugin ffmpeg_decoder; + +} // namespace + +// #endif // HAVE_FFMPEG +#endif diff --git a/akode/plugins/jack_sink/Makefile.am b/akode/plugins/jack_sink/Makefile.am new file mode 100644 index 0000000..967caea --- /dev/null +++ b/akode/plugins/jack_sink/Makefile.am @@ -0,0 +1,7 @@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(JACK_CFLAGS) $(all_includes) + +lib_LTLIBRARIES = libakode_jack_sink.la + +libakode_jack_sink_la_SOURCES = jack_sink.cpp +libakode_jack_sink_la_LDFLAGS = -module -avoid-version -no-undefined $(JACK_LDFLAGS) +libakode_jack_sink_la_LIBADD = ../../lib/libakode.la $(JACK_LIBADD) diff --git a/akode/plugins/jack_sink/Makefile.in b/akode/plugins/jack_sink/Makefile.in new file mode 100644 index 0000000..69091ba --- /dev/null +++ b/akode/plugins/jack_sink/Makefile.in @@ -0,0 +1,659 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = akode/plugins/jack_sink +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/akode/lib/akode_export.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libakode_jack_sink_la_DEPENDENCIES = ../../lib/libakode.la \ + $(am__DEPENDENCIES_1) +am_libakode_jack_sink_la_OBJECTS = jack_sink.lo +#>- libakode_jack_sink_la_OBJECTS = $(am_libakode_jack_sink_la_OBJECTS) +#>+ 1 +libakode_jack_sink_la_OBJECTS = jack_sink.lo +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/akode/lib +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 2 +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ +#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +#>- $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 3 +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +CXXLD = $(CXX) +#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ +#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +#>+ 2 +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libakode_jack_sink_la_SOURCES) +DIST_SOURCES = $(libakode_jack_sink_la_SOURCES) +ETAGS = etags +CTAGS = ctags +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AKODE_LIBDL = @AKODE_LIBDL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVCODEC_CFLAGS = @AVCODEC_CFLAGS@ +AVCODEC_LDFLAGS = @AVCODEC_LDFLAGS@ +AVCODEC_LIBADD = @AVCODEC_LIBADD@ +AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ +AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ +AVFORMAT_LIBADD = @AVFORMAT_LIBADD@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBADD = @JACK_LIBADD@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBFLAC = @LIBFLAC@ +LIBOBJS = @LIBOBJS@ +LIBOGGFLAC = @LIBOGGFLAC@ +LIBOSSAUDIO = @LIBOSSAUDIO@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSAMPLERATE = @LIBSAMPLERATE@ +LIBSEM = @LIBSEM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MADLIBS = @MADLIBS@ +MAKEINFO = @MAKEINFO@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POLYP_CFLAGS = @POLYP_CFLAGS@ +POLYP_LDFLAGS = @POLYP_LDFLAGS@ +POLYP_LIBADD = @POLYP_LIBADD@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXLIBS = @SPEEXLIBS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +VERSION = @VERSION@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +akode_SUBDIR_included_FALSE = @akode_SUBDIR_included_FALSE@ +akode_SUBDIR_included_TRUE = @akode_SUBDIR_included_TRUE@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_alsa_sink_FALSE = @include_alsa_sink_FALSE@ +include_alsa_sink_TRUE = @include_alsa_sink_TRUE@ +include_ffmpeg_decoder_FALSE = @include_ffmpeg_decoder_FALSE@ +include_ffmpeg_decoder_TRUE = @include_ffmpeg_decoder_TRUE@ +include_jack_sink_FALSE = @include_jack_sink_FALSE@ +include_jack_sink_TRUE = @include_jack_sink_TRUE@ +include_mpeg_decoder_FALSE = @include_mpeg_decoder_FALSE@ +include_mpeg_decoder_TRUE = @include_mpeg_decoder_TRUE@ +include_oss_sink_FALSE = @include_oss_sink_FALSE@ +include_oss_sink_TRUE = @include_oss_sink_TRUE@ +include_polyp_sink_FALSE = @include_polyp_sink_FALSE@ +include_polyp_sink_TRUE = @include_polyp_sink_TRUE@ +include_src_resampler_FALSE = @include_src_resampler_FALSE@ +include_src_resampler_TRUE = @include_src_resampler_TRUE@ +include_sun_sink_FALSE = @include_sun_sink_FALSE@ +include_sun_sink_TRUE = @include_sun_sink_TRUE@ +include_xiph_decoder_FALSE = @include_xiph_decoder_FALSE@ +include_xiph_decoder_TRUE = @include_xiph_decoder_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(JACK_CFLAGS) $(all_includes) +lib_LTLIBRARIES = libakode_jack_sink.la +libakode_jack_sink_la_SOURCES = jack_sink.cpp +#>- libakode_jack_sink_la_LDFLAGS = -module -avoid-version -no-undefined $(JACK_LDFLAGS) +#>+ 1 +libakode_jack_sink_la_LDFLAGS = -module -avoid-version -no-undefined $(KDE_NO_UNDEFINED) $(JACK_LDFLAGS) +libakode_jack_sink_la_LIBADD = ../../lib/libakode.la $(JACK_LIBADD) +#>- all: all-am +#>+ 1 +all: docs-am all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/jack_sink/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu akode/plugins/jack_sink/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/jack_sink/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/jack_sink/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/jack_sink/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + 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 + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +#>- libakode_jack_sink.la: $(libakode_jack_sink_la_OBJECTS) $(libakode_jack_sink_la_DEPENDENCIES) +#>+ 2 +@KDE_USE_CLOSURE_TRUE@libakode_jack_sink.la: libakode_jack_sink.la.closure $(libakode_jack_sink_la_OBJECTS) $(libakode_jack_sink_la_DEPENDENCIES) +@KDE_USE_CLOSURE_FALSE@libakode_jack_sink.la: $(libakode_jack_sink_la_OBJECTS) $(libakode_jack_sink_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libakode_jack_sink_la_LDFLAGS) $(libakode_jack_sink_la_OBJECTS) $(libakode_jack_sink_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jack_sink.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-am +#>+ 1 +clean: kde-rpo-clean clean-am + +#>- clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ +#>- mostlyclean-am +#>+ 2 +clean-am: clean-closures clean-bcheck clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES + +# 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: + +#>+ 8 +libakode_jack_sink.la.closure: $(libakode_jack_sink_la_OBJECTS) $(libakode_jack_sink_la_DEPENDENCIES) + @echo "int main() {return 0;}" > libakode_jack_sink_la_closure.cpp + @$(LTCXXCOMPILE) -c libakode_jack_sink_la_closure.cpp + $(CXXLINK) libakode_jack_sink_la_closure.lo $(libakode_jack_sink_la_LDFLAGS) $(libakode_jack_sink_la_OBJECTS) $(libakode_jack_sink_la_LIBADD) $(LIBS) + @rm -f libakode_jack_sink_la_closure.* libakode_jack_sink.la.closure + @echo "timestamp" > libakode_jack_sink.la.closure + + +#>+ 2 +KDE_DIST=Makefile.in jack_sink.h Makefile.am + +#>+ 3 +clean-closures: + -rm -f libakode_jack_sink.la.closure + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/jack_sink/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/jack_sink/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/jack_sink/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-am + +bcheck-am: + @for i in ; do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 3 +final: + $(MAKE) all-am + +#>+ 3 +final-install: + $(MAKE) install-am + +#>+ 3 +no-final: + $(MAKE) all-am + +#>+ 3 +no-final-install: + $(MAKE) install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/akode/plugins/jack_sink/jack_sink.cpp b/akode/plugins/jack_sink/jack_sink.cpp new file mode 100644 index 0000000..4824165 --- /dev/null +++ b/akode/plugins/jack_sink/jack_sink.cpp @@ -0,0 +1,227 @@ +/* aKode: JACK-Sink + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" + +#ifdef HAVE_STDINT_H +#include <stdint.h> +#elif HAVE_INTTYPES_H +#include <inttypes.h> +#endif +#include <jack/jack.h> + +#include <audioframe.h> +#include <audiobuffer.h> +#include "jack_sink.h" + +#include <iostream> + +namespace aKode { + +extern "C" { JACKSinkPlugin jack_sink; } + +struct JACKSink::private_data +{ + private_data() : left_port(0), right_port(0), client(0), error(false), sample_rate(0), buffer(8),pos(0) {}; +// jack_port_t *input_port; + jack_port_t *left_port; + jack_port_t *right_port; + + jack_client_t *client; + + bool error; + unsigned int sample_rate; + + AudioConfiguration config; + AudioBuffer buffer; + AudioFrame current; + int pos; +}; + +static int process (jack_nframes_t nframes, void *arg) +{ + JACKSink::private_data *m_data = (JACKSink::private_data*)arg; + + jack_default_audio_sample_t *out1=0, *out2=0; + + if (m_data->left_port) + out1 = (jack_default_audio_sample_t *) jack_port_get_buffer (m_data->left_port, nframes); + if (m_data->right_port) + out2 = (jack_default_audio_sample_t *) jack_port_get_buffer (m_data->right_port, nframes); + + if (!out2 && !out1) return 0; + + unsigned int n = 0; + float** buffer = (float**)m_data->current.data; + while(n < nframes) { + if (m_data->pos >= m_data->current.length) { + if (!m_data->buffer.get(&m_data->current, false)) break; + m_data->pos = 0; + buffer = (float**)m_data->current.data; + } + + if (out1) out1[n] = buffer[0][m_data->pos]; + if (out2) out2[n] = buffer[1][m_data->pos]; + + n++; + m_data->pos++; + } + + return n; +} + +static void shutdown (void *arg) +{ + JACKSink::private_data *m_data = (JACKSink::private_data*)arg; + + // Jack has shut down, so the sink is in fatal error. + m_data->error = true; + m_data->buffer.release(); +} + +JACKSink::JACKSink() +{ + m_data = new private_data; +} + +bool JACKSink::open() { + m_data->client = jack_client_new("akode_client"); + if (!m_data->client) { + m_data->error = true; + return false; + } + jack_set_process_callback(m_data->client, process, (void*)m_data); + jack_on_shutdown(m_data->client, shutdown, (void*)m_data); + + m_data->sample_rate = jack_get_sample_rate(m_data->client); +// jack_set_sample_rate_callback(m_data->client, sample_rate, (void*)m_data); + + if (jack_activate(m_data->client)) { + m_data->error = true; + std::cout << "aKode::Jack: Activate failed\n"; + return false; + } + const char** names = jack_get_ports (m_data->client, NULL, NULL, JackPortIsPhysical|JackPortIsInput); + while (*names) { + std::cout << *names << std::endl; + names++; + } + + return true; +} + +JACKSink::~JACKSink() +{ + if (m_data->left_port) + jack_port_unregister(m_data->client, m_data->left_port); + if (m_data->right_port) + jack_port_unregister(m_data->client, m_data->right_port); + if (m_data->client) + jack_deactivate(m_data->client); + delete m_data; +} + +int JACKSink::setAudioConfiguration(const AudioConfiguration* config) +{ + if (m_data->error) return -1; + + int res = 0; + m_data->config = *config; + + if (config->channel_config != MonoStereo ) return -1; + m_data->left_port = jack_port_register (m_data->client, "left", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); + if (jack_connect (m_data->client, jack_port_name (m_data->left_port), "alsa_pcm:playback_1")) { + m_data->error = true; + return -1; + } + if (config->channels > 1) { + m_data->right_port = jack_port_register (m_data->client, "right", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); + if (jack_connect (m_data->client, jack_port_name (m_data->right_port), "alsa_pcm:playback_2")) { + m_data->config.channels = 1; + res = 1; + } + } + + if (config->sample_width != -32) { + res = 1; + m_data->config.sample_width = -32; + } + + if (config->sample_rate != m_data->sample_rate) { + res = 1; + m_data->config.sample_rate = m_data->sample_rate; + } + + return res; +} + +const AudioConfiguration* JACKSink::audioConfiguration() const +{ + return &m_data->config; +} + +template<typename S> +void JACKSink::convertFrame(AudioFrame *in, AudioFrame *out) +{ + float scale = (float)(1<<(in->sample_width-1)); + scale = 1.0/scale; +// float scale = 1; + + out->reserveSpace(&m_data->config, in->length); + + int channels = in->channels; + S** indata = (S**)in->data; + float** outdata = (float**)out->data; + for(int j=0; j<in->length; j++) { + for(int i=0; i<channels; i++) { + outdata[i][j] = scale*indata[i][j]; + } + } +} + +bool JACKSink::writeFrame(AudioFrame* frame) +{ + if ( m_data->error ) return false; + + if ( frame->channels != m_data->config.channels ) + { + if (setAudioConfiguration(frame)!=0) + return false; + } + if (frame->length == 0) return true; + + // this shouldn't really happen + if (frame->sample_width>0) { + AudioFrame out; + if (frame->sample_width<=8) + convertFrame<int8_t>(frame, &out); + else + if (frame->sample_width<=16) + convertFrame<int16_t>(frame, &out); + else + if (frame->sample_width<=32) + convertFrame<int32_t>(frame, &out); + return m_data->buffer.put(&out, true); + } else + return m_data->buffer.put(frame, true); + +} + +} // namespace diff --git a/akode/plugins/jack_sink/jack_sink.h b/akode/plugins/jack_sink/jack_sink.h new file mode 100644 index 0000000..06fabef --- /dev/null +++ b/akode/plugins/jack_sink/jack_sink.h @@ -0,0 +1,60 @@ +/* aKode: JACK-Sink + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_JACK_SINK_H +#define _AKODE_JACK_SINK_H + +#include "sink.h" + +#include "akode_export.h" + +namespace aKode { + +class AudioConfiguration; +class AudioFrame; + +class JACKSink : public Sink { +public: + JACKSink(); + ~JACKSink(); + bool open(); + int setAudioConfiguration(const AudioConfiguration *config); + const AudioConfiguration* audioConfiguration() const; + // Writes blocking + bool writeFrame(AudioFrame *frame); + + struct private_data; +private: + template<class T> void convertFrame(AudioFrame *in, AudioFrame *out); + private_data *m_data; +}; + +class JACKSinkPlugin : public SinkPlugin { +public: + virtual JACKSink* openSink() { + return new JACKSink(); + } +}; + +extern "C" AKODE_EXPORT JACKSinkPlugin jack_sink; + +} // namespace + +#endif diff --git a/akode/plugins/mpc_decoder/Makefile.am b/akode/plugins/mpc_decoder/Makefile.am new file mode 100644 index 0000000..ad7546e --- /dev/null +++ b/akode/plugins/mpc_decoder/Makefile.am @@ -0,0 +1,8 @@ +SUBDIRS = mppdec . +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib -I$(srcdir)/mppdec $(all_includes) + +lib_LTLIBRARIES = libakode_mpc_decoder.la + +libakode_mpc_decoder_la_SOURCES = mpc_decoder.cpp +libakode_mpc_decoder_la_LDFLAGS = -module -avoid-version -no-undefined +libakode_mpc_decoder_la_LIBADD = ../../lib/libakode.la mppdec/libakode_mppdec.la diff --git a/akode/plugins/mpc_decoder/Makefile.in b/akode/plugins/mpc_decoder/Makefile.in new file mode 100644 index 0000000..39866eb --- /dev/null +++ b/akode/plugins/mpc_decoder/Makefile.in @@ -0,0 +1,778 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = akode/plugins/mpc_decoder +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/akode/lib/akode_export.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libakode_mpc_decoder_la_DEPENDENCIES = ../../lib/libakode.la \ + mppdec/libakode_mppdec.la +am_libakode_mpc_decoder_la_OBJECTS = mpc_decoder.lo +#>- libakode_mpc_decoder_la_OBJECTS = \ +#>- $(am_libakode_mpc_decoder_la_OBJECTS) +#>+ 1 +libakode_mpc_decoder_la_OBJECTS = mpc_decoder.lo +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/akode/lib +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 2 +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ +#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +#>- $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 3 +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +CXXLD = $(CXX) +#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ +#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +#>+ 2 +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libakode_mpc_decoder_la_SOURCES) +DIST_SOURCES = $(libakode_mpc_decoder_la_SOURCES) +#>- RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ +#>- html-recursive info-recursive install-data-recursive \ +#>- install-exec-recursive install-info-recursive \ +#>- install-recursive installcheck-recursive installdirs-recursive \ +#>- pdf-recursive ps-recursive uninstall-info-recursive \ +#>- uninstall-recursive +#>+ 6 +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive nmcheck-recursive bcheck-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AKODE_LIBDL = @AKODE_LIBDL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVCODEC_CFLAGS = @AVCODEC_CFLAGS@ +AVCODEC_LDFLAGS = @AVCODEC_LDFLAGS@ +AVCODEC_LIBADD = @AVCODEC_LIBADD@ +AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ +AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ +AVFORMAT_LIBADD = @AVFORMAT_LIBADD@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBADD = @JACK_LIBADD@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBFLAC = @LIBFLAC@ +LIBOBJS = @LIBOBJS@ +LIBOGGFLAC = @LIBOGGFLAC@ +LIBOSSAUDIO = @LIBOSSAUDIO@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSAMPLERATE = @LIBSAMPLERATE@ +LIBSEM = @LIBSEM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MADLIBS = @MADLIBS@ +MAKEINFO = @MAKEINFO@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POLYP_CFLAGS = @POLYP_CFLAGS@ +POLYP_LDFLAGS = @POLYP_LDFLAGS@ +POLYP_LIBADD = @POLYP_LIBADD@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXLIBS = @SPEEXLIBS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +VERSION = @VERSION@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +akode_SUBDIR_included_FALSE = @akode_SUBDIR_included_FALSE@ +akode_SUBDIR_included_TRUE = @akode_SUBDIR_included_TRUE@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_alsa_sink_FALSE = @include_alsa_sink_FALSE@ +include_alsa_sink_TRUE = @include_alsa_sink_TRUE@ +include_ffmpeg_decoder_FALSE = @include_ffmpeg_decoder_FALSE@ +include_ffmpeg_decoder_TRUE = @include_ffmpeg_decoder_TRUE@ +include_jack_sink_FALSE = @include_jack_sink_FALSE@ +include_jack_sink_TRUE = @include_jack_sink_TRUE@ +include_mpeg_decoder_FALSE = @include_mpeg_decoder_FALSE@ +include_mpeg_decoder_TRUE = @include_mpeg_decoder_TRUE@ +include_oss_sink_FALSE = @include_oss_sink_FALSE@ +include_oss_sink_TRUE = @include_oss_sink_TRUE@ +include_polyp_sink_FALSE = @include_polyp_sink_FALSE@ +include_polyp_sink_TRUE = @include_polyp_sink_TRUE@ +include_src_resampler_FALSE = @include_src_resampler_FALSE@ +include_src_resampler_TRUE = @include_src_resampler_TRUE@ +include_sun_sink_FALSE = @include_sun_sink_FALSE@ +include_sun_sink_TRUE = @include_sun_sink_TRUE@ +include_xiph_decoder_FALSE = @include_xiph_decoder_FALSE@ +include_xiph_decoder_TRUE = @include_xiph_decoder_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +SUBDIRS = mppdec . +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib -I$(srcdir)/mppdec $(all_includes) +lib_LTLIBRARIES = libakode_mpc_decoder.la +libakode_mpc_decoder_la_SOURCES = mpc_decoder.cpp +#>- libakode_mpc_decoder_la_LDFLAGS = -module -avoid-version -no-undefined +#>+ 1 +libakode_mpc_decoder_la_LDFLAGS = -module -avoid-version -no-undefined $(KDE_NO_UNDEFINED) +libakode_mpc_decoder_la_LIBADD = ../../lib/libakode.la mppdec/libakode_mppdec.la +#>- all: all-recursive +#>+ 1 +all: docs-am all-recursive + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/mpc_decoder/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu akode/plugins/mpc_decoder/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/mpc_decoder/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/mpc_decoder/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/mpc_decoder/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + 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 + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +#>- libakode_mpc_decoder.la: $(libakode_mpc_decoder_la_OBJECTS) $(libakode_mpc_decoder_la_DEPENDENCIES) +#>+ 2 +@KDE_USE_CLOSURE_TRUE@libakode_mpc_decoder.la: libakode_mpc_decoder.la.closure $(libakode_mpc_decoder_la_OBJECTS) $(libakode_mpc_decoder_la_DEPENDENCIES) +@KDE_USE_CLOSURE_FALSE@libakode_mpc_decoder.la: $(libakode_mpc_decoder_la_OBJECTS) $(libakode_mpc_decoder_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libakode_mpc_decoder_la_LDFLAGS) $(libakode_mpc_decoder_la_OBJECTS) $(libakode_mpc_decoder_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpc_decoder.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-recursive +#>+ 1 +clean: kde-rpo-clean clean-recursive + +#>- clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ +#>- mostlyclean-am +#>+ 2 +clean-am: clean-closures clean-bcheck clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-recursive ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-libLTLIBRARIES install-man \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ + pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-info-am uninstall-libLTLIBRARIES + +# 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: + +#>+ 8 +libakode_mpc_decoder.la.closure: $(libakode_mpc_decoder_la_OBJECTS) $(libakode_mpc_decoder_la_DEPENDENCIES) + @echo "int main() {return 0;}" > libakode_mpc_decoder_la_closure.cpp + @$(LTCXXCOMPILE) -c libakode_mpc_decoder_la_closure.cpp + $(CXXLINK) libakode_mpc_decoder_la_closure.lo $(libakode_mpc_decoder_la_LDFLAGS) $(libakode_mpc_decoder_la_OBJECTS) $(libakode_mpc_decoder_la_LIBADD) $(LIBS) + @rm -f libakode_mpc_decoder_la_closure.* libakode_mpc_decoder.la.closure + @echo "timestamp" > libakode_mpc_decoder.la.closure + + +#>+ 2 +KDE_DIST=mpc_decoder.h Makefile.in Makefile.am + +#>+ 3 +clean-closures: + -rm -f libakode_mpc_decoder.la.closure + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/mpc_decoder/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/mpc_decoder/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/mpc_decoder/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-recursive + +bcheck-am: + @for i in ; do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 3 +final: + $(MAKE) all-am + +#>+ 3 +final-install: + $(MAKE) install-am + +#>+ 3 +no-final: + $(MAKE) all-am + +#>+ 3 +no-final-install: + $(MAKE) install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/akode/plugins/mpc_decoder/mpc_decoder.cpp b/akode/plugins/mpc_decoder/mpc_decoder.cpp new file mode 100644 index 0000000..a355ff4 --- /dev/null +++ b/akode/plugins/mpc_decoder/mpc_decoder.cpp @@ -0,0 +1,218 @@ +/* aKode: Musepack(MPC) Decoder + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +//#ifdef AKODE_COMPILE_MPC + +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#else +#include <stdint.h> +#endif + +#include "file.h" +#include "audioframe.h" + +#include "mpc_dec.h" + +#include "mpc_decoder.h" + +namespace aKode { + +class MPC_reader_impl : public MPC_reader +{ +public: + MPC_reader_impl(aKode::File *file, bool p_seekable) : m_file(file), m_seekable(p_seekable) + { + m_file->openRO(); + m_file->fadvise(); + } + virtual ~MPC_reader_impl() { + m_file->close(); + } + size_t read ( void *ptr, size_t size ) {return m_file->read((char*)ptr,size);} + bool seek ( int offset, int origin ) {return m_file->seek(offset,origin);} + long tell () {return m_file->position();} + long get_size () {return m_file->length();} + bool canseek() {return m_file->seekable();} +private: + aKode::File * m_file; + bool m_seekable; +}; + +bool MPCDecoderPlugin::canDecode(File* src) { + MPC_reader_impl reader(src, true); + StreamInfo si; + + int r = si.ReadStreamInfo(&reader); + return r==0; +} + +extern "C" { MPCDecoderPlugin mpc_decoder; } + +struct MPCDecoder::private_data +{ + private_data(File *src) : reader(src,true), decoder(&reader), + initialized(false), buffer(0), position(0), + eof(false), error(false) + {}; + MPC_reader_impl reader; + StreamInfo si; + MPC_decoder decoder; + + bool initialized; + MPC_SAMPLE_FORMAT *buffer; + + long position; + bool eof; + bool error; + + AudioConfiguration config; +}; + +MPCDecoder::MPCDecoder(File *src) { + m_data = new private_data(src); +} + +MPCDecoder::~MPCDecoder() { + if (m_data->initialized) + delete[] m_data->buffer; + delete m_data; +} + +void MPCDecoder::initialize() { + if (m_data->initialized) return; + + m_data->si.ReadStreamInfo(&m_data->reader); + m_data->error = !m_data->decoder.Initialize(&m_data->si); + m_data->buffer = new MPC_SAMPLE_FORMAT[MPC_decoder::DecodeBufferLength]; + m_data->initialized = true; + + m_data->config.channels = m_data->si.simple.Channels; + m_data->config.sample_rate = m_data->si.simple.SampleFreq; + m_data->config.sample_width = -32; + + if (m_data->config.channels <=2) + m_data->config.channel_config = MonoStereo; + else + m_data->config.channel_config = MultiChannel; + +} +/* +template<int bits> +static inline int32_t scale(float sample) +{ + static const int32_t max = (1<<(bits-1))-1; + + // scale + sample *= max; + + // round + sample += 0.5; + + // clip + if (sample > max) + sample = max; + else + if (sample < -max) + sample = -max; + + return (int32_t)sample; +}*/ + +bool MPCDecoder::readFrame(AudioFrame* frame) { + if (!m_data->initialized) initialize(); + + int status = m_data->decoder.Decode(m_data->buffer); + + if (status == -1) { + m_data->error=true; + return false; + } + if (status == 0) { + m_data->eof=true; + return false; + } + + int channels = m_data->config.channels; + long length = status; + frame->reserveSpace(&m_data->config, length); + m_data->position+=length; + + // Demux into frame + /* + int16_t** data = (int16_t**)frame->data; + for(int i=0; i<length; i++) + for(int j=0; j<channels; j++) { + data[j][i] = scale<16>(m_data->buffer[i*channels+j]); + }*/ + + float** data = (float**)frame->data; + for(int i=0; i<length; i++) + for(int j=0; j<channels; j++) + data[j][i] = m_data->buffer[i*channels+j]; + + frame->pos = position(); + return true; +} + +long MPCDecoder::length() { + if (!m_data->initialized) return -1; + return (long)(m_data->si.GetLength()*1000.0); +} + +long MPCDecoder::position() { + if (!m_data->initialized) return -1; + float mpcpos = ((float)m_data->position)/(float)m_data->si.simple.SampleFreq; + return (long)(mpcpos*1000.0); +} + +bool MPCDecoder::eof() { + return m_data->eof; +} + +bool MPCDecoder::error() { + return m_data->error; +} + +bool MPCDecoder::seekable() { + return m_data->reader.canseek(); +} + +bool MPCDecoder::seek(long pos) { + if (!m_data->initialized) return false; + + long samplepos = (long)((pos*(float)m_data->si.simple.SampleFreq)/1000.0); + + if (m_data->decoder.SeekSample(samplepos)) { + m_data->position = samplepos; + return true; + } + else + return false; +} + +const AudioConfiguration* MPCDecoder::audioConfiguration() { + return &m_data->config; +} + +} // namespace + +//#endif diff --git a/akode/plugins/mpc_decoder/mpc_decoder.h b/akode/plugins/mpc_decoder/mpc_decoder.h new file mode 100644 index 0000000..f88eede --- /dev/null +++ b/akode/plugins/mpc_decoder/mpc_decoder.h @@ -0,0 +1,69 @@ +/* aKode: MPC-Decoder + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_MPC_DECODER_H +#define _AKODE_MPC_DECODER_H + +#include <config.h> +//#ifdef AKODE_COMPILE_MPC + +#include "decoder.h" + +namespace aKode { + +class File; +class AudioBuffer; + +class MPCDecoder : public Decoder { +public: + MPCDecoder(File* src); + virtual ~MPCDecoder(); + + virtual void initialize(); + virtual bool readFrame(AudioFrame* frame); + virtual long length(); + virtual long position(); + virtual bool seek(long); + virtual bool seekable(); + virtual bool eof(); + virtual bool error(); + + virtual const AudioConfiguration* audioConfiguration(); + + struct private_data; +private: + private_data *m_data; +}; + + +class MPCDecoderPlugin : public DecoderPlugin { +public: + virtual bool canDecode(File*); + virtual MPCDecoder* openDecoder(File* src) { + return new MPCDecoder(src); + }; +}; + +extern "C" MPCDecoderPlugin mpc_decoder; + +} // namespace + +//#endif // AKODE_COMPILE_MPC +#endif diff --git a/akode/plugins/mpc_decoder/mppdec/Makefile.am b/akode/plugins/mpc_decoder/mppdec/Makefile.am new file mode 100644 index 0000000..5f6f22a --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/Makefile.am @@ -0,0 +1,7 @@ +INCLUDES = -I$(top_srcdir)/akode/lib $(all_includes) +noinst_LTLIBRARIES = libakode_mppdec.la + +libakode_mppdec_la_SOURCES = bitstream.cpp huffsv46.cpp huffsv7.cpp idtag.cpp mpc_dec.cpp requant.cpp streaminfo.cpp synth_filter.cpp + +# workaround +KDE_OPTIONS = nofinal diff --git a/akode/plugins/mpc_decoder/mppdec/Makefile.in b/akode/plugins/mpc_decoder/mppdec/Makefile.in new file mode 100644 index 0000000..f4f5971 --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/Makefile.in @@ -0,0 +1,619 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = akode/plugins/mpc_decoder/mppdec +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/akode/lib/akode_export.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libakode_mppdec_la_LIBADD = +am_libakode_mppdec_la_OBJECTS = bitstream.lo huffsv46.lo huffsv7.lo \ + idtag.lo mpc_dec.lo requant.lo streaminfo.lo synth_filter.lo +#>- libakode_mppdec_la_OBJECTS = $(am_libakode_mppdec_la_OBJECTS) +#>+ 2 +libakode_mppdec_la_OBJECTS = bitstream.lo huffsv46.lo huffsv7.lo \ + idtag.lo mpc_dec.lo requant.lo streaminfo.lo synth_filter.lo +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/akode/lib +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 2 +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ +#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +#>- $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 3 +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +CXXLD = $(CXX) +#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ +#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +#>+ 2 +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libakode_mppdec_la_SOURCES) +DIST_SOURCES = $(libakode_mppdec_la_SOURCES) +ETAGS = etags +CTAGS = ctags +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AKODE_LIBDL = @AKODE_LIBDL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVCODEC_CFLAGS = @AVCODEC_CFLAGS@ +AVCODEC_LDFLAGS = @AVCODEC_LDFLAGS@ +AVCODEC_LIBADD = @AVCODEC_LIBADD@ +AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ +AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ +AVFORMAT_LIBADD = @AVFORMAT_LIBADD@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBADD = @JACK_LIBADD@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBFLAC = @LIBFLAC@ +LIBOBJS = @LIBOBJS@ +LIBOGGFLAC = @LIBOGGFLAC@ +LIBOSSAUDIO = @LIBOSSAUDIO@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSAMPLERATE = @LIBSAMPLERATE@ +LIBSEM = @LIBSEM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MADLIBS = @MADLIBS@ +MAKEINFO = @MAKEINFO@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POLYP_CFLAGS = @POLYP_CFLAGS@ +POLYP_LDFLAGS = @POLYP_LDFLAGS@ +POLYP_LIBADD = @POLYP_LIBADD@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXLIBS = @SPEEXLIBS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +VERSION = @VERSION@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +akode_SUBDIR_included_FALSE = @akode_SUBDIR_included_FALSE@ +akode_SUBDIR_included_TRUE = @akode_SUBDIR_included_TRUE@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_alsa_sink_FALSE = @include_alsa_sink_FALSE@ +include_alsa_sink_TRUE = @include_alsa_sink_TRUE@ +include_ffmpeg_decoder_FALSE = @include_ffmpeg_decoder_FALSE@ +include_ffmpeg_decoder_TRUE = @include_ffmpeg_decoder_TRUE@ +include_jack_sink_FALSE = @include_jack_sink_FALSE@ +include_jack_sink_TRUE = @include_jack_sink_TRUE@ +include_mpeg_decoder_FALSE = @include_mpeg_decoder_FALSE@ +include_mpeg_decoder_TRUE = @include_mpeg_decoder_TRUE@ +include_oss_sink_FALSE = @include_oss_sink_FALSE@ +include_oss_sink_TRUE = @include_oss_sink_TRUE@ +include_polyp_sink_FALSE = @include_polyp_sink_FALSE@ +include_polyp_sink_TRUE = @include_polyp_sink_TRUE@ +include_src_resampler_FALSE = @include_src_resampler_FALSE@ +include_src_resampler_TRUE = @include_src_resampler_TRUE@ +include_sun_sink_FALSE = @include_sun_sink_FALSE@ +include_sun_sink_TRUE = @include_sun_sink_TRUE@ +include_xiph_decoder_FALSE = @include_xiph_decoder_FALSE@ +include_xiph_decoder_TRUE = @include_xiph_decoder_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +INCLUDES = -I$(top_srcdir)/akode/lib $(all_includes) +noinst_LTLIBRARIES = libakode_mppdec.la +libakode_mppdec_la_SOURCES = bitstream.cpp huffsv46.cpp huffsv7.cpp idtag.cpp mpc_dec.cpp requant.cpp streaminfo.cpp synth_filter.cpp + +# workaround +KDE_OPTIONS = nofinal +#>- all: all-am +#>+ 1 +all: docs-am all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/mpc_decoder/mppdec/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu akode/plugins/mpc_decoder/mppdec/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/mpc_decoder/mppdec/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/mpc_decoder/mppdec/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/mpc_decoder/mppdec/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libakode_mppdec.la: $(libakode_mppdec_la_OBJECTS) $(libakode_mppdec_la_DEPENDENCIES) + $(CXXLINK) $(libakode_mppdec_la_LDFLAGS) $(libakode_mppdec_la_OBJECTS) $(libakode_mppdec_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitstream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/huffsv46.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/huffsv7.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idtag.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpc_dec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/requant.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/streaminfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_filter.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-am +#>+ 1 +clean: kde-rpo-clean clean-am + +#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ +#>- mostlyclean-am +#>+ 2 +clean-am: clean-bcheck clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +#>+ 2 +KDE_DIST=streaminfo.h stdafx.cpp readme.txt requant.h stdafx.h mpc_dec.h mpc_math.h Makefile.in Makefile.am + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/mpc_decoder/mppdec/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/mpc_decoder/mppdec/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/mpc_decoder/mppdec/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-am + +bcheck-am: + @for i in ; do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 3 +final: + $(MAKE) all-am + +#>+ 3 +final-install: + $(MAKE) install-am + +#>+ 3 +no-final: + $(MAKE) all-am + +#>+ 3 +no-final-install: + $(MAKE) install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/akode/plugins/mpc_decoder/mppdec/bitstream.cpp b/akode/plugins/mpc_decoder/mppdec/bitstream.cpp new file mode 100644 index 0000000..6e1714c --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/bitstream.cpp @@ -0,0 +1,166 @@ +#include "stdafx.h" + + +/* C O N S T A N T S */ +const unsigned int mask [33] = { + 0x00000000, 0x00000001, 0x00000003, 0x00000007, + 0x0000000F, 0x0000001F, 0x0000003F, 0x0000007F, + 0x000000FF, 0x000001FF, 0x000003FF, 0x000007FF, + 0x00000FFF, 0x00001FFF, 0x00003FFF, 0x00007FFF, + 0x0000FFFF, 0x0001FFFF, 0x0003FFFF, 0x0007FFFF, + 0x000FFFFF, 0x001FFFFF, 0x003FFFFF, 0x007FFFFF, + 0x00FFFFFF, 0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF, + 0x0FFFFFFF, 0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF, + 0xFFFFFFFF +}; + +/* F U N C T I O N S */ + +// resets bitstream decoding +void +MPC_decoder::Reset_BitstreamDecode ( void ) +{ + dword = 0; + pos = 0; + Zaehler = 0; + WordsRead = 0; +} + +// reports the number of read bits +unsigned int +MPC_decoder::BitsRead ( void ) +{ + return 32*WordsRead + pos; +} + +// read desired number of bits out of the bitstream +unsigned int +MPC_decoder::Bitstream_read ( const unsigned int bits ) +{ + unsigned int out = dword; + + pos += bits; + + if (pos<32) + { + out >>= (32-pos); + } + else + { + dword = Speicher[Zaehler=(Zaehler+1)&MEMMASK]; + pos -= 32; + if (pos) + { + out <<= pos; + out |= dword >> (32-pos); + } + ++WordsRead; + } + + return out & mask[bits]; +} + +// decode huffman +int +MPC_decoder::Huffman_Decode ( const HuffmanTyp* Table ) +{ + // load preview and decode + unsigned int code = dword << pos; + if (pos>18) code |= Speicher[(Zaehler+1)&MEMMASK] >> (32-pos); + while (code < Table->Code) Table++; + + // set the new position within bitstream without performing a dummy-read + if ((pos += Table->Length)>=32) + { + pos -= 32; + dword = Speicher[Zaehler=(Zaehler+1)&MEMMASK]; + ++WordsRead; + } + + return Table->Value; +} + +// faster huffman through previewing less bits +int +MPC_decoder::Huffman_Decode_fast ( const HuffmanTyp* Table ) +{ + // load preview and decode + unsigned int code = dword << pos; + if (pos>22) code |= Speicher[(Zaehler+1)&MEMMASK] >> (32-pos); + while (code < Table->Code) Table++; + + // set the new position within bitstream without performing a dummy-read + if ((pos += Table->Length)>=32) + { + pos -= 32; + dword = Speicher[Zaehler=(Zaehler+1)&MEMMASK]; + ++WordsRead; + } + + return Table->Value; +} + +// even faster huffman through previewing even less bits +int +MPC_decoder::Huffman_Decode_faster ( const HuffmanTyp* Table ) +{ + // load preview and decode + unsigned int code = dword << pos; + if (pos>27) code |= Speicher[(Zaehler+1)&MEMMASK] >> (32-pos); + while (code < Table->Code) Table++; + + // set the new position within bitstream without performing a dummy-read + if ((pos += Table->Length)>=32) + { + pos -= 32; + dword = Speicher[Zaehler=(Zaehler+1)&MEMMASK]; + ++WordsRead; + } + + return Table->Value; +} + +// decode SCFI-bundle (sv4,5,6) +void +MPC_decoder::SCFI_Bundle_read ( const HuffmanTyp* Table, int* SCFI, int* DSCF ) +{ + // load preview and decode + unsigned int code = dword << pos; + if (pos>26) code |= Speicher[(Zaehler+1)&MEMMASK] >> (32-pos); + while (code < Table->Code) Table++; + + // set the new position within bitstream without performing a dummy-read + if ((pos += Table->Length)>=32) + { + pos -= 32; + dword = Speicher[Zaehler=(Zaehler+1)&MEMMASK]; + ++WordsRead; + } + + *SCFI = Table->Value >> 1; + *DSCF = Table->Value & 1; +} + +int +MPC_decoder::HuffmanTyp_cmpfn ( const void* p1, const void* p2 ) +{ + if ( ((const MPC_decoder::HuffmanTyp*) p1)->Code < ((const MPC_decoder::HuffmanTyp*) p2)->Code ) return +1; + if ( ((const MPC_decoder::HuffmanTyp*) p1)->Code > ((const MPC_decoder::HuffmanTyp*) p2)->Code ) return -1; + return 0; +} + +// sort huffman-tables by codeword +// offset resulting value +void +MPC_decoder::Resort_HuffTables ( const unsigned int elements, HuffmanTyp* Table, const int offset ) +{ + unsigned int i; + + for ( i = 0; i < elements; i++ ) { + Table[i].Code <<= 32 - Table[i].Length; + Table[i].Value = i - offset; + } + qsort ( Table, elements, sizeof(*Table), HuffmanTyp_cmpfn ); +} + +/* end of bitstream.c */ diff --git a/akode/plugins/mpc_decoder/mppdec/huffsv46.cpp b/akode/plugins/mpc_decoder/mppdec/huffsv46.cpp new file mode 100644 index 0000000..b71f5c9 --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/huffsv46.cpp @@ -0,0 +1,228 @@ +#include "stdafx.h" + +void +MPC_decoder::Huffman_SV6_Decoder ( void ) +{ + Huffman_SV6_Encoder (); + Resort_HuffTables( 16, Region_A , 0); + Resort_HuffTables( 8, Region_B , 0); + Resort_HuffTables( 4, Region_C , 0); + Resort_HuffTables( 8, SCFI_Bundle , 0); + Resort_HuffTables( 13, DSCF_Entropie , 6); + Resort_HuffTables( 3, Entropie_1 , Dc[1]); + Resort_HuffTables( 5, Entropie_2 , Dc[2]); + Resort_HuffTables( 7, Entropie_3 , Dc[3]); + Resort_HuffTables( 9, Entropie_4 , Dc[4]); + Resort_HuffTables( 15, Entropie_5 , Dc[5]); + Resort_HuffTables( 31, Entropie_6 , Dc[6]); + Resort_HuffTables( 63, Entropie_7 , Dc[7]); +} + +void MPC_decoder::Huffman_SV6_Encoder ( void ) +{ + // SCFI-bundle + SCFI_Bundle[7].Code= 1; SCFI_Bundle[7].Length= 1; + SCFI_Bundle[3].Code= 1; SCFI_Bundle[3].Length= 2; + SCFI_Bundle[5].Code= 0; SCFI_Bundle[5].Length= 3; + SCFI_Bundle[1].Code= 7; SCFI_Bundle[1].Length= 5; + SCFI_Bundle[2].Code= 6; SCFI_Bundle[2].Length= 5; + SCFI_Bundle[4].Code= 4; SCFI_Bundle[4].Length= 5; + SCFI_Bundle[0].Code= 11; SCFI_Bundle[0].Length= 6; + SCFI_Bundle[6].Code= 10; SCFI_Bundle[6].Length= 6; + + // region A (subbands 0..10) + Region_A[ 1].Code= 1; Region_A[ 1].Length= 1; + Region_A[ 2].Code= 0; Region_A[ 2].Length= 2; + Region_A[ 0].Code= 2; Region_A[ 0].Length= 3; + Region_A[ 3].Code= 15; Region_A[ 3].Length= 5; + Region_A[ 5].Code= 13; Region_A[ 5].Length= 5; + Region_A[ 6].Code= 12; Region_A[ 6].Length= 5; + Region_A[ 4].Code= 29; Region_A[ 4].Length= 6; + Region_A[ 7].Code= 57; Region_A[ 7].Length= 7; + Region_A[ 8].Code= 113; Region_A[ 8].Length= 8; + Region_A[ 9].Code= 225; Region_A[ 9].Length= 9; + Region_A[10].Code= 449; Region_A[10].Length= 10; + Region_A[11].Code= 897; Region_A[11].Length= 11; + Region_A[12].Code= 1793; Region_A[12].Length= 12; + Region_A[13].Code= 3585; Region_A[13].Length= 13; + Region_A[14].Code= 7169; Region_A[14].Length= 14; + Region_A[15].Code= 7168; Region_A[15].Length= 14; + + // region B (subbands 11..22) + Region_B[1].Code= 1; Region_B[1].Length= 1; + Region_B[0].Code= 1; Region_B[0].Length= 2; + Region_B[2].Code= 1; Region_B[2].Length= 3; + Region_B[3].Code= 1; Region_B[3].Length= 4; + Region_B[4].Code= 1; Region_B[4].Length= 5; + Region_B[5].Code= 1; Region_B[5].Length= 6; + Region_B[6].Code= 1; Region_B[6].Length= 7; + Region_B[7].Code= 0; Region_B[7].Length= 7; + + // region C (subbands 23..31) + Region_C[0].Code= 1; Region_C[0].Length= 1; + Region_C[1].Code= 1; Region_C[1].Length= 2; + Region_C[2].Code= 1; Region_C[2].Length= 3; + Region_C[3].Code= 0; Region_C[3].Length= 3; + + // DSCF + DSCF_Entropie[ 6].Code= 0; DSCF_Entropie[ 6].Length= 2; + DSCF_Entropie[ 7].Code= 7; DSCF_Entropie[ 7].Length= 3; + DSCF_Entropie[ 5].Code= 4; DSCF_Entropie[ 5].Length= 3; + DSCF_Entropie[ 8].Code= 3; DSCF_Entropie[ 8].Length= 3; + DSCF_Entropie[ 9].Code= 13; DSCF_Entropie[ 9].Length= 4; + DSCF_Entropie[ 4].Code= 11; DSCF_Entropie[ 4].Length= 4; + DSCF_Entropie[10].Code= 10; DSCF_Entropie[10].Length= 4; + DSCF_Entropie[ 2].Code= 4; DSCF_Entropie[ 2].Length= 4; + DSCF_Entropie[11].Code= 25; DSCF_Entropie[11].Length= 5; + DSCF_Entropie[ 3].Code= 24; DSCF_Entropie[ 3].Length= 5; + DSCF_Entropie[ 1].Code= 11; DSCF_Entropie[ 1].Length= 5; + DSCF_Entropie[12].Code= 21; DSCF_Entropie[12].Length= 6; + DSCF_Entropie[ 0].Code= 20; DSCF_Entropie[ 0].Length= 6; + + // first quantizer + Entropie_1[1].Code= 1; Entropie_1[1].Length= 1; + Entropie_1[0].Code= 1; Entropie_1[0].Length= 2; + Entropie_1[2].Code= 0; Entropie_1[2].Length= 2; + + // second quantizer + Entropie_2[2].Code= 3; Entropie_2[2].Length= 2; + Entropie_2[3].Code= 1; Entropie_2[3].Length= 2; + Entropie_2[1].Code= 0; Entropie_2[1].Length= 2; + Entropie_2[4].Code= 5; Entropie_2[4].Length= 3; + Entropie_2[0].Code= 4; Entropie_2[0].Length= 3; + + // third quantizer + Entropie_3[3].Code= 3; Entropie_3[3].Length= 2; + Entropie_3[2].Code= 1; Entropie_3[2].Length= 2; + Entropie_3[4].Code= 0; Entropie_3[4].Length= 2; + Entropie_3[1].Code= 5; Entropie_3[1].Length= 3; + Entropie_3[5].Code= 9; Entropie_3[5].Length= 4; + Entropie_3[0].Code= 17; Entropie_3[0].Length= 5; + Entropie_3[6].Code= 16; Entropie_3[6].Length= 5; + + // forth quantizer + Entropie_4[4].Code= 0; Entropie_4[4].Length= 2; + Entropie_4[5].Code= 6; Entropie_4[5].Length= 3; + Entropie_4[3].Code= 5; Entropie_4[3].Length= 3; + Entropie_4[6].Code= 4; Entropie_4[6].Length= 3; + Entropie_4[2].Code= 3; Entropie_4[2].Length= 3; + Entropie_4[7].Code= 15; Entropie_4[7].Length= 4; + Entropie_4[1].Code= 14; Entropie_4[1].Length= 4; + Entropie_4[0].Code= 5; Entropie_4[0].Length= 4; + Entropie_4[8].Code= 4; Entropie_4[8].Length= 4; + + // fifth quantizer + Entropie_5[7 ].Code= 4; Entropie_5[7 ].Length= 3; + Entropie_5[8 ].Code= 3; Entropie_5[8 ].Length= 3; + Entropie_5[6 ].Code= 2; Entropie_5[6 ].Length= 3; + Entropie_5[9 ].Code= 0; Entropie_5[9 ].Length= 3; + Entropie_5[5 ].Code= 15; Entropie_5[5 ].Length= 4; + Entropie_5[4 ].Code= 13; Entropie_5[4 ].Length= 4; + Entropie_5[10].Code= 12; Entropie_5[10].Length= 4; + Entropie_5[11].Code= 10; Entropie_5[11].Length= 4; + Entropie_5[3 ].Code= 3; Entropie_5[3 ].Length= 4; + Entropie_5[12].Code= 2; Entropie_5[12].Length= 4; + Entropie_5[2 ].Code= 29; Entropie_5[2 ].Length= 5; + Entropie_5[1 ].Code= 23; Entropie_5[1 ].Length= 5; + Entropie_5[13].Code= 22; Entropie_5[13].Length= 5; + Entropie_5[0 ].Code= 57; Entropie_5[0 ].Length= 6; + Entropie_5[14].Code= 56; Entropie_5[14].Length= 6; + + // sixth quantizer + Entropie_6[15].Code= 9; Entropie_6[15].Length= 4; + Entropie_6[16].Code= 8; Entropie_6[16].Length= 4; + Entropie_6[14].Code= 7; Entropie_6[14].Length= 4; + Entropie_6[18].Code= 6; Entropie_6[18].Length= 4; + Entropie_6[17].Code= 5; Entropie_6[17].Length= 4; + Entropie_6[12].Code= 3; Entropie_6[12].Length= 4; + Entropie_6[13].Code= 2; Entropie_6[13].Length= 4; + Entropie_6[19].Code= 0; Entropie_6[19].Length= 4; + Entropie_6[11].Code= 31; Entropie_6[11].Length= 5; + Entropie_6[20].Code= 30; Entropie_6[20].Length= 5; + Entropie_6[10].Code= 29; Entropie_6[10].Length= 5; + Entropie_6[9 ].Code= 27; Entropie_6[9 ].Length= 5; + Entropie_6[21].Code= 26; Entropie_6[21].Length= 5; + Entropie_6[22].Code= 25; Entropie_6[22].Length= 5; + Entropie_6[8 ].Code= 24; Entropie_6[8 ].Length= 5; + Entropie_6[7 ].Code= 23; Entropie_6[7 ].Length= 5; + Entropie_6[23].Code= 21; Entropie_6[23].Length= 5; + Entropie_6[6 ].Code= 9; Entropie_6[6 ].Length= 5; + Entropie_6[24].Code= 3; Entropie_6[24].Length= 5; + Entropie_6[25].Code= 57; Entropie_6[25].Length= 6; + Entropie_6[5 ].Code= 56; Entropie_6[5 ].Length= 6; + Entropie_6[4 ].Code= 45; Entropie_6[4 ].Length= 6; + Entropie_6[26].Code= 41; Entropie_6[26].Length= 6; + Entropie_6[2 ].Code= 40; Entropie_6[2 ].Length= 6; + Entropie_6[27].Code= 17; Entropie_6[27].Length= 6; + Entropie_6[28].Code= 16; Entropie_6[28].Length= 6; + Entropie_6[3 ].Code= 5; Entropie_6[3 ].Length= 6; + Entropie_6[29].Code= 89; Entropie_6[29].Length= 7; + Entropie_6[1 ].Code= 88; Entropie_6[1 ].Length= 7; + Entropie_6[30].Code= 9; Entropie_6[30].Length= 7; + Entropie_6[0 ].Code= 8; Entropie_6[0 ].Length= 7; + + // seventh quantizer + Entropie_7[25].Code= 0; Entropie_7[25].Length= 5; + Entropie_7[37].Code= 1; Entropie_7[37].Length= 5; + Entropie_7[62].Code= 16; Entropie_7[62].Length= 8; + Entropie_7[ 0].Code= 17; Entropie_7[ 0].Length= 8; + Entropie_7[ 3].Code= 9; Entropie_7[ 3].Length= 7; + Entropie_7[ 5].Code= 10; Entropie_7[ 5].Length= 7; + Entropie_7[ 6].Code= 11; Entropie_7[ 6].Length= 7; + Entropie_7[38].Code= 3; Entropie_7[38].Length= 5; + Entropie_7[35].Code= 4; Entropie_7[35].Length= 5; + Entropie_7[33].Code= 5; Entropie_7[33].Length= 5; + Entropie_7[24].Code= 6; Entropie_7[24].Length= 5; + Entropie_7[27].Code= 7; Entropie_7[27].Length= 5; + Entropie_7[26].Code= 8; Entropie_7[26].Length= 5; + Entropie_7[12].Code= 18; Entropie_7[12].Length= 6; + Entropie_7[50].Code= 19; Entropie_7[50].Length= 6; + Entropie_7[29].Code= 10; Entropie_7[29].Length= 5; + Entropie_7[31].Code= 11; Entropie_7[31].Length= 5; + Entropie_7[36].Code= 12; Entropie_7[36].Length= 5; + Entropie_7[34].Code= 13; Entropie_7[34].Length= 5; + Entropie_7[28].Code= 14; Entropie_7[28].Length= 5; + Entropie_7[49].Code= 30; Entropie_7[49].Length= 6; + Entropie_7[56].Code= 62; Entropie_7[56].Length= 7; + Entropie_7[ 7].Code= 63; Entropie_7[ 7].Length= 7; + Entropie_7[32].Code= 16; Entropie_7[32].Length= 5; + Entropie_7[30].Code= 17; Entropie_7[30].Length= 5; + Entropie_7[13].Code= 36; Entropie_7[13].Length= 6; + Entropie_7[55].Code= 74; Entropie_7[55].Length= 7; + Entropie_7[61].Code= 150; Entropie_7[61].Length= 8; + Entropie_7[ 1].Code= 151; Entropie_7[ 1].Length= 8; + Entropie_7[14].Code= 38; Entropie_7[14].Length= 6; + Entropie_7[48].Code= 39; Entropie_7[48].Length= 6; + Entropie_7[ 4].Code= 80; Entropie_7[ 4].Length= 7; + Entropie_7[58].Code= 81; Entropie_7[58].Length= 7; + Entropie_7[47].Code= 41; Entropie_7[47].Length= 6; + Entropie_7[15].Code= 42; Entropie_7[15].Length= 6; + Entropie_7[16].Code= 43; Entropie_7[16].Length= 6; + Entropie_7[54].Code= 88; Entropie_7[54].Length= 7; + Entropie_7[ 8].Code= 89; Entropie_7[ 8].Length= 7; + Entropie_7[17].Code= 45; Entropie_7[17].Length= 6; + Entropie_7[46].Code= 46; Entropie_7[46].Length= 6; + Entropie_7[45].Code= 47; Entropie_7[45].Length= 6; + Entropie_7[53].Code= 96; Entropie_7[53].Length= 7; + Entropie_7[ 9].Code= 97; Entropie_7[ 9].Length= 7; + Entropie_7[43].Code= 49; Entropie_7[43].Length= 6; + Entropie_7[19].Code= 50; Entropie_7[19].Length= 6; + Entropie_7[18].Code= 51; Entropie_7[18].Length= 6; + Entropie_7[44].Code= 52; Entropie_7[44].Length= 6; + Entropie_7[ 2].Code= 212; Entropie_7[ 2].Length= 8; + Entropie_7[60].Code= 213; Entropie_7[60].Length= 8; + Entropie_7[10].Code= 107; Entropie_7[10].Length= 7; + Entropie_7[42].Code= 54; Entropie_7[42].Length= 6; + Entropie_7[41].Code= 55; Entropie_7[41].Length= 6; + Entropie_7[20].Code= 56; Entropie_7[20].Length= 6; + Entropie_7[21].Code= 57; Entropie_7[21].Length= 6; + Entropie_7[52].Code= 116; Entropie_7[52].Length= 7; + Entropie_7[51].Code= 117; Entropie_7[51].Length= 7; + Entropie_7[40].Code= 59; Entropie_7[40].Length= 6; + Entropie_7[22].Code= 60; Entropie_7[22].Length= 6; + Entropie_7[23].Code= 61; Entropie_7[23].Length= 6; + Entropie_7[39].Code= 62; Entropie_7[39].Length= 6; + Entropie_7[11].Code= 126; Entropie_7[11].Length= 7; + Entropie_7[57].Code= 254; Entropie_7[57].Length= 8; + Entropie_7[59].Code= 255; Entropie_7[59].Length= 8; +} diff --git a/akode/plugins/mpc_decoder/mppdec/huffsv7.cpp b/akode/plugins/mpc_decoder/mppdec/huffsv7.cpp new file mode 100644 index 0000000..c0ba0ab --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/huffsv7.cpp @@ -0,0 +1,461 @@ +#include "stdafx.h" + +void +MPC_decoder::Huffman_SV7_Decoder ( void ) +{ + Huffman_SV7_Encoder (); + Resort_HuffTables(10, &HuffHdr[0] , 5); + Resort_HuffTables( 4, &HuffSCFI[0] , 0); + Resort_HuffTables(16, &HuffDSCF[0] , 7); + Resort_HuffTables(27, &HuffQ1[0][0] , 0); + Resort_HuffTables(27, &HuffQ1[1][0] , 0); + Resort_HuffTables(25, &HuffQ2[0][0] , 0); + Resort_HuffTables(25, &HuffQ2[1][0] , 0); + Resort_HuffTables( 7, &HuffQ3[0][0] , Dc[3]); + Resort_HuffTables( 7, &HuffQ3[1][0] , Dc[3]); + Resort_HuffTables( 9, &HuffQ4[0][0] , Dc[4]); + Resort_HuffTables( 9, &HuffQ4[1][0] , Dc[4]); + Resort_HuffTables(15, &HuffQ5[0][0] , Dc[5]); + Resort_HuffTables(15, &HuffQ5[1][0] , Dc[5]); + Resort_HuffTables(31, &HuffQ6[0][0] , Dc[6]); + Resort_HuffTables(31, &HuffQ6[1][0] , Dc[6]); + Resort_HuffTables(63, &HuffQ7[0][0] , Dc[7]); + Resort_HuffTables(63, &HuffQ7[1][0] , Dc[7]); +} + +void +MPC_decoder::Huffman_SV7_Encoder ( void ) +{ + /***************************** SCFI *******************************/ + HuffSCFI[0].Code = 2; HuffSCFI[0].Length = 3; + HuffSCFI[1].Code = 1; HuffSCFI[1].Length = 1; + HuffSCFI[2].Code = 3; HuffSCFI[2].Length = 3; + HuffSCFI[3].Code = 0; HuffSCFI[3].Length = 2; + + /***************************** DSCF *******************************/ + HuffDSCF[ 0].Code = 32; HuffDSCF[ 0].Length = 6; + HuffDSCF[ 1].Code = 4; HuffDSCF[ 1].Length = 5; + HuffDSCF[ 2].Code = 17; HuffDSCF[ 2].Length = 5; + HuffDSCF[ 3].Code = 30; HuffDSCF[ 3].Length = 5; + HuffDSCF[ 4].Code = 13; HuffDSCF[ 4].Length = 4; + HuffDSCF[ 5].Code = 0; HuffDSCF[ 5].Length = 3; + HuffDSCF[ 6].Code = 3; HuffDSCF[ 6].Length = 3; + HuffDSCF[ 7].Code = 9; HuffDSCF[ 7].Length = 4; + HuffDSCF[ 8].Code = 5; HuffDSCF[ 8].Length = 3; + HuffDSCF[ 9].Code = 2; HuffDSCF[ 9].Length = 3; + HuffDSCF[10].Code = 14; HuffDSCF[10].Length = 4; + HuffDSCF[11].Code = 3; HuffDSCF[11].Length = 4; + HuffDSCF[12].Code = 31; HuffDSCF[12].Length = 5; + HuffDSCF[13].Code = 5; HuffDSCF[13].Length = 5; + HuffDSCF[14].Code = 33; HuffDSCF[14].Length = 6; + HuffDSCF[15].Code = 12; HuffDSCF[15].Length = 4; + + /************************* frame-header ***************************/ + /***************** differential quantizer indizes *****************/ + HuffHdr[0].Code = 92; HuffHdr[0].Length = 8; + HuffHdr[1].Code = 47; HuffHdr[1].Length = 7; + HuffHdr[2].Code = 10; HuffHdr[2].Length = 5; + HuffHdr[3].Code = 4; HuffHdr[3].Length = 4; + HuffHdr[4].Code = 0; HuffHdr[4].Length = 2; + HuffHdr[5].Code = 1; HuffHdr[5].Length = 1; + HuffHdr[6].Code = 3; HuffHdr[6].Length = 3; + HuffHdr[7].Code = 22; HuffHdr[7].Length = 6; + HuffHdr[8].Code = 187; HuffHdr[8].Length = 9; + HuffHdr[9].Code = 186; HuffHdr[9].Length = 9; + + /********************** 3-step quantizer **************************/ + /********************* 3 bundled samples **************************/ + //less shaped, book 0 + HuffQ1[0][ 0].Code = 54; HuffQ1[0][ 0].Length = 6; + HuffQ1[0][ 1].Code = 9; HuffQ1[0][ 1].Length = 5; + HuffQ1[0][ 2].Code = 32; HuffQ1[0][ 2].Length = 6; + HuffQ1[0][ 3].Code = 5; HuffQ1[0][ 3].Length = 5; + HuffQ1[0][ 4].Code = 10; HuffQ1[0][ 4].Length = 4; + HuffQ1[0][ 5].Code = 7; HuffQ1[0][ 5].Length = 5; + HuffQ1[0][ 6].Code = 52; HuffQ1[0][ 6].Length = 6; + HuffQ1[0][ 7].Code = 0; HuffQ1[0][ 7].Length = 5; + HuffQ1[0][ 8].Code = 35; HuffQ1[0][ 8].Length = 6; + HuffQ1[0][ 9].Code = 10; HuffQ1[0][ 9].Length = 5; + HuffQ1[0][10].Code = 6; HuffQ1[0][10].Length = 4; + HuffQ1[0][11].Code = 4; HuffQ1[0][11].Length = 5; + HuffQ1[0][12].Code = 11; HuffQ1[0][12].Length = 4; + HuffQ1[0][13].Code = 7; HuffQ1[0][13].Length = 3; + HuffQ1[0][14].Code = 12; HuffQ1[0][14].Length = 4; + HuffQ1[0][15].Code = 3; HuffQ1[0][15].Length = 5; + HuffQ1[0][16].Code = 7; HuffQ1[0][16].Length = 4; + HuffQ1[0][17].Code = 11; HuffQ1[0][17].Length = 5; + HuffQ1[0][18].Code = 34; HuffQ1[0][18].Length = 6; + HuffQ1[0][19].Code = 1; HuffQ1[0][19].Length = 5; + HuffQ1[0][20].Code = 53; HuffQ1[0][20].Length = 6; + HuffQ1[0][21].Code = 6; HuffQ1[0][21].Length = 5; + HuffQ1[0][22].Code = 9; HuffQ1[0][22].Length = 4; + HuffQ1[0][23].Code = 2; HuffQ1[0][23].Length = 5; + HuffQ1[0][24].Code = 33; HuffQ1[0][24].Length = 6; + HuffQ1[0][25].Code = 8; HuffQ1[0][25].Length = 5; + HuffQ1[0][26].Code = 55; HuffQ1[0][26].Length = 6; + + //more shaped, book 1 + HuffQ1[1][ 0].Code = 103; HuffQ1[1][ 0].Length = 8; + HuffQ1[1][ 1].Code = 62; HuffQ1[1][ 1].Length = 7; + HuffQ1[1][ 2].Code = 225; HuffQ1[1][ 2].Length = 9; + HuffQ1[1][ 3].Code = 55; HuffQ1[1][ 3].Length = 7; + HuffQ1[1][ 4].Code = 3; HuffQ1[1][ 4].Length = 4; + HuffQ1[1][ 5].Code = 52; HuffQ1[1][ 5].Length = 7; + HuffQ1[1][ 6].Code = 101; HuffQ1[1][ 6].Length = 8; + HuffQ1[1][ 7].Code = 60; HuffQ1[1][ 7].Length = 7; + HuffQ1[1][ 8].Code = 227; HuffQ1[1][ 8].Length = 9; + HuffQ1[1][ 9].Code = 24; HuffQ1[1][ 9].Length = 6; + HuffQ1[1][10].Code = 0; HuffQ1[1][10].Length = 4; + HuffQ1[1][11].Code = 61; HuffQ1[1][11].Length = 7; + HuffQ1[1][12].Code = 4; HuffQ1[1][12].Length = 4; + HuffQ1[1][13].Code = 1; HuffQ1[1][13].Length = 1; + HuffQ1[1][14].Code = 5; HuffQ1[1][14].Length = 4; + HuffQ1[1][15].Code = 63; HuffQ1[1][15].Length = 7; + HuffQ1[1][16].Code = 1; HuffQ1[1][16].Length = 4; + HuffQ1[1][17].Code = 59; HuffQ1[1][17].Length = 7; + HuffQ1[1][18].Code = 226; HuffQ1[1][18].Length = 9; + HuffQ1[1][19].Code = 57; HuffQ1[1][19].Length = 7; + HuffQ1[1][20].Code = 100; HuffQ1[1][20].Length = 8; + HuffQ1[1][21].Code = 53; HuffQ1[1][21].Length = 7; + HuffQ1[1][22].Code = 2; HuffQ1[1][22].Length = 4; + HuffQ1[1][23].Code = 54; HuffQ1[1][23].Length = 7; + HuffQ1[1][24].Code = 224; HuffQ1[1][24].Length = 9; + HuffQ1[1][25].Code = 58; HuffQ1[1][25].Length = 7; + HuffQ1[1][26].Code = 102; HuffQ1[1][26].Length = 8; + + /********************** 5-step quantizer **************************/ + /********************* 2 bundled samples **************************/ + //less shaped, book 0 + HuffQ2[0][ 0].Code = 89; HuffQ2[0][ 0].Length = 7; + HuffQ2[0][ 1].Code = 47; HuffQ2[0][ 1].Length = 6; + HuffQ2[0][ 2].Code = 15; HuffQ2[0][ 2].Length = 5; + HuffQ2[0][ 3].Code = 0; HuffQ2[0][ 3].Length = 5; + HuffQ2[0][ 4].Code = 91; HuffQ2[0][ 4].Length = 7; + HuffQ2[0][ 5].Code = 4; HuffQ2[0][ 5].Length = 5; + HuffQ2[0][ 6].Code = 6; HuffQ2[0][ 6].Length = 4; + HuffQ2[0][ 7].Code = 13; HuffQ2[0][ 7].Length = 4; + HuffQ2[0][ 8].Code = 4; HuffQ2[0][ 8].Length = 4; + HuffQ2[0][ 9].Code = 5; HuffQ2[0][ 9].Length = 5; + HuffQ2[0][10].Code = 20; HuffQ2[0][10].Length = 5; + HuffQ2[0][11].Code = 12; HuffQ2[0][11].Length = 4; + HuffQ2[0][12].Code = 4; HuffQ2[0][12].Length = 3; + HuffQ2[0][13].Code = 15; HuffQ2[0][13].Length = 4; + HuffQ2[0][14].Code = 14; HuffQ2[0][14].Length = 5; + HuffQ2[0][15].Code = 3; HuffQ2[0][15].Length = 5; + HuffQ2[0][16].Code = 3; HuffQ2[0][16].Length = 4; + HuffQ2[0][17].Code = 14; HuffQ2[0][17].Length = 4; + HuffQ2[0][18].Code = 5; HuffQ2[0][18].Length = 4; + HuffQ2[0][19].Code = 1; HuffQ2[0][19].Length = 5; + HuffQ2[0][20].Code = 90; HuffQ2[0][20].Length = 7; + HuffQ2[0][21].Code = 2; HuffQ2[0][21].Length = 5; + HuffQ2[0][22].Code = 21; HuffQ2[0][22].Length = 5; + HuffQ2[0][23].Code = 46; HuffQ2[0][23].Length = 6; + HuffQ2[0][24].Code = 88; HuffQ2[0][24].Length = 7; + + //more shaped, book 1 + HuffQ2[1][ 0].Code = 921; HuffQ2[1][ 0].Length = 10; + HuffQ2[1][ 1].Code = 113; HuffQ2[1][ 1].Length = 7; + HuffQ2[1][ 2].Code = 51; HuffQ2[1][ 2].Length = 6; + HuffQ2[1][ 3].Code = 231; HuffQ2[1][ 3].Length = 8; + HuffQ2[1][ 4].Code = 922; HuffQ2[1][ 4].Length = 10; + HuffQ2[1][ 5].Code = 104; HuffQ2[1][ 5].Length = 7; + HuffQ2[1][ 6].Code = 30; HuffQ2[1][ 6].Length = 5; + HuffQ2[1][ 7].Code = 0; HuffQ2[1][ 7].Length = 3; + HuffQ2[1][ 8].Code = 29; HuffQ2[1][ 8].Length = 5; + HuffQ2[1][ 9].Code = 105; HuffQ2[1][ 9].Length = 7; + HuffQ2[1][10].Code = 50; HuffQ2[1][10].Length = 6; + HuffQ2[1][11].Code = 1; HuffQ2[1][11].Length = 3; + HuffQ2[1][12].Code = 2; HuffQ2[1][12].Length = 2; + HuffQ2[1][13].Code = 3; HuffQ2[1][13].Length = 3; + HuffQ2[1][14].Code = 49; HuffQ2[1][14].Length = 6; + HuffQ2[1][15].Code = 107; HuffQ2[1][15].Length = 7; + HuffQ2[1][16].Code = 27; HuffQ2[1][16].Length = 5; + HuffQ2[1][17].Code = 2; HuffQ2[1][17].Length = 3; + HuffQ2[1][18].Code = 31; HuffQ2[1][18].Length = 5; + HuffQ2[1][19].Code = 112; HuffQ2[1][19].Length = 7; + HuffQ2[1][20].Code = 920; HuffQ2[1][20].Length = 10; + HuffQ2[1][21].Code = 106; HuffQ2[1][21].Length = 7; + HuffQ2[1][22].Code = 48; HuffQ2[1][22].Length = 6; + HuffQ2[1][23].Code = 114; HuffQ2[1][23].Length = 7; + HuffQ2[1][24].Code = 923; HuffQ2[1][24].Length = 10; + + /********************** 7-step quantizer **************************/ + /*********************** single samples ***************************/ + //less shaped, book 0 + HuffQ3[0][0].Code = 12; HuffQ3[0][0].Length = 4; + HuffQ3[0][1].Code = 4; HuffQ3[0][1].Length = 3; + HuffQ3[0][2].Code = 0; HuffQ3[0][2].Length = 2; + HuffQ3[0][3].Code = 1; HuffQ3[0][3].Length = 2; + HuffQ3[0][4].Code = 7; HuffQ3[0][4].Length = 3; + HuffQ3[0][5].Code = 5; HuffQ3[0][5].Length = 3; + HuffQ3[0][6].Code = 13; HuffQ3[0][6].Length = 4; + + //more shaped, book 1 + HuffQ3[1][0].Code = 4; HuffQ3[1][0].Length = 5; + HuffQ3[1][1].Code = 3; HuffQ3[1][1].Length = 4; + HuffQ3[1][2].Code = 2; HuffQ3[1][2].Length = 2; + HuffQ3[1][3].Code = 3; HuffQ3[1][3].Length = 2; + HuffQ3[1][4].Code = 1; HuffQ3[1][4].Length = 2; + HuffQ3[1][5].Code = 0; HuffQ3[1][5].Length = 3; + HuffQ3[1][6].Code = 5; HuffQ3[1][6].Length = 5; + + /********************** 9-step quantizer **************************/ + /*********************** single samples ***************************/ + //less shaped, book 0 + HuffQ4[0][0].Code = 5; HuffQ4[0][0].Length = 4; + HuffQ4[0][1].Code = 0; HuffQ4[0][1].Length = 3; + HuffQ4[0][2].Code = 4; HuffQ4[0][2].Length = 3; + HuffQ4[0][3].Code = 6; HuffQ4[0][3].Length = 3; + HuffQ4[0][4].Code = 7; HuffQ4[0][4].Length = 3; + HuffQ4[0][5].Code = 5; HuffQ4[0][5].Length = 3; + HuffQ4[0][6].Code = 3; HuffQ4[0][6].Length = 3; + HuffQ4[0][7].Code = 1; HuffQ4[0][7].Length = 3; + HuffQ4[0][8].Code = 4; HuffQ4[0][8].Length = 4; + + //more shaped, book 1 + HuffQ4[1][0].Code = 9; HuffQ4[1][0].Length = 5; + HuffQ4[1][1].Code = 12; HuffQ4[1][1].Length = 4; + HuffQ4[1][2].Code = 3; HuffQ4[1][2].Length = 3; + HuffQ4[1][3].Code = 0; HuffQ4[1][3].Length = 2; + HuffQ4[1][4].Code = 2; HuffQ4[1][4].Length = 2; + HuffQ4[1][5].Code = 7; HuffQ4[1][5].Length = 3; + HuffQ4[1][6].Code = 13; HuffQ4[1][6].Length = 4; + HuffQ4[1][7].Code = 5; HuffQ4[1][7].Length = 4; + HuffQ4[1][8].Code = 8; HuffQ4[1][8].Length = 5; + + /********************* 15-step quantizer **************************/ + /*********************** single samples ***************************/ + //less shaped, book 0 + HuffQ5[0][ 0].Code = 57; HuffQ5[0][ 0].Length = 6; + HuffQ5[0][ 1].Code = 23; HuffQ5[0][ 1].Length = 5; + HuffQ5[0][ 2].Code = 8; HuffQ5[0][ 2].Length = 4; + HuffQ5[0][ 3].Code = 10; HuffQ5[0][ 3].Length = 4; + HuffQ5[0][ 4].Code = 13; HuffQ5[0][ 4].Length = 4; + HuffQ5[0][ 5].Code = 0; HuffQ5[0][ 5].Length = 3; + HuffQ5[0][ 6].Code = 2; HuffQ5[0][ 6].Length = 3; + HuffQ5[0][ 7].Code = 3; HuffQ5[0][ 7].Length = 3; + HuffQ5[0][ 8].Code = 1; HuffQ5[0][ 8].Length = 3; + HuffQ5[0][ 9].Code = 15; HuffQ5[0][ 9].Length = 4; + HuffQ5[0][10].Code = 12; HuffQ5[0][10].Length = 4; + HuffQ5[0][11].Code = 9; HuffQ5[0][11].Length = 4; + HuffQ5[0][12].Code = 29; HuffQ5[0][12].Length = 5; + HuffQ5[0][13].Code = 22; HuffQ5[0][13].Length = 5; + HuffQ5[0][14].Code = 56; HuffQ5[0][14].Length = 6; + + //more shaped, book 1 + HuffQ5[1][ 0].Code = 229; HuffQ5[1][ 0].Length = 8; + HuffQ5[1][ 1].Code = 56; HuffQ5[1][ 1].Length = 6; + HuffQ5[1][ 2].Code = 7; HuffQ5[1][ 2].Length = 5; + HuffQ5[1][ 3].Code = 2; HuffQ5[1][ 3].Length = 4; + HuffQ5[1][ 4].Code = 0; HuffQ5[1][ 4].Length = 3; + HuffQ5[1][ 5].Code = 3; HuffQ5[1][ 5].Length = 3; + HuffQ5[1][ 6].Code = 5; HuffQ5[1][ 6].Length = 3; + HuffQ5[1][ 7].Code = 6; HuffQ5[1][ 7].Length = 3; + HuffQ5[1][ 8].Code = 4; HuffQ5[1][ 8].Length = 3; + HuffQ5[1][ 9].Code = 2; HuffQ5[1][ 9].Length = 3; + HuffQ5[1][10].Code = 15; HuffQ5[1][10].Length = 4; + HuffQ5[1][11].Code = 29; HuffQ5[1][11].Length = 5; + HuffQ5[1][12].Code = 6; HuffQ5[1][12].Length = 5; + HuffQ5[1][13].Code = 115; HuffQ5[1][13].Length = 7; + HuffQ5[1][14].Code = 228; HuffQ5[1][14].Length = 8; + + /********************* 31-step quantizer **************************/ + /*********************** single samples ***************************/ + //less shaped, book 0 + HuffQ6[0][ 0].Code = 65; HuffQ6[0][ 0].Length = 7; + HuffQ6[0][ 1].Code = 6; HuffQ6[0][ 1].Length = 6; + HuffQ6[0][ 2].Code = 44; HuffQ6[0][ 2].Length = 6; + HuffQ6[0][ 3].Code = 45; HuffQ6[0][ 3].Length = 6; + HuffQ6[0][ 4].Code = 59; HuffQ6[0][ 4].Length = 6; + HuffQ6[0][ 5].Code = 13; HuffQ6[0][ 5].Length = 5; + HuffQ6[0][ 6].Code = 17; HuffQ6[0][ 6].Length = 5; + HuffQ6[0][ 7].Code = 19; HuffQ6[0][ 7].Length = 5; + HuffQ6[0][ 8].Code = 23; HuffQ6[0][ 8].Length = 5; + HuffQ6[0][ 9].Code = 21; HuffQ6[0][ 9].Length = 5; + HuffQ6[0][10].Code = 26; HuffQ6[0][10].Length = 5; + HuffQ6[0][11].Code = 30; HuffQ6[0][11].Length = 5; + HuffQ6[0][12].Code = 0; HuffQ6[0][12].Length = 4; + HuffQ6[0][13].Code = 2; HuffQ6[0][13].Length = 4; + HuffQ6[0][14].Code = 5; HuffQ6[0][14].Length = 4; + HuffQ6[0][15].Code = 7; HuffQ6[0][15].Length = 4; + HuffQ6[0][16].Code = 3; HuffQ6[0][16].Length = 4; + HuffQ6[0][17].Code = 4; HuffQ6[0][17].Length = 4; + HuffQ6[0][18].Code = 31; HuffQ6[0][18].Length = 5; + HuffQ6[0][19].Code = 28; HuffQ6[0][19].Length = 5; + HuffQ6[0][20].Code = 25; HuffQ6[0][20].Length = 5; + HuffQ6[0][21].Code = 27; HuffQ6[0][21].Length = 5; + HuffQ6[0][22].Code = 24; HuffQ6[0][22].Length = 5; + HuffQ6[0][23].Code = 20; HuffQ6[0][23].Length = 5; + HuffQ6[0][24].Code = 18; HuffQ6[0][24].Length = 5; + HuffQ6[0][25].Code = 12; HuffQ6[0][25].Length = 5; + HuffQ6[0][26].Code = 2; HuffQ6[0][26].Length = 5; + HuffQ6[0][27].Code = 58; HuffQ6[0][27].Length = 6; + HuffQ6[0][28].Code = 33; HuffQ6[0][28].Length = 6; + HuffQ6[0][29].Code = 7; HuffQ6[0][29].Length = 6; + HuffQ6[0][30].Code = 64; HuffQ6[0][30].Length = 7; + + //more shaped, book 1 + HuffQ6[1][ 0].Code = 6472; HuffQ6[1][ 0].Length = 13; + HuffQ6[1][ 1].Code = 6474; HuffQ6[1][ 1].Length = 13; + HuffQ6[1][ 2].Code = 808; HuffQ6[1][ 2].Length = 10; + HuffQ6[1][ 3].Code = 405; HuffQ6[1][ 3].Length = 9; + HuffQ6[1][ 4].Code = 203; HuffQ6[1][ 4].Length = 8; + HuffQ6[1][ 5].Code = 102; HuffQ6[1][ 5].Length = 7; + HuffQ6[1][ 6].Code = 49; HuffQ6[1][ 6].Length = 6; + HuffQ6[1][ 7].Code = 9; HuffQ6[1][ 7].Length = 5; + HuffQ6[1][ 8].Code = 15; HuffQ6[1][ 8].Length = 5; + HuffQ6[1][ 9].Code = 31; HuffQ6[1][ 9].Length = 5; + HuffQ6[1][10].Code = 2; HuffQ6[1][10].Length = 4; + HuffQ6[1][11].Code = 6; HuffQ6[1][11].Length = 4; + HuffQ6[1][12].Code = 8; HuffQ6[1][12].Length = 4; + HuffQ6[1][13].Code = 11; HuffQ6[1][13].Length = 4; + HuffQ6[1][14].Code = 13; HuffQ6[1][14].Length = 4; + HuffQ6[1][15].Code = 0; HuffQ6[1][15].Length = 3; + HuffQ6[1][16].Code = 14; HuffQ6[1][16].Length = 4; + HuffQ6[1][17].Code = 10; HuffQ6[1][17].Length = 4; + HuffQ6[1][18].Code = 9; HuffQ6[1][18].Length = 4; + HuffQ6[1][19].Code = 5; HuffQ6[1][19].Length = 4; + HuffQ6[1][20].Code = 3; HuffQ6[1][20].Length = 4; + HuffQ6[1][21].Code = 30; HuffQ6[1][21].Length = 5; + HuffQ6[1][22].Code = 14; HuffQ6[1][22].Length = 5; + HuffQ6[1][23].Code = 8; HuffQ6[1][23].Length = 5; + HuffQ6[1][24].Code = 48; HuffQ6[1][24].Length = 6; + HuffQ6[1][25].Code = 103; HuffQ6[1][25].Length = 7; + HuffQ6[1][26].Code = 201; HuffQ6[1][26].Length = 8; + HuffQ6[1][27].Code = 200; HuffQ6[1][27].Length = 8; + HuffQ6[1][28].Code = 1619; HuffQ6[1][28].Length = 11; + HuffQ6[1][29].Code = 6473; HuffQ6[1][29].Length = 13; + HuffQ6[1][30].Code = 6475; HuffQ6[1][30].Length = 13; + + /********************* 63-step quantizer **************************/ + /*********************** single samples ***************************/ + //less shaped, book 0 + HuffQ7[0][ 0].Code = 103; HuffQ7[0][ 0].Length = 8; /* 0.003338 - 01100111 */ + HuffQ7[0][ 1].Code = 153; HuffQ7[0][ 1].Length = 8; /* 0.003766 - 10011001 */ + HuffQ7[0][ 2].Code = 181; HuffQ7[0][ 2].Length = 8; /* 0.004715 - 10110101 */ + HuffQ7[0][ 3].Code = 233; HuffQ7[0][ 3].Length = 8; /* 0.005528 - 11101001 */ + HuffQ7[0][ 4].Code = 64; HuffQ7[0][ 4].Length = 7; /* 0.006677 - 1000000 */ + HuffQ7[0][ 5].Code = 65; HuffQ7[0][ 5].Length = 7; /* 0.007041 - 1000001 */ + HuffQ7[0][ 6].Code = 77; HuffQ7[0][ 6].Length = 7; /* 0.007733 - 1001101 */ + HuffQ7[0][ 7].Code = 81; HuffQ7[0][ 7].Length = 7; /* 0.008296 - 1010001 */ + HuffQ7[0][ 8].Code = 91; HuffQ7[0][ 8].Length = 7; /* 0.009295 - 1011011 */ + HuffQ7[0][ 9].Code = 113; HuffQ7[0][ 9].Length = 7; /* 0.010814 - 1110001 */ + HuffQ7[0][10].Code = 112; HuffQ7[0][10].Length = 7; /* 0.010807 - 1110000 */ + HuffQ7[0][11].Code = 24; HuffQ7[0][11].Length = 6; /* 0.012748 - 011000 */ + HuffQ7[0][12].Code = 29; HuffQ7[0][12].Length = 6; /* 0.013390 - 011101 */ + HuffQ7[0][13].Code = 35; HuffQ7[0][13].Length = 6; /* 0.014224 - 100011 */ + HuffQ7[0][14].Code = 37; HuffQ7[0][14].Length = 6; /* 0.015201 - 100101 */ + HuffQ7[0][15].Code = 41; HuffQ7[0][15].Length = 6; /* 0.016642 - 101001 */ + HuffQ7[0][16].Code = 44; HuffQ7[0][16].Length = 6; /* 0.017292 - 101100 */ + HuffQ7[0][17].Code = 46; HuffQ7[0][17].Length = 6; /* 0.018647 - 101110 */ + HuffQ7[0][18].Code = 51; HuffQ7[0][18].Length = 6; /* 0.020473 - 110011 */ + HuffQ7[0][19].Code = 49; HuffQ7[0][19].Length = 6; /* 0.020152 - 110001 */ + HuffQ7[0][20].Code = 54; HuffQ7[0][20].Length = 6; /* 0.021315 - 110110 */ + HuffQ7[0][21].Code = 55; HuffQ7[0][21].Length = 6; /* 0.021358 - 110111 */ + HuffQ7[0][22].Code = 57; HuffQ7[0][22].Length = 6; /* 0.021700 - 111001 */ + HuffQ7[0][23].Code = 60; HuffQ7[0][23].Length = 6; /* 0.022449 - 111100 */ + HuffQ7[0][24].Code = 0; HuffQ7[0][24].Length = 5; /* 0.023063 - 00000 */ + HuffQ7[0][25].Code = 2; HuffQ7[0][25].Length = 5; /* 0.023854 - 00010 */ + HuffQ7[0][26].Code = 10; HuffQ7[0][26].Length = 5; /* 0.025481 - 01010 */ + HuffQ7[0][27].Code = 5; HuffQ7[0][27].Length = 5; /* 0.024867 - 00101 */ + HuffQ7[0][28].Code = 9; HuffQ7[0][28].Length = 5; /* 0.025352 - 01001 */ + HuffQ7[0][29].Code = 6; HuffQ7[0][29].Length = 5; /* 0.025074 - 00110 */ + HuffQ7[0][30].Code = 13; HuffQ7[0][30].Length = 5; /* 0.025745 - 01101 */ + HuffQ7[0][31].Code = 7; HuffQ7[0][31].Length = 5; /* 0.025195 - 00111 */ + HuffQ7[0][32].Code = 11; HuffQ7[0][32].Length = 5; /* 0.025502 - 01011 */ + HuffQ7[0][33].Code = 15; HuffQ7[0][33].Length = 5; /* 0.026251 - 01111 */ + HuffQ7[0][34].Code = 8; HuffQ7[0][34].Length = 5; /* 0.025260 - 01000 */ + HuffQ7[0][35].Code = 4; HuffQ7[0][35].Length = 5; /* 0.024418 - 00100 */ + HuffQ7[0][36].Code = 3; HuffQ7[0][36].Length = 5; /* 0.023983 - 00011 */ + HuffQ7[0][37].Code = 1; HuffQ7[0][37].Length = 5; /* 0.023697 - 00001 */ + HuffQ7[0][38].Code = 63; HuffQ7[0][38].Length = 6; /* 0.023041 - 111111 */ + HuffQ7[0][39].Code = 62; HuffQ7[0][39].Length = 6; /* 0.022656 - 111110 */ + HuffQ7[0][40].Code = 61; HuffQ7[0][40].Length = 6; /* 0.022549 - 111101 */ + HuffQ7[0][41].Code = 53; HuffQ7[0][41].Length = 6; /* 0.021151 - 110101 */ + HuffQ7[0][42].Code = 59; HuffQ7[0][42].Length = 6; /* 0.022042 - 111011 */ + HuffQ7[0][43].Code = 52; HuffQ7[0][43].Length = 6; /* 0.020837 - 110100 */ + HuffQ7[0][44].Code = 48; HuffQ7[0][44].Length = 6; /* 0.019446 - 110000 */ + HuffQ7[0][45].Code = 47; HuffQ7[0][45].Length = 6; /* 0.019189 - 101111 */ + HuffQ7[0][46].Code = 43; HuffQ7[0][46].Length = 6; /* 0.017177 - 101011 */ + HuffQ7[0][47].Code = 42; HuffQ7[0][47].Length = 6; /* 0.017035 - 101010 */ + HuffQ7[0][48].Code = 39; HuffQ7[0][48].Length = 6; /* 0.015287 - 100111 */ + HuffQ7[0][49].Code = 36; HuffQ7[0][49].Length = 6; /* 0.014559 - 100100 */ + HuffQ7[0][50].Code = 33; HuffQ7[0][50].Length = 6; /* 0.014117 - 100001 */ + HuffQ7[0][51].Code = 28; HuffQ7[0][51].Length = 6; /* 0.012776 - 011100 */ + HuffQ7[0][52].Code = 117; HuffQ7[0][52].Length = 7; /* 0.011107 - 1110101 */ + HuffQ7[0][53].Code = 101; HuffQ7[0][53].Length = 7; /* 0.010636 - 1100101 */ + HuffQ7[0][54].Code = 100; HuffQ7[0][54].Length = 7; /* 0.009751 - 1100100 */ + HuffQ7[0][55].Code = 80; HuffQ7[0][55].Length = 7; /* 0.008132 - 1010000 */ + HuffQ7[0][56].Code = 69; HuffQ7[0][56].Length = 7; /* 0.007091 - 1000101 */ + HuffQ7[0][57].Code = 68; HuffQ7[0][57].Length = 7; /* 0.007084 - 1000100 */ + HuffQ7[0][58].Code = 50; HuffQ7[0][58].Length = 7; /* 0.006277 - 0110010 */ + HuffQ7[0][59].Code = 232; HuffQ7[0][59].Length = 8; /* 0.005386 - 11101000 */ + HuffQ7[0][60].Code = 180; HuffQ7[0][60].Length = 8; /* 0.004408 - 10110100 */ + HuffQ7[0][61].Code = 152; HuffQ7[0][61].Length = 8; /* 0.003759 - 10011000 */ + HuffQ7[0][62].Code = 102; HuffQ7[0][62].Length = 8; /* 0.003160 - 01100110 */ + + //more shaped, book 1 + HuffQ7[1][ 0].Code = 14244; HuffQ7[1][ 0].Length = 14; /* 0.000059 - 11011110100100 */ + HuffQ7[1][ 1].Code = 14253; HuffQ7[1][ 1].Length = 14; /* 0.000098 - 11011110101101 */ + HuffQ7[1][ 2].Code = 14246; HuffQ7[1][ 2].Length = 14; /* 0.000078 - 11011110100110 */ + HuffQ7[1][ 3].Code = 14254; HuffQ7[1][ 3].Length = 14; /* 0.000111 - 11011110101110 */ + HuffQ7[1][ 4].Code = 3562; HuffQ7[1][ 4].Length = 12; /* 0.000320 - 110111101010 */ + HuffQ7[1][ 5].Code = 752; HuffQ7[1][ 5].Length = 10; /* 0.000920 - 1011110000 */ + HuffQ7[1][ 6].Code = 753; HuffQ7[1][ 6].Length = 10; /* 0.001057 - 1011110001 */ + HuffQ7[1][ 7].Code = 160; HuffQ7[1][ 7].Length = 9; /* 0.001403 - 010100000 */ + HuffQ7[1][ 8].Code = 162; HuffQ7[1][ 8].Length = 9; /* 0.001579 - 010100010 */ + HuffQ7[1][ 9].Code = 444; HuffQ7[1][ 9].Length = 9; /* 0.002486 - 110111100 */ + HuffQ7[1][10].Code = 122; HuffQ7[1][10].Length = 8; /* 0.003772 - 01111010 */ + HuffQ7[1][11].Code = 223; HuffQ7[1][11].Length = 8; /* 0.005710 - 11011111 */ + HuffQ7[1][12].Code = 60; HuffQ7[1][12].Length = 7; /* 0.006858 - 0111100 */ + HuffQ7[1][13].Code = 73; HuffQ7[1][13].Length = 7; /* 0.008033 - 1001001 */ + HuffQ7[1][14].Code = 110; HuffQ7[1][14].Length = 7; /* 0.009827 - 1101110 */ + HuffQ7[1][15].Code = 14; HuffQ7[1][15].Length = 6; /* 0.012601 - 001110 */ + HuffQ7[1][16].Code = 24; HuffQ7[1][16].Length = 6; /* 0.013194 - 011000 */ + HuffQ7[1][17].Code = 25; HuffQ7[1][17].Length = 6; /* 0.013938 - 011001 */ + HuffQ7[1][18].Code = 34; HuffQ7[1][18].Length = 6; /* 0.015693 - 100010 */ + HuffQ7[1][19].Code = 37; HuffQ7[1][19].Length = 6; /* 0.017846 - 100101 */ + HuffQ7[1][20].Code = 54; HuffQ7[1][20].Length = 6; /* 0.020078 - 110110 */ + HuffQ7[1][21].Code = 3; HuffQ7[1][21].Length = 5; /* 0.022975 - 00011 */ + HuffQ7[1][22].Code = 9; HuffQ7[1][22].Length = 5; /* 0.025631 - 01001 */ + HuffQ7[1][23].Code = 11; HuffQ7[1][23].Length = 5; /* 0.027021 - 01011 */ + HuffQ7[1][24].Code = 16; HuffQ7[1][24].Length = 5; /* 0.031465 - 10000 */ + HuffQ7[1][25].Code = 19; HuffQ7[1][25].Length = 5; /* 0.034244 - 10011 */ + HuffQ7[1][26].Code = 21; HuffQ7[1][26].Length = 5; /* 0.035921 - 10101 */ + HuffQ7[1][27].Code = 24; HuffQ7[1][27].Length = 5; /* 0.037938 - 11000 */ + HuffQ7[1][28].Code = 26; HuffQ7[1][28].Length = 5; /* 0.039595 - 11010 */ + HuffQ7[1][29].Code = 29; HuffQ7[1][29].Length = 5; /* 0.041546 - 11101 */ + HuffQ7[1][30].Code = 31; HuffQ7[1][30].Length = 5; /* 0.042623 - 11111 */ + HuffQ7[1][31].Code = 2; HuffQ7[1][31].Length = 4; /* 0.045180 - 0010 */ + HuffQ7[1][32].Code = 0; HuffQ7[1][32].Length = 4; /* 0.043151 - 0000 */ + HuffQ7[1][33].Code = 30; HuffQ7[1][33].Length = 5; /* 0.042538 - 11110 */ + HuffQ7[1][34].Code = 28; HuffQ7[1][34].Length = 5; /* 0.041422 - 11100 */ + HuffQ7[1][35].Code = 25; HuffQ7[1][35].Length = 5; /* 0.039145 - 11001 */ + HuffQ7[1][36].Code = 22; HuffQ7[1][36].Length = 5; /* 0.036691 - 10110 */ + HuffQ7[1][37].Code = 20; HuffQ7[1][37].Length = 5; /* 0.034955 - 10100 */ + HuffQ7[1][38].Code = 14; HuffQ7[1][38].Length = 5; /* 0.029155 - 01110 */ + HuffQ7[1][39].Code = 13; HuffQ7[1][39].Length = 5; /* 0.027921 - 01101 */ + HuffQ7[1][40].Code = 8; HuffQ7[1][40].Length = 5; /* 0.025553 - 01000 */ + HuffQ7[1][41].Code = 6; HuffQ7[1][41].Length = 5; /* 0.023093 - 00110 */ + HuffQ7[1][42].Code = 2; HuffQ7[1][42].Length = 5; /* 0.021200 - 00010 */ + HuffQ7[1][43].Code = 46; HuffQ7[1][43].Length = 6; /* 0.018134 - 101110 */ + HuffQ7[1][44].Code = 35; HuffQ7[1][44].Length = 6; /* 0.015824 - 100011 */ + HuffQ7[1][45].Code = 31; HuffQ7[1][45].Length = 6; /* 0.014701 - 011111 */ + HuffQ7[1][46].Code = 21; HuffQ7[1][46].Length = 6; /* 0.013187 - 010101 */ + HuffQ7[1][47].Code = 15; HuffQ7[1][47].Length = 6; /* 0.012776 - 001111 */ + HuffQ7[1][48].Code = 95; HuffQ7[1][48].Length = 7; /* 0.009664 - 1011111 */ + HuffQ7[1][49].Code = 72; HuffQ7[1][49].Length = 7; /* 0.007922 - 1001000 */ + HuffQ7[1][50].Code = 41; HuffQ7[1][50].Length = 7; /* 0.006838 - 0101001 */ + HuffQ7[1][51].Code = 189; HuffQ7[1][51].Length = 8; /* 0.005024 - 10111101 */ + HuffQ7[1][52].Code = 123; HuffQ7[1][52].Length = 8; /* 0.003830 - 01111011 */ + HuffQ7[1][53].Code = 377; HuffQ7[1][53].Length = 9; /* 0.002232 - 101111001 */ + HuffQ7[1][54].Code = 161; HuffQ7[1][54].Length = 9; /* 0.001566 - 010100001 */ + HuffQ7[1][55].Code = 891; HuffQ7[1][55].Length = 10; /* 0.001383 - 1101111011 */ + HuffQ7[1][56].Code = 327; HuffQ7[1][56].Length = 10; /* 0.000900 - 0101000111 */ + HuffQ7[1][57].Code = 326; HuffQ7[1][57].Length = 10; /* 0.000790 - 0101000110 */ + HuffQ7[1][58].Code = 3560; HuffQ7[1][58].Length = 12; /* 0.000254 - 110111101000 */ + HuffQ7[1][59].Code = 14255; HuffQ7[1][59].Length = 14; /* 0.000117 - 11011110101111 */ + HuffQ7[1][60].Code = 14247; HuffQ7[1][60].Length = 14; /* 0.000085 - 11011110100111 */ + HuffQ7[1][61].Code = 14252; HuffQ7[1][61].Length = 14; /* 0.000085 - 11011110101100 */ + HuffQ7[1][62].Code = 14245; HuffQ7[1][62].Length = 14; /* 0.000065 - 11011110100101 */ +} diff --git a/akode/plugins/mpc_decoder/mppdec/idtag.cpp b/akode/plugins/mpc_decoder/mppdec/idtag.cpp new file mode 100644 index 0000000..0b26833 --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/idtag.cpp @@ -0,0 +1,66 @@ +#include "stdafx.h" + +StreamInfo::StreamInfo () +{ + memset ( &simple, 0, sizeof (simple) ); +} + +MPC_INT64 StreamInfo::GetLenthSamples() +{ + MPC_INT64 samples = (MPC_INT64)simple.Frames * MPC_decoder::FrameLength; + if ( simple.IsTrueGapless ) { + samples -= (MPC_decoder::FrameLength - simple.LastFrameSamples); + } else { + samples -= MPC_decoder::SynthDelay; + } + return samples; +} + +double StreamInfo::GetLength() +{ + return (double)GetLenthSamples() / (double)simple.SampleFreq; +} + + + +// searches for a ID3v2-tag and reads the length (in bytes) of it +// -1 on errors of any kind + +long +JumpID3v2 ( MPC_reader* fp ) +{ + unsigned char tmp [10]; + unsigned int Unsynchronisation; // ID3v2.4-flag + unsigned int ExtHeaderPresent; // ID3v2.4-flag + unsigned int ExperimentalFlag; // ID3v2.4-flag + unsigned int FooterPresent; // ID3v2.4-flag + long ret; + + fp->read ( tmp, sizeof(tmp) ); + + // check id3-tag + if ( 0 != memcmp ( tmp, "ID3", 3) ) + return 0; + + // read flags + Unsynchronisation = tmp[5] & 0x80; + ExtHeaderPresent = tmp[5] & 0x40; + ExperimentalFlag = tmp[5] & 0x20; + FooterPresent = tmp[5] & 0x10; + + if ( tmp[5] & 0x0F ) + return -1; // not (yet???) allowed + if ( (tmp[6] | tmp[7] | tmp[8] | tmp[9]) & 0x80 ) + return -1; // not allowed + + // read HeaderSize (syncsave: 4 * $0xxxxxxx = 28 significant bits) + ret = tmp[6] << 21; + ret += tmp[7] << 14; + ret += tmp[8] << 7; + ret += tmp[9] ; + ret += 10; + if ( FooterPresent ) + ret += 10; + + return ret; +} diff --git a/akode/plugins/mpc_decoder/mppdec/mpc_dec.cpp b/akode/plugins/mpc_decoder/mppdec/mpc_dec.cpp new file mode 100644 index 0000000..1ecb130 --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/mpc_dec.cpp @@ -0,0 +1,1074 @@ +#include "stdafx.h" + +void +MPC_decoder::RESET_Synthesis ( void ) +{ + Reset_V (); +} + +void +MPC_decoder::RESET_Y ( void ) +{ + memset ( Y_L, 0, sizeof Y_L ); + memset ( Y_R, 0, sizeof Y_R ); +} + +void +MPC_decoder::RESET_Globals ( void ) +{ + Reset_BitstreamDecode (); + + DecodedFrames = 0; + StreamVersion = 0; + MS_used = 0; + + memset ( Y_L , 0, sizeof Y_L ); + memset ( Y_R , 0, sizeof Y_R ); + memset ( SCF_Index_L , 0, sizeof SCF_Index_L ); + memset ( SCF_Index_R , 0, sizeof SCF_Index_R ); + memset ( Res_L , 0, sizeof Res_L ); + memset ( Res_R , 0, sizeof Res_R ); + memset ( SCFI_L , 0, sizeof SCFI_L ); + memset ( SCFI_R , 0, sizeof SCFI_R ); + memset ( DSCF_Flag_L , 0, sizeof DSCF_Flag_L ); + memset ( DSCF_Flag_R , 0, sizeof DSCF_Flag_R ); + memset ( DSCF_Reference_L, 0, sizeof DSCF_Reference_L ); + memset ( DSCF_Reference_R, 0, sizeof DSCF_Reference_R ); + memset ( Q , 0, sizeof Q ); + memset ( MS_Flag , 0, sizeof MS_Flag ); +} + +unsigned int +MPC_decoder::decode_internal ( MPC_SAMPLE_FORMAT *buffer ) +{ + unsigned int output_frame_length = FrameLength; + + unsigned int FrameBitCnt = 0; + + if ( DecodedFrames >= OverallFrames ) + return (unsigned int)(-1); // end of file -> abort decoding + + // read jump-info for validity check of frame + FwdJumpInfo = Bitstream_read (20); + SeekTable [DecodedFrames] = 20 + FwdJumpInfo; // ... + + ActDecodePos = (Zaehler << 5) + pos; + + // decode data and check for validity of frame + FrameBitCnt = BitsRead (); + switch ( StreamVersion ) { + case 0x04: + case 0x05: + case 0x06: + Lese_Bitstrom_SV6 (); + break; + case 0x07: + case 0x17: + Lese_Bitstrom_SV7 (); + break; + default: + return (unsigned int)(-1); + } + FrameWasValid = BitsRead() - FrameBitCnt == FwdJumpInfo; + + // synthesize signal + Requantisierung ( Max_Band ); + + //if ( EQ_activated && PluginSettings.EQbyMPC ) + // perform_EQ (); + + Synthese_Filter_float ( buffer ); + + + DecodedFrames++; + + // cut off first SynthDelay zero-samples + if ( DecodedFrames == OverallFrames && StreamVersion >= 6 ) + { // reconstruct exact filelength + int mod_block = Bitstream_read (11); + int FilterDecay; + + if (mod_block == 0) mod_block = 1152; // Encoder bugfix + FilterDecay = (mod_block + SynthDelay) % FrameLength; + + // additional FilterDecay samples are needed for decay of synthesis filter + if ( SynthDelay + mod_block >= FrameLength ) { + + // ********************************************************************** + // Rhoades 4/16/2002 + // Commented out are blocks of code which cause gapless playback to fail. + // Temporary fix... + // ********************************************************************** + + if ( ! TrueGaplessPresent ) { + RESET_Y (); + } else { + //if ( FrameLength != LastValidSamples ) { + Bitstream_read (20); + Lese_Bitstrom_SV7 (); + Requantisierung ( Max_Band ); + //FilterDecay = LastValidSamples; + //} + //else { + //FilterDecay = 0; + //} + } + + Synthese_Filter_float ( buffer + 2304 ); + + output_frame_length = FrameLength + FilterDecay; + } + else { // there are only FilterDecay samples needed for this frame + output_frame_length = FilterDecay; + } + } + + if ( samples_to_skip ) { + if (output_frame_length < samples_to_skip) + { + samples_to_skip -= output_frame_length; + output_frame_length = 0; + } + else + { + output_frame_length -= samples_to_skip; + memmove ( buffer, buffer + samples_to_skip * 2, output_frame_length * 2 * sizeof (MPC_SAMPLE_FORMAT) ); + samples_to_skip = 0; + } + } + + return output_frame_length; + +} + +unsigned int MPC_decoder::Decode ( MPC_SAMPLE_FORMAT *buffer, unsigned int * vbr_update_acc, unsigned int * vbr_update_bits ) +{ + for(;;) + { + const int MaxBrokenFrames = 0; // PluginSettings.MaxBrokenFrames + + unsigned int RING = Zaehler; + int vbr_ring = (RING << 5) + pos; + + unsigned int valid_samples = decode_internal ( buffer ); + + if ( valid_samples == (unsigned int)(-1) ) return 0; + + /**************** ERROR CONCEALMENT *****************/ + if ( FrameWasValid == 0 ) { // error occurred in bitstream + return (unsigned int)(-1); + } else + { + if (vbr_update_acc && vbr_update_bits) + { + (*vbr_update_acc) ++; + vbr_ring = (Zaehler << 5) + pos - vbr_ring; + if (vbr_ring < 0) vbr_ring += 524288; + (*vbr_update_bits) += vbr_ring; + } + + } + UpdateBuffer ( RING ); + + if (valid_samples > 0) return valid_samples; + } +} + +void +MPC_decoder::Requantisierung ( const int Last_Band ) +{ + int Band; + int n; + MPC_SAMPLE_FORMAT facL; + MPC_SAMPLE_FORMAT facR; + MPC_SAMPLE_FORMAT templ; + MPC_SAMPLE_FORMAT tempr; + MPC_SAMPLE_FORMAT* YL; + MPC_SAMPLE_FORMAT* YR; + int* L; + int* R; + +#ifdef MPC_FIXED_POINT +#if MPC_FIXED_POINT_FRACTPART == 14 +#define MPC_MULTIPLY_SCF(CcVal, SCF_idx) \ + MPC_MULTIPLY_EX(CcVal,SCF[SCF_idx],SCF_shift[SCF_idx]) +#else + +#error FIXME, Cc table is in 18.14 format + +#endif +#else +#define MPC_MULTIPLY_SCF(CcVal, SCF_idx) \ + MPC_MULTIPLY(CcVal,SCF[SCF_idx]) +#endif + // requantization and scaling of subband-samples + for ( Band = 0; Band <= Last_Band; Band++ ) { // setting pointers + YL = Y_L [0] + Band; + YR = Y_R [0] + Band; + L = Q [Band].L; + R = Q [Band].R; + /************************** MS-coded **************************/ + if ( MS_Flag [Band] ) { + if ( Res_L [Band] ) { + if ( Res_R [Band] ) { // M!=0, S!=0 + facL = MPC_MULTIPLY_SCF( Cc[Res_L[Band]] , (unsigned char)SCF_Index_L[Band][0]); + facR = MPC_MULTIPLY_SCF( Cc[Res_R[Band]] , (unsigned char)SCF_Index_R[Band][0]); + for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) { + *YL = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++)); + *YR = templ - tempr; + } + facL = MPC_MULTIPLY_SCF( Cc[Res_L[Band]] , (unsigned char)SCF_Index_L[Band][1]); + facR = MPC_MULTIPLY_SCF( Cc[Res_R[Band]] , (unsigned char)SCF_Index_R[Band][1]); + for ( ; n < 24; n++, YL += 32, YR += 32 ) { + *YL = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++)); + *YR = templ - tempr; + } + facL = MPC_MULTIPLY_SCF( Cc[Res_L[Band]] , (unsigned char)SCF_Index_L[Band][2]); + facR = MPC_MULTIPLY_SCF( Cc[Res_R[Band]] , (unsigned char)SCF_Index_R[Band][2]); + for ( ; n < 36; n++, YL += 32, YR += 32 ) { + *YL = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++)); + *YR = templ - tempr; + } + } else { // M!=0, S==0 + facL = MPC_MULTIPLY_SCF( Cc[Res_L[Band]] , (unsigned char)SCF_Index_L[Band][0]); + for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) { + *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++); + } + facL = MPC_MULTIPLY_SCF( Cc[Res_L[Band]] , (unsigned char)SCF_Index_L[Band][1]); + for ( ; n < 24; n++, YL += 32, YR += 32 ) { + *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++); + } + facL = MPC_MULTIPLY_SCF( Cc[Res_L[Band]] , (unsigned char)SCF_Index_L[Band][2]); + for ( ; n < 36; n++, YL += 32, YR += 32 ) { + *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++); + } + } + } else { + if (Res_R[Band]) // M==0, S!=0 + { + facR = MPC_MULTIPLY_SCF( Cc[Res_R[Band]] , (unsigned char)SCF_Index_R[Band][0]); + for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) { + *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++))); + } + facR = MPC_MULTIPLY_SCF( Cc[Res_R[Band]] , (unsigned char)SCF_Index_R[Band][1]); + for ( ; n < 24; n++, YL += 32, YR += 32 ) { + *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++))); + } + facR = MPC_MULTIPLY_SCF( Cc[Res_R[Band]] , (unsigned char)SCF_Index_R[Band][2]); + for ( ; n < 36; n++, YL += 32, YR += 32 ) { + *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++))); + } + } else { // M==0, S==0 + for ( n = 0; n < 36; n++, YL += 32, YR += 32 ) { + *YR = *YL = 0; + } + } + } + } + /************************** LR-coded **************************/ + else { + if ( Res_L [Band] ) { + if ( Res_R [Band] ) { // L!=0, R!=0 + facL = MPC_MULTIPLY_SCF( Cc[Res_L[Band]] , (unsigned char)SCF_Index_L[Band][0]); + facR = MPC_MULTIPLY_SCF( Cc[Res_R[Band]] , (unsigned char)SCF_Index_R[Band][0]); + for (n = 0; n < 12; n++, YL += 32, YR += 32 ) { + *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++); + *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++); + } + facL = MPC_MULTIPLY_SCF( Cc[Res_L[Band]] , (unsigned char)SCF_Index_L[Band][1]); + facR = MPC_MULTIPLY_SCF( Cc[Res_R[Band]] , (unsigned char)SCF_Index_R[Band][1]); + for (; n < 24; n++, YL += 32, YR += 32 ) { + *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++); + *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++); + } + facL = MPC_MULTIPLY_SCF( Cc[Res_L[Band]] , (unsigned char)SCF_Index_L[Band][2]); + facR = MPC_MULTIPLY_SCF( Cc[Res_R[Band]] , (unsigned char)SCF_Index_R[Band][2]); + for (; n < 36; n++, YL += 32, YR += 32 ) { + *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++); + *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++); + } + } else { // L!=0, R==0 + facL = MPC_MULTIPLY_SCF( Cc[Res_L[Band]] , (unsigned char)SCF_Index_L[Band][0]); + for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) { + *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++); + *YR = 0; + } + facL = MPC_MULTIPLY_SCF( Cc[Res_L[Band]] , (unsigned char)SCF_Index_L[Band][1]); + for ( ; n < 24; n++, YL += 32, YR += 32 ) { + *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++); + *YR = 0; + } + facL = MPC_MULTIPLY_SCF( Cc[Res_L[Band]] , (unsigned char)SCF_Index_L[Band][2]); + for ( ; n < 36; n++, YL += 32, YR += 32 ) { + *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++); + *YR = 0; + } + } + } + else { + if ( Res_R [Band] ) { // L==0, R!=0 + facR = MPC_MULTIPLY_SCF( Cc[Res_R[Band]] , (unsigned char)SCF_Index_R[Band][0]); + for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) { + *YL = 0; + *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++); + } + facR = MPC_MULTIPLY_SCF( Cc[Res_R[Band]] , (unsigned char)SCF_Index_R[Band][1]); + for ( ; n < 24; n++, YL += 32, YR += 32 ) { + *YL = 0; + *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++); + } + facR = MPC_MULTIPLY_SCF( Cc[Res_R[Band]] , (unsigned char)SCF_Index_R[Band][2]); + for ( ; n < 36; n++, YL += 32, YR += 32 ) { + *YL = 0; + *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++); + } + } else { // L==0, R==0 + for ( n = 0; n < 36; n++, YL += 32, YR += 32 ) { + *YR = *YL = 0; + } + } + } + } + } +} + +/****************************************** SV 6 ******************************************/ +void +MPC_decoder::Lese_Bitstrom_SV6 ( void ) +{ + int n,k; + int Max_used_Band=0; + HuffmanTyp *Table; + const HuffmanTyp *x1; + const HuffmanTyp *x2; + int *L; + int *R; + int *ResL = Res_L; + int *ResR = Res_R; + + /************************ HEADER **************************/ + ResL = Res_L; + ResR = Res_R; + for (n=0; n<=Max_Band; ++n, ++ResL, ++ResR) + { + if (n<11) Table = Region_A; + else if (n>=11 && n<=22) Table = Region_B; + else /*if (n>=23)*/ Table = Region_C; + + *ResL = Q_res[n][Huffman_Decode(Table)]; + if (MS_used) MS_Flag[n] = Bitstream_read(1); + *ResR = Q_res[n][Huffman_Decode(Table)]; + + // only perform the following procedure up to the maximum non-zero subband + if (*ResL || *ResR) Max_used_Band = n; + } + + /************************* SCFI-Bundle *****************************/ + ResL = Res_L; + ResR = Res_R; + for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR) { + if (*ResL) SCFI_Bundle_read(SCFI_Bundle, &SCFI_L[n], &DSCF_Flag_L[n]); + if (*ResR) SCFI_Bundle_read(SCFI_Bundle, &SCFI_R[n], &DSCF_Flag_R[n]); + } + + /***************************** SCFI ********************************/ + ResL = Res_L; + ResR = Res_R; + L = SCF_Index_L[0]; + R = SCF_Index_R[0]; + for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR, L+=3, R+=3) + { + if (*ResL) + { + /*********** DSCF ************/ + if (DSCF_Flag_L[n]==1) + { + L[2] = DSCF_Reference_L[n]; + switch (SCFI_L[n]) + { + case 3: + L[0] = L[2] + Huffman_Decode_fast(DSCF_Entropie); + L[1] = L[0]; + L[2] = L[1]; + break; + case 1: + L[0] = L[2] + Huffman_Decode_fast(DSCF_Entropie); + L[1] = L[0] + Huffman_Decode_fast(DSCF_Entropie); + L[2] = L[1]; + break; + case 2: + L[0] = L[2] + Huffman_Decode_fast(DSCF_Entropie); + L[1] = L[0]; + L[2] = L[1] + Huffman_Decode_fast(DSCF_Entropie); + break; + case 0: + L[0] = L[2] + Huffman_Decode_fast(DSCF_Entropie); + L[1] = L[0] + Huffman_Decode_fast(DSCF_Entropie); + L[2] = L[1] + Huffman_Decode_fast(DSCF_Entropie); + break; + default: + return; + break; + } + } + /************ SCF ************/ + else + { + switch (SCFI_L[n]) + { + case 3: + L[0] = Bitstream_read(6); + L[1] = L[0]; + L[2] = L[1]; + break; + case 1: + L[0] = Bitstream_read(6); + L[1] = Bitstream_read(6); + L[2] = L[1]; + break; + case 2: + L[0] = Bitstream_read(6); + L[1] = L[0]; + L[2] = Bitstream_read(6); + break; + case 0: + L[0] = Bitstream_read(6); + L[1] = Bitstream_read(6); + L[2] = Bitstream_read(6); + break; + default: + return; + break; + } + } + // update Reference for DSCF + DSCF_Reference_L[n] = L[2]; + } + if (*ResR) + { + R[2] = DSCF_Reference_R[n]; + /*********** DSCF ************/ + if (DSCF_Flag_R[n]==1) + { + switch (SCFI_R[n]) + { + case 3: + R[0] = R[2] + Huffman_Decode_fast(DSCF_Entropie); + R[1] = R[0]; + R[2] = R[1]; + break; + case 1: + R[0] = R[2] + Huffman_Decode_fast(DSCF_Entropie); + R[1] = R[0] + Huffman_Decode_fast(DSCF_Entropie); + R[2] = R[1]; + break; + case 2: + R[0] = R[2] + Huffman_Decode_fast(DSCF_Entropie); + R[1] = R[0]; + R[2] = R[1] + Huffman_Decode_fast(DSCF_Entropie); + break; + case 0: + R[0] = R[2] + Huffman_Decode_fast(DSCF_Entropie); + R[1] = R[0] + Huffman_Decode_fast(DSCF_Entropie); + R[2] = R[1] + Huffman_Decode_fast(DSCF_Entropie); + break; + default: + return; + break; + } + } + /************ SCF ************/ + else + { + switch (SCFI_R[n]) + { + case 3: + R[0] = Bitstream_read(6); + R[1] = R[0]; + R[2] = R[1]; + break; + case 1: + R[0] = Bitstream_read(6); + R[1] = Bitstream_read(6); + R[2] = R[1]; + break; + case 2: + R[0] = Bitstream_read(6); + R[1] = R[0]; + R[2] = Bitstream_read(6); + break; + case 0: + R[0] = Bitstream_read(6); + R[1] = Bitstream_read(6); + R[2] = Bitstream_read(6); + break; + default: + return; + break; + } + } + // update Reference for DSCF + DSCF_Reference_R[n] = R[2]; + } + } + + /**************************** Samples ****************************/ + ResL = Res_L; + ResR = Res_R; + for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR) + { + // setting pointers + x1 = SampleHuff[*ResL]; + x2 = SampleHuff[*ResR]; + L = Q[n].L; + R = Q[n].R; + + if (x1!=NULL || x2!=NULL) + for (k=0; k<36; ++k) + { + if (x1 != NULL) *L++ = Huffman_Decode_fast (x1); + if (x2 != NULL) *R++ = Huffman_Decode_fast (x2); + } + + if (*ResL>7 || *ResR>7) + for (k=0; k<36; ++k) + { + if (*ResL>7) *L++ = (int)Bitstream_read(Res_bit[*ResL]) - Dc[*ResL]; + if (*ResR>7) *R++ = (int)Bitstream_read(Res_bit[*ResR]) - Dc[*ResR]; + } + } +} + +/****************************************** SV 7 ******************************************/ +void +MPC_decoder::Lese_Bitstrom_SV7 ( void ) +{ + // these arrays hold decoding results for bundled quantizers (3- and 5-step) + /*static*/ int idx30[] = { -1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1}; + /*static*/ int idx31[] = { -1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1}; + /*static*/ int idx32[] = { -1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + /*static*/ int idx50[] = { -2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2}; + /*static*/ int idx51[] = { -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2}; + + int n,k; + int Max_used_Band=0; + const HuffmanTyp *Table; + int idx; + int *L ,*R; + int *ResL,*ResR; + unsigned int tmp; + + /***************************** Header *****************************/ + ResL = Res_L; + ResR = Res_R; + + // first subband + *ResL = Bitstream_read(4); + *ResR = Bitstream_read(4); + if (MS_used && !(*ResL==0 && *ResR==0)) MS_Flag[0] = Bitstream_read(1); + + // consecutive subbands + ++ResL; ++ResR; // increase pointers + for (n=1; n<=Max_Band; ++n, ++ResL, ++ResR) + { + idx = Huffman_Decode_fast(HuffHdr); + *ResL = (idx!=4) ? *(ResL-1) + idx : Bitstream_read(4); + + idx = Huffman_Decode_fast(HuffHdr); + *ResR = (idx!=4) ? *(ResR-1) + idx : Bitstream_read(4); + + if (MS_used && !(*ResL==0 && *ResR==0)) MS_Flag[n] = Bitstream_read(1); + + // only perform following procedures up to the maximum non-zero subband + if (*ResL!=0 || *ResR!=0) Max_used_Band = n; + } + /****************************** SCFI ******************************/ + L = SCFI_L; + R = SCFI_R; + ResL = Res_L; + ResR = Res_R; + for (n=0; n<=Max_used_Band; ++n, ++L, ++R, ++ResL, ++ResR) { + if (*ResL) *L = Huffman_Decode_faster(HuffSCFI); + if (*ResR) *R = Huffman_Decode_faster(HuffSCFI); + } + + /**************************** SCF/DSCF ****************************/ + ResL = Res_L; + ResR = Res_R; + L = SCF_Index_L[0]; + R = SCF_Index_R[0]; + for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR, L+=3, R+=3) { + if (*ResL) + { + L[2] = DSCF_Reference_L[n]; + switch (SCFI_L[n]) + { + case 1: + idx = Huffman_Decode_fast(HuffDSCF); + L[0] = (idx!=8) ? L[2] + idx : Bitstream_read(6); + idx = Huffman_Decode_fast(HuffDSCF); + L[1] = (idx!=8) ? L[0] + idx : Bitstream_read(6); + L[2] = L[1]; + break; + case 3: + idx = Huffman_Decode_fast(HuffDSCF); + L[0] = (idx!=8) ? L[2] + idx : Bitstream_read(6); + L[1] = L[0]; + L[2] = L[1]; + break; + case 2: + idx = Huffman_Decode_fast(HuffDSCF); + L[0] = (idx!=8) ? L[2] + idx : Bitstream_read(6); + L[1] = L[0]; + idx = Huffman_Decode_fast(HuffDSCF); + L[2] = (idx!=8) ? L[1] + idx : Bitstream_read(6); + break; + case 0: + idx = Huffman_Decode_fast(HuffDSCF); + L[0] = (idx!=8) ? L[2] + idx : Bitstream_read(6); + idx = Huffman_Decode_fast(HuffDSCF); + L[1] = (idx!=8) ? L[0] + idx : Bitstream_read(6); + idx = Huffman_Decode_fast(HuffDSCF); + L[2] = (idx!=8) ? L[1] + idx : Bitstream_read(6); + break; + default: + return; + break; + } + // update Reference for DSCF + DSCF_Reference_L[n] = L[2]; + } + if (*ResR) + { + R[2] = DSCF_Reference_R[n]; + switch (SCFI_R[n]) + { + case 1: + idx = Huffman_Decode_fast(HuffDSCF); + R[0] = (idx!=8) ? R[2] + idx : Bitstream_read(6); + idx = Huffman_Decode_fast(HuffDSCF); + R[1] = (idx!=8) ? R[0] + idx : Bitstream_read(6); + R[2] = R[1]; + break; + case 3: + idx = Huffman_Decode_fast(HuffDSCF); + R[0] = (idx!=8) ? R[2] + idx : Bitstream_read(6); + R[1] = R[0]; + R[2] = R[1]; + break; + case 2: + idx = Huffman_Decode_fast(HuffDSCF); + R[0] = (idx!=8) ? R[2] + idx : Bitstream_read(6); + R[1] = R[0]; + idx = Huffman_Decode_fast(HuffDSCF); + R[2] = (idx!=8) ? R[1] + idx : Bitstream_read(6); + break; + case 0: + idx = Huffman_Decode_fast(HuffDSCF); + R[0] = (idx!=8) ? R[2] + idx : Bitstream_read(6); + idx = Huffman_Decode_fast(HuffDSCF); + R[1] = (idx!=8) ? R[0] + idx : Bitstream_read(6); + idx = Huffman_Decode_fast(HuffDSCF); + R[2] = (idx!=8) ? R[1] + idx : Bitstream_read(6); + break; + default: + return; + break; + } + // update Reference for DSCF + DSCF_Reference_R[n] = R[2]; + } + } + /***************************** Samples ****************************/ + ResL = Res_L; + ResR = Res_R; + L = Q[0].L; + R = Q[0].R; + for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR, L+=36, R+=36) + { + /************** links **************/ + switch (*ResL) + { + case -2: case -3: case -4: case -5: case -6: case -7: case -8: case -9: + case -10: case -11: case -12: case -13: case -14: case -15: case -16: case -17: + L += 36; + break; + case -1: + for (k=0; k<36; k++ ) { + tmp = random_int (); + *L++ = ((tmp >> 24) & 0xFF) + ((tmp >> 16) & 0xFF) + ((tmp >> 8) & 0xFF) + ((tmp >> 0) & 0xFF) - 510; + } + break; + case 0: + L += 36;// increase pointer + break; + case 1: + Table = HuffQ[Bitstream_read(1)][1]; + for (k=0; k<12; ++k) + { + idx = Huffman_Decode_fast(Table); + *L++ = idx30[idx]; + *L++ = idx31[idx]; + *L++ = idx32[idx]; + } + break; + case 2: + Table = HuffQ[Bitstream_read(1)][2]; + for (k=0; k<18; ++k) + { + idx = Huffman_Decode_fast(Table); + *L++ = idx50[idx]; + *L++ = idx51[idx]; + } + break; + case 3: + case 4: + Table = HuffQ[Bitstream_read(1)][*ResL]; + for (k=0; k<36; ++k) + *L++ = Huffman_Decode_faster(Table); + break; + case 5: + Table = HuffQ[Bitstream_read(1)][*ResL]; + for (k=0; k<36; ++k) + *L++ = Huffman_Decode_fast(Table); + break; + case 6: + case 7: + Table = HuffQ[Bitstream_read(1)][*ResL]; + for (k=0; k<36; ++k) + *L++ = Huffman_Decode(Table); + break; + case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: + tmp = Dc[*ResL]; + for (k=0; k<36; ++k) + *L++ = (int)Bitstream_read(Res_bit[*ResL]) - tmp; + break; + default: + return; + } + /************** rechts **************/ + switch (*ResR) + { + case -2: case -3: case -4: case -5: case -6: case -7: case -8: case -9: + case -10: case -11: case -12: case -13: case -14: case -15: case -16: case -17: + R += 36; + break; + case -1: + for (k=0; k<36; k++ ) { + tmp = random_int (); + *R++ = ((tmp >> 24) & 0xFF) + ((tmp >> 16) & 0xFF) + ((tmp >> 8) & 0xFF) + ((tmp >> 0) & 0xFF) - 510; + } + break; + case 0: + R += 36;// increase pointer + break; + case 1: + Table = HuffQ[Bitstream_read(1)][1]; + for (k=0; k<12; ++k) + { + idx = Huffman_Decode_fast(Table); + *R++ = idx30[idx]; + *R++ = idx31[idx]; + *R++ = idx32[idx]; + } + break; + case 2: + Table = HuffQ[Bitstream_read(1)][2]; + for (k=0; k<18; ++k) + { + idx = Huffman_Decode_fast(Table); + *R++ = idx50[idx]; + *R++ = idx51[idx]; + } + break; + case 3: + case 4: + Table = HuffQ[Bitstream_read(1)][*ResR]; + for (k=0; k<36; ++k) + *R++ = Huffman_Decode_faster(Table); + break; + case 5: + Table = HuffQ[Bitstream_read(1)][*ResR]; + for (k=0; k<36; ++k) + *R++ = Huffman_Decode_fast(Table); + break; + case 6: + case 7: + Table = HuffQ[Bitstream_read(1)][*ResR]; + for (k=0; k<36; ++k) + *R++ = Huffman_Decode(Table); + break; + case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: + tmp = Dc[*ResR]; + for (k=0; k<36; ++k) + *R++ = (int)Bitstream_read(Res_bit[*ResR]) - tmp; + break; + default: + return; + } + } +} + +MPC_decoder::~MPC_decoder () +{ + if (SeekTable) free ( SeekTable ); +} + +MPC_decoder::MPC_decoder ( MPC_reader *r, double scale_factor ) +{ + m_reader = r; + + HuffQ[0][0] = 0; + HuffQ[1][0] = 0; + HuffQ[0][1] = HuffQ1[0]; + HuffQ[1][1] = HuffQ1[1]; + HuffQ[0][2] = HuffQ2[0]; + HuffQ[1][2] = HuffQ2[1]; + HuffQ[0][3] = HuffQ3[0]; + HuffQ[1][3] = HuffQ3[1]; + HuffQ[0][4] = HuffQ4[0]; + HuffQ[1][4] = HuffQ4[1]; + HuffQ[0][5] = HuffQ5[0]; + HuffQ[1][5] = HuffQ5[1]; + HuffQ[0][6] = HuffQ6[0]; + HuffQ[1][6] = HuffQ6[1]; + HuffQ[0][7] = HuffQ7[0]; + HuffQ[1][7] = HuffQ7[1]; + + SampleHuff[0] = NULL; + SampleHuff[1] = Entropie_1; + SampleHuff[2] = Entropie_2; + SampleHuff[3] = Entropie_3; + SampleHuff[4] = Entropie_4; + SampleHuff[5] = Entropie_5; + SampleHuff[6] = Entropie_6; + SampleHuff[7] = Entropie_7; + SampleHuff[8] = NULL; + SampleHuff[9] = NULL; + SampleHuff[10] = NULL; + SampleHuff[11] = NULL; + SampleHuff[12] = NULL; + SampleHuff[13] = NULL; + SampleHuff[14] = NULL; + SampleHuff[15] = NULL; + SampleHuff[16] = NULL; + SampleHuff[17] = NULL; + + SeekTable = NULL; + EQ_activated = 0; + MPCHeaderPos = 0; + StreamVersion = 0; + MS_used = 0; + FwdJumpInfo = 0; + ActDecodePos = 0; + FrameWasValid = 0; + OverallFrames = 0; + DecodedFrames = 0; + LastValidSamples = 0; + TrueGaplessPresent = 0; + WordsRead = 0; + Max_Band = 0; + SampleRate = 0; +// clips = 0; + __r1 = 1; + __r2 = 1; + + dword = 0; + pos = 0; + Zaehler = 0; + WordsRead = 0; + Max_Band = 0; + + initialisiere_Quantisierungstabellen (scale_factor); + Huffman_SV6_Decoder (); + Huffman_SV7_Decoder (); +} + +void MPC_decoder::SetStreamInfo ( const StreamInfo *si ) +{ + RESET_Synthesis (); + RESET_Globals (); + + StreamVersion = si->simple.StreamVersion; + MS_used = si->simple.MS; + Max_Band = si->simple.MaxBand; + OverallFrames = si->simple.Frames; + MPCHeaderPos = si->simple.HeaderPosition; + LastValidSamples = si->simple.LastFrameSamples; + TrueGaplessPresent = si->simple.IsTrueGapless; + SampleRate = (int)si->simple.SampleFreq; + + if ( SeekTable != NULL ) free ( SeekTable ); + SeekTable = (unsigned short *)calloc ( sizeof(unsigned short), OverallFrames+64 ); + + samples_to_skip = SynthDelay; +} + +bool MPC_decoder::Initialize(const StreamInfo * info) +{ + SetStreamInfo(info); + + // AB: setting position to the beginning of the data-bitstream + switch ( StreamVersion ) { + case 0x04: f_seek ( 4 + MPCHeaderPos, SEEK_SET); pos = 16; break; // Geht auch über eine der Helperfunktionen + case 0x05: + case 0x06: f_seek ( 8 + MPCHeaderPos, SEEK_SET); pos = 0; break; + case 0x07: + case 0x17: /*f_seek ( 24 + MPCHeaderPos, SEEK_SET);*/ pos = 8; break; + default: return false; + } + + // AB: fill buffer and initialize decoder + f_read_dword ( Speicher, MEMSIZE ); + dword = Speicher [Zaehler = 0]; + + return true; +} + +//--------------------------------------------------------------- +// will seek from the beginning of the file to the desired +// position in ms (given by seek_needed) +//--------------------------------------------------------------- + +void +MPC_decoder::Helper1 ( unsigned long bitpos ) +{ + f_seek ( (bitpos>>5) * 4 + MPCHeaderPos, SEEK_SET ); + f_read_dword ( Speicher, 2 ); + dword = Speicher [ Zaehler = 0]; + pos = bitpos & 31; +} + +void +MPC_decoder::Helper2 ( unsigned long bitpos ) +{ + f_seek ( (bitpos>>5) * 4 + MPCHeaderPos, SEEK_SET ); + f_read_dword ( Speicher, MEMSIZE ); + dword = Speicher [ Zaehler = 0]; + pos = bitpos & 31; +} + +void +MPC_decoder::Helper3 ( unsigned long bitpos, unsigned long* buffoffs ) +{ + pos = bitpos & 31; + bitpos >>= 5; + if ( (unsigned long)(bitpos - *buffoffs) >= MEMSIZE-2 ) { + *buffoffs = bitpos; + f_seek ( bitpos * 4L + MPCHeaderPos, SEEK_SET ); + f_read_dword ( Speicher, MEMSIZE ); + } + dword = Speicher [ Zaehler = bitpos - *buffoffs ]; +} + +static unsigned int get_initial_fpos(unsigned int StreamVersion) +{ + unsigned int fpos = 0; + switch ( StreamVersion ) { // setting position to the beginning of the data-bitstream + case 0x04: fpos = 48; break; + case 0x05: + case 0x06: fpos = 64; break; + case 0x07: + case 0x17: fpos = 200; break; + } + return fpos; +} + +bool MPC_decoder::SeekSeconds ( double seconds ) +{ + return SeekSample((MPC_INT64)(seconds * (double)SampleRate + 0.5)); +} + + +bool MPC_decoder::SeekSample(MPC_INT64 destsample) +{ + unsigned long fpos; + unsigned int fwd; + + fwd = (unsigned) (destsample / FrameLength); + samples_to_skip = SynthDelay + (unsigned)(destsample % FrameLength); + + memset ( Y_L , 0, sizeof Y_L ); + memset ( Y_R , 0, sizeof Y_R ); + memset ( SCF_Index_L , 0, sizeof SCF_Index_L ); + memset ( SCF_Index_R , 0, sizeof SCF_Index_R ); + memset ( Res_L , 0, sizeof Res_L ); + memset ( Res_R , 0, sizeof Res_R ); + memset ( SCFI_L , 0, sizeof SCFI_L ); + memset ( SCFI_R , 0, sizeof SCFI_R ); + memset ( DSCF_Flag_L , 0, sizeof DSCF_Flag_L ); + memset ( DSCF_Flag_R , 0, sizeof DSCF_Flag_R ); + memset ( DSCF_Reference_L, 0, sizeof DSCF_Reference_L ); + memset ( DSCF_Reference_R, 0, sizeof DSCF_Reference_R ); + memset ( Q , 0, sizeof Q ); + memset ( MS_Flag , 0, sizeof MS_Flag ); + + RESET_Synthesis (); // resetting synthesis filter to avoid "clicks" + + fwd = fwd < OverallFrames ? fwd : OverallFrames; // prevent from desired position out of allowed range + DecodedFrames = 0; // reset number of decoded frames + + fpos = get_initial_fpos(StreamVersion); + if (fpos == 0) return false; + +#if 1 + { + unsigned long buffoffs = 0x80000000; + for ( ; DecodedFrames + 1024 < fwd; DecodedFrames++ ) { // proceed until 32 frames before (!!) desired position (allows to scan the scalefactors) + if ( SeekTable [DecodedFrames] == 0 ) { + Helper3 ( fpos, &buffoffs ); + fpos += SeekTable [DecodedFrames] = 20 + Bitstream_read (20); // calculate desired pos (in Bits) + } else { + fpos += SeekTable [DecodedFrames]; + } + } + } +#endif + Helper2 ( fpos ); + + for ( ; DecodedFrames < fwd; DecodedFrames++ ) { // read the last 32 frames before the desired position to scan the scalefactors (artifactless jumping) + unsigned int FrameBitCnt; + unsigned int RING; + RING = Zaehler; + FwdJumpInfo = Bitstream_read (20); // read jump-info + SeekTable [DecodedFrames] = 20 + FwdJumpInfo; + ActDecodePos = (Zaehler << 5) + pos; + FrameBitCnt = BitsRead (); // scanning the scalefactors and check for validity of frame + if (StreamVersion >= 7) Lese_Bitstrom_SV7 (); + else Lese_Bitstrom_SV6 (); + if ( BitsRead() - FrameBitCnt != FwdJumpInfo ) { +// Box ("Bug in perform_jump"); + return false; + } + if ( (RING ^ Zaehler) & MEMSIZE2 ) // update buffer + f_read_dword ( Speicher + (RING & MEMSIZE2), MEMSIZE2 ); + } + +// LastBitsRead = BitsRead (); + // LastFrame = DecodedFrames; + + return true; +} + +void MPC_decoder::UpdateBuffer ( unsigned int RING ) +{ + if ( (RING ^ Zaehler) & MEMSIZE2 ) + f_read_dword ( Speicher + (RING & MEMSIZE2), MEMSIZE2 ); // update buffer +} + +static unsigned long swap32(unsigned long val) +{ + const unsigned char * src = (const unsigned char*)&val; + return (unsigned long)src[0] | ((unsigned long)src[1] << 8) | ((unsigned long)src[2] << 16) | ((unsigned long)src[3] << 24); +} + +int MPC_decoder::f_read_dword( unsigned int * ptr, unsigned int count) +{ + count = f_read(ptr,count << 2) >> 2; +#ifndef MPC_LITTLE_ENDIAN + unsigned int n; + for(n=0;n<count;n++) + ptr[n] = swap32(ptr[n]); +#endif + return count; +} diff --git a/akode/plugins/mpc_decoder/mppdec/mpc_dec.h b/akode/plugins/mpc_decoder/mppdec/mpc_dec.h new file mode 100644 index 0000000..e6d37ae --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/mpc_dec.h @@ -0,0 +1,200 @@ +#ifndef _mpp_dec_h_ +#define _mpp_dec_h_ + + +#ifdef WIN32 +#define MPC_LITTLE_ENDIAN +#endif + + +#include <assert.h> + +#include "mpc_math.h" + + +class MPC_reader { +public: + virtual size_t read ( void *ptr, size_t size ) = 0; + virtual bool seek ( int offset, int origin ) = 0; + virtual long tell () = 0; + virtual long get_size () = 0; + virtual bool canseek() = 0; +}; + +class MPC_decoder { +public: + MPC_decoder(MPC_reader *r, double scale_factor = 1.0); + ~MPC_decoder(); + + bool Initialize(const class StreamInfo *si); + void ScaleOutput(double factor); + unsigned int Decode(MPC_SAMPLE_FORMAT *buffer, unsigned int * vbr_update_acc = 0, unsigned int * vbr_update_bits = 0); + bool SeekSeconds(double seconds); + bool SeekSample(MPC_INT64 sample); + +public: + enum + { + FrameLength = (36 * 32), // samples per frame + SynthDelay = 481, + DecodeBufferLength = 4 * FrameLength + }; +private: + enum + { + EQ_TAP = 13, // length of FIR filter for EQ + DELAY = ((EQ_TAP + 1) / 2), // delay of FIR + FIR_BANDS = 4, // number of subbands to be FIR filtered + MEMSIZE = 16384, // overall buffer size + MEMSIZE2 = (MEMSIZE/2), // size of one buffer + MEMMASK = (MEMSIZE-1), + V_MEM = 2304 + }; + void SetStreamInfo ( const class StreamInfo *si ); + void UpdateBuffer ( unsigned int RING ); + void RESET_Synthesis ( void ); + void RESET_Globals ( void ); + + unsigned int BitsRead ( void ); + unsigned int decode_internal ( MPC_SAMPLE_FORMAT *buffer ); + void RESET_Y ( void ); + void Lese_Bitstrom_SV6 ( void ); + void Lese_Bitstrom_SV7 ( void ); + + void Requantisierung ( const int Last_Band ); + + unsigned int samples_to_skip; + + typedef struct { + int L [36]; + int R [36]; + } QuantTyp; + + typedef struct { + unsigned int Code; + unsigned int Length; + int Value; + } HuffmanTyp; + + static int HuffmanTyp_cmpfn ( const void* p1, const void* p2 ); + + MPC_reader *m_reader; + + unsigned int dword; // actually decoded 32bit-word + unsigned int pos; // bit-position within dword + unsigned int Speicher [MEMSIZE]; // read-buffer + unsigned int Zaehler; // actual index within read-buffer + + unsigned int FwdJumpInfo; + unsigned int ActDecodePos; + unsigned int FrameWasValid; + + unsigned int DecodedFrames; + unsigned int OverallFrames; + int SampleRate; // Sample frequency + + unsigned int StreamVersion; // version of bitstream + unsigned int MS_used; // MS-coding used ? + int Max_Band; + unsigned int MPCHeaderPos; // AB: needed to support ID3v2 + //unsigned int OverallFrames; + //unsigned int DecodedFrames; + unsigned int LastValidSamples; + unsigned int TrueGaplessPresent; + + unsigned int EQ_activated; + + unsigned int WordsRead; // counts amount of decoded dwords + unsigned short* SeekTable; + + /*static*/ unsigned int __r1; + /*static*/ unsigned int __r2; + + + int SCF_Index_L [32] [3]; + int SCF_Index_R [32] [3]; // holds scalefactor-indices + QuantTyp Q [32]; // holds quantized samples + int Res_L [32]; + int Res_R [32]; // holds the chosen quantizer for each subband + int DSCF_Flag_L [32]; + int DSCF_Flag_R [32]; // differential SCF used? + int SCFI_L [32]; + int SCFI_R [32]; // describes order of transmitted SCF + int DSCF_Reference_L [32]; + int DSCF_Reference_R [32]; // holds last frames SCF + int MS_Flag[32]; // MS used? + + + HuffmanTyp HuffHdr [10]; + HuffmanTyp HuffSCFI [ 4]; + HuffmanTyp HuffDSCF [16]; + HuffmanTyp* HuffQ [2] [8]; + + HuffmanTyp HuffQ1 [2] [3*3*3]; + HuffmanTyp HuffQ2 [2] [5*5]; + HuffmanTyp HuffQ3 [2] [ 7]; + HuffmanTyp HuffQ4 [2] [ 9]; + HuffmanTyp HuffQ5 [2] [15]; + HuffmanTyp HuffQ6 [2] [31]; + HuffmanTyp HuffQ7 [2] [63]; + + const HuffmanTyp* SampleHuff [18]; + HuffmanTyp SCFI_Bundle [ 8]; + HuffmanTyp DSCF_Entropie [13]; + HuffmanTyp Region_A [16]; + HuffmanTyp Region_B [ 8]; + HuffmanTyp Region_C [ 4]; + + HuffmanTyp Entropie_1 [ 3]; + HuffmanTyp Entropie_2 [ 5]; + HuffmanTyp Entropie_3 [ 7]; + HuffmanTyp Entropie_4 [ 9]; + HuffmanTyp Entropie_5 [15]; + HuffmanTyp Entropie_6 [31]; + HuffmanTyp Entropie_7 [63]; + + MPC_SAMPLE_FORMAT V_L [V_MEM + 960]; + MPC_SAMPLE_FORMAT V_R [V_MEM + 960]; + MPC_SAMPLE_FORMAT Y_L [36] [32]; + MPC_SAMPLE_FORMAT Y_R [36] [32]; + + MPC_SAMPLE_FORMAT SCF [256]; // holds adapted scalefactors (for clipping prevention) +#ifdef MPC_FIXED_POINT + unsigned char SCF_shift[256]; +#endif + unsigned int Q_bit [32]; // holds amount of bits to save chosen quantizer (SV6) + unsigned int Q_res [32] [16]; // holds conversion: index -> quantizer (SV6) + +private: // functions + void Reset_BitstreamDecode ( void ); + unsigned int Bitstream_read ( const unsigned int ); + int Huffman_Decode ( const HuffmanTyp* ); // works with maximum lengths up to 14 + int Huffman_Decode_fast ( const HuffmanTyp* ); // works with maximum lengths up to 10 + int Huffman_Decode_faster ( const HuffmanTyp* ); // works with maximum lengths up to 5 + void SCFI_Bundle_read ( const HuffmanTyp*, int*, int* ); + + void Reset_V ( void ); + void Synthese_Filter_float ( MPC_SAMPLE_FORMAT * dst ); + unsigned int random_int ( void ); + + void EQSet ( int on, char data[10], int preamp ); + void Helper1 ( unsigned long bitpos ); + void Helper2 ( unsigned long bitpos ); + void Helper3 ( unsigned long bitpos, unsigned long* buffoffs ); + void Huffman_SV6_Encoder ( void ); + void Huffman_SV6_Decoder ( void ); + void Huffman_SV7_Encoder ( void ); + void Huffman_SV7_Decoder ( void ); + + void initialisiere_Quantisierungstabellen ( double ); + void Quantisierungsmodes ( void ); // conversion: index -> quantizer (bitstream reading) + void Resort_HuffTables ( const unsigned int elements, HuffmanTyp* Table, const int offset ); +private: + inline int f_read ( void *ptr, size_t size) { return m_reader->read (ptr, size); }; + int f_read_dword( unsigned int * ptr, unsigned int count); + inline bool f_seek ( int offset, int origin) { return m_reader->seek (offset, origin); }; +}; + +#include "streaminfo.h" + +#endif diff --git a/akode/plugins/mpc_decoder/mppdec/mpc_math.h b/akode/plugins/mpc_decoder/mppdec/mpc_math.h new file mode 100644 index 0000000..df894be --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/mpc_math.h @@ -0,0 +1,88 @@ +#ifndef _MPC_MATH_H_ +#define _MPC_MATH_H_ + + +// #define MPC_FIXED_POINT + + +#ifdef _MSC_VER +typedef __int64 MPC_INT64; +#else +typedef long long MPC_INT64; +#endif + + +#define MPC_FIXED_POINT_SHIFT 16 + +#ifdef MPC_FIXED_POINT + +#define MPC_FIXED_POINT_SCALE_SHIFT (MPC_FIXED_POINT_SHIFT + MPC_FIXED_POINT_FRACTPART) +#define MPC_FIXED_POINT_SCALE (1 << (MPC_FIXED_POINT_SCALE_SHIFT - 1)) + + +//in fixedpoint mode, results in decode output buffer are in -MPC_FIXED_POINT_SCALE ... MPC_FIXED_POINT_SCALE range + +#define MPC_FIXED_POINT_FRACTPART 14 +typedef int MPC_SAMPLE_FORMAT; + +typedef MPC_INT64 MPC_SAMPLE_FORMAT_MULTIPLY; + +#define MAKE_MPC_SAMPLE(X) (MPC_SAMPLE_FORMAT)((double)(X) * (double)(((MPC_INT64)1)<<MPC_FIXED_POINT_FRACTPART)) +#define MAKE_MPC_SAMPLE_EX(X,Y) (MPC_SAMPLE_FORMAT)((double)(X) * (double)(((MPC_INT64)1)<<(Y))) + +#define MPC_MULTIPLY_NOTRUNCATE(X,Y) \ + (((MPC_SAMPLE_FORMAT_MULTIPLY)(X) * (MPC_SAMPLE_FORMAT_MULTIPLY)(Y)) >> MPC_FIXED_POINT_FRACTPART) + +#define MPC_MULTIPLY_EX_NOTRUNCATE(X,Y,Z) \ + (((MPC_SAMPLE_FORMAT_MULTIPLY)(X) * (MPC_SAMPLE_FORMAT_MULTIPLY)(Y)) >> (Z)) + +#ifdef _DEBUG +static inline MPC_SAMPLE_FORMAT MPC_MULTIPLY(MPC_SAMPLE_FORMAT item1,MPC_SAMPLE_FORMAT item2) +{ + MPC_SAMPLE_FORMAT_MULTIPLY temp = MPC_MULTIPLY_NOTRUNCATE(item1,item2); + assert(temp == (MPC_SAMPLE_FORMAT_MULTIPLY)(MPC_SAMPLE_FORMAT)temp); + return (MPC_SAMPLE_FORMAT)temp; +} + +static inline MPC_SAMPLE_FORMAT MPC_MULTIPLY_EX(MPC_SAMPLE_FORMAT item1,MPC_SAMPLE_FORMAT item2,unsigned shift) +{ + MPC_SAMPLE_FORMAT_MULTIPLY temp = MPC_MULTIPLY_EX_NOTRUNCATE(item1,item2,shift); + assert(temp == (MPC_SAMPLE_FORMAT_MULTIPLY)(MPC_SAMPLE_FORMAT)temp); + return (MPC_SAMPLE_FORMAT)temp; +} + +#else + +#define MPC_MULTIPLY(X,Y) ((MPC_SAMPLE_FORMAT)MPC_MULTIPLY_NOTRUNCATE(X,Y)) +#define MPC_MULTIPLY_EX(X,Y,Z) ((MPC_SAMPLE_FORMAT)MPC_MULTIPLY_EX_NOTRUNCATE(X,Y,Z)) + +#endif + +#define MPC_MULTIPLY_FLOAT_INT(X,Y) ((X)*(Y)) +#define MPC_SCALE_CONST(X,Y,Z) MPC_MULTIPLY_EX(X,MAKE_MPC_SAMPLE_EX(Y,Z),(Z)) +#define MPC_SCALE_CONST_SHL(X,Y,Z,S) MPC_MULTIPLY_EX(X,MAKE_MPC_SAMPLE_EX(Y,Z),(Z)-(S)) +#define MPC_SCALE_CONST_SHR(X,Y,Z,S) MPC_MULTIPLY_EX(X,MAKE_MPC_SAMPLE_EX(Y,Z),(Z)+(S)) +#define MPC_SHR(X,Y) ((X)>>(Y)) +#define MPC_SHL(X,Y) ((X)<<(Y)) + +#else + +//in floating-point mode, decoded samples are in -1...1 range + +typedef float MPC_SAMPLE_FORMAT; + +#define MAKE_MPC_SAMPLE(X) ((MPC_SAMPLE_FORMAT)(X)) +#define MAKE_MPC_SAMPLE_EX(X,Y) ((MPC_SAMPLE_FORMAT)(X)) + +#define MPC_MULTIPLY_FLOAT_INT(X,Y) ((X)*(Y)) +#define MPC_MULTIPLY(X,Y) ((X)*(Y)) +#define MPC_MULTIPLY_EX(X,Y,Z) ((X)*(Y)) +#define MPC_SCALE_CONST(X,Y,Z) ((X)*(Y)) +#define MPC_SCALE_CONST_SHL(X,Y,Z,S) ((X)*(Y)) +#define MPC_SCALE_CONST_SHR(X,Y,Z,S) ((X)*(Y)) +#define MPC_SHR(X,Y) (X) +#define MPC_SHL(X,Y) (X) + +#endif + +#endif diff --git a/akode/plugins/mpc_decoder/mppdec/readme.txt b/akode/plugins/mpc_decoder/mppdec/readme.txt new file mode 100644 index 0000000..f4e3d62 --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/readme.txt @@ -0,0 +1,23 @@ +Portable Musepack decoder +(C) 1999-2002 Buschmann/Klemm/Piecha/Wolf +(C) 2003-2004 Peter Pawlowski + +See LGPL.txt for license/redistribution info. + +Usage: see sample.cpp + +Features: +- Switchable fixed-point and floating-point modes - enable/disable "#define MPC_FIXED_POINT" in mpc_math.h +- Endian-safe, verified running correctly on big-endian machines +- Multiinstance and multithread safe +- File access callbacks +- No assembly code used, for full portability + +Verified correctly compiling/running under: +- win32 / x86 / MSVC6 + SP5 + processor pack - very fast floating-point mode (goes above 200x on ~2GHz machines), fixed-point mode is significantly slower (~60x) +- win32 / x86 / MSVC7.1 - slightly faster than MSVC6, fixed-point mode still relatively slow +- win32 / x86 / DMCPP - fixed-point mode faster than MSVC, floating-point mode slower than expected with strange slowdowns when compiled with speed optimizations enabled +- wince / ARM (32bit) / eVC4 + SP3 - fixed-point decoding speed on 400MHz XScale CPU is about 10x realtime +- Darwin 7.3.0, MacOS X 10.3.3 / PowerPC970/G5 / GCC 3.3 - about 80x-100x decoding speed in both modes on 2GHz G5, thanks to TrNSZ for testing/feedback + +Package includes project files for MSVC6 and eVC4.
\ No newline at end of file diff --git a/akode/plugins/mpc_decoder/mppdec/requant.cpp b/akode/plugins/mpc_decoder/mppdec/requant.cpp new file mode 100644 index 0000000..b2e22c9 --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/requant.cpp @@ -0,0 +1,112 @@ +#include "stdafx.h" + +/* C O N S T A N T S */ +// bits per sample for chosen quantizer +const unsigned int Res_bit [18] = { + 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 +}; + +// coefficients for requantization +// 65536/step bzw. 65536/(2*D+1) + + + +#define _(X) MAKE_MPC_SAMPLE_EX(X,14) + +const MPC_SAMPLE_FORMAT __Cc [1 + 18] = { + _(111.285962475327f), // 32768/2/255*sqrt(3) + _(65536.000000000000f), _(21845.333333333332f), _(13107.200000000001f), _(9362.285714285713f), + _(7281.777777777777f), _(4369.066666666666f), _(2114.064516129032f), _(1040.253968253968f), + _(516.031496062992f), _(257.003921568627f), _(128.250489236790f), _(64.062561094819f), + _(32.015632633121f), _(16.003907203907f), _(8.000976681723f), _(4.000244155527f), + _(2.000061037018f), _(1.000015259021f) +}; + +#undef _ + +// offset for requantization +// 2*D+1 = steps of quantizer +const int __Dc [1 + 18] = { + 2, + 0, 1, 2, 3, 4, 7, 15, 31, 63, + 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767 +}; + +static unsigned find_shift(double fval) +{ + MPC_INT64 val = (MPC_INT64)fval; + if (val<0) val = -val; + unsigned ptr = 0; + while(val) {val>>=1;ptr++;} + + return ptr > 31 ? 0 : 31 - ptr; +} + +/* F U N C T I O N S */ + +#define SET_SCF(N,X) SCF[N] = MAKE_MPC_SAMPLE_EX(X,SCF_shift[N] = find_shift(X)); + +void +MPC_decoder::ScaleOutput ( double factor ) +{ +#ifndef MPC_FIXED_POINT + factor *= 1.0 / (double)(1<<(MPC_FIXED_POINT_SHIFT-1)); +#else + factor *= 1.0 / (double)(1<<(16 - MPC_FIXED_POINT_SHIFT)); +#endif + int n; + double f1 = factor; + double f2 = factor; + + // handles +1.58...-98.41 dB, where's scf[n] / scf[n-1] = 1.20050805774840750476 + + SET_SCF(1,factor); + + f1 *= 0.83298066476582673961; + f2 *= 1/0.83298066476582673961; + + for ( n = 1; n <= 128; n++ ) { + SET_SCF((unsigned char)(1+n),f1); + SET_SCF((unsigned char)(1-n),f2); + f1 *= 0.83298066476582673961; + f2 *= 1/0.83298066476582673961; + } +} + +void +MPC_decoder::Quantisierungsmodes ( void ) // conversion: index -> quantizer (bitstream reading) +{ // conversion: quantizer -> index (bitstream writing) + int Band = 0; + int i; + + do { + Q_bit [Band] = 4; + for ( i = 0; i < 16-1; i++ ) + Q_res [Band] [i] = i; + Q_res [Band][i] = 17; + Band++; + } while ( Band < 11 ); + + do { + Q_bit [Band] = 3; + for ( i = 0; i < 8-1; i++ ) + Q_res [Band] [i] = i; + Q_res [Band] [i] = 17; + Band++; + } while ( Band < 23 ); + + do { + Q_bit [Band] = 2; + for ( i = 0; i < 4-1; i++ ) + Q_res [Band] [i] = i; + Q_res [Band] [i] = 17; + Band++; + } while ( Band < 32 ); +} + +void +MPC_decoder::initialisiere_Quantisierungstabellen ( double scale_factor ) +{ + Quantisierungsmodes (); + ScaleOutput ( scale_factor ); +} diff --git a/akode/plugins/mpc_decoder/mppdec/requant.h b/akode/plugins/mpc_decoder/mppdec/requant.h new file mode 100644 index 0000000..c5b8794 --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/requant.h @@ -0,0 +1,14 @@ +#ifndef _requant_h +#define _requant_h_ + +#include "mpc_dec.h" + +/* C O N S T A N T S */ +extern const unsigned int Res_bit [18]; // bits per sample for chosen quantizer +extern const MPC_SAMPLE_FORMAT __Cc [1 + 18]; // coefficients for requantization +extern const int __Dc [1 + 18]; // offset for requantization + +#define Cc (__Cc + 1) +#define Dc (__Dc + 1) + +#endif diff --git a/akode/plugins/mpc_decoder/mppdec/stdafx.cpp b/akode/plugins/mpc_decoder/mppdec/stdafx.cpp new file mode 100644 index 0000000..81b3bac --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/stdafx.cpp @@ -0,0 +1,6 @@ +// stdafx.cpp : source file that includes just the standard includes +// mpcdec.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + diff --git a/akode/plugins/mpc_decoder/mppdec/stdafx.h b/akode/plugins/mpc_decoder/mppdec/stdafx.h new file mode 100644 index 0000000..771f6fe --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/stdafx.h @@ -0,0 +1,27 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#if !defined(AFX_STDAFX_H__B71FBBBC_81CB_47B5_A555_53A45CFD74F3__INCLUDED_) +#define AFX_STDAFX_H__B71FBBBC_81CB_47B5_A555_53A45CFD74F3__INCLUDED_ + +#ifdef _MSC_VER +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 +#endif // _MSC_VER + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <math.h> + +#include "mpc_dec.h" +#include "requant.h" + + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STDAFX_H__B71FBBBC_81CB_47B5_A555_53A45CFD74F3__INCLUDED_) diff --git a/akode/plugins/mpc_decoder/mppdec/streaminfo.cpp b/akode/plugins/mpc_decoder/mppdec/streaminfo.cpp new file mode 100644 index 0000000..fa61a23 --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/streaminfo.cpp @@ -0,0 +1,210 @@ +#include "stdafx.h" + +long JumpID3v2 ( MPC_reader* fp );//idtag.cpp + +static const char* +Stringify ( unsigned int profile ) // profile is 0...15, where 7...13 is used +{ + static const char na [] = "n.a."; + static const char* Names [] = { + na, "'Unstable/Experimental'", na, na, + na, "'quality 0'", "'quality 1'", "'Telephone'", + "'Thumb'", "'Radio'", "'Standard'", "'Xtreme'", + "'Insane'", "'BrainDead'", "'quality 9'", "'quality 10'" + }; + + return profile >= sizeof(Names)/sizeof(*Names) ? na : Names [profile]; +} + +// read information from SV8 header +int StreamInfo::ReadHeaderSV8 ( MPC_reader* fp ) +{ + return 0; +} + +// read information from SV7 header +int StreamInfo::ReadHeaderSV7 ( unsigned int HeaderData [8] ) +{ + const int samplefreqs [4] = { 44100, 48000, 37800, 32000 }; + + //unsigned int HeaderData [8]; + unsigned short EstimatedPeakTitle = 0; + + if ( simple.StreamVersion > 0x71 ) { +// Update (simple.StreamVersion); + return 0; + } + + /* + if ( !fp->seek ( simple.HeaderPosition, SEEK_SET ) ) // seek to header start + return ERROR_CODE_FILE; + if ( fp->read ( HeaderData, sizeof HeaderData) != sizeof HeaderData ) + return ERROR_CODE_FILE; + */ + + simple.Bitrate = 0; + simple.Frames = HeaderData[1]; + simple.IS = 0; + simple.MS = (HeaderData[2] >> 30) & 0x0001; + simple.MaxBand = (HeaderData[2] >> 24) & 0x003F; + simple.BlockSize = 1; + simple.Profile = (HeaderData[2] << 8) >> 28; + simple.ProfileName = Stringify ( simple.Profile ); + + simple.SampleFreq = samplefreqs [(HeaderData[2]>>16) & 0x0003]; + + EstimatedPeakTitle = (unsigned short)( HeaderData[2] & 0xFFFF ); // read the ReplayGain data + simple.GainTitle = (unsigned short)((HeaderData[3] >> 16) & 0xFFFF ); + simple.PeakTitle = (unsigned short)( HeaderData[3] & 0xFFFF ); + simple.GainAlbum = (unsigned short)((HeaderData[4] >> 16) & 0xFFFF ); + simple.PeakAlbum = (unsigned short)( HeaderData[4] & 0xFFFF ); + + simple.IsTrueGapless = (HeaderData[5] >> 31) & 0x0001; // true gapless: used? + simple.LastFrameSamples = (HeaderData[5] >> 20) & 0x07FF; // true gapless: valid samples for last frame + + simple.EncoderVersion = (HeaderData[6] >> 24) & 0x00FF; + if ( simple.EncoderVersion == 0 ) { + sprintf ( simple.Encoder, "Buschmann 1.7.0...9, Klemm 0.90...1.05" ); + } else { + switch ( simple.EncoderVersion % 10 ) { + case 0: + sprintf ( simple.Encoder, "Release %u.%u", simple.EncoderVersion/100, simple.EncoderVersion/10%10 ); + break; + case 2: case 4: case 6: case 8: + sprintf ( simple.Encoder, "Beta %u.%02u", simple.EncoderVersion/100, simple.EncoderVersion%100 ); + break; + default: + sprintf ( simple.Encoder, "--Alpha-- %u.%02u", simple.EncoderVersion/100, simple.EncoderVersion%100 ); + break; + } + } + +// if ( simple.PeakTitle == 0 ) // there is no correct PeakTitle contained within header +// simple.PeakTitle = (unsigned short)(EstimatedPeakTitle * 1.18); +// if ( simple.PeakAlbum == 0 ) +// simple.PeakAlbum = simple.PeakTitle; // no correct PeakAlbum, use PeakTitle + + //simple.SampleFreq = 44100; // AB: used by all files up to SV7 + simple.Channels = 2; + + return ERROR_CODE_OK; +} + +// read information from SV4-SV6 header +int StreamInfo::ReadHeaderSV6 ( unsigned int HeaderData [8] ) +{ + //unsigned int HeaderData [8]; + + /* + if ( !fp->seek ( simple.HeaderPosition, SEEK_SET ) ) // seek to header start + return ERROR_CODE_FILE; + if ( fp->read ( HeaderData, sizeof HeaderData ) != sizeof HeaderData ) + return ERROR_CODE_FILE; + */ + + simple.Bitrate = (HeaderData[0] >> 23) & 0x01FF; // read the file-header (SV6 and below) + simple.IS = (HeaderData[0] >> 22) & 0x0001; + simple.MS = (HeaderData[0] >> 21) & 0x0001; + simple.StreamVersion = (HeaderData[0] >> 11) & 0x03FF; + simple.MaxBand = (HeaderData[0] >> 6) & 0x001F; + simple.BlockSize = (HeaderData[0] ) & 0x003F; + simple.Profile = 0; + simple.ProfileName = Stringify ( (unsigned)(-1) ); + if ( simple.StreamVersion >= 5 ) + simple.Frames = HeaderData[1]; // 32 bit + else + simple.Frames = (HeaderData[1]>>16); // 16 bit + + simple.GainTitle = 0; // not supported + simple.PeakTitle = 0; + simple.GainAlbum = 0; + simple.PeakAlbum = 0; + + simple.LastFrameSamples = 0; + simple.IsTrueGapless = 0; + + simple.EncoderVersion = 0; + simple.Encoder[0] = '\0'; + + if ( simple.StreamVersion == 7 ) return ERROR_CODE_SV7BETA; // are there any unsupported parameters used? + if ( simple.Bitrate != 0 ) return ERROR_CODE_CBR; + if ( simple.IS != 0 ) return ERROR_CODE_IS; + if ( simple.BlockSize != 1 ) return ERROR_CODE_BLOCKSIZE; + + if ( simple.StreamVersion < 6 ) // Bugfix: last frame was invalid for up to SV5 + simple.Frames -= 1; + + simple.SampleFreq = 44100; // AB: used by all files up to SV7 + simple.Channels = 2; + + if ( simple.StreamVersion < 4 || simple.StreamVersion > 7 ) + return ERROR_CODE_INVALIDSV; + + return ERROR_CODE_OK; +} + +static unsigned int swap32(unsigned int val) +{ + const unsigned char * src = (const unsigned char*)&val; + return (unsigned int)src[0] | ((unsigned int)src[1] << 8) | ((unsigned int)src[2] << 16) | ((unsigned int)src[3] << 24); +} + +// reads file header and tags +int StreamInfo::ReadStreamInfo ( MPC_reader* fp) +{ + unsigned int HeaderData[8]; + int Error = 0; + + //memset ( &simple, 0, sizeof (BasicData) ); // Reset Info-Data + + + if ( (simple.HeaderPosition = JumpID3v2 (fp)) < 0 ) // get header position + return ERROR_CODE_FILE; + + if ( !fp->seek ( simple.HeaderPosition, SEEK_SET ) ) // seek to first byte of mpc data + return ERROR_CODE_FILE; + if ( fp->read ( HeaderData, 8*4 ) != 8*4 ) + return ERROR_CODE_FILE; + if (!fp->seek(simple.HeaderPosition+6*4,SEEK_SET)) return ERROR_CODE_FILE; + +/* if ( fp->read ( HeaderData, 6*4 ) != 6*4 ) + return ERROR_CODE_FILE; + HeaderData[6]=HeaderData[7]=0; + */ + /* + if ( fp->seek ( 0L, SEEK_END ) != 0 ) // get filelength + return ERROR_CODE_FILE; + simple.TotalFileLength = fp->tell(); + */ + simple.TotalFileLength = fp->get_size (); + simple.TagOffset = simple.TotalFileLength; + + if ( memcmp ( HeaderData, "MP+", 3 ) == 0 ) + { +#ifndef MPC_LITTLE_ENDIAN + { + unsigned int ptr; + for(ptr=0;ptr<8;ptr++) HeaderData[ptr] = swap32(HeaderData[ptr]); + } +#endif + simple.StreamVersion = HeaderData[0] >> 24; + + if ( (simple.StreamVersion & 15) >= 8 ) // StreamVersion 8 + Error = ReadHeaderSV8 ( fp ); + else if ( (simple.StreamVersion & 15) == 7 ) // StreamVersion 7 + Error = ReadHeaderSV7 ( HeaderData ); + } else { // StreamVersion 4-6 + Error = ReadHeaderSV6 ( HeaderData ); + } + + + simple.PCMSamples = 1152 * simple.Frames - 576; // estimation, exact value needs too much time + if ( simple.PCMSamples > 0 ) + simple.AverageBitrate = (simple.TagOffset - simple.HeaderPosition) * 8. * simple.SampleFreq / simple.PCMSamples; + else + simple.AverageBitrate = 0; + + return Error; +} + +/* end of in_mpc.c */ diff --git a/akode/plugins/mpc_decoder/mppdec/streaminfo.h b/akode/plugins/mpc_decoder/mppdec/streaminfo.h new file mode 100644 index 0000000..19bf2e9 --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/streaminfo.h @@ -0,0 +1,70 @@ +#ifndef _mpc_streaminfo_h_ +#define _mpc_streaminfo_h_ + +#ifndef _mpc_dec_h_ +class MPC_reader; +#endif + + +// error codes +#define ERROR_CODE_OK 0 +#define ERROR_CODE_FILE -1 +#define ERROR_CODE_SV7BETA 1 +#define ERROR_CODE_CBR 2 +#define ERROR_CODE_IS 3 +#define ERROR_CODE_BLOCKSIZE 4 +#define ERROR_CODE_INVALIDSV 5 + + +class StreamInfo { +public: + typedef long off_t; + + typedef struct { + unsigned int SampleFreq; + unsigned int Channels; + off_t HeaderPosition; // byte position of header + unsigned int StreamVersion; // Streamversion of current file + unsigned int Bitrate; // bitrate of current file (bps) + double AverageBitrate; // Average bitrate in bits/sec + unsigned int Frames; // number of frames contained + MPC_INT64 PCMSamples; + unsigned int MaxBand; // maximum band-index used (0...31) + unsigned int IS; // Intensity Stereo (0: off, 1: on) + unsigned int MS; // Mid/Side Stereo (0: off, 1: on) + unsigned int BlockSize; // only needed for SV4...SV6 -> not supported + unsigned int Profile; // quality profile + const char* ProfileName; + + // ReplayGain related data + short GainTitle; + short GainAlbum; + unsigned short PeakAlbum; + unsigned short PeakTitle; + + // true gapless stuff + unsigned int IsTrueGapless; // is true gapless used? + unsigned int LastFrameSamples; // number of valid samples within last frame + + unsigned int EncoderVersion; // version of encoder used + char Encoder[256]; + + off_t TagOffset; + off_t TotalFileLength; + } BasicData; + + BasicData simple; + +public: + StreamInfo (); + int ReadStreamInfo ( MPC_reader *fp ); + MPC_INT64 GetLenthSamples(); + double GetLength();//in seconds + +private: + int ReadHeaderSV6 ( unsigned int HeaderData [8] ); + int ReadHeaderSV7 ( unsigned int HeaderData [8] ); + int ReadHeaderSV8 ( MPC_reader* fp ); +}; + +#endif //_mpc_streaminfo_h_ diff --git a/akode/plugins/mpc_decoder/mppdec/synth_filter.cpp b/akode/plugins/mpc_decoder/mppdec/synth_filter.cpp new file mode 100644 index 0000000..256417a --- /dev/null +++ b/akode/plugins/mpc_decoder/mppdec/synth_filter.cpp @@ -0,0 +1,403 @@ +#include "stdafx.h" + +typedef int ptrdiff_t; + + +/* C O N S T A N T S */ +#undef _ + +#define MPC_FIXED_POINT_SYNTH_FIX 2 +#define MPC_FIXED_POINT_SYNTH_FIX2 0 + +#define Di_opt_shift 30 +#define _(value) MAKE_MPC_SAMPLE_EX((double)value/(double)(0x10000 << MPC_FIXED_POINT_SYNTH_FIX2),Di_opt_shift) + + +static const MPC_SAMPLE_FORMAT Di_opt [32] [16] = { + { _( 0), _( -29), _( 213), _( -459), _( 2037), _(-5153), _( 6574), _(-37489), _(75038), _(37489), _(6574), _( 5153), _(2037), _( 459), _(213), _(29) }, + { _( -1), _( -31), _( 218), _( -519), _( 2000), _(-5517), _( 5959), _(-39336), _(74992), _(35640), _(7134), _( 4788), _(2063), _( 401), _(208), _(26) }, + { _( -1), _( -35), _( 222), _( -581), _( 1952), _(-5879), _( 5288), _(-41176), _(74856), _(33791), _(7640), _( 4425), _(2080), _( 347), _(202), _(24) }, + { _( -1), _( -38), _( 225), _( -645), _( 1893), _(-6237), _( 4561), _(-43006), _(74630), _(31947), _(8092), _( 4063), _(2087), _( 294), _(196), _(21) }, + { _( -1), _( -41), _( 227), _( -711), _( 1822), _(-6589), _( 3776), _(-44821), _(74313), _(30112), _(8492), _( 3705), _(2085), _( 244), _(190), _(19) }, + { _( -1), _( -45), _( 228), _( -779), _( 1739), _(-6935), _( 2935), _(-46617), _(73908), _(28289), _(8840), _( 3351), _(2075), _( 197), _(183), _(17) }, + { _( -1), _( -49), _( 228), _( -848), _( 1644), _(-7271), _( 2037), _(-48390), _(73415), _(26482), _(9139), _( 3004), _(2057), _( 153), _(176), _(16) }, + { _( -2), _( -53), _( 227), _( -919), _( 1535), _(-7597), _( 1082), _(-50137), _(72835), _(24694), _(9389), _( 2663), _(2032), _( 111), _(169), _(14) }, + { _( -2), _( -58), _( 224), _( -991), _( 1414), _(-7910), _( 70), _(-51853), _(72169), _(22929), _(9592), _( 2330), _(2001), _( 72), _(161), _(13) }, + { _( -2), _( -63), _( 221), _(-1064), _( 1280), _(-8209), _( -998), _(-53534), _(71420), _(21189), _(9750), _( 2006), _(1962), _( 36), _(154), _(11) }, + { _( -2), _( -68), _( 215), _(-1137), _( 1131), _(-8491), _( -2122), _(-55178), _(70590), _(19478), _(9863), _( 1692), _(1919), _( 2), _(147), _(10) }, + { _( -3), _( -73), _( 208), _(-1210), _( 970), _(-8755), _( -3300), _(-56778), _(69679), _(17799), _(9935), _( 1388), _(1870), _( -29), _(139), _( 9) }, + { _( -3), _( -79), _( 200), _(-1283), _( 794), _(-8998), _( -4533), _(-58333), _(68692), _(16155), _(9966), _( 1095), _(1817), _( -57), _(132), _( 8) }, + { _( -4), _( -85), _( 189), _(-1356), _( 605), _(-9219), _( -5818), _(-59838), _(67629), _(14548), _(9959), _( 814), _(1759), _( -83), _(125), _( 7) }, + { _( -4), _( -91), _( 177), _(-1428), _( 402), _(-9416), _( -7154), _(-61289), _(66494), _(12980), _(9916), _( 545), _(1698), _(-106), _(117), _( 7) }, + { _( -5), _( -97), _( 163), _(-1498), _( 185), _(-9585), _( -8540), _(-62684), _(65290), _(11455), _(9838), _( 288), _(1634), _(-127), _(111), _( 6) }, + { _( -5), _(-104), _( 146), _(-1567), _( -45), _(-9727), _( -9975), _(-64019), _(64019), _( 9975), _(9727), _( 45), _(1567), _(-146), _(104), _( 5) }, + { _( -6), _(-111), _( 127), _(-1634), _( -288), _(-9838), _(-11455), _(-65290), _(62684), _( 8540), _(9585), _( -185), _(1498), _(-163), _( 97), _( 5) }, + { _( -7), _(-117), _( 106), _(-1698), _( -545), _(-9916), _(-12980), _(-66494), _(61289), _( 7154), _(9416), _( -402), _(1428), _(-177), _( 91), _( 4) }, + { _( -7), _(-125), _( 83), _(-1759), _( -814), _(-9959), _(-14548), _(-67629), _(59838), _( 5818), _(9219), _( -605), _(1356), _(-189), _( 85), _( 4) }, + { _( -8), _(-132), _( 57), _(-1817), _(-1095), _(-9966), _(-16155), _(-68692), _(58333), _( 4533), _(8998), _( -794), _(1283), _(-200), _( 79), _( 3) }, + { _( -9), _(-139), _( 29), _(-1870), _(-1388), _(-9935), _(-17799), _(-69679), _(56778), _( 3300), _(8755), _( -970), _(1210), _(-208), _( 73), _( 3) }, + { _(-10), _(-147), _( -2), _(-1919), _(-1692), _(-9863), _(-19478), _(-70590), _(55178), _( 2122), _(8491), _(-1131), _(1137), _(-215), _( 68), _( 2) }, + { _(-11), _(-154), _( -36), _(-1962), _(-2006), _(-9750), _(-21189), _(-71420), _(53534), _( 998), _(8209), _(-1280), _(1064), _(-221), _( 63), _( 2) }, + { _(-13), _(-161), _( -72), _(-2001), _(-2330), _(-9592), _(-22929), _(-72169), _(51853), _( -70), _(7910), _(-1414), _( 991), _(-224), _( 58), _( 2) }, + { _(-14), _(-169), _(-111), _(-2032), _(-2663), _(-9389), _(-24694), _(-72835), _(50137), _(-1082), _(7597), _(-1535), _( 919), _(-227), _( 53), _( 2) }, + { _(-16), _(-176), _(-153), _(-2057), _(-3004), _(-9139), _(-26482), _(-73415), _(48390), _(-2037), _(7271), _(-1644), _( 848), _(-228), _( 49), _( 1) }, + { _(-17), _(-183), _(-197), _(-2075), _(-3351), _(-8840), _(-28289), _(-73908), _(46617), _(-2935), _(6935), _(-1739), _( 779), _(-228), _( 45), _( 1) }, + { _(-19), _(-190), _(-244), _(-2085), _(-3705), _(-8492), _(-30112), _(-74313), _(44821), _(-3776), _(6589), _(-1822), _( 711), _(-227), _( 41), _( 1) }, + { _(-21), _(-196), _(-294), _(-2087), _(-4063), _(-8092), _(-31947), _(-74630), _(43006), _(-4561), _(6237), _(-1893), _( 645), _(-225), _( 38), _( 1) }, + { _(-24), _(-202), _(-347), _(-2080), _(-4425), _(-7640), _(-33791), _(-74856), _(41176), _(-5288), _(5879), _(-1952), _( 581), _(-222), _( 35), _( 1) }, + { _(-26), _(-208), _(-401), _(-2063), _(-4788), _(-7134), _(-35640), _(-74992), _(39336), _(-5959), _(5517), _(-2000), _( 519), _(-218), _( 31), _( 1) } +}; + +#undef _ + +/* F U N K T I O N E N */ +void +MPC_decoder::Reset_V ( void ) +{ + memset ( V_L, 0, sizeof V_L ); + memset ( V_R, 0, sizeof V_R ); +} + + +static void Calculate_New_V ( const MPC_SAMPLE_FORMAT * Sample, MPC_SAMPLE_FORMAT * V ) +{ + // Calculating new V-buffer values for left channel + // calculate new V-values (ISO-11172-3, p. 39) + // based upon fast-MDCT algorithm by Byeong Gi Lee + /*static*/ MPC_SAMPLE_FORMAT A00, A01, A02, A03, A04, A05, A06, A07, A08, A09, A10, A11, A12, A13, A14, A15; + /*static*/ MPC_SAMPLE_FORMAT B00, B01, B02, B03, B04, B05, B06, B07, B08, B09, B10, B11, B12, B13, B14, B15; + MPC_SAMPLE_FORMAT tmp; + + A00 = Sample[ 0] + Sample[31]; + A01 = Sample[ 1] + Sample[30]; + A02 = Sample[ 2] + Sample[29]; + A03 = Sample[ 3] + Sample[28]; + A04 = Sample[ 4] + Sample[27]; + A05 = Sample[ 5] + Sample[26]; + A06 = Sample[ 6] + Sample[25]; + A07 = Sample[ 7] + Sample[24]; + A08 = Sample[ 8] + Sample[23]; + A09 = Sample[ 9] + Sample[22]; + A10 = Sample[10] + Sample[21]; + A11 = Sample[11] + Sample[20]; + A12 = Sample[12] + Sample[19]; + A13 = Sample[13] + Sample[18]; + A14 = Sample[14] + Sample[17]; + A15 = Sample[15] + Sample[16]; + + B00 = A00 + A15; + B01 = A01 + A14; + B02 = A02 + A13; + B03 = A03 + A12; + B04 = A04 + A11; + B05 = A05 + A10; + B06 = A06 + A09; + B07 = A07 + A08;; + B08 = MPC_SCALE_CONST((A00 - A15) , 0.5024192929f , 31); + B09 = MPC_SCALE_CONST((A01 - A14) , 0.5224986076f , 31); + B10 = MPC_SCALE_CONST((A02 - A13) , 0.5669440627f , 31); + B11 = MPC_SCALE_CONST((A03 - A12) , 0.6468217969f , 31); + B12 = MPC_SCALE_CONST((A04 - A11) , 0.7881546021f , 31); + B13 = MPC_SCALE_CONST((A05 - A10) , 1.0606776476f , 30); + B14 = MPC_SCALE_CONST((A06 - A09) , 1.7224471569f , 30); + B15 = MPC_SCALE_CONST((A07 - A08) , 5.1011486053f , 28); + + A00 = B00 + B07; + A01 = B01 + B06; + A02 = B02 + B05; + A03 = B03 + B04; + A04 = MPC_SCALE_CONST((B00 - B07) , 0.5097956061f , 31); + A05 = MPC_SCALE_CONST((B01 - B06) , 0.6013448834f , 31); + A06 = MPC_SCALE_CONST((B02 - B05) , 0.8999761939f , 31); + A07 = MPC_SCALE_CONST((B03 - B04) , 2.5629155636f , 29); + A08 = B08 + B15; + A09 = B09 + B14; + A10 = B10 + B13; + A11 = B11 + B12; + A12 = MPC_SCALE_CONST((B08 - B15) , 0.5097956061f , 31); + A13 = MPC_SCALE_CONST((B09 - B14) , 0.6013448834f , 31); + A14 = MPC_SCALE_CONST((B10 - B13) , 0.8999761939f , 31); + A15 = MPC_SCALE_CONST((B11 - B12) , 2.5629155636f , 29); + + B00 = A00 + A03; + B01 = A01 + A02; + B02 = MPC_SCALE_CONST((A00 - A03) , 0.5411961079f , 31); + B03 = MPC_SCALE_CONST((A01 - A02) , 1.3065630198f , 30); + B04 = A04 + A07; + B05 = A05 + A06; + B06 = MPC_SCALE_CONST((A04 - A07) , 0.5411961079f , 31); + B07 = MPC_SCALE_CONST((A05 - A06) , 1.3065630198f , 30); + B08 = A08 + A11; + B09 = A09 + A10; + B10 = MPC_SCALE_CONST((A08 - A11) , 0.5411961079f , 31); + B11 = MPC_SCALE_CONST((A09 - A10) , 1.3065630198f , 30); + B12 = A12 + A15; + B13 = A13 + A14; + B14 = MPC_SCALE_CONST((A12 - A15) , 0.5411961079f , 31); + B15 = MPC_SCALE_CONST((A13 - A14) , 1.3065630198f , 30); + + A00 = B00 + B01; + A01 = MPC_SCALE_CONST((B00 - B01) , 0.7071067691f , 31); + A02 = B02 + B03; + A03 = MPC_SCALE_CONST((B02 - B03) , 0.7071067691f , 31); + A04 = B04 + B05; + A05 = MPC_SCALE_CONST((B04 - B05) , 0.7071067691f , 31); + A06 = B06 + B07; + A07 = MPC_SCALE_CONST((B06 - B07) , 0.7071067691f , 31); + A08 = B08 + B09; + A09 = MPC_SCALE_CONST((B08 - B09) , 0.7071067691f , 31); + A10 = B10 + B11; + A11 = MPC_SCALE_CONST((B10 - B11) , 0.7071067691f , 31); + A12 = B12 + B13; + A13 = MPC_SCALE_CONST((B12 - B13) , 0.7071067691f , 31); + A14 = B14 + B15; + A15 = MPC_SCALE_CONST((B14 - B15) , 0.7071067691f , 31); + + V[48] = -A00; + V[ 0] = A01; + V[40] = -A02 - (V[ 8] = A03); + V[36] = -((V[ 4] = A05 + (V[12] = A07)) + A06); + V[44] = - A04 - A06 - A07; + V[ 6] = (V[10] = A11 + (V[14] = A15)) + A13; + V[38] = (V[34] = -(V[ 2] = A09 + A13 + A15) - A14) + A09 - A10 - A11; + V[46] = (tmp = -(A12 + A14 + A15)) - A08; + V[42] = tmp - A10 - A11; + + A00 = MPC_SCALE_CONST_SHR((Sample[ 0] - Sample[31]) , 0.5006030202f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A01 = MPC_SCALE_CONST_SHR((Sample[ 1] - Sample[30]) , 0.5054709315f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A02 = MPC_SCALE_CONST_SHR((Sample[ 2] - Sample[29]) , 0.5154473186f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A03 = MPC_SCALE_CONST_SHR((Sample[ 3] - Sample[28]) , 0.5310425758f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A04 = MPC_SCALE_CONST_SHR((Sample[ 4] - Sample[27]) , 0.5531039238f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A05 = MPC_SCALE_CONST_SHR((Sample[ 5] - Sample[26]) , 0.5829349756f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A06 = MPC_SCALE_CONST_SHR((Sample[ 6] - Sample[25]) , 0.6225041151f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A07 = MPC_SCALE_CONST_SHR((Sample[ 7] - Sample[24]) , 0.6748083234f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A08 = MPC_SCALE_CONST_SHR((Sample[ 8] - Sample[23]) , 0.7445362806f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A09 = MPC_SCALE_CONST_SHR((Sample[ 9] - Sample[22]) , 0.8393496275f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A10 = MPC_SCALE_CONST_SHR((Sample[10] - Sample[21]) , 0.9725682139f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A11 = MPC_SCALE_CONST_SHR((Sample[11] - Sample[20]) , 1.1694399118f , 30, MPC_FIXED_POINT_SYNTH_FIX); + A12 = MPC_SCALE_CONST_SHR((Sample[12] - Sample[19]) , 1.4841645956f , 30, MPC_FIXED_POINT_SYNTH_FIX); + A13 = MPC_SCALE_CONST_SHR((Sample[13] - Sample[18]) , 2.0577809811f , 29, MPC_FIXED_POINT_SYNTH_FIX); + A14 = MPC_SCALE_CONST_SHR((Sample[14] - Sample[17]) , 3.4076085091f , 29, MPC_FIXED_POINT_SYNTH_FIX); + A15 = MPC_SCALE_CONST_SHR((Sample[15] - Sample[16]) , 10.1900081635f, 27 ,MPC_FIXED_POINT_SYNTH_FIX); + + B00 = A00 + A15; + B01 = A01 + A14; + B02 = A02 + A13; + B03 = A03 + A12; + B04 = A04 + A11; + B05 = A05 + A10; + B06 = A06 + A09; + B07 = A07 + A08; + B08 = MPC_SCALE_CONST((A00 - A15) , 0.5024192929f , 31); + B09 = MPC_SCALE_CONST((A01 - A14) , 0.5224986076f , 31); + B10 = MPC_SCALE_CONST((A02 - A13) , 0.5669440627f , 31); + B11 = MPC_SCALE_CONST((A03 - A12) , 0.6468217969f , 31); + B12 = MPC_SCALE_CONST((A04 - A11) , 0.7881546021f , 31); + B13 = MPC_SCALE_CONST((A05 - A10) , 1.0606776476f , 30); + B14 = MPC_SCALE_CONST((A06 - A09) , 1.7224471569f , 30); + B15 = MPC_SCALE_CONST((A07 - A08) , 5.1011486053f , 28); + + A00 = B00 + B07; + A01 = B01 + B06; + A02 = B02 + B05; + A03 = B03 + B04; + A04 = MPC_SCALE_CONST((B00 - B07) , 0.5097956061f , 31); + A05 = MPC_SCALE_CONST((B01 - B06) , 0.6013448834f , 31); + A06 = MPC_SCALE_CONST((B02 - B05) , 0.8999761939f , 31); + A07 = MPC_SCALE_CONST((B03 - B04) , 2.5629155636f , 29); + A08 = B08 + B15; + A09 = B09 + B14; + A10 = B10 + B13; + A11 = B11 + B12; + A12 = MPC_SCALE_CONST((B08 - B15) , 0.5097956061f , 31); + A13 = MPC_SCALE_CONST((B09 - B14) , 0.6013448834f , 31); + A14 = MPC_SCALE_CONST((B10 - B13) , 0.8999761939f , 31); + A15 = MPC_SCALE_CONST((B11 - B12) , 2.5629155636f , 29); + + B00 = A00 + A03; + B01 = A01 + A02; + B02 = MPC_SCALE_CONST((A00 - A03) , 0.5411961079f , 31); + B03 = MPC_SCALE_CONST((A01 - A02) , 1.3065630198f , 30); + B04 = A04 + A07; + B05 = A05 + A06; + B06 = MPC_SCALE_CONST((A04 - A07) , 0.5411961079f , 31); + B07 = MPC_SCALE_CONST((A05 - A06) , 1.3065630198f , 30); + B08 = A08 + A11; + B09 = A09 + A10; + B10 = MPC_SCALE_CONST((A08 - A11) , 0.5411961079f , 31); + B11 = MPC_SCALE_CONST((A09 - A10) , 1.3065630198f , 30); + B12 = A12 + A15; + B13 = A13 + A14; + B14 = MPC_SCALE_CONST((A12 - A15) , 0.5411961079f , 31); + B15 = MPC_SCALE_CONST((A13 - A14) , 1.3065630198f , 30); + + A00 = MPC_SHL(B00 + B01, MPC_FIXED_POINT_SYNTH_FIX); + A01 = MPC_SCALE_CONST_SHL((B00 - B01) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A02 = MPC_SHL(B02 + B03, MPC_FIXED_POINT_SYNTH_FIX); + A03 = MPC_SCALE_CONST_SHL((B02 - B03) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A04 = MPC_SHL(B04 + B05, MPC_FIXED_POINT_SYNTH_FIX); + A05 = MPC_SCALE_CONST_SHL((B04 - B05) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A06 = MPC_SHL(B06 + B07, MPC_FIXED_POINT_SYNTH_FIX); + A07 = MPC_SCALE_CONST_SHL((B06 - B07) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A08 = MPC_SHL(B08 + B09, MPC_FIXED_POINT_SYNTH_FIX); + A09 = MPC_SCALE_CONST_SHL((B08 - B09) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A10 = MPC_SHL(B10 + B11, MPC_FIXED_POINT_SYNTH_FIX); + A11 = MPC_SCALE_CONST_SHL((B10 - B11) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A12 = MPC_SHL(B12 + B13, MPC_FIXED_POINT_SYNTH_FIX); + A13 = MPC_SCALE_CONST_SHL((B12 - B13) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX); + A14 = MPC_SHL(B14 + B15, MPC_FIXED_POINT_SYNTH_FIX); + A15 = MPC_SCALE_CONST_SHL((B14 - B15) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX); + + // mehrfach verwendete Ausdrücke: A04+A06+A07, A09+A13+A15 + V[ 5] = (V[11] = (V[13] = A07 + (V[15] = A15)) + A11) + A05 + A13; + V[ 7] = (V[ 9] = A03 + A11 + A15) + A13; + V[33] = -(V[ 1] = A01 + A09 + A13 + A15) - A14; + V[35] = -(V[ 3] = A05 + A07 + A09 + A13 + A15) - A06 - A14; + V[37] = (tmp = -(A10 + A11 + A13 + A14 + A15)) - A05 - A06 - A07; + V[39] = tmp - A02 - A03; // abhängig vom Befehl drüber + V[41] = (tmp += A13 - A12) - A02 - A03; // abhängig vom Befehl 2 drüber + V[43] = tmp - A04 - A06 - A07; // abhängig von Befehlen 1 und 3 drüber + V[47] = (tmp = -(A08 + A12 + A14 + A15)) - A00; + V[45] = tmp - A04 - A06 - A07; // abhängig vom Befehl drüber + + V[32] = -V[ 0]; + V[31] = -V[ 1]; + V[30] = -V[ 2]; + V[29] = -V[ 3]; + V[28] = -V[ 4]; + V[27] = -V[ 5]; + V[26] = -V[ 6]; + V[25] = -V[ 7]; + V[24] = -V[ 8]; + V[23] = -V[ 9]; + V[22] = -V[10]; + V[21] = -V[11]; + V[20] = -V[12]; + V[19] = -V[13]; + V[18] = -V[14]; + V[17] = -V[15]; + + V[63] = V[33]; + V[62] = V[34]; + V[61] = V[35]; + V[60] = V[36]; + V[59] = V[37]; + V[58] = V[38]; + V[57] = V[39]; + V[56] = V[40]; + V[55] = V[41]; + V[54] = V[42]; + V[53] = V[43]; + V[52] = V[44]; + V[51] = V[45]; + V[50] = V[46]; + V[49] = V[47]; +} + +static void Synthese_Filter_float_internal(MPC_SAMPLE_FORMAT * OutData,MPC_SAMPLE_FORMAT * V,const MPC_SAMPLE_FORMAT * Y) +{ + unsigned n; + for ( n = 0; n < 36; n++, Y += 32 ) { + V -= 64; + Calculate_New_V ( Y, V ); + { + MPC_SAMPLE_FORMAT * Data = OutData; + const MPC_SAMPLE_FORMAT * D = (const MPC_SAMPLE_FORMAT *) &Di_opt; + int k; + //int tmp; + + + + for ( k = 0; k < 32; k++, D += 16, V++ ) { + *Data = ( + ( MPC_MULTIPLY_EX(V[ 0],D[ 0],Di_opt_shift) + MPC_MULTIPLY_EX(V[ 96],D[ 1],Di_opt_shift) + MPC_MULTIPLY_EX(V[128],D[ 2],Di_opt_shift) + MPC_MULTIPLY_EX(V[224],D[ 3],Di_opt_shift) + + MPC_MULTIPLY_EX(V[256],D[ 4],Di_opt_shift) + MPC_MULTIPLY_EX(V[352],D[ 5],Di_opt_shift) + MPC_MULTIPLY_EX(V[384],D[ 6],Di_opt_shift) + MPC_MULTIPLY_EX(V[480],D[ 7],Di_opt_shift) + + MPC_MULTIPLY_EX(V[512],D[ 8],Di_opt_shift) + MPC_MULTIPLY_EX(V[608],D[ 9],Di_opt_shift) + MPC_MULTIPLY_EX(V[640],D[10],Di_opt_shift) + MPC_MULTIPLY_EX(V[736],D[11],Di_opt_shift) + + MPC_MULTIPLY_EX(V[768],D[12],Di_opt_shift) + MPC_MULTIPLY_EX(V[864],D[13],Di_opt_shift) + MPC_MULTIPLY_EX(V[896],D[14],Di_opt_shift) + MPC_MULTIPLY_EX(V[992],D[15],Di_opt_shift) ) ); + + Data += 2; + } + V -= 32;//bleh + OutData+=64; + } + } +} + +void +MPC_decoder::Synthese_Filter_float ( MPC_SAMPLE_FORMAT* OutData ) +{ + /********* left channel ********/ + memmove ( V_L + V_MEM, V_L, 960 * sizeof(MPC_SAMPLE_FORMAT) ); + + Synthese_Filter_float_internal(OutData,reinterpret_cast<MPC_SAMPLE_FORMAT*>(V_L + V_MEM),reinterpret_cast<MPC_SAMPLE_FORMAT*>(Y_L [0])); + + /******** right channel ********/ + memmove ( V_R + V_MEM, V_R, 960 * sizeof(MPC_SAMPLE_FORMAT) ); + + Synthese_Filter_float_internal(OutData+1,reinterpret_cast<MPC_SAMPLE_FORMAT*>(V_R + V_MEM),reinterpret_cast<MPC_SAMPLE_FORMAT*>(Y_R [0])); + +} + + + +/*******************************************/ +/* */ +/* dithered synthesis */ +/* */ +/*******************************************/ + +static const unsigned char Parity [256] = { // parity + 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, + 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0, + 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0, + 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, + 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0, + 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, + 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, + 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0 +}; + +/* + * This is a simple random number generator with good quality for audio purposes. + * It consists of two polycounters with opposite rotation direction and different + * periods. The periods are coprime, so the total period is the product of both. + * + * ------------------------------------------------------------------------------------------------- + * +-> |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0| + * | ------------------------------------------------------------------------------------------------- + * | | | | | | | + * | +--+--+--+-XOR-+--------+ + * | | + * +--------------------------------------------------------------------------------------+ + * + * ------------------------------------------------------------------------------------------------- + * |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0| <-+ + * ------------------------------------------------------------------------------------------------- | + * | | | | | + * +--+----XOR----+--+ | + * | | + * +----------------------------------------------------------------------------------------+ + * + * + * The first has an period of 3*5*17*257*65537, the second of 7*47*73*178481, + * which gives a period of 18.410.713.077.675.721.215. The result is the + * XORed values of both generators. + */ + +unsigned int +MPC_decoder::random_int ( void ) +{ +#if 1 + unsigned int t1, t2, t3, t4; + + t3 = t1 = __r1; t4 = t2 = __r2; // Parity calculation is done via table lookup, this is also available + t1 &= 0xF5; t2 >>= 25; // on CPUs without parity, can be implemented in C and avoid unpredictable + t1 = Parity [t1]; t2 &= 0x63; // jumps and slow rotate through the carry flag operations. + t1 <<= 31; t2 = Parity [t2]; + + return (__r1 = (t3 >> 1) | t1 ) ^ (__r2 = (t4 + t4) | t2 ); +#else + return (__r1 = (__r1 >> 1) | ((unsigned int)Parity [__r1 & 0xF5] << 31) ) ^ + (__r2 = (__r2 << 1) | (unsigned int)Parity [(__r2 >> 25) & 0x63] ); +#endif +} diff --git a/akode/plugins/mpeg_decoder/Makefile.am b/akode/plugins/mpeg_decoder/Makefile.am new file mode 100644 index 0000000..ae5c2dc --- /dev/null +++ b/akode/plugins/mpeg_decoder/Makefile.am @@ -0,0 +1,8 @@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(USER_INCLUDES) $(all_includes) + +lib_LTLIBRARIES = libakode_mpeg_decoder.la + +libakode_mpeg_decoder_la_SOURCES = mpeg_decoder.cpp + +libakode_mpeg_decoder_la_LDFLAGS = -avoid-version -no-undefined $(USER_LDFLAGS) +libakode_mpeg_decoder_la_LIBADD = ../../lib/libakode.la $(MADLIBS) diff --git a/akode/plugins/mpeg_decoder/Makefile.in b/akode/plugins/mpeg_decoder/Makefile.in new file mode 100644 index 0000000..244b914 --- /dev/null +++ b/akode/plugins/mpeg_decoder/Makefile.in @@ -0,0 +1,660 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = akode/plugins/mpeg_decoder +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/akode/lib/akode_export.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libakode_mpeg_decoder_la_DEPENDENCIES = ../../lib/libakode.la \ + $(am__DEPENDENCIES_1) +am_libakode_mpeg_decoder_la_OBJECTS = mpeg_decoder.lo +#>- libakode_mpeg_decoder_la_OBJECTS = \ +#>- $(am_libakode_mpeg_decoder_la_OBJECTS) +#>+ 1 +libakode_mpeg_decoder_la_OBJECTS = mpeg_decoder.lo +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/akode/lib +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 2 +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ +#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +#>- $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 3 +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +CXXLD = $(CXX) +#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ +#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +#>+ 2 +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libakode_mpeg_decoder_la_SOURCES) +DIST_SOURCES = $(libakode_mpeg_decoder_la_SOURCES) +ETAGS = etags +CTAGS = ctags +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AKODE_LIBDL = @AKODE_LIBDL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVCODEC_CFLAGS = @AVCODEC_CFLAGS@ +AVCODEC_LDFLAGS = @AVCODEC_LDFLAGS@ +AVCODEC_LIBADD = @AVCODEC_LIBADD@ +AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ +AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ +AVFORMAT_LIBADD = @AVFORMAT_LIBADD@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBADD = @JACK_LIBADD@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBFLAC = @LIBFLAC@ +LIBOBJS = @LIBOBJS@ +LIBOGGFLAC = @LIBOGGFLAC@ +LIBOSSAUDIO = @LIBOSSAUDIO@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSAMPLERATE = @LIBSAMPLERATE@ +LIBSEM = @LIBSEM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MADLIBS = @MADLIBS@ +MAKEINFO = @MAKEINFO@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POLYP_CFLAGS = @POLYP_CFLAGS@ +POLYP_LDFLAGS = @POLYP_LDFLAGS@ +POLYP_LIBADD = @POLYP_LIBADD@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXLIBS = @SPEEXLIBS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +VERSION = @VERSION@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +akode_SUBDIR_included_FALSE = @akode_SUBDIR_included_FALSE@ +akode_SUBDIR_included_TRUE = @akode_SUBDIR_included_TRUE@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_alsa_sink_FALSE = @include_alsa_sink_FALSE@ +include_alsa_sink_TRUE = @include_alsa_sink_TRUE@ +include_ffmpeg_decoder_FALSE = @include_ffmpeg_decoder_FALSE@ +include_ffmpeg_decoder_TRUE = @include_ffmpeg_decoder_TRUE@ +include_jack_sink_FALSE = @include_jack_sink_FALSE@ +include_jack_sink_TRUE = @include_jack_sink_TRUE@ +include_mpeg_decoder_FALSE = @include_mpeg_decoder_FALSE@ +include_mpeg_decoder_TRUE = @include_mpeg_decoder_TRUE@ +include_oss_sink_FALSE = @include_oss_sink_FALSE@ +include_oss_sink_TRUE = @include_oss_sink_TRUE@ +include_polyp_sink_FALSE = @include_polyp_sink_FALSE@ +include_polyp_sink_TRUE = @include_polyp_sink_TRUE@ +include_src_resampler_FALSE = @include_src_resampler_FALSE@ +include_src_resampler_TRUE = @include_src_resampler_TRUE@ +include_sun_sink_FALSE = @include_sun_sink_FALSE@ +include_sun_sink_TRUE = @include_sun_sink_TRUE@ +include_xiph_decoder_FALSE = @include_xiph_decoder_FALSE@ +include_xiph_decoder_TRUE = @include_xiph_decoder_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(USER_INCLUDES) $(all_includes) +lib_LTLIBRARIES = libakode_mpeg_decoder.la +libakode_mpeg_decoder_la_SOURCES = mpeg_decoder.cpp +#>- libakode_mpeg_decoder_la_LDFLAGS = -avoid-version -no-undefined $(USER_LDFLAGS) +#>+ 1 +libakode_mpeg_decoder_la_LDFLAGS = -avoid-version -no-undefined $(KDE_NO_UNDEFINED) $(USER_LDFLAGS) +libakode_mpeg_decoder_la_LIBADD = ../../lib/libakode.la $(MADLIBS) +#>- all: all-am +#>+ 1 +all: docs-am all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/mpeg_decoder/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu akode/plugins/mpeg_decoder/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/mpeg_decoder/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/mpeg_decoder/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/mpeg_decoder/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + 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 + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +#>- libakode_mpeg_decoder.la: $(libakode_mpeg_decoder_la_OBJECTS) $(libakode_mpeg_decoder_la_DEPENDENCIES) +#>+ 2 +@KDE_USE_CLOSURE_TRUE@libakode_mpeg_decoder.la: libakode_mpeg_decoder.la.closure $(libakode_mpeg_decoder_la_OBJECTS) $(libakode_mpeg_decoder_la_DEPENDENCIES) +@KDE_USE_CLOSURE_FALSE@libakode_mpeg_decoder.la: $(libakode_mpeg_decoder_la_OBJECTS) $(libakode_mpeg_decoder_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libakode_mpeg_decoder_la_LDFLAGS) $(libakode_mpeg_decoder_la_OBJECTS) $(libakode_mpeg_decoder_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpeg_decoder.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-am +#>+ 1 +clean: kde-rpo-clean clean-am + +#>- clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ +#>- mostlyclean-am +#>+ 2 +clean-am: clean-closures clean-bcheck clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES + +# 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: + +#>+ 8 +libakode_mpeg_decoder.la.closure: $(libakode_mpeg_decoder_la_OBJECTS) $(libakode_mpeg_decoder_la_DEPENDENCIES) + @echo "int main() {return 0;}" > libakode_mpeg_decoder_la_closure.cpp + @$(LTCXXCOMPILE) -c libakode_mpeg_decoder_la_closure.cpp + $(CXXLINK) libakode_mpeg_decoder_la_closure.lo $(libakode_mpeg_decoder_la_LDFLAGS) $(libakode_mpeg_decoder_la_OBJECTS) $(libakode_mpeg_decoder_la_LIBADD) $(LIBS) + @rm -f libakode_mpeg_decoder_la_closure.* libakode_mpeg_decoder.la.closure + @echo "timestamp" > libakode_mpeg_decoder.la.closure + + +#>+ 2 +KDE_DIST=mpeg_decoder.h Makefile.in Makefile.am + +#>+ 3 +clean-closures: + -rm -f libakode_mpeg_decoder.la.closure + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/mpeg_decoder/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/mpeg_decoder/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/mpeg_decoder/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-am + +bcheck-am: + @for i in ; do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 3 +final: + $(MAKE) all-am + +#>+ 3 +final-install: + $(MAKE) install-am + +#>+ 3 +no-final: + $(MAKE) all-am + +#>+ 3 +no-final-install: + $(MAKE) install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/akode/plugins/mpeg_decoder/mpeg_decoder.cpp b/akode/plugins/mpeg_decoder/mpeg_decoder.cpp new file mode 100644 index 0000000..33466fa --- /dev/null +++ b/akode/plugins/mpeg_decoder/mpeg_decoder.cpp @@ -0,0 +1,572 @@ +/* aKode: MPEG-Decoder (MAD-decoder) + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + 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., 51 Franklin Steet, Fifth Floor, Boston, + MA 02110-1301, USA. +*/ + +#include "akodelib.h" + +// uncomment to debug the plugin +//#define MPEG_DEBUG + +#include <string.h> +#include <mad.h> + +#ifdef MPEG_DEBUG +#include <iostream> +using std::cerr; +#endif + +#include "file.h" +#include "audioframe.h" +#include "mpeg_decoder.h" + +namespace aKode { + +bool MPEGDecoderPlugin::canDecode(File* src) { + char header[6]; + unsigned char *buf = (unsigned char*)header; // C-stuff + bool res = false; + src->openRO(); + if(src->read(header, 4)) { + // skip id3v2 headers + if (memcmp(header, "ID3", 3) == 0) { + src->read(header, 6); + int size = 0; + if (buf[1] & 0x10) size += 10; + size += buf[5]; + size += buf[4] << 7; + size += buf[3] << 14; + size += buf[2] << 21; + src->seek(10+size); + src->read(header, 4); + } + if (buf[0] == 0xff && (buf[1] & 14)) // frame synchronizer + if((buf[1] & 0x18) != 0x08) // support MPEG 1, 2 and 2½ + if((buf[1] & 0x06) != 0x00) // Layer I, II and III + res = true; + } + src->close(); + return res; +} + +extern "C" { MPEGDecoderPlugin mpeg_decoder; } + +struct xing_frame { + // Xing header: + bool has_toc; // valid table-of-contents + unsigned int bytes; // nr-of-bytes (0 if unknown) + unsigned int frames; // nr-of-frames (0 if unknown) + unsigned char toc[100]; // time: x/100 -> place: y/256 (y = toc[x]) +}; + +#define FILEBUFFER_SIZE 8192 +struct MPEGDecoder::private_data +{ + private_data() : position(0), + length(0), + bitrate(0), + eof(false), + error(false), + initialized(false), + id3v2size(0), + xing_vbr(false), + unknown_vbr(false) + {}; + mad_stream stream; + mad_frame frame; + mad_synth synth; + + File *src; + AudioConfiguration config; + + long position, length; + int bitrate, layer; + + bool eof, error, initialized; + + int id3v2size; // size of prepended ID3v2 tag + bool xing_vbr; // Xing-compatible VBR + bool unknown_vbr; // Oh, bugger... + xing_frame xing; + + char filebuffer[FILEBUFFER_SIZE]; + + bool metaframe_filter(bool fast); +}; + +MPEGDecoder::MPEGDecoder(File *src) { + m_data = new private_data(); + + mad_stream_init(&m_data->stream); + mad_frame_init(&m_data->frame); + mad_synth_init(&m_data->synth); + + mad_stream_options(&m_data->stream, MAD_OPTION_IGNORECRC); + + m_data->eof = false; + m_data->error = false; + + m_data->src = src; + if (!m_data->src->openRO()) { + m_data->error = true; + #ifdef MPEG_DEBUG + cerr << "Could not open file: " << m_data->src->filename << "\n"; + #endif + } + m_data->src->fadvise(); + + m_data->length = m_data->src->length(); +} + +MPEGDecoder::~MPEGDecoder() { + mad_stream_finish(&m_data->stream); + mad_frame_finish(&m_data->frame); + mad_synth_finish(&m_data->synth); + m_data->src->close(); + delete m_data; +} + +bool MPEGDecoder::skipID3v2() { + m_data->src->seek(0); + m_data->id3v2size = 0; + char buf[16]; + if (m_data->src->read(buf, 10)) { + // skip id3v2 headers + if (memcmp(buf, "ID3", 3) == 0) { + #ifdef MPEG_DEBUG + cerr << "ID3v2 tag found\n"; + #endif + int size = 0; + if (buf[5] & 0x10) size += 10; + size += buf[9]; + size += buf[8] << 7; + size += buf[7] << 14; + size += buf[6] << 21; + m_data->id3v2size = size; + if (!m_data->src->seek(10+size)) { + char space[256]; + for(int i=0; i<size; ) { + i += m_data->src->read(space, (size-i) > 256 ? 256 : (size-i)); + } + } + return true; + } + } + if (!m_data->src->seek(0)) { + mad_stream_buffer(&m_data->stream, (uint8_t*)buf, 10); + } + return false; +} + +bool MPEGDecoder::moreData(bool flush) +{ + mad_stream *stream = &m_data->stream; + + long rem = 0; + if (stream->next_frame != 0 && !flush) { + rem = stream->bufend - stream->next_frame; + memmove(m_data->filebuffer, stream->next_frame, rem); + } + #ifdef MPEG_DEBUG +// cerr << "remainder=" << rem << "\n"; + #endif + + int res = m_data->src->read(m_data->filebuffer+rem, FILEBUFFER_SIZE-rem); + mad_stream_buffer(stream, (uint8_t*)m_data->filebuffer, res+rem); + // for some reason MAD can't to do this itself: + if (stream->error == MAD_ERROR_LOSTSYNC || flush) stream->sync = 0; + stream->error = MAD_ERROR_NONE; + + if (res == 0) { + m_data->eof = true; + return false; + } else + if (res < 0) { + m_data->error = true; + return false; + } else + return true; +} + +// originaly from minimad.c +template<int bits> +static inline int32_t scale(mad_fixed_t sample) +{ + /* round */ + sample += (1L << (MAD_F_FRACBITS - bits)); + + /* clip */ + if (sample >= MAD_F_ONE) + sample = MAD_F_ONE - 1; + else if (sample < -MAD_F_ONE) + sample = -MAD_F_ONE; + + /* quantize */ + return sample >> (MAD_F_FRACBITS + 1 - bits); +} + +static inline long postotime(long pos, int sample_rate) { + if (sample_rate == 0) return 0; + long sec = pos/sample_rate; + long rem = pos%sample_rate; + long ms = (rem*1000)/sample_rate; + return sec*1000+ms; +} + + +// Xing-header documentation is from http://www.multiweb.cz/twoinches/MP3inside.htm +// toc-format verified in LAME source-code +static bool xing_decode(xing_frame *xing, const unsigned char * bytes) +{ + mad_bitptr ptr; + mad_bit_init(&ptr, bytes); + + if (mad_bit_read(&ptr, 32) == (('X' << 24) | ('i' << 16) | ('n' << 8) | 'g')) + { + int flags = mad_bit_read(&ptr, 32); + if (flags & 1) + xing->frames = mad_bit_read(&ptr, 32); + if (flags & 2) + xing->bytes = mad_bit_read(&ptr, 32); + if (flags & 4) { + xing->has_toc = true; + for (int i=0; i<100; i++) { + xing->toc[i] = mad_bit_read(&ptr, 8); + } + } + return true; + } + return false; +} + +// Detect various metaframes +bool MPEGDecoder::private_data::metaframe_filter(bool fast) +{ + if (stream.anc_bitlen < 16) return false; + + const unsigned char* ptr; + + ptr = stream.anc_ptr.byte; +test: + if ((ptr[0] == 'X') && (ptr[1] == 'i') && (ptr[2] == 'n') && (ptr[3] =='g')) + { + #ifdef MPEG_DEBUG + cerr << "Xing(VBR) header found\n"; + #endif + xing_vbr = true; + xing_decode(&xing, ptr); + return true; + } /* + if ((ptr[0] == 'L') || (ptr[1] == 'A') || (ptr[2] == 'M') || (ptr[3] =='E')) + { + #ifdef MPEG_DEBUG + cerr << "LAME frame found\n"; + #endif + return true; + }*/ + if ((ptr[0] == 'I') && (ptr[1] == 'n') && (ptr[2] == 'f') && (ptr[3] =='o')) + { + #ifdef MPEG_DEBUG + cerr << "Info(CBR) header found\n"; + #endif + return true; + } + + if (!fast) { + // We can't trust broken-encoders to _not_ fuck this up + ptr = stream.this_frame; + // skip frame header and side info + ptr += 6; + // Search for metaframe tags: + for(int i=0; i<64 && ptr < stream.bufend; i++) { + if (*ptr == 'X' || *ptr== 'I') { + fast = true; + goto test; + } + ptr++; + } + } + + return false; +} + +bool MPEGDecoder::sync() +{ + // only try 32 times, if no sync-frame is found the file is properbly not MPEG + for(int i=0; i<32; i++) { + int res = mad_stream_sync(&m_data->stream); + if (res == 0 ) goto got_sync; + if (!moreData(true)) break; + } + m_data->error=true; + #ifdef MPEG_DEBUG + cerr << "Synchronization failed, likely not a mpeg audio file.\n"; + #endif + return false; + +got_sync: + return true; +} + +bool MPEGDecoder::prepare() +{ + skipID3v2(); + // initialize stream + if (m_data->stream.buffer == 0) moreData(); + + if (sync()) { + m_data->initialized = true; + return true; + } else + return false; +} + +static void setChannelConfiguration(AudioConfiguration& config, mad_mode mode) +{ + switch(mode) { + case MAD_MODE_SINGLE_CHANNEL: + config.channels=1; + config.channel_config=MonoStereo; + break; + case MAD_MODE_DUAL_CHANNEL: + config.channels=2; + config.channel_config=MultiChannel; + break; + default: // Stereo and joint stereo + config.channels=2; + config.channel_config=MonoStereo; + } + config.surround_config = 0; +} + +bool MPEGDecoder::readFrame(AudioFrame* frame) +{ + if (m_data->error) return false; + + int res = 0; + if (!m_data->initialized) { + if (!prepare()) return false; + + int retries = 0; + first_frame: + if (retries >= 8) { + // fatal error + m_data->error = true; + return false; + } + res = mad_frame_decode(&m_data->frame, &m_data->stream); + if (res != 0) { + if (m_data->stream.error == MAD_ERROR_BUFLEN) { + retries++; + if (!moreData(true)) return false; + } + else + if (m_data->stream.error == MAD_ERROR_LOSTSYNC) + {} + else + if (MAD_RECOVERABLE(m_data->stream.error)) { + #ifdef MPEG_DEBUG + cerr << "Invalid frame: " << mad_stream_errorstr(&m_data->stream) << "\n"; + #endif + m_data->metaframe_filter(true); + } + goto first_frame; + } + + m_data->config.sample_rate = m_data->frame.header.samplerate; + m_data->config.sample_width = 16; + setChannelConfiguration(m_data->config, m_data->frame.header.mode); + + m_data->bitrate = m_data->frame.header.bitrate; + m_data->layer = m_data->frame.header.layer; + + m_data->metaframe_filter(false); + } + else { + if (m_data->stream.buffer == 0 || + m_data->stream.error==MAD_ERROR_BUFLEN || + m_data->stream.error==MAD_ERROR_LOSTSYNC) if (!moreData()) return false; + + int retries = 0; + bool sync = true; + retry: + // give up after 16 new pages + if (retries >= 16) { + // fatal error + m_data->error = true; + return false; + } + res = mad_frame_decode(&m_data->frame, &m_data->stream); + + if (res != 0) { + if (m_data->stream.error == MAD_ERROR_BUFLEN) { + retries++; + if (moreData(!sync)) return false; + goto retry; + } + else + if (m_data->stream.error == MAD_ERROR_LOSTSYNC) { + #ifdef MPEG_DEBUG + cerr << "No sync\n"; + #endif + sync = false; + goto retry; + } + else + if (MAD_RECOVERABLE(m_data->stream.error)) { // invalid frame + #ifdef MPEG_DEBUG + cerr << "Invalid frame: " << mad_stream_errorstr(&m_data->stream) << "\n"; + #endif + m_data->metaframe_filter(true); + goto retry; + } + else { + // Unrecoverable error + m_data->error = true; + return false; + } + } + // fast check for metaframes + if (m_data->metaframe_filter(false)) + goto retry; + } + + if (m_data->bitrate && !m_data->xing_vbr) + if (m_data->bitrate != (int)m_data->frame.header.bitrate) + m_data->unknown_vbr = true; + + mad_synth_frame(&m_data->synth, &m_data->frame); + mad_pcm *pcm = &m_data->synth.pcm; + + // Has the format changed? (misread initial frame) + m_data->config.sample_rate = pcm->samplerate; + setChannelConfiguration(m_data->config, m_data->frame.header.mode); + + int channels = pcm->channels; + long length = pcm->length; + + frame->reserveSpace(&m_data->config, length); + + // Scale into frame (could be reduced to copy if we used MADs internal format) + int16_t** data = (int16_t**)frame->data; + for(int j=0; j<channels; j++) + for(int i=0; i<length; i++) + data[j][i] = scale<16>(pcm->samples[j][i]); + + m_data->position += length; + frame->pos = postotime(m_data->position, m_data->config.sample_rate); + + return true; +} + +static inline long time_madtoakode(mad_timer_t time) { + return mad_timer_count(time, MAD_UNITS_MILLISECONDS); +} + +static float mpeg_length(MPEGDecoder::private_data *m_data) { + if (m_data->layer == 1) + return (m_data->xing.frames*384.0)/m_data->config.sample_rate; + else + return (m_data->xing.frames*1152.0)/m_data->config.sample_rate; +} + +long MPEGDecoder::length() { + float len; + if (!m_data->initialized) return -1; + else { + if (m_data->xing_vbr || m_data->unknown_vbr) { + if (m_data->xing_vbr && m_data->xing.frames > 0) { + len = mpeg_length(m_data)*1000.0; + } + else { // VBR shot in the dark (based on average bitrate) + if (m_data->length > 0) { + float bytepos = m_data->src->position()/(float)m_data->length; + len = position()/bytepos; + } else + len = 0; + } + } + else { + if (m_data->length > 0) + len = ((float)m_data->length*8000.0)/((float)m_data->bitrate); + else + len = 0; + } + } + return (long)(len); +} + +long MPEGDecoder::position() { + if (!m_data->initialized) return -1; + if (m_data->frame.header.samplerate > 0 && m_data->position >= 0) + return postotime(m_data->position, m_data->config.sample_rate); + else + return -1; +} + +bool MPEGDecoder::eof() { + return m_data->eof; +} + +bool MPEGDecoder::error() { + return m_data->error; +} + +bool MPEGDecoder::seekable() { + return m_data->src->seekable(); +} + +bool MPEGDecoder::seek(long pos) { + if (!m_data->initialized) return false; + bool res = false; + // VBR with toc: + if (m_data->xing_vbr && m_data->xing.has_toc && m_data->xing.frames > 0) { + int procent = (int)((float)pos/(mpeg_length(m_data)*10)); + float place = ((float)m_data->xing.toc[procent])/256.0; + long bpos = (long)(place * m_data->length); + #ifdef MPEG_DEBUG + cerr << "TOC seeking " << procent << "/100 -> " << (long)(place*256.0) << "/256\n" ; + #endif + res = m_data->src->seek(bpos); + if (res) + m_data->position = (long)(((float)procent/100.0)*mpeg_length(m_data)*m_data->config.sample_rate); + } + else { // CBR seeking (and VBR without TOC fallback) + #ifdef MPEG_DEBUG + cerr << "CBR seeking\n"; + #endif + long bpos = (long)((((float)pos)*m_data->bitrate)/8000.0); + bpos += m_data->id3v2size; + res = m_data->src->seek(bpos); + if (res) + m_data->position = (long)(((float)pos*(float)m_data->config.sample_rate)/1000.0); + } + if (res) { + moreData(true); + sync(); + } + + return res; +} + +const AudioConfiguration* MPEGDecoder::audioConfiguration() { + if (!m_data->initialized) return 0; + return &m_data->config; +} + +} // namespace diff --git a/akode/plugins/mpeg_decoder/mpeg_decoder.h b/akode/plugins/mpeg_decoder/mpeg_decoder.h new file mode 100644 index 0000000..4d15ded --- /dev/null +++ b/akode/plugins/mpeg_decoder/mpeg_decoder.h @@ -0,0 +1,69 @@ +/* aKode: MPEG-Format(MAD) + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + 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., 51 Franklin Steet, Fifth Floor, Boston, + MA 02110-1301, USA. +*/ + +#ifndef _AKODE_MPEG_DECODER_H +#define _AKODE_MPEG_DECODER_H + +#include "decoder.h" + +namespace aKode { + +class File; +class AudioFrame; + +class MPEGDecoder : public Decoder { +public: + MPEGDecoder(File* src); + virtual ~MPEGDecoder(); + + virtual bool readFrame(AudioFrame*); + virtual long length(); + virtual long position(); + virtual bool seek(long); + virtual bool seekable(); + virtual bool eof(); + virtual bool error(); + + virtual const AudioConfiguration* audioConfiguration(); + + struct private_data; +private: + private_data *m_data; + bool prepare(); + bool sync(); + bool skipID3v2(); + bool moreData(bool flush = false); +}; + + +class MPEGDecoderPlugin : public DecoderPlugin { +public: + virtual bool canDecode(File*); + virtual MPEGDecoder* openDecoder(File* src) + { + return new MPEGDecoder(src); + }; +}; + +extern "C" MPEGDecoderPlugin mpeg_decoder; + +} // namespace + +#endif diff --git a/akode/plugins/oss_sink/Makefile.am b/akode/plugins/oss_sink/Makefile.am new file mode 100644 index 0000000..c088c75 --- /dev/null +++ b/akode/plugins/oss_sink/Makefile.am @@ -0,0 +1,7 @@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(all_includes) + +lib_LTLIBRARIES = libakode_oss_sink.la + +libakode_oss_sink_la_SOURCES = oss_sink.cpp +libakode_oss_sink_la_LDFLAGS = -module -avoid-version -no-undefined +libakode_oss_sink_la_LIBADD = ../../lib/libakode.la $(LIBOSSAUDIO) diff --git a/akode/plugins/oss_sink/Makefile.in b/akode/plugins/oss_sink/Makefile.in new file mode 100644 index 0000000..104d913 --- /dev/null +++ b/akode/plugins/oss_sink/Makefile.in @@ -0,0 +1,659 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = akode/plugins/oss_sink +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/akode/lib/akode_export.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libakode_oss_sink_la_DEPENDENCIES = ../../lib/libakode.la \ + $(am__DEPENDENCIES_1) +am_libakode_oss_sink_la_OBJECTS = oss_sink.lo +#>- libakode_oss_sink_la_OBJECTS = $(am_libakode_oss_sink_la_OBJECTS) +#>+ 1 +libakode_oss_sink_la_OBJECTS = oss_sink.lo +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/akode/lib +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 2 +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ +#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +#>- $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 3 +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +CXXLD = $(CXX) +#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ +#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +#>+ 2 +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libakode_oss_sink_la_SOURCES) +DIST_SOURCES = $(libakode_oss_sink_la_SOURCES) +ETAGS = etags +CTAGS = ctags +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AKODE_LIBDL = @AKODE_LIBDL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVCODEC_CFLAGS = @AVCODEC_CFLAGS@ +AVCODEC_LDFLAGS = @AVCODEC_LDFLAGS@ +AVCODEC_LIBADD = @AVCODEC_LIBADD@ +AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ +AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ +AVFORMAT_LIBADD = @AVFORMAT_LIBADD@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBADD = @JACK_LIBADD@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBFLAC = @LIBFLAC@ +LIBOBJS = @LIBOBJS@ +LIBOGGFLAC = @LIBOGGFLAC@ +LIBOSSAUDIO = @LIBOSSAUDIO@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSAMPLERATE = @LIBSAMPLERATE@ +LIBSEM = @LIBSEM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MADLIBS = @MADLIBS@ +MAKEINFO = @MAKEINFO@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POLYP_CFLAGS = @POLYP_CFLAGS@ +POLYP_LDFLAGS = @POLYP_LDFLAGS@ +POLYP_LIBADD = @POLYP_LIBADD@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXLIBS = @SPEEXLIBS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +VERSION = @VERSION@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +akode_SUBDIR_included_FALSE = @akode_SUBDIR_included_FALSE@ +akode_SUBDIR_included_TRUE = @akode_SUBDIR_included_TRUE@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_alsa_sink_FALSE = @include_alsa_sink_FALSE@ +include_alsa_sink_TRUE = @include_alsa_sink_TRUE@ +include_ffmpeg_decoder_FALSE = @include_ffmpeg_decoder_FALSE@ +include_ffmpeg_decoder_TRUE = @include_ffmpeg_decoder_TRUE@ +include_jack_sink_FALSE = @include_jack_sink_FALSE@ +include_jack_sink_TRUE = @include_jack_sink_TRUE@ +include_mpeg_decoder_FALSE = @include_mpeg_decoder_FALSE@ +include_mpeg_decoder_TRUE = @include_mpeg_decoder_TRUE@ +include_oss_sink_FALSE = @include_oss_sink_FALSE@ +include_oss_sink_TRUE = @include_oss_sink_TRUE@ +include_polyp_sink_FALSE = @include_polyp_sink_FALSE@ +include_polyp_sink_TRUE = @include_polyp_sink_TRUE@ +include_src_resampler_FALSE = @include_src_resampler_FALSE@ +include_src_resampler_TRUE = @include_src_resampler_TRUE@ +include_sun_sink_FALSE = @include_sun_sink_FALSE@ +include_sun_sink_TRUE = @include_sun_sink_TRUE@ +include_xiph_decoder_FALSE = @include_xiph_decoder_FALSE@ +include_xiph_decoder_TRUE = @include_xiph_decoder_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(all_includes) +lib_LTLIBRARIES = libakode_oss_sink.la +libakode_oss_sink_la_SOURCES = oss_sink.cpp +#>- libakode_oss_sink_la_LDFLAGS = -module -avoid-version -no-undefined +#>+ 1 +libakode_oss_sink_la_LDFLAGS = -module -avoid-version -no-undefined $(KDE_NO_UNDEFINED) +libakode_oss_sink_la_LIBADD = ../../lib/libakode.la $(LIBOSSAUDIO) +#>- all: all-am +#>+ 1 +all: docs-am all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/oss_sink/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu akode/plugins/oss_sink/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/oss_sink/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/oss_sink/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/oss_sink/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + 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 + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +#>- libakode_oss_sink.la: $(libakode_oss_sink_la_OBJECTS) $(libakode_oss_sink_la_DEPENDENCIES) +#>+ 2 +@KDE_USE_CLOSURE_TRUE@libakode_oss_sink.la: libakode_oss_sink.la.closure $(libakode_oss_sink_la_OBJECTS) $(libakode_oss_sink_la_DEPENDENCIES) +@KDE_USE_CLOSURE_FALSE@libakode_oss_sink.la: $(libakode_oss_sink_la_OBJECTS) $(libakode_oss_sink_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libakode_oss_sink_la_LDFLAGS) $(libakode_oss_sink_la_OBJECTS) $(libakode_oss_sink_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oss_sink.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-am +#>+ 1 +clean: kde-rpo-clean clean-am + +#>- clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ +#>- mostlyclean-am +#>+ 2 +clean-am: clean-closures clean-bcheck clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES + +# 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: + +#>+ 8 +libakode_oss_sink.la.closure: $(libakode_oss_sink_la_OBJECTS) $(libakode_oss_sink_la_DEPENDENCIES) + @echo "int main() {return 0;}" > libakode_oss_sink_la_closure.cpp + @$(LTCXXCOMPILE) -c libakode_oss_sink_la_closure.cpp + $(CXXLINK) libakode_oss_sink_la_closure.lo $(libakode_oss_sink_la_LDFLAGS) $(libakode_oss_sink_la_OBJECTS) $(libakode_oss_sink_la_LIBADD) $(LIBS) + @rm -f libakode_oss_sink_la_closure.* libakode_oss_sink.la.closure + @echo "timestamp" > libakode_oss_sink.la.closure + + +#>+ 2 +KDE_DIST=oss_sink.h Makefile.in Makefile.am + +#>+ 3 +clean-closures: + -rm -f libakode_oss_sink.la.closure + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/oss_sink/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/oss_sink/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/oss_sink/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-am + +bcheck-am: + @for i in ; do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 3 +final: + $(MAKE) all-am + +#>+ 3 +final-install: + $(MAKE) install-am + +#>+ 3 +no-final: + $(MAKE) all-am + +#>+ 3 +no-final-install: + $(MAKE) install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/akode/plugins/oss_sink/oss_sink.cpp b/akode/plugins/oss_sink/oss_sink.cpp new file mode 100644 index 0000000..758bcf9 --- /dev/null +++ b/akode/plugins/oss_sink/oss_sink.cpp @@ -0,0 +1,218 @@ +/* aKode: OSS-Sink + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <config.h> + +#if defined(HAVE_SYS_SOUNDCARD_H) +#include <sys/soundcard.h> +#elif defined(HAVE_SOUNDCARD_H) +#include <soundcard.h> +#endif + +#include <sys/ioctl.h> +#include <errno.h> +#include <fcntl.h> +#include <unistd.h> + +#include <audioframe.h> +#include "oss_sink.h" + +#include <iostream> + +namespace aKode { + +extern "C" { OSSSinkPlugin oss_sink; } + +struct OSSSink::private_data +{ + private_data() : audio_fd(-1), device(0), valid(false), buffer(0), buffer_length(0) {}; + int audio_fd; + + const char *device; + AudioConfiguration config; + bool valid; + + char* buffer; + int buffer_length; +}; + + +static const char *_devices[] = { + "/dev/dsp", + "/dev/sound/dsp0", + "/dev/audio", + 0 +}; + +OSSSink::OSSSink() +{ + d = new private_data; +} + +OSSSink::~OSSSink() +{ + close(); + delete d; +} + +bool OSSSink::open() +{ + const char** device = _devices; + while (*device) { + if(::access(*device, F_OK) == 0) { + break; + } + device++; + } + + if (!*device) { + std::cerr << "akode: No OSS device found\n"; + d->valid = false; + return false; + } + + return openDevice(*device); +} + +bool OSSSink::openDevice(const char *device) +{ + d->device = device; + + // Set non-blocking to not block on open + d->audio_fd = ::open(d->device, O_WRONLY | O_NONBLOCK, 0); + + if (d->audio_fd == -1) { + std::cerr << "akode: Could not open " << d->device << " for writing\n"; + goto failed; + } + // set blocking again to block on write + fcntl(d->audio_fd, F_SETFL, O_WRONLY); + d->valid = true; + return true; + +failed: + d->valid = false; + return false; +} + + +void OSSSink::close() { + if (d->audio_fd != -1) ::close(d->audio_fd); + d->audio_fd = -1; + delete d->buffer; + d->buffer = 0; + d->buffer_length = 0; + d->valid = false; +} + +int OSSSink::setAudioConfiguration(const AudioConfiguration* config) +{ + d->config = *config; + + int format = 0; + + if (config->sample_width > 0 && config->sample_width <= 8) + format = AFMT_S8; + else + format = AFMT_S16_NE; // 16bit native endian + + ioctl(d->audio_fd, SNDCTL_DSP_SETFMT, &format); + + if (format == AFMT_S16_NE) + d->config.sample_width = 16; + else + if (format == AFMT_S8) + d->config.sample_width = 8; + else + return -1; + + int stereo; + if (config->channels == 1) + stereo = 0; + else + stereo = 1; + + ioctl(d->audio_fd, SNDCTL_DSP_STEREO, &stereo); + + d->config.channel_config = MonoStereo; + if (stereo == 0) + d->config.channels = 1; + else + d->config.channels = 2; + + ioctl(d->audio_fd, SNDCTL_DSP_SPEED, &d->config.sample_rate); + + return 1; +} + +const AudioConfiguration* OSSSink::audioConfiguration() const +{ + return &d->config; +} + +bool OSSSink::writeFrame(AudioFrame* frame) +{ + if (!d->valid) return false; + + if ( frame->sample_width != d->config.sample_width + || frame->channels != d->config.channels ) + { + if (setAudioConfiguration(frame) < 0) + return false; + } + + int channels = d->config.channels; + int length = frame->length; + int bytelen = length*channels*((d->config.sample_width+7)/8); + + if (bytelen > d->buffer_length) { + delete d->buffer; + d->buffer = new char[bytelen]; + d->buffer_length = bytelen; + } + + if (d->config.sample_width == 8) { + int8_t *buffer = (int8_t*)d->buffer; + int8_t** data = (int8_t**)frame->data; + for(int i=0; i<length; i++) + for(int j=0; j<channels; j++) + buffer[i*channels+j] = data[j][i]; + } else { + int16_t *buffer = (int16_t*)d->buffer; + int16_t** data = (int16_t**)frame->data; + for(int i=0; i<length; i++) + for(int j=0; j<channels; j++) + buffer[i*channels+j] = data[j][i]; + } + + int status = 0; + do { + status = ::write(d->audio_fd, d->buffer, bytelen); + if (status == -1) { +// if (errno == EAGAIN) continue; + if (errno == EINTR) continue; + return false; + } + } while(false); + + return true; +} + +} // namespace diff --git a/akode/plugins/oss_sink/oss_sink.h b/akode/plugins/oss_sink/oss_sink.h new file mode 100644 index 0000000..814b391 --- /dev/null +++ b/akode/plugins/oss_sink/oss_sink.h @@ -0,0 +1,65 @@ +/* aKode: OSS-Sink + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_OSS_SINK_H +#define _AKODE_OSS_SINK_H + +#include "sink.h" + +#include "akode_export.h" + +namespace aKode { + +class AudioConfiguration; +class AudioFrame; + +class OSSSink : public Sink { +public: + OSSSink(); + ~OSSSink(); + bool open(); + bool openDevice(const char*); + void close(); + int setAudioConfiguration(const AudioConfiguration *config); + const AudioConfiguration* audioConfiguration() const; + // Writes blocking + bool writeFrame(AudioFrame *frame); + +// void pause(); +// void resume(); + + struct private_data; +private: + template<class T> void _writeFrame(AudioFrame *frame); + private_data *d; +}; + +class OSSSinkPlugin : public SinkPlugin { +public: + virtual OSSSink* openSink() { + return new OSSSink(); + } +}; + +extern "C" AKODE_EXPORT OSSSinkPlugin oss_sink; + +} // namespace + +#endif diff --git a/akode/plugins/polyp_sink/Makefile.am b/akode/plugins/polyp_sink/Makefile.am new file mode 100644 index 0000000..b67602a --- /dev/null +++ b/akode/plugins/polyp_sink/Makefile.am @@ -0,0 +1,7 @@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(POLYP_CFLAGS) $(all_includes) + +lib_LTLIBRARIES = libakode_polyp_sink.la + +libakode_polyp_sink_la_SOURCES = polyp_sink.cpp +libakode_polyp_sink_la_LDFLAGS = -module -avoid-version -no-undefined $(POLYP_LDFLAGS) +libakode_polyp_sink_la_LIBADD = ../../lib/libakode.la $(POLYP_LIBADD) diff --git a/akode/plugins/polyp_sink/Makefile.in b/akode/plugins/polyp_sink/Makefile.in new file mode 100644 index 0000000..dccd711 --- /dev/null +++ b/akode/plugins/polyp_sink/Makefile.in @@ -0,0 +1,659 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = akode/plugins/polyp_sink +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/akode/lib/akode_export.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libakode_polyp_sink_la_DEPENDENCIES = ../../lib/libakode.la \ + $(am__DEPENDENCIES_1) +am_libakode_polyp_sink_la_OBJECTS = polyp_sink.lo +#>- libakode_polyp_sink_la_OBJECTS = $(am_libakode_polyp_sink_la_OBJECTS) +#>+ 1 +libakode_polyp_sink_la_OBJECTS = polyp_sink.lo +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/akode/lib +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 2 +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ +#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +#>- $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 3 +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +CXXLD = $(CXX) +#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ +#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +#>+ 2 +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libakode_polyp_sink_la_SOURCES) +DIST_SOURCES = $(libakode_polyp_sink_la_SOURCES) +ETAGS = etags +CTAGS = ctags +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AKODE_LIBDL = @AKODE_LIBDL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVCODEC_CFLAGS = @AVCODEC_CFLAGS@ +AVCODEC_LDFLAGS = @AVCODEC_LDFLAGS@ +AVCODEC_LIBADD = @AVCODEC_LIBADD@ +AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ +AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ +AVFORMAT_LIBADD = @AVFORMAT_LIBADD@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBADD = @JACK_LIBADD@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBFLAC = @LIBFLAC@ +LIBOBJS = @LIBOBJS@ +LIBOGGFLAC = @LIBOGGFLAC@ +LIBOSSAUDIO = @LIBOSSAUDIO@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSAMPLERATE = @LIBSAMPLERATE@ +LIBSEM = @LIBSEM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MADLIBS = @MADLIBS@ +MAKEINFO = @MAKEINFO@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POLYP_CFLAGS = @POLYP_CFLAGS@ +POLYP_LDFLAGS = @POLYP_LDFLAGS@ +POLYP_LIBADD = @POLYP_LIBADD@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXLIBS = @SPEEXLIBS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +VERSION = @VERSION@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +akode_SUBDIR_included_FALSE = @akode_SUBDIR_included_FALSE@ +akode_SUBDIR_included_TRUE = @akode_SUBDIR_included_TRUE@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_alsa_sink_FALSE = @include_alsa_sink_FALSE@ +include_alsa_sink_TRUE = @include_alsa_sink_TRUE@ +include_ffmpeg_decoder_FALSE = @include_ffmpeg_decoder_FALSE@ +include_ffmpeg_decoder_TRUE = @include_ffmpeg_decoder_TRUE@ +include_jack_sink_FALSE = @include_jack_sink_FALSE@ +include_jack_sink_TRUE = @include_jack_sink_TRUE@ +include_mpeg_decoder_FALSE = @include_mpeg_decoder_FALSE@ +include_mpeg_decoder_TRUE = @include_mpeg_decoder_TRUE@ +include_oss_sink_FALSE = @include_oss_sink_FALSE@ +include_oss_sink_TRUE = @include_oss_sink_TRUE@ +include_polyp_sink_FALSE = @include_polyp_sink_FALSE@ +include_polyp_sink_TRUE = @include_polyp_sink_TRUE@ +include_src_resampler_FALSE = @include_src_resampler_FALSE@ +include_src_resampler_TRUE = @include_src_resampler_TRUE@ +include_sun_sink_FALSE = @include_sun_sink_FALSE@ +include_sun_sink_TRUE = @include_sun_sink_TRUE@ +include_xiph_decoder_FALSE = @include_xiph_decoder_FALSE@ +include_xiph_decoder_TRUE = @include_xiph_decoder_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(POLYP_CFLAGS) $(all_includes) +lib_LTLIBRARIES = libakode_polyp_sink.la +libakode_polyp_sink_la_SOURCES = polyp_sink.cpp +#>- libakode_polyp_sink_la_LDFLAGS = -module -avoid-version -no-undefined $(POLYP_LDFLAGS) +#>+ 1 +libakode_polyp_sink_la_LDFLAGS = -module -avoid-version -no-undefined $(KDE_NO_UNDEFINED) $(POLYP_LDFLAGS) +libakode_polyp_sink_la_LIBADD = ../../lib/libakode.la $(POLYP_LIBADD) +#>- all: all-am +#>+ 1 +all: docs-am all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/polyp_sink/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu akode/plugins/polyp_sink/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/polyp_sink/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/polyp_sink/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/polyp_sink/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + 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 + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +#>- libakode_polyp_sink.la: $(libakode_polyp_sink_la_OBJECTS) $(libakode_polyp_sink_la_DEPENDENCIES) +#>+ 2 +@KDE_USE_CLOSURE_TRUE@libakode_polyp_sink.la: libakode_polyp_sink.la.closure $(libakode_polyp_sink_la_OBJECTS) $(libakode_polyp_sink_la_DEPENDENCIES) +@KDE_USE_CLOSURE_FALSE@libakode_polyp_sink.la: $(libakode_polyp_sink_la_OBJECTS) $(libakode_polyp_sink_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libakode_polyp_sink_la_LDFLAGS) $(libakode_polyp_sink_la_OBJECTS) $(libakode_polyp_sink_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/polyp_sink.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-am +#>+ 1 +clean: kde-rpo-clean clean-am + +#>- clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ +#>- mostlyclean-am +#>+ 2 +clean-am: clean-closures clean-bcheck clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES + +# 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: + +#>+ 8 +libakode_polyp_sink.la.closure: $(libakode_polyp_sink_la_OBJECTS) $(libakode_polyp_sink_la_DEPENDENCIES) + @echo "int main() {return 0;}" > libakode_polyp_sink_la_closure.cpp + @$(LTCXXCOMPILE) -c libakode_polyp_sink_la_closure.cpp + $(CXXLINK) libakode_polyp_sink_la_closure.lo $(libakode_polyp_sink_la_LDFLAGS) $(libakode_polyp_sink_la_OBJECTS) $(libakode_polyp_sink_la_LIBADD) $(LIBS) + @rm -f libakode_polyp_sink_la_closure.* libakode_polyp_sink.la.closure + @echo "timestamp" > libakode_polyp_sink.la.closure + + +#>+ 2 +KDE_DIST=polyp_sink.h Makefile.in Makefile.am + +#>+ 3 +clean-closures: + -rm -f libakode_polyp_sink.la.closure + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/polyp_sink/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/polyp_sink/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/polyp_sink/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-am + +bcheck-am: + @for i in ; do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 3 +final: + $(MAKE) all-am + +#>+ 3 +final-install: + $(MAKE) install-am + +#>+ 3 +no-final: + $(MAKE) all-am + +#>+ 3 +no-final-install: + $(MAKE) install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/akode/plugins/polyp_sink/polyp_sink.cpp b/akode/plugins/polyp_sink/polyp_sink.cpp new file mode 100644 index 0000000..9376dac --- /dev/null +++ b/akode/plugins/polyp_sink/polyp_sink.cpp @@ -0,0 +1,143 @@ +/* aKode: Polyp-Sink + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" + +#ifdef HAVE_STDINT_H +#include <stdint.h> +#elif defined(HAVE_INTTYPES_H) +#include <inttypes.h> +#endif +#include <polyp/polyplib-simple.h> + +#include "audioframe.h" +#include "audiobuffer.h" +#include "polyp_sink.h" + +#include <iostream> + +namespace aKode { + +extern "C" { PolypSinkPlugin polyp_sink; }; + +struct PolypSink::private_data +{ + private_data() : server(0), error(false) {}; + + pa_simple *server; + pa_sample_spec sample_spec; + + bool error; + + AudioConfiguration config; +}; + +PolypSink::PolypSink() +{ + m_data = new private_data; + m_data->sample_spec.rate = 44100; + m_data->sample_spec.channels = 2; + m_data->sample_spec.format = PA_SAMPLE_S16NE; +} + +bool PolypSink::open() { + int error = 0; + m_data->server = pa_simple_new(0, "akode-client", PA_STREAM_PLAYBACK, 0, "", &m_data->sample_spec, 0, 255, &error ); + if (!m_data->server || error != 0) { + m_data->error = true; + close(); + std::cout << "Cannot open client\n"; + return false; + } + + + return true; +} + +void PolypSink::close() { + if (m_data->server) { + pa_simple_free(m_data->server); + m_data->server = 0; + } +} + +PolypSink::~PolypSink() +{ + close(); + delete m_data; +} + +int PolypSink::setAudioConfiguration(const AudioConfiguration* config) +{ + if (m_data->error) return -1; + + int res = 0; + if (*config == m_data->config) return 0; + m_data->config = *config; + + if (config->channel_config != MonoStereo ) return -1; + m_data->sample_spec.channels = config->channels; + + if (config->sample_width != 16) { + res = 1; + m_data->config.sample_width = 16; + } + + m_data->sample_spec.rate = config->sample_rate; + + // create new connection + close(); + open(); + + return res; +} + +const AudioConfiguration* PolypSink::audioConfiguration() const +{ + return &m_data->config; +} + +bool PolypSink::writeFrame(AudioFrame* frame) +{ + if ( m_data->error ) return false; + + if ( frame->channels != m_data->config.channels || frame->sample_rate != m_data->config.sample_rate) + { + if (setAudioConfiguration(frame)!=0) + return false; + } + + int channels = m_data->config.channels; + int length = frame->length; + + int16_t *buffer = new int16_t[length*channels]; + int16_t** data = (int16_t**)frame->data; + for(int i = 0; i<length; i++) + for(int j=0; j<channels; j++) + buffer[i*channels+j] = data[j][i]; + + int error = 0; + pa_simple_write(m_data->server, buffer, channels*length*2, &error); + delete[] buffer; + + return (error == 0); +} + +} // namespace diff --git a/akode/plugins/polyp_sink/polyp_sink.h b/akode/plugins/polyp_sink/polyp_sink.h new file mode 100644 index 0000000..e279ff6 --- /dev/null +++ b/akode/plugins/polyp_sink/polyp_sink.h @@ -0,0 +1,60 @@ +/* aKode: Polyp-Sink + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_POLYP_SINK_H +#define _AKODE_POLYP_SINK_H + +#include "sink.h" + +#include "akode_export.h" + +namespace aKode { + +class AudioConfiguration; +class AudioFrame; + +class PolypSink : public Sink { +public: + PolypSink(); + ~PolypSink(); + bool open(); + void close(); + int setAudioConfiguration(const AudioConfiguration *config); + const AudioConfiguration* audioConfiguration() const; + // Writes blocking + bool writeFrame(AudioFrame *frame); + + struct private_data; +private: + private_data *m_data; +}; + +class PolypSinkPlugin : public SinkPlugin { +public: + virtual PolypSink* openSink() { + return new PolypSink(); + } +}; + +extern "C" AKODE_EXPORT PolypSinkPlugin polyp_sink; + +} // namespace + +#endif diff --git a/akode/plugins/src_resampler/Makefile.am b/akode/plugins/src_resampler/Makefile.am new file mode 100644 index 0000000..f643a48 --- /dev/null +++ b/akode/plugins/src_resampler/Makefile.am @@ -0,0 +1,7 @@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib -I$(srcdir)/mppdec $(all_includes) + +lib_LTLIBRARIES = libakode_src_resampler.la + +libakode_src_resampler_la_SOURCES = src_resampler.cpp +libakode_src_resampler_la_LDFLAGS = -module -avoid-version -no-undefined +libakode_src_resampler_la_LIBADD = ../../lib/libakode.la $(LIBSAMPLERATE) diff --git a/akode/plugins/src_resampler/Makefile.in b/akode/plugins/src_resampler/Makefile.in new file mode 100644 index 0000000..e96956b --- /dev/null +++ b/akode/plugins/src_resampler/Makefile.in @@ -0,0 +1,660 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = akode/plugins/src_resampler +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/akode/lib/akode_export.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libakode_src_resampler_la_DEPENDENCIES = ../../lib/libakode.la \ + $(am__DEPENDENCIES_1) +am_libakode_src_resampler_la_OBJECTS = src_resampler.lo +#>- libakode_src_resampler_la_OBJECTS = \ +#>- $(am_libakode_src_resampler_la_OBJECTS) +#>+ 1 +libakode_src_resampler_la_OBJECTS = src_resampler.lo +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/akode/lib +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 2 +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ +#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +#>- $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 3 +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +CXXLD = $(CXX) +#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ +#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +#>+ 2 +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libakode_src_resampler_la_SOURCES) +DIST_SOURCES = $(libakode_src_resampler_la_SOURCES) +ETAGS = etags +CTAGS = ctags +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AKODE_LIBDL = @AKODE_LIBDL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVCODEC_CFLAGS = @AVCODEC_CFLAGS@ +AVCODEC_LDFLAGS = @AVCODEC_LDFLAGS@ +AVCODEC_LIBADD = @AVCODEC_LIBADD@ +AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ +AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ +AVFORMAT_LIBADD = @AVFORMAT_LIBADD@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBADD = @JACK_LIBADD@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBFLAC = @LIBFLAC@ +LIBOBJS = @LIBOBJS@ +LIBOGGFLAC = @LIBOGGFLAC@ +LIBOSSAUDIO = @LIBOSSAUDIO@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSAMPLERATE = @LIBSAMPLERATE@ +LIBSEM = @LIBSEM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MADLIBS = @MADLIBS@ +MAKEINFO = @MAKEINFO@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POLYP_CFLAGS = @POLYP_CFLAGS@ +POLYP_LDFLAGS = @POLYP_LDFLAGS@ +POLYP_LIBADD = @POLYP_LIBADD@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXLIBS = @SPEEXLIBS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +VERSION = @VERSION@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +akode_SUBDIR_included_FALSE = @akode_SUBDIR_included_FALSE@ +akode_SUBDIR_included_TRUE = @akode_SUBDIR_included_TRUE@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_alsa_sink_FALSE = @include_alsa_sink_FALSE@ +include_alsa_sink_TRUE = @include_alsa_sink_TRUE@ +include_ffmpeg_decoder_FALSE = @include_ffmpeg_decoder_FALSE@ +include_ffmpeg_decoder_TRUE = @include_ffmpeg_decoder_TRUE@ +include_jack_sink_FALSE = @include_jack_sink_FALSE@ +include_jack_sink_TRUE = @include_jack_sink_TRUE@ +include_mpeg_decoder_FALSE = @include_mpeg_decoder_FALSE@ +include_mpeg_decoder_TRUE = @include_mpeg_decoder_TRUE@ +include_oss_sink_FALSE = @include_oss_sink_FALSE@ +include_oss_sink_TRUE = @include_oss_sink_TRUE@ +include_polyp_sink_FALSE = @include_polyp_sink_FALSE@ +include_polyp_sink_TRUE = @include_polyp_sink_TRUE@ +include_src_resampler_FALSE = @include_src_resampler_FALSE@ +include_src_resampler_TRUE = @include_src_resampler_TRUE@ +include_sun_sink_FALSE = @include_sun_sink_FALSE@ +include_sun_sink_TRUE = @include_sun_sink_TRUE@ +include_xiph_decoder_FALSE = @include_xiph_decoder_FALSE@ +include_xiph_decoder_TRUE = @include_xiph_decoder_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib -I$(srcdir)/mppdec $(all_includes) +lib_LTLIBRARIES = libakode_src_resampler.la +libakode_src_resampler_la_SOURCES = src_resampler.cpp +#>- libakode_src_resampler_la_LDFLAGS = -module -avoid-version -no-undefined +#>+ 1 +libakode_src_resampler_la_LDFLAGS = -module -avoid-version -no-undefined $(KDE_NO_UNDEFINED) +libakode_src_resampler_la_LIBADD = ../../lib/libakode.la $(LIBSAMPLERATE) +#>- all: all-am +#>+ 1 +all: docs-am all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/src_resampler/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu akode/plugins/src_resampler/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/src_resampler/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/src_resampler/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/src_resampler/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + 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 + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +#>- libakode_src_resampler.la: $(libakode_src_resampler_la_OBJECTS) $(libakode_src_resampler_la_DEPENDENCIES) +#>+ 2 +@KDE_USE_CLOSURE_TRUE@libakode_src_resampler.la: libakode_src_resampler.la.closure $(libakode_src_resampler_la_OBJECTS) $(libakode_src_resampler_la_DEPENDENCIES) +@KDE_USE_CLOSURE_FALSE@libakode_src_resampler.la: $(libakode_src_resampler_la_OBJECTS) $(libakode_src_resampler_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libakode_src_resampler_la_LDFLAGS) $(libakode_src_resampler_la_OBJECTS) $(libakode_src_resampler_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/src_resampler.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-am +#>+ 1 +clean: kde-rpo-clean clean-am + +#>- clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ +#>- mostlyclean-am +#>+ 2 +clean-am: clean-closures clean-bcheck clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES + +# 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: + +#>+ 8 +libakode_src_resampler.la.closure: $(libakode_src_resampler_la_OBJECTS) $(libakode_src_resampler_la_DEPENDENCIES) + @echo "int main() {return 0;}" > libakode_src_resampler_la_closure.cpp + @$(LTCXXCOMPILE) -c libakode_src_resampler_la_closure.cpp + $(CXXLINK) libakode_src_resampler_la_closure.lo $(libakode_src_resampler_la_LDFLAGS) $(libakode_src_resampler_la_OBJECTS) $(libakode_src_resampler_la_LIBADD) $(LIBS) + @rm -f libakode_src_resampler_la_closure.* libakode_src_resampler.la.closure + @echo "timestamp" > libakode_src_resampler.la.closure + + +#>+ 2 +KDE_DIST=src_resampler.h Makefile.in Makefile.am + +#>+ 3 +clean-closures: + -rm -f libakode_src_resampler.la.closure + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/src_resampler/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/src_resampler/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/src_resampler/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-am + +bcheck-am: + @for i in ; do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 3 +final: + $(MAKE) all-am + +#>+ 3 +final-install: + $(MAKE) install-am + +#>+ 3 +no-final: + $(MAKE) all-am + +#>+ 3 +no-final-install: + $(MAKE) install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/akode/plugins/src_resampler/src_resampler.cpp b/akode/plugins/src_resampler/src_resampler.cpp new file mode 100644 index 0000000..2edb2ee --- /dev/null +++ b/akode/plugins/src_resampler/src_resampler.cpp @@ -0,0 +1,177 @@ +/* aKode Resampler (Secret Rabbit Code) + + Copyright (C) 2004,2006 Allan Sandfeld Jensen <kde@carewolf.com> + + 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., 51 Franklin Steet, Fifth Floor, Boston, + MA 02110-1301, USA. +*/ + +#include "akodelib.h" + +#include <samplerate.h> + +#include "arithmetic.h" +#include "audioframe.h" +#include "src_resampler.h" + +namespace aKode { + +SRCResampler* SRCResamplerPlugin::openResampler() { + return new SRCResampler(); +} + +extern "C" { SRCResamplerPlugin src_resampler; }; + +SRCResampler::SRCResampler() : speed(1.0), sample_rate(44100) {}; + +template<typename S> +static void _convert1_FP(AudioFrame *in, float* outdata) +{ + long length = in->length; + int channels = in->channels; + + S** indata = (S**)in->data; + for(int j=0; j<length; j++) { + for(int i=0; i<channels; i++) { + outdata[i+j*channels] = (float)(indata[i][j]); + } + } +} + +template<typename S> +static void _convert1_Int(AudioFrame *in, float* outdata) +{ + float scale = 1.0/(float)Arithm_Int<S>::max(in->sample_width); + + long length = in->length; + int channels = in->channels; + + S** indata = (S**)in->data; + for(int j=0; j<length; j++) { + for(int i=0; i<channels; i++) { + outdata[i+j*channels] = scale*indata[i][j]; + } + } +} + +// demux channels +template<typename S> +static void _convert2_FP(float *indata, AudioFrame* out) +{ + long length = out->length; + int channels = out->channels; + + S** outdata = (S**)out->data; + for(int j=0; j<length; j++) { + for(int i=0; i<channels; i++) { + outdata[i][j] = (S)(indata[i+j*channels]); + } + } +} + +template<typename S> +static void _convert2_Int(float *indata, AudioFrame* out) +{ + float scale = Arithm_Int<S>::max(out->sample_width); + + long length = out->length; + int channels = out->channels; + + S** outdata = (S**)out->data; + for(int j=0; j<length; j++) { + for(int i=0; i<channels; i++) { + outdata[i][j] = (S)(scale*indata[i+j*channels]); + } + } +} + +// A high quality resampling by using libsamplerate +bool SRCResampler::doFrame(AudioFrame* in, AudioFrame* out) +{ + // Ouch, I dont like this much mallocing + float *tmp1 = new float[in->channels*in->length]; + + // convert to float frames + if (in->sample_width == -64) { + _convert1_FP<double>(in, tmp1); + } else + if (in->sample_width == -32) { + _convert1_FP<float>(in, tmp1); + } else + if (in->sample_width <= 8) { + _convert1_Int<int8_t>(in, tmp1); + } else + if (in->sample_width <= 16) { + _convert1_Int<int16_t>(in, tmp1); + } else + _convert1_Int<int32_t>(in, tmp1); + + float ratio = (sample_rate/(float)in->sample_rate) / speed; + long outlength = (long)((in->length + ratio) * ratio); // max size + float *tmp2 = new float[in->channels*outlength]; + + // We should figure out if interleaving first is faster + // than making a call per channel +// for (int i=0; i<in->channels; i++) { + SRC_DATA src_data; + + src_data.data_in = tmp1; + src_data.data_out = tmp2; + src_data.input_frames = in->length; + src_data.output_frames = outlength; + src_data.src_ratio = ratio; + + src_simple(&src_data, SRC_SINC_MEDIUM_QUALITY, in->channels); +// } + + AudioConfiguration config = *in; + config.sample_width = -32; + config.sample_rate = sample_rate; + out->reserveSpace(&config, src_data.output_frames_gen); + out->pos = in->pos; + + // convert from float frames +#if 0 + if (out->sample_width > 0) { + if (out->sample_width <= 8) { + _convert2_Int<int8_t>(tmp2, out); + } else + if (out->sample_width <= 16) { + _convert2_Int<int16_t>(tmp2, out); + } else + _convert2_Int<int32_t>(tmp2, out); + } else + if (out->sample_width == -64) + _convert2_FP<double>(tmp2, out); + else +#endif + _convert2_FP<float>(tmp2, out); + + + delete[] tmp1; + delete[] tmp2; + + return true; +} + +void SRCResampler::setSpeed(float value) { + speed = value; +} + +void SRCResampler::setSampleRate(unsigned int rate) { + sample_rate = rate; +} + +} // namespace diff --git a/akode/plugins/src_resampler/src_resampler.h b/akode/plugins/src_resampler/src_resampler.h new file mode 100644 index 0000000..7321c12 --- /dev/null +++ b/akode/plugins/src_resampler/src_resampler.h @@ -0,0 +1,57 @@ +/* aKode: Resampler (Secret Rabbit Code) + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + 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., 51 Franklin Steet, Fifth Floor, Boston, + MA 02110-1301, USA. +*/ +#ifndef _AKODE_SRC_RESAMPLER_H +#define _AKODE_SRC_RESAMPLER_H + +#include "akodelib.h" + +#include "resampler.h" + +namespace aKode { + +class AudioFrame; + +//! High quality resampler using the Secret Rabbit Code library also known as libsamplerate + +/*! + * This is the high quality resampler. Compared to the default resampler, it is + * lot slower, uses primarely float point, and is GPL. + */ +class SRCResampler : public Resampler { +public: + SRCResampler(); + bool doFrame(AudioFrame* in, AudioFrame* out); + void setSampleRate(unsigned int rate); + void setSpeed(float speed); + + float speed; + unsigned int sample_rate; +}; + +class SRCResamplerPlugin : public ResamplerPlugin { +public: + virtual SRCResampler* openResampler(); +}; + +extern "C" SRCResamplerPlugin src_resampler; + +} // namespace + +#endif diff --git a/akode/plugins/sun_sink/Makefile.am b/akode/plugins/sun_sink/Makefile.am new file mode 100644 index 0000000..64806dd --- /dev/null +++ b/akode/plugins/sun_sink/Makefile.am @@ -0,0 +1,7 @@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(all_includes) + +lib_LTLIBRARIES = libakode_sun_sink.la + +libakode_sun_sink_la_SOURCES = sun_sink.cpp +libakode_sun_sink_la_LDFLAGS = -module -avoid-version -no-undefined +libakode_sun_sink_la_LIBADD = ../../lib/libakode.la $(LIBSUNAUDIO) diff --git a/akode/plugins/sun_sink/Makefile.in b/akode/plugins/sun_sink/Makefile.in new file mode 100644 index 0000000..c9ead26 --- /dev/null +++ b/akode/plugins/sun_sink/Makefile.in @@ -0,0 +1,657 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = akode/plugins/sun_sink +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/akode/lib/akode_export.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libakode_sun_sink_la_DEPENDENCIES = ../../lib/libakode.la +am_libakode_sun_sink_la_OBJECTS = sun_sink.lo +#>- libakode_sun_sink_la_OBJECTS = $(am_libakode_sun_sink_la_OBJECTS) +#>+ 1 +libakode_sun_sink_la_OBJECTS = sun_sink.lo +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/akode/lib +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 2 +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ +#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +#>- $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 3 +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +CXXLD = $(CXX) +#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ +#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +#>+ 2 +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libakode_sun_sink_la_SOURCES) +DIST_SOURCES = $(libakode_sun_sink_la_SOURCES) +ETAGS = etags +CTAGS = ctags +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AKODE_LIBDL = @AKODE_LIBDL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVCODEC_CFLAGS = @AVCODEC_CFLAGS@ +AVCODEC_LDFLAGS = @AVCODEC_LDFLAGS@ +AVCODEC_LIBADD = @AVCODEC_LIBADD@ +AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ +AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ +AVFORMAT_LIBADD = @AVFORMAT_LIBADD@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBADD = @JACK_LIBADD@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBFLAC = @LIBFLAC@ +LIBOBJS = @LIBOBJS@ +LIBOGGFLAC = @LIBOGGFLAC@ +LIBOSSAUDIO = @LIBOSSAUDIO@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSAMPLERATE = @LIBSAMPLERATE@ +LIBSEM = @LIBSEM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MADLIBS = @MADLIBS@ +MAKEINFO = @MAKEINFO@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POLYP_CFLAGS = @POLYP_CFLAGS@ +POLYP_LDFLAGS = @POLYP_LDFLAGS@ +POLYP_LIBADD = @POLYP_LIBADD@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXLIBS = @SPEEXLIBS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +VERSION = @VERSION@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +akode_SUBDIR_included_FALSE = @akode_SUBDIR_included_FALSE@ +akode_SUBDIR_included_TRUE = @akode_SUBDIR_included_TRUE@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_alsa_sink_FALSE = @include_alsa_sink_FALSE@ +include_alsa_sink_TRUE = @include_alsa_sink_TRUE@ +include_ffmpeg_decoder_FALSE = @include_ffmpeg_decoder_FALSE@ +include_ffmpeg_decoder_TRUE = @include_ffmpeg_decoder_TRUE@ +include_jack_sink_FALSE = @include_jack_sink_FALSE@ +include_jack_sink_TRUE = @include_jack_sink_TRUE@ +include_mpeg_decoder_FALSE = @include_mpeg_decoder_FALSE@ +include_mpeg_decoder_TRUE = @include_mpeg_decoder_TRUE@ +include_oss_sink_FALSE = @include_oss_sink_FALSE@ +include_oss_sink_TRUE = @include_oss_sink_TRUE@ +include_polyp_sink_FALSE = @include_polyp_sink_FALSE@ +include_polyp_sink_TRUE = @include_polyp_sink_TRUE@ +include_src_resampler_FALSE = @include_src_resampler_FALSE@ +include_src_resampler_TRUE = @include_src_resampler_TRUE@ +include_sun_sink_FALSE = @include_sun_sink_FALSE@ +include_sun_sink_TRUE = @include_sun_sink_TRUE@ +include_xiph_decoder_FALSE = @include_xiph_decoder_FALSE@ +include_xiph_decoder_TRUE = @include_xiph_decoder_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(all_includes) +lib_LTLIBRARIES = libakode_sun_sink.la +libakode_sun_sink_la_SOURCES = sun_sink.cpp +#>- libakode_sun_sink_la_LDFLAGS = -module -avoid-version -no-undefined +#>+ 1 +libakode_sun_sink_la_LDFLAGS = -module -avoid-version -no-undefined $(KDE_NO_UNDEFINED) +libakode_sun_sink_la_LIBADD = ../../lib/libakode.la $(LIBSUNAUDIO) +#>- all: all-am +#>+ 1 +all: docs-am all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/sun_sink/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu akode/plugins/sun_sink/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/sun_sink/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/sun_sink/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/sun_sink/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + 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 + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +#>- libakode_sun_sink.la: $(libakode_sun_sink_la_OBJECTS) $(libakode_sun_sink_la_DEPENDENCIES) +#>+ 2 +@KDE_USE_CLOSURE_TRUE@libakode_sun_sink.la: libakode_sun_sink.la.closure $(libakode_sun_sink_la_OBJECTS) $(libakode_sun_sink_la_DEPENDENCIES) +@KDE_USE_CLOSURE_FALSE@libakode_sun_sink.la: $(libakode_sun_sink_la_OBJECTS) $(libakode_sun_sink_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libakode_sun_sink_la_LDFLAGS) $(libakode_sun_sink_la_OBJECTS) $(libakode_sun_sink_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_sink.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-am +#>+ 1 +clean: kde-rpo-clean clean-am + +#>- clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ +#>- mostlyclean-am +#>+ 2 +clean-am: clean-closures clean-bcheck clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES + +# 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: + +#>+ 8 +libakode_sun_sink.la.closure: $(libakode_sun_sink_la_OBJECTS) $(libakode_sun_sink_la_DEPENDENCIES) + @echo "int main() {return 0;}" > libakode_sun_sink_la_closure.cpp + @$(LTCXXCOMPILE) -c libakode_sun_sink_la_closure.cpp + $(CXXLINK) libakode_sun_sink_la_closure.lo $(libakode_sun_sink_la_LDFLAGS) $(libakode_sun_sink_la_OBJECTS) $(libakode_sun_sink_la_LIBADD) $(LIBS) + @rm -f libakode_sun_sink_la_closure.* libakode_sun_sink.la.closure + @echo "timestamp" > libakode_sun_sink.la.closure + + +#>+ 2 +KDE_DIST=sun_sink.h Makefile.in Makefile.am + +#>+ 3 +clean-closures: + -rm -f libakode_sun_sink.la.closure + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/sun_sink/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/sun_sink/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/sun_sink/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-am + +bcheck-am: + @for i in ; do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 3 +final: + $(MAKE) all-am + +#>+ 3 +final-install: + $(MAKE) install-am + +#>+ 3 +no-final: + $(MAKE) all-am + +#>+ 3 +no-final-install: + $(MAKE) install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/akode/plugins/sun_sink/sun_sink.cpp b/akode/plugins/sun_sink/sun_sink.cpp new file mode 100644 index 0000000..c8b6c57 --- /dev/null +++ b/akode/plugins/sun_sink/sun_sink.cpp @@ -0,0 +1,179 @@ +/* aKode: Sun-Sink + + Copyright (C) 2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <config.h> + +#include <sys/audioio.h> + +#include <sys/ioctl.h> +#include <errno.h> +#include <fcntl.h> +#include <unistd.h> +#include <alloca.h> + +#include <audioframe.h> +#include "sun_sink.h" + +#include <iostream> + +namespace aKode { + +extern "C" { SunSinkPlugin sun_sink; } + +struct SunSink::private_data +{ + private_data() : audio_fd(-1), device(0), valid(false) {}; + int audio_fd; + audio_info_t auinfo; + + const char *device; + AudioConfiguration config; + bool valid; +}; + + +SunSink::SunSink() +{ + d = new private_data; +} + +SunSink::~SunSink() +{ + close(); + delete d; +} + +bool SunSink::open() +{ + const char* device = getenv("AUDIODEV"); + if (!device) device = "/dev/audio"; + + if (::access(device, F_OK) != 0) { + std::cerr << "akode: Device not found: " << device << "\n"; + goto failed; + } + + d->device = device; + + d->audio_fd = ::open(d->device, O_WRONLY, 0); + + if (d->audio_fd == -1) { + std::cerr << "akode: No write access to " << device << "\n"; + goto failed; + } + d->valid = true; + return true; + +failed: + d->valid = false; + return false; +} + + +void SunSink::close() { + if (d->audio_fd != -1) ::close(d->audio_fd); + d->audio_fd = -1; + d->valid = false; +} + +int SunSink::setAudioConfiguration(const AudioConfiguration* config) +{ + d->config = *config; + + AUDIO_INITINFO(&d->auinfo) + + if (ioctl(d->audio_fd, AUDIO_GETINFO, &d->auinfo) < 0) + { + d->valid = false; + return -1; + } + + int width = config->sample_width; + if (width < 0 ) width = 16; + d->auinfo.play.precision = width; + + d->auinfo.play.encoding = AUDIO_ENCODING_LINEAR; + + d->auinfo.play.channels = config->channels; + d->auinfo.play.sample_rate = config->sample_rate; + + if (ioctl(d->audio_fd, AUDIO_SETINFO, &d->auinfo) < 0) + { + d->valid = false; + return -1; + } + + if (ioctl(d->audio_fd, AUDIO_GETINFO, &d->auinfo) < 0) + { + d->valid = false; + return -1; + } + + d->config.sample_width = d->auinfo.play.precision; + d->config.channels = d->auinfo.play.channels; + d->config.sample_rate = d->auinfo.play.sample_rate; + if (d->config.channels <= 2) d->config.channel_config = MonoStereo; + + if (d->config == *config) + return 0; + else + return 1; +} + +const AudioConfiguration* SunSink::audioConfiguration() const +{ + return &d->config; +} + +bool SunSink::writeFrame(AudioFrame* frame) +{ + if (!d->valid) return false; + + if ( frame->sample_width != d->config.sample_width + || frame->channels != d->config.channels ) + { + if (setAudioConfiguration(frame) < 0) + return false; + } + + int channels = d->config.channels; + int length = frame->length; + + int16_t *buffer = (int16_t*)alloca(length*channels*2); + int16_t** data = (int16_t**)frame->data; + for(int i = 0; i<length; i++) + for(int j=0; j<channels; j++) + buffer[i*channels+j] = data[j][i]; + +// std::cerr << "Writing frame\n"; + int status = 0; + do { + status = ::write(d->audio_fd, buffer, channels*length*2); + if (status == -1) { +// if (errno == EAGAIN) continue; + if (errno == EINTR) continue; + return false; + } + } while(false); + + return true; +} + +} // namespace diff --git a/akode/plugins/sun_sink/sun_sink.h b/akode/plugins/sun_sink/sun_sink.h new file mode 100644 index 0000000..33b10cb --- /dev/null +++ b/akode/plugins/sun_sink/sun_sink.h @@ -0,0 +1,64 @@ +/* aKode: Sun-Sink + + Copyright (C) 2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_SUN_SINK_H +#define _AKODE_SUN_SINK_H + +#include "sink.h" + +#include "akode_export.h" + +namespace aKode { + +class AudioConfiguration; +class AudioFrame; + +class SunSink : public Sink { +public: + SunSink(); + ~SunSink(); + bool open(); + void close(); + int setAudioConfiguration(const AudioConfiguration *config); + const AudioConfiguration* audioConfiguration() const; + // Writes blocking + bool writeFrame(AudioFrame *frame); + +// void pause(); +// void resume(); + + struct private_data; +private: + template<class T> void _writeFrame(AudioFrame *frame); + private_data *d; +}; + +class SunSinkPlugin : public SinkPlugin { +public: + virtual SunSink* openSink() { + return new SunSink(); + } +}; + +extern "C" AKODE_EXPORT SunSinkPlugin sun_sink; + +} // namespace + +#endif diff --git a/akode/plugins/xiph_decoder/Makefile.am b/akode/plugins/xiph_decoder/Makefile.am new file mode 100644 index 0000000..367760e --- /dev/null +++ b/akode/plugins/xiph_decoder/Makefile.am @@ -0,0 +1,8 @@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(USER_INCLUDES) $(all_includes) + +lib_LTLIBRARIES = libakode_xiph_decoder.la + +libakode_xiph_decoder_la_SOURCES = flac_decoder.cpp flac113_decoder.cpp speex_decoder.cpp vorbis_decoder.cpp xiph_decoder.cpp + +libakode_xiph_decoder_la_LDFLAGS = -module -avoid-version -no-undefined $(USER_LDFLAGS) +libakode_xiph_decoder_la_LIBADD = ../../lib/libakode.la $(LIBFLAC) $(LIBOGGFLAC) $(VORBIS_LIBS) $(VORBISFILE_LIBS) $(SPEEXLIBS)
\ No newline at end of file diff --git a/akode/plugins/xiph_decoder/Makefile.in b/akode/plugins/xiph_decoder/Makefile.in new file mode 100644 index 0000000..b603541 --- /dev/null +++ b/akode/plugins/xiph_decoder/Makefile.in @@ -0,0 +1,689 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = akode/plugins/xiph_decoder +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h \ + $(top_builddir)/akode/lib/akode_export.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libakode_xiph_decoder_la_DEPENDENCIES = ../../lib/libakode.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libakode_xiph_decoder_la_OBJECTS = flac_decoder.lo \ + flac113_decoder.lo speex_decoder.lo vorbis_decoder.lo \ + xiph_decoder.lo +#>- libakode_xiph_decoder_la_OBJECTS = \ +#>- $(am_libakode_xiph_decoder_la_OBJECTS) +#>+ 6 +libakode_xiph_decoder_la_final_OBJECTS = libakode_xiph_decoder_la.all_cpp.lo +libakode_xiph_decoder_la_nofinal_OBJECTS = flac_decoder.lo \ + flac113_decoder.lo speex_decoder.lo vorbis_decoder.lo \ + xiph_decoder.lo +@KDE_USE_FINAL_FALSE@libakode_xiph_decoder_la_OBJECTS = $(libakode_xiph_decoder_la_nofinal_OBJECTS) +@KDE_USE_FINAL_TRUE@libakode_xiph_decoder_la_OBJECTS = $(libakode_xiph_decoder_la_final_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/akode/lib +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 2 +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ +#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +#>- $(AM_CXXFLAGS) $(CXXFLAGS) +#>+ 3 +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) +CXXLD = $(CXX) +#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ +#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +#>+ 2 +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libakode_xiph_decoder_la_SOURCES) +DIST_SOURCES = $(libakode_xiph_decoder_la_SOURCES) +ETAGS = etags +CTAGS = ctags +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AKODE_LIBDL = @AKODE_LIBDL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVCODEC_CFLAGS = @AVCODEC_CFLAGS@ +AVCODEC_LDFLAGS = @AVCODEC_LDFLAGS@ +AVCODEC_LIBADD = @AVCODEC_LIBADD@ +AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ +AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ +AVFORMAT_LIBADD = @AVFORMAT_LIBADD@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBADD = @JACK_LIBADD@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBFLAC = @LIBFLAC@ +LIBOBJS = @LIBOBJS@ +LIBOGGFLAC = @LIBOGGFLAC@ +LIBOSSAUDIO = @LIBOSSAUDIO@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSAMPLERATE = @LIBSAMPLERATE@ +LIBSEM = @LIBSEM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MADLIBS = @MADLIBS@ +MAKEINFO = @MAKEINFO@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POLYP_CFLAGS = @POLYP_CFLAGS@ +POLYP_LDFLAGS = @POLYP_LDFLAGS@ +POLYP_LIBADD = @POLYP_LIBADD@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXLIBS = @SPEEXLIBS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +VERSION = @VERSION@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_LIBS = @VORBIS_LIBS@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +akode_SUBDIR_included_FALSE = @akode_SUBDIR_included_FALSE@ +akode_SUBDIR_included_TRUE = @akode_SUBDIR_included_TRUE@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_alsa_sink_FALSE = @include_alsa_sink_FALSE@ +include_alsa_sink_TRUE = @include_alsa_sink_TRUE@ +include_ffmpeg_decoder_FALSE = @include_ffmpeg_decoder_FALSE@ +include_ffmpeg_decoder_TRUE = @include_ffmpeg_decoder_TRUE@ +include_jack_sink_FALSE = @include_jack_sink_FALSE@ +include_jack_sink_TRUE = @include_jack_sink_TRUE@ +include_mpeg_decoder_FALSE = @include_mpeg_decoder_FALSE@ +include_mpeg_decoder_TRUE = @include_mpeg_decoder_TRUE@ +include_oss_sink_FALSE = @include_oss_sink_FALSE@ +include_oss_sink_TRUE = @include_oss_sink_TRUE@ +include_polyp_sink_FALSE = @include_polyp_sink_FALSE@ +include_polyp_sink_TRUE = @include_polyp_sink_TRUE@ +include_src_resampler_FALSE = @include_src_resampler_FALSE@ +include_src_resampler_TRUE = @include_src_resampler_TRUE@ +include_sun_sink_FALSE = @include_sun_sink_FALSE@ +include_sun_sink_TRUE = @include_sun_sink_TRUE@ +include_xiph_decoder_FALSE = @include_xiph_decoder_FALSE@ +include_xiph_decoder_TRUE = @include_xiph_decoder_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(USER_INCLUDES) $(all_includes) +lib_LTLIBRARIES = libakode_xiph_decoder.la +libakode_xiph_decoder_la_SOURCES = flac_decoder.cpp flac113_decoder.cpp speex_decoder.cpp vorbis_decoder.cpp xiph_decoder.cpp +#>- libakode_xiph_decoder_la_LDFLAGS = -module -avoid-version -no-undefined $(USER_LDFLAGS) +#>+ 1 +libakode_xiph_decoder_la_LDFLAGS = -module -avoid-version -no-undefined $(KDE_NO_UNDEFINED) $(USER_LDFLAGS) +libakode_xiph_decoder_la_LIBADD = ../../lib/libakode.la $(LIBFLAC) $(LIBOGGFLAC) $(VORBIS_LIBS) $(VORBISFILE_LIBS) $(SPEEXLIBS) +#>- all: all-am +#>+ 1 +all: docs-am all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/xiph_decoder/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu akode/plugins/xiph_decoder/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/xiph_decoder/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/xiph_decoder/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/xiph_decoder/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + 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 + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +#>- libakode_xiph_decoder.la: $(libakode_xiph_decoder_la_OBJECTS) $(libakode_xiph_decoder_la_DEPENDENCIES) +#>+ 2 +@KDE_USE_CLOSURE_TRUE@libakode_xiph_decoder.la: libakode_xiph_decoder.la.closure $(libakode_xiph_decoder_la_OBJECTS) $(libakode_xiph_decoder_la_DEPENDENCIES) +@KDE_USE_CLOSURE_FALSE@libakode_xiph_decoder.la: $(libakode_xiph_decoder_la_OBJECTS) $(libakode_xiph_decoder_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libakode_xiph_decoder_la_LDFLAGS) $(libakode_xiph_decoder_la_OBJECTS) $(libakode_xiph_decoder_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac113_decoder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_decoder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/speex_decoder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vorbis_decoder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xiph_decoder.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-am +#>+ 1 +clean: kde-rpo-clean clean-am + +#>- clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ +#>- mostlyclean-am +#>+ 2 +clean-am: clean-closures clean-bcheck clean-final clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES + +# 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: + +#>+ 8 +libakode_xiph_decoder.la.closure: $(libakode_xiph_decoder_la_OBJECTS) $(libakode_xiph_decoder_la_DEPENDENCIES) + @echo "int main() {return 0;}" > libakode_xiph_decoder_la_closure.cpp + @$(LTCXXCOMPILE) -c libakode_xiph_decoder_la_closure.cpp + $(CXXLINK) libakode_xiph_decoder_la_closure.lo $(libakode_xiph_decoder_la_LDFLAGS) $(libakode_xiph_decoder_la_OBJECTS) $(libakode_xiph_decoder_la_LIBADD) $(LIBS) + @rm -f libakode_xiph_decoder_la_closure.* libakode_xiph_decoder.la.closure + @echo "timestamp" > libakode_xiph_decoder.la.closure + + +#>+ 2 +KDE_DIST=Makefile.in xiph_decoder.h vorbis_decoder.h flac_decoder.h Makefile.am speex_decoder.h + +#>+ 3 +clean-closures: + -rm -f libakode_xiph_decoder.la.closure + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu akode/plugins/xiph_decoder/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu akode/plugins/xiph_decoder/Makefile + cd $(top_srcdir) && perl admin/am_edit akode/plugins/xiph_decoder/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-am + +bcheck-am: + @for i in ; do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 11 +libakode_xiph_decoder_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/flac_decoder.cpp $(srcdir)/flac113_decoder.cpp $(srcdir)/speex_decoder.cpp $(srcdir)/vorbis_decoder.cpp $(srcdir)/xiph_decoder.cpp + @echo 'creating libakode_xiph_decoder_la.all_cpp.cpp ...'; \ + rm -f libakode_xiph_decoder_la.all_cpp.files libakode_xiph_decoder_la.all_cpp.final; \ + echo "#define KDE_USE_FINAL 1" >> libakode_xiph_decoder_la.all_cpp.final; \ + for file in flac_decoder.cpp flac113_decoder.cpp speex_decoder.cpp vorbis_decoder.cpp xiph_decoder.cpp ; do \ + echo "#include \"$$file\"" >> libakode_xiph_decoder_la.all_cpp.files; \ + test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libakode_xiph_decoder_la.all_cpp.final; \ + done; \ + cat libakode_xiph_decoder_la.all_cpp.final libakode_xiph_decoder_la.all_cpp.files > libakode_xiph_decoder_la.all_cpp.cpp; \ + rm -f libakode_xiph_decoder_la.all_cpp.final libakode_xiph_decoder_la.all_cpp.files + +#>+ 3 +clean-final: + -rm -f libakode_xiph_decoder_la.all_cpp.cpp + +#>+ 3 +final: + $(MAKE) libakode_xiph_decoder_la_OBJECTS="$(libakode_xiph_decoder_la_final_OBJECTS)" all-am + +#>+ 3 +final-install: + $(MAKE) libakode_xiph_decoder_la_OBJECTS="$(libakode_xiph_decoder_la_final_OBJECTS)" install-am + +#>+ 3 +no-final: + $(MAKE) libakode_xiph_decoder_la_OBJECTS="$(libakode_xiph_decoder_la_nofinal_OBJECTS)" all-am + +#>+ 3 +no-final-install: + $(MAKE) libakode_xiph_decoder_la_OBJECTS="$(libakode_xiph_decoder_la_nofinal_OBJECTS)" install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/akode/plugins/xiph_decoder/flac113_decoder.cpp b/akode/plugins/xiph_decoder/flac113_decoder.cpp new file mode 100644 index 0000000..46a46e2 --- /dev/null +++ b/akode/plugins/xiph_decoder/flac113_decoder.cpp @@ -0,0 +1,377 @@ +/* aKode: FLAC-Decoder (using libFLAC 1.1.3 API) + + Copyright (C) 2004-2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "akodelib.h" + +#ifdef HAVE_LIBFLAC113 + +#include <string.h> +#include <iostream> + +#include <FLAC/format.h> +#include <FLAC/stream_decoder.h> + +#include "audioframe.h" +#include "decoder.h" +#include "file.h" +#include "flac_decoder.h" + + +namespace aKode { + +class FLACDecoder; + +static bool checkFLAC(File *src) { + char header[6]; + bool res = false; + src->seek(0); + if(src->read(header, 4) == 4) { + // skip id3v2 headers + if (memcmp(header, "ID3", 3) == 0) { + if (src->read(header, 6) != 6) goto end; + int size = 0; + if (header[1] & 0x10) size += 10; + size += header[5]; + size += header[4] << 7; + size += header[3] << 14; + size += header[2] << 21; + src->seek(10+size); + if (src->read(header, 4) != 4) goto end; + } + if (memcmp(header, "fLaC",4) == 0 ) res = true; + } +end: + return res; +} + +static bool checkOggFLAC(File *src) { + char header[34]; + bool res = false; + src->seek(0); + if (src->read(header, 34) == 34) + if (memcmp(header, "OggS",4) == 0 ) + // old FLAC 1.1.0 format + if (memcmp(header+28, "fLaC",4) == 0) res = true; + else + // new FLAC 1.1.1 format + if (memcmp(header+29, "FLAC",4) == 0) res = true; + return res; +} + + +bool FLACDecoderPlugin::canDecode(File* src) { + src->openRO(); + bool res = checkFLAC(src); + if (!res) res = checkOggFLAC(src); + src->close(); + return res; +} + +extern "C" { FLACDecoderPlugin flac_decoder; } +extern "C" { FLACDecoderPlugin oggflac_decoder; } + +struct FLACDecoder::private_data { + private_data() : decoder(0), valid(false), out(0), source(0), eof(false), error(false) {}; + + FLAC__StreamDecoder *decoder; + const FLAC__StreamMetadata_StreamInfo* si; + const FLAC__StreamMetadata_VorbisComment* vc; + + bool valid; + AudioFrame *out; + File *source; + AudioConfiguration config; + + uint32_t max_block_size; + uint64_t position, length; + + bool eof, error; +}; + +static FLAC__StreamDecoderReadStatus flac_read_callback( + const FLAC__StreamDecoder *, + FLAC__byte buffer[], + unsigned *bytes, + void *client_data) +{ + FLACDecoder::private_data *data = (FLACDecoder::private_data*)client_data; + + long res = data->source->read((char*)buffer, *bytes); + if (res<=0) { + if (data->source->eof()) { + return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; + } + else + return FLAC__STREAM_DECODER_READ_STATUS_ABORT; + } + else { + *bytes = res; + return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; + } +} + +static FLAC__StreamDecoderSeekStatus flac_seek_callback( + const FLAC__StreamDecoder *, + FLAC__uint64 absolute_byte_offset, + void *client_data) +{ + FLACDecoder::private_data *data = (FLACDecoder::private_data*)client_data; + + if(data->source->seek(absolute_byte_offset)) + return FLAC__STREAM_DECODER_SEEK_STATUS_OK; + else + return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; +} + +static FLAC__StreamDecoderTellStatus flac_tell_callback( + const FLAC__StreamDecoder *, + FLAC__uint64 *absolute_byte_offset, + void *client_data) +{ + FLACDecoder::private_data *data = (FLACDecoder::private_data*)client_data; + + long res = data->source->position(); + if (res<0) + return FLAC__STREAM_DECODER_TELL_STATUS_ERROR; + else { + *absolute_byte_offset = res; + return FLAC__STREAM_DECODER_TELL_STATUS_OK; + } +} + +static FLAC__StreamDecoderLengthStatus flac_length_callback( + const FLAC__StreamDecoder *, + FLAC__uint64 *stream_length, + void *client_data) +{ + FLACDecoder::private_data *data = (FLACDecoder::private_data*)client_data; + + long res = data->source->length(); + if (res<0) + return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; + else { + *stream_length = res; + return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; + } +} + +static FLAC__bool eof_callback( + const FLAC__StreamDecoder *, + void *client_data) +{ + FLACDecoder::private_data *data = (FLACDecoder::private_data*)client_data; + + return data->source->eof(); +} + +static FLAC__StreamDecoderWriteStatus write_callback( + const FLAC__StreamDecoder *, + const FLAC__Frame *frame, + const FLAC__int32 * const buffer[], + void* client_data) +{ + FLACDecoder::private_data *data = (FLACDecoder::private_data*)client_data; + + if (!data->out) // Handle spurious callbacks (happens during seeks) + data->out = new AudioFrame; + + const long frameSize = frame->header.blocksize; + const char bits = frame->header.bits_per_sample; + const char channels = frame->header.channels; + + AudioFrame* const outFrame = data->out; + + outFrame->reserveSpace(channels, frameSize, bits); + outFrame->sample_rate = frame->header.sample_rate; + + if (channels == 1 || channels == 2) + outFrame->channel_config = aKode::MonoStereo; + else if (channels > 2 && channels < 8) + outFrame->channel_config = aKode::Surround; + else + outFrame->channel_config = aKode::MultiChannel; + + for(int i = 0; i<channels; i++) { + if (outFrame->data[i] == 0) break; + if (bits<=8) { + int8_t** data = (int8_t**)outFrame->data; + for(long j=0; j<frameSize; j++) + data[i][j] = buffer[i][j]; + } else + if (bits<=16) { + int16_t** data = (int16_t**)outFrame->data; + for(long j=0; j<frameSize; j++) + data[i][j] = buffer[i][j]; + } else { + int32_t** data = (int32_t**)outFrame->data; + for(long j=0; j<frameSize; j++) + data[i][j] = buffer[i][j]; + } + } + data->position+=frameSize; + data->valid = true; + return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; +} + +static void metadata_callback( + const FLAC__StreamDecoder *, + const FLAC__StreamMetadata *metadata, + void* client_data) +{ + FLACDecoder::private_data *data = (FLACDecoder::private_data*)client_data; + + if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO) { + data->length = metadata->data.stream_info.total_samples; + data->config.sample_rate = metadata->data.stream_info.sample_rate; + data->config.sample_width = metadata->data.stream_info.bits_per_sample; + data->config.channels = metadata->data.stream_info.channels; + data->max_block_size = metadata->data.stream_info.max_blocksize; + + if (data->config.channels <= 2) + data->config.channel_config = aKode::MonoStereo; + else if (data->config.channels <= 7) + data->config.channel_config = aKode::Surround; + else + data->config.channel_config = aKode::MultiChannel; + + data->si = &metadata->data.stream_info; + + data->position = 0; + + } else + if (metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) { + data->vc = &metadata->data.vorbis_comment; + } +} + +static void error_callback( + const FLAC__StreamDecoder *, + FLAC__StreamDecoderErrorStatus status, + void* /* client_data */) +{ + std::cerr << "FLAC error: " << FLAC__StreamDecoderErrorStatusString[status] << "\n"; + switch (status) { + case FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC: + break; + case FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER: + break; + case FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH: + break; + case FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM: + break; + } + //data->valid = false; +} + +const AudioConfiguration* FLACDecoder::audioConfiguration() { + return &m_data->config; +} + +FLACDecoder::FLACDecoder(File* src) { + m_data = new private_data; + m_data->out = 0; + m_data->decoder = FLAC__stream_decoder_new(); + m_data->source = src; + m_data->source->openRO(); + m_data->source->fadvise(); + // ### check return value + FLAC__stream_decoder_init_stream( + m_data->decoder, + flac_read_callback, + flac_seek_callback, + flac_tell_callback, + flac_length_callback, + eof_callback, + write_callback, + metadata_callback, + error_callback, + m_data + ); + FLAC__stream_decoder_process_until_end_of_metadata(m_data->decoder); +} + +FLACDecoder::~FLACDecoder() { + FLAC__stream_decoder_finish(m_data->decoder); + FLAC__stream_decoder_delete(m_data->decoder); + m_data->source->close(); + delete m_data; +} + +bool FLACDecoder::readFrame(AudioFrame* frame) { + if (m_data->error || m_data->eof) return false; + + if (m_data->out) { // Handle spurious callbacks + frame->freeSpace(); + *frame = *m_data->out; // copy + m_data->out->data = 0; // nullify, don't free! + delete m_data->out; + m_data->out = 0; + return true; + } + m_data->valid = false; + m_data->out = frame; + bool ret = FLAC__stream_decoder_process_single(m_data->decoder); + m_data->out = 0; + if (ret && m_data->valid) { + frame->pos = position(); + return true; + } else { + FLAC__StreamDecoderState state = FLAC__stream_decoder_get_state(m_data->decoder); + if (state == FLAC__STREAM_DECODER_END_OF_STREAM) + m_data->eof = true; + else + if (state > FLAC__STREAM_DECODER_END_OF_STREAM) + m_data->error = true; + return false; + } +} + +long FLACDecoder::length() { + float pos = ((float)m_data->length)/m_data->config.sample_rate; + return (long)(pos*1000.0); +} + +long FLACDecoder::position() { + float pos = ((float)m_data->position)/m_data->config.sample_rate; + return (long)(pos*1000.0); +} + +bool FLACDecoder::eof() { + return m_data->eof; +} + +bool FLACDecoder::error() { + return m_data->error; +} + +bool FLACDecoder::seekable() { + return m_data->source->seekable(); +} + +bool FLACDecoder::seek(long pos) { + if (m_data->error) return false; + float samplePos = (float)pos * (float)m_data->config.sample_rate / 1000.0; + m_data->position = (uint64_t)samplePos; + return FLAC__stream_decoder_seek_absolute(m_data->decoder, m_data->position); +} + +} // namespace + +#endif // HAVE_LIBFLAC113 diff --git a/akode/plugins/xiph_decoder/flac_decoder.cpp b/akode/plugins/xiph_decoder/flac_decoder.cpp new file mode 100644 index 0000000..130e2a1 --- /dev/null +++ b/akode/plugins/xiph_decoder/flac_decoder.cpp @@ -0,0 +1,587 @@ +/* aKode: FLAC-Decoder + + Copyright (C) 2004-2005 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "akodelib.h" + +#if defined(HAVE_LIBFLAC) && !defined(HAVE_LIBFLAC113) + +#include <string.h> +#include <iostream> + +#include <FLAC/format.h> +#include <FLAC/seekable_stream_decoder.h> + +#ifdef HAVE_LIBOGGFLAC + #include <OggFLAC/seekable_stream_decoder.h> +#endif + +#include "audioframe.h" +#include "decoder.h" +#include "file.h" +#include "flac_decoder.h" + + +namespace aKode { + +class FLACDecoder; + +bool FLACDecoderPlugin::canDecode(File* src) { + char header[6]; + bool res = false; + src->openRO(); + if(src->read(header, 4) == 4) { + // skip id3v2 headers + if (memcmp(header, "ID3", 3) == 0) { + if (src->read(header, 6) != 6) goto end; + int size = 0; + if (header[1] & 0x10) size += 10; + size += header[5]; + size += header[4] << 7; + size += header[3] << 14; + size += header[2] << 21; + src->seek(10+size); + if (src->read(header, 4) != 4) goto end; + } + if (memcmp(header, "fLaC",4) == 0 ) res = true; + } +end: + src->close(); + return res; +} + +extern "C" { FLACDecoderPlugin flac_decoder; } + +#ifdef HAVE_LIBOGGFLAC +bool OggFLACDecoderPlugin::canDecode(File* src) { + char header[34]; + bool res = false; + src->openRO(); + if (src->read(header, 34) == 34) + if (memcmp(header, "OggS",4) == 0 ) + // old FLAC 1.1.0 format + if (memcmp(header+28, "fLaC",4) == 0) res = true; + else + // new FLAC 1.1.1 format + if (memcmp(header+29, "FLAC",4) == 0) res = true; + src->close(); + return res; +} +extern "C" { OggFLACDecoderPlugin oggflac_decoder; } +#endif + +struct FLACDecoder::private_data { + private_data() : decoder(0), valid(false), out(0), source(0), eof(false), error(false) {}; + + FLAC__SeekableStreamDecoder *decoder; + const FLAC__StreamMetadata_StreamInfo* si; + const FLAC__StreamMetadata_VorbisComment* vc; + + bool valid; + AudioFrame *out; + File *source; + AudioConfiguration config; + + uint32_t max_block_size; + uint64_t position, length; + + bool eof, error; +}; + +#ifdef HAVE_LIBOGGFLAC +struct OggFLACDecoder::private_data { + private_data() : decoder(0), valid(false), out(0), source(0), eof(false), error(false) {}; + + OggFLAC__SeekableStreamDecoder *decoder; + const FLAC__StreamMetadata_StreamInfo* si; + const FLAC__StreamMetadata_VorbisComment* vc; + + bool valid; + AudioFrame *out; + File *source; + AudioConfiguration config; + + uint32_t max_block_size; + uint64_t position, length; + + bool eof, error; +}; +#endif + +static FLAC__SeekableStreamDecoderReadStatus flac_read_callback( + const FLAC__SeekableStreamDecoder *, + FLAC__byte buffer[], + unsigned *bytes, + void *client_data) +{ + FLACDecoder::private_data *data = (FLACDecoder::private_data*)client_data; + + long res = data->source->read((char*)buffer, *bytes); + if (res<=0) { + return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR; + } + else { + *bytes = res; + return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK; + } +} + +#ifdef HAVE_LIBOGGFLAC +// God, I hate people doing OO in C! +static OggFLAC__SeekableStreamDecoderReadStatus oggflac_read_callback( + const OggFLAC__SeekableStreamDecoder *, + FLAC__byte buffer[], + unsigned *bytes, + void *client_data) +{ + OggFLACDecoder::private_data *data = (OggFLACDecoder::private_data*)client_data; + + long res = data->source->read((char*)buffer, *bytes); + if (res<=0) { + return OggFLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR; + } + else { + *bytes = res; + return OggFLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK; + } +} +#endif + +static FLAC__SeekableStreamDecoderSeekStatus flac_seek_callback( + const FLAC__SeekableStreamDecoder *, + FLAC__uint64 absolute_byte_offset, + void *client_data) +{ + FLACDecoder::private_data *data = (FLACDecoder::private_data*)client_data; + + if(data->source->seek(absolute_byte_offset)) + return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK; + else + return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR; +} + +#ifdef HAVE_LIBOGGFLAC +static OggFLAC__SeekableStreamDecoderSeekStatus oggflac_seek_callback( + const OggFLAC__SeekableStreamDecoder *, + FLAC__uint64 absolute_byte_offset, + void *client_data) +{ + OggFLACDecoder::private_data *data = (OggFLACDecoder::private_data*)client_data; + + if(data->source->seek(absolute_byte_offset)) + return OggFLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK; + else + return OggFLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR; +} +#endif + +static FLAC__SeekableStreamDecoderTellStatus flac_tell_callback( + const FLAC__SeekableStreamDecoder *, + FLAC__uint64 *absolute_byte_offset, + void *client_data) +{ + FLACDecoder::private_data *data = (FLACDecoder::private_data*)client_data; + + long res = data->source->position(); + if (res<0) + return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR; + else { + *absolute_byte_offset = res; + return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK; + } +} + +#ifdef HAVE_LIBOGGFLAC +static OggFLAC__SeekableStreamDecoderTellStatus oggflac_tell_callback( + const OggFLAC__SeekableStreamDecoder *, + FLAC__uint64 *absolute_byte_offset, + void *client_data) +{ + OggFLACDecoder::private_data *data = (OggFLACDecoder::private_data*)client_data; + + long res = data->source->position(); + if (res<0) + return OggFLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR; + else { + *absolute_byte_offset = res; + return OggFLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK; + } +} +#endif + +static FLAC__SeekableStreamDecoderLengthStatus flac_length_callback( + const FLAC__SeekableStreamDecoder *, + FLAC__uint64 *stream_length, + void *client_data) +{ + FLACDecoder::private_data *data = (FLACDecoder::private_data*)client_data; + + long res = data->source->length(); + if (res<0) + return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR; + else { + *stream_length = res; + return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK; + } +} + +#ifdef HAVE_LIBOGGFLAC +static OggFLAC__SeekableStreamDecoderLengthStatus oggflac_length_callback( + const OggFLAC__SeekableStreamDecoder *, + FLAC__uint64 *stream_length, + void *client_data) +{ + OggFLACDecoder::private_data *data = (OggFLACDecoder::private_data*)client_data; + + long res = data->source->length(); + if (res<0) + return OggFLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR; + else { + *stream_length = res; + return OggFLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK; + } +} +#endif + +template<class S, class T> +static FLAC__bool eof_callback( + const S *, + void *client_data) +{ + T *data = (T*)client_data; + + return data->source->eof(); +} + +template<class S, class T> +static FLAC__StreamDecoderWriteStatus write_callback( + const S *, + const FLAC__Frame *frame, + const FLAC__int32 * const buffer[], + void* client_data) +{ + T *data = (T*)client_data; + //FLACDecoder::private_data *data = (FLACDecoder::private_data*)client_data; + + if (!data->out) // Handle spurious callbacks (happens during seeks) + data->out = new AudioFrame; + + const long frameSize = frame->header.blocksize; + const char bits = frame->header.bits_per_sample; + const char channels = frame->header.channels; + + AudioFrame* const outFrame = data->out; + + outFrame->reserveSpace(channels, frameSize, bits); + outFrame->sample_rate = frame->header.sample_rate; + + if (channels == 1 || channels == 2) + outFrame->channel_config = aKode::MonoStereo; + else if (channels > 2 && channels < 8) + outFrame->channel_config = aKode::Surround; + else + outFrame->channel_config = aKode::MultiChannel; + + for(int i = 0; i<channels; i++) { + if (outFrame->data[i] == 0) break; + if (bits<=8) { + int8_t** data = (int8_t**)outFrame->data; + for(long j=0; j<frameSize; j++) + data[i][j] = buffer[i][j]; + } else + if (bits<=16) { + int16_t** data = (int16_t**)outFrame->data; + for(long j=0; j<frameSize; j++) + data[i][j] = buffer[i][j]; + } else { + int32_t** data = (int32_t**)outFrame->data; + for(long j=0; j<frameSize; j++) + data[i][j] = buffer[i][j]; + } + } + data->position+=frameSize; + data->valid = true; + return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; +} + +template<class S, class T> +static void metadata_callback( + const S *, + //const FLAC__SeekableStreamDecoder *decoder, + const FLAC__StreamMetadata *metadata, + void* client_data) +{ + T *data = (T*)client_data; +// FLACDecoder::private_data *data = (FLACDecoder::private_data*)client_data; + + if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO) { + data->length = metadata->data.stream_info.total_samples; + data->config.sample_rate = metadata->data.stream_info.sample_rate; + data->config.sample_width = metadata->data.stream_info.bits_per_sample; + data->config.channels = metadata->data.stream_info.channels; + data->max_block_size = metadata->data.stream_info.max_blocksize; + + if (data->config.channels <= 2) + data->config.channel_config = aKode::MonoStereo; + else if (data->config.channels <= 7) + data->config.channel_config = aKode::Surround; + else + data->config.channel_config = aKode::MultiChannel; + + data->si = &metadata->data.stream_info; + + data->position = 0; + + } else + if (metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) { + data->vc = &metadata->data.vorbis_comment; + } +} + +template<class S, class T> +static void error_callback( + const S *, + //const FLAC__SeekableStreamDecoder *decoder, + FLAC__StreamDecoderErrorStatus status, + void* /* client_data */) +{ + //T *data = (T*)client_data; + std::cerr << "FLAC error: " << FLAC__StreamDecoderErrorStatusString[status] << "\n"; + switch (status) { + case FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC: + break; + case FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER: + break; + case FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH: + break; + } + //data->valid = false; +} + +const AudioConfiguration* FLACDecoder::audioConfiguration() { + return &m_data->config; +} + +#ifdef HAVE_LIBOGGFLAC +const AudioConfiguration* OggFLACDecoder::audioConfiguration() { + return &m_data->config; +} +#endif + +FLACDecoder::FLACDecoder(File* src) { + m_data = new private_data; + m_data->out = 0; + m_data->decoder = FLAC__seekable_stream_decoder_new(); + m_data->source = src; + m_data->source->openRO(); + m_data->source->fadvise(); + FLAC__seekable_stream_decoder_set_client_data(m_data->decoder, m_data); + FLAC__seekable_stream_decoder_set_read_callback (m_data->decoder, flac_read_callback); + FLAC__seekable_stream_decoder_set_seek_callback (m_data->decoder, flac_seek_callback); + FLAC__seekable_stream_decoder_set_tell_callback (m_data->decoder, flac_tell_callback); + FLAC__seekable_stream_decoder_set_length_callback (m_data->decoder, flac_length_callback); + FLAC__seekable_stream_decoder_set_eof_callback (m_data->decoder, + eof_callback<FLAC__SeekableStreamDecoder, private_data>); + FLAC__seekable_stream_decoder_set_write_callback (m_data->decoder, + write_callback<FLAC__SeekableStreamDecoder, private_data>); + FLAC__seekable_stream_decoder_set_error_callback (m_data->decoder, + error_callback<FLAC__SeekableStreamDecoder, private_data>); + FLAC__seekable_stream_decoder_set_metadata_callback(m_data->decoder, + metadata_callback<FLAC__SeekableStreamDecoder, private_data>); + FLAC__seekable_stream_decoder_set_metadata_respond (m_data->decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT); + + FLAC__seekable_stream_decoder_init(m_data->decoder); + FLAC__seekable_stream_decoder_process_until_end_of_metadata(m_data->decoder); +} + +FLACDecoder::~FLACDecoder() { + FLAC__seekable_stream_decoder_finish(m_data->decoder); + FLAC__seekable_stream_decoder_delete(m_data->decoder); + m_data->source->close(); + delete m_data; +} + +#ifdef HAVE_LIBOGGFLAC +OggFLACDecoder::OggFLACDecoder(File* src) { + m_data = new private_data; + m_data->out = 0; + m_data->decoder = OggFLAC__seekable_stream_decoder_new(); + m_data->source = src; + m_data->source->openRO(); + m_data->source->fadvise(); + OggFLAC__seekable_stream_decoder_set_client_data(m_data->decoder, m_data); + OggFLAC__seekable_stream_decoder_set_read_callback (m_data->decoder, oggflac_read_callback); + OggFLAC__seekable_stream_decoder_set_seek_callback (m_data->decoder, oggflac_seek_callback); + OggFLAC__seekable_stream_decoder_set_tell_callback (m_data->decoder, oggflac_tell_callback); + OggFLAC__seekable_stream_decoder_set_length_callback (m_data->decoder, oggflac_length_callback); + OggFLAC__seekable_stream_decoder_set_eof_callback (m_data->decoder, + eof_callback<OggFLAC__SeekableStreamDecoder, private_data>); + OggFLAC__seekable_stream_decoder_set_write_callback (m_data->decoder, + write_callback<OggFLAC__SeekableStreamDecoder, private_data>); + OggFLAC__seekable_stream_decoder_set_error_callback (m_data->decoder, + error_callback<OggFLAC__SeekableStreamDecoder, private_data>); + OggFLAC__seekable_stream_decoder_set_metadata_callback(m_data->decoder, + metadata_callback<OggFLAC__SeekableStreamDecoder, private_data>); + OggFLAC__seekable_stream_decoder_set_metadata_respond (m_data->decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT); + + OggFLAC__seekable_stream_decoder_init(m_data->decoder); + OggFLAC__seekable_stream_decoder_process_until_end_of_metadata(m_data->decoder); +} + +OggFLACDecoder::~OggFLACDecoder() { + OggFLAC__seekable_stream_decoder_finish(m_data->decoder); + OggFLAC__seekable_stream_decoder_delete(m_data->decoder); + m_data->source->close(); + delete m_data; +} +#endif + +bool FLACDecoder::readFrame(AudioFrame* frame) { + if (m_data->error || m_data->eof) return false; + + if (m_data->out) { // Handle spurious callbacks + frame->freeSpace(); + *frame = *m_data->out; // copy + m_data->out->data = 0; // nullify, don't free! + delete m_data->out; + m_data->out = 0; + return true; + } + m_data->valid = false; + m_data->out = frame; + bool ret = FLAC__seekable_stream_decoder_process_single(m_data->decoder); + m_data->out = 0; + if (ret && m_data->valid) { + frame->pos = position(); + return true; + } else { + FLAC__SeekableStreamDecoderState state = FLAC__seekable_stream_decoder_get_state(m_data->decoder); + switch (state) { + case FLAC__SEEKABLE_STREAM_DECODER_OK: + break; + case FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM: + m_data->eof = true; + break; + default: + m_data->error = true; + break; + } + return false; + } +} + +#ifdef HAVE_LIBOGGFLAC +bool OggFLACDecoder::readFrame(AudioFrame* frame) { + if (m_data->error || m_data->eof) return false; + + if (m_data->out) { // Handle spurious callbacks + frame->freeSpace(); + *frame = *m_data->out; // copy + m_data->out->data = 0; // nullify, don't free! + delete m_data->out; + m_data->out = 0; + return true; + } + m_data->valid = false; + m_data->out = frame; + bool ret = OggFLAC__seekable_stream_decoder_process_single(m_data->decoder); + m_data->out = 0; + if (ret && m_data->valid) { + frame->pos = position(); + return true; + } else { + OggFLAC__SeekableStreamDecoderState state = OggFLAC__seekable_stream_decoder_get_state(m_data->decoder); + switch (state) { + case OggFLAC__SEEKABLE_STREAM_DECODER_OK: + break; + case OggFLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM: + m_data->eof = true; + break; + default: + m_data->error = true; + break; + } + return false; + } +} +#endif + +long FLACDecoder::length() { + float pos = ((float)m_data->length)/m_data->config.sample_rate; + return (long)(pos*1000.0); +} + +long FLACDecoder::position() { + float pos = ((float)m_data->position)/m_data->config.sample_rate; + return (long)(pos*1000.0); +} + +bool FLACDecoder::eof() { + return m_data->eof; +} + +bool FLACDecoder::error() { + return m_data->error; +} + +bool FLACDecoder::seekable() { + return m_data->source->seekable(); +} + +bool FLACDecoder::seek(long pos) { + if (m_data->error) return false; + float samplePos = (float)pos * (float)m_data->config.sample_rate / 1000.0; + m_data->position = (uint64_t)samplePos; + return FLAC__seekable_stream_decoder_seek_absolute(m_data->decoder, m_data->position); +} + +#ifdef HAVE_LIBOGGFLAC +long OggFLACDecoder::length() { + float pos = ((float)m_data->length)/m_data->config.sample_rate; + return (long)(pos*1000.0); +} + +long OggFLACDecoder::position() { + float pos = ((float)m_data->position)/m_data->config.sample_rate; + return (long)(pos*1000.0); +} + +bool OggFLACDecoder::eof() { + return m_data->eof; +} + +bool OggFLACDecoder::error() { + return m_data->error; +} + +bool OggFLACDecoder::seekable() { + return m_data->source->seekable(); +} + +bool OggFLACDecoder::seek(long pos) { + if (m_data->error) return false; + float samplePos = (float)pos * (float)m_data->config.sample_rate / 1000.0; + m_data->position = (uint64_t)samplePos; + return OggFLAC__seekable_stream_decoder_seek_absolute(m_data->decoder, m_data->position); +} +#endif + +} // namespace + +#endif // HAVE_LIBFLAC diff --git a/akode/plugins/xiph_decoder/flac_decoder.h b/akode/plugins/xiph_decoder/flac_decoder.h new file mode 100644 index 0000000..68a4cd9 --- /dev/null +++ b/akode/plugins/xiph_decoder/flac_decoder.h @@ -0,0 +1,103 @@ +/* aKode: FLAC-Decoder + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_FLAC_DECODER_H +#define _AKODE_FLAC_DECODER_H + +#include "akodelib.h" +#if defined(HAVE_LIBFLAC) || defined(HAVE_LIBFLAC113) + +#include "decoder.h" + +namespace aKode { + +class File; +class AudioFrame; + +class FLACDecoder : public Decoder { +public: + FLACDecoder(File* src); + virtual ~FLACDecoder(); + virtual bool readFrame(AudioFrame*); + virtual long length(); + virtual long position(); + virtual bool seek(long); + virtual bool seekable(); + virtual bool eof(); + virtual bool error(); + + virtual const AudioConfiguration* audioConfiguration(); + + struct private_data; +private: + private_data *m_data; +}; + +#ifdef HAVE_LIBOGGFLAC +class OggFLACDecoder : public Decoder { +public: + OggFLACDecoder(File* src); + virtual ~OggFLACDecoder(); + virtual bool readFrame(AudioFrame*); + virtual long length(); + virtual long position(); + virtual bool seek(long); + virtual bool seekable(); + virtual bool eof(); + virtual bool error(); + + virtual const AudioConfiguration* audioConfiguration(); + + struct private_data; +private: + private_data *m_data; +}; +#endif + +class FLACDecoderPlugin : public DecoderPlugin { +public: + virtual bool canDecode(File*); + virtual Decoder* openDecoder(File* fil) { + return new FLACDecoder(fil); + }; +}; + +extern "C" FLACDecoderPlugin flac_decoder; +#ifdef HAVE_LIBFLAC113 +extern "C" FLACDecoderPlugin oggflac_decoder; +#endif + +#ifdef HAVE_LIBOGGFLAC +class OggFLACDecoderPlugin : public DecoderPlugin { +public: + virtual bool canDecode(File*); + virtual Decoder* openDecoder(File* fil) { + return new OggFLACDecoder(fil); + }; +}; + +extern "C" OggFLACDecoderPlugin oggflac_decoder; +#endif + +} // namespace + + +#endif // HAVE_LIBFLAC +#endif diff --git a/akode/plugins/xiph_decoder/speex_decoder.cpp b/akode/plugins/xiph_decoder/speex_decoder.cpp new file mode 100644 index 0000000..4c3d816 --- /dev/null +++ b/akode/plugins/xiph_decoder/speex_decoder.cpp @@ -0,0 +1,351 @@ +/* aKode: Speex-Decoder + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "akodelib.h" + +#ifdef HAVE_SPEEX + +extern "C" { +#include <string.h> +#include <stdlib.h> +#include <speex.h> +#include <speex_header.h> +#include <speex_callbacks.h> +#include <speex_stereo.h> +#include <ogg/ogg.h> +} + +#ifdef SPEEX_DEBUG +#include <iostream> +using std::cerr; +#endif + +#include "file.h" +#include "audioframe.h" +#include "decoder.h" +#include "speex_decoder.h" + +namespace aKode { + +bool SpeexDecoderPlugin::canDecode(File* src) { + char header[36]; + bool res = false; + src->openRO(); + if (src->read(header, 36) == 36) + if (memcmp(header, "OggS",4) == 0 ) + if (memcmp(header+28, "Speex ",8) == 0) res = true; + src->close(); + return res; +}; + +extern "C" { SpeexDecoderPlugin speex_decoder; }; + +struct SpeexDecoder::private_data +{ + SpeexBits bits; + SpeexMode *mode; + SpeexStereoState stereo; + + ogg_sync_state sync; + ogg_stream_state stream; + ogg_page page; // current page + ogg_packet packet; // current packet + + void *dec_state; + File *src; +#ifdef HAVE_SPEEX11 + int16_t *out_buffer; +#else + float *out_buffer; +#endif + + unsigned int bitrate; + int frame_size; + int frames_per_packet; + int frame_nr; + AudioConfiguration config; + int serialno; + long position; + bool seeked; + + bool initialized; + bool error, eof; +}; + +SpeexDecoder::SpeexDecoder(File *src) { + m_data = new private_data; + m_data->src = src; + m_data->out_buffer = 0; + + ogg_sync_init(&m_data->sync); + + m_data->dec_state = 0; + SpeexStereoState initstereo = SPEEX_STEREO_STATE_INIT; + m_data->stereo = initstereo; + + m_data->initialized = m_data->eof = m_data->error = false; + m_data->frame_nr = 100000; + m_data->position = 0; + m_data->seeked = false; + + src->openRO(); + src->fadvise(); +}; + +SpeexDecoder::~SpeexDecoder() { + if (m_data->initialized) { + speex_bits_reset(&m_data->bits); + ogg_sync_clear(&m_data->sync); + ogg_stream_clear(&m_data->stream); + if (m_data->dec_state) speex_decoder_destroy(m_data->dec_state); + m_data->src->close(); + delete[] m_data->out_buffer; + } + delete m_data; +} + +bool SpeexDecoder::openFile() { + m_data->error = false; + while(ogg_sync_pageout(&m_data->sync, &m_data->page) != 1) { + char *buf = ogg_sync_buffer(&m_data->sync, 1024); + int read = m_data->src->read(buf, 1024); + if (read <= 0) { + m_data->error = true; + return false; + } + ogg_sync_wrote(&m_data->sync, read); + } + m_data->serialno = ogg_page_serialno(&m_data->page); + ogg_stream_init(&m_data->stream, m_data->serialno); + speex_bits_init(&m_data->bits); + +// ogg_stream_pagein(&m_data->stream, &m_data->page); + //ogg_stream_packetout(&m_data->stream, &m_data->packet); +// ogg_stream_packetout(&m_data->stream, &m_data->packet); + + if(!decodeHeader()) + { + m_data->error = true; + return false; + } + + m_data->initialized = true; + return true; +} + +bool SpeexDecoder::readPage() { + + while (ogg_sync_pageout(&m_data->sync, &m_data->page) != 1) { + char *buf = ogg_sync_buffer(&m_data->sync, 4096); + long read = m_data->src->read(buf, 4096); + if (read <= 0) return false; + ogg_sync_wrote(&m_data->sync, read); + } + + ogg_stream_pagein(&m_data->stream, &m_data->page); +// m_data->packets = ogg_page_packets(&m_data->page); + return true; +} + +bool SpeexDecoder::readPacket() { + bool res = true; + while (ogg_stream_packetpeek(&m_data->stream, &m_data->packet) != 1 && res) { + res = readPage(); + } + ogg_stream_packetout(&m_data->stream, &m_data->packet); + speex_bits_read_from(&m_data->bits, (char*)m_data->packet.packet, m_data->packet.bytes); + m_data->frame_nr = 0; + + return res; +} + +bool SpeexDecoder::decodeHeader() { + + SpeexHeader *header; + header = speex_packet_to_header((char*)m_data->page.body, m_data->page.body_len); + if (!header) { + // invalid file + m_data->error = true; + #ifdef SPEEX_DEBUG + std::cerr << "Invalid file\n"; + #endif + return false; + } + + SpeexMode *mode = ( SpeexMode* )speex_mode_list[ header->mode ]; + m_data->mode = mode; + m_data->config.channels = header->nb_channels; + m_data->config.channel_config = MonoStereo; + m_data->frames_per_packet = header->frames_per_packet; + + if (mode->bitstream_version != header->mode_bitstream_version) { + // incompatible bitstream + m_data->error = true; + return false; + } + + m_data->dec_state = speex_decoder_init(mode); + speex_decoder_ctl(m_data->dec_state, SPEEX_GET_FRAME_SIZE, &m_data->frame_size); + //m_data->bitrate = header->bitrate; + speex_decoder_ctl(m_data->dec_state, SPEEX_GET_BITRATE, &m_data->bitrate); + m_data->config.sample_rate = header->rate; + m_data->config.sample_width = 16; + speex_decoder_ctl(m_data->dec_state, SPEEX_SET_SAMPLING_RATE, &m_data->config.sample_rate); + //speex_decoder_ctl(m_data->dec_state, SPEEX_GET_SAMPLING_RATE, &m_data->sample_rate); + + // Use the perceptial enhancement, which gives a subjectively better result + // but is technically further from the source. + int i = 1; + speex_decoder_ctl(m_data->dec_state, SPEEX_SET_ENH, &i); + + // Handle the patched-on stereo stuff + if (m_data->config.channels != 1) { + SpeexCallback callback; + callback.callback_id = SPEEX_INBAND_STEREO; + callback.func = speex_std_stereo_request_handler; + callback.data = &m_data->stereo; + speex_decoder_ctl(m_data->dec_state, SPEEX_SET_HANDLER, &callback); + } + #ifdef HAVE_SPEEX11 + m_data->out_buffer = new int16_t[m_data->frame_size*m_data->config.channels]; + #else + m_data->out_buffer = new float[m_data->frame_size*m_data->config.channels]; + #endif + + free(header); + return true; +} + +bool SpeexDecoder::readFrame(AudioFrame* frame) +{ + if (!m_data->initialized) openFile(); + + if (m_data->eof || m_data->error) return false; + + if (m_data->frame_nr >= m_data->frames_per_packet) { + if (!readPacket()) { + m_data->eof = true; + return false; + } + } + #if defined(HAVE_SPEEX11) && !defined(BROKEN_SPEEX11) + speex_decode_int(m_data->dec_state, &m_data->bits, m_data->out_buffer); + #else + speex_decode(m_data->dec_state, &m_data->bits, m_data->out_buffer); + #endif + + int channels = m_data->config.channels; + int length = m_data->frame_size; + frame->reserveSpace(&m_data->config, length); + + if (m_data->config.channels == 2) + #if defined(HAVE_SPEEX11) && !defined(BROKEN_SPEEX11) + speex_decode_stereo_int(m_data->out_buffer, length, &m_data->stereo); + #else + speex_decode_stereo(m_data->out_buffer, length, &m_data->stereo); + #endif + + + for (int i=0; i<m_data->frame_size*m_data->config.channels; i++) { + if (m_data->out_buffer[i] > 32766) m_data->out_buffer[i] = 32767; + else + if (m_data->out_buffer[i] < -32767) m_data->out_buffer[i] = -32768; + else + m_data->out_buffer[i] = m_data->out_buffer[i]; + }; + + // Decode into frame + int16_t** data = (int16_t**)frame->data; + for(int i=0; i<length; i++) + for(int j=0; j<channels; j++) + #if defined(HAVE_SPEEX11) + data[j][i] = m_data->out_buffer[i*channels+j]; + #else + data[j][i] = (int16_t)(m_data->out_buffer[i*channels+j]+0.5); + #endif + + + m_data->position += m_data->frame_size; + frame->pos = position(); + m_data->frame_nr++; + return true; +} + +long SpeexDecoder::length() { + if (!m_data->bitrate || !m_data->initialized) return -1; + float spxlen = (8.0*m_data->src->length())/(float)m_data->bitrate; + return (long)(spxlen*1000.0); +} + +long SpeexDecoder::position() { + if (!m_data->bitrate || !m_data->initialized) return -1; + float spxpos = ((float)m_data->position)/(float)m_data->config.sample_rate; + + if (m_data->seeked) { + float tellpos = (8.0*m_data->src->position())/(float)m_data->bitrate; + // tellpos should always be somewhat ahead, if spxpos is worse use tellpos + if (tellpos < spxpos) { + spxpos = tellpos; + m_data->position = (long)(tellpos*m_data->config.sample_rate); + } + } + + return (long)(spxpos*1000.0); +} + +bool SpeexDecoder::eof() { + return m_data->eof || m_data->error; + /*return m_data->error || (m_data->src->eof() && m_data->frame_nr >= m_data->frames_per_packet); */ +} + +bool SpeexDecoder::error() { + return m_data->error; +} + +bool SpeexDecoder::seekable() { + return m_data->src->seekable(); +} + +bool SpeexDecoder::seek(long pos) { + if(!m_data->initialized) return false; + + long bpos = (long)(((float)pos*(float)m_data->bitrate)/8000.0); + if (m_data->src->seek(bpos)) { + speex_bits_reset(&m_data->bits); + ogg_sync_reset(&m_data->sync); + ogg_stream_reset(&m_data->stream); + readPage(); + readPacket(); + // We should now have read in a whole new page + bpos = (m_data->src->position()-m_data->page.body_len); + m_data->position = (long)((bpos*8.0*m_data->config.sample_rate)/(float)m_data->bitrate); + m_data->seeked = true; + return true; + } + return false; +} + +const AudioConfiguration* SpeexDecoder::audioConfiguration() { + return &m_data->config; +} + +} // namespace + +#endif // HAVE_SPEEX diff --git a/akode/plugins/xiph_decoder/speex_decoder.h b/akode/plugins/xiph_decoder/speex_decoder.h new file mode 100644 index 0000000..903f828 --- /dev/null +++ b/akode/plugins/xiph_decoder/speex_decoder.h @@ -0,0 +1,74 @@ +/* aKode: Speex-Format + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_SPEEX_DECODER_H +#define _AKODE_SPEEX_DECODER_H + +#include "akodelib.h" +#ifdef HAVE_SPEEX + +#include "decoder.h" + +namespace aKode { + +class File; +class AudioFrame; + +class SpeexDecoder : public Decoder { +public: + SpeexDecoder(File* src); + virtual ~SpeexDecoder(); + bool openFile(); + + virtual bool readFrame(AudioFrame*); + virtual long length(); + virtual long position(); + virtual bool seek(long); + virtual bool seekable(); + virtual bool eof(); + virtual bool error(); + + virtual const AudioConfiguration* audioConfiguration(); + + struct private_data; +private: + bool readPage(); + bool readPacket(); + bool decodeHeader(); + + private_data *m_data; +}; + + +class SpeexDecoderPlugin : public DecoderPlugin { +public: + virtual bool canDecode(File*); + virtual Decoder* openDecoder(File* src) { + return new SpeexDecoder(src); + }; +}; + +extern "C" SpeexDecoderPlugin speex_decoder; + +} // namespace + + +#endif // HAVE_SPEEX +#endif diff --git a/akode/plugins/xiph_decoder/vorbis_decoder.cpp b/akode/plugins/xiph_decoder/vorbis_decoder.cpp new file mode 100644 index 0000000..44329d0 --- /dev/null +++ b/akode/plugins/xiph_decoder/vorbis_decoder.cpp @@ -0,0 +1,277 @@ +/* aKode: Ogg Vorbis-Decoder + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "akodelib.h" +#ifdef HAVE_OGG_VORBIS + +#include <vorbis/vorbisfile.h> + +#include "file.h" +#include "audioframe.h" +#include "decoder.h" +#include "vorbis_decoder.h" + +//#include <iostream> + +namespace aKode { + +static size_t _read(void *ptr, size_t size, size_t nmemb, void *datasource) { + File *src = (File*)datasource; + return src->read((char*)ptr, size*nmemb); +} + +static int _seek(void *datasource, ogg_int64_t offset, int whence) { + File *src = (File*)datasource; + if (src->seek(offset, whence)) + return 0; + else + return -1; +} + +static int _close(void *datasource) { + File *src = (File*)datasource; + src->close(); + return 0; +} + +static long _tell(void *datasource) { + File *src = (File*)datasource; + return src->position(); +} + +static ov_callbacks _callbacks = {_read, _seek, _close, _tell}; + +bool VorbisDecoderPlugin::canDecode(File* src) { + OggVorbis_File vf; + src->openRO(); + int r = ov_test_callbacks(src, &vf, 0, 0, _callbacks); + ov_clear(&vf); + src->close(); + return r==0; +} + +extern "C" { VorbisDecoderPlugin vorbis_decoder; } + + +struct VorbisDecoder::private_data +{ + private_data() : bitstream(0), eof(false), error(false), initialized(false), retries(0), big_endian(0) {}; + OggVorbis_File *vf; + vorbis_comment *vc; + vorbis_info *vi; + + File *src; + AudioConfiguration config; + + int bitstream; + bool eof, error; + char buffer[8192]; + bool initialized; + int retries; + + int big_endian; +}; + +VorbisDecoder::VorbisDecoder(File *src) { + m_data = new private_data; + m_data->vf = new OggVorbis_File; + + m_data->src = src; + m_data->src->openRO(); + m_data->src->fadvise(); + + unsigned short endian_test = 1; + m_data->big_endian = 1 - (*((char *)(&endian_test))); +} + +VorbisDecoder::~VorbisDecoder() { + if (m_data->initialized) + ov_clear(m_data->vf); + delete m_data->vf; + delete m_data; +} + +static void setAudioConfiguration(AudioConfiguration *config, vorbis_info *vi) +{ + config->channels = vi->channels; + config->sample_rate = vi->rate; + config->sample_width = 16; + + if (config->channels <= 2) { + config->channel_config = MonoStereo; + config->surround_config = 0; + } else + if (config->channels <= 6) { + config->channel_config = Surround; + SurroundConfiguration surround_config; + switch (config->channels) { + case 3: + surround_config.front_channels = 3; + break; + case 4: + surround_config.front_channels = 2; + surround_config.rear_channels = 2; + break; + case 5: + surround_config.front_channels = 3; + surround_config.rear_channels = 2; + break; + case 6: + surround_config.front_channels = 3; + surround_config.rear_channels = 2; + surround_config.LFE_channel = 1; + break; + } + config->surround_config = surround_config; + } + else { + config->channel_config = MultiChannel; + config->surround_config = 0; + } +} + +bool VorbisDecoder::openFile() { + int status; + + status = ov_open_callbacks(m_data->src, m_data->vf, 0, 0, _callbacks); + if (status != 0) goto fault; + + m_data->vi = ov_info(m_data->vf, -1); + //m_data->vc = ov_comment(m_data->vf, -1); + setAudioConfiguration(&m_data->config, m_data->vi); + + m_data->initialized = true; + m_data->error = false; + m_data->retries = 0; + return true; +fault: + m_data->initialized = false; + m_data->error = true; + return false; +} + +// translation from vorbis channel-layout to akodelib channel-layout +static int vorbis_channel[7][6] = { + {-1, -1, -1, -1, -1, -1}, + {0, -1, -1, -1, -1, -1}, + {0, 1, -1, -1, -1, -1}, + {0, 2, 1, -1, -1, -1}, + {0, 1, 2, 3, -1, -1}, + {0, 2, 1, 3, 4, -1}, + {0, 2, 1, 3, 4, 5} +}; + +bool VorbisDecoder::readFrame(AudioFrame* frame) +{ + if (!m_data->initialized) { + if (!openFile()) return false; + } + + int old_bitstream = m_data->bitstream; + long v = ov_read(m_data->vf, (char*)m_data->buffer, 8192, m_data->big_endian, 2, 1, &m_data->bitstream); + + if (v == 0 || v == OV_EOF ) { + // vorbisfile sometimes return 0 even though EOF is not yet reached + if (m_data->src->eof() || m_data->src->error() || ++m_data->retries >= 16) + m_data->eof = true; +// std::cerr << "akode-vorbis: EOF\n"; + } + else + if (v == OV_HOLE) { + if (++m_data->retries >= 16) m_data->error = true; +// std::cerr << "akode-vorbis: Hole\n"; + } + else + if (v < 0) { + m_data->error = true; +// std::cerr << "akode-vorbis: Error\n"; + } + + if (v <= 0) return false; + m_data->retries = 0; + + if (old_bitstream != m_data->bitstream) { // changing streams, update info + m_data->vi = ov_info(m_data->vf, -1); + //m_data->vc = ov_comment(m_data->vf, -1); + setAudioConfiguration(&m_data->config, m_data->vi); + } + + int channels = m_data->config.channels; + long length = v/(channels*2); + frame->reserveSpace(&m_data->config, length); + + // Demux into frame + int16_t* buffer = (int16_t*)m_data->buffer; + int16_t** data = (int16_t**)frame->data; + if (channels <= 6) { + int *trans = vorbis_channel[channels]; + for(int i=0; i<length; i++) + for(int j=0; j<channels; j++) + data [trans[j]] [i] = buffer[i*channels+j]; + } + else + for(int i=0; i<length; i++) + for(int j=0; j<channels; j++) + data[j][i] = buffer[i*channels+j]; + + frame->pos = position(); + return true; +} + +long VorbisDecoder::length() { + if (!m_data->initialized) return -1; + // -1 return total length of all bitstreams. + // Should we take them one at a time instead? + double ogglen = ov_time_total(m_data->vf,-1); + return (long)(ogglen*1000.0); +} + +long VorbisDecoder::position() { + if (!m_data->initialized) return -1; + double oggpos = ov_time_tell(m_data->vf); + return (long)(oggpos*1000.0); +} + +bool VorbisDecoder::eof() { + return m_data->eof; +} + +bool VorbisDecoder::error() { + return m_data->error; +} + +bool VorbisDecoder::seekable() { + return m_data->src->seekable(); +} + +bool VorbisDecoder::seek(long pos) { + if (!m_data->initialized) return false; + int r = ov_time_seek(m_data->vf, pos/1000.0); + return r == 0; +} + +const AudioConfiguration* VorbisDecoder::audioConfiguration() { + if (!m_data->initialized) return 0; + return &m_data->config; +} + +} // namespace + +#endif //OGG_VORBIS diff --git a/akode/plugins/xiph_decoder/vorbis_decoder.h b/akode/plugins/xiph_decoder/vorbis_decoder.h new file mode 100644 index 0000000..5dd6790 --- /dev/null +++ b/akode/plugins/xiph_decoder/vorbis_decoder.h @@ -0,0 +1,70 @@ +/* aKode: Ogg Vorbis-Format + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_VORBISFORMAT_H +#define _AKODE_VORBISFORMAT_H + +#include "akodelib.h" +#ifdef HAVE_OGG_VORBIS + +#include "decoder.h" + +namespace aKode { + +class File; +class AudioFrame; + +class VorbisDecoder : public Decoder { +public: + VorbisDecoder(File* src); + virtual ~VorbisDecoder(); + + virtual bool openFile(); + + virtual bool readFrame(AudioFrame*); + virtual long length(); + virtual long position(); + virtual bool seek(long); + virtual bool seekable(); + virtual bool eof(); + virtual bool error(); + + virtual const AudioConfiguration* audioConfiguration(); + + struct private_data; +private: + private_data *m_data; +}; + + +class VorbisDecoderPlugin : public DecoderPlugin { +public: + virtual bool canDecode(File*); + virtual VorbisDecoder* openDecoder(File* src) { + return new VorbisDecoder(src); + }; +}; + +extern "C" VorbisDecoderPlugin vorbis_decoder; + +} // namespace + +#endif // HAVE_VORBIS +#endif diff --git a/akode/plugins/xiph_decoder/xiph_decoder.cpp b/akode/plugins/xiph_decoder/xiph_decoder.cpp new file mode 100644 index 0000000..841656d --- /dev/null +++ b/akode/plugins/xiph_decoder/xiph_decoder.cpp @@ -0,0 +1,84 @@ +/* aKode: Xiph-Format + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the src COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "akodelib.h" + +#include "file.h" +#include "audioframe.h" +#include "decoder.h" + +#include "xiph_decoder.h" +#include "flac_decoder.h" +#include "vorbis_decoder.h" +#include "speex_decoder.h" + +namespace aKode { + +bool XiphDecoderPlugin::canDecode(File* src) { +#if defined(HAVE_LIBFLAC) || defined(HAVE_LIBFLAC113) + if (flac_decoder.canDecode(src)) + return true; + else +#endif +#ifdef HAVE_LIBOGGFLAC + if (oggflac_decoder.canDecode(src)) + return true; + else +#endif +#ifdef HAVE_OGG_VORBIS + if (vorbis_decoder.canDecode(src)) + return true; + else +#endif +#ifdef HAVE_SPEEX + if (speex_decoder.canDecode(src)) + return true; + else +#endif + return false; +} + +Decoder* XiphDecoderPlugin::openDecoder(File* src) { +#if defined(HAVE_LIBFLAC) || defined(HAVE_LIBFLAC113) + if (flac_decoder.canDecode(src)) + return flac_decoder.openDecoder(src); + else +#endif +#ifdef HAVE_LIBOGGFLAC + if (oggflac_decoder.canDecode(src)) + return oggflac_decoder.openDecoder(src); + else +#endif +#ifdef HAVE_OGG_VORBIS + if (vorbis_decoder.canDecode(src)) + return vorbis_decoder.openDecoder(src); + else +#endif +#ifdef HAVE_SPEEX + if (speex_decoder.canDecode(src)) + return speex_decoder.openDecoder(src); + else +#endif + return 0; +} + +extern "C" { XiphDecoderPlugin xiph_decoder; } + +} // namespace diff --git a/akode/plugins/xiph_decoder/xiph_decoder.h b/akode/plugins/xiph_decoder/xiph_decoder.h new file mode 100644 index 0000000..bef9fc8 --- /dev/null +++ b/akode/plugins/xiph_decoder/xiph_decoder.h @@ -0,0 +1,42 @@ +/* aKode: Xiph-Format (parent for various Xiph formats) + + Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _AKODE_XIPH_DECODER_H +#define _AKODE_XIPH_DECODER_H + +#include "akodelib.h" + +#include "decoder.h" + +namespace aKode { + +class File; + +class XiphDecoderPlugin : public DecoderPlugin { +public: + virtual bool canDecode(File*); + virtual Decoder* openDecoder(File* src); +}; + +extern "C" XiphDecoderPlugin xiph_decoder; + +} // namespace + +#endif |