Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

EDLChunk.java

00001 /*
00002  *  Copyright 2006-2007 Columbia University.
00003  *
00004  *  This file is part of MEAPsoft.
00005  *
00006  *  MEAPsoft is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License version 2 as
00008  *  published by the Free Software Foundation.
00009  *
00010  *  MEAPsoft is distributed in the hope that it will be useful, but
00011  *  WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  *  General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with MEAPsoft; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00018  *  02110-1301 USA
00019  *
00020  *  See the file "COPYING" for the text of the license.
00021  */
00022 
00023 package com.meapsoft;
00024 
00025 import java.util.Iterator;
00026 import java.util.Vector;
00027 
00040 public class EDLChunk extends FeatChunk
00041 {
00042     // Time (in seconds) to synthesize this chunk.
00043     // (as opposed to startTime = the start time of the chunk in the
00044     // source file)
00045     public double dstTime;
00046     
00047     // List of commands that Synthesizer should apply to this chunk.
00048     public Vector commands; 
00049 
00053     public EDLChunk(String sf, double st, double l, double dt)
00054     {
00055         super(sf,st,l);
00056         dstTime = dt;
00057 
00058         commands = new Vector();
00059     }
00060    
00061     public EDLChunk(Chunk c, double dt)
00062     {
00063         this(c.srcFile, c.startTime, c.length, dt);
00064     }
00065 
00066     public EDLChunk(FeatChunk c, double dt)
00067     {
00068         this(c.srcFile, c.startTime, c.length, dt);
00069         features = c.features;
00070     }
00071 
00076     public int compareTo(Object o) throws ClassCastException
00077     {
00078         try
00079         {
00080             EDLChunk c = (EDLChunk)o;
00081             return Double.compare(dstTime, c.dstTime);
00082         }
00083         catch(ClassCastException e)
00084         {
00085             return super.compareTo(o);
00086         }
00087     }
00088 
00093     public String toString()
00094     {
00095         StringBuffer s = new StringBuffer(200);
00096         s.append(dstTime).append(" ").append(srcFile.replaceAll(" ", "%20")).append(" ");
00097         s.append(startTime).append(" ").append(length).append(" ");
00098 
00099         if(commands != null)
00100         {
00101             Iterator x = commands.iterator();
00102             while(x.hasNext())
00103                 s.append(x.next()).append(" ");
00104         }
00105 
00106         s.append(comment).append("\n");
00107         
00108         return s.toString();
00109     }
00110 }
00111 

Generated on Tue Feb 6 19:02:26 2007 for MEAPsoft by doxygen1.2.18