MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / dumpSources

Method dumpSources

Engine/source/sfx/sfxSystem.cpp:1137–1219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1135//-----------------------------------------------------------------------------
1136
1137void SFXSystem::dumpSources( StringBuilder* toString, bool excludeGroups )
1138{
1139 SimSet* sources = Sim::getSFXSourceSet();
1140 if( !sources )
1141 return;
1142
1143 bool isFirst = true;
1144 for( SimSet::iterator iter = sources->begin(); iter != sources->end(); ++ iter )
1145 {
1146 SFXSource* source = dynamic_cast< SFXSource* >( *iter );
1147 if( !source )
1148 continue;
1149
1150 bool isGroup = typeid( *source ) == typeid( SFXSource );
1151 if( isGroup && excludeGroups )
1152 continue;
1153
1154 bool isPlayOnce = false;
1155 for( U32 j = 0; j < mPlayOnceSources.size(); ++ j )
1156 if( mPlayOnceSources[ j ] == source )
1157 {
1158 isPlayOnce = true;
1159 break;
1160 }
1161
1162 SFXSource* sourceGroup = source->getSourceGroup();
1163
1164 SFXSound* sound = dynamic_cast< SFXSound* >( source );
1165 SFXController* controller = dynamic_cast< SFXController* >( source );
1166
1167 if( toString )
1168 toString->format( "%s%5i: type=%s, status=%s, blocked=%s, volume=%.2f, priority=%.2f, virtual=%s, looping=%s, 3d=%s, group=%s, playtime=%.2f, playOnce=%s, streaming=%s, hasVoice=%s, track=%s",
1169 ( isFirst ? "" : "\n" ),
1170 source->getId(),
1171 ( isGroup ? "group" : sound ? "sound" : controller ? "list" : "other" ),
1172 source->isPlaying()
1173 ? "playing"
1174 : source->isPaused()
1175 ? "paused"
1176 : source->isStopped()
1177 ? "stopped"
1178 : "unknown",
1179 ( sound && sound->isBlocked() ? "1" : "0" ),
1180 source->getAttenuatedVolume(),
1181 source->getEffectivePriority(),
1182 ( sound && sound->isVirtualized() ? "1" : "0" ),
1183 ( sound && sound->isLooping() ) ? "1" : "0",
1184 source->getDescription()->mIs3D ? "1" : "0",
1185 sourceGroup ? sourceGroup->getName() : "",
1186 source->getElapsedPlayTimeCurrentCycle(),
1187 isPlayOnce ? "1" : "0",
1188 ( sound && sound->isStreaming() ? "1" : "0" ),
1189 ( sound && sound->hasVoice() ? "1" : "0" ),
1190 source->getTrack() ? source->getTrack()->getName() : ""
1191 );
1192 else
1193 Con::printf( "%5i: type=%s, status=%s, blocked=%s, volume=%.2f, priority=%.2f, virtual=%s, looping=%s, 3d=%s, group=%s, playtime=%.2f, playOnce=%s, streaming=%s, hasVoice=%s, track=%s",
1194 source->getId(),

Callers 1

sfxSystem.cppFile · 0.80

Calls 15

printfFunction · 0.85
getSourceGroupMethod · 0.80
getAttenuatedVolumeMethod · 0.80
getEffectivePriorityMethod · 0.80
hasVoiceMethod · 0.80
getIdMethod · 0.65
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
formatMethod · 0.45
isPlayingMethod · 0.45
isPausedMethod · 0.45

Tested by

no test coverage detected