Panda3D
userDataAudioCursor.h
1 // Filename: userDataAudioCursor.h
2 // Created by: jyelon (02Jul07)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef USERDATAAUDIOCURSOR_H
16 #define USERDATAAUDIOCURSOR_H
17 
18 #include "pandabase.h"
19 #include "luse.h"
20 #include "pointerTo.h"
21 #include "pointerToArray.h"
22 #include "movieAudioCursor.h"
23 
24 class UserDataAudio;
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : UserDataAudioCursor
28 // Description : A UserDataAudioCursor is a means to manually
29 // supply a sequence of raw audio samples.
30 ////////////////////////////////////////////////////////////////////
31 class EXPCL_PANDA_MOVIES UserDataAudioCursor : public MovieAudioCursor {
32 
33 PUBLISHED:
35  virtual ~UserDataAudioCursor();
36 
37 public:
38  virtual void read_samples(int n, PN_int16 *data);
39  virtual int ready() const;
40  virtual void seek(double offset);
41 
42 public:
43  static TypeHandle get_class_type() {
44  return _type_handle;
45  }
46  static void init_type() {
47  MovieAudioCursor::init_type();
48  register_type(_type_handle, "UserDataAudioCursor",
49  MovieAudioCursor::get_class_type());
50  }
51  virtual TypeHandle get_type() const {
52  return get_class_type();
53  }
54  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
55 
56 private:
57  static TypeHandle _type_handle;
58 };
59 
60 #include "userDataAudioCursor.I"
61 #include "userDataAudio.h"
62 
63 #endif
void read_samples(int n, Datagram *dg)
Read audio samples from the stream into a Datagram.
A UserDataAudioCursor is a means to manually supply a sequence of raw audio samples.
A MovieAudio is actually any source that provides a sequence of audio samples.
A UserDataAudio is a way for the user to manually supply raw audio samples.
Definition: userDataAudio.h:35
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
virtual int ready() const
Returns the number of audio samples that are ready to read.
virtual void seek(double offset)
Skips to the specified offset within the file.