syscomm.c 1.9 KB
#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 */