2009-06-25 07:16:22 -07:00
|
|
|
/*
|
|
|
|
* UstTrack.cs
|
|
|
|
* Copyright (c) 2009 kbinani
|
|
|
|
*
|
|
|
|
* This file is part of Boare.Lib.Vsq.
|
|
|
|
*
|
|
|
|
* Boare.Lib.Vsq is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the BSD License.
|
|
|
|
*
|
|
|
|
* Boare.Lib.Vsq is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
*/
|
2010-03-16 20:14:08 -07:00
|
|
|
#if JAVA
|
|
|
|
package org.kbinani.vsq;
|
2009-06-25 07:16:22 -07:00
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
import java.util.*;
|
|
|
|
#else
|
|
|
|
using System;
|
2009-09-07 03:44:18 -07:00
|
|
|
using bocoree;
|
2010-03-16 20:14:08 -07:00
|
|
|
using bocoree.java.util;
|
2009-09-07 03:44:18 -07:00
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
namespace Boare.Lib.Vsq {
|
|
|
|
#endif
|
2009-06-25 07:16:22 -07:00
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
#if JAVA
|
|
|
|
public class UstTrack implements Cloneable {
|
|
|
|
#else
|
2009-06-25 07:16:22 -07:00
|
|
|
public class UstTrack : ICloneable {
|
2010-03-16 20:14:08 -07:00
|
|
|
#endif
|
|
|
|
public Object Tag;
|
2009-09-07 03:44:18 -07:00
|
|
|
private Vector<UstEvent> m_events;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
|
|
|
public UstTrack() {
|
2009-09-07 03:44:18 -07:00
|
|
|
m_events = new Vector<UstEvent>();
|
2009-06-25 07:16:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public UstEvent getEvent( int index ) {
|
2009-09-07 03:44:18 -07:00
|
|
|
return m_events.get( index );
|
2009-06-25 07:16:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public void setEvent( int index, UstEvent item ) {
|
2009-09-07 03:44:18 -07:00
|
|
|
m_events.set( index, item );
|
2009-06-25 07:16:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public void addEvent( UstEvent item ) {
|
2009-09-07 03:44:18 -07:00
|
|
|
m_events.add( item );
|
2009-06-25 07:16:22 -07:00
|
|
|
}
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
public void removeEventAt( int index ) {
|
2009-09-07 03:44:18 -07:00
|
|
|
m_events.removeElementAt( index );
|
2009-06-25 07:16:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public int getEventCount() {
|
2009-09-07 03:44:18 -07:00
|
|
|
return m_events.size();
|
2009-06-25 07:16:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public Iterator getNoteEventIterator() {
|
2010-03-16 20:14:08 -07:00
|
|
|
#if JAVA
|
|
|
|
return m_events.iterator();
|
|
|
|
#else
|
2009-06-25 07:16:22 -07:00
|
|
|
return new ListIterator<UstEvent>( m_events );
|
2010-03-16 20:14:08 -07:00
|
|
|
#endif
|
2009-06-25 07:16:22 -07:00
|
|
|
}
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
public Object clone() {
|
2009-06-25 07:16:22 -07:00
|
|
|
UstTrack ret = new UstTrack();
|
2010-03-16 20:14:08 -07:00
|
|
|
int c = m_events.size();
|
|
|
|
for ( int i = 0; i < c; i++ ) {
|
|
|
|
ret.m_events.set( i, (UstEvent)m_events.get( i ).clone() );
|
2009-06-25 07:16:22 -07:00
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
2010-03-16 20:14:08 -07:00
|
|
|
|
|
|
|
#if !JAVA
|
|
|
|
public object Clone() {
|
|
|
|
return clone();
|
|
|
|
}
|
|
|
|
#endif
|
2009-06-25 07:16:22 -07:00
|
|
|
}
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
#if !JAVA
|
2009-06-25 07:16:22 -07:00
|
|
|
}
|
2010-03-16 20:14:08 -07:00
|
|
|
#endif
|