public bool IsLooping() { foreach (SoundEntry soundEntry in m_soundEntries) { Sound sound = soundEntry.FindSound(m_ownerSoundBank); foreach (Track track in sound.m_tracks) { foreach (EventBase trackEvent in track.m_events) { PlayWaveEvent playWave = trackEvent as PlayWaveEvent; // TBD any other event types? if (playWave != null) { if (playWave.m_loopCount == 255) { // Only care about infinite loops. Something that loops 254 times then stops is // still only a very long sound as far as anyone but XACT is concerned. return(true); } } } } } return(false); }
private static Dictionary <string, object> TranslateEvent( Xap.PlayWaveEvent evt, HashSet <string> waveNames ) { var waveEntry = evt.m_waveEntries.First(); waveNames.Add(waveEntry.m_entryName); return(new Dictionary <string, object>() { { "Type", evt.GetType().Name }, { "WaveBank", waveEntry.m_bankName }, { "Wave", waveEntry.m_entryName }, { "LoopCount", evt.m_loopCount } }); }
public override bool SetProperty( string propertyName, string value, string[] source, ref int line ) { switch ( propertyName ) { case "Name": m_name = value; break; case "Volume": m_volume = Parser.ParseInt( value, line ); break; case "Use Filter": m_useFilter = Parser.ParseInt(value, line); break; case "RPC Curve Entry": RpcCurveEntry entry = new RpcCurveEntry(); entry.Parse( source, ref line, OwnerProject ); RpcCurve curve = OwnerProject.m_globalSettings.m_rpcs[entry.m_rpcIndex].m_rpcCurves[entry.m_curveIndex]; m_rpcCurves.Add( curve ); break; case "Clip Entry": throw new NotImplementedException( "Clip Entries don't exist?" ); case "Play Wave Event": PlayWaveEvent playWave = new PlayWaveEvent(); playWave.Parse( source, ref line, OwnerProject ); m_events.Add( playWave ); break; case "Play Sound Event": PlaySoundEvent playSound = new PlaySoundEvent(); playSound.Parse( source, ref line, OwnerProject ); m_events.Add( playSound ); break; case "Stop Event": StopEvent stop = new StopEvent(); stop.Parse( source, ref line, OwnerProject ); m_events.Add( stop ); break; case "Branch Event": // Docs say "not supported", but I'm not sure that's true? BranchEvent branch = new BranchEvent(); branch.Parse( source, ref line, OwnerProject ); m_events.Add( branch ); break; case "Wait Event": WaitEvent wait = new WaitEvent(); wait.Parse( source, ref line, OwnerProject ); m_events.Add( wait ); break; case "Set Effect Parameter": SetEffectParameterEvent effectParam = new SetEffectParameterEvent(); effectParam.Parse( source, ref line, OwnerProject ); m_events.Add( effectParam ); break; case "Set Variable Event": SetVariableEvent variable = new SetVariableEvent(); variable.Parse( source, ref line, OwnerProject ); m_events.Add( variable ); break; case "Set Pitch Event": SetPitchEvent pitch = new SetPitchEvent(); pitch.Parse( source, ref line, OwnerProject ); m_events.Add( pitch ); break; case "Set Volume Event": SetVolumeEvent volume = new SetVolumeEvent(); volume.Parse( source, ref line, OwnerProject ); m_events.Add( volume ); break; case "Marker Event": MarkerEvent marker = new MarkerEvent(); marker.Parse( source, ref line, OwnerProject ); m_events.Add( marker ); break; // These are all obsolete? case "Play Wave From Offset Event": case "Play Wave Variation Event": case "Set Variable Recurring Event": case "Set Marker Recurring Event": default: return false; } return true; }
public override bool SetProperty(string propertyName, string value, string[] source, ref int line) { switch (propertyName) { case "Volume": m_volume = Parser.ParseInt(value, line); break; case "Use Filter": m_useFilter = Parser.ParseInt(value, line); break; case "RPC Curve Entry": RpcCurveEntry entry = new RpcCurveEntry(); entry.Parse(source, ref line, OwnerProject); RpcCurve curve = OwnerProject.m_globalSettings.m_rpcs[entry.m_rpcIndex].m_rpcCurves[entry.m_curveIndex]; m_rpcCurves.Add(curve); break; case "Clip Entry": throw new NotImplementedException("Clip Entries don't exist?"); case "Play Wave Event": PlayWaveEvent playWave = new PlayWaveEvent(); playWave.Parse(source, ref line, OwnerProject); m_events.Add(playWave); break; case "Play Sound Event": PlaySoundEvent playSound = new PlaySoundEvent(); playSound.Parse(source, ref line, OwnerProject); m_events.Add(playSound); break; case "Stop Event": StopEvent stop = new StopEvent(); stop.Parse(source, ref line, OwnerProject); m_events.Add(stop); break; case "Branch Event": // Docs say "not supported", but I'm not sure that's true? BranchEvent branch = new BranchEvent(); branch.Parse(source, ref line, OwnerProject); m_events.Add(branch); break; case "Wait Event": WaitEvent wait = new WaitEvent(); wait.Parse(source, ref line, OwnerProject); m_events.Add(wait); break; case "Set Effect Parameter": SetEffectParameterEvent effectParam = new SetEffectParameterEvent(); effectParam.Parse(source, ref line, OwnerProject); m_events.Add(effectParam); break; case "Set Variable Event": SetVariableEvent variable = new SetVariableEvent(); variable.Parse(source, ref line, OwnerProject); m_events.Add(variable); break; case "Set Pitch Event": SetPitchEvent pitch = new SetPitchEvent(); pitch.Parse(source, ref line, OwnerProject); m_events.Add(pitch); break; case "Set Volume Event": SetVolumeEvent volume = new SetVolumeEvent(); volume.Parse(source, ref line, OwnerProject); m_events.Add(volume); break; case "Marker Event": MarkerEvent marker = new MarkerEvent(); marker.Parse(source, ref line, OwnerProject); m_events.Add(marker); break; // These are all obsolete? case "Play Wave From Offset Event": case "Play Wave Variation Event": case "Set Variable Recurring Event": case "Set Marker Recurring Event": default: return(false); } return(true); }