AeAsset.h 23.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730
#ifndef __AeAsset__
#define __AeAsset__

#include <Xm/Xm.h>	// Pixmap

#include "AeTypes.h"
#include "AeClient.h"

typedef enum
{
    kUnknownType = 0,
    kBankFileType,
    kBankType,
    kInstType,
    kSoundType,
    kEnvType,
    kKeymapType,
    kWaveType,
    kRaw16WaveType,
    kADPCMWaveType,
    kLoopType,
    kADPCMLoopType,
    kADPCMBookType,
    kFxType,
    kFxNoneType,
    kFxSmallRoomType,
    kFxBigRoomType,
    kFxChorusType,
    kFxEchoType,
    kFxFlangeType,
    kFxCustomType,
    kFxSxnType,
    kInstFileType
} TAssetType;


typedef short *	TADPCMState;


enum
{
    kDefVolume		= 127,
    kDefPan		= 64,
    kDefPriority	= 0,
    kDefBendRange	= 200,
    kDefSampleRate	= 44100,

    kDefAttTime		= 10000,
    kDefAttLevel	= kDefVolume,
    kDefDecTime		= 100000,
    kDefDecLevel	= 100,
    kDefRelTime		= 20000,

    kDefVelMin		= 0,
    kDefVelMax		= 127,
    kDefKeyMin		= 0,
    kDefKeyMax		= 127,
    kDefKeyBase		= 60,		// middle C
    kDefDetune		= 0,

    kDefLFOType		= 0,
    kDefLFORate		= 0,
    kDefLFODepth	= 0,
    kDefLFODelay	= 0
};


template<class T> class GList;
class AeInstAsset;
class AeEnvAsset;
class AeKeymapAsset;
class AeWaveAsset;
class AeLoopAsset;
class AeADPCMLoopAsset;
class AeADPCMBookAsset;
class AeBankFile;
class AeWaveFile;
class AeFxSxnAsset;
class AeAssetBase;


class AeAsset
{
public:
                        AeAsset (const char * name, TAssetType);
    virtual 		~AeAsset (void);

    TAssetType		GetType (void)     { return fType; }
    virtual Pixmap	GetIcon (void);
    
    char *		GetName (void)     { return fName; }
    void		SetName (const char * name);
    virtual void       	GetClassName (char *);

    Boolean	       	IsSelected (void)              { return fIsSelected; }
    void	       	SetSelect (Boolean isSelected) { fIsSelected = isSelected; }
    void		ToggleSelect (void)            { fIsSelected = !fIsSelected; }

    virtual Boolean	CanOnline (void)               { return False; }
    Boolean		IsOnline (void)		       { return fIsOnline; }
    void	       	SetOnline (Boolean isOnline)   { fIsOnline = isOnline; }
    void		ToggleOnline (void)            { fIsOnline = !fIsOnline; }
    
    Boolean 		GetClientData (AeClient *, void **);
    void		SetClientData (AeClient *, void *);

    static char *	GetNameProc (AeAsset * asset);
    static void		SetNameProc (AeAsset * asset, char * name);

    
    virtual Boolean	HasParent (void);
    virtual Boolean	IsParent (AeAsset *);
    void		AppendParent (AeAsset *);
    void		RemoveParent (AeAsset *);
    GList<AeAsset *> *	GetParentList (void) { return fParentList; }
    virtual Boolean	CanContain (void) { return False; }

    Boolean		IsBankComponent (void);
    Boolean		IsFxComponent (void);
    static AeAsset *	NewTypedAsset (TAssetType, AeAssetBase *);
    void		FindUniqueName (AeAssetBase *);

protected:
    TAssetType		fType;
    TString63		fName;

    GList<void *> *	fClientDataList;
    GList<AeAsset *> *	fParentList;

    Boolean	       	fIsSelected;	// true if selected by editor
    Boolean		fIsOnline;	// true if loaded into player

public:
    // pure virtual routines
    virtual int	      	GetMaxDelay (void);	// fx assets
};


class AeContainerAsset : public AeAsset
{
public:
                        AeContainerAsset (const char * name, TAssetType);
    virtual		~AeContainerAsset (void);

    static int		GetNumChildrenProc (AeAsset *);
    int			GetNumChildren (void);

    virtual Boolean	CanContain (void) { return True; }

    virtual TAssetType	GetChildType (void);
    GList<AeAsset *> *	GetChildList (void) { return fChildList; }
    AeAsset *		GetIndexedChild (int index);

