29 #ifndef __H3DSOUNDFILENODE_H__
30 #define __H3DSOUNDFILENODE_H__
52 typedef bool ( *SupportsFileFunc)(
const string &url );
62 CreateNodeFunc _create,
63 SupportsFileFunc _supports ):
65 create_func( _create ),
66 supports_func( _supports ) {
67 if( !H3DSoundFileNode::initialized) {
68 H3DSoundFileNode::registered_file_readers.reset(
69 new list< FileReaderRegistration > );
75 CreateNodeFunc create_func;
76 SupportsFileFunc supports_func;
79 friend struct FileReaderRegistration;
83 virtual unsigned int load(
const string &_url ) = 0;
97 CreateNodeFunc create,
98 SupportsFileFunc supports ) {
105 registered_file_readers->push_back( fr );
115 class local_auto_ptr{
119 typedef T element_type;
122 explicit local_auto_ptr (T* ptr = 0) {
130 local_auto_ptr (local_auto_ptr& rhs)
throw() : ap(rhs.release()) { }
133 local_auto_ptr (local_auto_ptr<Y>& rhs)
throw() : ap(rhs.release()) { }
137 local_auto_ptr& operator= (local_auto_ptr& rhs)
throw(){
139 reset(rhs.release());
144 local_auto_ptr& operator= (local_auto_ptr<Y>& rhs)
throw(){
146 reset(rhs.release());
152 ~local_auto_ptr() throw(){
157 T* get()
const throw(){
163 T* operator->()
const throw(){
168 T* release() throw(){
177 void reset (T* ptr=0) throw(){
188 static local_auto_ptr<list< FileReaderRegistration > > registered_file_readers;
189 static bool initialized;
Header file for H3DSoundStreamNode, X3D scene-graph node.
This abstract node type is used to derive node types that can stream PCM sound data from a file.
Definition: H3DSoundFileNode.h:46
virtual unsigned int load(const string &_url)=0
Load a sound file from the given url that will be used to generate PCM data.
static void registerFileReader(const string &name, CreateNodeFunc create, SupportsFileFunc supports)
Register a file reader that can then be returned by getSupportedFileReader().
Definition: H3DSoundFileNode.h:96
static void registerFileReader(const FileReaderRegistration &fr)
Register a file reader that can then be returned by getSupportedFileReader().
Definition: H3DSoundFileNode.h:104
This abstract node type is used to derive node types that can stream PCM sound data.
Definition: H3DSoundStreamNode.h:42
DualQuaternion operator*(const DualQuaternion &q1, const DualQuaternion &q2)
H3D API namespace.
Definition: Anchor.h:38
Class used to register a class to the registered file readers.
Definition: H3DSoundFileNode.h:58
FileReaderRegistration(const string &_name, CreateNodeFunc _create, SupportsFileFunc _supports)
Constructor.
Definition: H3DSoundFileNode.h:61