home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / inventor / inventorTemplates1.1.2 / AudioNode.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.5 KB  |  80 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. #ifndef AUDIONODE_H
  18. #define AUDIONODE_H
  19.  
  20. #include <Inventor/SbTime.h>
  21. #include <Inventor/nodes/SoSubNode.h>
  22. #include <Inventor/fields/SoFieldData.h>
  23. #include <Inventor/fields/SoSFString.h>
  24. #include <Inventor/fields/SoSFFloat.h>
  25. #include <Inventor/fields/SoSFEnum.h>
  26. #include <Inventor/SoSensor.h>
  27.  
  28. #include "PlayClass.h"
  29.  
  30. // the following is the inventor node wrapper for the AUDIONODE class
  31. class AudioNode : public SoNode {
  32.  
  33.     // Define typeId and name stuff
  34.     SO_SUBNODE_ID_HEADER(AudioNode);
  35.     SO_SUBNODE_FIELD_HEADER(AudioNode);
  36.  
  37. private:
  38.     static void DataCB(void *, SoSensor *);
  39.  
  40. protected:
  41.     PlayClass *pc;
  42.     SbName OldFilename;
  43.     float oldtimeLength, oldinTime, oldoutTime, oldmaxOutputLevel;
  44.     short fnamechange, tlchange, itchange, otchange, molchange;
  45.     SoDataSensor *dsensor;
  46.  
  47. public:
  48.     enum AudioEnumType {
  49.     YUP = 0x01,
  50.     NOPE = 0x02,
  51.     };
  52.  
  53.     SoSFString filename;        // sets the audio filename
  54.     SoSFFloat timeLength;       // length of time to play the audio
  55.     SoSFFloat inTime;           // length of time to fade in over
  56.     SoSFFloat outTime;          // length of time to fade out over
  57.     SoSFFloat maxOutputLevel;   // maximum output level (0 - 1)
  58.     SoSFEnum rude;              // do I change the hardware sampling rate if
  59.                                 // it isn't the same as the audiofile
  60.     SoSFEnum loop;              // do I loop
  61.     SoSFEnum sproc;             // do I sproc a child process or
  62.                                 // play synchronously
  63.     AudioNode();
  64.     ~AudioNode();
  65.     void play();
  66.     void stop();
  67.     void fade();
  68.     void pause();
  69.     void unpause();
  70.     void setNoDone(short);
  71.     int donep();
  72.  
  73. SoINTERNAL public:
  74.     SO_SF_ENUM_HEADER(AudioNode, 2);
  75.     static void initClass();
  76.  
  77. };
  78.  
  79. #endif
  80.