/* DO NOT DISTRIBUTE !!!! SUBJECT TO CHANGE !!! This is bla, not for gnf but sebelable optimurks. */ #define MANUID 0x4231 #define MANUPROD 1 struct PreludeBase { struct Library LibNode; UBYTE Flags; UBYTE Count; struct ExecBase *SysLib; ULONG DosLib; struct SegList *SegList; ULONG ExpLib; ULONG CardAd; struct PrlCtrl *PrlCtrl; ULONG IRQ; APTR SigTask; /* for IRQ signalling */ ULONG SigMask; /* e.g. Level Meter */ APTR SneakTask; /* for Sneak Signalling */ ULONG SneakMask; /* e.g. Record */ APTR LastPlayPointer; APTR LastRecPointer; struct List Cards; }; struct PrlCtrl { UBYTE *BaseAdress; /* 0 */ UBYTE VolumeLeftLine; /* 4 */ UBYTE VolumeRightLine; UBYTE VolumeLeftAux1; UBYTE VolumeRightAux1; UBYTE VolumeLeftAux2; UBYTE VolumeRightAux2; UBYTE VolumeMonoIn; UBYTE VolumeLoopback; /* LoopBack control */ UBYTE VolumeLeftDAC; UBYTE VolumeRightDAC; UBYTE InputGainLeft; UBYTE InputGainRight; UBYTE LeftInput; /* which channel is to be used for sampling left */ UBYTE RightInput; /* which channel is to be used for sampling right */ UBYTE RunningMode; /* 18 */ /* see below */ UBYTE SamplingMode; /* 19 */ /* See Flags below */ UBYTE DataLength; /* 1 or 2 depending on Sampling Mode (8Bit or 16Bit) */ UBYTE Dummy1; UWORD Frequency; /* 22 */ /* possible frequencies are: 5510 Hz 6620 Hz 8000 Hz - Telecom 9600 Hz 11025 Hz 16000 Hz - musical standard 18900 Hz 22050 Hz - Amiga optimal sound ( CD/2 ) 27420 Hz 32000 Hz - DAT LongPlay / DSR 33075 Hz 37800 Hz 44100 Hz - CD (Philips Standard) 48000 Hz - DAT Standard */ UBYTE FilterEnabled; /* enables High Pass filter of the ADC. - forces the ADC offset to 0 ! */ UBYTE LMicGainEnabled; /* enables left MIC 20dB Gain */ UBYTE RMicGainEnabled; /* enables right MIC 20dB Gain */ UBYTE LastError; UBYTE *PLAY_SampleStart1; /* 28 */ /* These are pointers to actually used */ UBYTE *PLAY_SampleStart2; /* 32 */ /* memory areas */ UBYTE *PLAY_SampleEnd1; /* 36 */ UBYTE *PLAY_SampleEnd2; /* 40 */ UBYTE *PLAY_Pointer1; /* 44 */ /* They are updated by the library constantly */ UBYTE *PLAY_Pointer2; /* 48 */ /* and can be used e.g. to get the latest */ UBYTE *REC_SampleStart1; /* single sample value */ UBYTE *REC_SampleStart2; UBYTE *REC_SampleEnd1; UBYTE *REC_SampleEnd2; UBYTE *REC_Pointer1; UBYTE *REC_Pointer2; APTR PL_Anchor; /* Anchor for Playlist and other goodies */ ULONG SIG_Sneak; /* Sig Adress Pointer for Record and Play */ APTR PL_SigTask; /* Task to signal when getting new Playpointers from Playlist */ ULONG PL_SigMask; /* SigMask to signal to that task */ APTR UserData; /* for extensions */ /* internal values */ UWORD play_offset; /* actual value of bytes to play before adding pause_offset_play */ UWORD record_offset; /* actual value of bytes to record before adding pause_offset_record */ UWORD pause_offset_play; /* actual value to add after play_offset bytes have been played */ UWORD pause_offset_record; /* actual value to add after record_offset bytes have been recorded */ UWORD PRL_Status; /* internal Status register */ }; struct PrlNode { struct Node node; APTR start1,end1; UBYTE mode; UWORD frequency; APTR start2,end2; }; #define PRL_err_ok 0 #define PRL_err_mem 1 #define PRL_err_ni 2 #define PRL_err_noIRQ 3 /*********************************************** FLAGS defined for prelude library routines. ***********************************************/ /* These are BITs for the state of each channel */ #define PRL_PlayActive 0x01 #define PRL_RecActive 0x02 #define PRL_LeftActive 0x10 #define PRL_RightActive 0x20 /* These are INPUTs for the sampling device */ #define PRL_InLINE 0x00 #define PRL_InAUX1 0x40 #define PRL_InMIC 0x80 #define PRL_LoopBack 0xc0 /* These are MODE BITs for the sampling device */ #define PRL_Stereo 0x10 /* if this bit is NOT set, Mode is MONO */ #define PRL_Compressed 0x20 /* SET: means compressed sound data, format in PRL_FMT: 0 - ULAW 1 - ALAW CLR: means linear sound data, format in PRL_FMT: 0 - 8 BIT 1 - 16 BIT (LittleEndian) */ #define PRL_FMT 0x40 /* see above */ #define PRL_FMTX 0x80 /* if this bit is SET there are more sampling/playback formats available: if using 16Bit uncompressed mode ( PRL_FMT = 1 PRL_Compressed = 0 ) BigEndian is used instead of LittleEndian if using 8Bit ULAW mode ( PRL_FMT = 0 PRL_Compressed = 1 ) ADPCM 4-bit (IMA compatible) is used. other modes are not implemented and should be left al1. */ #define MIC_GAIN_ENABLE 0x20 /* to enable 20dB MIC booster */ /* these are bits for the MONO amplifier of the Prelude */ #define MONO_OUT_BYPASS 0x20 /* Mono In muted, Mono Out mixed */ #define MONO_OUT_THROUGH 0x00 /* Mono In mixed to Out */ #define MONO_OUT_MUTE 0x40 /* Mono Out muted, Mono In mixed */ /*....................................................................... TAGs to change PrlCtrl structure .......................................................................*/ #define PRL_VOL_LINE_LEFT (TAG_USER+14) /* VolumeLeftLine */ #define PRL_VOL_LINE_RIGHT (TAG_USER+15) /* VolumeRightLine */ #define PRL_VOL_A1_LEFT (TAG_USER+1) /* VolumeLeftAux1; */ #define PRL_VOL_A1_RIGHT (TAG_USER+2) /* VolumeRightAux1; */ #define PRL_VOL_A2_LEFT (TAG_USER+3) /* VolumeLeftAux2; */ #define PRL_VOL_A2_RIGHT (TAG_USER+4) /* VolumeRightAux2; */ #define PRL_VOL_MONO (TAG_USER+13) /* VolumeMono Control */ #define PRL_VOL_LOOPB (TAG_USER+16) /* VolumeLoopback */ #define PRL_VOL_DAC_LEFT (TAG_USER+5) /* DACVolumeLeft; */ #define PRL_VOL_DAC_RIGHT (TAG_USER+6) /* DACVolumeRight; */ #define PRL_ING_LEFT (TAG_USER+7) /* InputGainLeft; */ #define PRL_ING_RIGHT (TAG_USER+8) /* InputGainRight; */ #define PRL_MING_LEFT (TAG_USER+21) /* Left MIC Gain */ #define PRL_MING_RIGHT (TAG_USER+22) /* Right MIC Gain */ #define PRL_INPUT_LEFT (TAG_USER+9) /* LeftInput; */ #define PRL_INPUT_RIGHT (TAG_USER+10) /* RightInput; */ #define PRL_SMPL_MODE (TAG_USER+11) /* SamplingMode */ #define PRL_HPF (TAG_USER+20) /* Enable/Disable HP-Filter */ #define PRL_FREQUENCY (TAG_USER+12) /* Frequency */ /*....................................................................... additional offset defines for use in PrlPlayBuff calls .......................................................................*/ #define PRL_BUFF1 (TAG_USER+32) /* Start of first buffer */ #define PRL_BUFF2 (TAG_USER+33) /* start of second buffer */ #define PRL_BUFF_LENGTH (TAG_USER+36) /* overall length in bytes of buffer */ #define PRL_LOOP (TAG_USER+34) /* start of loop */ #define PRL_LOOP_END (TAG_USER+35) /* end point of loop NOTE: if 1 of the running pointers has reached this address the loop is started at its start address */ #define PRL_OSET_RUN (TAG_USER+37) /* number of bytes to be played before skipping pause_offset bytes */ #define PRL_OSET_PAUSE (TAG_USER+38) /* number of bytes to be skipped - signed! */ #define PRL_SIG_ADR (TAG_USER+40) /* address where a signal shall be sent. NOTE: if 1 of the running pointers has reached this address the task is signalled. */ #define PRL_SIG_TASK (TAG_USER+41) /* (struct Task *) to be signalled */ #define PRL_SIG_MASK (TAG_USER+42) /* signal mask to be sent to the task */ /* ----------------------------------------------------------------------- internal status bits ----------------------------------------------------------------------- */ #define PRL_STATUS_PLAYING 0x1000 #define PRL_STATUS_FIFOUSE 0x2000 #define PRL_STATUS_IRQRUN 0x4000 #define PRL_STATUS_NOIRQ 0x8000 #define PRL_STATUS_PLAYPAUSE 0x0100 #define PRL_STATUS_RECPAUSE 0x0200