1 package tim.prune.data;
3 import java.util.ArrayList;
6 * Class to hold a list of audio clips, using the MediaList superclass
8 public class AudioList extends MediaList
19 * @param inList ArrayList containing audio clip objects
21 private AudioList(ArrayList<MediaObject> inList) {
26 * @return clone of list contents
28 public AudioList cloneList()
30 if (getNumMedia() == 0) return this;
31 ArrayList<MediaObject> listCopy = new ArrayList<MediaObject>();
32 listCopy.addAll(_media);
33 return new AudioList(listCopy);
37 * @return the number of audio clips in the list
39 public int getNumAudios() {
44 * Add an audio clip to the list
45 * @param inAudio object to add
47 public void addAudio(AudioClip inAudio) {
52 * Add an audio clip to the list
53 * @param inAudio object to add
54 * @param inIndex index at which to add
56 public void addAudio(AudioClip inAudio, int inIndex) {
57 addMedia(inAudio, inIndex);
61 * Remove the selected audio clip from the list
62 * @param inIndex index number to remove
64 public void deleteAudio(int inIndex) {
69 * Get the index of the given audio clip
70 * @param inAudio object to check
71 * @return index of this object in the list, or -1 if not found
73 public int getAudioIndex(AudioClip inAudio) {
74 return getMediaIndex(inAudio);
78 * Get the Audio object at the given index
79 * @param inIndex index number, starting at 0
80 * @return specified object
82 public AudioClip getAudio(int inIndex) {
83 return (AudioClip) getMedia(inIndex);
87 * @return true if list contains correlated objects
89 public boolean hasCorrelatedAudios() {
90 return hasCorrelatedMedia();
94 * Remove all correlated media from the list
96 public void removeCorrelatedAudios() {
97 removeCorrelatedMedia();