/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package scriptbuilder.structures.events;

import scriptbuilder.structures.ELEMENT;
import scriptbuilder.structures.I_XML_Writable;
import scriptbuilder.structures.ScriptEvent;
import scriptbuilder.structures.XMLWriter;

/**
 * Data model for an audio event. Audio events have a filepath leading to an
 * audio file to be played, and a length in seconds of that file.
 *
 * @author Bryan McGuffin
 */
public class AudioEvent extends ScriptEvent implements I_XML_Writable
{

    /**
     * Constructor.
     */
    public AudioEvent()
    {
        super(ScriptEventType.AUDIO_EVENT);
    }

    /**
     * Length of the audio to be played, in seconds.
     */
    public Integer audioLength = 0;

    /**
     * File path for the audio file.
     */
    public String audioPath = "";

    @Override
    public String toXML()
    {
        return XMLWriter.emptyTag(ELEMENT.AUDIO.tag + " Length=\"" + audioLength + "\" Path=\"" + audioPath + "\"");
    }
}
