OBS User unknown 2008-03-03 15:21:31 +00:00 committed by Git OBS Bridge
parent b754b9f4c5
commit 81799e8f82
3 changed files with 758 additions and 3 deletions

View File

@ -1,6 +1,374 @@
diff -r b1dfac5a4d55 configure.in
--- a/configure.in Tue Feb 05 10:08:09 2008 +0100
+++ b/configure.in Mon Mar 03 10:13:04 2008 +0100
@@ -575,8 +575,8 @@ if test ! -L "$srcdir"/include/alsa ; th
ln -sf . "$srcdir"/include/alsa
fi
-AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile include/Makefile
- include/sound/Makefile src/Versions src/Makefile \
+AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
+ include/Makefile include/sound/Makefile src/Versions src/Makefile \
src/control/Makefile src/mixer/Makefile \
src/pcm/Makefile src/pcm/scopes/Makefile \
src/rawmidi/Makefile src/timer/Makefile \
diff -r b1dfac5a4d55 doc/Makefile.am
--- a/doc/Makefile.am Tue Feb 05 10:08:09 2008 +0100
+++ b/doc/Makefile.am Mon Mar 03 10:13:04 2008 +0100
@@ -5,6 +5,7 @@ INCLUDES=-I$(top_srcdir)/include
INCLUDES=-I$(top_srcdir)/include
doc:
+ test -e doxygen.cfg || sed s:@top_srcdir@:..:g doxygen.cfg.in > doxygen.cfg
doxygen doxygen.cfg
doc-pack: doc
diff -r b1dfac5a4d55 doc/doxygen.cfg
--- a/doc/doxygen.cfg Tue Feb 05 10:08:09 2008 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-PROJECT_NAME = "ALSA project - the C library reference"
-OUTPUT_DIRECTORY = doxygen
-GENERATE_LATEX = NO
-GENERATE_MAN = NO
-GENERATE_RTF = NO
-
-CASE_SENSE_NAMES = NO
-INPUT = index.doxygen \
- ../include/asoundlib.h \
- ../include/version.h \
- ../include/global.h \
- ../include/asoundef.h \
- ../include/input.h \
- ../include/output.h \
- ../include/error.h \
- ../include/conf.h \
- ../include/control.h \
- ../include/pcm.h \
- ../include/rawmidi.h \
- ../include/timer.h \
- ../include/hwdep.h \
- ../include/seq.h \
- ../include/seq_event.h \
- ../include/seqmid.h \
- ../include/seq_midi_event.h \
- ../include/pcm_external.h \
- ../include/pcm_extplug.h \
- ../include/pcm_ioplug.h \
- ../include/control_external.h \
- ../include/mixer.h \
- ../src/error.c \
- ../src/dlmisc.c \
- ../src/async.c \
- ../src/input.c \
- ../src/output.c \
- ../src/conf.c \
- ../src/confmisc.c \
- ../src/names.c \
- ../src/shmarea.c \
- ../src/userfile.c \
- ../src/control \
- ../src/mixer \
- ../src/pcm/pcm.c \
- ../src/pcm/pcm_mmap.c \
- ../src/pcm/pcm_plugin.c \
- ../src/pcm/pcm_hw.c \
- ../src/pcm/pcm_mmap_emul.c \
- ../src/pcm/pcm_shm.c \
- ../src/pcm/pcm_null.c \
- ../src/pcm/pcm_copy.c \
- ../src/pcm/pcm_linear.c \
- ../src/pcm/pcm_lfloat.c \
- ../src/pcm/pcm_mulaw.c \
- ../src/pcm/pcm_alaw.c \
- ../src/pcm/pcm_adpcm.c \
- ../src/pcm/pcm_route.c \
- ../src/pcm/pcm_rate.c \
- ../src/pcm/pcm_plug.c \
- ../src/pcm/pcm_file.c \
- ../src/pcm/pcm_multi.c \
- ../src/pcm/pcm_share.c \
- ../src/pcm/pcm_hooks.c \
- ../src/pcm/pcm_dmix.c \
- ../src/pcm/pcm_dshare.c \
- ../src/pcm/pcm_dsnoop.c \
- ../src/pcm/pcm_meter.c \
- ../src/pcm/pcm_ladspa.c \
- ../src/pcm/pcm_asym.c \
- ../src/pcm/pcm_iec958.c \
- ../src/pcm/pcm_softvol.c \
- ../src/pcm/pcm_extplug.c \
- ../src/pcm/pcm_ioplug.c \
- ../src/pcm/pcm_empty.c \
- ../src/pcm/pcm_misc.c \
- ../src/pcm/pcm_simple.c \
- ../src/rawmidi \
- ../src/timer \
- ../src/hwdep \
- ../src/seq
-EXCLUDE = ../src/control/control_local.h \
- ../src/pcm/atomic.h \
- ../src/pcm/interval.h \
- ../src/pcm/interval_inline.h \
- ../src/pcm/mask.h \
- ../src/pcm/mask_inline.h \
- ../src/pcm/pcm_local.h \
- ../src/pcm/pcm_meter.h \
- ../src/pcm/pcm_plugin.h \
- ../src/pcm/plugin_ops.h \
- ../src/pcm/ladspa.h \
- ../src/hwdep/hwdep_local.h \
- ../src/mixer/mixer_local.h \
- ../src/rawmidi/rawmidi_local.h \
- ../src/seq/seq_local.h
-RECURSIVE = YES
-FILE_PATTERNS = *.c *.h
-EXAMPLE_PATH = ../test
-IMAGE_PATH = pictures
-QUIET = YES
-
-EXTRACT_ALL = NO
-EXTRACT_STATIC = NO
-SHOW_INCLUDE_FILES = NO
-JAVADOC_AUTOBRIEF = NO
-INHERIT_DOCS = YES
-ENABLED_SECTIONS = ""
-MACRO_EXPANSION = YES
-EXPAND_ONLY_PREDEF = YES
-PREDEFINED = DOXYGEN PIC "DOC_HIDDEN" \
- "ATTRIBUTE_UNUSED=" \
- ALSA_PCM_NEW_HW_PARAMS_API \
- _POSIX_C_SOURCE \
- "use_default_symbol_version(x,y,z)=" \
- "link_warning(x,y)="
-
-OPTIMIZE_OUTPUT_FOR_C = YES # doxygen 1.2.6 option
-
-#INPUT_FILTER = inputfilter
-#FILTER_SOURCE_FILES = YES
diff -r b1dfac5a4d55 doc/doxygen.cfg.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/doxygen.cfg.in Mon Mar 03 10:13:04 2008 +0100
@@ -0,0 +1,119 @@
+PROJECT_NAME = "ALSA project - the C library reference"
+OUTPUT_DIRECTORY = doxygen
+GENERATE_LATEX = NO
+GENERATE_MAN = NO
+GENERATE_RTF = NO
+
+CASE_SENSE_NAMES = NO
+INPUT = @top_srcdir@/doc/index.doxygen \
+ @top_srcdir@/include/asoundlib.h \
+ @top_srcdir@/include/version.h \
+ @top_srcdir@/include/global.h \
+ @top_srcdir@/include/asoundef.h \
+ @top_srcdir@/include/input.h \
+ @top_srcdir@/include/output.h \
+ @top_srcdir@/include/error.h \
+ @top_srcdir@/include/conf.h \
+ @top_srcdir@/include/control.h \
+ @top_srcdir@/include/pcm.h \
+ @top_srcdir@/include/rawmidi.h \
+ @top_srcdir@/include/timer.h \
+ @top_srcdir@/include/hwdep.h \
+ @top_srcdir@/include/seq.h \
+ @top_srcdir@/include/seq_event.h \
+ @top_srcdir@/include/seqmid.h \
+ @top_srcdir@/include/seq_midi_event.h \
+ @top_srcdir@/include/pcm_external.h \
+ @top_srcdir@/include/pcm_extplug.h \
+ @top_srcdir@/include/pcm_ioplug.h \
+ @top_srcdir@/include/control_external.h \
+ @top_srcdir@/include/mixer.h \
+ @top_srcdir@/src/error.c \
+ @top_srcdir@/src/dlmisc.c \
+ @top_srcdir@/src/async.c \
+ @top_srcdir@/src/input.c \
+ @top_srcdir@/src/output.c \
+ @top_srcdir@/src/conf.c \
+ @top_srcdir@/src/confmisc.c \
+ @top_srcdir@/src/names.c \
+ @top_srcdir@/src/shmarea.c \
+ @top_srcdir@/src/userfile.c \
+ @top_srcdir@/src/control \
+ @top_srcdir@/src/mixer \
+ @top_srcdir@/src/pcm/pcm.c \
+ @top_srcdir@/src/pcm/pcm_mmap.c \
+ @top_srcdir@/src/pcm/pcm_plugin.c \
+ @top_srcdir@/src/pcm/pcm_hw.c \
+ @top_srcdir@/src/pcm/pcm_mmap_emul.c \
+ @top_srcdir@/src/pcm/pcm_shm.c \
+ @top_srcdir@/src/pcm/pcm_null.c \
+ @top_srcdir@/src/pcm/pcm_copy.c \
+ @top_srcdir@/src/pcm/pcm_linear.c \
+ @top_srcdir@/src/pcm/pcm_lfloat.c \
+ @top_srcdir@/src/pcm/pcm_mulaw.c \
+ @top_srcdir@/src/pcm/pcm_alaw.c \
+ @top_srcdir@/src/pcm/pcm_adpcm.c \
+ @top_srcdir@/src/pcm/pcm_route.c \
+ @top_srcdir@/src/pcm/pcm_rate.c \
+ @top_srcdir@/src/pcm/pcm_plug.c \
+ @top_srcdir@/src/pcm/pcm_file.c \
+ @top_srcdir@/src/pcm/pcm_multi.c \
+ @top_srcdir@/src/pcm/pcm_share.c \
+ @top_srcdir@/src/pcm/pcm_hooks.c \
+ @top_srcdir@/src/pcm/pcm_dmix.c \
+ @top_srcdir@/src/pcm/pcm_dshare.c \
+ @top_srcdir@/src/pcm/pcm_dsnoop.c \
+ @top_srcdir@/src/pcm/pcm_meter.c \
+ @top_srcdir@/src/pcm/pcm_ladspa.c \
+ @top_srcdir@/src/pcm/pcm_asym.c \
+ @top_srcdir@/src/pcm/pcm_iec958.c \
+ @top_srcdir@/src/pcm/pcm_softvol.c \
+ @top_srcdir@/src/pcm/pcm_extplug.c \
+ @top_srcdir@/src/pcm/pcm_ioplug.c \
+ @top_srcdir@/src/pcm/pcm_empty.c \
+ @top_srcdir@/src/pcm/pcm_misc.c \
+ @top_srcdir@/src/pcm/pcm_simple.c \
+ @top_srcdir@/src/rawmidi \
+ @top_srcdir@/src/timer \
+ @top_srcdir@/src/hwdep \
+ @top_srcdir@/src/seq
+EXCLUDE = @top_srcdir@/src/control/control_local.h \
+ @top_srcdir@/src/pcm/atomic.h \
+ @top_srcdir@/src/pcm/interval.h \
+ @top_srcdir@/src/pcm/interval_inline.h \
+ @top_srcdir@/src/pcm/mask.h \
+ @top_srcdir@/src/pcm/mask_inline.h \
+ @top_srcdir@/src/pcm/pcm_local.h \
+ @top_srcdir@/src/pcm/pcm_meter.h \
+ @top_srcdir@/src/pcm/pcm_plugin.h \
+ @top_srcdir@/src/pcm/plugin_ops.h \
+ @top_srcdir@/src/pcm/ladspa.h \
+ @top_srcdir@/src/hwdep/hwdep_local.h \
+ @top_srcdir@/src/mixer/mixer_local.h \
+ @top_srcdir@/src/rawmidi/rawmidi_local.h \
+ @top_srcdir@/src/seq/seq_local.h
+RECURSIVE = YES
+FILE_PATTERNS = *.c *.h
+EXAMPLE_PATH = @top_srcdir@/test
+IMAGE_PATH = pictures
+QUIET = YES
+
+EXTRACT_ALL = NO
+EXTRACT_STATIC = NO
+SHOW_INCLUDE_FILES = NO
+JAVADOC_AUTOBRIEF = NO
+INHERIT_DOCS = YES
+ENABLED_SECTIONS = ""
+MACRO_EXPANSION = YES
+EXPAND_ONLY_PREDEF = YES
+PREDEFINED = DOXYGEN PIC "DOC_HIDDEN" \
+ "ATTRIBUTE_UNUSED=" \
+ ALSA_PCM_NEW_HW_PARAMS_API \
+ _POSIX_C_SOURCE \
+ "use_default_symbol_version(x,y,z)=" \
+ "link_warning(x,y)="
+
+OPTIMIZE_OUTPUT_FOR_C = YES # doxygen 1.2.6 option
+
+#INPUT_FILTER = inputfilter
+#FILTER_SOURCE_FILES = YES
diff -r b1dfac5a4d55 include/asoundef.h
--- a/include/asoundef.h Tue Feb 05 10:08:09 2008 +0100
+++ b/include/asoundef.h Mon Mar 03 10:13:04 2008 +0100
@@ -121,6 +121,14 @@ extern "C" {
#define IEC958_AES3_CON_CLOCK_1000PPM (0<<4) /**< 1000 ppm */
#define IEC958_AES3_CON_CLOCK_50PPM (1<<4) /**< 50 ppm */
#define IEC958_AES3_CON_CLOCK_VARIABLE (2<<4) /**< variable pitch */
+#define IEC958_AES4_CON_MAX_WORDLEN_24 (1<<0) /**< 0 = 20-bit, 1 = 24-bit */
+#define IEC958_AES4_CON_WORDLEN (7<<1) /**< mask - sample word length */
+#define IEC958_AES4_CON_WORDLEN_NOTID (0<<1) /**< not indicated */
+#define IEC958_AES4_CON_WORDLEN_20_16 (1<<1) /**< 20-bit or 16-bit */
+#define IEC958_AES4_CON_WORDLEN_22_18 (2<<1) /**< 22-bit or 18-bit */
+#define IEC958_AES4_CON_WORDLEN_23_19 (4<<1) /**< 23-bit or 19-bit */
+#define IEC958_AES4_CON_WORDLEN_24_20 (5<<1) /**< 24-bit or 20-bit */
+#define IEC958_AES4_CON_WORDLEN_21_17 (6<<1) /**< 21-bit or 17-bit */
/** \} */
diff -r b1dfac5a4d55 include/iatomic.h
--- a/include/iatomic.h Tue Feb 05 10:08:09 2008 +0100
+++ b/include/iatomic.h Mon Mar 03 10:13:04 2008 +0100
@@ -1010,6 +1010,75 @@ static __inline__ void atomic_clear_mask
#endif /* __arm__ */
+#ifdef __sh__
+
+typedef struct { volatile int counter; } atomic_t;
+
+#define ATOMIC_INIT(i) { (i) }
+
+#define atomic_read(v) ((v)->counter)
+#define atomic_set(v,i) (((v)->counter) = (i))
+
+#define atomic_dec_return(v) atomic_sub_return(1,(v))
+#define atomic_inc_return(v) atomic_add_return(1,(v))
+
+#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
+#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
+#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) != 0)
+
+#define atomic_add(i,v) atomic_add_return((i),(v))
+#define atomic_sub(i,v) atomic_sub_return((i),(v))
+#define atomic_inc(v) atomic_add(1,(v))
+#define atomic_dec(v) atomic_sub(1,(v))
+
+static __inline__ int atomic_add_return(int i, volatile atomic_t *v)
+{
+ int result;
+
+ asm volatile (
+ " .align 2\n"
+ " mova 99f, r0\n"
+ " mov r15, r1\n"
+ " mov #-6, r15\n"
+ " mov.l @%2, %0\n"
+ " add %1, %0\n"
+ " mov.l %0, @%2\n"
+ "99: mov r1, r15"
+ : "=&r"(result)
+ : "r"(i), "r"(v)
+ : "r0", "r1");
+
+ return result;
+}
+
+static __inline__ int atomic_sub_return(int i, volatile atomic_t *v)
+{
+ int result;
+
+ asm volatile (
+ " .align 2\n"
+ " mova 99f, r0\n"
+ " mov r15, r1\n"
+ " mov #-6, r15\n"
+ " mov.l @%2, %0\n"
+ " sub %1, %0\n"
+ " mov.l %0, @%2\n"
+ "99: mov r1, r15"
+ : "=&r"(result)
+ : "r"(i), "r"(v)
+ : "r0", "r1");
+
+ return result;
+}
+
+#define mb() __asm__ __volatile__ ("" : : : "memory")
+#define rmb() mb()
+#define wmb() mb()
+
+#define IATOMIC_DEFINED 1
+
+#endif /* __sh__ */
+
#ifndef IATOMIC_DEFINED
/*
* non supported architecture.
diff -r b1dfac5a4d55 include/pcm.h
--- a/include/pcm.h Tue Feb 05 10:08:09 2008 +0100
+++ b/include/pcm.h Wed Feb 13 12:48:53 2008 +0100
+++ b/include/pcm.h Mon Mar 03 10:13:04 2008 +0100
@@ -1105,6 +1105,8 @@ int snd_pcm_sw_params_get_xfer_align(con
int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) __attribute__((deprecated));
int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val) __attribute__((deprecated));
@ -19,3 +387,373 @@ diff -r b1dfac5a4d55 include/pcm.h
/** \} */
diff -r b1dfac5a4d55 include/seq.h
--- a/include/seq.h Tue Feb 05 10:08:09 2008 +0100
+++ b/include/seq.h Mon Mar 03 10:13:04 2008 +0100
@@ -152,6 +152,11 @@ void snd_seq_client_info_set_broadcast_f
void snd_seq_client_info_set_broadcast_filter(snd_seq_client_info_t *info, int val);
void snd_seq_client_info_set_error_bounce(snd_seq_client_info_t *info, int val);
void snd_seq_client_info_set_event_filter(snd_seq_client_info_t *info, unsigned char *filter);
+
+void snd_seq_client_info_event_filter_clear(snd_seq_client_info_t *info);
+void snd_seq_client_info_event_filter_add(snd_seq_client_info_t *info, int event_type);
+void snd_seq_client_info_event_filter_del(snd_seq_client_info_t *info, int event_type);
+int snd_seq_client_info_event_filter_check(snd_seq_client_info_t *info, int event_type);
int snd_seq_get_client_info(snd_seq_t *handle, snd_seq_client_info_t *info);
int snd_seq_get_any_client_info(snd_seq_t *handle, int client, snd_seq_client_info_t *info);
@@ -575,6 +580,7 @@ int snd_seq_remove_events(snd_seq_t *han
*/
void snd_seq_set_bit(int nr, void *array);
+void snd_seq_unset_bit(int nr, void *array);
int snd_seq_change_bit(int nr, void *array);
int snd_seq_get_bit(int nr, void *array);
diff -r b1dfac5a4d55 include/sound/asound.h
--- a/include/sound/asound.h Tue Feb 05 10:08:09 2008 +0100
+++ b/include/sound/asound.h Mon Mar 03 10:13:04 2008 +0100
@@ -59,6 +59,7 @@
#ifndef __KERNEL__
#include <sys/time.h>
#include <sys/types.h>
+#include <sys/ioctl.h>
#endif
/*
diff -r b1dfac5a4d55 src/conf/cards/NFORCE.conf
--- a/src/conf/cards/NFORCE.conf Tue Feb 05 10:08:09 2008 +0100
+++ b/src/conf/cards/NFORCE.conf Mon Mar 03 10:13:04 2008 +0100
@@ -171,6 +171,79 @@ NFORCE.pcm.surround51.0 {
}
}
+<confdir:pcm/surround71.conf>
+
+NFORCE.pcm.surround71.0 {
+ @args [ CARD ]
+ @args.CARD {
+ type string
+ }
+ type softvol
+ slave.pcm {
+ type route
+ ttable.0.0 1
+ ttable.1.1 1
+ ttable.2.4 1
+ ttable.3.5 1
+ ttable.4.2 1
+ ttable.5.3 1
+ ttable.6.6 1
+ ttable.7.7 1
+ slave.pcm {
+ type hooks
+ slave.pcm {
+ type hw
+ card $CARD
+ device 0
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {
+ name "Channel Mode"
+ preserve true
+ value "8ch"
+ lock true
+ optional true
+ }
+ # for old drivers
+ {
+ name "Line-In As Surround"
+ preserve true
+ value true
+ optional true
+ }
+ {
+ name "Mic As Center/LFE"
+ preserve true
+ value true
+ optional true
+ }
+ {
+ name "Surround Down Mix"
+ preserve true
+ value off
+ lock true
+ optional true
+ }
+ {
+ name "Center/LFE Down Mix"
+ preserve true
+ value off
+ lock true
+ optional true
+ }
+ ]
+ }
+ }
+ slave.channels 8
+ }
+ control {
+ name "PCM Playback Volume"
+ card $CARD
+ }
+}
+
<confdir:pcm/iec958.conf>
NFORCE.pcm.iec958.0 {
diff -r b1dfac5a4d55 src/pcm/pcm_ioplug.c
--- a/src/pcm/pcm_ioplug.c Tue Feb 05 10:08:09 2008 +0100
+++ b/src/pcm/pcm_ioplug.c Mon Mar 03 10:13:04 2008 +0100
@@ -484,7 +484,7 @@ static int snd_pcm_ioplug_pause(snd_pcm_
{
ioplug_priv_t *io = pcm->private_data;
static snd_pcm_state_t states[2] = {
- SND_PCM_STATE_PAUSED, SND_PCM_STATE_RUNNING
+ SND_PCM_STATE_RUNNING, SND_PCM_STATE_PAUSED
};
int prev, err;
diff -r b1dfac5a4d55 src/seq/seq.c
--- a/src/seq/seq.c Tue Feb 05 10:08:09 2008 +0100
+++ b/src/seq/seq.c Mon Mar 03 10:13:04 2008 +0100
@@ -1522,11 +1522,17 @@ int snd_seq_client_info_get_error_bounce
}
/**
- * \brief Get the event filter bitmap of a client_info container
+ * \brief (DEPRECATED) Get the event filter bitmap of a client_info container
* \param info client_info container
* \return NULL if no event filter, or pointer to event filter bitmap
*
- * \sa snd_seq_get_client_info(), snd_seq_client_info_set_event_filter()
+ * Use #snd_seq_client_info_event_filter_check() instead.
+ *
+ * \sa snd_seq_client_info_event_filter_add(),
+ * snd_seq_client_info_event_filter_del(),
+ * snd_seq_client_info_event_filter_check(),
+ * snd_seq_client_info_event_filter_clear(),
+ * snd_seq_get_client_info()
*/
const unsigned char *snd_seq_client_info_get_event_filter(const snd_seq_client_info_t *info)
{
@@ -1538,6 +1544,87 @@ const unsigned char *snd_seq_client_info
}
/**
+ * \brief Disable event filtering of a client_info container
+ * \param info client_info container
+ *
+ * Remove all event types added with #snd_seq_client_info_event_filter_add and clear
+ * the event filtering flag of this client_info container.
+ *
+ * \sa snd_seq_client_info_event_filter_add(),
+ * snd_seq_client_info_event_filter_del(),
+ * snd_seq_client_info_event_filter_check(),
+ * snd_seq_get_client_info(),
+ * snd_seq_set_client_info()
+ */
+void snd_seq_client_info_event_filter_clear(snd_seq_client_info_t *info)
+{
+ assert(info);
+ info->filter &= ~SNDRV_SEQ_FILTER_USE_EVENT;
+ memset(info->event_filter, 0, sizeof(info->event_filter));
+}
+
+/**
+ * \brief Add an event type to the event filtering of a client_info container
+ * \param info client_info container
+ * \param event_type event type to be added
+ *
+ * Set the event filtering flag of this client_info and add the specified event type to the
+ * filter bitmap of this client_info container.
+ *
+ * \sa snd_seq_get_client_info(),
+ * snd_seq_set_client_info(),
+ * snd_seq_client_info_event_filter_del(),
+ * snd_seq_client_info_event_filter_check(),
+ * snd_seq_client_info_event_filter_clear()
+ */
+void snd_seq_client_info_event_filter_add(snd_seq_client_info_t *info, int event_type)
+{
+ assert(info);
+ info->filter |= SNDRV_SEQ_FILTER_USE_EVENT;
+ snd_seq_set_bit(event_type, info->event_filter);
+}
+
+/**
+ * \brief Remove an event type from the event filtering of a client_info container
+ * \param info client_info container
+ * \param event_type event type to be removed
+ *
+ * Removes the specified event from the filter bitmap of this client_info container. It will
+ * not clear the event filtering flag, use #snd_seq_client_info_event_filter_clear instead.
+ *
+ * \sa snd_seq_get_client_info(),
+ * snd_seq_set_client_info(),
+ * snd_seq_client_info_event_filter_add(),
+ * snd_seq_client_info_event_filter_check(),
+ * snd_seq_client_info_event_filter_clear()
+ */
+void snd_seq_client_info_event_filter_del(snd_seq_client_info_t *info, int event_type)
+{
+ assert(info);
+ snd_seq_unset_bit(event_type, info->event_filter);
+}
+
+/**
+ * \brief Check if an event type is present in the event filtering of a client_info container
+ * \param info client_info container
+ * \param event_type event type to be checked
+ * \return 1 if the event type is present, 0 otherwise
+ *
+ * Test if the event type is in the filter bitamp of this client_info container.
+ *
+ * \sa snd_seq_get_client_info(),
+ * snd_seq_set_client_info(),
+ * snd_seq_client_info_event_filter_add(),
+ * snd_seq_client_info_event_filter_del(),
+ * snd_seq_client_info_event_filter_clear()
+ */
+int snd_seq_client_info_event_filter_check(snd_seq_client_info_t *info, int event_type)
+{
+ assert(info);
+ return snd_seq_get_bit(event_type, info->event_filter);
+}
+
+/**
* \brief Get the number of opened ports of a client_info container
* \param info client_info container
* \return number of opened ports
@@ -1623,12 +1710,17 @@ void snd_seq_client_info_set_error_bounc
}
/**
- * \brief Set the event filter bitmap of a client_info container
- * \param info client_info container
- * \param filter event filter bitmap
- *
- * \sa snd_seq_get_client_info(), snd_seq_client_info_get_event_filger(),
- * snd_seq_set_client_event_filter()
+ * \brief (DEPRECATED) Set the event filter bitmap of a client_info container
+ * \param info client_info container
+ * \param filter event filter bitmap, pass NULL for no event filtering
+ *
+ * Use #snd_seq_client_info_event_filter_add instead.
+ *
+ * \sa snd_seq_client_info_event_filter_add(),
+ * snd_seq_client_info_event_filter_del(),
+ * snd_seq_client_info_event_filter_check(),
+ * snd_seq_client_info_event_filter_clear(),
+ * snd_seq_set_client_info()
*/
void snd_seq_client_info_set_event_filter(snd_seq_client_info_t *info, unsigned char *filter)
{
@@ -4663,6 +4755,14 @@ void snd_seq_set_bit(int nr, void *array
}
/**
+ * \brief unset a bit flag
+ */
+void snd_seq_unset_bit(int nr, void *array)
+{
+ ((unsigned int *)array)[nr >> 5] &= ~(1UL << (nr & 31));
+}
+
+/**
* \brief change a bit flag
*/
int snd_seq_change_bit(int nr, void *array)
@@ -4670,7 +4770,7 @@ int snd_seq_change_bit(int nr, void *arr
int result;
result = ((((unsigned int *)array)[nr >> 5]) & (1UL << (nr & 31))) ? 1 : 0;
- ((unsigned int *)array)[nr >> 5] |= 1UL << (nr & 31);
+ ((unsigned int *)array)[nr >> 5] ^= 1UL << (nr & 31);
return result;
}
diff -r b1dfac5a4d55 src/seq/seqmid.c
--- a/src/seq/seqmid.c Tue Feb 05 10:08:09 2008 +0100
+++ b/src/seq/seqmid.c Mon Mar 03 10:13:04 2008 +0100
@@ -251,8 +251,7 @@ int snd_seq_set_client_event_filter(snd_
if ((err = snd_seq_get_client_info(seq, &info)) < 0)
return err;
- info.filter |= SNDRV_SEQ_FILTER_USE_EVENT;
- snd_seq_set_bit(event_type, info.event_filter);
+ snd_seq_client_info_event_filter_add(&info, event_type);
return snd_seq_set_client_info(seq, &info);
}
diff -r b1dfac5a4d55 test/Makefile.am
--- a/test/Makefile.am Tue Feb 05 10:08:09 2008 +0100
+++ b/test/Makefile.am Mon Mar 03 10:13:04 2008 +0100
@@ -1,6 +1,6 @@ check_PROGRAMS=control pcm pcm_min laten
check_PROGRAMS=control pcm pcm_min latency seq \
playmidi1 timer rawmidi midiloop \
- oldapi queue_timer namehint
+ oldapi queue_timer namehint client_event_filter
control_LDADD=../src/libasound.la
pcm_LDADD=../src/libasound.la
@@ -14,6 +14,7 @@ oldapi_LDADD=../src/libasound.la
oldapi_LDADD=../src/libasound.la
queue_timer_LDADD=../src/libasound.la
namehint_LDADD=../src/libasound.la
+client_event_filter_LDADD=../src/libasound.la
code_CFLAGS=-Wall -pipe -g -O2
INCLUDES=-I$(top_srcdir)/include
diff -r b1dfac5a4d55 test/client_event_filter.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/client_event_filter.c Mon Mar 03 10:13:04 2008 +0100
@@ -0,0 +1,46 @@
+#include <alsa/asoundlib.h>
+
+void dump_event_filter(snd_seq_client_info_t *client_info) {
+ int i, b;
+
+ for (i = 0; i <= 255;) {
+ b = snd_seq_client_info_event_filter_check(client_info, i);
+ i++;
+ printf("%c%s%s", (b ? 'X' : '.'),
+ (i % 8 == 0 ? " " : ""),
+ (i % 32 == 0 ? "\n" : ""));
+ }
+ printf("\n");
+}
+
+int main(void) {
+ snd_seq_client_info_t *client_info;
+
+ snd_seq_client_info_alloca(&client_info);
+
+ printf("first client_info_event_filter :\n");
+ dump_event_filter(client_info);
+
+ snd_seq_client_info_event_filter_add(client_info, SND_SEQ_EVENT_NOTEON);
+ printf("after snd_seq_client_info_event_filter_add(client_info, SND_SEQ_EVENT_NOTEON);\n");
+ dump_event_filter(client_info);
+
+ snd_seq_client_info_event_filter_add(client_info, SND_SEQ_EVENT_PGMCHANGE);
+ printf("after snd_seq_client_info_event_filter_add(client_info, SND_SEQ_EVENT_PGMCHANGE);\n");
+ dump_event_filter(client_info);
+
+ snd_seq_client_info_event_filter_del(client_info, SND_SEQ_EVENT_NOTEON);
+ printf("after snd_seq_client_info_event_filter_del(client_info, SND_SEQ_EVENT_NOTEON);\n");
+ dump_event_filter(client_info);
+
+ snd_seq_client_info_event_filter_clear(client_info);
+ printf("after snd_seq_client_info_event_filter_clear(client_info);\n");
+ dump_event_filter(client_info);
+
+ snd_seq_client_info_event_filter_add(client_info, SND_SEQ_EVENT_NOTEON);
+ printf("after snd_seq_client_info_event_filter_add(client_info, SND_SEQ_EVENT_NOTEON);\n");
+ dump_event_filter(client_info);
+
+ return 0;
+}
+

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Mar 3 10:19:10 CET 2008 - tiwai@suse.de
- fix a typo in configure option --enable-symbolic-functions
- HG version (20080228):
* make doxygen.cfg dynamically (for other build source dir)
* snd_seq_client_*_event_filter() API
* Add surround7.1 config for Nvidia
* iatomic.h for SH arch
-------------------------------------------------------------------
Wed Feb 13 12:51:30 CET 2008 - tiwai@suse.de

View File

@ -22,7 +22,7 @@ PreReq: %insserv_prereq %fillup_prereq
AutoReqProv: on
Summary: Advanced Linux Sound Architecture
Version: 1.0.16
Release: 10
Release: 16
Source: ftp://ftp.alsa-project.org/pub/lib/alsa-lib-%{package_version}.tar.bz2
Source8: 40-alsa.rules
Source11: alsasound
@ -116,7 +116,7 @@ Authors:
autoreconf -fi
%configure \
--disable-static \
--enable-symbolic-functoins \
--enable-symbolic-functions \
--disable-aload \
--disable-alisp \
--disable-python
@ -250,6 +250,13 @@ exit 0
%{_datadir}/alsa
%changelog
* Mon Mar 03 2008 tiwai@suse.de
- fix a typo in configure option --enable-symbolic-functions
- HG version (20080228):
* make doxygen.cfg dynamically (for other build source dir)
* snd_seq_client_*_event_filter() API
* Add surround7.1 config for Nvidia
* iatomic.h for SH arch
* Wed Feb 13 2008 tiwai@suse.de
- fix the build of old programs that don't define *_OLD_API
properly