Warning: Can't use blame annotator:
svn blame failed on trunk/src/scriptbuilder/structures/events/AudioEvent.java: ("Can't find a temporary directory: Internal error", 20014)

source: tmcsimulator-scriptbuilder/trunk/src/scriptbuilder/structures/events/AudioEvent.java @ 35

Revision 35, 1.2 KB checked in by bmcguffin, 9 years ago (diff)

Added toXML implementation for Audio, CAD detail, Unit, Paramics, Telephone, and CHP radio events.

RevLine 
1/*
2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6package scriptbuilder.structures.events;
7
8import scriptbuilder.structures.ELEMENT;
9import scriptbuilder.structures.I_XML_Writable;
10import scriptbuilder.structures.ScriptEvent;
11
12/**
13 * Data model for an audio event. Audio events have a filepath leading to an
14 * audio file to be played, and a length in seconds of that file.
15 *
16 * @author Bryan McGuffin
17 */
18public class AudioEvent extends ScriptEvent implements I_XML_Writable
19{
20
21    public AudioEvent()
22    {
23        super(ScriptEventType.AUDIO_EVENT);
24    }
25
26    public Integer audioLength = 0;
27
28    public String audioPath = "";
29
30    @Override
31    public String toXML()
32    {
33        return emptyTag(ELEMENT.AUDIO.tag + " Length=\"" + audioLength + "\" Path=\"" + audioPath + "\"");
34    }
35
36    @Override
37    public String openTag(String s)
38    {
39        return "<" + s + ">\n";
40    }
41
42    @Override
43    public String closeTag(String s)
44    {
45        return "</" + s + ">\n";
46    }
47
48    @Override
49    public String emptyTag(String s)
50    {
51        return "<" + s + "/>\n";
52    }
53}
Note: See TracBrowser for help on using the repository browser.