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