Panda3D
microphoneAudio.h
1 // Filename: microphoneAudio.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 MICROPHONEAUDIO_H
16 #define MICROPHONEAUDIO_H
17 
18 #include "movieAudio.h"
19 class MovieAudio;
20 class MovieAudioCursor;
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : MicrophoneAudio
24 // Description : Class MicrophoneAudio provides the means to read
25 // raw audio samples from a microphone.
26 ////////////////////////////////////////////////////////////////////
27 class EXPCL_PANDA_MOVIES MicrophoneAudio : public MovieAudio {
28 
29  PUBLISHED:
30  virtual ~MicrophoneAudio();
31 
32  static int get_num_options();
33  static PT(MicrophoneAudio) get_option(int n);
34  MAKE_SEQ(get_options, get_num_options, get_option);
35 
36  INLINE int get_channels() const;
37  INLINE int get_rate() const;
38 
39  virtual PT(MovieAudioCursor) open() = 0;
40 
41 public:
42  static void find_all_microphones();
43 
44 protected:
45  int _channels;
46  int _rate;
47 
48  static pvector<PT(MicrophoneAudio)> _all_microphones;
49 
50  public:
51  static TypeHandle get_class_type() {
52  return _type_handle;
53  }
54  static void init_type() {
55  MovieAudio::init_type();
56  register_type(_type_handle, "MicrophoneAudio",
57  MovieAudio::get_class_type());
58  }
59  virtual TypeHandle get_type() const {
60  return get_class_type();
61  }
62  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
63 
64  private:
65  static TypeHandle _type_handle;
66 };
67 
68 #include "microphoneAudio.I"
69 
70 #endif
Class MicrophoneAudio provides the means to read raw audio samples from a microphone.
A MovieAudio is actually any source that provides a sequence of audio samples.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
A MovieAudio is actually any source that provides a sequence of audio samples.
Definition: movieAudio.h:48