/****************************************************************************

   File              : sosmfnct.h

   Programmer(s)     : Don Fowler, Nick Skrepetos
   Date              :

   Purpose           : Include Files For Zortech C++ Compiler

   Last Updated      :

****************************************************************************
               Copyright(c) 1993,1994 Human Machine Interfaces 
                            All Rights Reserved
****************************************************************************/

#ifndef  _SOS_MIDI_FUNCTIONS
#define  _SOS_MIDI_FUNCTIONS

#pragma pack(4)

#ifdef __cplusplus // HACK - ECH 96/01/26
extern "C" {
#endif

WORD  sosMIDILockMemory                (  VOID  );
WORD  sosMIDIUnLockMemory              (  VOID  );
WORD  sosMIDIGetDeviceCaps             (  WORD, _SOS_MIDI_CAPABILITIES * );
WORD  sosMIDIInitSystem                (  PSTR, WORD  );
WORD  sosMIDIUnInitSystem              (  VOID  );
WORD  sosMIDIInitDriver                (  WORD, _SOS_MIDI_HARDWARE *,
                                         _SOS_MIDI_INIT_DRIVER *, WORD *  );
WORD  sosMIDIUnInitDriver              (  WORD, BOOL  );
WORD  sosMIDILoadDriver                (  WORD, WORD, SFAR *, SFAR *, PSTR, PSTR, WORD * );
WORD  sosMIDIUnLoadDriver              (  WORD  );
WORD  sosMIDIInitSong                  (  _SOS_MIDI_INIT_SONG *,
                                          _SOS_MIDI_TRACK_DEVICE *,
                                          WORD * );
WORD  sosMIDIUnInitSong                (  WORD  );
WORD  sosMIDIResetSong                 (  WORD, _SOS_MIDI_INIT_SONG *  );
WORD  sosMIDIStartSong                 (  WORD  );  
WORD  sosMIDIStopSong                  (  WORD  );  
WORD  sosMIDIPauseSong                 (  WORD, WORD  );
WORD  sosMIDIMuteSong                  (  WORD  );
WORD  sosMIDIUnMuteSong                (  WORD  );
WORD  sosMIDIResumeSong                (  WORD  );
BOOL  sosMIDISongDone                  (  WORD  );  
WORD  sosMIDISongAlterTempo            (  WORD, WORD  );  
WORD  sosMIDIGetDeltaTime              (  PSTR, DWORD *  );
WORD  sosMIDISongGetTimeToPlay         (  WORD  );  
BYTE * sosMIDINormalizePtr       (  BYTE *  );
WORD  sosMIDISetInsData                (  WORD, PSTR, WORD  );
WORD  sosMIDIResetDriver               (  WORD  );
BOOL  sosMIDIHandleMIDIData            (  WORD, PSTR, WORD, WORD  );
WORD  sosMIDISendMIDIData              (  WORD, PSTR, WORD  );
VOID  sosMIDISetTrackState             (  WORD, WORD, WORD  );

// compiled in drivers function interface
VOID digiGetCallTable                 (  WORD *  );
VOID callbackGetCallTable             (  WORD *  );

WORD cdecl callbackSendData             (  SFAR, WORD, WORD  );
WORD cdecl callbackInit                 (  SFAR, WORD, WORD  );
WORD cdecl callbackUnInit               (  SFAR, WORD, WORD  );
WORD cdecl callbackReset                (  SFAR, WORD, WORD  );
WORD cdecl callbackSetInstrumentData    (  SFAR, WORD, WORD  );

// function prototypes
WORD cdecl digiSendData             (  SFAR, WORD, WORD  );
WORD cdecl digiInit                 (  SFAR, WORD, WORD  );
WORD cdecl digiUnInit               (  SFAR, WORD, WORD  );
WORD cdecl digiReset                (  SFAR, WORD, WORD  );
WORD cdecl digiSetInstrumentData    (  SFAR, WORD, WORD  );

VOID waveGetCallTable               (  WORD *  );
WORD cdecl waveSendData             (  SFAR, WORD, WORD  );
WORD cdecl waveInit                 (  SFAR, WORD, WORD  );
WORD cdecl waveUnInit               (  SFAR, WORD, WORD  );
WORD cdecl waveReset                (  SFAR, WORD, WORD  );
WORD cdecl waveSetInstrumentData    (  SFAR, WORD, WORD  );
VOID cdecl waveSampleCallback(  WORD, WORD, WORD  );

WORD cdecl callbackSendDataStub             (  SFAR, WORD, WORD  );
WORD cdecl callbackInitStub                 (  SFAR, WORD, WORD  );
WORD cdecl callbackUnInitStub               (  SFAR, WORD, WORD  );
WORD cdecl callbackResetStub                (  SFAR, WORD, WORD  );
WORD cdecl callbackSetInstrumentDataStub    (  SFAR, WORD, WORD  );

// function prototypes
WORD cdecl digiSendDataStub             (  SFAR, WORD, WORD  );
WORD cdecl digiInitStub                 (  SFAR, WORD, WORD  );
WORD cdecl digiUnInitStub               (  SFAR, WORD, WORD  );
WORD cdecl digiResetStub                (  SFAR, WORD, WORD  );
WORD cdecl digiSetInstrumentDataStub    (  SFAR, WORD, WORD  );

WORD cdecl waveSendDataStub             (  SFAR, WORD, WORD  );
WORD cdecl waveInitStub                 (  SFAR, WORD, WORD  );
WORD cdecl waveUnInitStub               (  SFAR, WORD, WORD  );
WORD cdecl waveResetStub                (  SFAR, WORD, WORD  );
WORD cdecl waveSetInstrumentDataStub    (  SFAR, WORD, WORD  );

VOID        digiQueueInit           (  WORD, WORD  );
VOID        digiQueueUnInit         (  WORD  );
WORD        digiQueueAddItem        (  WORD, WORD, WORD, WORD, WORD );
WORD        digiQueueGetItem        (  WORD, WORD  );
WORD        digiQueueGetItemWAVE    (  WORD  );
WORD        digiQueueDeleteItem     (  WORD, WORD  );
WORD        digiQueueDeleteItemWAVE (  WORD, WORD  );
WORD        digiQueueDeleteItemMIDI (  WORD, WORD, WORD  );
WORD        digiQueueFindItemMIDI   (  WORD, WORD, WORD  );

// function prototypes
VOID cdecl digiSampleCallback(  WORD, WORD, WORD  );

WORD        sosMIDIRegisterBranchFunction (  WORD, WORD ( * )( WORD, BYTE, BYTE )  );
WORD        sosMIDIRegisterLoopFunction   (  WORD, WORD ( * )( WORD, BYTE, BYTE, BYTE )  );
WORD        sosMIDIRegisterTriggerFunction(  WORD, BYTE, WORD ( * )( WORD, BYTE, BYTE ) );
WORD        sosMIDIBranchToTrackLocation  (  WORD, BYTE, BYTE  );
WORD        sosMIDIBranchToSongLocation   (  WORD, BYTE  );

//#ifdef __cplusplus  // ECH
//extern "C" {
//#endif

extern   void  cdecl sosMIDIDRVGetCapsInfo( SFAR, SFAR, PSTR );
extern   void  cdecl sosMIDIDRVGetCapsPtr ( SFAR, SFAR, PSTR );
extern   void  cdecl sosMIDIDRVGetFuncsPtr( SFAR, SFAR, PSTR );
extern   VOID cdecl sosMIDIDRVSpecialFunction( SFAR, SFAR, WORD, SFAR * );
extern   WORD cdecl xgetES( void );

extern   WORD  cdecl sosMIDIDRVCall32Func( SFAR, SFAR, WORD, WORD );

//#ifdef __cplusplus // ECH
//}
//#endif

BOOL sosMIDIResetChannelStealing (  WORD  );
WORD sosMIDIEnableChannelStealing(  WORD  );
VOID sosMIDISongHandler( VOID );

WORD sosMIDISetMT32InsData       (  WORD, PSTR, WORD  );
WORD sosMIDISetMasterVolume      (  BYTE  );
VOID sosMIDIMT32Timer        (  VOID  );

WORD sosMIDISetSongVolume        (  WORD, BYTE  );
WORD        sosMIDIFadeSong            (  WORD, WORD, WORD, BYTE, BYTE, WORD  );       
VOID  sosMIDIGusFunction( VOID );
VOID  sosMIDIGusFunction1( SFAR );

// functions for memory locking
VOID  sosMIDICaps_Start( VOID );
VOID  sosMIDICaps_End( VOID );
VOID  sosMIDICbck_Start( VOID );
VOID  sosMIDICbck_End( VOID );
VOID  sosMIDIDigi_Start( VOID );
VOID  sosMIDIDigi_End( VOID );
VOID  sosMIDIDone_Start( VOID );
VOID  sosMIDIDone_End( VOID );
VOID  sosMIDIDq_Start( VOID );
VOID  sosMIDIDq_End( VOID );
VOID  sosMIDIInit_Start( VOID );
VOID  sosMIDIInit_End( VOID );
VOID  sosMIDIIns_Start( VOID );
VOID  sosMIDIIns_End( VOID );
VOID  sosMIDILoad_Start( VOID );
VOID  sosMIDILoad_End( VOID );
VOID  sosMIDIPause_Start( VOID );
VOID  sosMIDIPause_End( VOID );
VOID  sosMIDIPtr_Start( VOID );
VOID  sosMIDIPtr_End( VOID );
VOID  sosMIDISong_Start( VOID );
VOID  sosMIDISong_End( VOID );
VOID  sosMIDISt_Start( VOID );
VOID  sosMIDISt_End( VOID );
VOID  sosMIDITmpo_Start( VOID );
VOID  sosMIDITmpo_End( VOID );
VOID  sosMIDITmr_Start( VOID );
VOID  sosMIDITmr_End( VOID );
VOID  sosMIDIAWE_Start( VOID );
VOID  sosMIDIAWE_End( VOID );

void 	StringOut( BYTE X, BYTE Y, BYTE * String, BYTE Color );

#ifdef __cplusplus // HACK - ECH 96/01/26
}
#endif

#pragma pack()

#endif
