aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/edje/src/modules/alsa_snd_player
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libraries/edje/src/modules/alsa_snd_player/Makefile.am20
-rw-r--r--libraries/edje/src/modules/alsa_snd_player/Makefile.in634
-rw-r--r--libraries/edje/src/modules/alsa_snd_player/alsa_snd_player.c405
3 files changed, 1059 insertions, 0 deletions
diff --git a/libraries/edje/src/modules/alsa_snd_player/Makefile.am b/libraries/edje/src/modules/alsa_snd_player/Makefile.am
new file mode 100644
index 0000000..de015f8
--- /dev/null
+++ b/libraries/edje/src/modules/alsa_snd_player/Makefile.am
@@ -0,0 +1,20 @@
1## Process this file with automake to produce Makefile.in
2
3MAINTAINERCLEANFILES = Makefile.in
4
5pkglibdir = $(REMIX_PLUGIN_DIR)
6
7AM_CPPFLAGS = \
8-I. \
9-DPACKAGE_LIB_DIR=\"$(libdir)/remix\" \
10-DPACKAGE_DATA_DIR=\"$(datadir)/remix\" \
11@EDJE_CFLAGS@ \
12@REMIX_CFLAGS@ \
13@ALSA_CFLAGS@
14
15pkgdir = $(REMIX_PLUGIN_DIR)
16pkg_LTLIBRARIES = libalsa_snd_player.la
17
18libalsa_snd_player_la_SOURCES = alsa_snd_player.c
19libalsa_snd_player_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version @EDJE_LIBS@ @REMIX_LIBS@ @ALSA_LIBS@
20libalsa_snd_player_la_LIBTOOLFLAGS = --tag=disable-static
diff --git a/libraries/edje/src/modules/alsa_snd_player/Makefile.in b/libraries/edje/src/modules/alsa_snd_player/Makefile.in
new file mode 100644
index 0000000..ce68f41
--- /dev/null
+++ b/libraries/edje/src/modules/alsa_snd_player/Makefile.in
@@ -0,0 +1,634 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18VPATH = @srcdir@
19pkgdatadir = $(datadir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21pkglibexecdir = $(libexecdir)/@PACKAGE@
22am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23install_sh_DATA = $(install_sh) -c -m 644
24install_sh_PROGRAM = $(install_sh) -c
25install_sh_SCRIPT = $(install_sh) -c
26INSTALL_HEADER = $(INSTALL_DATA)
27transform = $(program_transform_name)
28NORMAL_INSTALL = :
29PRE_INSTALL = :
30POST_INSTALL = :
31NORMAL_UNINSTALL = :
32PRE_UNINSTALL = :
33POST_UNINSTALL = :
34build_triplet = @build@
35host_triplet = @host@
36subdir = src/modules/alsa_snd_player
37DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \
40 $(top_srcdir)/m4/efl_binary.m4 \
41 $(top_srcdir)/m4/efl_coverage.m4 \
42 $(top_srcdir)/m4/efl_doxygen.m4 \
43 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
44 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
45 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
46 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
47am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
48 $(ACLOCAL_M4)
49mkinstalldirs = $(install_sh) -d
50CONFIG_HEADER = $(top_builddir)/config.h
51CONFIG_CLEAN_FILES =
52CONFIG_CLEAN_VPATH_FILES =
53am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
54am__vpath_adj = case $$p in \
55 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
56 *) f=$$p;; \
57 esac;
58am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
59am__install_max = 40
60am__nobase_strip_setup = \
61 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
62am__nobase_strip = \
63 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
64am__nobase_list = $(am__nobase_strip_setup); \
65 for p in $$list; do echo "$$p $$p"; done | \
66 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
67 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
68 if (++n[$$2] == $(am__install_max)) \
69 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
70 END { for (dir in files) print dir, files[dir] }'
71am__base_list = \
72 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
73 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
74am__installdirs = "$(DESTDIR)$(pkgdir)"
75LTLIBRARIES = $(pkg_LTLIBRARIES)
76libalsa_snd_player_la_LIBADD =
77am_libalsa_snd_player_la_OBJECTS = \
78 libalsa_snd_player_la-alsa_snd_player.lo
79libalsa_snd_player_la_OBJECTS = $(am_libalsa_snd_player_la_OBJECTS)
80AM_V_lt = $(am__v_lt_$(V))
81am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
82am__v_lt_0 = --silent
83libalsa_snd_player_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
84 $(libalsa_snd_player_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
85 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
86 $(libalsa_snd_player_la_LDFLAGS) $(LDFLAGS) -o $@
87DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
88depcomp = $(SHELL) $(top_srcdir)/depcomp
89am__depfiles_maybe = depfiles
90am__mv = mv -f
91COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
92 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
93LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
94 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
95 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
96 $(AM_CFLAGS) $(CFLAGS)
97AM_V_CC = $(am__v_CC_$(V))
98am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
99am__v_CC_0 = @echo " CC " $@;
100AM_V_at = $(am__v_at_$(V))
101am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
102am__v_at_0 = @
103CCLD = $(CC)
104LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
105 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
106 $(AM_LDFLAGS) $(LDFLAGS) -o $@
107AM_V_CCLD = $(am__v_CCLD_$(V))
108am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
109am__v_CCLD_0 = @echo " CCLD " $@;
110AM_V_GEN = $(am__v_GEN_$(V))
111am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
112am__v_GEN_0 = @echo " GEN " $@;
113SOURCES = $(libalsa_snd_player_la_SOURCES)
114DIST_SOURCES = $(libalsa_snd_player_la_SOURCES)
115ETAGS = etags
116CTAGS = ctags
117DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
118pkglibdir = $(REMIX_PLUGIN_DIR)
119ACLOCAL = @ACLOCAL@
120ALLOCA = @ALLOCA@
121ALSA_CFLAGS = @ALSA_CFLAGS@
122ALSA_LIBS = @ALSA_LIBS@
123AMTAR = @AMTAR@
124AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
125AR = @AR@
126AS = @AS@
127AUTOCONF = @AUTOCONF@
128AUTOHEADER = @AUTOHEADER@
129AUTOMAKE = @AUTOMAKE@
130AWK = @AWK@
131CC = @CC@
132CCDEPMODE = @CCDEPMODE@
133CFLAGS = @CFLAGS@
134CHECK_CFLAGS = @CHECK_CFLAGS@
135CHECK_LIBS = @CHECK_LIBS@
136CPP = @CPP@
137CPPFLAGS = @CPPFLAGS@
138CYGPATH_W = @CYGPATH_W@
139DEFS = @DEFS@
140DEPDIR = @DEPDIR@
141DLLTOOL = @DLLTOOL@
142DSYMUTIL = @DSYMUTIL@
143DUMPBIN = @DUMPBIN@
144ECHO_C = @ECHO_C@
145ECHO_N = @ECHO_N@
146ECHO_T = @ECHO_T@
147ECORE_IMF_CFLAGS = @ECORE_IMF_CFLAGS@
148ECORE_IMF_LIBS = @ECORE_IMF_LIBS@
149EDJE_CC_CFLAGS = @EDJE_CC_CFLAGS@
150EDJE_CC_LIBS = @EDJE_CC_LIBS@
151EDJE_CC_PRG = @EDJE_CC_PRG@
152EDJE_CFLAGS = @EDJE_CFLAGS@
153EDJE_DECC_CFLAGS = @EDJE_DECC_CFLAGS@
154EDJE_DECC_LIBS = @EDJE_DECC_LIBS@
155EDJE_DECC_PRG = @EDJE_DECC_PRG@
156EDJE_EXTERNAL_INSPECTOR_CFLAGS = @EDJE_EXTERNAL_INSPECTOR_CFLAGS@
157EDJE_EXTERNAL_INSPECTOR_LIBS = @EDJE_EXTERNAL_INSPECTOR_LIBS@
158EDJE_EXTERNAL_INSPECTOR_PRG = @EDJE_EXTERNAL_INSPECTOR_PRG@
159EDJE_INSPECTOR_CFLAGS = @EDJE_INSPECTOR_CFLAGS@
160EDJE_INSPECTOR_LIBS = @EDJE_INSPECTOR_LIBS@
161EDJE_INSPECTOR_PRG = @EDJE_INSPECTOR_PRG@
162EDJE_LIBS = @EDJE_LIBS@
163EDJE_PLAYER_CFLAGS = @EDJE_PLAYER_CFLAGS@
164EDJE_PLAYER_LIBS = @EDJE_PLAYER_LIBS@
165EDJE_PLAYER_PRG = @EDJE_PLAYER_PRG@
166EDJE_RECC_PRG = @EDJE_RECC_PRG@
167EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
168EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
169EFL_EDJE_BUILD = @EFL_EDJE_BUILD@
170EGREP = @EGREP@
171EVIL_CFLAGS = @EVIL_CFLAGS@
172EVIL_LIBS = @EVIL_LIBS@
173EXEEXT = @EXEEXT@
174FGREP = @FGREP@
175FLAC_CFLAGS = @FLAC_CFLAGS@
176FLAC_LIBS = @FLAC_LIBS@
177GREP = @GREP@
178INSTALL = @INSTALL@
179INSTALL_DATA = @INSTALL_DATA@
180INSTALL_PROGRAM = @INSTALL_PROGRAM@
181INSTALL_SCRIPT = @INSTALL_SCRIPT@
182INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
183LD = @LD@
184LDFLAGS = @LDFLAGS@
185LIBOBJS = @LIBOBJS@
186LIBS = @LIBS@
187LIBTOOL = @LIBTOOL@
188LIPO = @LIPO@
189LN_S = @LN_S@
190LTLIBOBJS = @LTLIBOBJS@
191LUA_CFLAGS = @LUA_CFLAGS@
192LUA_LIBS = @LUA_LIBS@
193MAKEINFO = @MAKEINFO@
194MINIMAL_CFLAGS = @MINIMAL_CFLAGS@
195MINIMAL_LIBS = @MINIMAL_LIBS@
196MKDIR_P = @MKDIR_P@
197MODULE_ARCH = @MODULE_ARCH@
198NM = @NM@
199NMEDIT = @NMEDIT@
200OBJDUMP = @OBJDUMP@
201OBJEXT = @OBJEXT@
202OTOOL = @OTOOL@
203OTOOL64 = @OTOOL64@
204PACKAGE = @PACKAGE@
205PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
206PACKAGE_NAME = @PACKAGE_NAME@
207PACKAGE_STRING = @PACKAGE_STRING@
208PACKAGE_TARNAME = @PACKAGE_TARNAME@
209PACKAGE_URL = @PACKAGE_URL@
210PACKAGE_VERSION = @PACKAGE_VERSION@
211PATH_SEPARATOR = @PATH_SEPARATOR@
212PKG_CONFIG = @PKG_CONFIG@
213PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
214PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
215PYTHON = @PYTHON@
216PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
217PYTHON_PLATFORM = @PYTHON_PLATFORM@
218PYTHON_PREFIX = @PYTHON_PREFIX@
219PYTHON_VERSION = @PYTHON_VERSION@
220RANLIB = @RANLIB@
221REMIX_CFLAGS = @REMIX_CFLAGS@
222REMIX_LIBS = @REMIX_LIBS@
223REMIX_PLUGIN_DIR = @REMIX_PLUGIN_DIR@
224SED = @SED@
225SET_MAKE = @SET_MAKE@
226SHELL = @SHELL@
227SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
228SNDFILE_LIBS = @SNDFILE_LIBS@
229STRIP = @STRIP@
230VERSION = @VERSION@
231VMAJ = @VMAJ@
232VORBISENC_CFLAGS = @VORBISENC_CFLAGS@
233VORBISENC_LIBS = @VORBISENC_LIBS@
234abs_builddir = @abs_builddir@
235abs_srcdir = @abs_srcdir@
236abs_top_builddir = @abs_top_builddir@
237abs_top_srcdir = @abs_top_srcdir@
238ac_ct_CC = @ac_ct_CC@
239ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
240am__include = @am__include@
241am__leading_dot = @am__leading_dot@
242am__quote = @am__quote@
243am__tar = @am__tar@
244am__untar = @am__untar@
245bindir = @bindir@
246build = @build@
247build_alias = @build_alias@
248build_cpu = @build_cpu@
249build_os = @build_os@
250build_vendor = @build_vendor@
251builddir = @builddir@
252datadir = @datadir@
253datarootdir = @datarootdir@
254docdir = @docdir@
255dvidir = @dvidir@
256edje_cc = @edje_cc@
257efl_doxygen = @efl_doxygen@
258efl_have_doxygen = @efl_have_doxygen@
259exec_prefix = @exec_prefix@
260have_lcov = @have_lcov@
261host = @host@
262host_alias = @host_alias@
263host_cpu = @host_cpu@
264host_os = @host_os@
265host_vendor = @host_vendor@
266htmldir = @htmldir@
267includedir = @includedir@
268infodir = @infodir@
269install_sh = @install_sh@
270libdir = @libdir@
271libexecdir = @libexecdir@
272localedir = @localedir@
273localstatedir = @localstatedir@
274lt_ECHO = @lt_ECHO@
275lt_enable_auto_import = @lt_enable_auto_import@
276lua_libs = @lua_libs@
277mandir = @mandir@
278mkdir_p = @mkdir_p@
279oldincludedir = @oldincludedir@
280pdfdir = @pdfdir@
281pkgconfig_requires_private = @pkgconfig_requires_private@
282pkgpyexecdir = @pkgpyexecdir@
283pkgpythondir = @pkgpythondir@
284prefix = @prefix@
285program_transform_name = @program_transform_name@
286psdir = @psdir@
287pyexecdir = @pyexecdir@
288pythondir = @pythondir@
289release_info = @release_info@
290requirement_edje = @requirement_edje@
291sbindir = @sbindir@
292sharedstatedir = @sharedstatedir@
293srcdir = @srcdir@
294sysconfdir = @sysconfdir@
295target_alias = @target_alias@
296top_build_prefix = @top_build_prefix@
297top_builddir = @top_builddir@
298top_srcdir = @top_srcdir@
299version_info = @version_info@
300vimdir = @vimdir@
301MAINTAINERCLEANFILES = Makefile.in
302AM_CPPFLAGS = \
303-I. \
304-DPACKAGE_LIB_DIR=\"$(libdir)/remix\" \
305-DPACKAGE_DATA_DIR=\"$(datadir)/remix\" \
306@EDJE_CFLAGS@ \
307@REMIX_CFLAGS@ \
308@ALSA_CFLAGS@
309
310pkgdir = $(REMIX_PLUGIN_DIR)
311pkg_LTLIBRARIES = libalsa_snd_player.la
312libalsa_snd_player_la_SOURCES = alsa_snd_player.c
313libalsa_snd_player_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version @EDJE_LIBS@ @REMIX_LIBS@ @ALSA_LIBS@
314libalsa_snd_player_la_LIBTOOLFLAGS = --tag=disable-static
315all: all-am
316
317.SUFFIXES:
318.SUFFIXES: .c .lo .o .obj
319$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
320 @for dep in $?; do \
321 case '$(am__configure_deps)' in \
322 *$$dep*) \
323 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
324 && { if test -f $@; then exit 0; else break; fi; }; \
325 exit 1;; \
326 esac; \
327 done; \
328 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/alsa_snd_player/Makefile'; \
329 $(am__cd) $(top_srcdir) && \
330 $(AUTOMAKE) --gnu src/modules/alsa_snd_player/Makefile
331.PRECIOUS: Makefile
332Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
333 @case '$?' in \
334 *config.status*) \
335 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
336 *) \
337 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
338 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
339 esac;
340
341$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
342 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
343
344$(top_srcdir)/configure: $(am__configure_deps)
345 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
346$(ACLOCAL_M4): $(am__aclocal_m4_deps)
347 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
348$(am__aclocal_m4_deps):
349install-pkgLTLIBRARIES: $(pkg_LTLIBRARIES)
350 @$(NORMAL_INSTALL)
351 test -z "$(pkgdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdir)"
352 @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \
353 list2=; for p in $$list; do \
354 if test -f $$p; then \
355 list2="$$list2 $$p"; \
356 else :; fi; \
357 done; \
358 test -z "$$list2" || { \
359 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkgdir)'"; \
360 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkgdir)"; \
361 }
362
363uninstall-pkgLTLIBRARIES:
364 @$(NORMAL_UNINSTALL)
365 @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \
366 for p in $$list; do \
367 $(am__strip_dir) \
368 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgdir)/$$f'"; \
369 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgdir)/$$f"; \
370 done
371
372clean-pkgLTLIBRARIES:
373 -test -z "$(pkg_LTLIBRARIES)" || rm -f $(pkg_LTLIBRARIES)
374 @list='$(pkg_LTLIBRARIES)'; for p in $$list; do \
375 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
376 test "$$dir" != "$$p" || dir=.; \
377 echo "rm -f \"$${dir}/so_locations\""; \
378 rm -f "$${dir}/so_locations"; \
379 done
380libalsa_snd_player.la: $(libalsa_snd_player_la_OBJECTS) $(libalsa_snd_player_la_DEPENDENCIES)
381 $(AM_V_CCLD)$(libalsa_snd_player_la_LINK) -rpath $(pkgdir) $(libalsa_snd_player_la_OBJECTS) $(libalsa_snd_player_la_LIBADD) $(LIBS)
382
383mostlyclean-compile:
384 -rm -f *.$(OBJEXT)
385
386distclean-compile:
387 -rm -f *.tab.c
388
389@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libalsa_snd_player_la-alsa_snd_player.Plo@am__quote@
390
391.c.o:
392@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
393@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
394@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
395@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
396@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
397@am__fastdepCC_FALSE@ $(COMPILE) -c $<
398
399.c.obj:
400@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
401@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
402@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
403@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
404@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
405@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
406
407.c.lo:
408@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
409@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
410@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
411@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
412@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
413@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
414
415libalsa_snd_player_la-alsa_snd_player.lo: alsa_snd_player.c
416@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libalsa_snd_player_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libalsa_snd_player_la-alsa_snd_player.lo -MD -MP -MF $(DEPDIR)/libalsa_snd_player_la-alsa_snd_player.Tpo -c -o libalsa_snd_player_la-alsa_snd_player.lo `test -f 'alsa_snd_player.c' || echo '$(srcdir)/'`alsa_snd_player.c
417@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libalsa_snd_player_la-alsa_snd_player.Tpo $(DEPDIR)/libalsa_snd_player_la-alsa_snd_player.Plo
418@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
419@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='alsa_snd_player.c' object='libalsa_snd_player_la-alsa_snd_player.lo' libtool=yes @AMDEPBACKSLASH@
420@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
421@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(libalsa_snd_player_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libalsa_snd_player_la-alsa_snd_player.lo `test -f 'alsa_snd_player.c' || echo '$(srcdir)/'`alsa_snd_player.c
422
423mostlyclean-libtool:
424 -rm -f *.lo
425
426clean-libtool:
427 -rm -rf .libs _libs
428
429ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
430 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
431 unique=`for i in $$list; do \
432 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
433 done | \
434 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
435 END { if (nonempty) { for (i in files) print i; }; }'`; \
436 mkid -fID $$unique
437tags: TAGS
438
439TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
440 $(TAGS_FILES) $(LISP)
441 set x; \
442 here=`pwd`; \
443 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
444 unique=`for i in $$list; do \
445 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
446 done | \
447 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
448 END { if (nonempty) { for (i in files) print i; }; }'`; \
449 shift; \
450 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
451 test -n "$$unique" || unique=$$empty_fix; \
452 if test $$# -gt 0; then \
453 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
454 "$$@" $$unique; \
455 else \
456 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
457 $$unique; \
458 fi; \
459 fi
460ctags: CTAGS
461CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
462 $(TAGS_FILES) $(LISP)
463 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
464 unique=`for i in $$list; do \
465 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
466 done | \
467 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
468 END { if (nonempty) { for (i in files) print i; }; }'`; \
469 test -z "$(CTAGS_ARGS)$$unique" \
470 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
471 $$unique
472
473GTAGS:
474 here=`$(am__cd) $(top_builddir) && pwd` \
475 && $(am__cd) $(top_srcdir) \
476 && gtags -i $(GTAGS_ARGS) "$$here"
477
478distclean-tags:
479 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
480
481distdir: $(DISTFILES)
482 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
483 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
484 list='$(DISTFILES)'; \
485 dist_files=`for file in $$list; do echo $$file; done | \
486 sed -e "s|^$$srcdirstrip/||;t" \
487 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
488 case $$dist_files in \
489 */*) $(MKDIR_P) `echo "$$dist_files" | \
490 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
491 sort -u` ;; \
492 esac; \
493 for file in $$dist_files; do \
494 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
495 if test -d $$d/$$file; then \
496 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
497 if test -d "$(distdir)/$$file"; then \
498 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
499 fi; \
500 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
501 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
502 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
503 fi; \
504 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
505 else \
506 test -f "$(distdir)/$$file" \
507 || cp -p $$d/$$file "$(distdir)/$$file" \
508 || exit 1; \
509 fi; \
510 done
511check-am: all-am
512check: check-am
513all-am: Makefile $(LTLIBRARIES)
514installdirs:
515 for dir in "$(DESTDIR)$(pkgdir)"; do \
516 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
517 done
518install: install-am
519install-exec: install-exec-am
520install-data: install-data-am
521uninstall: uninstall-am
522
523install-am: all-am
524 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
525
526installcheck: installcheck-am
527install-strip:
528 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
529 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
530 `test -z '$(STRIP)' || \
531 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
532mostlyclean-generic:
533
534clean-generic:
535
536distclean-generic:
537 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
538 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
539
540maintainer-clean-generic:
541 @echo "This command is intended for maintainers to use"
542 @echo "it deletes files that may require special tools to rebuild."
543 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
544clean: clean-am
545
546clean-am: clean-generic clean-libtool clean-pkgLTLIBRARIES \
547 mostlyclean-am
548
549distclean: distclean-am
550 -rm -rf ./$(DEPDIR)
551 -rm -f Makefile
552distclean-am: clean-am distclean-compile distclean-generic \
553 distclean-tags
554
555dvi: dvi-am
556
557dvi-am:
558
559html: html-am
560
561html-am:
562
563info: info-am
564
565info-am:
566
567install-data-am: install-pkgLTLIBRARIES
568
569install-dvi: install-dvi-am
570
571install-dvi-am:
572
573install-exec-am:
574
575install-html: install-html-am
576
577install-html-am:
578
579install-info: install-info-am
580
581install-info-am:
582
583install-man:
584
585install-pdf: install-pdf-am
586
587install-pdf-am:
588
589install-ps: install-ps-am
590
591install-ps-am:
592
593installcheck-am:
594
595maintainer-clean: maintainer-clean-am
596 -rm -rf ./$(DEPDIR)
597 -rm -f Makefile
598maintainer-clean-am: distclean-am maintainer-clean-generic
599
600mostlyclean: mostlyclean-am
601
602mostlyclean-am: mostlyclean-compile mostlyclean-generic \
603 mostlyclean-libtool
604
605pdf: pdf-am
606
607pdf-am:
608
609ps: ps-am
610
611ps-am:
612
613uninstall-am: uninstall-pkgLTLIBRARIES
614
615.MAKE: install-am install-strip
616
617.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
618 clean-libtool clean-pkgLTLIBRARIES ctags distclean \
619 distclean-compile distclean-generic distclean-libtool \
620 distclean-tags distdir dvi dvi-am html html-am info info-am \
621 install install-am install-data install-data-am install-dvi \
622 install-dvi-am install-exec install-exec-am install-html \
623 install-html-am install-info install-info-am install-man \
624 install-pdf install-pdf-am install-pkgLTLIBRARIES install-ps \
625 install-ps-am install-strip installcheck installcheck-am \
626 installdirs maintainer-clean maintainer-clean-generic \
627 mostlyclean mostlyclean-compile mostlyclean-generic \
628 mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
629 uninstall-am uninstall-pkgLTLIBRARIES
630
631
632# Tell versions [3.59,3.63) of GNU make to not export all variables.
633# Otherwise a system limit (for SysV at least) may be exceeded.
634.NOEXPORT:
diff --git a/libraries/edje/src/modules/alsa_snd_player/alsa_snd_player.c b/libraries/edje/src/modules/alsa_snd_player/alsa_snd_player.c
new file mode 100644
index 0000000..f397255
--- /dev/null
+++ b/libraries/edje/src/modules/alsa_snd_player/alsa_snd_player.c
@@ -0,0 +1,405 @@
1/*
2 * Remix ALSA Player: ALSA audio output
3 *
4 * Govindaraju SM <govi.sm@samsung.com>, October 2011
5 * Prince Kumar Dubey <prince.dubey@samsung.com>, October 2011
6 */
7
8#include "config.h"
9#include <stdio.h>
10#include <remix/remix.h>
11#include <alsa/asoundlib.h>
12#include <Eina.h>
13#ifdef HAVE_LIBSNDFILE
14#include <sndfile.h>
15#endif
16
17#define ALSA_PLAYER_BUFFERLEN 2048
18
19typedef struct _Alsa_Player_Data Alsa_Player_Data;
20typedef short PLAYER_PCM;
21
22struct _Alsa_Player_Data
23{
24 RemixPCM databuffer[ALSA_PLAYER_BUFFERLEN];
25 snd_pcm_t *alsa_dev;
26 unsigned int stereo;
27 unsigned channels;
28 unsigned int frequency;
29};
30
31static int _log_dom = -1;
32static int init_count = 0;
33
34#ifdef WRN
35# undef WRN
36#endif
37#define WRN(...) EINA_LOG_DOM_WARN(_log_dom, __VA_ARGS__)
38
39//#define MIXDBG 1
40
41/* Optimisation dependencies: none */
42static RemixBase *alsa_player_optimise(RemixEnv *env, RemixBase *base);
43
44static snd_pcm_t *
45alsa_open(int channels, unsigned int samplerate, unsigned int *real_samplerate)
46{
47 const char *device = "default";
48 snd_pcm_t *alsa_dev = NULL;
49 snd_pcm_hw_params_t *hw_params;
50 snd_pcm_uframes_t alsa_buffer_frames;
51 snd_pcm_uframes_t alsa_period_size;
52 unsigned int samplerate_ret = 0;
53 int err;
54
55 alsa_buffer_frames = ALSA_PLAYER_BUFFERLEN;
56 alsa_period_size = ALSA_PLAYER_BUFFERLEN / 4;
57
58 if ((err = snd_pcm_open(&alsa_dev, device, SND_PCM_STREAM_PLAYBACK, 0)) < 0)
59 {
60 WRN("cannot open alsa playback stream (%s)", snd_strerror(err));
61 goto catch_error;
62 }
63 snd_pcm_hw_params_alloca(&hw_params);
64 if ((err = snd_pcm_hw_params_any(alsa_dev, hw_params)) < 0)
65 {
66 WRN("cannot initialize snd hw params (%s)", snd_strerror(err));
67 goto catch_error;
68 }
69 if ((err = snd_pcm_hw_params_set_access(alsa_dev, hw_params,
70 SND_PCM_ACCESS_RW_INTERLEAVED)) < 0)
71 {
72 WRN("cannot set interleaved access (%s)", snd_strerror(err));
73 goto catch_error;
74 }
75 if ((err = snd_pcm_hw_params_set_format(alsa_dev, hw_params,
76 SND_PCM_FORMAT_FLOAT)) < 0)
77 {
78 WRN("cannot set float sample format (%s)", snd_strerror(err));
79 goto catch_error;
80 }
81#ifdef MIXDBG // testing/debugging by making output samplerate be 48khz
82 samplerate_ret = 48000;
83 if ((err = snd_pcm_hw_params_set_rate_near(alsa_dev, hw_params,
84 &samplerate_ret, 0)) < 0)
85 {
86 WRN("cannot set sample rate (%s)", snd_strerror(err));
87 goto catch_error;
88 }
89#else
90 if ((err = snd_pcm_hw_params_set_rate_near(alsa_dev, hw_params,
91 &samplerate, 0)) < 0)
92 {
93 WRN("cannot set sample rate (%s)", snd_strerror(err));
94 goto catch_error;
95 }
96#endif
97 if ((err = snd_pcm_hw_params_set_channels(alsa_dev, hw_params, channels)) < 0)
98 {
99 WRN("cannot set channel count (%s)", snd_strerror(err));
100 goto catch_error;
101 }
102 if ((err = snd_pcm_hw_params_set_buffer_size_near(alsa_dev, hw_params,
103 &alsa_buffer_frames)) < 0)
104 {
105 WRN("cannot set buffer size (%s)", snd_strerror(err));
106 goto catch_error;
107 }
108 if ((err = snd_pcm_hw_params_set_period_size_near(alsa_dev, hw_params,
109 &alsa_period_size, 0)) < 0)
110 {
111 WRN("cannot set period size (%s)", snd_strerror(err));
112 goto catch_error;
113 }
114 if ((err = snd_pcm_hw_params(alsa_dev, hw_params)) < 0)
115 {
116 WRN("cannot set parameters (%s)", snd_strerror(err));
117 goto catch_error;
118 }
119 if ((err = snd_pcm_hw_params_get_rate(hw_params, &samplerate_ret, 0)) < 0)
120 {
121 WRN("cannot get samplerate (%s)", snd_strerror(err));
122 goto catch_error;
123 }
124 if ((err = snd_pcm_prepare(alsa_dev)) < 0)
125 {
126 WRN("cannot prepare audio for use (%s)", snd_strerror(err));
127 goto catch_error;
128 }
129 if (real_samplerate) *real_samplerate = samplerate_ret;
130
131catch_error:
132 if ((err < 0) && (alsa_dev != NULL))
133 {
134 snd_pcm_close(alsa_dev);
135 return NULL;
136 }
137 return alsa_dev;
138}
139
140static RemixBase *
141alsa_player_reset_device(RemixEnv *env, RemixBase *base)
142{
143 Alsa_Player_Data *player_data = remix_base_get_instance_data(env, base);
144 unsigned int real_samplerate = 0;
145
146 if (player_data->alsa_dev)
147 {
148 snd_pcm_drain(player_data->alsa_dev);
149 snd_pcm_close(player_data->alsa_dev);
150 }
151 player_data->alsa_dev = alsa_open(player_data->channels,
152 player_data->frequency,
153 &real_samplerate);
154 if (!player_data->alsa_dev)
155 {
156 remix_set_error(env, REMIX_ERROR_SYSTEM);
157 return RemixNone;
158 }
159// printf("%i != %i\n", real_samplerate, player_data->frequency);
160 if (real_samplerate != player_data->frequency)
161 {
162 player_data->frequency = real_samplerate;
163 remix_set_samplerate(env, player_data->frequency);
164 }
165 return base;
166}
167
168static RemixBase *
169alsa_player_init(RemixEnv *env, RemixBase *base, CDSet *parameters __UNUSED__)
170{
171 CDSet *channels;
172 Alsa_Player_Data *player_data = calloc(1, sizeof(Alsa_Player_Data));
173
174 if (!player_data)
175 {
176 remix_set_error(env, REMIX_ERROR_SYSTEM);
177 return RemixNone;
178 }
179
180 init_count++;
181 if (init_count == 1)
182 {
183 eina_init();
184 _log_dom = eina_log_domain_register("remix-alsa", EINA_COLOR_CYAN);
185 }
186
187 remix_base_set_instance_data(env, base, player_data);
188 channels = remix_get_channels(env);
189
190 player_data->channels = cd_set_size(env, channels);
191 if (player_data->channels == 1) player_data->stereo = 0;
192 else if (player_data->channels == 2) player_data->stereo = 1;
193
194 player_data->frequency = remix_get_samplerate(env);
195 alsa_player_reset_device(env, base);
196 base = alsa_player_optimise(env, base);
197 return base;
198}
199
200static RemixBase *
201alsa_player_clone(RemixEnv *env, RemixBase *base __UNUSED__)
202{
203 RemixBase *new_player = remix_base_new(env);
204 alsa_player_init(env, new_player, NULL);
205 return new_player;
206}
207
208static int
209alsa_player_destroy(RemixEnv *env, RemixBase *base)
210{
211 Alsa_Player_Data *player_data = remix_base_get_instance_data(env, base);
212
213 if (player_data->alsa_dev)
214 {
215 snd_pcm_drain(player_data->alsa_dev);
216 snd_pcm_close(player_data->alsa_dev);
217 }
218 free(player_data);
219 init_count--;
220 if (init_count == 0)
221 {
222 eina_log_domain_unregister(_log_dom);
223 _log_dom = -1;
224 eina_shutdown();
225 }
226 return 0;
227}
228
229static int
230alsa_player_ready(RemixEnv *env, RemixBase *base)
231{
232 Alsa_Player_Data *player_data = remix_base_get_instance_data(env, base);
233 RemixCount nr_channels;
234 CDSet *channels;
235 int samplerate;
236
237 channels = remix_get_channels(env);
238 samplerate = (int)remix_get_samplerate(env);
239 nr_channels = cd_set_size(env, channels);
240 return ((samplerate == (int)player_data->frequency) &&
241 (((nr_channels == 1) && (player_data->stereo == 0)) ||
242 ((nr_channels > 1) && (player_data->stereo == 1))));
243}
244
245static RemixBase *
246alsa_player_prepare(RemixEnv *env, RemixBase *base)
247{
248 alsa_player_reset_device(env, base);
249 return base;
250}
251
252static RemixCount
253alsa_player_playbuffer(RemixEnv *env __UNUSED__, Alsa_Player_Data *player, RemixPCM *data, RemixCount count)
254{
255#ifdef MIXDBG
256 {
257 static int total = 0;
258 static SNDFILE *sfile = NULL;
259 static SF_INFO sfinfo;
260
261 if (total == 0)
262 {
263 sfinfo.frames = 0;
264 sfinfo.samplerate = player->frequency;
265 sfinfo.channels = 2;
266 sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16 | SF_ENDIAN_LITTLE;
267 sfinfo.sections = 0;
268 sfinfo.seekable = 0;
269 sfile = sf_open("out.wav", SFM_WRITE, &sfinfo);
270 }
271
272 if (sfile)
273 {
274 sf_writef_float(sfile, data, count);
275 total += count;
276 }
277 }
278#endif
279 return snd_pcm_writei(player->alsa_dev, data, count);
280}
281
282static RemixCount
283alsa_player_chunk(RemixEnv *env, RemixChunk *chunk, RemixCount offset, RemixCount count, int channelname __UNUSED__, void *data)
284{
285 Alsa_Player_Data *player = data;
286 RemixCount remaining = count, written = 0, n, playcount;
287 RemixPCM *d;
288
289 while (remaining > 0)
290 {
291 playcount = MIN(remaining, ALSA_PLAYER_BUFFERLEN);
292
293 d = &chunk->data[offset];
294 n = alsa_player_playbuffer(env, player, d, playcount);
295
296 if (n == -1) return -1;
297 else n /= sizeof(PLAYER_PCM);
298
299 offset += n;
300 written += n;
301 remaining -= n;
302 }
303 return written;
304}
305
306static RemixCount
307alsa_player_process(RemixEnv *env, RemixBase *base, RemixCount count, RemixStream *input, RemixStream *output __UNUSED__)
308{
309 Alsa_Player_Data *player_data = remix_base_get_instance_data(env, base);
310 RemixCount nr_channels = remix_stream_nr_channels(env, input);
311 RemixCount remaining = count, processed = 0, n, nn;
312
313 if ((nr_channels == 1) && (player_data->stereo == 0))
314 { /*MONO*/
315 return remix_stream_chunkfuncify(env, input, count,
316 alsa_player_chunk, player_data);
317 }
318 else if ((nr_channels == 2) && (player_data->stereo == 1))
319 { /*STEREO*/
320 while (remaining > 0)
321 {
322 n = MIN(remaining, ALSA_PLAYER_BUFFERLEN / 2);
323 n = remix_stream_interleave_2(env, input,
324 REMIX_CHANNEL_LEFT,
325 REMIX_CHANNEL_RIGHT,
326 player_data->databuffer, n);
327 nn = alsa_player_playbuffer(env, player_data,
328 player_data->databuffer, n);
329 processed += n;
330 remaining -= n;
331 }
332 return processed;
333 }
334 WRN("[alsa_player_process] unsupported stream/output channel "
335 "combination %ld / %d", nr_channels, player_data->stereo ? 2 : 1);
336 return -1;
337}
338
339static RemixCount
340alsa_player_length(RemixEnv *env __UNUSED__, RemixBase *base __UNUSED__)
341{
342 return REMIX_COUNT_INFINITE;
343}
344
345static RemixCount
346alsa_player_seek(RemixEnv *env __UNUSED__, RemixBase *base __UNUSED__, RemixCount count __UNUSED__)
347{
348 return count;
349}
350
351static int
352alsa_player_flush(RemixEnv *env, RemixBase *base)
353{
354 alsa_player_reset_device(env, base);
355 return 0;
356}
357
358static struct _RemixMethods _alsa_player_methods =
359{
360 alsa_player_clone,
361 alsa_player_destroy,
362 alsa_player_ready,
363 alsa_player_prepare,
364 alsa_player_process,
365 alsa_player_length,
366 alsa_player_seek,
367 alsa_player_flush,
368};
369
370static RemixBase *
371alsa_player_optimise(RemixEnv *env, RemixBase *base)
372{
373 remix_base_set_methods(env, base, &_alsa_player_methods);
374 return base;
375}
376
377static struct _RemixMetaText alsa_player_metatext =
378{
379 "alsa_snd_player",
380 "ALSA sound player for Remix",
381 "Output the audio stream into ALSA Driver",
382 "Copyright (C) 2011, Samsung Electronics Co., Ltd.",
383 "http://www.samsung.com",
384 REMIX_ONE_AUTHOR("Govindaraju SM", "prince.dubey@samsung.com"),
385};
386
387static struct _RemixPlugin alsa_player_plugin =
388{
389 &alsa_player_metatext,
390 REMIX_FLAGS_NONE,
391 CD_EMPTY_SET, /* init scheme */
392 alsa_player_init,
393 CD_EMPTY_SET, /* process scheme */
394 NULL, /* suggests */
395 NULL, /* plugin data */
396 NULL /* destroy */
397};
398
399EAPI CDList *
400remix_load(RemixEnv *env)
401{
402 CDList *plugins = cd_list_new(env);
403 plugins = cd_list_prepend(env, plugins, CD_POINTER(&alsa_player_plugin));
404 return plugins;
405}