mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
add a test code for snd_seq_client_info_event_filter_*()
Added test code for
snd_seq_client_info_event_filter_{clear,add,del,check}
Signed-off-by: Aldrin Martoq <amartoq@dcc.uchile.cl>
This commit is contained in:
parent
75ecdac6f4
commit
83c5a60778
2 changed files with 48 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
check_PROGRAMS=control pcm pcm_min latency seq \
|
check_PROGRAMS=control pcm pcm_min latency seq \
|
||||||
playmidi1 timer rawmidi midiloop \
|
playmidi1 timer rawmidi midiloop \
|
||||||
oldapi queue_timer namehint
|
oldapi queue_timer namehint client_event_filter
|
||||||
|
|
||||||
control_LDADD=../src/libasound.la
|
control_LDADD=../src/libasound.la
|
||||||
pcm_LDADD=../src/libasound.la
|
pcm_LDADD=../src/libasound.la
|
||||||
|
|
@ -14,6 +14,7 @@ midiloop_LDADD=../src/libasound.la
|
||||||
oldapi_LDADD=../src/libasound.la
|
oldapi_LDADD=../src/libasound.la
|
||||||
queue_timer_LDADD=../src/libasound.la
|
queue_timer_LDADD=../src/libasound.la
|
||||||
namehint_LDADD=../src/libasound.la
|
namehint_LDADD=../src/libasound.la
|
||||||
|
client_event_filter_LDADD=../src/libasound.la
|
||||||
code_CFLAGS=-Wall -pipe -g -O2
|
code_CFLAGS=-Wall -pipe -g -O2
|
||||||
|
|
||||||
INCLUDES=-I$(top_srcdir)/include
|
INCLUDES=-I$(top_srcdir)/include
|
||||||
|
|
|
||||||
46
test/client_event_filter.c
Normal file
46
test/client_event_filter.c
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue