Debian Codegraph @

libmve/movie_sound.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Descent Developers
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #ifndef LIBMVE_MOVIE_SOUND_H_
20 #define LIBMVE_MOVIE_SOUND_H_cxx . . $ `libmve/movie_sound.h:20:9`!
21
22 #include <SDL_audio.h>
23
24 #include "sound_interface.h"cxx . . $ `<file>/libmve/sound_interface.h`/
25
26 namespace D3cxx . . $ D3/ {
27
28 /// Implementation class for sound device used on movie playback.
29 class MovieSoundDevicecxx . . $ D3/MovieSoundDevice# : ISoundDevicecxx . . $ D3/ISoundDevice# {
30 private:
31 SDL_AudioDeviceID m_device_idcxx . . $ D3/MovieSoundDevice#m_device_id. = 0;
32 uint16_tcxx . . $ uint16_t# m_sample_sizecxx . . $ D3/MovieSoundDevice#m_sample_size. = 0;
33
34 public:
35 /**
36 * Initialize sound device
37 * @param sample_rate sample rate in Hz (22050, 44100...)
38 * @param sample_size sample size (8, 16)
39 * @param channels count of channels (1 for mono, 2 for stereo)
40 * @param buf_size buffer size for SDL audio device
41 * @param is_compressed mark stream as compressed (on streaming will be used decompression functions)
42 */
43 MovieSoundDevicecxx . . $ D3/MovieSoundDevice#MovieSoundDevice(48b93216585987e2).(int sample_rate, uint16_tcxx . . $ uint16_t# sample_size, uint8_tcxx . . $ uint8_t# channels, uint32_tcxx . . $ uint32_t# buf_size, bool is_compressed);
44 ~cxx . . $ D3/MovieSoundDevice#`~MovieSoundDevice`(ced63f7c635d850d).MovieSoundDevicecxx . . $ D3/MovieSoundDevice#();
45
46 /**
47 * Check if sound device is properly initialized
48 * @return true on success
49 */
50 [[nodiscard]] bool IsInitializedcxx . . $ D3/MovieSoundDevice#IsInitialized(50ce9a9e25b4a850).() const { return m_device_idcxx . . $ D3/MovieSoundDevice#m_device_id. > 0; }
51
52 /**
53 * Fill internal audio stream to be played
54 * @param stream source buffer
55 * @param len length of source buffer
56 */
57 void FillBuffercxx . . $ D3/MovieSoundDevice#FillBuffer(4c1d9d34c3551872).(char *stream, int len) const;
58
59 /**
60 * Get sample size
61 * @return 2 (for 16 bit), 1 (for 8 bit)
62 */
63 [[nodiscard]] uint16_tcxx . . $ uint16_t# GetSampleSizecxx . . $ D3/MovieSoundDevice#GetSampleSize(72085aa11f4b6e09).() const { return m_sample_sizecxx . . $ D3/MovieSoundDevice#m_sample_size.; };
64
65 void Playcxx . . $ D3/MovieSoundDevice#Play(49f6e7a06ebc5aa8).() override;
66 void Stopcxx . . $ D3/MovieSoundDevice#Stop(49f6e7a06ebc5aa8).() override;
67 void Lockcxx . . $ D3/MovieSoundDevice#Lock(49f6e7a06ebc5aa8).() override;
68 void Unlockcxx . . $ D3/MovieSoundDevice#Unlock(49f6e7a06ebc5aa8).() override;
69
70 using ISoundDevicecxx . . $ D3/ISoundDevice#::IsCompressedcxx . . $ D3/MovieSoundDevice#IsCompressed(50ce9a9e25b4a850).;
71
72 };
73
74 }
75
76 #endif // LIBMVE_MOVIE_SOUND_H_