MusicKit  0.0.0
_ScorefileVar.h
00001 /*
00002   $Id$
00003   Defined In: The MusicKit
00004 
00005   Description:
00006     This class is used for variable values. Setting a ScorefileVar never
00007     changes its type unless it is an Untyped score var. Automatic type
00008     conversion is done where possible.
00009 
00010     This is a private musickit class.
00011 
00012   Original Author: David A. Jaffe
00013 
00014   Copyright (c) 1988-1992, NeXT Computer, Inc.
00015   Portions Copyright (c) 1994 NeXT Computer, Inc. and reproduced under license from NeXT
00016   Portions Copyright (c) 1994 Stanford University
00017 */
00018 /*
00019   $Log$
00020   Revision 1.4  2006/02/05 17:57:10  leighsmith
00021   Cleaned up prototypes for Xcode 2.2 as it is much more strict about mixing id with a defined type
00022 
00023   Revision 1.3  2000/05/13 17:16:49  leigh
00024   Doco cleanup and stricter typing of parameters
00025 
00026   Revision 1.2  1999/07/29 01:26:01  leigh
00027   Added Win32 compatibility, CVS logs, SBs changes
00028 
00029 */
00030 #ifndef __MK__ScorefileVar_H___
00031 #define __MK__ScorefileVar_H___
00032 
00033 #import <Foundation/NSObject.h>
00034 
00035 /* _ScorefileVar functions */ 
00036 #import "_MKParameter.h"
00037 #import "tokens.h"
00038 
00039 @interface _ScorefileVar : NSObject
00040 {
00041     _MKToken token;
00042     _MKParameter *myParameter;          /* Used internally to store value. */
00043     BOOL (*preDaemon)();
00044     /* preDaemon is an optional function of three arguments:
00045        id varObject; _MKToken newValueType; and char *ptrToNewValue;
00046        It is called before the value is set and is used to filter bad values.
00047        It returns YES if the value should be set or NO if it should not be set.
00048        */
00049     void (*postDaemon)();
00050     /* postDaemon is an optional function of one arguments:
00051        id ScorefileVarObject;
00052        It is called after the value has been set.
00053        */
00054     BOOL readOnly;   /* YES, if variable should not be changed. */
00055     NSString *s;     // name string of the variable.
00056 }
00057 
00058 - copy;
00059 - writeScorefileStream:(NSMutableData *)aStream; 
00060 - (NSString *) varName;
00061 - (void)dealloc; 
00062 
00063 @end
00064 
00065 extern _MKParameter *_MKSFVarGetParameter(_ScorefileVar *sfVar);
00066 extern _ScorefileVar *_MKNewScorefileVar(_MKParameter *aPar, NSString * name, BOOL untyped, BOOL isReadOnly);
00067 extern int _MKSFVarInternalType(_ScorefileVar *sfVar);
00068 extern _MKParameterUnion *_MKSFVarRaw(_ScorefileVar *sfVar);
00069 extern int _MKSetDoubleSFVar(_ScorefileVar *sfVar, double floval);
00070 extern int _MKSetIntSFVar(_ScorefileVar *sfVar, int intval);
00071 extern int _MKSetStringSFVar(_ScorefileVar *sfVar, NSString *strval);
00072 extern int _MKSetEnvSFVar(_ScorefileVar *sfVar, id envelope);
00073 extern int _MKSetWaveSFVar(_ScorefileVar *sfVar, id waveTable);
00074 extern int _MKSetObjSFVar(_ScorefileVar *sfVar, id anObj);
00075 extern id _MKSetScorefileVarPreDaemon();
00076 extern id _MKSetScorefileVarPostDaemon();
00077 extern id _MKSetReadOnlySFVar(_ScorefileVar *sfVar, BOOL yesOrNo);
00078 void _MKSFSetPrintfunc();
00079 
00080 #endif