    virtual void	AppendChild (AeAsset *);
    virtual void	InsertChild (AeAsset *, int before);
    virtual void	RemoveChild (AeAsset *);

protected:
    GList<AeAsset *> *	fChildList;
};


class AeBankFileAsset : public AeContainerAsset
{
public:
                        AeBankFileAsset (AeBankFile *);
                        AeBankFileAsset (const char *);
    virtual		~AeBankFileAsset (void);

    virtual void       	GetClassName (char *);
    virtual Pixmap	GetIcon (void)             { return fIcon; }
    virtual TAssetType	GetChildType (void) 	   { return kBankType; }
    AeBankFile *	GetFile (void)             { return fFile; }
    int			GetRevision (void)         { return fRevision; }

    void		SetRevision (int revision) { fRevision = revision; }

    static int		GetRevisionProc (AeAsset *);
    static char *	GetDirProc (AeAsset *);

private:
    static Pixmap	fIcon;
    AeBankFile *	fFile;
    int			fRevision;
};


class AeBankAsset : public AeContainerAsset
{
public:
                        AeBankAsset (const char * name,
				     int sampleRate = kDefSampleRate,
				     AeInstAsset * percussion = NULL);
    virtual		~AeBankAsset (void);

    virtual void       	GetClassName (char *);
    virtual Boolean	HasParent (void)        { return True; }
    virtual Boolean	CanOnline (void)        { return True; }
    virtual Pixmap	GetIcon (void)          { return fIcon; }
    virtual TAssetType	GetChildType (void)     { return kInstType; }

    int			GetSampleRate (void)    { return fSampleRate; }
    AeInstAsset *	GetPercussion (void)    { return fPercussion; }

    void       		SetSampleRate (int sampleRate) { fSampleRate = sampleRate; }
    void		SetPercussion (AeInstAsset *);

    static int		GetSampleRateProc (AeAsset *);
    static AeAsset *	GetPercussionProc (AeAsset *);

    static void		SetSampleRateProc (AeAsset *, int sampleRate);
    static void		SetPercussionProc (AeAsset *, AeAsset * percussion);

private:
    static Pixmap      	fIcon;
    int			fSampleRate;
    AeInstAsset *	fPercussion;
};


class AeInstAsset : public AeContainerAsset
{
public:
                        AeInstAsset (const char * name,
				     int vol = kDefVolume,
				     int pan = kDefPan,
				     int priority = kDefPriority,
				     int bendrange = kDefBendRange);
    virtual		~AeInstAsset (void);

    virtual Boolean	IsParent (AeAsset *);

    virtual void       	GetClassName (char *);
    virtual Pixmap	GetIcon (void)               { return fIcon; }
    virtual TAssetType	GetChildType (void) 	     { return kSoundType; }
    int			GetPatch (void);
    int			GetVolume (void)             { return fVolume; }
    int			GetPan (void)                { return fPan; }
    int			GetPriority (void)           { return fPriority; }
    int			GetBendRange (void)          { return fBendRange; }
    int     		GetTremType (void)           { return fTremType; }
    int     		GetTremRate (void)           { return fTremRate; }
    int     		GetTremDepth (void)          { return fTremDepth; }
    int     		GetTremDelay (void)          { return fTremDelay; }
    int     		GetVibType (void)            { return fVibType; }
    int     		GetVibRate (void)            { return fVibRate; }
    int     		GetVibDepth (void)           { return fVibDepth; }
    int     		GetVibDelay (void)           { return fVibDelay; }

    void	       	SetVolume (int volume)       { fVolume = volume; }
    void	       	SetPan (int pan)             { fPan = pan; }
    void	       	SetPriority (int priority)   { fPriority = priority; }
    void	       	SetBendRange (int bendRange) { fBendRange = bendRange; }
    void    		SetTremType (int type) 	     { fTremType = type; }
    void    		SetTremRate (int rate)       { fTremRate = rate; }
    void    		SetTremDepth (int depth)     { fTremDepth = depth; }
    void    		SetTremDelay (int delay)     { fTremDelay = delay; }
    void    		SetVibType (int type)        { fVibType = type; }
    void    		SetVibRate (int rate)        { fVibRate = rate; }
    void    		SetVibDepth (int depth)      { fVibDepth = depth; }
    void    		SetVibDelay (int delay)      { fVibDelay = delay; }

