PK2META-INF/MANIFEST.MFMLK-. K-*ϳR03MuI,.R,KPK۷q1/PK ڈ2YWavFilter.class.. WavFilter"javax/swing/filechooser/FileFilter()VCode  LineNumberTableLocalVariableTablethis LWavFilter;accept(Ljava/io/File;)Z java/io/File isDirectory()Z  getName()Ljava/lang/String;  java/lang/String toLowerCase  .wavendsWith(Ljava/lang/String;)Z !" #fLjava/io/File;fileNameLjava/lang/String;getDescriptionWave Audio Files* SourceFileWavFilter.java!/*    p++M, $    %& '()-+   ,-PK |2F GWavFilter.java// WavFilter.java // Filter for selecting .wav files // // (c) 2005 David Cuny // http://jlipsync.sourceforge.net // Released under Qt Public License import java.io.File; import javax.swing.filechooser.FileFilter; // accept files ending with .wav public class WavFilter extends FileFilter { // Accept all directories and all .jls files public boolean accept(File f) { if (f.isDirectory()) { return true; } String fileName = f.getName().toLowerCase(); if (fileName.endsWith( ".wav" )) { return true; } return false; } // The description of this filter public String getDescription() { return "Wave Audio Files"; } }PK ڈ24iiAviWriter.class. AviWriterjava/lang/Object frameRateI frameCountcurrentFrameNumber frameWidth frameHeightbitCountframeBufferSize frameBuffer[B dataOffsetframeDataIndex[IaudioInputStream&Ljavax/sound/sampled/AudioInputStream; posInFilefileOutputStreamLjava/io/FileOutputStream;hasAudioZwaveSamplesPerSecondwaveSamplesPerFramewaveBitsPerSamplewaveBufferSize waveBuffer waveDataIndex waveDataSizewaveBufferPaddingwaveFrameCount+(Ljava/lang/String;Ljava/lang/String;IIII)V Exceptionsjava/lang/Exception%Code()V "( )  +  -  /  1  3  5  7  9  ;?Bad frame format. Width must be divisible by 4, and height by 2=(Ljava/lang/String;)V "? &@java/io/FileOutputStreamB C@  Ejava/lang/MathGfloor(D)D IJ HK  M  O  QSjava/lang/StringUequals(Ljava/lang/Object;)Z WX VY java/io/File[ \@javax/sound/sampled/AudioSystem^getAudioInputStream6(Ljava/io/File;)Ljavax/sound/sampled/AudioInputStream; `a _bjava/lang/StringBufferdUnable to open audio file f e@append,(Ljava/lang/String;)Ljava/lang/StringBuffer; ij ektoString()Ljava/lang/String; mn eo errMessage q? r$javax/sound/sampled/AudioInputStreamt getFormat#()Ljavax/sound/sampled/AudioFormat; vw uxjavax/sound/sampled/AudioFormatzgetSampleSizeInBits()I |} {~   getSampleRate()F {      getFrameLength()J u getFrameSize } { !       RIFFccOut ? dWordOut(I)V AVI LISThdrlavihB@strlstrhvidswordOut strfauds movi    LineNumberTableLocalVariableTablethis LAviWriter;fileNameLjava/lang/String; waveFileNamewidthheightnFramesframesPerSecond headerSize streamCountwaveFileLjava/io/File;eLjava/lang/Exception; audioFormat!Ljavax/sound/sampled/AudioFormat; byteCountiflags listChunkSize indexesSizedataSize totalFileSizeaddFrameCan't add frame (I)Ljava/lang/StringBuffer; i e, only  allocated00dbwrite([B)V C Ci1i2i3i4getBytes()[B Vtextclose01wbread([BII)I uidx1 ( C usetPixel(IIIII)Vxyrgboffset clearFrame(III)VError javax/swing/JOptionPaneshowMessageDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)V  s SourceFileAviWriter.java       ! "#$&'[***,*.*0*2*4*6*8*:6*<6*4~*6~ &Y>A*CY+DF**4*6h*<`lLhN**NP**8 R,TZ9\Y,]: * c,*0: *eYgh,lps*0*06*,y: * * **l***lh*, iY6 6 ** *lL *p *Y`** ** **6 * T  **p*26 6 *8h`6 *N`*8h `6 *02 *h`6  **2``*h`6 d6 $6 06 ` `6 ** *** ***8**:lL**N*:h** **8****N**4**6******t***8*********:***8**N******4**6**(*(**4**6***<***N*****0**\***8*************8h********************* d***&^1 $,45#6)7/:4?:B=E]FgJsMNQTWXYZ[\acfghij#m7p>qNrXsbxlyv|}~}  &,28>DTaflty &.4:@HPU]bjoty~     & .!3";&A(J)P,U-Z.[[[[[[[4'=  5s      G ($&'z**81&YeY޷h*`l*8lpA*R**O***N*F*P*Y*N``*Y`& 5 79;F?L@TC_FoIyJ z$&',~=z<~>*F*F*Y.`.QT UXY![+\*,,&$&'V~=z<~>z<~6z<~6*F*F*F*F*Y.`.6 bc defg"h)k1l9mBnKpUq>VVPE9)-?$&'R*F+*Y.`.v wx($&'/*0u<h**O*****,**O*F**Y*``*2*F*Y`**8h<*0 *h`<**=$****R.**N*8*0J==***.****.**.**F*0 *,% $:EU\dny '.4/ p,E'j*6`d=*4*6*4h`h6*PT*P`T*P`T" ;<HR^iHjjjjjj H"   '26%*PT*P`T*P`T*Nر%142222 .q?'J +  PK ľ|2NtP::AviWriter.java// AviWriter.java // Create .avi file from framebuffer // // (c) 2005 David Cuny // http://jlipsync.sourceforge.net // Released under Qt Public License import java.io.File; import java.io.FileOutputStream; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.swing.JOptionPane; class AviWriter { int frameRate; // frames per second int frameCount; // total count of frames int currentFrameNumber; // index of frame being written int frameWidth; // frame width int frameHeight; // frame height int bitCount; // size of color data (defaults to 24) int frameBufferSize; // size of buffer holding image byte[] frameBuffer; // buffer holding the image int dataOffset; // position in file where data starts int frameDataIndex[]; // position of frame data in file, relative to dataStarts AudioInputStream audioInputStream = null; int posInFile = 0; // position in file, for debugging FileOutputStream fileOutputStream; // output file // audio support boolean hasAudio = true; // true if this file has audio support int waveSamplesPerSecond; int waveSamplesPerFrame; int waveBitsPerSample; int waveBufferSize; byte waveBuffer[]; // buffer holding wave data for a single frame int waveDataIndex[]; // position of wave data in file, relative to dataStarts int waveDataSize[]; // number of bytes of wave data in frame int waveBufferPadding = 0; int waveFrameCount; // number of wave frames // create the writer, and write out the header public AviWriter( String fileName, String waveFileName, int width, int height, int nFrames, int framesPerSecond) throws Exception { // save the parameters frameWidth = width; frameHeight = height; frameCount = nFrames; frameRate = framesPerSecond; // header size int headerSize = 204; // 12+12+56+8+12+56+8+40 // hard coded bitCount. Other values can be supported, but // you'll have to write your own routines to write to the // framebuffer. bitCount = 24; // number of streams int streamCount = 1; // frame width must be divisible by 4, and height an even number if (((frameWidth & 3) != 0 ) | ((frameHeight & 1) != 0)) { throw new Exception("Bad frame format. Width must be divisible by 4, and height by 2"); } // open the file fileOutputStream = new FileOutputStream( fileName ); // allocate the frame buffer frameBufferSize = frameWidth*frameHeight*(int)Math.floor((bitCount+1)/8); frameBuffer = new byte[frameBufferSize]; // indexes for frame data frameDataIndex = new int[frameCount]; // wave information if (!(waveFileName.equals(""))) { // try to open the file try { File waveFile = new File( waveFileName ); audioInputStream = AudioSystem.getAudioInputStream( waveFile ); hasAudio = true; } catch (Exception e) { errMessage( "Unable to open audio file " + waveFileName ); hasAudio = false; } } if (hasAudio) { // add audio to stream count streamCount = 2; // get the audio format AudioFormat audioFormat = audioInputStream.getFormat(); waveBitsPerSample = audioFormat.getSampleSizeInBits(); waveSamplesPerSecond = (int)audioFormat.getSampleRate(); waveSamplesPerFrame = waveSamplesPerSecond / framesPerSecond; waveBufferSize = waveSamplesPerFrame * ( waveBitsPerSample/8 ); // total count of bytes int byteCount = byteCount = (int)(audioInputStream.getFrameLength() * audioFormat.getFrameSize()); // ensure minimum size for smooth playback waveBufferSize = 1024; waveFrameCount = (int)Math.floor( byteCount / waveBufferSize ); if ( (byteCount % waveBufferSize) != 0 ) { waveFrameCount++; } // indexes for wave data waveDataIndex = new int[waveFrameCount]; waveDataSize = new int[waveFrameCount]; // create and initialize wave buffer waveBuffer = new byte[waveBufferSize]; for (int i = 0; i < waveBufferSize; i++ ) { waveBuffer[i] = 0; } // does the wave buffer need padding? if ((waveBufferSize % 2) != 0) { waveBufferPadding = 1; } } // flags int flags = 2064; // dwFlags 0x18 HASINDEX | TRUSTCKTYPE // list chunk size int listChunkSize = 192; // magic number // calculate total file size int indexesSize = (frameCount*16)+8; int dataSize = ( (frameBufferSize+8) * frameCount ) + 12; // space needed for video frames +4 for movie int totalFileSize; if (hasAudio) { // double the size to include indexes to audio frames indexesSize += (waveFrameCount*16); // add space needed for audio frames dataSize += ( (waveBufferSize+waveBufferPadding+8) * waveFrameCount ); // add to header size headerSize += 100; // flags flags = 272; // dwFlags 0x18 HASINDEX | ISINTERLEAVED // adjust chunk size //listChunkSize += 100; listChunkSize = 292; } headerSize = 304; // sum all the values totalFileSize = headerSize + dataSize + indexesSize; // AVI RIFF file ccOut( "RIFF"); dWordOut(totalFileSize); ccOut( "AVI "); // 'AVI ' ccOut( "LIST"); dWordOut( listChunkSize ); ccOut( "hdrl"); ccOut( "avih"); // avi header dWordOut( 0x38 ); // 00000038 dWordOut( (int)Math.floor(1000000/frameRate)); // dwMicroSecPerFrame dWordOut( frameBufferSize*frameRate ); // dwMaxBytesPerSec dWordOut( 0 ); // dwPaddingGranularity (0) dWordOut( flags ); // dwFlags dWordOut( frameCount ); // dwTotalFrames dWordOut( 0 ); // dwInitialFrames dWordOut( streamCount ); // dwStreams (1 = video only, 2 = audio+video) dWordOut( frameBufferSize ); // dwSuggestedBufferSize dWordOut( frameWidth ); // dwWidth dWordOut( frameHeight ); // dwHeight dWordOut( 0 ); // dwReserved[1] dWordOut( 0 ); // dwReserved[2] dWordOut( 0 ); // dwReserved[3] dWordOut( 0 ); // dwReserved[4] ccOut( "LIST" ); dWordOut( 0x74 ); // size of this chunk ccOut( "strl" ); ccOut( "strh" ); dWordOut( 0x38 ); // size of this chunk - FIXME! ccOut( "vids" ); // fccType /* Note: the codecs are: cvid Radius CinePak msvc Microsoft Video 1 iv32 Intel Indeo 3.2 iv41 Intel Indeo 4.1 iv50 Intel Indeo 5.1 mpg4 Microsoft MPEG4 v1 mp42 Microsoft MPEG4 v2 mp43 Microsoft MPEG4 v3 div3 DivX Low-Motion div4 DivX Fast-Motion divx Divx 4.x/5.x xvid Xvid dvsd DV-AVI type 2 dvsd DV (D1) type 1 dvhd DV (HD) dvsl DV (???) */ dWordOut( 0 ); // fccHandler: should this be 'dvsd'? dWordOut( 0 ); // dwFlags 0x0 wordOut( 0 ); // wPriority wordOut( 0 ); // wLanguage 0x0 undefined dWordOut( 0 ); // dwInitialFrames dWordOut( 1 ); // dwScale (example had 100 = 29.970 frames/sec) dWordOut( frameRate ); // dwRate dWordOut( 0 ); // dwStart dWordOut( frameCount ); // length dWordOut( frameBufferSize ); // suggested buffer size dWordOut( 0 ); // dwQuality dWordOut( 0 ); // dwSampleSize wordOut( 0 ); // rcFrame left wordOut( 0 ); // rcFrame top wordOut( frameWidth ); // rcFrame right wordOut( frameHeight ); // rcFrame bottom ccOut( "strf" ); // AVI Stream Format dWordOut( 40 ); // size of this chunk dWordOut( 40 ); // size of this chunk, (repeated, odd) dWordOut( frameWidth ); // biWidth dWordOut( frameHeight ); // biHeight wordOut( 1 ); // biPlanes wordOut( bitCount ); // biBitCount dWordOut( 0 ); // No compression - "raw " and "rgb " don't work dWordOut( frameBufferSize ); // biSizeImage dWordOut( 0 ); // biXPelsPerMeter dWordOut( 0 ); // biYPelsPerMeter dWordOut( 0 ); // biClrUsed dWordOut( 0 ); // biClrImportant // does this have audio? if (hasAudio) { ccOut( "LIST" ); dWordOut( 92 ); // size of this chunk - fixme! (94 if using cbSize) ccOut( "strl" ); // stream 1 (audio stream) "strl" ccOut( "strh" ); // audio header "strh dWordOut( 56 ); // size of header (56) ccOut( "auds" ); // fccType "auds" ccOut( " " ); // fccHandler (codec) dWordOut( 0 ); // dwFlags 0x0 wordOut( 0 ); // wPriority wordOut( 0 ); // wLanguage 0x0 undefined dWordOut( 0 ); // dwInitialFrames (8268) dWordOut( 1 ); // dwScale (1) dWordOut( waveSamplesPerSecond ); // dwRate (11025) dWordOut( 0 ); // dwStart (0) dWordOut( waveBufferSize * frameCount ); // length (25924) dWordOut( waveBufferSize ); // suggested buffer size (8268) dWordOut( 0 ); // dwQuality (should this be 1?) (0) dWordOut( 1 ); // dwSampleSize (1) wordOut( 0 ); // rcFrame left (0) wordOut( 0 ); // rcFrame top (0) wordOut( 0 ); // rcFrame right (0) wordOut( 0 ); // rcFrame bottom (0) ccOut( "strf" ); // audio format "strf" dWordOut( 16 ); // side of header (18) wordOut( 1 ); // wFormatTag (codec) 1 = PCM (1) wordOut( 1 ); // nChannels = 1 (mono) (FIXME!) (1) dWordOut( waveSamplesPerSecond ); // nSamplesPerSec (11025) dWordOut( waveSamplesPerSecond ); // nAvgBytesPerSec (11025) wordOut( 1 ); // nBlockAlign (1) What is this??? wordOut( waveBitsPerSample ); // wBitsPerSample (8) // wordOut( 0 ); // cbSize (ignored for PCM) } ccOut( "LIST"); // ChunkID + length dWordOut( dataSize-8 ); ccOut( "movi" ); // data starts here dataOffset = 4; currentFrameNumber = 0; } // write the current frame buffer to the avi file void addFrame() throws Exception { // check current frame if (currentFrameNumber >= frameCount) { // throw an exception throw new Exception("Can't add frame " + (currentFrameNumber+1) + ", only " + frameCount + " allocated"); } // save position of frame data frameDataIndex[currentFrameNumber] = dataOffset; // 8 byte header // "00" = stream 0, "db" = uncompressed video frame ccOut("00db"); dWordOut(frameBufferSize); // framebuffer data fileOutputStream.write( frameBuffer ); // increment data position dataOffset += 8 + frameBufferSize; // increment current frame index currentFrameNumber += 1; } // write out word-sized number public void wordOut( int i ) throws Exception { // get the low byte int i1 = i & 0xFF; // get the high byte i = i >> 8; int i2 = i & 0xFF; // write them to the file fileOutputStream.write( i1 ); fileOutputStream.write( i2 ); posInFile += 2; } // write out a double-word sized number public void dWordOut( int i ) throws Exception { // get the bytes int i1 = i & 0xFF; i = i >> 8; int i2 = i & 0xFF; i = i >> 8; int i3 = i & 0xFF; i = i >> 8; int i4 = i & 0xFF; // write them out fileOutputStream.write( i1 ); fileOutputStream.write( i2 ); fileOutputStream.write( i3 ); fileOutputStream.write( i4 ); posInFile += 4; } // write out a 4 byte character code public void ccOut( String text ) throws Exception { fileOutputStream.write( text.getBytes() ); posInFile += 4; } // write out the indexes, and close the file public void close() throws Exception { // need to add audio data? if (hasAudio) { // write out the wave frames for ( int i = 0; i < waveFrameCount; i++ ) { // save position waveDataIndex[i] = dataOffset; // 8 byte header // "01" = stream 1, "wb" = wave buffer ccOut("01wb"); dWordOut(waveBufferSize); // read in the audio waveDataSize[i] = audioInputStream.read(waveBuffer, 0, waveBufferSize); // write wave data fileOutputStream.write( waveBuffer ); // increment data position dataOffset += 8 + waveBufferSize; // need to pad buffer to an even boundary? if (waveBufferPadding != 0) { fileOutputStream.write( 0 ); dataOffset += 1; } } } // frame index int dataSize = frameCount * 16; if (hasAudio) { // include audio frames dataSize += waveFrameCount * 16; } ccOut( "idx1" ); dWordOut(dataSize); // index data size only 14.6.2004 BLE // video frame indexes for ( int i = 0; i < frameCount; i++ ) { // "00" = stream 0, "db" = uncompressed video frame ccOut("00db"); dWordOut( 0x10 ); // key frame flag dWordOut( frameDataIndex[i] ); // offset to chunk dWordOut(frameBufferSize); // frame buffer size } // audio frame indexes if (hasAudio) { for ( int i = 0; i < waveFrameCount; i++ ) { ccOut("01wb"); dWordOut( 0x10 ); // key frame flag // empty frame? (shouldn't happen) if (waveDataSize[i] == -1 ) { dWordOut( 0 ); // doesn't matter dWordOut( 0 ); // no size } else { dWordOut( waveDataIndex[i] ); // offset to chunk dWordOut(waveDataSize[i]); // frame buffer size } } } // close the file fileOutputStream.close(); // close the audio file if (hasAudio) { audioInputStream.close(); } } // set the requested pixel in the framebuffer public void setPixel( int x, int y, int r, int g, int b ) { // this assumes a 24 bit framebuffer: ints stored in r, g, b order // invert the y value y = frameHeight - (y+1); // range check if ( x < 0 | y < 0 | x > frameWidth | y > frameHeight ) { return; } // offset into the buffer int offset = ((y * frameWidth) + x) * 3; // set rgb values frameBuffer[offset] = (byte)b; frameBuffer[offset+1] = (byte)g; frameBuffer[offset+2] = (byte)r; } // set the frame to a requested color void clearFrame( int r, int g, int b ) { // this assumes a 24 bit framebuffer // fill the buffer for ( int i = 0; i < frameBufferSize; i += 3 ) { frameBuffer[i] = (byte)b; frameBuffer[i+1] = (byte)g; frameBuffer[i+2] = (byte)r; } } public void errMessage( String s ) { JOptionPane.showMessageDialog(null, s, "Error", JOptionPane.ERROR_MESSAGE); } } PK ڈ2lU U SimpleXmlReader.class.SimpleXmlReaderjava/io/FileInputStreamtagLjava/lang/String;(Ljava/io/File;)V Exceptionsjava/io/FileNotFoundException Code   java/lang/String(Ljava/lang/String;)V    LineNumberTableLocalVariableTablethisLSimpleXmlReader;fileNameLjava/io/File; getCurrentTag()Ljava/lang/String;java/io/IOException length()I "# $read &# 'Unexpected end of file) !java/lang/StringBuffer,()V . -/Expected start of XML tag, not 1 -append(C)Ljava/lang/StringBuffer; 45 -6(char #8,(Ljava/lang/String;)Ljava/lang/StringBuffer; 4: -;(I)Ljava/lang/StringBuffer; 4= ->)@toString B -CExpected XML tag not E{EOF}GbIbufferLjava/lang/StringBuffer; getString&(Ljava/lang/String;)Ljava/lang/String;  O<Q>Sequals(Ljava/lang/Object;)Z UV WExpected XML tag <Y>, not [Expected XML tag data for , not end of file_Expected tag *,D*R #&()&++&H.P1W2~46789;6>? IJP}KLMN ! ,*P-YR3+<T<DX'!Y-YZ3+<\<*P<D+-Y0:*(> !Y-Y^3+<`<D+<7WDM-YR3:?*(>-!Y-Yb3+<\<D<H<D+7W>D-Yd3+<T<DX(!Y-Yf3+<\<D<D+*,ZIJCNLTQUVVsZz[}^Qcfijklnirs$u*w>,,ghQ4IJIJLKLiN ! =*PM+%,+,X$!Y-Yk3+<m<,<D+*,5; ==g8nop ! ;*+tuqr ! @ *+w}  uN ! d(*P-YR3+<T<DX *+w%((uPK |2Ӻ!!SimpleXmlReader.java// SimpleXmlReader.java // Basic XML-style file reader // // (c) 2005 David Cuny // http://jlipsync.sourceforge.net // Released under Qt Public License import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; public class SimpleXmlReader extends FileInputStream { // holds the last tag not accepted public String tag = new String(""); public SimpleXmlReader( File fileName ) throws FileNotFoundException { super( fileName ); } // get the next XML tag in the stream public String getCurrentTag() throws IOException { // if there is an unprocessed tag, return that if ( tag.length() != 0 ) { return tag; } // start reading tag int b = read(); // skip whitespace while ( b == -1 || b == '\n' || b == '\r' || b == '\t' || b == ' ' ) { // check for end of file... if ( b == -1 ) { throw new IOException( "Unexpected end of file" ); } b = read(); } StringBuffer buffer = new StringBuffer(); // read first character if ( (char)b != '<' ) { throw new IOException( "Expected start of XML tag, not " + (char)b + "(char #" + b + ")"); } buffer.append( (char)b ); // read until '<' is reached while ( (char)b != '>' ) { b = (int)read(); if ( b == -1 ) { throw new IOException( "Expected XML tag not " + buffer.toString() +"{EOF}" ); } buffer.append( (char)b ); } tag = buffer.toString(); return tag; } public String getString( String expectedTag ) throws IOException { String value; int b; if ( !getCurrentTag().equals("<" + expectedTag + ">" )) { throw new IOException( "Expected XML tag <" + expectedTag + ">, not " + getCurrentTag() ); } // create a buffer to accumulate into StringBuffer buffer = new StringBuffer(); // read from the stream while (true) { // read a byte b = read(); if ( b == -1 ) { throw new IOException( "Expected XML tag data for , not end of file" ); } // end of tag? if ( (char)b == '<' ) { break; } else { // accumulate buffer.append( (char)b ); } } // save the value value = buffer.toString(); // clear the buffer buffer = new StringBuffer("<"); // closing tag while ( (char)b != '>' ) { b = read(); if ( b == -1 ) { throw new IOException( "Expected tag , not " + buffer.toString() + "{EOF}" ); } buffer.append( (char)b ); } // check tag if (!buffer.toString().equals( "" )) { throw new IOException( "Expected XML tag , not " + buffer.toString() ); } tag = ""; return value; } // get the next tag in the stream. String getTag( String expectedTag ) throws IOException { // check against expected tag String theTag = getCurrentTag(); if ( expectedTag.length() != 0 && !expectedTag.equals(theTag) ) { throw new IOException( "Expected XML tag " + expectedTag + ", not " + theTag ); } // clear it tag = ""; return theTag; } public int getInt( String s ) throws IOException { return (int)getFloat(s); } public float getFloat( String s ) throws IOException { return Float.valueOf(getString( s )).floatValue(); } // return value from optional tag public String getOptionalString( String s ) throws IOException { // is this the requested tag? if ( getCurrentTag().equals("<" + s + ">") ) { // get the string return getString( s ); } // return an empty string return ""; } }PK ڈ2Ӽ0TimeSheetTableModel.class.xTimeSheetTableModel$javax/swing/table/AbstractTableModel timeSheet LTimeSheet; columnNames[Ljava/lang/String; checkMarkLjavax/swing/ImageIcon; noCheckMark(LTimeSheet;)VCode()V  java/lang/StringFrame Time CodeKeyMouthComments  images/check.gif  Utilities"createImageIcon+(Ljava/lang/String;)Ljavax/swing/ImageIcon; $% #& (images/no_check.gif* ,  .LineNumberTableLocalVariableTablethisLTimeSheetTableModel;getColumnCount()I getRowCount TimeSheet7 frameCountI 9: 8; getColumnName(I)Ljava/lang/String;col getValueAt(II)Ljava/lang/Object;java/lang/StringBufferBvalueOf D> E(Ljava/lang/String;)V G CHtoString()Ljava/lang/String; JK CL calcTimeCode N> 8Okey[Z QR 8Smouth U 8Vcomment X 8Y[rowisCellEditable(II)Z setValueAt(Ljava/lang/Object;II)Vjava/lang/BooleanbTRUELjava/lang/Boolean; de cfvalueLjava/lang/Object;flaggetColumnClass(I)Ljava/lang/Class; @A mjava/lang/ObjectogetClass()Ljava/lang/Class; qr psc SourceFileTimeSheetTableModel.java   =**YSYSYSYSYS*!')*+'-*+/0.  %./47<1=23=450*0 1 23652*/<0$1 23=>;*20(123?:@Ami#4?U_CY`FIM*/`P*/T3*)*-*/W2*/Z2\0& ,$/52@6L7Q9V=`@jD1 m23m]:m?:^_G 0I1  23 ]: ?:`aYW:J+c:*/TgT */W+S*/Z+S0"NP"Q8R;UHVKYX\14Y23YhiY]:Y?:"jekl> *nt0_1 23 u:vwPK i|2@rTimeSheetTableModel.java// TimeSheetTableModel.java // Display TimeSheet information in a JTable // // (c) 2005 David Cuny // http://jlipsync.sourceforge.net // Released under Qt Public License import javax.swing.ImageIcon; import javax.swing.table.AbstractTableModel; // table model for the timesheet class TimeSheetTableModel extends AbstractTableModel { TimeSheet timeSheet; String columnNames[] = { "Frame", "Time Code", "Key", "Mouth", "Comments" }; ImageIcon checkMark = Utilities.createImageIcon("images/check.gif"); ImageIcon noCheckMark = Utilities .createImageIcon("images/no_check.gif"); public TimeSheetTableModel(TimeSheet timeSheet) { // save data this.timeSheet = timeSheet; } public int getColumnCount() { return columnNames.length; } public int getRowCount() { return timeSheet.frameCount; } public String getColumnName(int col) { return columnNames[col]; } public Object getValueAt(int row, int col) { switch (col) { case TimeSheet.COLUMN_FRAME: // frame number return row + 1 + ""; case TimeSheet.COLUMN_TIMECODE: return timeSheet.calcTimeCode(row + 1); case TimeSheet.COLUMN_KEY: // return new Boolean(timeSheetKey[row]); if (timeSheet.key[row]) { return checkMark; } else { return noCheckMark; } case TimeSheet.COLUMN_MOUTH: return timeSheet.mouth[row]; case TimeSheet.COLUMN_COMMENTS: return timeSheet.comment[row]; } // shouldn't happen return ""; } public boolean isCellEditable(int row, int col) { // only column 4 is editable return (col == TimeSheet.COLUMN_COMMENTS); } public void setValueAt(Object value, int row, int col) { switch (col) { case TimeSheet.COLUMN_KEY: Boolean flag = (Boolean) value; timeSheet.key[row] = (flag == Boolean.TRUE); break; case TimeSheet.COLUMN_MOUTH: timeSheet.mouth[row] = (String) value; break; case TimeSheet.COLUMN_COMMENTS: timeSheet.comment[row] = (String) value; break; } } public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); } } PK ڈ2 ԳddTimeSheet.class.d TimeSheetjava/lang/Object COLUMN_FRAMEI ConstantValueCOLUMN_TIMECODE COLUMN_KEY COLUMN_MOUTHCOLUMN_COMMENTS frameCountframesPerSecond hourOffset minuteOffset secondOffsetmouth[Ljava/lang/String;commentkey[Z(II)VCode()V    !  #  %  'init ) *LineNumberTableLocalVariableTablethis LTimeSheet;java/lang/String02(Ljava/lang/String;)V 4 15  7  9  ;  =i calcTimeCode(I)Ljava/lang/String;java/lang/StringBufferB C50Eappend,(Ljava/lang/String;)Ljava/lang/StringBuffer; GH CI(I)Ljava/lang/StringBuffer; GK CL:N.PtoString()Ljava/lang/String; RS CTJLipSyncV padString'(Ljava/lang/String;I)Ljava/lang/String; XY WZframesLjava/lang/StringBuffer;secondshoursminutes SourceFileTimeSheet.java       u* *"*$*&*(*+,  - ./)f*"*1$*1&*(>+*$1Y36S*&1Y36S*(T*"*8*:*<*>,:%( )*-!.0/?0F-Q4V5[6`7e8-*f./ff3?@AlCY3DMd*8l>*:h*<``>l6hd> ,FJW,MW,OJW ,FJW,MW,OJW ,FJW,MW,QJW ,FJW,MW,U [,^; >A+C2D;FAGIJPKWL^MeNlOsPzQRSTUVWX[->./\ ]^_2`AwabcPK X|2%8/\\TimeSheet.java// TimeSheet.java // Time sheet information // // (c) 2005 David Cuny // http://jlipsync.sourceforge.net // Released under Qt Public License class TimeSheet { // timesheet columns final static int COLUMN_FRAME = 0; final static int COLUMN_TIMECODE = 1; final static int COLUMN_KEY = 2; final static int COLUMN_MOUTH = 3; final static int COLUMN_COMMENTS = 4; // settings for timesheet int frameCount = 0; int framesPerSecond; int hourOffset; int minuteOffset; int secondOffset; // timesheet data String mouth[] = null; String comment[] = null; boolean key[] = null; public TimeSheet( int frameCount, int framesPerSecond ) { this.init(frameCount, framesPerSecond); } // erase the timesheet public void init( int frameCount, int framesPerSecond ) { // save frame count this.frameCount = frameCount; // allocate space this.mouth = new String[frameCount]; this.comment = new String[frameCount]; this.key = new boolean[frameCount]; // fill with blanks for (int i = 0; i < this.frameCount; i++) { this.mouth[i] = new String(""); this.comment[i] = new String(""); this.key[i] = false; } // reset values to defaults this.framesPerSecond = framesPerSecond; this.hourOffset = 0; this.minuteOffset = 0; this.secondOffset = 0; } public String calcTimeCode(int frame) { StringBuffer s = new StringBuffer(""); // calculate number of seconds int seconds = (frame - 1) / framesPerSecond; // add offsets seconds += (hourOffset * 3600) + (minuteOffset * 60) + secondOffset; int hours = seconds / 3600; seconds -= hours * 3600; int minutes = seconds / 60; seconds -= minutes * 60; // build the time if (hours < 10) s.append("0"); s.append(hours); s.append(":"); if (minutes < 10) s.append("0"); s.append(minutes); s.append(":"); if (seconds < 10) s.append("0"); s.append(seconds); s.append("."); if (frame < 10) s.append("0"); s.append(frame); // convert to string return JLipSync.padString(s.toString(), 12); } } PK ى2ʫ϶JLipSync$1$MyCellRenderer.class.lJLipSync$1$MyCellRendererjavax/swing/JLabeljavax/swing/ListCellRendererthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethisLJLipSync$1$MyCellRenderer;getListCellRendererComponent>(Ljavax/swing/JList;Ljava/lang/Object;IZZ)Ljava/awt/Component;java/lang/ObjecttoString()Ljava/lang/String;  setText(Ljava/lang/String;)V   JLipSync" facePanel LFacePanel; $% #& FacePanel( getSmallFace+(Ljava/lang/String;)Ljavax/swing/ImageIcon; *+ ),setIcon(Ljavax/swing/Icon;)V ./ 0javax/swing/JList2getSelectionBackground()Ljava/awt/Color; 45 36 setBackground(Ljava/awt/Color;)V 89 :getSelectionForeground <5 3= setForeground ?9 @ getBackground B5 3C getForeground E5 3F isEnabled()Z HI 3J setEnabled(Z)V LM NgetFont()Ljava/awt/Font; PQ 3RsetFont(Ljava/awt/Font;)V TU V setOpaque XM YlistLjavax/swing/JList;valueLjava/lang/Object;indexI isSelectedZ cellHasFocussLjava/lang/String;faceIconLjavax/swing/Icon; SourceFile JLipSync.java InnerClassesMyCellRenderer    4 **+   n,:*!*'*'-: *1*+7;*+>A*+D;*+GA*+KO*+SW*Z*>$% )*$+),/142<3G5O6W9_:g;l<Rnn[\n]^n_`nabncbhde$ fghij kPK ى2m&JLipSync$1.class.& JLipSync$1java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$1;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSynccancelledAutoSave()Z  eraseTimeSheet  eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    S**   !"#$% PK ى2OQGJLipSync$10.class.) JLipSync$10java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$10;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSynccancelledAutoSave()Z  java/lang/Systemexit(I)V ! "eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+ ;   P*#> ? BC$%&'( PK ى2o1JLipSync$11.class.- JLipSync$11java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$11;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync wavePanel LWavePanel;   WavePanel frameCountI ! " playFrames(II)V $% &eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+ T   K**#' VW()*+, PK ى2OJLipSync$12.class.0 JLipSync$12java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$12;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync wavePanel LWavePanel;   WavePanel markerStartI ! " markerEnd $! % playFrames(II)V '( )eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+ _   T**#*&* ab+,-./ PK ى2|ucJLipSync$13.class.0 JLipSync$13java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$13;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync wavePanel LWavePanel;   WavePanel markerStartI ! " frameCount $! % playFrames(II)V '( )eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+ n   T**#*&* pq+,-./ PK ى2JLipSync$14.class.- JLipSync$14java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$14;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync wavePanel LWavePanel;   WavePanel markerEndI ! " playFrames(II)V $% &eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+ }   K**#' ()*+, PK ى2=ΕJLipSync$15.class.( JLipSync$15java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$15;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync wavePanel LWavePanel;   WavePanel zoomToFit !eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    C *"    #$%&' PK ى2bRJLipSync$16.class.( JLipSync$16java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$16;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync wavePanel LWavePanel;   WavePanelzoomAll !eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    C *"    #$%&' PK ى2eMJLipSync$17.class. JLipSync$17java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$17;actionPerformed(Ljava/awt/event/ActionEvent;)Vjava/lang/StringBuffer JLipSync timeSheet LTimeSheet;   TimeSheet! hourOffsetI #$ "%0'append,(Ljava/lang/String;)Ljava/lang/StringBuffer; )* +java/lang/String-valueOf(I)Ljava/lang/String; /0 .1(Ljava/lang/String;)V 3 4:6toString()Ljava/lang/String; 89 : minuteOffset <$ "= secondOffset ?$ "@(I)Ljava/lang/StringBuffer; )B CEnter the new base time:Ejavax/swing/JOptionPaneGshowInputDialogL(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String; IJ HK .:split((Ljava/lang/String;I)[Ljava/lang/String; NO .Pjava/lang/IntegerRparseInt(Ljava/lang/String;)I TU SVtimeSheetTableLjavax/swing/JTable; XY Zjavax/swing/JTable\repaint ^ ]_java/lang/ExceptionaBad time formatc b4Bad time format 'f' - use HH:MM:SSh Utilitiesj errMessage l3 kmeLjava/awt/event/ActionEvent;baseTimeLjava/lang/StringBuffer;sLjava/lang/String;value[Ljava/lang/String;newHour newMinute newSeconde1Ljava/lang/Exception; SourceFile JLipSync.java InnerClasses0   8 **+    KQYM* & ,(,W,Y* &257,;,W* > ,(,W,Y* >257,;,W* A ,(,W,* ADWF,;LN--M7Q:2W62W62W6UcNH<A;<4* &* >* A*[`*bYde:Yg5-,i,;n66b~?NUv)68EJP\ QQopIqrstuvww$nx$ey$8z{|}~ PK ى2!aJLipSync$18.class.V JLipSync$18java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$18;actionPerformed(Ljava/awt/event/ActionEvent;)V'Enter the audio track offset in frames:java/lang/Stringjava/lang/StringBufferJLipSync trackOffsetI ! "valueOf(I)Ljava/lang/String; $% &(Ljava/lang/String;)V ( )toString()Ljava/lang/String; +, - )javax/swing/JOptionPane0showInputDialogL(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String; 23 14java/lang/Integer6parseInt(Ljava/lang/String;)I 89 7:'<append,(Ljava/lang/String;)Ljava/lang/StringBuffer; >? @' is not an integerBBad Track OffsetDshowMessageDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)V FG 1Hjava/lang/ExceptionJeLjava/awt/event/ActionEvent;sLjava/lang/String;e1Ljava/lang/Exception;message SourceFile JLipSync.java InnerClasses0   8 **+    ]YY*#'*./5M,9*,;#+NYY=*,ACA./:EI&44KF"&459FKSVY\4]]LM";NO5'PQS ROSTU PK ى2[A JLipSync$19.class., JLipSync$19java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$19;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSyncrescaleTimeSheet(I)V   wavePanel LWavePanel;    WavePanel"repaint $ #%eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+ .   P**!&0 12'()*+ PK ى2\\JLipSync$2.class." JLipSync$2java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$2;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSyncfileOpen  eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    @*  ! PK ى2 wNJLipSync$20.class., JLipSync$20java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$20;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSyncrescaleTimeSheet(I)V   wavePanel LWavePanel;    WavePanel"repaint $ #%eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+ ;   P**!&= >?'()*+ PK ى2^JLipSync$21.class., JLipSync$21java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$21;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSyncrescaleTimeSheet(I)V   wavePanel LWavePanel;    WavePanel"repaint $ #%eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+ H   P**!&J KL'()*+ PK ى2&JLipSync$22.class.& JLipSync$22java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$22;actionPerformed(Ljava/awt/event/ActionEvent;)VAboutbuilt Monday, April 25, 2005%(Ljava/awt/Frame;Ljava/lang/String;)V  eLjava/awt/event/ActionEvent; aboutDialogLAbout; SourceFile JLipSync.java InnerClasses0   8 **+ k   V YMnon q     !"#$% PK ى2 D^^JLipSync$23.class." JLipSync$23java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$23;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSyncfileOpen  eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    @*  ! PK ى27A^^JLipSync$24.class." JLipSync$24java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$24;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSyncfileSave  eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    @*  ! PK ى2vbzeeJLipSync$25.class." JLipSync$25java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$25;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSynccopyToClipboard  eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    @*  ! PK ى2꾔JLipSync$26.class.- JLipSync$26java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$26;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync wavePanel LWavePanel;   WavePanel frameCountI ! " playFrames(II)V $% &eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    K**#' ()*+, PK ى2F)JLipSync$27.class.0 JLipSync$27java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$27;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync wavePanel LWavePanel;   WavePanel markerStartI ! " markerEnd $! % playFrames(II)V '( )eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    T**#*&* +,-./ PK ى2OF,5JLipSync$28.class.0 JLipSync$28java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$28;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync wavePanel LWavePanel;   WavePanel markerStartI ! " frameCount $! % playFrames(II)V '( )eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    T**#*&* +,-./ PK ى2.JLipSync$29.class.- JLipSync$29java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$29;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync wavePanel LWavePanel;   WavePanel markerEndI ! " playFrames(II)V $% &eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    K**#' ()*+, PK ى2)\\JLipSync$3.class." JLipSync$3java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$3;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSyncfileSave  eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    @*  ! PK ى2tJLipSync$30.class.) JLipSync$30java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$30;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync wavePanel LWavePanel;   WavePanelstopPlayingWaveZ ! "eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    D *#    $%&'( PK ى2VY~JLipSync$31.class.( JLipSync$31java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$31;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync wavePanel LWavePanel;   WavePanel zoomToFit !eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    C *"    #$%&' PK ى2G[JLipSync$32.class.( JLipSync$32java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$32;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync wavePanel LWavePanel;   WavePanelzoomAll !eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    C *"    #$%&' PK ى2lJLipSync$33.class.( JLipSync$33java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$33;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync wavePanel LWavePanel;   WavePanelzoomIn !eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+     C *"     #$%&' PK ى2OGJLipSync$34.class.( JLipSync$34java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$34;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync wavePanel LWavePanel;   WavePanelzoomOut !eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    C *"    #$%&' PK ى26JLipSync$35.class.: JLipSync$35java/lang/Object'javax/swing/event/ListSelectionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$35; valueChanged)(Ljavax/swing/event/ListSelectionEvent;)V$javax/swing/event/ListSelectionEvent getSource()Ljava/lang/Object;  javax/swing/JListgetSelectedValue  !java/lang/String#JLipSync% facePanel LFacePanel; '( &) FacePanel+setFace(Ljava/lang/String;)V -. ,/e&Ljavax/swing/event/ListSelectionEvent;listLjavax/swing/JList;sLjava/lang/String; SourceFile JLipSync.java InnerClasses0   8 **+ L   p+M,"$N**-0NORS*1234 56789 PK ى2~^ۓJLipSync$36.class.^ JLipSync$36java/awt/event/MouseAdapterthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V    LineNumberTableLocalVariableTablethis LJLipSync$36; mouseClicked(Ljava/awt/event/MouseEvent;)Vjava/awt/event/MouseEvent getClickCount()I  JLipSynctimeSheetTableLjavax/swing/JTable;   javax/swing/JTable"getSelectionModel"()Ljavax/swing/ListSelectionModel; $% #&javax/swing/ListSelectionModel(isSelectionEmpty()Z *+ ),getMinSelectionIndex . )/ getSource()Ljava/lang/Object; 12 3javax/swing/JList5getSelectedValue 72 68java/lang/String:<equals(Ljava/lang/Object;)Z >? ;@B timeSheet LTimeSheet; DE F TimeSheetHmouth[Ljava/lang/String; JK ILrepaint N #OeLjava/awt/event/MouseEvent;lsm Ljavax/swing/ListSelectionModel; selectedRowIlistLjavax/swing/JList;sLjava/lang/String; SourceFile JLipSync.java InnerClasses0  8 * *+ W   ]+W*!'M,-C,0>+46:9;:=AC:*GMS*!P. Z]`b#e,h6k@lDpRs\v>]]QRIST#9UV,0WX6&YZ[\] PK ى2dqqJLipSync$37.class.] JLipSync$37java/lang/Object'javax/swing/event/ListSelectionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$37; valueChanged)(Ljavax/swing/event/ListSelectionEvent;)V$javax/swing/event/ListSelectionEventgetValueIsAdjusting()Z   getSource()Ljava/lang/Object;   javax/swing/ListSelectionModel"isSelectionEmpty $ #%getMinSelectionIndex()I '( #)JLipSync+ wavePanel LWavePanel; -. ,/ WavePanel1 markerStartI 34 25 markerEnd 74 28repaint : 2; facePanel LFacePanel; => ,? timeSheet LTimeSheet; AB ,C TimeSheetEmouth[Ljava/lang/String; GH FI FacePanelKsetFace(Ljava/lang/String;)V MN LOensureFrameVisible(I)V QR 2Se&Ljavax/swing/event/ListSelectionEvent;lsm Ljavax/swing/ListSelectionModel; selectedRow SourceFile JLipSync.java InnerClasses0   8 **+    h++!#M,&Q,*>*0`6*0`9*0<*@*DJ2P*0`T.  -:DZg*hhUVXWX GY4Z[\ PK ى2 (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$38;keyTyped(Ljava/awt/event/KeyEvent;)VJLipSynctimeSheetTableLjavax/swing/JTable;  javax/swing/JTablegetSelectedColumn()I ! "getSelectedRow $! % getRowCount '! (java/awt/event/KeyEvent* getKeyChar()C ,- +. timeSheet LTimeSheet; 01 2 TimeSheet4key[Z 67 58repaint : ; wavePanel LWavePanel; => ? WavePanelA playFrames(II)V CD BEjava/lang/StringGjava/lang/StringBufferIvalueOf(C)Ljava/lang/String; KL HM(Ljava/lang/String;)V O JPtoString()Ljava/lang/String; RS JT HP toUpperCase WS HXHZequals(Ljava/lang/Object;)Z \] H^mouth[Ljava/lang/String; `a 5bCdCHfShSHjTlTHnXpClosedr facePanel LFacePanel; tu v FacePanelxsetFace zO y{eLjava/awt/event/KeyEvent;selectedColumnI selectedRowrowscsLjava/lang/String; currentValue keyPressed getKeyCode ! +comment a 5i keyReleased SourceFile JLipSync.java InnerClasses0   8 **+    3*#=*&>*)6+/6C x X-*39*393T*< *@``FzHYJYNQUVY:[_D*3c2:e_ g:3i_ k:"m_o:q_s:*3cHYVS*<*w|~ (.3Hhrsz&2R33}~ (( .d3 2p*&=*)>+6d6Z*3c*3cd2S*3*3d2S*39*39d3T*3cS*3S*39T*<6Z*3c*3c`2S*3*3`2S*39*39`3Td*3cdHYVS*3dHYVS*39dT*<b  $,Hd $&()*&(.?/V0e3o6Hpp}~ eZT)`b 5:}~ PK ى2nVJLipSync$39.class.: JLipSync$39java/awt/event/MouseAdapterthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V    LineNumberTableLocalVariableTablethis LJLipSync$39; mouseClicked(Ljava/awt/event/MouseEvent;)VJLipSynctimeSheetTableLjavax/swing/JTable;  javax/swing/JTablegetSelectedColumn()I   getSelectedRow " # timeSheet LTimeSheet; %& ' TimeSheet)key[Z +, *-repaint / 0eLjava/awt/event/MouseEvent;selectedColumnI selectedRow SourceFile JLipSync.java InnerClasses0  8 * *+ ?   G*!=*$>*(.*(.3T*1A DEIL<OFQ*GG23 <45+65789 PK ى2[˚}^^JLipSync$4.class." JLipSync$4java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$4;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync fileSaveAs  eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    @*  ! PK ى2oUffJLipSync$5.class.# JLipSync$5java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$5;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync exportFile(I)V  eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    A *    !" PK ى2*ffJLipSync$6.class.# JLipSync$6java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$6;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync exportFile(I)V  eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+     A *    !" PK ى2^QffJLipSync$7.class.# JLipSync$7java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$7;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync exportFile(I)V  eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+    A *    !" PK ى29ְccJLipSync$8.class." JLipSync$8java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$8;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSynccopyToClipboard  eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+     @* "# ! PK ى2׹T``JLipSync$9.class." JLipSync$9java/lang/Objectjava/awt/event/ActionListenerthis$0 LJLipSync; Synthetic (LJLipSync;)VCode()V   LineNumberTableLocalVariableTablethis LJLipSync$9;actionPerformed(Ljava/awt/event/ActionEvent;)VJLipSync writeAviFile  eLjava/awt/event/ActionEvent; SourceFile JLipSync.java InnerClasses0   8 **+ ,   @* ./ ! PK ى2.9 JLipSync$CreateAviFile.class.JLipSync$CreateAviFilejava/lang/ThreadfileNameLjava/lang/String;this$0 LJLipSync; Synthetic(LJLipSync;Ljava/lang/String;)VCode()V     LineNumberTableLocalVariableTablethisLJLipSync$CreateAviFile; theFileNamerunJLipSync facePanel LFacePanel;    FacePanel"getFace+(Ljava/lang/String;)Ljavax/swing/ImageIcon; $% #&javax/swing/ImageIcon(getImage()Ljava/awt/Image; *+ ),toBufferedImage0(Ljava/awt/Image;)Ljava/awt/image/BufferedImage; ./ 0 wavePanel LWavePanel; 23 4 WavePanel6 frameCountI 89 7:framesPerSecond <9 7= AviWriter? 7+(Ljava/lang/String;Ljava/lang/String;IIII)V B @C statusBarLjavax/swing/JLabel; EF Gjava/lang/StringBufferIFrame #K(Ljava/lang/String;)V M JNappend(I)Ljava/lang/StringBuffer; PQ JRtoString()Ljava/lang/String; TU JVjavax/swing/JLabelXsetText ZM Y[ timeSheet LTimeSheet; ]^ _ TimeSheetamouth[Ljava/lang/String; cd bejava/lang/Stringgequals(Ljava/lang/Object;)Z ij hkmjava/awt/image/BufferedImageogetRGB(II)I qr pssetPixel(IIIII)V uv @w getIconHeight()I yz ){ getIconWidth }z )~addFrame @Writing the AVI file...close @Created AVI fileError creating .AVI file: ,(Ljava/lang/Object;)Ljava/lang/StringBuffer; P J Utilities errMessage M java/lang/Exception theWriter LAviWriter; priorFaceiconLjavax/swing/ImageIcon; bufferedImageLjava/awt/image/BufferedImage;framesfpsheightwidthiuseFacenextIconxyrgbrgbe1Ljava/lang/Exception; SourceFile JLipSync.java InnerClasses CreateAviFile    K**+*,f hi  WM*!,'N--1:*5;6*5>6t6~6@Y**5ADL6 *HJYLO `SW\*`f 2:  ,l nl{*! ':  h -1:6 O6 =  t6z~6z~6~6+  x  -|  -+  >*H\+*H\: JYO W8@@"qrux$y0z4{8LRV\y!-1@BVWVTH?$390'94#989Y9  j X9 F9 ,9!999B  PK ى2G=JLipSync$PlayFaces.class.dJLipSync$PlayFacesjava/lang/Thread startIndexIendIndexthis$0 LJLipSync; Synthetic(LJLipSync;II)VCode()V        LineNumberTableLocalVariableTablethisLJLipSync$PlayFaces; startAtIndex endAtIndexrunjava/lang/SystemcurrentTimeMillis()J ! "sleep(J)V $% &@@JLipSync* wavePanel LWavePanel; ,- +. WavePanel0 playingWaveZ 23 14framesPerSecond 6 17 trackOffset 9 +: frameCount < 1= timeSheet LTimeSheet; ?@ +A TimeSheetCmouth[Ljava/lang/String; EF DG facePanel LFacePanel; IJ +K FacePanelMsetFace(Ljava/lang/String;)V OP NQ java/lang/ExceptionU startWaitD startTime sleepTime nextFramei frameIndexuseMouthLjava/lang/String; SourceFile JLipSync.java InnerClasses PlayFaces     ^**+**    θ#H '#'g(*/5#J*/8l9)9*;*Y*;d*6 ^*; `d6  G */>8*BH 2: *L Rc9 S'#  *LV^ ).?BL\esRWX.YX?ZXB[Xbj\ sJ] &^_ `ab +cPK ى2x kuhuhJLipSync.class.JLipSyncjavax/swing/JFramejava/awt/event/ActionListenerjava/awt/event/ItemListener'javax/swing/event/ListSelectionListener JLIPSYNC_VERSIONLjava/lang/String; ConstantValuebuilt Monday, April 25, 2005 FORMAT_MAGPIEI FORMAT_MOHOFORMAT_GAMESTUDIO phonemeListLjavax/swing/JList;fileOpenButtonLjavax/swing/JButton;fileSaveButton copyButtonzoomToFitButton zoomAllButton zoomInButton zoomOutButton playAllButtonplaySelectionButtonplayFromButton playToButtonfps24"Ljavax/swing/JRadioButtonMenuItem;fps25fps30 wavePanel LWavePanel; facePanel LFacePanel; timeSheet LTimeSheet;timeSheetTableLjavax/swing/JTable;openFileLjava/io/File; trackOffset statusBarLjavax/swing/JLabel;class$0Ljava/lang/Class; Synthetic()VCode(Ljava/lang/String;)V 9= > -. @ /0 B 12 D 3 FsetDefaultCloseOperation(I)V HI J createMenuBar()Ljavax/swing/JMenuBar; LM N setJMenuBar(Ljavax/swing/JMenuBar;)V PQ RcreateContentPanel()Ljava/awt/Container; TU VsetContentPane(Ljava/awt/Container;)V XY ZsetSize(II)V \] ^ setVisible(Z)V `a bLineNumberTableLocalVariableTablethis LJLipSync; playFrames )* i WavePanelk bytesPerFrame m ln frameCount p lq byteCount s lt playingWaveZ vw lx h] lzJLipSync$PlayFaces|(LJLipSync;II)V 9~ }start : }Error playing the wave file Utilities errMessage = java/lang/Exception startFrameendFrame startByteendByteeLjava/lang/Exception;eraseTimeSheetframesPerSecond  l TimeSheetinit ] rescaleTimeSheetjava/lang/Stringmouth[Ljava/lang/String; comment key[Z calculateMetrics : l : javax/swing/JTablerepaint : newFramesPerSecond oldFrameCount priorMouth priorCommentpriorKeyideltaFtargetloadWave(Ljava/io/File;)V lfile loadTimeSheetSimpleXmlReader 9 getTag&(Ljava/lang/String;)Ljava/lang/String;  substring(II)Ljava/lang/String;  version getString wavefilefpsgetFloat(Ljava/lang/String;)F %&  javax/swing/JRadioButtonMenuItem setSelected a '&  (&  java/io/File >java/lang/StringBufferCan't find file  >append,(Ljava/lang/String;)Ljava/lang/StringBuffer; toString()Ljava/lang/String;    framecount getCurrentTag    track getInt(Ljava/lang/String;)I  hour hourOffset  minute minuteOffset  second secondOffset    "getColumnModel&()Ljavax/swing/table/TableColumnModel; $% &"javax/swing/table/TableColumnModel( getColumn"(I)Ljavax/swing/table/TableColumn; *+ ),javax/swing/table/TableColumn.setWidth 0I /135getOptionalString 8 9true<? A CError reading file: E,(Ljava/lang/Object;)Ljava/lang/StringBuffer; G H lxmlLSimpleXmlReader; theHeader waveFileNamewaveFilee2widths[IcolumnLjavax/swing/table/TableColumn;writeXMLjava/io/FileWriterV WError writing file Y, [write ]= W^ ` 1.1 b dfileName f lg i k(I)Ljava/lang/StringBuffer; m n p r t v x z | ~       length()I  true    close : WError writing file:streamLjava/io/FileWriter;cancelledAutoSave()ZSave Current File First? Save File?javax/swing/JOptionPaneshowConfirmDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)I  getPath  .jlsaddFileExtention8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;   U resultfileOpen  defaultDirectory getPreference   fileChooser*(Ljava/io/File;)Ljavax/swing/JFileChooser;   WavFilter 9: javax/swing/JFileChooseraddChoosableFileFilter'(Ljavax/swing/filechooser/FileFilter;)V   JlsFilter showOpenDialog1(Ljava/awt/Component;Ljavax/swing/JFileChooser;)I  getSelectedFile()Ljava/io/File;  getName   toLowerCase  endsWith(Ljava/lang/String;)Z   dirNamefcLjavax/swing/JFileChooser; returnValvalueOf&(Ljava/lang/Object;)Ljava/lang/String;   extention lowerFileNamefileSave fileSaveAs : showSaveDialog   padString'(Ljava/lang/String;I)Ljava/lang/String;.  >spadSizepadded magpieFormat0Frame Timecode Key Mouth name Comments     calcTimeCode(I)Ljava/lang/String;    X     Ljava/lang/StringBuffer;theHour theMinute theSecondtheTicktheFrame mohoFormat MohoSwitch1   ! mouthShapegameStudioFormat 1 &0 (none, *, ,tick exportFile.txt0   3  5 $ 7fileTypecontentscopyToClipboardjava/awt/Toolkit<getDefaultToolkit()Ljava/awt/Toolkit; >? =@getSystemClipboard#()Ljava/awt/datatransfer/Clipboard; BC =D%java/awt/datatransfer/StringSelectionF G>java/awt/datatransfer/ClipboardI setContentsM(Ljava/awt/datatransfer/Transferable;Ljava/awt/datatransfer/ClipboardOwner;)V KL JM clipboard!Ljava/awt/datatransfer/Clipboard;'Ljava/awt/datatransfer/StringSelection;hasAlpha(Ljava/awt/Image;)Zjava/awt/image/BufferedImageT getColorModel()Ljava/awt/image/ColorModel; VW UXjava/awt/image/ColorModelZ R [\java/awt/image/PixelGrabber^(Ljava/awt/Image;IIIIZ)V 9` _a grabPixels c _d _Xjava/lang/InterruptedExceptiongimageLjava/awt/Image;bimageLjava/awt/image/BufferedImage;pgLjava/awt/image/PixelGrabber;cmLjava/awt/image/ColorModel;toBufferedImage0(Ljava/awt/Image;)Ljava/awt/image/BufferedImage;javax/swing/ImageIcons(Ljava/awt/Image;)V 9u tvgetImage()Ljava/awt/Image; xy tz RS |java/awt/GraphicsEnvironment~getLocalGraphicsEnvironment ()Ljava/awt/GraphicsEnvironment;  getDefaultScreenDevice()Ljava/awt/GraphicsDevice;  java/awt/GraphicsDevicegetDefaultConfiguration"()Ljava/awt/GraphicsConfiguration;  java/awt/ImagegetWidth!(Ljava/awt/image/ImageObserver;)I   getHeight  java/awt/GraphicsConfigurationcreateCompatibleImage#(III)Ljava/awt/image/BufferedImage;  (III)V 9 UcreateGraphics()Ljava/awt/Graphics2D;  Ujava/awt/Graphics drawImage3(Ljava/awt/Image;IILjava/awt/image/ImageObserver;)Z  dispose : java/awt/HeadlessExceptiongeLjava/awt/GraphicsEnvironment; transparencygsLjava/awt/GraphicsDevice;gc Ljava/awt/GraphicsConfiguration;typegLjava/awt/Graphics; writeAviFile"Audio file must be selected first. AviFilter .aviJLipSync$CreateAviFile(LJLipSync;Ljava/lang/String;)V 9  javax/swing/JMenuBar javax/swing/JMenuFile > setMnemonic I getAccessibleContext)()Ljavax/accessibility/AccessibleContext;  Open and Save options%javax/accessibility/AccessibleContextsetAccessibleDescription = add((Ljavax/swing/JMenu;)Ljavax/swing/JMenu;  javax/swing/JMenuItemNew...(Ljava/lang/String;I)V 9 javax/swing/KeyStroke getKeyStroke(II)Ljavax/swing/KeyStroke;  setAccelerator(Ljavax/swing/KeyStroke;)V   Create a new timesheet0(Ljavax/swing/JMenuItem;)Ljavax/swing/JMenuItem;   JLipSync$1 (LJLipSync;)V 9 addActionListener"(Ljava/awt/event/ActionListener;)V  Open...Load a file from disk JLipSync$2 SaveSave the current file to disk  JLipSync$3   Save As... Save to disk with a new filename JLipSync$4  addSeparator : Export To File Magpie... JLipSync$5 Moho...  JLipSync$6" #3D GameStudio...% JLipSync$7' (Copy Timesheet To Clipboard*(Copy the exposure sheet to the clipboard, JLipSync$8. /Create AVI File...1#Create an AVI file of the animation3 JLipSync$95 6Exit8 JLipSync$10: ;Waveform=Waveform options?Play the waveformAPlay the entire waveformC JLipSync$11E FPlay the selectionH)Play the selected portion of the waveformJ JLipSync$12L MPlay from selectionO@Play the waveform starting from the current selection to the endQ JLipSync$13S TPlay to selectionVHPlay the waveform from the beginning to the end of the current selectionX JLipSync$14Z [Zoom to selection](Display the selected portion of the wave_ JLipSync$15a b Zoom backdDisplay the entire wavef JLipSync$16h iOptionsk"Configuration options and settingsmBase timecode...o&Set the starting time of the soundclipq JLipSync$17s tAudio/Video sync...vSet the audio/video syncx JLipSync$18z {javax/swing/ButtonGroup} ~ Film (24 fps) >  -Use 24 frames per second (standard film rate)(Ljavax/swing/AbstractButton;)V  ~ JLipSync$19   PAL (25 fps)2Use 25 frames per second (standard PAL video rate) JLipSync$20  NTSC (30 fps)3Use 30 frames per second (standard NTSC video rate) JLipSync$21 Help Help optionsAbout JLipSync...About this program JLipSync$22 menuBarLjavax/swing/JMenuBar;menuLjavax/swing/JMenu;subMenumenuItemLjavax/swing/JMenuItem; subMenuItemgroupLjavax/swing/ButtonGroup;actionPerformed(Ljava/awt/event/ActionEvent;)Vjava/awt/event/ActionEvent getSource()Ljava/lang/Object;  javax/swing/JListgetSelectedValue  Ljava/awt/event/ActionEvent;source valueChanged)(Ljavax/swing/event/ListSelectionEvent;)V$javax/swing/event/ListSelectionEvent  +,  FacePanelsetFace = &Ljavax/swing/event/ListSelectionEvent;listitemStateChanged(Ljava/awt/event/ItemEvent;)VLjava/awt/event/ItemEvent; getClassNamejava/lang/ObjectgetClass()Ljava/lang/Class;  java/lang/Class . lastIndexOf    oLjava/lang/Object; classStringdotIndexjavax/swing/JPaneljava/awt/BorderLayout (Ljava/awt/LayoutManager;)V 9 java/awt/Dimension 9] setPreferredSize(Ljava/awt/Dimension;)V   setOpaque a javax/swing/JToolBar  North<(Ljava/lang/String;Ljava/awt/Component;)Ljava/awt/Component;  javax/swing/JButtonimages/open.gifcreateImageIcon+(Ljava/lang/String;)Ljavax/swing/ImageIcon;  (Ljavax/swing/Icon;)V 9  setToolTipText  = *(Ljava/awt/Component;)Ljava/awt/Component;   JLipSync$23  images/save.gifSave the current file disk JLipSync$24 images/copy.gif JLipSync$25 ! images/play.gif$ JLipSync$26& 'images/play_selection.gif) JLipSync$27+ ,images/play_from.gif. JLipSync$280 1images/play_to.gif3 JLipSync$295 6images/stop.gif8Stop the playback: JLipSync$30< =images/zoom_fit.gif? JLipSync$31A Bimages/zoom_1.gifD JLipSync$32F Gimages/zoom_in.gifIZoom in on the waveK JLipSync$33M Nimages/zoom_out.gifPZoom out on the waveR JLipSync$34T UW([Ljava/lang/Object;)V 9Y ZJLipSync$1$MyCellRenderer\ ]setCellRenderer!(Ljavax/swing/ListCellRenderer;)V _` asetVisibleRowCount cI djavax/swing/JScrollPanef gsetViewportView(Ljava/awt/Component;)V ij gk gWestn JLipSync$35p qaddListSelectionListener,(Ljavax/swing/event/ListSelectionListener;)V st u JLipSync$36w xaddMouseListener!(Ljava/awt/event/MouseListener;)V z{ |Center~default >East l lphonemes[Ljava/lang/Object;   setListData Y  TimeSheetTableModel(LTimeSheet;)V 9 !(Ljavax/swing/table/TableModel;)V 9 "setPreferredScrollableViewportSize  setSelectionMode I  revalidate :  9j g lB lgetSelectionModel"()Ljavax/swing/ListSelectionModel;   JLipSync$37 javax/swing/ListSelectionModel u JLipSync$38 addKeyListener(Ljava/awt/event/KeyListener;)V   JLipSync$39  |javax/swing/JLabelWelcome to JLipSync! > 45  java/awt/FlowLayout  setLayout   javax/swing/BorderFactorycreateEtchedBorder()Ljavax/swing/border/Border;   setBorder(Ljavax/swing/border/Border;)V  Southbutton contentPanelLjavax/swing/JPanel;toolbarLjavax/swing/JToolBar; phonemeNamesphonemeScrollPaneLjavax/swing/JScrollPane;midPanelwaveAndFacePaneltimeSheetTableModelLTimeSheetTableModel; scrollPanerowSM Ljavax/swing/ListSelectionModel; statusPanel 67 forName%(Ljava/lang/String;)Ljava/lang/Class;  java/lang/NoClassDefFoundErrorjava/lang/Throwable getMessage   > getResource"(Ljava/lang/String;)Ljava/net/URL;  (Ljava/net/URL;)V 9 tCouldn't find file: ErrorshowMessageDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)V   java/lang/ClassNotFoundExceptionpathimgURLLjava/net/URL;messagemain([Ljava/lang/String;)Vjavax/swing/UIManager getSystemLookAndFeelClassName     setLookAndFeel =    argsapp SourceFile JLipSync.java InnerClasses PlayFaces CreateAviFileMyCellRenderer!       !"#$%&'&(&)*+,-./0123456789:;?*<?*A*C*E*G*K**OS**W[*¶_*cd. l\ _benq't/w9x>ye ?fgh];g*jodh>*joh6< *jr=*ju *ju6*jy*j{}Y* :>__d: !)5>FO_afe>gfggg [Pa:;M*A*jr*j*Gde fgI; *jr=N::62-*A2S*A2S*A3T*j*j**jrn86Rj6*jr*jrd6*A-2S*A2S*A3T*Cd^ ,;JS[bfsy  ef fg 8scvXC;I *j+*d e fg 2; eY+N-ȶ:Ҷ֚ Yطٿ-۶W-ݶ:-:*j-苵*A*j*j*.*j**j *Y::YYٿ **j-苵r-  ֙K- W*-G*A-*A-*A-!-#W *G*A*A*A!*A*jr*j Y OYOYOY(OYdO:6 *C' -:   .2  -4W6 O-6W*A -7:S*A -;:=T*A ->:S-@W  *jr-BW-DW.NYF-I*jr*j**jJ*C++d8" %&!'++2.:1B4P5^6j7u89:;BCEHIMPQRSTU-V8Y=ZE[M\U`jcdefdklnqtwz l} +,@IRV]deefge2 "KLM : BN O2bO2PQR&  ST [ ,*U;WY+XMNYZ-I,\_,a_,c_,Ye*jhj_,Yl*joq_,Ys*jrou_,w_,Yy*Go{_,Y}*Ao_,Y*Ao_,Y*A!o_,_,_>,_*A2&,Y*A2_*A3 ,_*A2&,Y*A2_,_*jrp,_,D_,NY-I*+E "d)  !")07Xyz")05<KnzeHfg2 " 2;B*E<*EM*,M*Y,d:  !#+4@e Bfg-+f :;k*øLM,Yζ,Y׶*,>9*,ߵE*E::**E **Ed>*04 < E LWbje4kfg\ W0;E%f ;v"+N-,Y+,+d   e*"fg"f "  :;t,*E * *EL*+L*Y+d$&)*-+/e,fgf :;A*EL+Y׶*+=&+N-:*:*Yd& 23457":(;3>@@e4Afg9("2(f  ;s%YY*M,dаdCCDCEe % %  ;ŻYL=>666+ W`6d + W + W+oW+ W+*A`W*A3+W +W+*A2W+*A2W+W*jr^+dfJKJ M NOPRU#X)Y0Z8[?\G]N^Vafdse~gknoRseRfg  );YY L=<*A2N-(+Y`" -W*jr+dw yz{!|FyTe*Yfg N G,# $;=Y%L+Y*jr" *joW*A=*A>*A!666ք*j!6;6;>+Y`" W+Y" o o W*A3+'W +)W*A2:++W+Y-W*jr$+dr7?GPSY\hknux{)8eR=fg5?GPS.V- /I; M*,>,::*1:WYX::YZIY2:1"+*4:*6: *8:_:YI'55Vd^ '57LMVpvyep fg9 2f 2Mb7VY: ;:;nAEYLLGY*4HM+,Nd e fgOP:Q RS;5*U*UL+Y]_Y*bL+eWM+fM,]"**hd" "*+ 0 e*5ij kl"mn0op qr;t*U*UtY*w{K*}<MN66-::**M:,!66UY**M,:*W,#OOdn  ""!#%&&*'-+3,:-A.H-O0Q4U6X7\8_:h;o:s?yBCEe\ ijmRwkkl#g&)3:Xy:;[*j*jhȶ֙ L+Y*+=&+N-:*:Y*ŶƱd2 LMNR"S-T3U7X<[B\M]Z_e4[fg"93(<2Bf LM; -YLYͷM,F,׶+,WYO:N,WY*YO:O,WY*Y S:S ,W Y*YA:*,WY*,YN,-WYM:-WY*Y!H:-W#Y*$Y&3:-W(Y*)Y+C:C-,W/Y*0Y2C:4*,W6Y*7,Y9X:-*,W;Y*<Y>M,W,@+,WYBP:PD,WFY*GYIL:K,WMY*NYPF:FR,WTY*UYWT:TY,W[Y*\,Y^Z:`,WbY*cYeB:g,WiY*jYlM,O,n+,WYpB:r,WtY*uYwS:y,W{Y*|,~Y:*Y**F**,*W*Y**Y*F**,*W*Y**Y*F**,*W*Y*YM,H,*+,WYA:,WY*+d  #)79;=CHKNUbprtv| *1> L S `nu '()(*+,36787 9:;$G/H5I9J?KENSOUOWPXO^QcRfQiSpT}[\]\^_fgghgijlkmnuvvwvxy{z| },147>KY^adkx   #&'()*&+)*,,5->.M5[6d7k8n7q9z:;BCDEDFGHPQRSTg hihjk+seH-fg%7*-;t++N-Mdz {|e*fg  ;m+M,N*-˱de*fg  ;5defg;h+׶M,ܶ>,`de*fg TU;G YYM,Yȷ,YN-Y,-WY  L+-+W+Y*Y  L+-+W+Y*Y  L+--+W+!Y*"-#Y%  L+D-+W+'Y*(Y*  L+K-+W+,Y*-Y/  L+R-+W+1Y*2Y4  L+Y-+W+6Y*7Y9  L+;-+W+=Y*>-#Y@  L+`-+W+BY*CYE  L+g-+W+GY*HYJ  L+L-+W+NY*OYQ  L+S-+W+UY*VYXS:Y[:]Y*^begYh:lYdȷm,oWqY*rvxY*y}YY:,WYY:W*Y*ƶW*lYj*jY*jW*ƴ*Y*jr*jAY*A: *Y C*CYȷ*C*CgY*C: *j*C*j*Ƶ*C:  Y**CY**CY* W*YY:  Yö *W*Ͷ,*W,dd %-=FT[am{ "(4BCIO[ijpv  "A.C9DFEMFVG]HnIxLWz{~3@Maip}?TWXYZ[ \^e fgT -.9Vw]@ } } . ;VYW<YZ_*L+ tY+YY*M, d"c%d)e2gKhPiQhTje V %1K   ;c LYL+ dr s wxzegR*} #(/6;FMT[bit{!',16=BGNU]qxPK ى2?R JLipSync.java// JLipSync.java // clone of Magpie lipsync program // (c) 2004 David Cuny // http://jlipsync.sourceforge.net // Released under Qt Public License import java.awt.BorderLayout; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Graphics; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import java.awt.HeadlessException; import java.awt.Image; import java.awt.Toolkit; import java.awt.Transparency; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.image.BufferedImage; import java.awt.image.ColorModel; import java.awt.image.PixelGrabber; import java.io.File; import java.io.FileWriter; import javax.swing.BorderFactory; import javax.swing.ButtonGroup; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JCheckBoxMenuItem; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JRadioButtonMenuItem; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JToolBar; import javax.swing.KeyStroke; import javax.swing.ListCellRenderer; import javax.swing.ListSelectionModel; import javax.swing.UIManager; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.TableColumn; public class JLipSync extends JFrame implements ActionListener, ItemListener, ListSelectionListener { final static String JLIPSYNC_VERSION = "built Monday, April 25, 2005"; // file export formats final static int FORMAT_MAGPIE = 0; final static int FORMAT_MOHO = 1; final static int FORMAT_GAMESTUDIO = 2; // list of phonemes JList phonemeList; // buttons JButton fileOpenButton, fileSaveButton, copyButton, zoomToFitButton, zoomAllButton, zoomInButton, zoomOutButton, playAllButton, playSelectionButton, playFromButton, playToButton; // frames per second JRadioButtonMenuItem fps24, fps25, fps30; // panel for drawing the wave on WavePanel wavePanel; // panel for displaying the faces FacePanel facePanel; // timesheet holding timing data TimeSheet timeSheet = null; // timesheet table for displaying timesheet JTable timeSheetTable = null; // currently open file File openFile = null; // track offset int trackOffset = 0; JLabel statusBar; public JLipSync() { // set the name super("JLipSync"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // create the menu bar setJMenuBar(createMenuBar()); // create the window content setContentPane(createContentPanel()); //Display the window. setSize(450, 450); setVisible(true); } // play the wave and faces in sync public void playFrames(int startFrame, int endFrame) { // calculate start and end bytes int startByte = wavePanel.bytesPerFrame * (startFrame - 1); int endByte = wavePanel.bytesPerFrame * endFrame; // no start frame if (startFrame == 0) { startFrame = 1; } // no end frame if (endFrame == 0) { endFrame = wavePanel.frameCount; } // range check if (endByte > wavePanel.byteCount) { endByte = wavePanel.byteCount; } // play the thread on a background thread try { // set semaphor wavePanel.playingWave = false; // this runs a thread for the wave wavePanel.playFrames(startFrame, endFrame); // create a thread for the animation new PlayFaces(startFrame, endFrame).start(); } catch (Exception e) { Utilities.errMessage("Error playing the wave file"); } } // play the sound on a background thread class PlayFaces extends Thread { int startIndex, endIndex; public PlayFaces(int startAtIndex, int endAtIndex) { startIndex = startAtIndex; endIndex = endAtIndex; } public void run() { try { // wait for wave to start playing double startWait = System.currentTimeMillis(); while (!wavePanel.playingWave) { // give the multitasker a chance to run something else sleep(1); // timed out? if (System.currentTimeMillis() - startWait > 8000) { break; } } // calculate wait time between frames double startTime = System.currentTimeMillis(); double sleepTime = 1000 / wavePanel.framesPerSecond; // time next frame is to appear double nextFrame = startTime; // extend play time for negative track offsets if (trackOffset < 0) { endIndex -= trackOffset; } // display the frames for (int i = startIndex; i <= endIndex; i++) { int frameIndex = trackOffset + i - 1; // in range? if (frameIndex > -1 && frameIndex < wavePanel.frameCount) { // get the mouth String useMouth = timeSheet.mouth[frameIndex]; // set the mouth facePanel.setFace(useMouth); // wait for next frame nextFrame += sleepTime; while (System.currentTimeMillis() <= nextFrame) { // sleep a bit sleep(10); } } } } catch (Exception e) { // oops. } } } // erase the timesheet public void eraseTimeSheet() { // clear the time sheet timeSheet.init(wavePanel.frameCount, wavePanel.framesPerSecond); // clear the track offset trackOffset = 0; } // set the timesheet to a new framerate public void rescaleTimeSheet(int newFramesPerSecond) { // save the old values int oldFrameCount = wavePanel.frameCount; // create a copy of the timesheet. String priorMouth[] = new String[oldFrameCount]; String priorComment[] = new String[oldFrameCount]; boolean priorKey[] = new boolean[oldFrameCount]; for (int i = 0; i < oldFrameCount; i++) { priorMouth[i] = timeSheet.mouth[i]; priorComment[i] = timeSheet.comment[i]; priorKey[i] = timeSheet.key[i]; } // set the new values wavePanel.framesPerSecond = newFramesPerSecond; wavePanel.calculateMetrics(); eraseTimeSheet(); // map between the two float delta = (float) wavePanel.frameCount / (float) oldFrameCount; // walk through the old timesheet for (int i = 0; i < oldFrameCount; i++) { // determine target int target = (int) (i * delta); if (target > wavePanel.frameCount) { target = wavePanel.frameCount - 1; } // copy the mouth shape, comment and keyframe flag timeSheet.mouth[target] = priorMouth[i]; timeSheet.comment[target] = priorComment[i]; timeSheet.key[target] = priorKey[i]; } // repaint the table timeSheetTable.repaint(); } // load a wave file public void loadWave(File file) { wavePanel.loadWave(file); eraseTimeSheet(); } // load a timesheet (along with the wave) void loadTimeSheet(File file) { String tag; try { SimpleXmlReader xml = new SimpleXmlReader(file); // xml header String theHeader = xml.getTag(""); if (!theHeader.substring(0, 6).equals(""); // version number String version = xml.getString("version"); // get the wave file name String waveFileName = xml.getString("wavefile"); // get fps wavePanel.framesPerSecond = (int) xml.getFloat("fps"); timeSheet.framesPerSecond = wavePanel.framesPerSecond; if (wavePanel.framesPerSecond == 24) { fps24.setSelected(true); } else if (wavePanel.framesPerSecond == 25) { fps25.setSelected(true); } else if (wavePanel.framesPerSecond == 30) { fps30.setSelected(true); } // try loading the wave file File waveFile; try { // open the file waveFile = new File(waveFileName); } catch (Exception e2) { // failed throw new Exception("Can't find file " + waveFileName); } if (waveFile != null) { loadWave(waveFile); } // get framecount wavePanel.frameCount = (int) xml.getFloat("framecount"); // offsets (new to 1.1) if (xml.getCurrentTag().equals("")) { xml.getTag(""); trackOffset = xml.getInt("track"); timeSheet.hourOffset = xml.getInt("hour"); timeSheet.minuteOffset = xml.getInt("minute"); timeSheet.secondOffset = xml.getInt("second"); xml.getTag(""); } else { // set to zero trackOffset = 0; timeSheet.hourOffset = 0; timeSheet.minuteOffset = 0; timeSheet.secondOffset = 0; } // create a new timesheet timeSheet.init(wavePanel.frameCount, wavePanel.framesPerSecond); // set the column widths int widths[] = { 10, 220, 20, 40, 100 }; for (int i = 0; i < 1; i++) { TableColumn column = timeSheetTable.getColumnModel().getColumn(i); column.setWidth(widths[i]); } // read the frames xml.getTag(""); for (int i = 0; i < wavePanel.frameCount; i++) { // start of frame xml.getTag(""); // mouth is optional timeSheet.mouth[i] = xml.getOptionalString("mouth"); // key is optional timeSheet.key[i] = xml.getOptionalString("key").equals("true"); // comment is optional timeSheet.comment[i] = xml.getOptionalString("comment"); // required end tag xml.getTag(""); } xml.getTag(""); xml.getTag(""); } catch (Exception e) { // display an error Utilities.errMessage("Error reading file: " + e); // clear the timesheet wavePanel.frameCount = 20; wavePanel.framesPerSecond = 24; eraseTimeSheet(); } // update the display wavePanel.repaint(); timeSheetTable.repaint(); } // write the file to disk void writeXML(File file) { FileWriter stream; try { stream = new FileWriter(file); } catch (Exception e) { Utilities.errMessage("Error writing file " + e); return; } // write the file try { // xml header stream.write("\n"); // header stream.write("\n"); stream.write("\t1.1\n"); stream.write("\t" + wavePanel.fileName + "\n"); stream.write("\t" + wavePanel.framesPerSecond + "\n"); stream.write("\t" + wavePanel.frameCount + "\n"); // offsets (new to 1.1) stream.write("\t\n"); stream.write("\t\t" + trackOffset + "\n"); stream.write("\t\t" + timeSheet.hourOffset + "\n"); stream.write("\t\t" + timeSheet.minuteOffset + "\n"); stream.write("\t\t" + timeSheet.secondOffset + "\n"); stream.write("\t\n"); // the frames stream.write("\t\n"); for (int i = 0; i < wavePanel.frameCount; i++) { // frame number stream.write("\t\t"); // optional mouth if (timeSheet.mouth[i].length() > 0) { stream.write("" + timeSheet.mouth[i] + ""); } // optional key if (timeSheet.key[i]) { stream.write("true"); } // optional comment if (timeSheet.comment[i].length() > 0) { stream.write("" + timeSheet.comment[i] + ""); } stream.write("\n"); } stream.write("\t\n"); stream.write(""); stream.close(); } catch (Exception e) { Utilities.errMessage("Error writing file:" + e); return; } // make this the current file openFile = file; } // if returns false, user cancelled autosave action public boolean cancelledAutoSave() { // no work to save? if (openFile == null) { return false; } // ask user if they want to save their current work int result = JOptionPane.showConfirmDialog(null, "Save Current File First?", "Save File?", JOptionPane.YES_NO_CANCEL_OPTION); if (result == JOptionPane.CANCEL_OPTION) { // cancelled return true; } else if (result == JOptionPane.NO_OPTION) { // didn't save, but didn't cancel return false; } // make sure it ends with the proper extention String fileName = openFile.getPath(); fileName = addFileExtention(fileName, ".jls"); // write the timesheet out writeXML(new File(fileName)); return false; } // Menu actions public void fileOpen() { // autosave? if (cancelledAutoSave()) { return; } // look for default directory String dirName = Utilities.getPreference("defaultDirectory"); // open file dialog JFileChooser fc = Utilities.fileChooser(null); fc.addChoosableFileFilter(new WavFilter()); fc.addChoosableFileFilter(new JlsFilter()); int returnVal = Utilities.showOpenDialog(this, fc); if (returnVal == JFileChooser.APPROVE_OPTION) { // get the file name openFile = fc.getSelectedFile(); String fileName = openFile.getName(); // end with ".jls" ? fileName = fileName.toLowerCase(); if (fileName.endsWith(".jls")) { // pass the file and the path to load the timesheet loadTimeSheet(openFile); } else { // assume a wave file of some sort loadWave(openFile); } } } // ensure file name ends with given extention public String addFileExtention(String fileName, String extention) { String lowerFileName = fileName.toLowerCase(); if (!(lowerFileName.endsWith(extention))) { return fileName + extention; } return fileName; } public void fileSave() { if (this.openFile == null) { // use save as instead fileSaveAs(); } else { // make sure it ends with the proper extention String fileName = openFile.getPath(); fileName = addFileExtention(fileName, ".jls"); // write the timesheet out writeXML(new File(fileName)); } } public void fileSaveAs() { JFileChooser fc = Utilities.fileChooser(openFile); fc.addChoosableFileFilter(new JlsFilter()); int returnVal = Utilities.showSaveDialog(this, fc); if (returnVal == JFileChooser.APPROVE_OPTION) { // get the selected file File file = fc.getSelectedFile(); // make sure it ends with the proper extention String fileName = file.getPath(); fileName = addFileExtention(fileName, ".jls"); // write the timesheet out writeXML(new File(fileName)); } } public static String padString(String s, int padSize) { String padded = new String(s + " "); return padded.substring(0, padSize - 1); } public String magpieFormat() { StringBuffer s = new StringBuffer( "Frame Timecode Key Mouth name Comments\n"); int theHour = 0; int theMinute = 0; int theSecond = 0; int theTick = 0; for (int i = 0; i < wavePanel.frameCount; i++) { // leading spaces s.append(" "); // the frame number int theFrame = i + 1; if (theFrame < 100) s.append(" "); if (theFrame < 10) s.append(" "); s.append(theFrame); s.append(" "); // caculate timecode s.append(timeSheet.calcTimeCode(i + 1)); // key? if (timeSheet.key[i]) { s.append(" X "); } else { s.append(" "); } // 15 characters for the mouth shape s.append(padString(timeSheet.mouth[i], 15)); // optional comment s.append(timeSheet.comment[i]); s.append("\n"); } // convert to a string return s.toString(); } public String mohoFormat() { StringBuffer s = new StringBuffer("MohoSwitch1\n"); for (int i = 0; i < wavePanel.frameCount; i++) { String mouthShape = timeSheet.mouth[i]; if (mouthShape.length() > 0) { s.append((i + 1) + " " + mouthShape + "\n"); } } // convert to a string return s.toString(); } public String gameStudioFormat() { StringBuffer s = new StringBuffer(); // frame count and frames per second s.append(wavePanel.frameCount + " " + wavePanel.framesPerSecond + "\n"); // initialize timing int hour = timeSheet.hourOffset; int minute = timeSheet.minuteOffset; int second = timeSheet.secondOffset; int tick = 0; for (int i = 0; i < wavePanel.frameCount; i++) { // tick tick++; if (tick > wavePanel.framesPerSecond) { tick = 1; second++; if (second > 59) { second = 0; minute++; if (minute > 59) { minute = 0; hour++; } } } // add frame number s.append((i + 1) + " "); // add timecode s.append(hour + " " + minute + " " + second + " "); // key? if (timeSheet.key[i]) { // true s.append("1 "); } else { // false s.append("0 "); } // mouth shape String mouth = timeSheet.mouth[i]; if (mouth.length() == 0) { s.append("none, "); } else { s.append(mouth + ", "); } } // convert to a string return s.toString(); } public void exportFile(int fileType) { JFileChooser fc = Utilities.fileChooser(null); int returnVal = Utilities.showSaveDialog(this, fc); if (returnVal == JFileChooser.APPROVE_OPTION) { // get the selected file File file = fc.getSelectedFile(); // make sure it ends with the proper extention String fileName = file.getPath(); fileName = addFileExtention(fileName, ".txt"); FileWriter stream; try { stream = new FileWriter(file); } catch (Exception e) { Utilities.errMessage("Error writing file " + e); return; } // create file contents String contents = new String(); try { // create the contents switch (fileType) { case FORMAT_MAGPIE: contents = magpieFormat(); break; case FORMAT_MOHO: contents = mohoFormat(); break; case FORMAT_GAMESTUDIO: contents = gameStudioFormat(); break; } // write the contents stream.write(contents); stream.close(); } catch (Exception e) { Utilities.errMessage("Error writing file:" + e); return; } } } public void copyToClipboard() { // create a clipboard Clipboard clipboard = clipboard = Toolkit.getDefaultToolkit() .getSystemClipboard(); // create the contents StringSelection contents = new StringSelection(magpieFormat()); // copy to clipboard clipboard.setContents(contents, null); } // This method returns true if the specified image has transparent pixels public static boolean hasAlpha(Image image) { // If buffered image, the color model is readily available if (image instanceof BufferedImage) { BufferedImage bimage = (BufferedImage) image; return bimage.getColorModel().hasAlpha(); } // Use a pixel grabber to retrieve the image's color model; // grabbing a single pixel is usually sufficient PixelGrabber pg = new PixelGrabber(image, 0, 0, 1, 1, false); try { pg.grabPixels(); } catch (InterruptedException e) { // nothing to do } // Get the image's color model ColorModel cm = pg.getColorModel(); return cm.hasAlpha(); } // This method returns a buffered image with the contents of an image public static BufferedImage toBufferedImage(Image image) { if (image instanceof BufferedImage) { return (BufferedImage) image; } // This code ensures that all the pixels in the image are loaded image = new ImageIcon(image).getImage(); // Determine if the image has transparent pixels; for this method's // implementation, see e665 Determining If an Image Has Transparent // Pixels boolean hasAlpha = hasAlpha(image); // Create a buffered image with a format that's compatible with the // screen BufferedImage bimage = null; GraphicsEnvironment ge = GraphicsEnvironment .getLocalGraphicsEnvironment(); try { // Determine the type of transparency of the new buffered image int transparency = Transparency.OPAQUE; if (hasAlpha) { transparency = Transparency.BITMASK; } // Create the buffered image GraphicsDevice gs = ge.getDefaultScreenDevice(); GraphicsConfiguration gc = gs.getDefaultConfiguration(); bimage = gc.createCompatibleImage(image.getWidth(null), image .getHeight(null), transparency); } catch (HeadlessException e) { // The system does not have a screen } if (bimage == null) { // Create a buffered image using the default color model int type = BufferedImage.TYPE_INT_RGB; if (hasAlpha) { type = BufferedImage.TYPE_INT_ARGB; } bimage = new BufferedImage(image.getWidth(null), image .getHeight(null), type); } // Copy image to buffered image Graphics g = bimage.createGraphics(); // Paint the image onto the buffered image g.drawImage(image, 0, 0, null); g.dispose(); return bimage; } // write out an AviFile public void writeAviFile() { // no wave selected? if (wavePanel == null || wavePanel.fileName.equals("")) { Utilities.errMessage("Audio file must be selected first."); return; } // Show save file dialog JFileChooser fc = Utilities.fileChooser(null); fc.addChoosableFileFilter(new AviFilter()); int returnVal = Utilities.showSaveDialog(this, fc); if (returnVal == JFileChooser.APPROVE_OPTION) { // get the selected file File file = fc.getSelectedFile(); // need to add an extention? String fileName = file.getPath(); fileName = addFileExtention(fileName, ".avi"); new CreateAviFile(fileName).start(); } } // create an AVI file on a background thread class CreateAviFile extends Thread { String fileName; public CreateAviFile(String theFileName) { // save the name of the file fileName = theFileName; } public void run() { // for now, dummy code AviWriter theWriter; // get the default icon String priorFace = ""; ImageIcon icon = facePanel.getFace(priorFace); // make it a BufferedImages BufferedImage bufferedImage = toBufferedImage(icon.getImage()); // values for the avi file int frames = wavePanel.frameCount; int fps = wavePanel.framesPerSecond; int height = 116; // must be divisible by 4 int width = 126; // must be an even number // write the frames to the file try { // create the AviWriter theWriter = new AviWriter(fileName, wavePanel.fileName, height, width, frames, fps); // write out the required number of frames for (int i = 0; i < frames; i++) { statusBar.setText("Frame #" + (i + 1)); // get the next mouth String useFace = timeSheet.mouth[i]; // update frame if different if (!useFace.equals(priorFace) && !useFace.equals("")) { // get the icon ImageIcon nextIcon = facePanel.getFace(useFace); if (nextIcon != null) { // make it a BufferedImages bufferedImage = toBufferedImage(nextIcon.getImage()); // copy the pixels into the frame for (int x = 0; x < icon.getIconWidth(); x++) { for (int y = 0; y < icon.getIconHeight(); y++) { int rgb = bufferedImage.getRGB(x, y); int r = (0xff & (rgb >> 16)); int g = (0xff & (rgb >> 8)); int b = (0xff & rgb); theWriter.setPixel(x, y, r, g, b); } } } } // add the frame to the file theWriter.addFrame(); } // close the file statusBar.setText("Writing the AVI file..."); theWriter.close(); // success statusBar.setText("Created AVI file"); } catch (Exception e1) { Utilities.errMessage("Error creating .AVI file: " + e1); } } } public JMenuBar createMenuBar() { JMenuBar menuBar; JMenu menu, subMenu; JMenuItem menuItem, subMenuItem; JRadioButtonMenuItem rbMenuItem; JCheckBoxMenuItem cbMenuItem; //Create the menu bar. menuBar = new JMenuBar(); // file menu menu = new JMenu("File"); menu.setMnemonic(KeyEvent.VK_F); menu.getAccessibleContext().setAccessibleDescription( "Open and Save options"); menuBar.add(menu); //file : new menuItem = new JMenuItem("New...", KeyEvent.VK_O); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.ALT_MASK)); menuItem.getAccessibleContext().setAccessibleDescription( "Create a new timesheet"); menu.add(menuItem); menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // save current work? if (cancelledAutoSave()) { return; } // erase time sheet eraseTimeSheet(); } }); //file : open menuItem = new JMenuItem("Open...", KeyEvent.VK_O); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.ALT_MASK)); menuItem.getAccessibleContext().setAccessibleD