NiCMidi 1.1.0
A MIDI library derived from J.D.Koftinoff jdksmidi
MIDIMultiProcessor Class Reference

Allows the user to queue many MIDIProcessor objects, passing the result of each one to the next. More...

#include <processor.h>

Inheritance diagram for MIDIMultiProcessor:
MIDIProcessor

Public Types

enum  { MODE_IGNORE , MODE_CONTINUE , MODE_STOP }
 These are the values to be given as parameters to the SetProcessMode() method. More...
 

Public Member Functions

 MIDIMultiProcessor ()
 The constructor creates an object with empty queue. More...
 
virtual void Reset ()
 Empties the processors queue, removing all their pointers from it. More...
 
MIDIProcessorGetProcessor (unsigned int pos)
 Returns a pointer to the MIDIProcessor at the given position. More...
 
const MIDIProcessorGetProcessor (unsigned int pos) const
 Returns a pointer to the MIDIProcessor at the given position. More...
 
int GetProcessMode () const
 Returns the processing mode (see SetProcessMode()). More...
 
void SetProcessor (MIDIProcessor *proc, int pos=-1)
 Inserts a MIDIProcessor object into the queue. More...
 
void RemoveProcessor (unsigned int pos)
 Removes the MIDIProcessor at the given position. More...
 
void RemoveProcessor (const MIDIProcessor *proc)
 Searches the given MIDIProcessor in the queue and removes it (it does nothing if the processor is not in the queue). More...
 
void SetProcessMode (int mode)
 Determines the behaviour of the MIDIMultiProcessor if any of the processors return false. More...
 
virtual bool Process (MIDITimedMessage *msg)
 The Process method. More...
 
- Public Member Functions inherited from MIDIProcessor
 MIDIProcessor ()
 The constructor. More...
 
virtual ~MIDIProcessor ()
 The destructor. More...
 

Detailed Description

Allows the user to queue many MIDIProcessor objects, passing the result of each one to the next.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

These are the values to be given as parameters to the SetProcessMode() method.

Constructor & Destructor Documentation

◆ MIDIMultiProcessor()

MIDIMultiProcessor::MIDIMultiProcessor ( )
inline

The constructor creates an object with empty queue.

Member Function Documentation

◆ Reset()

virtual void MIDIMultiProcessor::Reset ( )
virtual

Empties the processors queue, removing all their pointers from it.

Implements MIDIProcessor.

◆ GetProcessor() [1/2]

MIDIProcessor * MIDIMultiProcessor::GetProcessor ( unsigned int  pos)
inline

Returns a pointer to the MIDIProcessor at the given position.

◆ GetProcessor() [2/2]

const MIDIProcessor * MIDIMultiProcessor::GetProcessor ( unsigned int  pos) const
inline

Returns a pointer to the MIDIProcessor at the given position.

◆ GetProcessMode()

int MIDIMultiProcessor::GetProcessMode ( ) const
inline

Returns the processing mode (see SetProcessMode()).

◆ SetProcessor()

void MIDIMultiProcessor::SetProcessor ( MIDIProcessor proc,
int  pos = -1 
)

Inserts a MIDIProcessor object into the queue.

Parameters
procthe MIDIProcessor to be inserted (it is not owned by the MIDIMultiProcessor)
posthe position in the queue. If you leave the default value the processor will be appended to the queue, otherwise the new processor substitutes the old (the method does nothing if pos is not in the appropriate range)

◆ RemoveProcessor() [1/2]

void MIDIMultiProcessor::RemoveProcessor ( unsigned int  pos)

Removes the MIDIProcessor at the given position.

It only removes the processor pointer from the queue, and does nothing if pos is not in the appropriate range.

◆ RemoveProcessor() [2/2]

void MIDIMultiProcessor::RemoveProcessor ( const MIDIProcessor proc)

Searches the given MIDIProcessor in the queue and removes it (it does nothing if the processor is not in the queue).

It only removes the processor pointer from the queue.

◆ SetProcessMode()

void MIDIMultiProcessor::SetProcessMode ( int  mode)
inline

Determines the behaviour of the MIDIMultiProcessor if any of the processors return false.

You can set these three values:

  • MODE_IGNORE : the MIDIMultiProcessor ignores return values and always returns true
  • MODE_CONTINUE : the MIDIMultiProcessor performs all the processing, and returns false if any processor returned false, true otherwise (this is the default when the object is created)
  • MODE_STOP : the MIDIMultiProcessor stops processing when a processor returns false and returns false, true otherwise.

◆ Process()

virtual bool MIDIMultiProcessor::Process ( MIDITimedMessage msg)
virtual

The Process method.

It passes the MIDI message to the first processor and subsequently to all other processors in the queue. If any of the processors returns false the behaviour and the returned value are defined by the SetProcessMode() method.

Implements MIDIProcessor.


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