home *** CD-ROM | disk | FTP | other *** search
/ Amiga Dream 59 / CDDream59.ISO / BeOs / Sound / Intel / PPBeDevKit.ZIP / PLAYERPR.TAR / PlayerPRO / Source / RDriver.h < prev    next >
C/C++ Source or Header  |  1999-01-02  |  22KB  |  592 lines

  1. /********************                        ***********************/
  2. //
  3. //    Player PRO 5.0 - DRIVER SOURCE CODE -
  4. //
  5. //    Library Version 5.0
  6. //
  7. //    To use with MAD Library for Mac: Symantec, CodeWarrior and MPW
  8. //
  9. //    Antoine ROSSET
  10. //    16 Tranchees
  11. //    1206 GENEVA
  12. //    SWITZERLAND
  13. //
  14. //    COPYRIGHT ANTOINE ROSSET 1996, 1997, 1998
  15. //
  16. //    Thank you for your interest in PlayerPRO !
  17. //
  18. //    FAX:                (+41 22) 346 11 97
  19. //    PHONE:             (+41 79) 203 74 62
  20. //    Internet:     RossetAntoine@bluewin.ch
  21. //
  22. /********************                        ***********************/
  23.  
  24. #ifndef __RDRIVERH__
  25. #define __RDRIVERH__
  26.  
  27. #include "MAD.h"
  28.  
  29. ////////////////////////////////////////////////
  30.  
  31. #ifdef _MAC_H
  32. #ifndef __SOUND__
  33. #include <Sound.h>
  34. #endif
  35.  
  36. #ifndef __RETRACE__
  37. #include <Retrace.h>
  38. #endif
  39. #endif
  40.  
  41. ////////////////////////////////////////////////
  42.  
  43. #ifdef _INTEL_H
  44. #ifndef __DSOUND_INCLUDED__
  45. #include <mmreg.h>
  46. #include <DSound.h>
  47. #endif
  48. #endif
  49.  
  50. ////////////////////////////////////////////////
  51.  
  52. #if defined(powerc) || defined (__powerc)
  53. #pragma options align=mac68k
  54. #else
  55. #if !defined(THINK_C)
  56. #pragma options align=mac68k
  57. #endif
  58. #endif
  59.  
  60. ////////////////////////////////////////////////
  61.  
  62. /********************                        ***********************/
  63. /***                         Define List                            ***/
  64. /********************                        ***********************/
  65.  
  66. #define NUMBER_NOTES        96
  67. #define NOFINETUNE            8363
  68. #define MIN_VOLUME            0
  69. #define MAX_VOLUME            64
  70. #define MAX_PANNING            64
  71. //#define MAXTRACK            32
  72. //#define MAXINSTRU            64
  73. #define MAXSAMPLE            64L
  74. #define MAXPATTERN            200
  75. #define MAXPATTERNSIZE        900
  76. #define MAX_ARP             3
  77. #define MAXPLUG                40
  78. /********************                        ***********************/
  79. /***                         Error messages                         ***/
  80. /********************                        ***********************/
  81.  
  82. enum
  83. {
  84.     MADNeedMemory                     = -1,
  85.     MADReadingErr                    = -2,
  86.     MADIncompatibleFile                = -3,
  87.     MADLibraryNotInitialized        = -4,
  88.     MADParametersErr                = -5,
  89.     MADUnknowErr                    = -6,
  90.     MADSoundManagerErr                = -7,
  91.     MADOrderNotImplemented            = -8,
  92.     MADFileNotSupportedByThisPlug    = -9,
  93.     MADCannotFindPlug                = -10,
  94.     MADMusicHasNoDriver                = -11,
  95.     MADDriverHasNoMusic                = -12
  96. };
  97.  
  98. /********************                        ***********************/
  99. /***                Channel structure definition                    ***/
  100. /********************                        ***********************/
  101.  
  102. struct Channel
  103. {
  104.         long        ID;                    // Channel ID - 0 to MAXTRACK
  105.  
  106.         Ptr            begPtr;                // Sample Data Ptr - Beginning of data
  107.         Ptr            maxPtr;                // Sample Data Ptr - End of data
  108.         Ptr            curPtr;                // Sample Data Ptr - Current position
  109.         long        sizePtr;            // Sample Size in bytes
  110.         
  111.         long        amp;                // Sample amplitude: 8 or 16 bits
  112.         
  113.         long        loopBeg;            // Loop Beginning
  114.         long        loopSize;            // Loop Size
  115.         
  116.         long        ins;                // Current Instrument ID
  117.         long        insOld;                // Previous Instrument ID played on this channel
  118.         long        samp;                // Current Sample ID
  119.         
  120.         long        fineTune;            // Finetune
  121.         
  122.         long        note;                // Note
  123.         long        noteOld;            // Previous note played on this channel
  124.         
  125.         long         period;                // Current period
  126.         long        periodOld;            // Previous period played on this channel
  127.         
  128.         long        vol;                // Channel vol (0 to 64)
  129.         long        pann;                // Channel pan (0 to 64)
  130.         
  131.         long         cmd;                // Command
  132.         Byte        arg;                // Argument of command
  133.         Byte        volcmd;                // Volume Command
  134.         
  135.         long         arp[ MAX_ARP];        // Used for arpeggio command
  136.         long         arpindex;            // Used for arpeggio command
  137.         Boolean        arpUse;
  138.         
  139.         char        viboffset;            // Used for vibrato command
  140.         long         vibdepth;            // Used for vibrato command
  141.         long         vibrate;            // Used for vibrato command
  142.         long        vibtype;            // Used for vibrato command
  143.         
  144.         long         slide;                // Used for slideUp and slideDown command
  145.         
  146.         long         pitchgoal;            // Used for portamento command
  147.         long         pitchrate;            // Used for portamento command
  148.         
  149.         long         volumerate;            // Used for slideVolume command
  150.         
  151.         long        oldArg[ 16];
  152.         
  153.         Ptr            samplePtr;            // Used internaly by MADPlaySoundData & MADPlaySndHandle
  154.         
  155.         /**/
  156.         
  157.         Boolean        KeyOn;
  158.         short        a;
  159.         short        b;
  160.         short        p;
  161.         long        volEnv;
  162.         long        volFade;
  163.         
  164.         short        aa;
  165.         short        bb;
  166.         short        pp;
  167.         long        pannEnv;
  168.         
  169.         long        lAC;
  170.         
  171.         Ptr            prevPtr;
  172.         long        lastWordL, curLastWordL;
  173.         long        lastWordR, curLastWordR;
  174.         long        curLevelL, curLevelR;
  175.         
  176.         Boolean        LevelDirectionL, LevelDirectionR, RemoverWorking;
  177.         
  178.         long        prevVol0;
  179.         long        prevVol1;
  180.         
  181.         /**/
  182.         
  183.         Boolean        GEffect;
  184.         short        GPat, GReader;
  185.         
  186.         /**/
  187.         
  188.         Boolean        stereo;
  189.         
  190.         Byte        loopType;
  191.         Boolean        pingpong;
  192.         
  193.         long        preOff;
  194.         char        preVal, preVal2;
  195.         char        preValR, preVal2R;
  196.         
  197.         short        spreVal, spreVal2;
  198.         short        spreValR, spreVal2R;
  199.         long        TICKREMOVESIZE;
  200. };
  201. typedef        struct Channel    Channel;
  202.  
  203. /********************                        ***********************/
  204. /***         Music description - used in Import/Export filter    ***/
  205. /********************                        ***********************/
  206.  
  207. struct    MADMusic
  208. {
  209.     MADSpec                    *header;                                // Music Header - See 'MAD.h'
  210.     PatData                    *partition[ MAXPATTERN];                // Patterns
  211.     InstrData                *fid;                                    // Instruments
  212.     sData                    **sample;                                // Samples
  213.     Boolean                    musicUnderModification;                    // Tell the driver to NOT access music data
  214.     
  215. };
  216. typedef        struct MADMusic    MADMusic;
  217.  
  218. /********************                        ***********************/
  219. /***                  Driver Settings definition                    ***/
  220. /********************                        ***********************/
  221.  
  222. enum
  223. {
  224.     oldASCSoundDriver = 1,            // MAC ONLY,    // NOT SUPPORTED anymore
  225.     oldAWACSoundDriver,                // MAC ONLY        // NOT SUPPORTED anymore
  226.     MIDISoundDriver,                // MAC ONLY
  227.     SoundManagerDriver,                // MAC ONLY You should use only SoundManagerDriver for full compatibility !
  228.     QK25SoundDriver,                // MAC ONLY
  229.     DigiDesignSoundDriver,            // MAC ONLY
  230.     BeOSSoundDriver,                // BE ONLY when using with BeOS compatible systems ! - NOT FOR MAC
  231.     DirectSound95NT,                // WINDOWS 95/NT ONLY when using with PC compatible systems ! - NOT FOR MAC
  232.     Wave95NT,                        // WINDOWS 95/NT ONLY when using with PC compatible systems ! - NOT FOR MAC
  233.     NoHardwareDriver                // NO HARDWARE CONNECTION, will not produce any sound
  234. };
  235.  
  236. enum
  237. {
  238.     oldMonoOutPut = 1,                // NOT SUPPORTED anymore
  239.     oldStereoOutPut,                // NOT SUPPORTED anymore
  240.     DeluxeStereoOutPut,                // USE THIS ONE ONLY !!!!!!!!!!!!!!
  241.     PolyPhonic                        // Do NOT use it ! Standard hardware doesn't support it !
  242. };
  243.  
  244. struct MADDriverSettings
  245. {
  246.     short                    numChn;                                // Active tracks from 2 to 32, automatically setup when a new music is loaded
  247.     short                    outPutBits;                            // 8 or 16 Bits
  248.     unsigned long            outPutRate;                            // Fixed number, by example : rate44khz, rate22050hz, rate22khz, rate11khz, rate11025hz
  249.     short                    outPutMode;                            // Now, only DeluxeStereoOutPut is available !
  250.     short                    driverMode;                            // MIDISoundDriver, SoundManagerDriver, BeOSSoundDriver, DirectSound95NT or Wave95NT
  251. //    Boolean                    antiAliasing;                        // NOT USED anymore
  252.     Boolean                    repeatMusic;                        // If music finished, repeat it or stop.
  253.     Boolean                    sysMemory;                            // Allocate memory in Application Heap (false) or in System Heap (true)
  254. //    Boolean                    Interpolation;                        // NOT USED anymore
  255. //    Boolean                    MicroDelay;                            // NOT USED anymore
  256.     long                    MicroDelaySize;                        // Micro delay duration (in ms, max 1 sec = 1000 ms, min = 0 ms)
  257.     Boolean                    surround;                            // Surround effect active? true/false
  258.     Boolean                    Reverb;                                // Reverb effect active? true/false
  259.     long                    ReverbSize;                            // Reverb delay duration (in ms, min = 25 ms, max 1 sec = 1000 ms)
  260.     long                    ReverbStrength;                        // Reverb strength in % (0 <-> 70)
  261.     Boolean                    TickRemover;                        // Remove volume/sample/loop ticks.
  262. };
  263. typedef struct MADDriverSettings MADDriverSettings;
  264.  
  265. /******************************************************************/
  266. //******************* MUSICS IMPORT/EXPORT PLUGS  *****************/
  267. //
  268. //    Protocol Version 2.3
  269. //
  270. //    To use with PlayerPRO for CodeWarrior
  271. //
  272. //    Your main function have to be in this form:
  273. //    OSErr main(     OSType order,
  274. //                    Ptr AlienFileName,
  275. //                    MADMusic *MadFile,
  276. //                    PPInfoRec *info,
  277. //                    MADDriverSettings *DriverParam);
  278. //
  279. //    Actual plug have to support these orders:
  280. //
  281. //    order: 'TEST':    check the AlienFile to see if your Plug really supports it.
  282. //    order: 'IMPT':    convert the AlienFile into a MADMusic. You have to allocate MADMusic.
  283. //    order: 'INFO':    Fill PPInfoRec structure.
  284. //    order: 'EXPT':    Convert the MADMusic into AlienFile. You have to create the AlienFile.
  285. //                    Don't delete the MADMusic Structure after conversion !!
  286. //
  287. //    An IMPORT plug have to support these orders: 'TEST', 'IMPT', 'INFO'
  288. //    An EXPORT plug have to support these orders: 'EXPT'
  289. //     An IMPORT/EXPORT plug have to support these orders: 'TEST', 'IMPT', 'INFO', 'EXPT'
  290. //
  291. //    About Resources:
  292. //
  293. //    Your Plug should have: Creator: 'SNPL', Type: 'IMPL' - MAC ONLY
  294. //
  295. //    Your Plug have to have these resources - MAC ONLY:
  296. //
  297. //    - One segment CODE 1000 with 68k Code
  298. //    - One segment PPCC 1000 with PPC Code (OPTIONAL: if PlayerPRO in PPC cannot find it, it will use the CODE 1000 resource)
  299. //    - One STR# resource :
  300. //
  301. //        1 string: which kind of files your plug support (OSType value!!! 4 char) By example: 'STrk', '669 ', etc...
  302. //        2 string: what does your Plug: EXPL : only Export files, IMPL : only Import Files, EXIM : import AND export.
  303. //        3 string: string that will be used in Import and Export menu of PlayerPRO
  304. //        4 string: Copyright string of this plug.
  305. //
  306. /********************                        ***********************/
  307.  
  308. struct PPInfoRec
  309. {
  310.     char        internalFileName[ 60];
  311.     char        formatDescription[ 60];
  312.     
  313.     long        totalPatterns;
  314.     long        partitionLength;
  315.     
  316.     short        totalTracks;
  317.     short        totalInstruments;
  318.     
  319.     OSType        signature;
  320.     
  321.     long        fileSize;
  322.     
  323. };
  324. typedef struct PPInfoRec PPInfoRec;
  325.  
  326.  
  327. /********************                        ***********************/
  328. /***             Informations about Plugs: ThePlug[]                ***/
  329. /********************                        ***********************/
  330.  
  331. #ifdef _MAC_H
  332. struct PlugInfo
  333. {
  334.     Handle        IOPlug;                                            // Plug CODE
  335.     Str63        MenuName;                                        // Plug name
  336.     Str63        AuthorString;                                    // Plug author
  337.     FSSpec        file;                                            // Location of plug file
  338.     char        type[ 5];                                        // OSType of file support
  339.     OSType        mode;                                            // Mode support : Import +/ Export
  340.     Boolean        hasPPCCode;                                        // Is Plug FAT?
  341. };
  342. typedef struct PlugInfo PlugInfo;
  343. #endif
  344.  
  345. #ifdef _INTEL_H
  346. //#include "windows.h"
  347. typedef OSErr (*PLUGDLLFUNC) ( OSType , Ptr , MADMusic* , PPInfoRec *, MADDriverSettings *);
  348. struct PlugInfo
  349. {
  350.     HANDLE            hLibrary;
  351.     PLUGDLLFUNC        IOPlug;                                        // Plug CODE
  352.     char            MenuName[ 65];                                // Plug name
  353.     char            AuthorString[ 65];                            // Plug author
  354.     char            file[ 255];                                    // Location of plug file
  355.     char            type[ 5];                                    // OSType of file support
  356.     OSType            mode;                                        // Mode support : Import +/ Export
  357. };
  358. typedef struct PlugInfo PlugInfo;
  359. #endif
  360.  
  361. #ifdef _BE_H
  362.  
  363. typedef    OSErr (*MADPlug)( OSType order, Ptr AlienFileName, MADMusic *MadFile, PPInfoRec *info, MADDriverSettings *init);
  364.  
  365. struct PlugInfo
  366. {
  367.     image_id        hLibrary;
  368.     MADPlug            IOPlug;                                        // Plug CODE
  369.     char            MenuName[ 65];                                // Plug name
  370.     char            AuthorString[ 65];                            // Plug author
  371.     char            file[1024];                                    // Location of plug file
  372.     char            type[ 5];                                    // OSType of file support
  373.     OSType            mode;                                        // Mode support : Import +/ Export
  374. };
  375. typedef struct PlugInfo PlugInfo;
  376. #endif
  377. /********************                        ***********************/
  378. /***         Global structure : PlayerPRO variables                ***/
  379. /********************                        ***********************/
  380.  
  381. struct MADLibrary
  382. {
  383.     long                    IDType;                                // IDType = 'MADD' -- READ ONLY --
  384.     Boolean                    sysMemory;
  385.     long                    mytab[ 12];
  386.     
  387.     /** Plugs Import/Export variables **/
  388.     
  389.     PlugInfo                 *ThePlug;                            // Pointers on plugs code & infos
  390.     short                    TotalPlug;                            // no of Plugs in pointer ThePlug
  391.  
  392. };
  393. typedef struct MADLibrary MADLibrary;
  394.  
  395. struct MADDriverRec
  396. {
  397.     /**********************/
  398.     /** Public variables **/
  399.     /**********************/
  400.     
  401.     MADDriverSettings        DriverSettings;                                    // Driver SetUp -- READ ONLY --
  402.     
  403.     /**  Current music in memory, loaded with RLoadMusic() by example **/
  404.     
  405.     MADMusic                *curMusic;                                        // Current music played by this driver, it can be 0L !!!
  406.     MADLibrary                *lib;
  407.     
  408.     /**  Drivers variables **/
  409.     
  410.     Channel                    chan[ MAXTRACK];                                // Current driver channels -- READ ONLY --
  411.     Boolean                    musicEnd;                                        // Is music playing finished? -- READ ONLY --
  412.     short                    Tube[ MAXTRACK];                                // Used in 'Tracks View' Window - View menu 
  413.     short                    PartitionReader;                                // Current position in pattern (0...999)
  414.     short                    Pat;                                            // Current ID Pattern, see 'Patterns list'
  415.     short                    PL;                                                // Current position in partition, see 'Partition list'
  416.     long                    VolGlobal;                                        // Global SOFTWARE volume (This is NOT Mac hardware volume!) from 0 to 64
  417.     short                    speed;                                            // Current speed, see speed Effect
  418.     short                    finespeed;                                        // Current finespeed, see speed Effect
  419.     short                    InstruTube[ MAXINSTRU];                            // Used in 'Instrument View' Window - View menu
  420.     short                    VExt;                                            // External music speed, see 'Adaptators' window. 80 = normal
  421.     short                    FreqExt;                                        // External music pitch, see 'Adaptators' window. 80 = normal
  422.     Boolean                    Reading;                                        // Reading indicator
  423.     Boolean                    Active[ MAXTRACK];                                // Channel Active?
  424.     
  425.     #ifdef _MAC_H
  426.     SndChannelPtr             MusicChannelPP;                                    // The SndChannelPtr to apply SndDoCommand, etc.
  427.     #endif                                                                    // ONLY available if you are using MAC SoundManager driver
  428.     
  429.     #ifdef _INTEL_H
  430.     LPDIRECTSOUND            lpDirectSound;                                    // The LPDIRECTSOUND to apply & get informations, etc.
  431.     LPDIRECTSOUNDBUFFER        lpDirectSoundBuffer, lpSwSamp;                    // ONLY available if you are using Win95 DirectSound driver
  432.     #endif    
  433.     
  434.     /** Private variables - Not documented **/
  435.     /* DO NOT MODIFY OR USE these variables */
  436.     
  437.     long                    MIN_PITCH, MAX_PITCH;
  438.     short                    smallcounter, trackDiv;
  439.     short                    PatternLoopE6, PatternLoopE6Count;
  440.     long                    FREQBASE;
  441.     short                    InstruActif[ MAXINSTRU];
  442.     Ptr                        SysHeapPtr, IntDataPtr, OscilloWavePtr;
  443.     Boolean                    JumpToNextPattern, endPattern, MADPlay;
  444.     long                    ASCBUFFER;
  445.     long                    BufSize;
  446.     long                    VSYNC, BufCounter, BytesToGenerate;
  447.     short                    vibrato_table[ 64];
  448.     short                    MIDIPortRefNum, gOutNodeRefNum;
  449.     short                    InstuNoOld[ MAXTRACK];
  450.     short                    NoteOld[ MAXTRACK];
  451.     short                    VelocityOld[ MAXTRACK];
  452.     Boolean                    TrackLineReading[ MAXTRACK];
  453.     Ptr                        OverShoot;
  454.     long                    *DASCBuffer;
  455.     short                    *DASCBuffer8;
  456.     long                    MDelay;
  457.     long                    RDelay;
  458.     Ptr                        ReverbPtr;
  459.     
  460.     #ifdef _MAC_H
  461.     SndDoubleBufferHeader     TheHeader;
  462.     
  463.     #endif
  464. };
  465. typedef struct MADDriverRec MADDriverRec;
  466.  
  467. /********************                        ***********************/
  468. /***                        EFFECTS ID                            ***/
  469. /********************                        ***********************/
  470.  
  471. enum {
  472.         arpeggioE         = 0,    //    0x00
  473.         downslideE         = 1,    //    0x01
  474.         upslideE         = 2,    //    0x02
  475.         portamentoE     = 3,    //    0x03
  476.         vibratoE         = 4,    //    0x04
  477.         portaslideE     = 5,    //    0x05
  478.         vibratoslideE    = 6,    //    0x06
  479.         nothingE         = 7,    //    0x07
  480.         panningE        = 8,    //    0x08
  481.         offsetE         = 9,    //    0x09
  482.         slidevolE         = 10,    //    0x0A
  483.         fastskipE         = 11,    //    0x0B
  484.         volumeE         = 12,    //    0x0C
  485.         skipE             = 13,    //    0x0D
  486.         extendedE         = 14,    //    0x0E
  487.         speedE             = 15    //    0x0F
  488.     };
  489.  
  490. /********************                        ***********************/
  491. /***                        FUNCTIONS                            ***/
  492. /********************                        ***********************/
  493.  
  494.  
  495. #ifdef __cplusplus
  496. extern "C" {
  497. #endif
  498.  
  499. void MyDebugStr( short, char*, char*);                                // Internal Debugger function, NORMALLY it is never called, only when FATAL error
  500.                                                                     // You NEED to provide this function, see examples!
  501.  
  502. MADLibrary* MADGetMADLibraryPtr();                                    // Get MADDriver structure pointer.
  503.  
  504. OSErr    MADInitLibrary( char *PlugsFolderName, Boolean sysMemory, MADLibrary **MADLib);    // Library initialisation, you have to CALL this function if you want to use other functions & variables
  505. OSErr    MADDisposeLibrary( MADLibrary *MADLib);                        // Close Library, close music, close driver, free all memory
  506.  
  507. void    MADGetBestDriver( MADDriverSettings    *DriverInitParam);        // Found and identify the current Mac sound hardware and fill DriverInitParam
  508. OSErr    MADCreateDriver( MADDriverSettings    *DriverInitParam, MADLibrary *MADLib, MADDriverRec** returnDriver);        // Music Driver initialization and memory allocation
  509. OSErr    MADDisposeDriver( MADDriverRec *MDriver);                                            // Dispose the music driver, use it after RInitMusic()
  510.  
  511. OSErr    MADChangeDriverSettings( MADDriverSettings    *DriverInitParam, MADDriverRec** returnDriver);
  512.  
  513. OSErr    MADStartDriver( MADDriverRec *MDriver);                                        // NEW - Activate the sound generating procedure (interruption)
  514. OSErr    MADStopDriver( MADDriverRec *MDriver);                                        // NEW - DESActivate the sound generating procedure (interruption)
  515.  
  516. OSErr    MADPlayMusic( MADDriverRec *MDriver);                                        // NEW - Read and play current music in memory - Call MADStartInterruption BEFORE
  517. OSErr    MADStopMusic( MADDriverRec *MDriver);                                        // NEW - Stop reading current music in memory, Use MADCleanDriver to stop sounds
  518. void    MADCleanDriver( MADDriverRec *intDriver);                                    // Clean the driver : stop playing sounds
  519.  
  520. OSErr    MADReset( MADDriverRec *MDriver);                                            // Reset the current music at the start position
  521. OSErr    MADGetMusicStatus( MADDriverRec *MDriver, long *fullTime, long *curTime);            // Get informations about music position and duration, IN 1/60th SECS !! NOT IN SECS ANYMORE !!!!!!!
  522. 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
  523.  
  524. OSErr    MADSetHardwareVolume( long);                                // 0...64, Mac HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume
  525. long    MADGetHardwareVolume( void);                                        // Return HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume
  526.  
  527. OSErr    MADAttachDriverToMusic( MADDriverRec *driver, MADMusic *music);
  528.  
  529. OSErr    MADLoadMusicRsrc( MADMusic **music, OSType IDName, short IDNo);                // MAD ONLY - Load a MAD Rsrc into memory
  530. OSErr    MADLoadMusicPtr( MADMusic **music, Ptr myPtr);                                // MAD ONLY - Load a MAD Ptr into memory, you can DisposPtr your Ptr after this call
  531.  
  532. OSErr    MADLoadMusicFilePString( MADLibrary *, MADMusic **music, char *type, Str255 fName);            // Load a music file with plugs
  533. OSErr    MADLoadMusicFileCString( MADLibrary *, MADMusic **music, char *type, Ptr fName);            // Load a music file with plugs
  534. OSErr    MADLoadMusicFSpFile( MADLibrary *, MADMusic **music, char *type, FSSpec *theSpec);            // Load a music file with plugs
  535.  
  536. OSErr    MADMusicIdentifyPString( MADLibrary *, char *type, Str255 pName);            // Identify what kind of music format is pName file.
  537. OSErr    MADMusicIdentifyCString( MADLibrary *, char *type, Ptr cName);            // Identify what kind of music format is cName file.
  538. OSErr    MADMusicIdentifyFSp( MADLibrary *, char *type, FSSpec *theSpec);            // Identify what kind of music format is theSpec file.
  539.  
  540. Boolean    MADPlugAvailable( MADLibrary *, char *type);                                // Is plug 'type' available?
  541.  
  542. OSErr    MADDisposeMusic( MADMusic **);                                // Dispose the current music, use it after RLoadMusic(), RLoadMusicRsrc(), RInstallMADF()
  543.  
  544. void    MADChangeTracks( MADDriverRec *MDriver, short);                // Change current tracks number of the music driver
  545. Cmd*    GetMADCommand(    short        position,                        // Extract a Command from a PatData structure
  546.                         short        channel,
  547.                         PatData*    aPatData);
  548.  
  549. OSErr    MADPlaySndHandle(     MADDriverRec *MDriver,
  550.                             Handle sound,                            // Handle to a 'snd ' handle, by ex: GetResource('snd ', 128);
  551.                             long chan,                                // channel ID on which to play sound
  552.                             long note);                                // note: 0 to NUMBER_NOTES or 0xFF: play sound at his normal sampleRate Khz
  553.  
  554. OSErr    MADPlaySoundData(    MADDriverRec *MDriver,
  555.                             Ptr                soundPtr,                // Sound Pointer to data
  556.                             long            size,                    // Sound size in bytes
  557.                             long            channel,                // channel ID on which to play sound
  558.                             long            note,                    // note: 0 to NUMBER_NOTES or 0xFF: play sound at 22 Khz
  559.                             long            amplitude,                // 8 or 16 bits
  560.                             long            loopBeg,                // loop beginning
  561.                             long            loopSize,                // loop size in bytes
  562.                             unsigned long    rate,                    // sample rate of the sound data, by ex: rate22khz
  563.                             Boolean            stereo);                // sample is in stereo or in mono?
  564.                             
  565. OSErr    MADPlaySoundDataSYNC(MADDriverRec *MDriver,
  566.                             Ptr                soundPtr,                // Sound Pointer to data
  567.                             long            size,                    // Sound size in bytes
  568.                             long            channel,                // channel ID on which to play sound
  569.                             long            note,                    // note: 0 to NUMBER_NOTES or 0xFF: play sound at 22 Khz
  570.                             long            amplitude,                // 8 or 16 bits
  571.                             long            loopBeg,                // loop beginning
  572.                             long            loopSize,                // loop size in bytes
  573.                             unsigned long    rate,                    // sample rate of the sound data, by ex: rate22khz
  574.                             Boolean            stereo);                // sample is in stereo or in mono?
  575.  
  576. Ptr MADNewPtr( long size, MADLibrary* init);
  577. Ptr MADNewPtrClear( long size, MADLibrary* init);
  578.  
  579. void MyDebugStr(short, Ptr, Ptr);                                    // Called when a fatal error occurs.... Normally, NEVER !
  580.  
  581. #ifdef __cplusplus
  582. }
  583. #endif
  584.  
  585. #if defined(powerc) || defined (__powerc)
  586. #pragma options align=reset
  587. #else
  588. #if !defined(THINK_C)
  589. #pragma options align=reset
  590. #endif
  591. #endif
  592. #endif