Changeset 161 in tmcsimulator-scriptbuilder for trunk


Ignore:
Timestamp:
12/04/2019 02:43:12 PM (6 years ago)
Author:
sdanthin
Message:

AudioEvent?.java CHPRadioEvent.java added corresponding functions to match interface and began implementing an ID system.

Location:
trunk/src/scriptbuilder/structures/events
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/structures/events/AudioEvent.java

    r76 r161  
    2727        super(ScriptEventType.AUDIO_EVENT); 
    2828    } 
     29     
     30    /** 
     31     * Constructor with ID 
     32     * @param id AudioEvent ID 
     33     */ 
     34    public AudioEvent(String id) 
     35    { 
     36        super(ScriptEventType.AUDIO_EVENT); 
     37        this.id = id; 
     38    } 
    2939 
    3040    /** 
     
    3747     */ 
    3848    public String audioPath = ""; 
    39  
     49     
     50    /** 
     51     * id represents the audio file name that corresponds with the event 
     52     */ 
     53     public String id = ""; 
     54      
     55    /** 
     56     * sets the audio path relative to the running directory. 
     57     * @param f filename 
     58     */ 
     59     
     60    
     61     
     62    public void setAudioFilePathRelative(String f) 
     63    { 
     64        audioPath = "audio/" + f + ".mp3"; 
     65    } 
     66     
     67    public void setAudioFilePathRelative() 
     68    { 
     69        audioPath = "audio/" + id + ".mp3"; 
     70    } 
     71     
    4072    @Override 
    4173    public String toXML() 
  • trunk/src/scriptbuilder/structures/events/CHPRadioEvent.java

    r155 r161  
    1919 * @author Bryan McGuffin 
    2020 */ 
    21 public class CHPRadioEvent extends ScriptEvent implements I_XML_Writable 
     21public class CHPRadioEvent extends ScriptEvent implements I_XML_Writable, I_AudioEvent 
    2222{ 
    2323 
     
    4444     */ 
    4545    public String radioFile = ""; 
    46  
     46     
     47    /** 
     48     * ID 
     49     */ 
     50    public String id = ""; 
     51     
     52     
    4753    /** 
    4854     * Returns the contents of the CHPRadioEvent to make recording easier. 
     
    5763        } 
    5864        return fileContents; 
     65    } 
     66     
     67    @Override 
     68    public String getFileName() 
     69    { 
     70        return radioFile; 
     71    } 
     72     
     73    @Override 
     74    public String getID() 
     75    { 
     76        return id; 
     77    } 
     78     
     79    @Override 
     80    public void setFileName(String s) 
     81    { 
     82        radioFile = s; 
    5983    } 
    6084     
Note: See TracChangeset for help on using the changeset viewer.