Debian Codegraph @

test/testaupv.c

raw
1 /*
2 Audio File Library
3
4 Copyright 1998, Michael Pruett <[email protected]>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21 /*
22 testaupv.c
23
24 This is a program to test the AUpvlist commands.
25 */
26
27 #ifdef __USE_SGI_HEADERS__
28 #include <dmedia/dm_audioutil.h>
29 #include <dmedia/audiofile.h>
30 #else
31 #include <audiofile.h>
32 #include <aupvlist.h>
33 #endif
34
35 #include <stdio.h>
36 #include <stdlib.h>
37
38 int main (int argc, char **argv)
39 {
40 AUpvlist list;
41 int size;
42 AFfilehandle file;
43
44 long fuck = 99;
45
46 if (argc != 2)
47 {
48 fprintf(stderr, "usage: testaupv filename\n");
49 exit(EXIT_FAILURE);
50 }
51
52 file = afOpenFile(argv[1], "r", NULL);
53
54 list = AUpvnew(4);
55 size = AUpvgetmaxitems(list);
56
57 printf("AUpvsetparam: %d\n", AUpvsetparam(list, 0, AF_INST_MIDI_BASENOTE));
58 printf("AUpvsetparam: %d\n", AUpvsetparam(list, 1, AF_INST_MIDI_LONOTE));
59 printf("AUpvsetparam: %d\n", AUpvsetparam(list, 2, AF_INST_SUSLOOPID));
60 printf("AUpvsetparam: %d\n", AUpvsetparam(list, 3, AF_INST_RELLOOPID));
61
62 afGetInstParams(file, AF_DEFAULT_INST, list, 4);
63
64 AUpvgetval(list, 0, &fuck);
65 printf("AUpvgetval: %ld\n", fuck);
66
67 AUpvgetval(list, 1, &fuck);
68 printf("AUpvgetval: %ld\n", fuck);
69
70 AUpvgetval(list, 2, &fuck);
71 printf("AUpvgetval: %ld\n", fuck);
72
73 AUpvgetval(list, 3, &fuck);
74 printf("AUpvgetval: %ld\n", fuck);
75
76 afCloseFile(file);
77
78 return 0;
79 }