org.hd.d.pg2k.svrCore.MIME
Class AbstractSampledSoundHandler

java.lang.Object
  extended by org.hd.d.pg2k.svrCore.MIME.AbstractHandler
      extended by org.hd.d.pg2k.svrCore.MIME.AbstractSampledSoundHandler
All Implemented Interfaces:
Handler
Direct Known Subclasses:
au, wav

public abstract class AbstractSampledSoundHandler
extends AbstractHandler

Base class with useful default behaviour for (sampled) sound exhibit media-handler classes. By default this uses javax.sound.* routines to extract sound and metadata from an exhibit stream.

Various routines can be overridden in deriving classes to change this behaviour.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.hd.d.pg2k.svrCore.MIME.Handler
Handler.ThumbnailParams
 
Field Summary
 
Fields inherited from interface org.hd.d.pg2k.svrCore.MIME.Handler
TAG_NAME_METADATA_TOP
 
Constructor Summary
AbstractSampledSoundHandler()
           
 
Method Summary
protected  javax.sound.sampled.AudioFileFormat getAudioFileFormat(java.io.InputStream is)
          Get format of audio data; null if none or format not usable/parseable.
 org.w3c.dom.Node getMetadata(java.io.InputStream is, Name.ExhibitFull exhibitName)
          Gets all available exhibit metadata as a single XML DOM tree; null if none.
 
Methods inherited from class org.hd.d.pg2k.svrCore.MIME.AbstractHandler
canMakeThumbnails, decodeImage, get2DImageDimensions, getThumbnailParams, makeImageBinary, makeSizeConstrainedEncodedImage, makeThumbnails, makeThumbnails
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hd.d.pg2k.svrCore.MIME.Handler
getExhibitType
 

Constructor Detail

AbstractSampledSoundHandler

public AbstractSampledSoundHandler()
Method Detail

getAudioFileFormat

protected javax.sound.sampled.AudioFileFormat getAudioFileFormat(java.io.InputStream is)
Get format of audio data; null if none or format not usable/parseable. This may require the stream to be seekable, at least with mark() and reset().


getMetadata

public org.w3c.dom.Node getMetadata(java.io.InputStream is,
                                    Name.ExhibitFull exhibitName)
Gets all available exhibit metadata as a single XML DOM tree; null if none. We do not (yet) have a schema for this and may never do so, since its structure and content will depend on various external sources and parts of (for example) the ImageIO and JAI subsystems.

This implementation synthesises a metadata tree from the AudioFileFormat data, if any.

Specified by:
getMetadata in interface Handler
Overrides:
getMetadata in class AbstractHandler
Parameters:
is - input stream; never null
exhibitName - TODO
Returns:
top-level node "metadata" with captured metadata beneath, else null

DHD Multimedia Gallery V1.60.69

Copyright (c) 1996-2012, Damon Hart-Davis. All rights reserved.