00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "pandabase.h"
00016 #ifdef HAVE_FMODEX //[
00017
00018 #include "config_fmodAudio.h"
00019 #include "audioManager.h"
00020 #include "fmodAudioManager.h"
00021 #include "fmodAudioSound.h"
00022 #include "pandaSystem.h"
00023 #include "dconfig.h"
00024
00025 ConfigureDef(config_fmodAudio);
00026 NotifyCategoryDef(fmodAudio, ":audio");
00027
00028 ConfigureFn(config_fmodAudio) {
00029 init_libFmodAudio();
00030 }
00031
00032 ConfigVariableInt fmod_audio_preload_threshold
00033 ("fmod-audio-preload-threshold", 1048576,
00034 PRC_DESC("Files that are smaller "
00035 "than this number of bytes will be preloaded and kept "
00036 "resident in memory, while files that are this size or larger "
00037 "will be streamed from disk. Set this to -1 to preload "
00038 "every file."));
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 void
00049 init_libFmodAudio() {
00050 static bool initialized = false;
00051 if (initialized) {
00052 return;
00053 }
00054
00055 initialized = true;
00056 FmodAudioManager::init_type();
00057 FmodAudioSound::init_type();
00058
00059 PandaSystem *ps = PandaSystem::get_global_ptr();
00060 ps->add_system("FMOD");
00061 ps->add_system("audio");
00062 ps->set_system_tag("audio", "implementation", "FMOD");
00063 }
00064
00065
00066
00067
00068
00069
00070
00071 Create_AudioManager_proc *
00072 get_audio_manager_func_fmod_audio() {
00073 init_libFmodAudio();
00074 return &Create_FmodAudioManager;
00075 }
00076
00077 #endif //]