Panda3D
|
00001 // Filename: movieAudio.cxx 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 #include "movieAudio.h" 00016 #include "movieAudioCursor.h" 00017 #include "ffmpegAudio.h" 00018 00019 TypeHandle MovieAudio::_type_handle; 00020 00021 //////////////////////////////////////////////////////////////////// 00022 // Function: MovieAudio::Constructor 00023 // Access: Public 00024 // Description: This constructor returns a null audio stream --- a 00025 // stream of total silence, at 8000 samples per second. 00026 // To get more interesting audio, you need to construct 00027 // a subclass of this class. 00028 //////////////////////////////////////////////////////////////////// 00029 MovieAudio:: 00030 MovieAudio(const string &name) : 00031 Namable(name) 00032 { 00033 } 00034 00035 //////////////////////////////////////////////////////////////////// 00036 // Function: MovieAudio::Destructor 00037 // Access: Public, Virtual 00038 // Description: 00039 //////////////////////////////////////////////////////////////////// 00040 MovieAudio:: 00041 ~MovieAudio() { 00042 } 00043 00044 //////////////////////////////////////////////////////////////////// 00045 // Function: MovieAudio::open 00046 // Access: Published, Virtual 00047 // Description: Open this audio, returning a MovieAudioCursor 00048 //////////////////////////////////////////////////////////////////// 00049 PT(MovieAudioCursor) MovieAudio:: 00050 open() { 00051 return new MovieAudioCursor(this); 00052 } 00053 00054 //////////////////////////////////////////////////////////////////// 00055 // Function: MovieAudio::get 00056 // Access: Published, Static 00057 // Description: Obtains a MovieAudio that references a file. 00058 //////////////////////////////////////////////////////////////////// 00059 PT(MovieAudio) MovieAudio:: 00060 get(const Filename &name) { 00061 #ifdef HAVE_FFMPEG 00062 // Someday, I'll probably put a dispatcher here. 00063 // But for now, just hardwire it to go to FFMPEG. 00064 return new FfmpegAudio(name); 00065 #else 00066 return new MovieAudio("Load-Failure Stub"); 00067 #endif 00068 }