Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kinetiknz/cubeb
Browse files Browse the repository at this point in the history
Conflicts:
	Makefile.am
  • Loading branch information
kinetiknz committed Sep 20, 2011
2 parents 690c0c0 + f09da0f commit 5d4669a
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 6 deletions.
24 changes: 21 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,33 @@ cubebinclude_HEADERS = include/cubeb/cubeb.h include/cubeb/cubeb-stdint.h

lib_LTLIBRARIES = src/libcubeb.la

src_libcubeb_la_SOURCES = \
src/cubeb_alsa.c
if PULSE
src_libcubeb_la_SOURCES = src/cubeb_pulse.c
endif
if ALSA
src_libcubeb_la_SOURCES = src/cubeb_alsa.c
endif
if COREAUDIO
src_libcubeb_la_SOURCES = src/cubeb_coreaudio.c
endif
if WAVE
src_libcubeb_la_SOURCES = src/cubeb_winmm.c
endif
if DSOUND
src_libcubeb_la_SOURCES = src/cubeb_directsound.c
endif

EXTRA_src_libcubeb_la_SOURCES = \
cubeb_alsa.c cubeb_pulse.c \
cubeb_coreaudio.c \
cubeb_directsound.c cubeb_winmm.c

src_libcubeb_la_LDFLAGS = -export-symbols-regex '^cubeb_'

check_PROGRAMS = test/test_sanity

test_test_sanity_SOURCES = test/test_sanity.c
test_test_sanity_LDADD = -lasound -lm src/libcubeb.la
test_test_sanity_LDADD = $(platform_lib) -lm src/libcubeb.la

TESTS = test/test_sanity

Expand Down
30 changes: 30 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,34 @@ AM_PROG_CC_C_O
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL

dnl Choose the target platform audio API
AC_CHECK_HEADERS([alsa/soundlib.h pulse/pulseaudio.h \
AudioToolbox/AudioToolbox.h \
windows.h dsound.h])
platform_api="none"
platform_lib="none"
if test $ac_cv_header_pulse_pulseaudio_h = yes; then
platform_api="pulse"
platform_lib="-lpulse"
elif test $ac_cv_header_alsa_soundlib_h = yes; then
platform_api="alsa"
platform_lib="-lpulse"
elif test $ac_cv_header_AudioToolbox_AudioToolbox_h = yes; then
platform_api="coreaudio"
platform_lib="-framework AudioToolbox"
elif test $ac_cv_header_windows_h = yes; then
if test $ac_cv_header_dsound_h = yes; then
platform_api="dsound"
else
platform_api="wave"
fi
fi
AM_CONDITIONAL([PULSE], [test ${platform_api} = "pulse"])
AM_CONDITIONAL([ALSA], [test ${platform_api} = "alsa"])
AM_CONDITIONAL([COREAUDIO], [test ${platform_api} = "coreaudio"])
AM_CONDITIONAL([DSOUND], [test ${platform_api} = "dsound"])
AM_CONDITIONAL([WAVE], [test ${platform_api} = "wave"])

dnl Check for doxygen
AC_ARG_ENABLE([doc],
AS_HELP_STRING([--enable-doc], [Build API documentation]),
Expand Down Expand Up @@ -78,6 +106,7 @@ dnl --------------------------------------------------

AC_SUBST(DEBUG)
AC_SUBST(PROFILE)
AC_SUBST(platform_lib)

AC_OUTPUT([
Makefile
Expand All @@ -104,6 +133,7 @@ AC_MSG_RESULT([
General configuration:
Platform API target: ........ ${platform_api}
API Documentation: .......... ${doc_build}
Installation paths:
Expand Down
6 changes: 3 additions & 3 deletions include/cubeb/cubeb.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ extern "C" {
cubeb_stream_init(app_ctx, &stm, "Example Stream 1", params,
250, data_cb, state_cb, NULL);
cubeb_start(stm);
cubeb_stream_start(stm);
for (;;) {
cubeb_get_time(stm, &ts);
printf("time=%lu\n", ts);
sleep(1);
}
cubeb_stop(stm);
cubeb_stream_stop(stm);
cubeb_stream_destroy(stm);
cubeb_destroy(app_ctx);
@endcode
@code
int data_cb(cubeb_stream * stm, void * user, void * buffer, size_t nframes)
long data_cb(cubeb_stream * stm, void * user, void * buffer, long nframes)
{
short * buf = buffer;
for (i = 0; i < nframes; ++i) {
Expand Down

0 comments on commit 5d4669a

Please sign in to comment.