MusicKit  0.0.0
libdsp.h
00001 #ifndef __MK_libdsp_H___
00002 #define __MK_libdsp_H___
00003 /* libdsp.h - external declarations for functions in libdsp_s.a 
00004  * Copyright 1988-1992, NeXT Inc.  All rights reserved.
00005  * Author: Julius O. Smith III
00006  *
00007  * Note that libdsp_s.a depends only on libsys_s.a.
00008  *
00009  * Functions with prefix DSPMK work only in conjunction with the 
00010  * DSP Music Kit Monitor "/usr/local/lib/dsp/monitor/mkmon*.dsp", 
00011  * obtained via DSPMKInit().
00012  *
00013  * Functions with prefix DSPAP (see libarrayproc.h) work in conjunction 
00014  * with the array processing monitor "apmon*.dsp", obtained via DSPAPInit().
00015  * 
00016  * Functions with prefix DSP work with EITHER the array processing or 
00017  * Music Kit monitors.
00018  * 
00019  * Each function returns an integer error code (0 = success, nonzero = error),
00020  * unless its name is of one of the following forms:
00021  *
00022  *      (1) "DSPGet<v>()" 
00023  *              Returns <v>, where <v> can be any scalar C type.
00024  *              Example: rx = DSPGetRX() reads the DSP RX register.
00025  *
00026  *      (2) "DSP<var>IsEnabled()" 
00027  *              Returns an open-state variable <var> (zero or nonzero).
00028  *              Example: if (DSPErrorLogIsEnabled()) ...
00029  *
00030  *      (3) "DSPIs<condition>()" 
00031  *              Returns <condition> (zero or nonzero).
00032  *              Example: if (DSPIsAlive()) ...
00033  * 
00034  * For functions which return an error code, the exact nature 
00035  * of the error is written to the error log file, if it is enabled.
00036  * (See DSPError.h for error log enabling functions.)
00037  */
00038 
00039 #import "DSPControl.h"
00040 #import "DSPMessage.h"
00041 #import "DSPTransfer.h"
00042 #import "DSPStructMisc.h"
00043 #import "DSPConversion.h"
00044 #import "DSPObject.h"
00045 #import "DSPSymbols.h"
00046 #import "DSPError.h"
00047 
00048 #include "MKDSPDefines.h"
00049 
00050 /* ============================= DSPLoad.c ================================= */
00051 
00052 MKDSP_API int DSPLoadFile(char *fn);
00053 /*
00054  * Load DSP from the file specified.
00055  * Equivalent to DSPReadFile followed by DSPLoad.
00056  *
00057  */
00058 
00059 MKDSP_API int DSPLoad(DSPLoadSpec *dspimg);     
00060 /*
00061  * Load everything in *dspimg to the DSP.
00062  */
00063 
00064 
00065 /* =============================== DSPBoot.c =============================== */
00066 
00067 MKDSP_API int DSPBootFile(char *fn);
00068 /*
00069  * Boot DSP from the file specified.
00070  * Equivalent to DSPReadFile followed by DSPBoot.
00071  */
00072 
00073 
00074 MKDSP_API int DSPBoot(DSPLoadSpec *system);
00075 /* 
00076  * Load DSP bootstrap program.
00077  * DSPBoot closes the DSP if it is open, resets it, and feeds the
00078  * resident monitor supplied in the struct 'system' to the bootstrapping DSP.
00079  * If system is NULL, the default resident monitor is supplied to the DSP.
00080  * On return, the DSP is open.
00081  */
00082 
00083 MKDSP_API int DSPReboot(DSPLoadSpec *system);
00084 /* 
00085  * Like DSPBoot() but assumes system is the same one used 
00086  * the last time this DSP was booted (an optimization to avoid 
00087  * resetting the cache.)
00088  */
00089 
00090 
00091 /* ============================= DSPReadFile.c ============================= */
00092 
00093 MKDSP_API int DSPReadFile(DSPLoadSpec **dsppp, const char *fn);
00094 /*
00095  * Read in a DSP file (as produced by the assembler in absolute mode).
00096  * It looks in the system-wide .dsp directory for the given file if 
00097  * the user's working directory does not contain a readable version of 
00098  * the file (.lnk, .lod, or .dsp).
00099  */
00100 
00101 /* ================================ _DSPCV.c =============================== */
00102 
00103 MKDSP_API char *DSPFix24ToStr(DSPFix24 datum);
00104 /* 
00105  * Convert type DSPFix24 to fractional fixed-point string 
00106  */
00107 
00108 
00109 MKDSP_API char *DSPFix48ToSampleStr(DSPFix48 *aTimeStampP);
00110 /* 
00111  * Convert type DSPFix48 to fractional time-stamp string in samples
00112  */
00113 
00114 
00115 MKDSP_API char *DSPTimeStampStr(DSPFix48 *aTimeStampP);
00116 /* 
00117  * Convert type DSPFix48 to fractional time-stamp string in samples
00118  * or the string "<untimed>" if null, or the string "at end of current tick"
00119  * if time-stamp is zero.
00120  */
00121 
00122 /* ============================= _DSPString.c ============================== */
00123 
00124 MKDSP_API char *DSPCat(const char *f1, const char *f2);
00125 /* 
00126  * Concatenate two strings into the returned string.
00127  * Uses malloc to create the returned string.
00128  */
00129 
00130 /* libdsp is by J. O. Smith */
00131 
00132 #endif