    static int		GetPatchProc (AeAsset *);
    static int		GetVolumeProc (AeAsset *);
    static int		GetPanProc (AeAsset *);
    static int		GetPriorityProc (AeAsset *);
    static int		GetBendRangeProc (AeAsset *);
    static int         	GetTremTypeProc (AeAsset *);
    static int         	GetTremRateProc (AeAsset *);
    static int         	GetTremDepthProc (AeAsset *);
    static int         	GetTremDelayProc (AeAsset *);
    static int         	GetVibTypeProc (AeAsset *);
    static int         	GetVibRateProc (AeAsset *);
    static int         	GetVibDepthProc (AeAsset *);
    static int         	GetVibDelayProc (AeAsset *);

    static void		SetVolumeProc (AeAsset *, int);
    static void		SetPanProc (AeAsset *, int);
    static void		SetPriorityProc (AeAsset *, int);
    static void		SetBendRangeProc (AeAsset *, int);
    static void        	SetTremTypeProc (AeAsset *, int);
    static void        	SetTremRateProc (AeAsset *, int);
    static void        	SetTremDepthProc (AeAsset *, int);
    static void        	SetTremDelayProc (AeAsset *, int);
    static void        	SetVibTypeProc (AeAsset *, int);
    static void        	SetVibRateProc (AeAsset *, int);
    static void        	SetVibDepthProc (AeAsset *, int);
    static void        	SetVibDelayProc (AeAsset *, int);

private:
    static Pixmap      	fIcon;
    int			fVolume;
    int			fPan;
    int			fPriority;
    int		       	fBendRange;

    int      		fTremType;
    int      		fTremRate;
    int      		fTremDepth;
    int      		fTremDelay;

    int      		fVibType;
    int      		fVibRate;
    int      		fVibDepth;
    int      		fVibDelay;
};


class AeSoundAsset : public AeAsset
{
public:
                        AeSoundAsset (const char * name,
				      int vol = kDefVolume,
				      int pan = kDefPan,
				      AeEnvAsset * envelope = NULL,
				      AeKeymapAsset * keymap = NULL,
				      AeWaveAsset * wave = NULL);
    virtual		~AeSoundAsset (void);

    virtual void       	GetClassName (char *);
    virtual Pixmap	GetIcon (void)     { return fIcon; }
    int			GetVolume (void)   { return fVolume; }
    int			GetPan (void)      { return fPan; }
    AeEnvAsset *       	GetEnvelope (void) { return fEnvelope; }
    AeKeymapAsset *    	GetKeymap (void)   { return fKeymap; }
    AeWaveAsset *     	GetWave (void)     { return fWave; }

    void       		SetVolume (int volume)          { fVolume = volume; }
    void       		SetPan (int pan)                { fPan = pan; }
    void		SetEnvelope (AeEnvAsset *);
    void		SetKeymap (AeKeymapAsset *);
    void		SetWave (AeWaveAsset *);

    static int		GetVolumeProc (AeAsset *);
    static int		GetPanProc (AeAsset *);
    static AeAsset *	GetEnvelopeProc (AeAsset *);
    static AeAsset * 	GetKeymapProc (AeAsset *);
    static AeAsset * 	GetWaveProc (AeAsset *);

    static void		SetVolumeProc (AeAsset *, int volume);
    static void		SetPanProc (AeAsset *, int pan);
    static void		SetEnvelopeProc (AeAsset *, AeAsset * envelope);
    static void		SetKeymapProc (AeAsset *, AeAsset * keymap);
    static void		SetWaveProc (AeAsset *, AeAsset * wave);

private:
    static Pixmap      	fIcon;
    int			fVolume;
    int			fPan;
    AeEnvAsset *       	fEnvelope;
    AeKeymapAsset *    	fKeymap;
    AeWaveAsset *	fWave;
};


class AeEnvAsset : public AeAsset
{
  public:
                        AeEnvAsset (const char * name,
				    int attTime = kDefAttTime,
				    int attLevel = kDefAttLevel,
				    int decTime = kDefDecTime,
				    int decLevel = kDefDecLevel,
				    int relTime = kDefRelTime);
    virtual		~AeEnvAsset (void);
    
    virtual Boolean	IsParent (AeAsset *);

    virtual void       	GetClassName (char *);
    virtual Pixmap	GetIcon (void)             { return fIcon; }
    int     		GetAttackTime (void)       { return fAttackTime; }
    int     		GetAttackLevel (void)      { return fAttackLevel; }
    int     		GetDecayTime (void)        { return fDecayTime; }
    int     		GetDecayLevel (void)       { return fDecayLevel; }
    int     		GetReleaseTime (void)      { return fReleaseTime; }

