Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ch.laoe.clip
Class AClipStorage  view AClipStorage download AClipStorage.java

java.lang.Object
  extended bych.laoe.clip.AClipStorage

public class AClipStorage
extends java.lang.Object

This file is part of LAoE. LAoE is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. LAoE 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. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with LAoE; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Class: AClipStorage Autor: olivier gäumann, neuchâtel (switzerland) JDK: 1.3 Desctription: clip fileformat saver/loader. file format definition: XML format is used, the filename-extension is ".laoe". it is gzipped. "complete" clip-types describe a complete clip, "partial" clip describes only relative changes to the previous clip. complete clips need all attributes of the tags, partial clips only attributes to identify the tag and the changed attributes. the "length"-attribute in the samples-tag is mandatory. following fields are optional on partial clips: layer, channel, samples, selection. all data outside the "laoe" field are ignored. the fileformat is identified through the laoe-tag and its attribute "fileformat". the file consists of two parts, the xml-header described below, which contains general informations, and the samples-body, which is outside the xml-part and contains all sample values, as binary streamed float-values. optional binary serialized samples in the same order than described in the XML-header... Since LAoE version 0.4.04 beta the channel-selection may optionally contain intensity-information. So the selection may be an element with separate begin- and end-tag in addition to the old data-less version. Backward-compatibility must be guaranteed!!! Here an example: ... ... Since LAoE version 0.4.05 beta the channel may optionally contain a mask.Backward-compatibility must be guaranteed!!! Here an example: ... ... ... The layer contains a new optional attribute "plotType": at the time, two different plottypes exist: sample-curve and spectrogram. ... ... Since LAoE version 0.4.08 beta the channel may optionally contain markers.Backward-compatibility must be guaranteed!!! Here an example: ... ... ... ... Since LAoE version 0.6.02 beta the channel-plotter may optionally contain the color, in hexadecimal format. Backward-compatibility must be guaranteed!!! Here an example: ... ... ... History: Date: Description: Autor: 13.07.01 first draft oli4 15.07.01 gzipped and serialized oli4 18.07.01 put serialized samples at the end oli4 22.01.02 add intensity to the selection oli4 03.03.02 add channel-mask oli4 18.03.02 add layer plottype oli4 04.07.02 add markers oli4 27.04.2003 add channel-plotter color oli4


Field Summary
private static boolean channelCompressionEnable
           
 
Constructor Summary
AClipStorage()
           
 
Method Summary
static boolean load(AClip c, java.io.File f)
          loads a clip from a file.
static float[] loadSamples(java.io.File f)
          loads a sample-array in serialized form
private static float[] loadSamples(java.io.ObjectInputStream ois)
          loads a sample-array in serialized form
static void save(AClip c, java.io.File f)
          saves a clip to a file.
private static void save(AClip c, java.io.File f, boolean completeClip)
           
static void saveSamples(float[] samples, java.io.File f)
          saves a sample-array in serialized form
private static void saveSamples(float[] samples, java.io.ObjectOutputStream oos)
          saves a sample-array in serialized form
static void saveWithoutSamples(AClip c, java.io.File f)
          saves a clip with link to external samples
static boolean supports(java.io.File f)
          loads a clip from a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

channelCompressionEnable

private static final boolean channelCompressionEnable
Constructor Detail

AClipStorage

public AClipStorage()
Method Detail

supports

public static boolean supports(java.io.File f)
                        throws java.io.IOException
loads a clip from a file. returns true, if the fileformat was accepted, and false if it was a wrong fileformat


load

public static boolean load(AClip c,
                           java.io.File f)
                    throws java.io.IOException
loads a clip from a file. returns true, if the fileformat was accepted, and false if it was a wrong fileformat


save

public static void save(AClip c,
                        java.io.File f)
                 throws java.io.IOException
saves a clip to a file.


saveWithoutSamples

public static void saveWithoutSamples(AClip c,
                                      java.io.File f)
                               throws java.io.IOException
saves a clip with link to external samples


save

private static void save(AClip c,
                         java.io.File f,
                         boolean completeClip)
                  throws java.io.IOException

loadSamples

private static float[] loadSamples(java.io.ObjectInputStream ois)
                            throws java.io.IOException
loads a sample-array in serialized form


saveSamples

private static void saveSamples(float[] samples,
                                java.io.ObjectOutputStream oos)
                         throws java.io.IOException
saves a sample-array in serialized form


saveSamples

public static void saveSamples(float[] samples,
                               java.io.File f)
                        throws java.io.IOException
saves a sample-array in serialized form


loadSamples

public static float[] loadSamples(java.io.File f)
                           throws java.io.IOException
loads a sample-array in serialized form