| http://www.sim.no/ http://www.coin3d.org/

SoVRMLAudioClip.h
1 /**************************************************************************\
2 *
3 * This file is part of the Coin 3D visualization library.
4 * Copyright (C) by Kongsberg Oil & Gas Technologies.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * ("GPL") version 2 as published by the Free Software Foundation.
9 * See the file LICENSE.GPL at the root directory of this source
10 * distribution for additional information about the GNU GPL.
11 *
12 * For using Coin with software that can not be combined with the GNU
13 * GPL, and for taking advantage of the additional benefits of our
14 * support services, please contact Kongsberg Oil & Gas Technologies
15 * about acquiring a Coin Professional Edition License.
16 *
17 * See http://www.coin3d.org/ for more information.
18 *
19 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
20 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
21 *
22 \**************************************************************************/
23
24 #ifndef COIN_SOVRMLAUDIOCLIP_H
25 #define COIN_SOVRMLAUDIOCLIP_H
26
27 #include <Inventor/nodes/SoSubNode.h>
28 #include <Inventor/nodes/SoNode.h>
29 #include <Inventor/fields/SoSFString.h>
30 #include <Inventor/fields/SoMFString.h>
31 #include <Inventor/fields/SoSFBool.h>
32 #include <Inventor/fields/SoSFFloat.h>
33 #include <Inventor/fields/SoSFTime.h>
34 #include <Inventor/lists/SbStringList.h>
35 #include <Inventor/SbTime.h>
36
37 class SoVRMLAudioClipP;
38
39 class COIN_DLL_API SoVRMLAudioClip : public SoNode
40 {
41 typedef SoNode inherited;
42 SO_NODE_HEADER(SoVRMLAudioClip);
43
44 public:
45 typedef void *open_func(const SbStringList &url,
46 SoVRMLAudioClip *clip, void *userdataptr);
47 typedef size_t read_func(void *datasource,
48 void *buffer, int numframes, int &channels,
49 SoVRMLAudioClip *clip, void *userdataptr);
50 typedef int seek_func(void *datasource, long offset, int whence,
51 SoVRMLAudioClip *clip, void *userdataptr);
52 typedef long tell_func(void *datasource,
53 SoVRMLAudioClip *clip, void *userdataptr);
54 typedef int close_func(void *datasource,
55 SoVRMLAudioClip *clip, void *userdataptr);
56
57 static void initClass(void);
58 SoVRMLAudioClip(void);
59
60 SoSFString description;
61 SoSFBool loop;
62 SoSFFloat pitch;
63 SoSFTime startTime;
64 SoSFTime stopTime;
65 SoMFString url;
66
67 static void setSubdirectories(const SbList<SbString> &subdirectories);
68 static const SbStringList & getSubdirectories();
69 static void setDefaultPauseBetweenTracks(SbTime pause);
70 static SbTime getDefaultPauseBetweenTracks();
71 static void setDefaultIntroPause(SbTime pause);
72 static SbTime getDefaultIntroPause();
73 static void setDefaultSampleRate(int samplerate);
74 static int getDefaultSampleRate();
75 static void setDefaultTimerInterval(SbTime interval);
76 static SbTime getDefaultTimerInterval();
77
78 int getSampleRate();
79
80 void * open(const SbStringList &url);
81 size_t read(void *datasource, void *buffer, int numframes, int &channels);
82 int seek(void *datasource, long offset, int whence);
83 long tell(void *datasource);
84 int close(void *datasource);
85
86 void setCallbacks(open_func *opencb, read_func *readcb, seek_func *seekcb,
87 tell_func *tellcb, close_func *closecb, void *userdataptr);
88
89 protected:
90 virtual ~SoVRMLAudioClip();
91 SoSFTime duration_changed; // eventOut
92 SoSFBool isActive; // eventOut
93
94 private:
95 SoVRMLAudioClipP *pimpl;
96 friend class SoVRMLAudioClipP;
97 };
98
99 #endif // ! COIN_SOVRMLAUDIOCLIP_H
SoVRMLAudioClip::url
SoMFString url
Definition: SoVRMLAudioClip.h:65
SO_NODE_HEADER
#define SO_NODE_HEADER(classname)
SoVRMLAudioClip::stopTime
SoSFTime stopTime
Definition: SoVRMLAudioClip.h:64
SoVRMLAudioClip::pitch
SoSFFloat pitch
Definition: SoVRMLAudioClip.h:62
SoVRMLAudioClip::isActive
SoSFBool isActive
Definition: SoVRMLAudioClip.h:92
SoVRMLAudioClip::startTime
SoSFTime startTime
Definition: SoVRMLAudioClip.h:63
SbList< SbString >
SoSFString
The SoSFString class is a container for an SbString.This field is used where nodes, engines or other field containers needs to store a single string.
Definition: SoSFString.h:31
SoVRMLAudioClip::description
SoSFString description
Definition: SoVRMLAudioClip.h:60
SoVRMLAudioClip::loop
SoSFBool loop
Definition: SoVRMLAudioClip.h:61
SoNode
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
SoSFBool
The SoSFBool class is a container for an SbBool value.This field is used where nodes, engines or other field containers needs to store a boolean on/off or TRUE/FALSE value, like for instance as the "on" field of the SoPointLight, SoSpotLight and SoDirectionalLight node classes.
Definition: SoSFBool.h:30
SoMFString
The SoMFString class is a container for SbString values.This field is used where nodes, engines or other field containers needs to store arrays of strings.
Definition: SoMFString.h:31
SoVRMLAudioClip::duration_changed
SoSFTime duration_changed
Definition: SoVRMLAudioClip.h:91
SoBase::read
static SbBool read(SoInput *input, SoBase *&base, SoType expectedtype)
Definition: SoBase.cpp:1015
SbTime
The SbTime class instances represents time values.SbTime is a convenient way of doing system independ...
Definition: SbTime.h:41
SoVRMLAudioClip
The SoVRMLAudioClip class is used to load and store audio data.Audio data is loaded using the simage ...
Definition: SoVRMLAudioClip.h:39
SoSFTime
The SoSFTime class is a container for an SbTime value.This field is used where nodes, engines or other field containers needs to store a single time representation.
Definition: SoSFTime.h:31
SoSFFloat
The SoSFFloat class is a container for a floating point value.This field is used where nodes...
Definition: SoSFFloat.h:30
SbStringList
The SbStringList class is a container for arrays of SbString pointers.Note that upon using the equali...
Definition: SbStringList.h:31

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.