    void    		SetAttackTime (int time)   { fAttackTime = time; }
    void    		SetAttackLevel (int level) { fAttackLevel = level; }
    void    		SetDecayTime (int time)    { fDecayTime = time; }
    void    		SetDecayLevel (int level)  { fDecayLevel = level; }
    void    		SetReleaseTime (int time)  { fReleaseTime = time; }

    static void        	SetAttackTimeProc (AeAsset *, int time);
    static void        	SetAttackLevelProc (AeAsset *, int level);
    static void        	SetDecayTimeProc (AeAsset *, int time);
    static void        	SetDecayLevelProc (AeAsset *, int level);
    static void        	SetReleaseTimeProc (AeAsset *, int time);

    static int         	GetAttackTimeProc (AeAsset *);
    static int         	GetAttackLevelProc (AeAsset *);
    static int         	GetDecayTimeProc (AeAsset *);
    static int         	GetDecayLevelProc (AeAsset *);
    static int         	GetReleaseTimeProc (AeAsset *);


  private:
    static Pixmap      	fIcon;
    int     		fAttackTime;
    int     		fAttackLevel;
    int     		fDecayTime;
    int     		fDecayLevel;
    int     		fReleaseTime;  
};


class AeKeymapAsset : public AeAsset
{
  public:
                        AeKeymapAsset (const char * name,
				       int velMin = kDefVelMin,
				       int velMax = kDefVelMax,
				       int keyMin = kDefKeyMin,
				       int keyMax = kDefKeyMax,
				       int keyBase = kDefKeyBase,
				       int detune = kDefDetune);
    virtual		~AeKeymapAsset (void);
    
    virtual Boolean	IsParent (AeAsset *);

    virtual void       	GetClassName (char *);
    virtual Pixmap	GetIcon (void) 	       { return fIcon; }
    int     		GetVelMin (void)       { return fVelocityMin; }
    int     		GetVelMax (void)       { return fVelocityMax; }
    int     		GetKeyMin (void)       { return fKeyMin; }
    int     		GetKeyMax (void)       { return fKeyMax; }
    int     		GetKeyBase (void)      { return fKeyBase; }
    int     		GetDetune (void)       { return fDetune; }

    void    		SetVelMin (int vel)    { fVelocityMin = vel; }
    void    		SetVelMax (int vel)    { fVelocityMax = vel; }
    void    		SetKeyMin (int key)    { fKeyMin = key; }
    void    		SetKeyMax (int key)    { fKeyMax = key; }
    void    		SetKeyBase (int key)   { fKeyBase = key; }
    void    		SetDetune (int detune) { fDetune = detune; }

    static void        	SetVelMinProc (AeAsset *, int vel);
    static void        	SetVelMaxProc (AeAsset *, int vel);
    static void        	SetKeyMinProc (AeAsset *, int key);
    static void        	SetKeyMaxProc (AeAsset *, int key);
    static void        	SetKeyBaseProc (AeAsset *, int key);
    static void        	SetDetuneProc (AeAsset *, int detune);

    static int         	GetVelMinProc (AeAsset *);
    static int         	GetVelMaxProc (AeAsset *);
    static int         	GetKeyMinProc (AeAsset *);
    static int         	GetKeyMaxProc (AeAsset *);
    static int         	GetKeyBaseProc (AeAsset *);
    static int         	GetDetuneProc (AeAsset *);

  private:
    static Pixmap      	fIcon;
    int     		fVelocityMin;
    int     		fVelocityMax;
    int     		fKeyMin;
    int     		fKeyMax;
    int     		fKeyBase;
    int     		fDetune;
};


class AeWaveAsset : public AeAsset
{
  public:
                        AeWaveAsset (AeWaveFile *, TAssetType);
                        AeWaveAsset (const char *, TAssetType);
    virtual 		~AeWaveAsset (void);

    virtual Boolean	IsParent (AeAsset *);

    void      		SetSampleRate (double rate)  { fSampleRate = rate; }
    void      		SetSampleSize (int size)     { fSampleSize = size; }
    void      		SetSampleFrames (int frames) { fSampleFrames = frames; }
    void		SetNDataBytes (long nbytes)  { fNDataBytes = nbytes; }
    virtual void      	SetLoop (AeLoopAsset *);

