home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- #ifndef AUDIONODE_H
- #define AUDIONODE_H
-
- #include <Inventor/SbTime.h>
- #include <Inventor/nodes/SoSubNode.h>
- #include <Inventor/fields/SoFieldData.h>
- #include <Inventor/fields/SoSFString.h>
- #include <Inventor/fields/SoSFFloat.h>
- #include <Inventor/fields/SoSFEnum.h>
- #include <Inventor/SoSensor.h>
-
- #include "PlayClass.h"
-
- // the following is the inventor node wrapper for the AUDIONODE class
- class AudioNode : public SoNode {
-
- // Define typeId and name stuff
- SO_SUBNODE_ID_HEADER(AudioNode);
- SO_SUBNODE_FIELD_HEADER(AudioNode);
-
- private:
- static void DataCB(void *, SoSensor *);
-
- protected:
- PlayClass *pc;
- SbName OldFilename;
- float oldtimeLength, oldinTime, oldoutTime, oldmaxOutputLevel;
- short fnamechange, tlchange, itchange, otchange, molchange;
- SoDataSensor *dsensor;
-
- public:
- enum AudioEnumType {
- YUP = 0x01,
- NOPE = 0x02,
- };
-
- SoSFString filename; // sets the audio filename
- SoSFFloat timeLength; // length of time to play the audio
- SoSFFloat inTime; // length of time to fade in over
- SoSFFloat outTime; // length of time to fade out over
- SoSFFloat maxOutputLevel; // maximum output level (0 - 1)
- SoSFEnum rude; // do I change the hardware sampling rate if
- // it isn't the same as the audiofile
- SoSFEnum loop; // do I loop
- SoSFEnum sproc; // do I sproc a child process or
- // play synchronously
- AudioNode();
- ~AudioNode();
- void play();
- void stop();
- void fade();
- void pause();
- void unpause();
- void setNoDone(short);
- int donep();
-
- SoINTERNAL public:
- SO_SF_ENUM_HEADER(AudioNode, 2);
- static void initClass();
-
- };
-
- #endif
-