Changeset 164 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures
- Timestamp:
- 12/04/2019 02:52:08 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scriptbuilder/structures/ScriptIncident.java
r150 r164 8 8 import java.util.TreeMap; 9 9 import scriptbuilder.structures.events.I_ScriptEvent; 10 import scriptbuilder.structures.ScriptEvent.ScriptEventType; 11 import scriptbuilder.structures.events.I_AudioEvent; 12 import scriptbuilder.structures.events.AudioEvent; 10 13 11 14 /** … … 71 74 */ 72 75 public int eventCount = 0; 76 77 public int audioEventCount = 0; 73 78 74 79 public SimulationScript script; … … 285 290 //Check to see if there's already a timeslice here 286 291 TimeSlice t = slices.get(start); 292 //logic to check if the added event needs to also have an associated audio event. 293 287 294 //If not, make one; then, add the event to it 288 295 if (t == null) 289 296 { 290 297 t = new TimeSlice(start, this); 291 t.addEvent(ev);298 //t.addEvent(ev); 292 299 slices.put(start, t); 293 300 } 294 301 else 295 302 { 296 t.addEvent(ev); 303 //t.addEvent(ev); 304 } 305 t.addEvent(ev); 306 if(ev instanceof I_AudioEvent){ 307 //should make a path and a different filename fields for the file itself. Either that or deal with the string separation each time 308 //needs a check for when we move I_AudioEvents in the incident, as to not make duplicate events. 309 String fileName = number+"/"+number + "" + audioEventCount; 310 AudioEvent audio = (AudioEvent) ScriptEvent.factoryByType(ScriptEventType.AUDIO_EVENT); 311 ((I_AudioEvent) ev).setFileName(fileName); 312 audio.setAudioFilePathRelative(fileName); 313 314 t.addEvent(audio); 315 audioEventCount++; 297 316 } 298 317 eventCount++; … … 524 543 if (!(oldTime == 0 && newTime > oldTime)) 525 544 { 545 if(evt instanceof I_AudioEvent) 546 { 547 //todo: need to figure out how to remove the audioEvent tha corresponds with the 548 this.slices.get(oldTime).removeCorrespondingAudioEvent((I_AudioEvent)evt); 549 //this.addNewEvent(evt,newTime) 550 } 526 551 this.slices.get(oldTime).events.remove(evt); 527 552 this.addNewEvent(evt, newTime);
Note: See TracChangeset
for help on using the changeset viewer.
