Panda3D
config_fmodAudio.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file config_fmodAudio.cxx
10  * @author cort
11  */
12 
13 #include "pandabase.h"
14 
15 #include "config_fmodAudio.h"
16 #include "audioManager.h"
17 #include "fmodAudioManager.h"
18 #include "fmodAudioSound.h"
19 #include "pandaSystem.h"
20 #include "dconfig.h"
21 
22 #if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) && !defined(BUILDING_FMOD_AUDIO)
23  #error Buildsystem error: BUILDING_FMOD_AUDIO not defined
24 #endif
25 
26 ConfigureDef(config_fmodAudio);
27 NotifyCategoryDef(fmodAudio, ":audio");
28 
29 ConfigureFn(config_fmodAudio) {
31 }
32 
33 ConfigVariableInt fmod_audio_preload_threshold
34 ("fmod-audio-preload-threshold", 1048576,
35  PRC_DESC("Files that are smaller "
36  "than this number of bytes will be preloaded and kept "
37  "resident in memory, while files that are this size or larger "
38  "will be streamed from disk. Set this to -1 to preload "
39  "every file."));
40 
41 /**
42  * Initializes the library. This must be called at least once before any of
43  * the functions or classes in this library can be used. Normally it will be
44  * called by the static initializers and need not be called explicitly, but
45  * special cases exist.
46  */
47 void
49  static bool initialized = false;
50  if (initialized) {
51  return;
52  }
53 
54  initialized = true;
55  FmodAudioManager::init_type();
56  FmodAudioSound::init_type();
57 
58  AudioManager::register_AudioManager_creator(&Create_FmodAudioManager);
59 
61  ps->add_system("FMOD");
62  ps->add_system("audio");
63  ps->set_system_tag("audio", "implementation", "FMOD");
64 }
65 
66 /**
67  * This function is called when the dynamic library is loaded; it should
68  * return the Create_AudioManager function appropriate to create a
69  * FmodAudioManager.
70  */
71 Create_AudioManager_proc *
75 }
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a convenience class to specialize ConfigVariable as an integer type.
This class is used as a namespace to group several global properties of Panda.
Definition: pandaSystem.h:26
void set_system_tag(const std::string &system, const std::string &tag, const std::string &value)
Intended for use by each subsystem to register its set of capabilities at startup.
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
void add_system(const std::string &system)
Intended for use by each subsystem to register itself at startup.
void init_libFmodAudio()
Initializes the library.
Create_AudioManager_proc * get_audio_manager_func_fmod_audio()
This function is called when the dynamic library is loaded; it should return the Create_AudioManager ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
AudioManager * Create_FmodAudioManager()
Factory Function.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.