syscomm.c
1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#include <sys/types.h>
#include <sys/prctl.h>
#include <sys/ipc.h>
#include <ultratypes.h>
#include <libaudio.h>
#include <stdio.h>
#include <stdlib.h>
#include "midiApp.h"
#include "midiDmon.h"
#include "midiGlobals.h"
#ifdef SYSEX_IMPL
#include <sysex.h>
#include <synthcommon.h>
#define LIST_INST_STR_LEN 16
#define LIST_SNDS_STR_LEN 11
int gNintendoID[2] = { _SYNTH_SYNTH_ID,_DESTINATION_ALL_ID};
void AckPresent(char *param)
{
int i;
for(i=0;i<gNumPorts;i++)
suSetBooleanMIDI(gMidiOutPort[i],0,gNintendoID,param,1);
}
void ReplyValue(char *param,u32 value)
{
int i;
for(i=0;i<gNumPorts;i++)
suSetNumberMIDI(gMidiOutPort[i],0,gNintendoID,param,(double)value);
}
void ReplyString(char *param,char *strPtr)
{
int i;
for(i=0;i<gNumPorts;i++)
suSetStringMIDI(gMidiOutPort[i],0,gNintendoID,param,strPtr);
}
void SendClassList(int class, char *param)
{
char *list;
int c;
printf("BuildingClassList, for class %d\n",class);
list = BuildClassList(class);
if(list)
{
list[400] = 0;
printf("Sending list: %s\n",list);
for(c=0;c<gNumPorts;c++)
suSetStringMIDI(gMidiOutPort[c],0,gNintendoID,param,list);
free(list);
}
else
printf("No List!\n");
}
void SendInstList(char *param)
{
char *list;
int c;
list = BuildInstList(param+LIST_INST_STR_LEN);
if(list)
{
/* list[400] = 0; */
for(c=0;c<gNumPorts;c++)
suSetStringMIDI(gMidiOutPort[c],0,gNintendoID,param,list);
free(list);
}
}
void SendSoundList(char *param)
{
char *list;
int c;
list = BuildSoundList(param+LIST_SNDS_STR_LEN);
if(list)
{
/* list[400] = 0; */
for(c=0;c<gNumPorts;c++)
suSetStringMIDI(gMidiOutPort[c],0,gNintendoID,param,list);
free(list);
}
}
#endif /* SYSEX_IMPL */