Source: midimountain/mcBase.h


Annotated List
Files
Globals
Hierarchy
Index
//=============================================================================
// TMidiBase class definition
//=============================================================================
// Author  : Adrian Meyer
// Version : 0.2.0
// Log     :
//=============================================================================
// 28.08.2000 building class
//=============================================================================
// to do:
// - event handling
//=============================================================================

#ifndef __MCBASE__
#define __MCBASE__

class TMidiBase;

// identifier for classes
const short cMCAll      =  0x00;                      // all classes
const short cMCSequence =  0x01;                      // sequence identifier
const short cMCTrack    =  0x02;                      // track identifier
const short cMCEvent    =  0x03;                      // event identifier
const short cMCIO       =  0x04;                      // IO identifier
const short cMCPlayback =  0x05;                      // playback identifier
const short cMCMapper   =  0x06;                      // mapper identifier
const short cMCDevice   =  0x07;                      // device identifier

// message information
struct sMCMessage
{
  short Class;
  long Message;
  char* Text;
  void* UserData;
  bool* Handled;
};

// type for MidiClass message
// ( pointer to class, struct with info )
typedef void ( tMCMessage ) ( TMidiBase*, sMCMessage* );

// structure for message list
struct sMCMessageList
{
  sMCMessageList * Next;
  tMCMessage * Message;
  void* UserData;
};

// base class for Midi
class TMidiBase                
  {
    private:
      sMCMessageList * fMCMessageList;
      sMCMessage * fMCMessage;                        // struct for calls
    public:
      TMidiBase( void );                              // constructor for class
      ~TMidiBase( void );                             // constructor for class
      void AddMCMessage( tMCMessage * aMCMessage,  
                         void* aUserData );           // add message and pointer to list
      sMCMessage * GetMCMessage( void );              // read message struct for call
      void CallMCMessage( TMidiBase* aBase );         // call message with fMCMessage
      void CallMCMessage( TMidiBase* aBase, short aClass, long aMessage, char* aText );  
  };

#endif

Generated by: root@castle on Fri Jul 20 00:33:17 2001, using kdoc 2.0a36.