@@ -54,19 +54,16 @@ void MusicMan::Update() {
54
54
if (m_PreviousSoundContainerSetToFade && m_MusicFadeTimer.IsPastRealTimeLimit ()) {
55
55
m_PreviousSoundContainerSetToFade = false ;
56
56
if (m_PreviousSoundContainer) {
57
- g_ConsoleMan.PrintString (" MusicMan: Faded PreviousSoundContainer due to SetToFade." );
58
57
const int musicFadeOutTimeMs = 250 ;
59
58
m_PreviousSoundContainer->FadeOut (musicFadeOutTimeMs);
60
59
}
61
60
}
62
61
} else if (!m_ReturnToDynamicMusic) {
63
62
if (m_CurrentSoundContainer && m_CurrentSoundContainer->GetAudibleVolume () == 0 .0F ) {
64
- g_ConsoleMan.PrintString (" MusicMan: Inaudible CurrentSoundContainer is about to be deleted: " + m_CurrentSoundContainer->GetPresetName ());
65
63
m_CurrentSoundContainer = nullptr ;
66
64
}
67
65
}
68
66
if (m_PreviousSoundContainer && m_PreviousSoundContainer->GetAudibleVolume () == 0 .0F ) {
69
- g_ConsoleMan.PrintString (" MusicMan: Inaudible PreviousSoundContainer is about to be deleted: " + m_PreviousSoundContainer->GetPresetName ());
70
67
m_PreviousSoundContainer = nullptr ;
71
68
}
72
69
}
@@ -110,7 +107,6 @@ bool MusicMan::PlayDynamicSong(const std::string& songName, const std::string& s
110
107
// If this isn't the case, then the MusicTimer's existing setup should make it play properly anyway, even if it's just instant
111
108
if (playImmediately) {
112
109
if (m_IsPlayingDynamicMusic) {
113
- g_ConsoleMan.PrintString (" MusicMan: Immediately played DynamicSong has stopped PreviousSoundContainer." );
114
110
if (m_PreviousSoundContainer) {
115
111
m_PreviousSoundContainer->Stop ();
116
112
m_PreviousSoundContainer = nullptr ;
@@ -127,13 +123,10 @@ bool MusicMan::PlayDynamicSong(const std::string& songName, const std::string& s
127
123
}
128
124
129
125
bool MusicMan::SetNextDynamicSongSection (const std::string& newSongSectionType, bool playImmediately, bool playTransition, bool smoothFade) {
130
- g_ConsoleMan.PrintString (" MusicMan: Attempting to set next DynamicSongSection..." );
131
126
std::string currentDynamicSongSection = " None" ;
132
127
if (m_NextSongSection) {
133
128
currentDynamicSongSection = m_NextSongSection->GetPresetName ();
134
129
}
135
- g_ConsoleMan.PrintString (" Current DynamicSongSection: " + currentDynamicSongSection);
136
- g_ConsoleMan.PrintString (" Desired new DynamicSongSection: " + newSongSectionType);
137
130
138
131
if (!m_IsPlayingDynamicMusic) {
139
132
return false ;
@@ -142,9 +135,7 @@ bool MusicMan::SetNextDynamicSongSection(const std::string& newSongSectionType,
142
135
SelectNextSongSection ();
143
136
SelectNextSoundContainer (playTransition);
144
137
if (playImmediately) {
145
- g_ConsoleMan.PrintString (" Playing new song section immediately!" );
146
138
if (m_PreviousSoundContainerSetToFade) {
147
- g_ConsoleMan.PrintString (" MusicMan: Immediately played new song section has stopped PreviousSoundContainer." );
148
139
m_PreviousSoundContainerSetToFade = false ;
149
140
if (m_PreviousSoundContainer) {
150
141
m_PreviousSoundContainer->Stop ();
@@ -157,44 +148,38 @@ bool MusicMan::SetNextDynamicSongSection(const std::string& newSongSectionType,
157
148
}
158
149
159
150
bool MusicMan::CyclePlayingSoundContainers (bool smoothFade) {
160
- g_ConsoleMan.PrintString (" MusicMan: Cycling SoundContainers..." );
161
151
std::string currentSoundContainer = " None" ;
162
152
if (m_CurrentSoundContainer) {
163
153
currentSoundContainer = m_CurrentSoundContainer->GetPresetName ();
164
154
}
165
- g_ConsoleMan.PrintString (" Current sound container: " + currentSoundContainer);
166
- g_ConsoleMan.PrintString (" Next sound container: " + m_NextSoundContainer->GetPresetName ());
155
+
167
156
std::string previousSoundContainer = " None" ;
168
157
if (m_PreviousSoundContainer) {
169
158
previousSoundContainer = m_PreviousSoundContainer->GetPresetName ();
170
159
}
171
- g_ConsoleMan.PrintString (" Previous sound container: " + previousSoundContainer);
172
160
173
161
if (m_CurrentSoundContainer && m_CurrentSoundContainer->IsBeingPlayed ()) {
174
162
if (smoothFade) {
175
163
m_CurrentSoundContainer->FadeOut (static_cast <int >(m_NextSoundContainer->GetMusicPreEntryTime ()));
176
164
} else if (!m_MusicTimer.IsPastRealTimeLimit ()) {
177
- g_ConsoleMan.PrintString (" No smoothFade and premature cycling means upcoming PreviousSoundContainer will be faded out at entry point." );
178
165
m_PreviousSoundContainerSetToFade = true ;
179
166
m_MusicFadeTimer.Reset ();
180
167
m_MusicFadeTimer.SetRealTimeLimitMS (static_cast <int >(m_NextSoundContainer->GetMusicPreEntryTime ()));
181
168
}
182
169
if (m_PreviousSoundContainer) {
183
- g_ConsoleMan.PrintString (" Found unfaded PreviousSoundContainer. Stopping: " + m_PreviousSoundContainer->GetPresetName ());
184
170
m_PreviousSoundContainerSetToFade = false ;
185
171
m_PreviousSoundContainer->Stop ();
186
172
m_PreviousSoundContainer = nullptr ;
187
173
}
188
174
m_PreviousSoundContainer = std::unique_ptr<SoundContainer>(m_CurrentSoundContainer.release ());
189
- g_ConsoleMan.PrintString (" Moved CurrentSoundContainer to PreviousSoundContainer while cycling, it is now: " + m_PreviousSoundContainer->GetPresetName ());
190
175
}
191
176
192
177
// Clone instead of just point to because we might wanna keep this around even if the DynamicSong is gone
193
178
m_CurrentSoundContainer = std::unique_ptr<SoundContainer>(dynamic_cast <SoundContainer*>(m_NextSoundContainer->Clone ()));
194
179
SelectNextSoundContainer ();
195
- m_MusicTimer. Reset ();
180
+
196
181
double timeUntilNextShouldBePlayed = std::max (0 .0F , m_CurrentSoundContainer->GetMusicExitTime () - m_NextSoundContainer->GetMusicPreEntryTime ());
197
- g_ConsoleMan. PrintString ( " Time until next should be played: " + std::to_string (timeUntilNextShouldBePlayed) );
182
+ m_MusicTimer. Reset ( );
198
183
m_MusicTimer.SetRealTimeLimitMS (timeUntilNextShouldBePlayed);
199
184
m_CurrentSoundContainer->Play ();
200
185
m_CurrentSongSectionType = m_NextSongSectionType;
@@ -254,7 +239,6 @@ void MusicMan::PlayInterruptingMusic(const SoundContainer* soundContainer) {
254
239
}
255
240
256
241
void MusicMan::EndInterruptingMusic () {
257
- g_ConsoleMan.PrintString (" MusicMan: Ending interrupting music." );
258
242
if (m_InterruptingMusicSoundContainer && m_InterruptingMusicSoundContainer->IsBeingPlayed ()) {
259
243
m_InterruptingMusicSoundContainer->Stop ();
260
244
@@ -263,7 +247,6 @@ void MusicMan::EndInterruptingMusic() {
263
247
}
264
248
265
249
if (m_CurrentSoundContainer != nullptr ) {
266
- g_ConsoleMan.PrintString (" Unpausing CurrentSoundContainer." );
267
250
m_CurrentSoundContainer->SetPaused (false );
268
251
}
269
252
0 commit comments