org.mmbase.module.builders
Class RawAudios

java.lang.Object
  |
  +--org.mmbase.module.core.MMTable
        |
        +--org.mmbase.module.core.MMObjectBuilder
              |
              +--org.mmbase.module.builders.RawAudios

public class RawAudios
extends MMObjectBuilder

NOTE This Builder needs significant changes to operate on NON-VPRO machines. Do NOT use before that, also ignore all errors stemming from this builder

Version:
$Id: RawAudios.java,v 1.15 2002/07/23 13:55:43 vpro Exp $
Author:
Daniel Ockeloen, David van Zeventer

Field Summary
static int GEDAAN
           
static int MP2_FORMAT
           
static int MP3_FORMAT
           
static int PCM_FORMAT
           
static int RA_FORMAT
           
 boolean replaceCache
           
static int SURESTREAM_FORMAT
           
static int WAV_FORMAT
           
 
Fields inherited from class org.mmbase.module.core.MMObjectBuilder
broadcastChanges, database, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, fields, nodeCache, obj2type, OBJ2TYPE_MAX_SIZE, oType, REPLACE_CACHE, searchAge, sortedDBLayout, TEMPNODE_DEFAULT_SIZE, TemporaryNodes, virtual
 
Fields inherited from class org.mmbase.module.core.MMTable
mmb, tableName
 
Constructor Summary
RawAudios()
           
 
Method Summary
static java.lang.String getFileName(int format, int speed, int channels)
          getFileName: Gets the right audio filename using the format speed and channels values.
 java.lang.String getFullName(MMObjectNode node)
           
 java.lang.String getGUIIndicator(MMObjectNode node)
          What should a GUI display for this node.
 java.lang.String getGUIIndicator(java.lang.String field, MMObjectNode node)
          What should a GUI display for this node/field combo.
static java.lang.String getHostName(java.lang.String url)
          getHostName: Gets the right hostname and using String containing a rawaudios.url field.
 MMObjectNode getNewNode(java.lang.String owner)
          get new node
static java.lang.String getProtocolName(int format)
          getProtocolName: Gets the protocol name used for this audiofile.
 java.lang.Object getValue(MMObjectNode node, java.lang.String field)
          Provides additional functionality when obtaining field values.
 boolean removeAudio(int id)
           
 
Methods inherited from class org.mmbase.module.core.MMObjectBuilder
addField, addLocalObserver, addRemoteObserver, buildSet, checkAddTmpField, commit, convertMMNode2SQL, count, create, createAlias, created, deleteNodeCache, drop, equals, equals, executeFunction, executeFunction, fieldLocalChanged, getAge, getAliasedNode, getAncestors, getCacheNumbers, getCacheSize, getCacheSize, getClassName, getConfigFile, getDBByte, getDBKey, getDBState, getDBText, getDBType, getDefaultTeaser, getDefaultUrl, getDescendants, getDescription, getDescription, getDescriptions, getEditFields, getField, getFieldNames, getFields, getFields, getFullTableName, getFunctionParameters, getHardNode, getHardNode, getHTML, getInitParameter, getInitParameters, getList, getLocaleGUIIndicator, getLocaleGUIIndicator, getMachineName, getMaintainer, getNewTmpNode, getNextField, getNextField, getNode, getNode, getNode, getNode, getNodes, getNodeType, getNumberFromName, getObjectType, getObjectValue, getParentBuilder, getPluralName, getPluralName, getPluralNames, getQuery, getQuery, getQuery, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getSortedFields, getSortedListFields, getTableName, getTmpNode, getURLEncode, getVersion, getWAP, getXMLPath, hashCode, hostname_function, init, insert, insert, insertDone, isExtensionOf, isNodeCached, isVirtual, nodeLocalChanged, nodeRemoteChanged, preCommit, preEdit, process, putTmpNode, readSearchResults, removeField, removeNode, removeRelations, removeTmpNode, replace, safeCache, safeCommit, safeInsert, search, search, search, searchIn, searchIn, searchIn, searchList, searchList, searchNumbers, searchVector, searchVector, searchVector, searchVector, searchVectorIn, searchVectorIn, searchVectorIn, searchVectorIn, searchWithWhere, sendFieldChangeSignal, setDBLayout_xml, setDefaults, setDescription, setDescriptions, setInitParameter, setMaintainer, setMMBase, setParentBuilder, setPluralNames, setSearchAge, setSingularNames, setTableName, setValue, setValue, setVersion, setXMLPath, setXMLValues, signalNewObject, testValidData, toString, toString, toXML, updateFields, waitUntilNodeChanged, wrap
 
