PlugInfo *ThePlug; // Pointers on plugs code & infos
short TotalPlug; // no of Plugs in pointer ThePlug
};
typedef struct MADLibrary MADLibrary;
struct MADDriverRec
{
/**********************/
/** Public variables **/
/**********************/
MADDriverSettings DriverSettings; // Driver SetUp -- READ ONLY --
/** Current music in memory, loaded with RLoadMusic() by example **/
MADMusic *curMusic; // Current music played by this driver, it can be 0L !!!
MADLibrary *lib;
/** Drivers variables **/
Channel chan[ MAXTRACK]; // Current driver channels -- READ ONLY --
Boolean musicEnd; // Is music playing finished? -- READ ONLY --
short Tube[ MAXTRACK]; // Used in 'Tracks View' Window - View menu
short PartitionReader; // Current position in pattern (0...999)
short Pat; // Current ID Pattern, see 'Patterns list'
short PL; // Current position in partition, see 'Partition list'
long VolGlobal; // Global SOFTWARE volume (This is NOT Mac hardware volume!) from 0 to 64
short speed; // Current speed, see speed Effect
short finespeed; // Current finespeed, see speed Effect
short InstruTube[ MAXINSTRU]; // Used in 'Instrument View' Window - View menu
short VExt; // External music speed, see 'Adaptators' window. 80 = normal
short FreqExt; // External music pitch, see 'Adaptators' window. 80 = normal
Boolean Reading; // Reading indicator
Boolean Active[ MAXTRACK]; // Channel Active?
#ifdef _MAC_H
SndChannelPtr MusicChannelPP; // The SndChannelPtr to apply SndDoCommand, etc.
#endif // ONLY available if you are using MAC SoundManager driver
#ifdef _INTEL_H
LPDIRECTSOUND lpDirectSound; // The LPDIRECTSOUND to apply & get informations, etc.
LPDIRECTSOUNDBUFFER lpDirectSoundBuffer, lpSwSamp; // ONLY available if you are using Win95 DirectSound driver
#endif
/** Private variables - Not documented **/
/* DO NOT MODIFY OR USE these variables */
long MIN_PITCH, MAX_PITCH;
short smallcounter, trackDiv;
short PatternLoopE6, PatternLoopE6Count;
long FREQBASE;
short InstruActif[ MAXINSTRU];
Ptr SysHeapPtr, IntDataPtr, OscilloWavePtr;
Boolean JumpToNextPattern, endPattern, MADPlay;
long ASCBUFFER;
long BufSize;
long VSYNC, BufCounter, BytesToGenerate;
short vibrato_table[ 64];
short MIDIPortRefNum, gOutNodeRefNum;
short InstuNoOld[ MAXTRACK];
short NoteOld[ MAXTRACK];
short VelocityOld[ MAXTRACK];
Boolean TrackLineReading[ MAXTRACK];
Ptr OverShoot;
long *DASCBuffer;
short *DASCBuffer8;
long MDelay;
long RDelay;
Ptr ReverbPtr;
#ifdef _MAC_H
SndDoubleBufferHeader TheHeader;
#endif
};
typedef struct MADDriverRec MADDriverRec;
/******************** ***********************/
/*** EFFECTS ID ***/
/******************** ***********************/
enum {
arpeggioE = 0, // 0x00
downslideE = 1, // 0x01
upslideE = 2, // 0x02
portamentoE = 3, // 0x03
vibratoE = 4, // 0x04
portaslideE = 5, // 0x05
vibratoslideE = 6, // 0x06
nothingE = 7, // 0x07
panningE = 8, // 0x08
offsetE = 9, // 0x09
slidevolE = 10, // 0x0A
fastskipE = 11, // 0x0B
volumeE = 12, // 0x0C
skipE = 13, // 0x0D
extendedE = 14, // 0x0E
speedE = 15 // 0x0F
};
/******************** ***********************/
/*** FUNCTIONS ***/
/******************** ***********************/
#ifdef __cplusplus
extern "C" {
#endif
void MyDebugStr( short, char*, char*); // Internal Debugger function, NORMALLY it is never called, only when FATAL error
// You NEED to provide this function, see examples!
MADLibrary* MADGetMADLibraryPtr(); // Get MADDriver structure pointer.
OSErr MADInitLibrary( char *PlugsFolderName, Boolean sysMemory, MADLibrary **MADLib); // Library initialisation, you have to CALL this function if you want to use other functions & variables
OSErr MADDisposeLibrary( MADLibrary *MADLib); // Close Library, close music, close driver, free all memory
void MADGetBestDriver( MADDriverSettings *DriverInitParam); // Found and identify the current Mac sound hardware and fill DriverInitParam
OSErr MADCreateDriver( MADDriverSettings *DriverInitParam, MADLibrary *MADLib, MADDriverRec** returnDriver); // Music Driver initialization and memory allocation
OSErr MADDisposeDriver( MADDriverRec *MDriver); // Dispose the music driver, use it after RInitMusic()
OSErr MADStartDriver( MADDriverRec *MDriver); // NEW - Activate the sound generating procedure (interruption)
OSErr MADStopDriver( MADDriverRec *MDriver); // NEW - DESActivate the sound generating procedure (interruption)
OSErr MADPlayMusic( MADDriverRec *MDriver); // NEW - Read and play current music in memory - Call MADStartInterruption BEFORE
OSErr MADStopMusic( MADDriverRec *MDriver); // NEW - Stop reading current music in memory, Use MADCleanDriver to stop sounds
void MADCleanDriver( MADDriverRec *intDriver); // Clean the driver : stop playing sounds
OSErr MADReset( MADDriverRec *MDriver); // Reset the current music at the start position
OSErr MADGetMusicStatus( MADDriverRec *MDriver, long *fullTime, long *curTime); // Get informations about music position and duration, IN 1/60th SECS !! NOT IN SECS ANYMORE !!!!!!!
OSErr MADSetMusicStatus( MADDriverRec *MDriver, long minV, long maxV, long curV); // Change position of current music, by example MADSetMusicStatus( 0, 100, 50) = go to the middle of the music
OSErr MADSetHardwareVolume( long); // 0...64, Mac HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume
long MADGetHardwareVolume( void); // Return HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume