MusicKit  0.0.0
_ParName.h
00001 /*
00002  $Id$
00003  Defined In: The MusicKit
00004  
00005  Description:
00006  This class defines the parameter-representation mechanism and is a private
00007  MusicKit class used for parameter names.
00008  
00009  Each parameter is represented by a unique instance of _ParName.
00010  They have an optional function which is called when the parameter value is written and
00011  they have a low integer value, the particular parameter.
00012  The printfunc allows particular parameters to write in
00013  special ways. For example, keyNum writes using the keyNum constants.
00014  You never instantiate instances of this class directly.
00015  
00016  The term "parameter" is, unfortunately, used loosely for several things.
00017  This could be cleaned up, but it's all private functions, so it's just
00018  an annoyance to the maintainer:
00019  
00020  1) An object, of class _ParName, that represents the parameter name. E.g.
00021  there is only one instance of this object for all frequency parameters.
00022  
00023  2) A low integer that corresponds to the _ParName object. E.g. the constant
00024  MK_freq is a low integer that represents all frequency parameters.
00025  
00026  3) A string name that corresponds to the _ParName object. E.g. "freq".
00027  
00028  4) A struct called _MKParameter, that represents the particular parameter
00029  value.  E.g. there is one _MKParameter for each note containing a frequency.
00030  
00031  The _ParName contains the string name, the low integer, and a function
00032  (optional) for printing the parameter values in a special way.
00033  
00034  The _MKParameter contains the data, the type of the data, and the
00035  low integer. There's an array that maps low integers to _ParNames.
00036  
00037  MKNote objects contain an NSHashTable of _MKParameters. @see MKNote.m
00038  
00039  Note that the code for writing scorefiles is spread between writeScore.m,
00040  MKNote.m, and _ParName.m. This is for reasons of avoiding inter-module
00041  communication (i.e. minimizing globals). Perhaps the scorefile-writing
00042  should be more cleanly isolated.
00043   
00044  Original Author: David A. Jaffe
00045  
00046  Copyright (c) 1988-1992, NeXT Computer, Inc.
00047  Portions Copyright (c) 1999-2006, The MusicKit Project.
00048  
00049  Modification history in CVS at musickit.org
00050  */
00051 #ifndef __MK__ParName_H___
00052 #define __MK__ParName_H___
00053 
00054 #import <Foundation/Foundation.h>
00055 
00056 #import "_MKParameter.h"
00057 
00058 @interface _ParName : NSObject
00059 {
00060     // printfunc is a function for writing the value of the par.
00061     // See _ParName.m for details.
00062     BOOL (*printfunc)(_MKParameter *param, NSMutableData *aStream, _MKScoreOutStruct *p);
00063     int par;    /* What parameter this is. */
00064     NSString *s;    /* Name of parameter */
00065 }
00066 
00067 @end
00068 
00069 extern unsigned _MKGetParNamePar(_ParName *aParName);
00070 
00071 #endif