home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / SoundApps / Patchmix / Source / Param.m < prev    next >
Encoding:
Text File  |  1995-06-12  |  1.5 KB  |  90 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. #import <string.h>
  5. #import "Param.h"
  6.  
  7. @implementation Param
  8.  
  9. - init:motherUgen:(NXPoint *)theOffset
  10. // create a parameter for the unit generator
  11. {
  12.     ugen = motherUgen;  
  13.     offset.x = theOffset->x;
  14.     offset.y = theOffset->y;
  15.     strcpy(value,"1");
  16.     connectedParam = nil;
  17.     return self;
  18. }
  19.  
  20. - move:(NXPoint *)newloc
  21. // move the parameter to the new location after unit generator placed somewhere in view
  22. {
  23.     location.x = newloc->x+offset.x;
  24.     location.y = newloc->y+offset.y;
  25.     rectangle.origin.x = location.x;
  26.     rectangle.origin.y = location.y;
  27.     rectangle.size.width = PARAM_SIZE;
  28.     rectangle.size.height = PARAM_SIZE;
  29.     drawPoint.x = location.x + 10;
  30.     drawPoint.y = location.y + 10;
  31.     return self;
  32. }
  33.  
  34. - (NXRect *)getRect
  35. {
  36.     return &rectangle;
  37. }
  38.  
  39. - (NXPoint *)getDrawPoint
  40. {
  41.     return &drawPoint;
  42. }
  43.  
  44. - setConnectedParam:param
  45. {
  46.     connectedParam = param;
  47.     return self;
  48. }
  49.  
  50. - getConnectedParam
  51. // get the parameter that this parameter is connected to
  52. {
  53.     return connectedParam;
  54. }
  55.  
  56. - setValue:(char *)val
  57. // set the value stored 
  58. {
  59.     strcpy(value,val);
  60.     return self;
  61. }
  62.  
  63. - (char *)getValue
  64. // get the value stored in the parameter
  65. {
  66.     return value;
  67. }
  68.  
  69. - getUgen
  70. // get the unit generator this parameter is part of
  71. {
  72.     return ugen;
  73. }
  74.  
  75. - setTitle:(char *)tit
  76. // set the title of the parameter (for the parameter-setting form field)
  77. {
  78.     strcpy(title,tit);
  79.     return self;
  80. }
  81.  
  82. - (char *)getTitle
  83. // get the title of the parameter (for the parameter-setting form field)
  84. {
  85.     return title;
  86. }
  87.  
  88.  
  89. @end
  90.