1
+ #include " SFML/Audio/SoundChannel.hpp"
1
2
#include " System/Vector3.hpp"
2
3
#include < SFML/Audio/SoundStream.hpp>
3
4
#include < cstdint>
@@ -11,10 +12,11 @@ class sfCustomSoundStream final : public sf::SoundStream {
11
12
sfCustomSoundStreamSeekCb onSeek,
12
13
unsigned int channelCount,
13
14
unsigned int sampleRate,
15
+ const std::vector<sf::SoundChannel> *channel,
14
16
void *userData) : myGetDataCb(onGetData),
15
17
mySeekCallCb (onSeek),
16
18
myUserData(userData) {
17
- initialize (channelCount, sampleRate);
19
+ initialize (channelCount, sampleRate, *channel );
18
20
}
19
21
20
22
private:
@@ -35,8 +37,9 @@ extern "C" sfCustomSoundStream *sfCustomSoundStream_new(sfCustomSoundStreamGetDa
35
37
sfCustomSoundStreamSeekCb onSeek,
36
38
unsigned int channelCount,
37
39
unsigned int sampleRate,
40
+ const std::vector<sf::SoundChannel> *channel,
38
41
void *userData) {
39
- return new sfCustomSoundStream (onGetData, onSeek, channelCount, sampleRate, userData);
42
+ return new sfCustomSoundStream (onGetData, onSeek, channelCount, sampleRate, channel, userData);
40
43
}
41
44
42
45
extern " C" void sfCustomSoundStream_del (sfCustomSoundStream *soundStream) {
@@ -68,6 +71,10 @@ extern "C" unsigned int sfCustomSoundStream_getSampleRate(const sfCustomSoundStr
68
71
return soundStream->getSampleRate ();
69
72
}
70
73
74
+ extern " C" const std::vector<sf::SoundChannel> *sfCustomSoundStream_getChannelMap (const sfCustomSoundStream *soundStream) {
75
+ return new std::vector (soundStream->getChannelMap ());
76
+ }
77
+
71
78
extern " C" void sfCustomSoundStream_setPitch (sfCustomSoundStream *soundStream, float pitch) {
72
79
soundStream->setPitch (pitch);
73
80
}
@@ -76,8 +83,8 @@ extern "C" void sfCustomSoundStream_setVolume(sfCustomSoundStream *soundStream,
76
83
soundStream->setVolume (volume);
77
84
}
78
85
79
- extern " C" void sfCustomSoundStream_setPosition (sfCustomSoundStream *soundStream, sfVector3f position) {
80
- soundStream->setPosition (position. x , position. y , position. z );
86
+ extern " C" void sfCustomSoundStream_setPosition (sfCustomSoundStream *soundStream, sf::Vector3f position) {
87
+ soundStream->setPosition (position);
81
88
}
82
89
83
90
extern " C" void sfCustomSoundStream_setRelativeToListener (sfCustomSoundStream *soundStream, bool relative) {
@@ -96,8 +103,8 @@ extern "C" void sfCustomSoundStream_setPlayingOffset(sfCustomSoundStream *soundS
96
103
soundStream->setPlayingOffset (sf::microseconds (timeOffset));
97
104
}
98
105
99
- extern " C" void sfCustomSoundStream_setLoop (sfCustomSoundStream *soundStream, bool loop) {
100
- soundStream->setLoop (loop);
106
+ extern " C" void sfCustomSoundStream_setLooping (sfCustomSoundStream *soundStream, bool loop) {
107
+ soundStream->setLooping (loop);
101
108
}
102
109
103
110
extern " C" float sfCustomSoundStream_getPitch (const sfCustomSoundStream *soundStream) {
@@ -125,8 +132,8 @@ extern "C" float sfCustomSoundStream_getAttenuation(const sfCustomSoundStream *s
125
132
return soundStream->getAttenuation ();
126
133
}
127
134
128
- extern " C" bool sfCustomSoundStream_getLoop (const sfCustomSoundStream *soundStream) {
129
- return soundStream->getLoop ();
135
+ extern " C" bool sfCustomSoundStream_isLooping (const sfCustomSoundStream *soundStream) {
136
+ return soundStream->isLooping ();
130
137
}
131
138
132
139
extern " C" int64_t sfCustomSoundStream_getPlayingOffset (const sfCustomSoundStream *soundStream) {
0 commit comments