Panda3D
microphoneAudio.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 microphoneAudio.h
10  * @author jyelon
11  * @date 2007-07-02
12  */
13 
14 #ifndef MICROPHONEAUDIO_H
15 #define MICROPHONEAUDIO_H
16 
17 #include "movieAudio.h"
18 class MovieAudio;
19 class MovieAudioCursor;
20 
21 /**
22  * Class MicrophoneAudio provides the means to read raw audio samples from a
23  * microphone.
24  */
25 class EXPCL_PANDA_MOVIES MicrophoneAudio : public MovieAudio {
26 
27  PUBLISHED:
28  virtual ~MicrophoneAudio();
29 
30  static int get_num_options();
31  static PT(MicrophoneAudio) get_option(int n);
32  MAKE_SEQ(get_options, get_num_options, get_option);
33 
34  INLINE int get_channels() const;
35  INLINE int get_rate() const;
36 
37  MAKE_SEQ_PROPERTY(options, get_num_options, get_option);
38  MAKE_PROPERTY(channels, get_channels);
39  MAKE_PROPERTY(rate, get_rate);
40 
41  virtual PT(MovieAudioCursor) open() = 0;
42 
43 public:
44  static void find_all_microphones();
45 
46 protected:
47  int _channels;
48  int _rate;
49 
50  static pvector<PT(MicrophoneAudio)> _all_microphones;
51 
52  public:
53  static TypeHandle get_class_type() {
54  return _type_handle;
55  }
56  static void init_type() {
57  MovieAudio::init_type();
58  register_type(_type_handle, "MicrophoneAudio",
59  MovieAudio::get_class_type());
60  }
61  virtual TypeHandle get_type() const {
62  return get_class_type();
63  }
64  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
65 
66  private:
67  static TypeHandle _type_handle;
68 };
69 
70 #include "microphoneAudio.I"
71 
72 #endif
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
Class MicrophoneAudio provides the means to read raw audio samples from a microphone.
This is our own Panda specialization on the default STL vector.
Definition: pvector.h:42
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A MovieAudio is actually any source that provides a sequence of audio samples.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
A MovieAudio is actually any source that provides a sequence of audio samples.
Definition: movieAudio.h:44