#include <process.h>
Inheritance diagram for jdkmidi::MIDIProcessorTransposer:

Public Member Functions | |
| MIDIProcessorTransposer () | |
| virtual | ~MIDIProcessorTransposer () |
| void | SetTransposeChannel (int chan, int trans) |
| int | GetTransposeChannel (int chan) const |
| void | SetAllTranspose (int trans) |
| virtual bool | Process (MIDITimedBigMessage *msg) |
Private Attributes | |
| int | trans_amount [16] |
|
|
Definition at line 81 of file jdkmidi_process.cpp. References trans_amount.
00082 {
00083 for( int i=0; i<16; ++i )
00084 {
00085 trans_amount[i] = 0;
00086 }
00087
00088 }
|
|
|
Definition at line 90 of file jdkmidi_process.cpp.
00091 {
00092 }
|
|
|
Definition at line 89 of file process.h. References trans_amount.
00090 {
00091 return trans_amount[chan];
00092 }
|
|
|
Implements jdkmidi::MIDIProcessor. Definition at line 103 of file jdkmidi_process.cpp. References jdkmidi::MIDIMessage::GetChannel(), jdkmidi::MIDIMessage::GetNote(), jdkmidi::MIDIMessage::IsChannelMsg(), jdkmidi::MIDIMessage::IsNoteOff(), jdkmidi::MIDIMessage::IsNoteOn(), jdkmidi::MIDIMessage::IsPolyPressure(), jdkmidi::MIDIMessage::SetNote(), and trans_amount.
00104 {
00105 if( msg->IsChannelMsg() )
00106 {
00107 if( msg->IsNoteOn() || msg->IsNoteOff() || msg->IsPolyPressure() )
00108 {
00109 int trans = trans_amount[ msg->GetChannel() ];
00110
00111 int new_note = ((int)msg->GetNote())+trans;
00112
00113 if( trans>127 || trans<0 )
00114 {
00115 // delete event if out of range
00116 return false;
00117 }
00118 else
00119 {
00120 // set new note number
00121 msg->SetNote( (unsigned char)new_note );
00122 }
00123
00124 }
00125 }
00126
00127 return true;
00128 }
|
|
|
Definition at line 95 of file jdkmidi_process.cpp. References trans_amount.
00096 {
00097 for( int chan=0; chan<16; ++chan )
00098 {
00099 trans_amount[chan]=val;
00100 }
00101 }
|
|
||||||||||||
|
Definition at line 84 of file process.h. References trans_amount.
00085 {
00086 trans_amount[chan] = trans;
00087 }
|
|
|
|