32#ifndef _NICMIDI_PROCESSOR_H
33#define _NICMIDI_PROCESSOR_H
104 enum { MODE_IGNORE, MODE_CONTINUE, MODE_STOP };
108 std::vector<MIDIProcessor*> processors;
141 int trans_amount[16];
162 void SetRechanMap (
int src_chan,
int dest_chan) { rechan_map[src_chan] = dest_chan; }
188 print_on(true), chan_from_1(from_1 != 0), ost(stream) {}
190 virtual void Reset() { print_on =
true; }
208 unsigned char chan_from_1;
Allows the user to queue many MIDIProcessor objects, passing the result of each one to the next.
Definition: processor.h:66
virtual bool Process(MIDITimedMessage *msg)
The Process method.
void SetProcessMode(int mode)
Determines the behaviour of the MIDIMultiProcessor if any of the processors return false.
Definition: processor.h:98
MIDIProcessor * GetProcessor(unsigned int pos)
Returns a pointer to the MIDIProcessor at the given position.
Definition: processor.h:74
MIDIMultiProcessor()
The constructor creates an object with empty queue.
Definition: processor.h:70
virtual void Reset()
Empties the processors queue, removing all their pointers from it.
const MIDIProcessor * GetProcessor(unsigned int pos) const
Returns a pointer to the MIDIProcessor at the given position.
Definition: processor.h:76
void SetProcessor(MIDIProcessor *proc, int pos=-1)
Inserts a MIDIProcessor object into the queue.
void RemoveProcessor(unsigned int pos)
Removes the MIDIProcessor at the given position.
int GetProcessMode() const
Returns the processing mode (see SetProcessMode()).
Definition: processor.h:78
void RemoveProcessor(const MIDIProcessor *proc)
Searches the given MIDIProcessor in the queue and removes it (it does nothing if the processor is not...
A pure virtual class implementing an object that can manipulate a MIDI message, inspecting or changin...
Definition: processor.h:47
virtual bool Process(MIDITimedMessage *msg)=0
The Process() pure virtual method.
MIDIProcessor()
The constructor.
Definition: processor.h:50
virtual ~MIDIProcessor()
The destructor.
Definition: processor.h:52
virtual void Reset()=0
You should implement this pure virtual method in order to return the MIDIProcessor to its initial sta...
A MIDIProcessor which prints a human-readable description of the processed messages to a std::ostream...
Definition: processor.h:184
virtual void Reset()
Same of SetPrint(true)
Definition: processor.h:190
void SetChanFrom(unsigned char c)
Sets the numbering of MIDI channels in message printing.
Definition: processor.h:198
int GetChanFrom() const
Returns the numbering of the first MIDI channel in message printing (0 or 1).
Definition: processor.h:193
virtual bool Process(MIDITimedMessage *msg)
The Process method.
bool GetPrint() const
Returns the printing status.
Definition: processor.h:195
void SetPrint(bool on_off)
Sets the printing on and off (default is on).
Definition: processor.h:200
MIDIProcessorPrinter(std::ostream &stream=std::cout, unsigned char from_1=0)
The constructor sets the std::ostream that will print the messages (default: std::cout).
Definition: processor.h:187
A MIDIProcessor which changes the channel of all processed MIDI channel messages.
Definition: processor.h:150
virtual bool Process(MIDITimedMessage *msg)
The Process() method.
void SetAllRechan(int dest_chan)
Sends all channel messages to channel dest_chan.
MIDIProcessorRechannelizer()
The constructor.
int GetRechanMap(int src_chan) const
Gets the corresponding channel for the (source) src_chan.
Definition: processor.h:159
void Reset()
Resets the default status (no rechannelizing).
void SetRechanMap(int src_chan, int dest_chan)
Set the correspondence between two channels (will transform src_chan into dest_chan).
Definition: processor.h:162
A MIDIProcessor which shifts the pitch of MIDI note and polyphonic pressure messages by a given amoun...
Definition: processor.h:118
void SetChannelTranspose(int chan, int trans)
Sets the transposing amount.
Definition: processor.h:130
MIDIProcessorTransposer()
The constructor.
virtual void Reset()
Resets to the default status (no transposing on all channels).
int GetChannelTranspose(int chan) const
Gets the transposing amount (in semitones) for the given channel.
Definition: processor.h:126
void SetAllTranspose(int trans)
Sets the same transposing amount (in semitones) for all the channels.
virtual bool Process(MIDITimedMessage *msg)
The process() method.
The MIDITimedMessage class inherits from the MIDIMessage and represents a message associated with a s...
Definition: msg.h:382
Contains the definition of the classes MIDIMessage and MIDITimedMessage.