Update of /cvsroot/alsa/alsa-driver/test
In directory sc8-pr-cvs1:/tmp/cvs-serv23752
Modified Files:
Makefile
Added Files:
seq1.c seq2.c
Log Message:
Added seq1.c and seq2.c
--- NEW FILE: seq1.c ---
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <linux/soundcard.h>
#define DEVICE "/dev/sequencer"
int main(void)
{
int fd;
ssize_t res;
unsigned char ev[4];
fd = open(DEVICE, O_RDWR);
if (fd < 0) { perror( "open (" DEVICE ")" ); return EXIT_FAILURE; }
while ((res = read(fd, &ev, sizeof(ev))) == sizeof(ev)) {
printf("read event: bytes = 0x%x,0x%x,0x%x,0x%x\n", ev[0], ev[1],
ev[2], ev[3]);
}
printf("end res = %li\n", (long)res);
close(fd);
return EXIT_SUCCESS;
}
--- NEW FILE: seq2.c ---
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <linux/soundcard.h>
#define DEVICE "/dev/sequencer"
int main(int argc, char *argv[])
{
int fd;
ssize_t res;
unsigned char ev[4];
fd = open(DEVICE, O_RDWR);
if (fd < 0) { perror( "open (" DEVICE ")" ); return EXIT_FAILURE; }
ev[0] = SEQ_MIDIPUTC;
ev[1] = 0xfe; /* active sensing */
ev[2] = argc > 1 ? atoi(argv[1]) : 0;
res = write(fd, &ev, sizeof(ev));
printf("end res = %li\n", (long)res);
close(fd);
return EXIT_SUCCESS;
}
Index: Makefile
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/test/Makefile,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Makefile 13 Aug 2002 16:25:36 -0000 1.7
+++ Makefile 11 Mar 2003 18:19:42 -0000 1.8
@@ -16,5 +16,11 @@
mmap_test: mmap_test.c
$(CC) $(CFLAGS) -DVERBOSE -o mmap_test mmap_test.c -lm
+seq1: seq1.c
+ $(CC) $(CFLAGS) -DVERBOSE -o seq1 seq1.c
+
+seq2: seq2.c
+ $(CC) $(CFLAGS) -DVERBOSE -o seq2 seq2.c
+
clean:
rm -f *.o $(TARGETS) *~
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog