Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 74902ec

Browse files
committed
Cleaned up some non const pointer params in AudioMan and tweaked a header region name
1 parent ba371ea commit 74902ec

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Managers/AudioMan.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ namespace RTE {
524524
FMOD::ChannelGroup *channelGroupToPlayIn = soundContainer->IsImmobile() ? m_ImmobileSoundChannelGroup : m_MobileSoundChannelGroup;
525525
FMOD::Channel *channel;
526526
int channelIndex;
527-
for (SoundContainer::SoundData soundData : soundContainer->GetSelectedSoundSet()) {
527+
for (SoundContainer::SoundData soundData : soundContainer->GetFlattenedSelectedSoundSet()) {
528528
result = (result == FMOD_OK) ? m_AudioSystem->playSound(soundData.SoundObject, channelGroupToPlayIn, true, &channel) : result;
529529
result = (result == FMOD_OK) ? channel->getIndex(&channelIndex) : result;
530530

@@ -562,7 +562,7 @@ namespace RTE {
562562

563563
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
564564

565-
bool AudioMan::ChangeSoundContainerPlayingChannelsPosition(SoundContainer *soundContainer) {
565+
bool AudioMan::ChangeSoundContainerPlayingChannelsPosition(const SoundContainer *soundContainer) {
566566
if (!m_AudioEnabled || !soundContainer) {
567567
return false;
568568
}
@@ -589,7 +589,7 @@ namespace RTE {
589589

590590
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
591591

592-
bool AudioMan::ChangeSoundContainerPlayingChannelsVolume(SoundContainer *soundContainer, float newVolume) {
592+
bool AudioMan::ChangeSoundContainerPlayingChannelsVolume(const SoundContainer *soundContainer, float newVolume) {
593593
if (!m_AudioEnabled || !soundContainer || !soundContainer->IsBeingPlayed()) {
594594
return false;
595595
}
@@ -621,7 +621,7 @@ namespace RTE {
621621

622622
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
623623

624-
bool AudioMan::ChangeSoundContainerPlayingChannelsPitch(SoundContainer *soundContainer) {
624+
bool AudioMan::ChangeSoundContainerPlayingChannelsPitch(const SoundContainer *soundContainer) {
625625
if (!m_AudioEnabled || !soundContainer || !soundContainer->IsBeingPlayed()) {
626626
return false;
627627
}

Managers/AudioMan.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ namespace RTE {
217217
void SetMusicPosition(float position);
218218
#pragma endregion
219219

220-
#pragma region Sound Getters and Setters
220+
#pragma region Overall Sound Getters and Setters
221221
/// <summary>
222222
/// Gets the volume of all sounds. Does not get volume of music.
223223
/// </summary>
@@ -427,22 +427,22 @@ namespace RTE {
427427
/// </summary>
428428
/// <param name="soundContainer">A pointer to a SoundContainer object. Ownership IS NOT transferred!</param>
429429
/// <returns>Whether the position was successfully set.</returns>
430-
bool ChangeSoundContainerPlayingChannelsPosition(SoundContainer *soundContainer);
430+
bool ChangeSoundContainerPlayingChannelsPosition(const SoundContainer *soundContainer);
431431

432432
/// <summary>
433433
/// Changes the volume of a SoundContainer's playing sounds.
434434
/// </summary>
435435
/// <param name="soundContainer">A pointer to a SoundContainer object. Ownership IS NOT transferred!</param>
436436
/// <param name="newVolume">The new volume to play sounds at, between 0 and 1.</param>
437437
/// <returns>Whether the volume was successfully updated.</returns>
438-
bool ChangeSoundContainerPlayingChannelsVolume(SoundContainer *soundContainer, float newVolume);
438+
bool ChangeSoundContainerPlayingChannelsVolume(const SoundContainer *soundContainer, float newVolume);
439439

440440
/// <summary>
441441
/// Changes the frequency/pitch of a SoundContainer's playing sounds.
442442
/// </summary>
443443
/// <param name="soundContainer">A pointer to a SoundContainer object. Ownership IS NOT transferred!</param>
444444
/// <returns>Whether the pitch was successfully updated.</returns>
445-
bool ChangeSoundContainerPlayingChannelsPitch(SoundContainer *soundContainer);
445+
bool ChangeSoundContainerPlayingChannelsPitch(const SoundContainer *soundContainer);
446446
#pragma endregion
447447

448448
#pragma region 3D Effect Handling

0 commit comments

Comments
 (0)