jdkmidi class library documentation

Copyright © 2004 J.D. Koftinoff Software, Ltd.

Released under the GNU General Public License (GPL)




Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

jdkmidi::MIDIProcessorRechannelizer Class Reference

#include <process.h>

Inheritance diagram for jdkmidi::MIDIProcessorRechannelizer:

jdkmidi::MIDIProcessor List of all members.

Public Member Functions

 MIDIProcessorRechannelizer ()
virtual ~MIDIProcessorRechannelizer ()
void SetRechanMap (int src_chan, int dest_chan)
int GetRechanMap (int src_chan) const
void SetAllRechan (int dest_chan)
virtual bool Process (MIDITimedBigMessage *msg)

Private Attributes

int rechan_map [16]

Constructor & Destructor Documentation

jdkmidi::MIDIProcessorRechannelizer::MIDIProcessorRechannelizer  ) 
 

Definition at line 134 of file jdkmidi_process.cpp.

References rechan_map.

00135   {
00136     for( int i=0; i<16; ++i )
00137     {
00138       rechan_map[i] = i;
00139     }
00140     
00141   }

jdkmidi::MIDIProcessorRechannelizer::~MIDIProcessorRechannelizer  )  [virtual]
 

Definition at line 143 of file jdkmidi_process.cpp.

00144   {
00145   }


Member Function Documentation

int jdkmidi::MIDIProcessorRechannelizer::GetRechanMap int  src_chan  )  const [inline]
 

Definition at line 112 of file process.h.

References rechan_map.

00113         { 
00114           return rechan_map[src_chan];
00115         }

bool jdkmidi::MIDIProcessorRechannelizer::Process MIDITimedBigMessage msg  )  [virtual]
 

Implements jdkmidi::MIDIProcessor.

Definition at line 156 of file jdkmidi_process.cpp.

References jdkmidi::MIDIMessage::GetChannel(), jdkmidi::MIDIMessage::IsChannelMsg(), rechan_map, and jdkmidi::MIDIMessage::SetChannel().

00157   {
00158     if( msg->IsChannelMsg() )
00159     {   
00160       int new_chan = rechan_map[ msg->GetChannel() ];
00161       
00162       if( new_chan==-1 )
00163       {
00164         // this channel is to be deleted! return false
00165         return false;
00166       }
00167       
00168       msg->SetChannel( (unsigned char)new_chan );
00169     }
00170     
00171     return true;
00172   }

void jdkmidi::MIDIProcessorRechannelizer::SetAllRechan int  dest_chan  ) 
 

Definition at line 148 of file jdkmidi_process.cpp.

References rechan_map.

00149   {
00150     for( int i=0; i<16; ++i )
00151     {
00152       rechan_map[i] = dest_chan;
00153     }
00154   }

void jdkmidi::MIDIProcessorRechannelizer::SetRechanMap int  src_chan,
int  dest_chan
[inline]
 

Definition at line 107 of file process.h.

References rechan_map.

00108         {
00109           rechan_map[src_chan] = dest_chan;
00110         }


Member Data Documentation

int jdkmidi::MIDIProcessorRechannelizer::rechan_map[16] [private]
 

Definition at line 123 of file process.h.


The documentation for this class was generated from the following files: