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

Method dumpSources

Engine/source/sfx/sfxSystem.cpp:1140–1222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

sfxSystem.cppFile · 0.80

Calls 15

printfFunction · 0.85
getSourceGroupMethod · 0.80
isStoppedMethod · 0.80
getAttenuatedVolumeMethod · 0.80
getEffectivePriorityMethod · 0.80
hasVoiceMethod · 0.80
getTrackMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
formatMethod · 0.45
getIdMethod · 0.45

Tested by

no test coverage detected