Panda3D
config_audio.h
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_audio.h
10  * @author cary
11  * @date 2000-09-22
12  */
13 
14 #ifndef __CONFIG_AUDIO_H__
15 #define __CONFIG_AUDIO_H__
16 
17 #include "pandabase.h"
18 #include "notifyCategoryProxy.h"
19 #include "configVariableInt.h"
20 #include "configVariableBool.h"
21 #include "configVariableDouble.h"
22 #include "configVariableString.h"
23 #include "configVariableFilename.h"
24 
25 #if defined(WIN32_VC) || defined(WIN64_VC)
26 #pragma warning (disable : 4231)
27 #endif
28 
29 NotifyCategoryDecl(audio, EXPCL_PANDA_AUDIO, EXPTP_PANDA_AUDIO);
30 
31 extern EXPCL_PANDA_AUDIO ConfigVariableBool audio_active;
32 extern EXPCL_PANDA_AUDIO ConfigVariableInt audio_cache_limit;
33 extern EXPCL_PANDA_AUDIO ConfigVariableDouble audio_volume;
34 extern EXPCL_PANDA_AUDIO ConfigVariableFilename audio_dls_file;
35 
36 // We Need This one.
37 extern EXPCL_PANDA_AUDIO ConfigVariableString audio_library_name;
38 
39 // Config vars for Fmod:
40 
41 // Values match FMOD_SPEAKERMODE enum.
42 enum FmodSpeakerMode {
43  FSM_raw,
44  FSM_mono,
45  FSM_stereo,
46  FSM_quad,
47  FSM_surround,
48  FSM_5point1,
49  FSM_7point1,
50 
51  // For backward compatibility
52  FSM_unspecified
53 };
54 
55 EXPCL_PANDA_AUDIO std::ostream &operator << (std::ostream &out, FmodSpeakerMode sm);
56 EXPCL_PANDA_AUDIO std::istream &operator >> (std::istream &in, FmodSpeakerMode &sm);
57 
58 extern EXPCL_PANDA_AUDIO ConfigVariableInt fmod_number_of_sound_channels;
59 extern EXPCL_PANDA_AUDIO ConfigVariableBool fmod_use_surround_sound;
60 extern EXPCL_PANDA_AUDIO ConfigVariableEnum<FmodSpeakerMode> fmod_speaker_mode;
61 
62 // Config vars for OpenAL:
63 
64 extern EXPCL_PANDA_AUDIO ConfigVariableDouble audio_doppler_factor;
65 extern EXPCL_PANDA_AUDIO ConfigVariableDouble audio_distance_factor;
66 extern EXPCL_PANDA_AUDIO ConfigVariableDouble audio_drop_off_factor;
67 extern EXPCL_PANDA_AUDIO ConfigVariableDouble audio_buffering_seconds;
68 extern EXPCL_PANDA_AUDIO ConfigVariableInt audio_preload_threshold;
69 
70 // Config vars for Miles:
71 
72 extern EXPCL_PANDA_AUDIO ConfigVariableBool audio_software_midi;
73 extern EXPCL_PANDA_AUDIO ConfigVariableFilename audio_dls_file;
74 extern EXPCL_PANDA_AUDIO ConfigVariableBool audio_play_midi;
75 extern EXPCL_PANDA_AUDIO ConfigVariableBool audio_play_wave;
76 extern EXPCL_PANDA_AUDIO ConfigVariableBool audio_play_mp3;
77 extern EXPCL_PANDA_AUDIO ConfigVariableInt audio_output_rate;
78 extern EXPCL_PANDA_AUDIO ConfigVariableInt audio_output_bits;
79 extern EXPCL_PANDA_AUDIO ConfigVariableInt audio_output_channels;
80 
81 
82 
83 #ifdef NOTIFY_DEBUG //[
84  // Non-release build:
85  #define audio_debug(msg) \
86  if (audio_cat.is_debug()) { \
87  audio_cat->debug() << msg << std::endl; \
88  } else {}
89 #else //][
90  // Release build:
91  #define audio_debug(msg) ((void)0);
92 #endif //]
93 
94 #define audio_info(msg) \
95  audio_cat->info() << msg << std::endl
96 
97 #define audio_warning(msg) \
98  audio_cat->warning() << msg << std::endl
99 
100 #define audio_error(msg) \
101  audio_cat->error() << msg << std::endl
102 
103 #endif /* __CONFIG_AUDIO_H__ */
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a convenience class to specialize ConfigVariable as a Filename type.
This is a convenience class to specialize ConfigVariable as a boolean type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a convenience class to specialize ConfigVariable as a floating- point type.
This is a convenience class to specialize ConfigVariable as a string type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class specializes ConfigVariable as an enumerated type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a convenience class to specialize ConfigVariable as an integer type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.