Panda3D

microphoneAudio.h

00001 // Filename: microphoneAudio.h
00002 // Created by: jyelon (02Jul07)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef MICROPHONEAUDIO_H
00016 #define MICROPHONEAUDIO_H
00017 
00018 #include "movieAudio.h"
00019 class MovieAudio;
00020 class MovieAudioCursor;
00021 
00022 ////////////////////////////////////////////////////////////////////
00023 //       Class : MicrophoneAudio
00024 // Description : Class MicrophoneAudio provides the means to read
00025 //               raw audio samples from a microphone.
00026 ////////////////////////////////////////////////////////////////////
00027 class EXPCL_PANDA_MOVIES MicrophoneAudio : public MovieAudio {
00028 
00029  PUBLISHED:
00030   virtual ~MicrophoneAudio();
00031 
00032   static int                 get_num_options();
00033   static PT(MicrophoneAudio) get_option(int n);
00034   MAKE_SEQ(get_options, get_num_options, get_option);
00035   
00036   INLINE int get_channels() const;
00037   INLINE int get_rate() const;
00038   
00039   virtual PT(MovieAudioCursor) open() = 0;
00040 
00041 public:
00042   static void find_all_microphones();
00043 
00044 protected:
00045   int _channels;
00046   int _rate;
00047 
00048   static pvector<PT(MicrophoneAudio)> _all_microphones;
00049 
00050  public:
00051   static TypeHandle get_class_type() {
00052     return _type_handle;
00053   }
00054   static void init_type() {
00055     TypedWritableReferenceCount::init_type();
00056     register_type(_type_handle, "MicrophoneAudio",
00057                   MovieAudio::get_class_type());
00058   }
00059   virtual TypeHandle get_type() const {
00060     return get_class_type();
00061   }
00062   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00063 
00064  private:
00065   static TypeHandle _type_handle;
00066 };
00067 
00068 #include "microphoneAudio.I"
00069 
00070 #endif
 All Classes Functions Variables Enumerations