zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit ae9cb074dd5052666cb0c921e6cc7fc0af4f07ac
parent c654affbcdce7c122f8624253c06095107a19113
Author: Mark McCurry <[email protected]>
Date:   Fri,  5 Jun 2009 20:20:36 -0400

Indentation

Diffstat:
Msrc/Input/OSSMidiIn.C | 64++++++++++++++++++++++++++++++++--------------------------------
Msrc/Input/OSSMidiIn.h | 20++++++++++----------
2 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/src/Input/OSSMidiIn.C b/src/Input/OSSMidiIn.C @@ -50,15 +50,15 @@ unsigned char OSSMidiIn::readbyte(){ unsigned char tmp[4]; read(midi_handle,&tmp[0],1); while (tmp[0]!=SEQ_MIDIPUTC){ - read(midi_handle,&tmp[0],4); - }; + read(midi_handle,&tmp[0],4); + } return(tmp[1]); }; unsigned char OSSMidiIn::getmidibyte(){ unsigned char b; do { - b=readbyte(); + b=readbyte(); } while (b==0xfe);//drops the Active Sense Messages return(b); }; @@ -69,47 +69,47 @@ unsigned char OSSMidiIn::getmidibyte(){ void OSSMidiIn::getmidicmd(MidiCmdType &cmdtype,unsigned char &cmdchan,int *cmdparams){ unsigned char tmp,i; if (inputok==0) { - cmdtype=MidiNull; - return; - }; + cmdtype=MidiNull; + return; + } i=0; if (lastmidicmd==0){//asteapta prima data pana cand vine prima comanda midi - while (tmp<0x80) tmp=getmidibyte(); - lastmidicmd=tmp; - }; + while (tmp<0x80) tmp=getmidibyte(); + lastmidicmd=tmp; + } tmp=getmidibyte(); if (tmp>=0x80) { - lastmidicmd=tmp; - tmp=getmidibyte(); - }; + lastmidicmd=tmp; + tmp=getmidibyte(); + } if ((lastmidicmd>=0x80)&&(lastmidicmd<=0x8f)){//Note OFF - cmdtype=MidiNoteOFF; - cmdchan=lastmidicmd%16; - cmdparams[0]=tmp;//note number - }; + cmdtype=MidiNoteOFF; + cmdchan=lastmidicmd%16; + cmdparams[0]=tmp;//note number + } if ((lastmidicmd>=0x90)&&(lastmidicmd<=0x9f)){//Note ON - cmdtype=MidiNoteON; - cmdchan=lastmidicmd%16; - cmdparams[0]=tmp;//note number - cmdparams[1]=getmidibyte();//velocity - if (cmdparams[1]==0) cmdtype=MidiNoteOFF;//if velocity==0 then is note off - }; + cmdtype=MidiNoteON; + cmdchan=lastmidicmd%16; + cmdparams[0]=tmp;//note number + cmdparams[1]=getmidibyte();//velocity + if (cmdparams[1]==0) cmdtype=MidiNoteOFF;//if velocity==0 then is note off + } if ((lastmidicmd>=0xB0)&&(lastmidicmd<=0xBF)){//Controllers - cmdtype=MidiController; - cmdchan=lastmidicmd%16; - cmdparams[0]=getcontroller(tmp); - cmdparams[1]=getmidibyte(); - }; + cmdtype=MidiController; + cmdchan=lastmidicmd%16; + cmdparams[0]=getcontroller(tmp); + cmdparams[1]=getmidibyte(); + } if ((lastmidicmd>=0xE0)&&(lastmidicmd<=0xEF)){//Pitch Wheel - cmdtype=MidiController; - cmdchan=lastmidicmd%16; - cmdparams[0]=C_pitchwheel; - cmdparams[1]=(tmp+getmidibyte()*(int) 128)-8192;//hope this is correct - }; + cmdtype=MidiController; + cmdchan=lastmidicmd%16; + cmdparams[0]=C_pitchwheel; + cmdparams[1]=(tmp+getmidibyte()*(int) 128)-8192;//hope this is correct + } }; diff --git a/src/Input/OSSMidiIn.h b/src/Input/OSSMidiIn.h @@ -27,19 +27,19 @@ class OSSMidiIn:public MidiIn{ public: - OSSMidiIn(); - ~OSSMidiIn(); - unsigned char getmidibyte(); - unsigned char readbyte(); + OSSMidiIn(); + ~OSSMidiIn(); + unsigned char getmidibyte(); + unsigned char readbyte(); - //Midi parser - void getmidicmd(MidiCmdType &cmdtype,unsigned char &cmdchan,int *cmdparams); - unsigned char cmdtype;//the Message Type (noteon,noteof,sysex..) - unsigned char cmdchan;//the channel number + //Midi parser + void getmidicmd(MidiCmdType &cmdtype,unsigned char &cmdchan,int *cmdparams); + unsigned char cmdtype;//the Message Type (noteon,noteof,sysex..) + unsigned char cmdchan;//the channel number private: - int midi_handle; - unsigned char lastmidicmd;//last byte (>=80) received from the Midi + int midi_handle; + unsigned char lastmidicmd;//last byte (>=80) received from the Midi };