]> git.alsa-project.org Git - alsa-lib.git/commitdiff
More pcm_jack plugin changes
authorJaroslav Kysela <perex@perex.cz>
Wed, 12 Feb 2003 21:57:49 +0000 (21:57 +0000)
committerJaroslav Kysela <perex@perex.cz>
Wed, 12 Feb 2003 21:57:49 +0000 (21:57 +0000)
aserver/Makefile.am
configure.in
include/pcm.h
include/pcm_plugin.h
src/Makefile.am
src/control/control.c
src/pcm/pcm_plug.c

index 5b88a747cf89ad2a958c10d9b30d3661bd08a7d3..32caa5d43c37c32318e4ed472d57c537143db465 100644 (file)
@@ -1,8 +1,13 @@
+if HAVE_JACK
+JACK_LIB = -ljack
+else
+JACK_LIB =
+endif
 
 bin_PROGRAMS = aserver
 aserver_SOURCES = aserver.c
 # aserver_LDADD = -lasound
-aserver_LDADD = ../src/libasound.la
+aserver_LDADD = ../src/libasound.la $(JACK_LIB)
 
 all: aserver
 
index 5406d0c4554181a0820947fd121fda2a480f0f0f..4bcbeb7cc215c1f245e9edd9e6a8c586fff7dffe 100644 (file)
@@ -118,6 +118,19 @@ else
   AC_MSG_RESULT(no)
 fi
 
+dnl Check for jack...
+AC_MSG_CHECKING(for jack)
+AC_ARG_WITH(jack,
+  [  --with-jack             do you have installed Jack Audio Connection Kit (optional)],
+  [  AC_DEFINE(HAVE_JACK, "1", [enabled])
+     jack=yes ],)
+if test "$jack" = "yes" ; then
+  AC_MSG_RESULT(yes)
+else
+  AC_MSG_RESULT(no)
+fi
+AM_CONDITIONAL(HAVE_JACK, test x$jack = xyes)
+
 dnl Check for architecture
 AC_MSG_CHECKING(for architecture)
 case "$target" in
index 880c749df9a5d155769dd5e3f7106ef56e9419c9..eb7a91b8f2c14840ca34800656959f6245f9af88 100644 (file)
@@ -347,7 +347,9 @@ enum _snd_pcm_type {
        /** LADSPA integration plugin */
        SND_PCM_TYPE_LADSPA,
        /** Direct Mixing plugin */
-       SND_PCM_TYPE_DMIX
+       SND_PCM_TYPE_DMIX,
+       /** Jack Audio Connection Kit plugin */
+       SND_PCM_TYPE_JACK,
 };
 
 /** PCM type */
index 5db88d89d4158c0e42345bdf589ace69ac040162..17f19cfca9fca6fb4887e812b00dd794cea508d5 100644 (file)
@@ -183,6 +183,16 @@ int _snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name,
                         snd_config_t *root, snd_config_t *conf,
                         snd_pcm_stream_t stream, int mode);
 
+/*
+ *  Jack plugin
+ */
+int snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name,
+                     snd_pcm_stream_t stream, int mode);
+int _snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name,
+                       snd_config_t *root, snd_config_t *conf,
+                       snd_pcm_stream_t stream, int mode);
+
+
 /** \} */
 
 #endif /* __ALSA_PCM_PLUGIN_H */
index 95c7c587e9e2432e1f23fc4a95a1effa0d63cbf4..1a7d7dfde280b9d80596eb419e63c22bcae52187 100644 (file)
@@ -2,12 +2,18 @@ SUBDIRS=control mixer pcm rawmidi timer hwdep seq instr compat conf
 EXTRA_DIST=Versions
 COMPATNUM=@LIBTOOL_VERSION_INFO@
 
+if HAVE_JACK
+JACK_LIB = -ljack
+else
+JACK_LIB =
+endif
+
 lib_LTLIBRARIES = libasound.la
 libasound_la_SOURCES = conf.c confmisc.c input.c output.c async.c error.c dlmisc.c
 libasound_la_LIBADD = control/libcontrol.la mixer/libmixer.la pcm/libpcm.la \
                       rawmidi/librawmidi.la timer/libtimer.la \
                      hwdep/libhwdep.la seq/libseq.la instr/libinstr.la \
-                     compat/libcompat.la -lm -ldl -lpthread
+                     compat/libcompat.la -lm -ldl -lpthread $(JACK_LIB)
 
 libasound_la_LDFLAGS = -version-info $(COMPATNUM)
 LDFLAGS = -Wl,--version-script=Versions
index 29c81434f7337346c03a84aa89f12dbbd791e52e..f589202d4547ed82f4fcfd7079f24269a7e47231 100644 (file)
@@ -512,7 +512,7 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name,
 #ifndef PIC
        extern void *snd_control_open_symbols(void);
 #endif
-       void *h;
+       void *h = NULL;
        if (snd_config_get_type(ctl_conf) != SND_CONFIG_TYPE_COMPOUND) {
                if (name)
                        SNDERR("Invalid type for CTL %s definition", name);
index 6328d1475e69b849c4cbf7a5c00bef4e74597156..e2b0396195308d439583ac53f5227d1e6fe633d7 100644 (file)
@@ -627,9 +627,9 @@ static int snd_pcm_plug_hw_refine_cprepare(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_
 static int snd_pcm_plug_hw_refine_sprepare(snd_pcm_t *pcm, snd_pcm_hw_params_t *sparams)
 {
        snd_pcm_plug_t *plug = pcm->private_data;
-       _snd_pcm_hw_params_any(sparams);
        int err;
        
+       _snd_pcm_hw_params_any(sparams);
        if (plug->sformat >= 0) {
                _snd_pcm_hw_params_set_format(sparams, plug->sformat);
                _snd_pcm_hw_params_set_subformat(sparams, SND_PCM_SUBFORMAT_STD);