home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff227.lzh / MidiLib / include.i / midi / midibase.i < prev   
Text File  |  1989-06-25  |  3KB  |  95 lines

  1. ; midi/midibase.i
  2.  
  3. ; midi.library MidiBase & related definitions (not for the casual midi user)
  4.  
  5.     ifnd    MIDI_MIDIBASE_I
  6. MIDI_MIDIBASE_I set 1
  7.  
  8.     ifnd    EXEC_LIBRARIES_I
  9.     include "exec/libraries.i"
  10.     endc
  11.  
  12.     ifnd    EXEC_SEMAPHORES_I
  13.     include "exec/semaphores.i"
  14.     endc
  15.  
  16.     ifnd    LIBRARIES_DOS_I
  17.     include "libraries/dos.i"
  18.     endc
  19.  
  20.     ifnd    MIDI_MIDI_I
  21.     include "midi/midi.i"
  22.     endc
  23.  
  24.  
  25.     STRUCTURE    MidiBase,LIB_SIZE    ; Library Base
  26.     STRUCT    ml_SourceList,LH_SIZE        ; Source List
  27.     STRUCT    ml_DestList,LH_SIZE        ; Dest List
  28.  
  29.     STRUCT    ml_ListSemaphore,SS_SIZE    ; locks source/dest lists - blocks Src & Dst list management
  30.                         ; (locked when LockBase is called)
  31.     STRUCT    ml_RouteSemaphore,SS_SIZE   ; locks routes - blocks msg routing & RPList management in Src & Dst
  32.     ULONG    ml_SegList            ; Segment List for the library
  33.     APTR    ml_SysBase            ; SysBase
  34.     APTR    ml_DosBase            ; DosBase
  35.     STRUCT    ml_SignalList,MLH_SIZE        ; list of MListSignal's
  36.     STRUCT    ml_PacketPool,MLH_SIZE        ; memory pool
  37.     UWORD    ml_RouteCount            ; total number of MRoutes open
  38.  
  39.     LABEL    sizeof_MidiBase
  40.  
  41.  
  42.     STRUCTURE    MTaskInfo,0 ; Task info structure for Resident Nodes
  43.     APTR    ti_Name     ; Process Name
  44.     WORD    ti_Pri        ; Process Priority
  45.     APTR    ti_Entry    ; Entry point
  46.     UWORD    ti_Stack    ; Stack Size
  47.  
  48.     UWORD    ti_Sources    ; source count
  49.     APTR    ti_SourceList    ; source list
  50.     UWORD    ti_Dests    ; dest count
  51.     APTR    ti_DestList    ; dest list
  52.  
  53.     STRUCT    ti_Semaphore,SS_SIZE    ; signal semaphore for locking this task
  54.  
  55.     UWORD    ti_UsageCount
  56.     APTR    ti_TaskPort    ; task's MsgPort
  57.     BPTR    ti_Segment    ; BPTR pointer to tasks segment
  58.     LABEL    sizeof_MTaskInfo
  59.  
  60.  
  61.     STRUCTURE    MNodeInfo,0 ; Resident Node info structure
  62.     APTR    ni_Name     ; Node Name
  63.     APTR    ni_Image    ; Node Image
  64.     APTR    ni_Node     ; Node pointer
  65.     LABEL    sizeof_MNodeInfo
  66.  
  67.  
  68.     ; packet array
  69.  
  70. PA_PACKETS     equ 256
  71. PA_BITMAPSIZE  equ PA_PACKETS/8     ; must be divisible by 4
  72.  
  73.     STRUCTURE    PacketArray,MLN_SIZE
  74.     STRUCT    pa_BitMap,PA_BITMAPSIZE         ; availability bit map
  75.     STRUCT    pa_Packets,PA_PACKETS*sizeof_MidiPacket ; array of MidiPackets
  76.     LABEL    sizeof_PacketArray
  77.  
  78. mp_PacketArray    equ LN_NAME        ; points to PacketArray that contains this MidiPacket
  79. mp_PacketIndex    equ MN_LENGTH        ; index (not offset) of MidiPacket w/i PacketArray
  80.  
  81. ; pa_Packets are allocated from low to high address.
  82. ; ExecMsg in each packet gets used as follows:
  83. ;    LN_NAME points to PacketArray in which MidiPacket exists
  84. ;    MN_LENGTH contains index (not offset) of Packet w/i PacketArray
  85.  
  86. ; pa_BitMap bytes are allocated from low to high address, bits are allocated
  87. ; right to left (everything proceeds in a low to high addressing order).
  88.  
  89. ; pa_BitMap[0], bit #0 corresponds to pa_Packets[0]
  90. ; pa_BitMap[31], bit #7 corresponds to pa_Packet[255]
  91.  
  92. ; bits in BitMap contain 1 for available, 0 for in use
  93.  
  94.     endc
  95.