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