ScummVM API documentation
volume_manager.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #include "common/scummsys.h"
23 #include "math/angle.h"
24 #include "zvision/zvision.h"
25 
26 #ifndef ZVISION_VOLUME_MANAGER
27 #define ZVISION_VOLUME_MANAGER
28 
29 namespace ZVision {
30 
31 enum volumeScaling {
32  kVolumeLinear,
33  kVolumePowerLaw,
34  kVolumeParabolic,
35  kVolumeCubic,
36  kVolumeQuartic,
37  kVolumeLogPower,
38  kVolumeLogAmplitude
39 };
40 
42 public:
43  VolumeManager(ZVision *engine, volumeScaling mode);
44  ~VolumeManager() {};
45  volumeScaling getMode() const {
46  return _mode;
47  }
48  void setMode(volumeScaling mode) {
49  _mode = mode;
50  }
51  uint8 convert(uint8 inputValue);
52  uint8 convert(uint8 inputValue, volumeScaling &mode);
53  uint8 convert(uint8 inputValue, Math::Angle azimuth, uint8 directionality = 255);
54  uint8 convert(uint8 inputValue, volumeScaling &mode, Math::Angle azimuth, uint8 directionality = 255);
55 #if defined(USE_MPEG2) && defined(USE_A52)
56  double getVobAmplification(Common::String fileName) const;
57 #endif
58 
59 private:
60  ZVision *_engine;
61  uint _scriptScale = 100; // Z-Vision scripts internally use a volume scale of 0-100; ScummVM uses a scale of 0-255.
62  volumeScaling _mode = kVolumeLinear;
63 };
64 
65 } // End of namespace ZVision
66 
67 #endif
Definition: str.h:59
Definition: focus_list.h:27
Definition: volume_manager.h:41