@@ -167,12 +167,7 @@ namespace RTE {
167
167
168
168
// / Sets the custom pan value of this SoundContainer. Clamped between -1 and 1.
169
169
// / @param customPanValue The new custom pan value.
170
- void SetCustomPanValue (float customPanValue) {
171
- m_CustomPanValue = std::clamp (customPanValue, -1 .0f , 1 .0f );
172
- if (IsBeingPlayed ()) {
173
- g_AudioMan.ChangeSoundContainerPlayingChannelsCustomPanValue (this );
174
- }
175
- }
170
+ void SetCustomPanValue (float customPanValue);
176
171
177
172
// / Gets the panning strength multiplier of this SoundContainer.
178
173
// / @return A float with the panning strength multiplier.
@@ -224,41 +219,23 @@ namespace RTE {
224
219
// / Sets the position of the SoundContainer's sounds while they're playing.
225
220
// / @param position The new position to play the SoundContainer's sounds.
226
221
// / @return Whether this SoundContainer's attenuation setting was successful.
227
- void SetPosition (const Vector& newPosition) {
228
- if (!m_Immobile && newPosition != m_Pos) {
229
- m_Pos = newPosition;
230
- if (IsBeingPlayed ()) {
231
- g_AudioMan.ChangeSoundContainerPlayingChannelsPosition (this );
232
- }
233
- }
234
- }
222
+ void SetPosition (const Vector& newPosition);
235
223
236
224
// / Gets the volume the sounds in this SoundContainer are played at. Note that this does not factor volume changes due to the SoundContainer's position.
237
225
// / @return The volume the sounds in this SoundContainer are played at.
238
226
float GetVolume () const { return m_Volume; }
239
227
240
228
// / Sets the volume sounds in this SoundContainer should be played at. Note that this does not factor volume changes due to the SoundContainer's position. Does not affect currently playing sounds.
241
229
// / @param newVolume The new volume sounds in this SoundContainer should be played at. Limited between 0 and 10.
242
- void SetVolume (float newVolume) {
243
- newVolume = std::clamp (newVolume, 0 .0F , 10 .0F );
244
- if (IsBeingPlayed ()) {
245
- g_AudioMan.ChangeSoundContainerPlayingChannelsVolume (this , newVolume);
246
- }
247
- m_Volume = newVolume;
248
- }
230
+ void SetVolume (float newVolume);
249
231
250
232
// / Gets the pitch the sounds in this SoundContainer are played at. Note that this does not factor in global pitch.
251
233
// / @return The pitch the sounds in this SoundContainer are played at.
252
234
float GetPitch () const { return m_Pitch; }
253
235
254
236
// / Sets the pitch sounds in this SoundContainer should be played at and updates any playing instances accordingly.
255
237
// / @param newPitch The new pitch sounds in this SoundContainer should be played at. Limited between 0.125 and 8 (8 octaves up or down).
256
- void SetPitch (float newPitch) {
257
- m_Pitch = std::clamp (newPitch, 0 .125F , 8 .0F );
258
- if (IsBeingPlayed ()) {
259
- g_AudioMan.ChangeSoundContainerPlayingChannelsPitch (this );
260
- }
261
- }
238
+ void SetPitch (float newPitch);
262
239
263
240
// / Gets the pitch variation the sounds in this SoundContainer are played at.
264
241
// / @return The pitch variation the sounds in this SoundContainer are played at.
@@ -300,7 +277,7 @@ namespace RTE {
300
277
// / Stops playback of this SoundContainer for a specific player.
301
278
// / @param player Player to stop playback of this SoundContainer for.
302
279
// / @return Whether this SoundContainer successfully stopped playing.
303
- bool Stop (int player) { return ( HasAnySounds () && IsBeingPlayed ()) ? g_AudioMan. StopSoundContainerPlayingChannels ( this , player) : false ; }
280
+ bool Stop (int player);
304
281
305
282
// / Restarts playback of this SoundContainer for all players.
306
283
// / @return Whether this SoundContainer successfully restarted its playback.
@@ -309,15 +286,11 @@ namespace RTE {
309
286
// / Restarts playback of this SoundContainer for a specific player.
310
287
// / @param player Player to restart playback of this SoundContainer for.
311
288
// / @return Whether this SoundContainer successfully restarted its playback.
312
- bool Restart (int player) { return ( HasAnySounds () && IsBeingPlayed ()) ? g_AudioMan. StopSoundContainerPlayingChannels ( this , player) && g_AudioMan. PlaySoundContainer ( this , player) : false ; }
289
+ bool Restart (int player);
313
290
314
291
// / Fades out playback of the SoundContainer to 0 volume.
315
292
// / @param fadeOutTime How long the fadeout should take.
316
- void FadeOut (int fadeOutTime = 1000 ) {
317
- if (IsBeingPlayed ()) {
318
- return g_AudioMan.FadeOutSoundContainerPlayingChannels (this , fadeOutTime);
319
- }
320
- }
293
+ void FadeOut (int fadeOutTime = 1000 );
321
294
#pragma endregion
322
295
323
296
#pragma region Miscellaneous
0 commit comments