home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Audio 4.94 - Over 11,000 Files
/
audio-11000.iso
/
mac
/
soundutl
/
vmtrs10s.hqx
/
VUMeters
/
Sources
/
SoundMonitor.h
< prev
next >
Wrap
Text File
|
1993-08-05
|
3KB
|
95 lines
/*
* ARTA VUMeters for Macintosh
* Malcolm Slaney
* Advanced Technology Group
* Apple Computer, Inc.
* malcolm@apple.com
* 1992-1993
*
* Warranty Information
* Even though Apple has reviewed this software, Apple makes no warranty
* or representation, either express or implied, with respect to this
* software, its quality, accuracy, merchantability, or fitness for a
* particular purpose. As a result, this software is provided "as is,"
* and you, its user, are assuming the entire risk as to its quality
* and accuracy.
*
* Copyright (c) 1992-1993 by Apple Computer, Inc
* All Rights Reserved.
*/
/* SoundMonitor.h */
#ifndef SoundMonitor_h
#define SoundMonitor_h
/*
* NOTE...the DSP defines and the structure that follow MUST agree exactly.
* They form the parameter blocks that are used to communicate between the
* DSP system and the host. This parameter block will reside in main memory.
* The DSP system will update the level variables during every frame (assuming
* that the the monitorLeft/monitorRight variables are nonzero).
*/
#ifdef DSPCOMPILE
monitorLeft: int 0 /* Monitor Left Channel? */
monitorRight: int 0 /* Monitor Right Channel? */
fastLeftLevel: float 0.0 /* Left level without dynamics */
fastRightLevel: float 0.0 /* Right level without dynamics */
slowLeftLevel: float 0.0 /* Left level with meter dynamics */
slowRightLevel: float 0.0 /* Right level with meter dynamics */
decayRate: float 0.5 /* Meter Dynamics Decay Factor */
frameScale: float 1.0
#else
struct DSPMonitorParmStruct {
long monitorLeft, monitorRight; /* Monitor this channel? */
float fastLeftLevel, fastRightLevel; /* Level without meter dynamics */
float slowLeftLevel, slowRightLevel; /* Level with (slow) meter dynamics */
float decayRate; /* Meter Dynamics Decay Factor */
float frameScale; /* Scale Frame by this number */
};
/* Define error conditions */
#define NO_ERROR 0
#define ERROR -1
#define FALSE 0
#define TRUE 1
#define SMGetFastLevelsPtr(monitor) &((monitor)->dspParms->fastLeftLevel)
#define SMGetSlowLevelsPtr(monitor) &((monitor)->dspParms->slowLeftLevel)
#define SMMaxSetDecayRate(monitor,x) ((monitor)->dspParms->decayRate)=(x)
#define SMMaxSetScaleFactor(monitor,x) ((monitor)->dspParms->frameScale)=(x)
/* Monitor input or output */
#define SMMonitorInput 0
#define SMMonitorOutput 1
/* SMSetChannel Command Numbers */
enum SMSetChannelParm {
SMChannelOff, SMChannelOn, SMChannelDontChange,
SMChannelAddClient, SMChannelRemoveClient};
typedef struct DSPMonitorRecStruct {
DSPTaskRefNum taskRef; /* How do I refer to this task? */
struct DSPMonitorParmStruct *dspParms; /* Pointer to common variables */
StringPtr typeName; /* What type of task (power or peak) */
long streamLocation; /* Input or output stream? */
short taskActive; /* Is this task active */
} DSPMonitorRec, *DSPMonitor;
SoundStream SMOpenDSPSoundStream();
DSPCPUDeviceParamBlkPtr SMOpenDSP3210(SoundStream sound_stream);
long SMCloseDSP3210(DSPCPUDeviceParamBlkPtr pblock);
DSPMonitor SMCreateDSPMonitor(DSPCPUDeviceParamBlkPtr ppblock,
SoundStream sound_stream,
StringPtr typeName,
long streamLocation);
#endif /* DSPCOMPILE */
#endif /* SoundMonitor_h */