    virtual void       	GetClassName (char *);
    virtual Pixmap	GetIcon (void) 	             { return fIcon; }
    TAssetType		GetWaveType (void)     	     { return fWaveType; }
    double             	GetSampleRate (void)         { return fSampleRate; }
    int       		GetSampleSize (void)         { return fSampleSize; }
    int       		GetSampleFrames (void)       { return fSampleFrames; }
    long		GetNDataBytes (void) 	     { return fNDataBytes; }
    char *		GetSampleData (void);
    AeWaveFile *	GetFile (void)               { return fFile; }
    virtual AeLoopAsset * GetLoop (void);

    void      		SetSmplXRef (void * xref)    { fSmplXRef = xref; }
    void *     		GetSmplXRef (void)           { return fSmplXRef; }

    static int		GetWaveTypeProc (AeAsset *);
    static float       	GetSampleRateProc (AeAsset *);
    static int		GetSampleSizeProc (AeAsset *);
    static int		GetSampleFramesProc (AeAsset *);
    static char *	GetDirProc (AeAsset *);

    static int		GetLoopStartProc (AeAsset *);
    static int		GetLoopEndProc (AeAsset *);
    static int		GetLoopCountProc (AeAsset *);

    static void		SetLoopStartProc (AeAsset *, int);
    static void		SetLoopEndProc (AeAsset *, int);
    static void		SetLoopCountProc (AeAsset *, int);

  private:
    static Pixmap      	fIcon;
    AeWaveFile *	fFile;
    TAssetType		fWaveType;
    double             	fSampleRate;
    int			fSampleSize;
    int           	fSampleFrames;
    long		fNDataBytes;
    void *		fSmplXRef;    
};


class AeRaw16WaveAsset : public AeWaveAsset
{
  public:
                        AeRaw16WaveAsset (AeWaveFile *);
                        AeRaw16WaveAsset (const char *);
    virtual 		~AeRaw16WaveAsset (void);

    virtual AeLoopAsset * GetLoop (void)             { return fLoop; }
    virtual void       	SetLoop (AeLoopAsset * loop);

  private:
    AeLoopAsset *      	fLoop;
};


class AeADPCMWaveAsset : public AeWaveAsset
{
  public:
                        AeADPCMWaveAsset (AeWaveFile *);
                        AeADPCMWaveAsset (const char *);
    virtual 		~AeADPCMWaveAsset (void);

    virtual AeLoopAsset * GetLoop (void)             { return (AeLoopAsset *)fLoop; }
    AeADPCMBookAsset *	GetBook (void)               { return fBook; }

    virtual void       	SetLoop (AeLoopAsset * loop);
    void      		SetBook (AeADPCMBookAsset * book);

  private:
    AeADPCMLoopAsset * 	fLoop;
    AeADPCMBookAsset * 	fBook;
};


class AeLoopAsset : public AeAsset
{
  public:
                        AeLoopAsset (const char * name,
				     int start = 0,
				     int end = 0,
				     int count = 0);
    virtual		~AeLoopAsset (void);
    
    virtual char	HasStateData (void)  { return False; }

    void    		SetStart (int start) { fStart = start; }
    void   		SetEnd (int end)     { fEnd = end; }
    void   		SetCount (int count) { fCount = count; }

    int     		GetStart (void)      { return fStart; }
    int     		GetEnd (void)        { return fEnd; }
    int     		GetCount (void)      { return fCount; }

  private:
    int          	fStart;
    int          	fCount;
    int          	fEnd;
};


class AeADPCMLoopAsset : public AeLoopAsset
{
  public:
                        AeADPCMLoopAsset (const char * name,
					  int start = 0,
					  int end = 0,
					  int count = 0,
					  int stateSize = 0,
					  short * stateArray = NULL);
    virtual		~AeADPCMLoopAsset (void);

    virtual char	HasStateData (void)          { return True; }
    void    		GetStateData (int & stateSize, short * stateArray);
    void    		SetStateData (int stateSize, short * stateArray);

  private:
    int			fStateSize;
    TADPCMState  	fStateArray;
};


class AeADPCMBookAsset : public AeAsset
{
  public:
                        AeADPCMBookAsset (const char * name,
					  int order = 0,
					  int npredictors = 0,
					  int vsize = 0,
					  short * bookData = NULL);
    virtual		~AeADPCMBookAsset (void);

    void  	        SetBook (int ord, int npds, int vsize, short * data);

