#include #include #include #include #include #include #include #include "snd_note1.h" /* This is the Note/1 control utility */ #define DEFAULT_DEVFILE "/dev/snd_noteone" int probe = 0, fd = -1; char* devfile = DEFAULT_DEVFILE; int main( int argc, char** argv ) { char c; while ( ( c = getopt( argc, argv, "pd:" ) ) != -1 ) { switch( c ) { case 'd': devfile = strdup( optarg ); break; case 'p': probe = 1; break; } } fd = open( devfile, O_RDWR ); if ( fd < 0 ) { printf( "Could not open %s!\n", devfile ); return -1; } if ( probe ) { printf( "Trying probe!\n" ); if ( ioctl( fd, NOTE1_IOCPROBE ) < 0 ) printf( "ioctl() error!\n" ); } close( fd ); return 0; }