|
|
| version 1.1.1.1, 2003/10/16 17:58:45 | version 1.3, 2003/10/25 09:08:24 |
|---|---|
| Line 2 | Line 2 |
| #include "np2.h" | #include "np2.h" |
| #include "mimpidef.h" | #include "mimpidef.h" |
| #include "commng.h" | #include "commng.h" |
| #include "keydisp.h" | |
| #if defined(VERMOUTH_LIB) | #if defined(VERMOUTH_LIB) |
| #include "sound.h" | #include "sound.h" |
| #include "vermouth.h" | #include "vermouth.h" |
| #endif | #endif |
| #include "keydisp.h" | |
| #if defined(VERMOUTH_LIB) | #if defined(VERMOUTH_LIB) |
| Line 83 struct _cmmidi; | Line 83 struct _cmmidi; |
| typedef struct _cmmidi _CMMIDI; | typedef struct _cmmidi _CMMIDI; |
| typedef struct _cmmidi *CMMIDI; | typedef struct _cmmidi *CMMIDI; |
| typedef struct { | |
| BYTE prog; | |
| BYTE press; | |
| UINT16 bend; | |
| BYTE ctrl[28]; | |
| } _MIDICH, *MIDICH; | |
| struct _cmmidi { | struct _cmmidi { |
| UINT opened; | UINT opened; |
| void (*outfn)(CMMIDI self, UINT32 msg); | void (*outfn)(CMMIDI self, UINT32 msg); |
| Line 336 static void midisetparam(CMMIDI midi) { | Line 343 static void midisetparam(CMMIDI midi) { |
| // ---- | // ---- |
| static UINT midiread(COMMNG self, BYTE *data) { | static UINT midiread(COMMNG self, BYTE *data) { |
| CMMIDI midi; | CMMIDI midi; |
| Line 350 static UINT midiread(COMMNG self, BYTE * | Line 357 static UINT midiread(COMMNG self, BYTE * |
| return(0); | return(0); |
| } | } |
| static UINT midiwrite(COMMNG self, BYTE data) { | static UINT midiwrite(COMMNG self, BYTE data) { |
| CMMIDI midi; | CMMIDI midi; |
| MIDICH mch; | MIDICH mch; |
| Line 529 static UINT midiwrite(COMMNG self, BYTE | Line 536 static UINT midiwrite(COMMNG self, BYTE |
| return(0); | return(0); |
| } | } |
| static BYTE midigetstat(COMMNG self) { | static BYTE midigetstat(COMMNG self) { |
| return(0x00); | return(0x00); |
| } | } |
| static UINT midimsg(COMMNG self, UINT msg, long param) { | static long midimsg(COMMNG self, UINT msg, long param) { |
| CMMIDI midi; | CMMIDI midi; |
| COMFLAG flag; | |
| midi = (CMMIDI)(self + 1); | midi = (CMMIDI)(self + 1); |
| switch(msg) { | switch(msg) { |
| Line 544 static UINT midimsg(COMMNG self, UINT ms | Line 552 static UINT midimsg(COMMNG self, UINT ms |
| midireset(midi); | midireset(midi); |
| return(1); | return(1); |
| case COMMSG_SETFLAG: | |
| flag = (COMFLAG)param; | |
| if ((flag) && | |
| (flag->size == sizeof(_COMFLAG) + sizeof(midi->mch)) && | |
| (flag->sig == COMSIG_MIDI)) { | |
| CopyMemory(midi->mch, flag + 1, sizeof(midi->mch)); | |
| midisetparam(midi); | |
| return(1); | |
| } | |
| break; | |
| case COMMSG_GETFLAG: | |
| flag = (COMFLAG)_MALLOC(sizeof(_COMFLAG) + sizeof(midi->mch), | |
| "MIDI FLAG"); | |
| if (flag) { | |
| flag->size = sizeof(_COMFLAG) + sizeof(midi->mch); | |
| flag->sig = COMSIG_MIDI; | |
| flag->ver = 0; | |
| flag->param = 0; | |
| CopyMemory(flag + 1, midi->mch, sizeof(midi->mch)); | |
| return((long)flag); | |
| } | |
| break; | |
| case COMMSG_MIMPIDEFFILE: | case COMMSG_MIMPIDEFFILE: |
| mimpidef_load(&midi->def, (char *)param); | mimpidef_load(&midi->def, (char *)param); |
| return(1); | return(1); |
| Line 551 static UINT midimsg(COMMNG self, UINT ms | Line 583 static UINT midimsg(COMMNG self, UINT ms |
| case COMMSG_MIMPIDEFEN: | case COMMSG_MIMPIDEFEN: |
| midi->def_en = (param)?TRUE:FALSE; | midi->def_en = (param)?TRUE:FALSE; |
| return(1); | return(1); |
| case COMMSG_MIDISTATSET: | |
| CopyMemory(midi->mch, (void *)param, sizeof(midi->mch)); | |
| midisetparam(midi); | |
| return(1); | |
| case COMMSG_MIDISTATGET: | |
| CopyMemory((void *)param, midi->mch, sizeof(midi->mch)); | |
| return(1); | |
| } | } |
| return(0); | return(0); |
| } | } |