    int   		GetOrder (void)        { return fOrder; }
    int   		GetNPredictors (void)  { return fNpredictors; }
    int   		GetNumBookItems (void) { return fNBookItems; }
    int   		GetBookData (short *data);
    
    static int         	GetOrderProc (AeAsset *);
    static int         	GetNPredictorsProc (AeAsset *);

  private:
    int     		fOrder;
    int     		fNpredictors;
    int			fVSize;
    int			fNBookItems;
    short *		fBookData;
};


class AeFxAsset : public AeContainerAsset
{
  public:
                        AeFxAsset (const char * name);
    virtual		~AeFxAsset (void);

    virtual void       	GetClassName (char *);
    virtual void	AppendChild (AeAsset *);

    virtual Boolean	HasParent (void)       { return True; }
    virtual Boolean	CanOnline (void)       { return True; }
    virtual Pixmap	GetIcon (void) 	       { return fIcon; }
    virtual TAssetType	GetChildType (void)    { return kFxSxnType; }
    int			GetLength (void)       { return fLength; }
    virtual int	       	GetMaxDelay (void)     { return kDelayMax; }
    TAssetType         	GetFxType (void)       { return fFxType; }

    void		SetLength (int length) { fLength = length; }

    static void		SetLengthProc (AeAsset *, int length);
    static int	       	GetLengthProc (AeAsset *);

    void		ParseParamList (int * params);
    void		BuildParamList (int ** pParams, int * nParams);

  private:
    void    		initByType (void);
    void		deleteSections (void);
    
    static Pixmap      	fIcon;
    int			fLength;		// in samples
    TAssetType   	fFxType;		// may be obsolete
					       
 public:
    static const int   	kDelayMin;
    static const int   	kDelayMax;
    static const int   	kDelayDef;

};


class AeFxSxnAsset : public AeAsset
{
  public:
                        AeFxSxnAsset (const char *);
    virtual		~AeFxSxnAsset (void);

    virtual void       	GetClassName (char *);
    virtual Pixmap	GetIcon (void) 	       { return fIcon; }
    int			GetSxnID (void);

    virtual int	       	GetMaxDelay (void);
    int			GetInput (void) { return fInput; }
    int			GetOutput (void) { return fOutput; }
    int			GetFBCoef (void) { return fFBCoef; }
    int			GetFFCoef (void) { return fFFCoef; }
    int			GetGain (void) { return fGain; }
    int	        	GetChorusRate (void) { return fChorusRate; }
    int	        	GetChorusDepth (void) { return fChorusDepth; }
    int			GetFilterCoef (void) { return fFilterCoef; }

    void		SetInput (int input) { fInput = input; }
    void		SetOutput (int output) { fOutput = output; }
    void		SetFBCoef (int fbCoef) { fFBCoef = fbCoef; }
    void		SetFFCoef (int ffCoef) { fFFCoef = ffCoef; }
    void		SetGain (int gain) { fGain = gain; }
    void	        SetChorusRate (int rate) { fChorusRate = rate; } 
    void	        SetChorusDepth (int depth) { fChorusDepth = depth; }
    void		SetFilterCoef (int filterCoef) { fFilterCoef = filterCoef; }

    static void		SetInputProc (AeAsset *, int);
    static void		SetOutputProc (AeAsset *, int);
    static void		SetFBCoefProc (AeAsset *, int);
    static void		SetFFCoefProc (AeAsset *, int);
    static void		SetGainProc (AeAsset *, int);
    static void	        SetChorusRateProc (AeAsset *, int);
    static void	        SetChorusDepthProc (AeAsset *, int);
    static void		SetFilterCoefProc (AeAsset *, int);

    static int	       	GetInputProc (AeAsset *);
    static int	       	GetOutputProc (AeAsset *);
    static int	       	GetFBCoefProc (AeAsset *);
    static int	       	GetFFCoefProc (AeAsset *);
    static int	       	GetGainProc (AeAsset *);
    static int	       	GetChorusRateProc (AeAsset *);
    static int	       	GetChorusDepthProc (AeAsset *);
    static int	       	GetFilterCoefProc (AeAsset *);

    int *		ParseParamList (int *);
    int *		BuildParamList (int *);

  private:
    static Pixmap      	fIcon;
    int			fInput;
    int			fOutput;
    int			fFBCoef;
    int			fFFCoef;
    int			fGain;
    int			fChorusRate;
    int			fChorusDepth;
    int			fFilterCoef;
};


#endif __AeAsset__