Methods inherited from class org.mmbase.module.core.MMTable
size
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MP3_FORMAT

public static final int MP3_FORMAT

RA_FORMAT

public static final int RA_FORMAT

WAV_FORMAT

public static final int WAV_FORMAT

PCM_FORMAT

public static final int PCM_FORMAT

MP2_FORMAT

public static final int MP2_FORMAT

SURESTREAM_FORMAT

public static final int SURESTREAM_FORMAT

GEDAAN

public static final int GEDAAN

replaceCache

public boolean replaceCache
Constructor Detail

RawAudios

public RawAudios()
Method Detail

getGUIIndicator

public java.lang.String getGUIIndicator(MMObjectNode node)
Description copied from class: MMObjectBuilder
What should a GUI display for this node. Default is the first non system field (first field after owner). Override this to display your own choice (see Images.java).
Overrides:
getGUIIndicator in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Parameters:
node - The node to display
Returns:
the display of the node as a String

getGUIIndicator

public java.lang.String getGUIIndicator(java.lang.String field,
                                        MMObjectNode node)
Description copied from class: MMObjectBuilder
What should a GUI display for this node/field combo. Default is null (indicating to display the field as is) Override this to display your own choice.
Overrides:
getGUIIndicator in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Parameters:
node - The node to display
field - the name field of the field to display
Returns:
the display of the node's field as a String, null if not specified

getNewNode

public MMObjectNode getNewNode(java.lang.String owner)
get new node
Overrides:
getNewNode in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Parameters:
owner - The administrator creating the new node.
Returns:
A newly initialized MMObjectNode.

getValue

public java.lang.Object getValue(MMObjectNode node,
                                 java.lang.String field)
Description copied from class: MMObjectBuilder
Provides additional functionality when obtaining field values. This method is called whenever a Node of the builder's type fails at evaluating a getValue() request (generally when a fieldname is supplied that doesn't exist). It allows the system to add 'functions' to be included with a field name, such as 'html(body)' or 'time(lastmodified)'. This method will parse the fieldname, determining functions and calling the MMObjectBuilder.executeFunction(org.mmbase.module.core.MMObjectNode, java.lang.String, java.util.List) method to handle it. Functions in fieldnames can be given in the format 'functionname(fieldname)'. An old format allows 'functionname_fieldname' instead, though this only applies to the text functions 'short', 'html', and 'wap'. Functions can be nested, i.e. 'html(shorted(body))'. Derived builders should override this method only if they want to provide virtual fieldnames. To provide addiitonal functions, override MMObjectBuilder.executeFunction(org.mmbase.module.core.MMObjectNode, java.lang.String, java.util.List) instead.
Overrides:
getValue in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Parameters:
node - the node whos efields are queries
field - the fieldname that is requested
Returns:
the result of the 'function', or null if no valid functions could be determined.

removeAudio

public boolean removeAudio(int id)

getFullName

public java.lang.String getFullName(MMObjectNode node)

getFileName

public static java.lang.String getFileName(int format,
                                           int speed,
                                           int channels)
getFileName: Gets the right audio filename using the format speed and channels values.
Parameters:
format - The audio format used.
speed - The speed value.
channels - The channels value.
Returns:
The audio fileName

getHostName

public static java.lang.String getHostName(java.lang.String url)
getHostName: Gets the right hostname and using String containing a rawaudios.url field. This method contains a lot of if-then-else constructs, since the RawAudios.url field uses such a StrangE! format. the url format is either: F=/audiopart#/16_1.ra H1=hostA.bla.nl H2=hostB.bla.nl the url format is or: http://hostA.vpro.nl/audio/ra/audiopart#/40_1.ra
Parameters:
url - A String containing the contents of the rawaudios.url field.
Returns:
The hostName

getProtocolName

public static java.lang.String getProtocolName(int format)
getProtocolName: Gets the protocol name used for this audiofile. Currently only SURESTREAM and RA is supported and the method returns HTTP if another.
Parameters:
format - The audio format used.
Returns:
A String containing the protocolName.


MMBase build 1.6.5.20030923