org.mmbase.module.builders
Class AudioParts

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

public class AudioParts
extends MediaParts

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: AudioParts.java,v 1.27 2002/01/28 13:26:20 pierre Exp $
Author:
Daniel Ockeloen, David van Zeventer, Rico Jansen

Field Summary
static int AUDIOSOURCE_CD
           
static int AUDIOSOURCE_DEFAULT
           
static int AUDIOSOURCE_DROPBOX
           
static int AUDIOSOURCE_JAZZ
           
static int AUDIOSOURCE_UPLOAD
           
static int AUDIOSOURCE_VWM
           
 
Fields inherited from class org.mmbase.module.builders.MediaParts
urlCache
 
Fields inherited from class org.mmbase.module.core.MMObjectBuilder
broadcastChanges, className, database, debug, description, descriptions, fields, NODE_MAX_SIZE, nodeCache, obj2type, OBJ2TYPE_MAX_SIZE, oType, replaceCache, searchAge, sortedDBLayout, TEMPNODE_DEFAULT_SIZE, TemporaryNodes, virtual
 
Fields inherited from class org.mmbase.module.core.MMTable
mmb, tableName
 
Constructor Summary
AudioParts()
           
 
Method Summary
 void addRawAudio(RawAudios bul, int id, int status, int format, int speed, int channels)
           
static long calcTime(java.lang.String time)
          Deprecated. Time stuff should be in util class
 java.lang.String doGetUrl(scanpage sp, int number, int userSpeed, int userChannels)
          Calls the get url method for audioparts.
 java.lang.String getAudiopartUrl(MMBase mmbase, scanpage sp, int number, int speed, int channels)
          Gets the url for a audiopart using the mediautil classes.
protected  java.lang.String getAudioSourceString(int source)
           
 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.
 int getMinChannels()
          Gets minimal channel setting from audioutil
 int getMinSpeed()
          Gets minimal speed setting from audioutils
 java.lang.Object getValue(MMObjectNode node, java.lang.String field)
          Provides additional functionality when obtaining field values.
 int insertDone(EditState ed, MMObjectNode node)
          When an audiopart is inserted, the start & stop times still need to be saved.(start & stop are not real fields, these were later)
static void main(java.lang.String[] args)
          Test
 int preEdit(EditState ed, MMObjectNode node)
          Just before commiting or inserting this method is called and only when a node was changed (commit) we update the start and stoptimes.
 void setDefaults(MMObjectNode node)
          setDefaults for a node
 
Methods inherited from class org.mmbase.module.builders.MediaParts
getChannelsParam, getNumberParam, getSpeedParam, getUrl, init, nodeLocalChanged, nodeRemoteChanged, removeFromUrlCache, removeRaws, replace
 
Methods inherited from class org.mmbase.module.core.MMObjectBuilder
addField, addLocalObserver, addRemoteObserver, buildSet, checkAddTmpField, commit, convertMMNode2SQL, count, create, createAlias, created, debug, deleteNodeCache, executeFunction, fieldLocalChanged, getAge, getAliasedNode, getCacheNumbers, getCacheSize, getCacheSize, getClassName, getDBByte, getDBKey, getDBState, getDBText, getDBType, getDefaultTeaser, getDefaultUrl, getDescription, getDescriptions, getDutchSName, getEditFields, getField, getFieldNames, getFields, getFullTableName, getFunctionParameters, getHardNode, getHardNode, getHTML, getInitParameter, getInitParameters, getList, getMachineName, getMaintainer, getNewNode, getNewTmpNode, getNextField, getNode, getNode, getNode, getNode, getNodeType, getNumberFromName, getPluralName, getPluralName, getPluralNames, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getSortedFields, getSortedListFields, getTableName, getTmpNode, getURLEncode, getVersion, getWAP, getXMLPath, getXMLSetup, hostname_function, init_obj2type, insert, insert, isNodeCached, isVirtual, isXMLConfig, preCommit, process, putTmpNode, readSearchResults, removeField, removeNode, removeRelations, removeTmpNode, safeCache, safeCommit, safeInsert, search, search, search, searchIn, searchIn, searchIn, searchNumbers, searchVector, searchVector, searchVector, searchVector, searchVectorIn, searchVectorIn, searchVectorIn, searchVectorIn, searchWithWhere, sendFieldChangeSignal, setClassName, setDBLayout_xml, setDBLayout, setDebug, setDescription, setDescriptions, setDutchSName, setInitParameter, setMaintainer, setMMBase, setPluralNames, setSearchAge, setSingularNames, setTableName, setValue, setValue, setVersion, setXmlConfig, setXMLPath, setXMLValues, signalNewObject, testValidData, toXML, waitUntilNodeChanged, wrap
 
Methods inherited from class org.mmbase.module.core.MMTable
size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUDIOSOURCE_DEFAULT

public static final int AUDIOSOURCE_DEFAULT

AUDIOSOURCE_DROPBOX

public static final int AUDIOSOURCE_DROPBOX

AUDIOSOURCE_UPLOAD

public static final int AUDIOSOURCE_UPLOAD

AUDIOSOURCE_CD

public static final int AUDIOSOURCE_CD

AUDIOSOURCE_JAZZ

public static final int AUDIOSOURCE_JAZZ

AUDIOSOURCE_VWM

public static final int AUDIOSOURCE_VWM
Constructor Detail

AudioParts

public AudioParts()
Method Detail

preEdit

public int preEdit(EditState ed,
                   MMObjectNode node)
Just before commiting or inserting this method is called and only when a node was changed (commit) we update the start and stoptimes. (start & stoptimes of newly inserted nodes are inserted by insertDone).
Overrides:
preEdit in class MMObjectBuilder
Parameters:
ed - the editstate
node - the audiopart node that has just been inserted.
Returns:
-1

insertDone

public int insertDone(EditState ed,
                      MMObjectNode node)
When an audiopart is inserted, the start & stop times still need to be saved.(start & stop are not real fields, these were later)
Overrides:
insertDone in class MMObjectBuilder
Parameters:
ed - the editstate
node - the audiopart node that has just been inserted.
Returns:
-1

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.lang.String) 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.lang.String) 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.

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

getAudioSourceString

protected java.lang.String getAudioSourceString(int source)

addRawAudio

public void addRawAudio(RawAudios bul,
                        int id,
                        int status,
                        int format,
                        int speed,
                        int channels)

setDefaults

public void setDefaults(MMObjectNode node)
setDefaults for a node
Overrides:
setDefaults in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Parameters:
node - The node to set the defaults of.

calcTime

public static long calcTime(java.lang.String time)
Deprecated. Time stuff should be in util class


doGetUrl

public java.lang.String doGetUrl(scanpage sp,
                                 int number,
                                 int userSpeed,
                                 int userChannels)
Calls the get url method for audioparts.
Overrides:
doGetUrl in class MediaParts
Parameters:
sp - the scanpage
number - the audiopart object number
speed - the user speed value
channels - the user channels value
Returns:
a String with url to a audiopart.

getAudiopartUrl

public java.lang.String getAudiopartUrl(MMBase mmbase,
                                        scanpage sp,
                                        int number,
                                        int speed,
                                        int channels)
Gets the url for a audiopart using the mediautil classes.
Parameters:
mmbase - mmbase reference
sp - the scanpage
number - the audiopart object number
speed - the user speed value
channels - the user channels value
Returns:
a String with url to a audiopart.

getMinSpeed

public int getMinSpeed()
Gets minimal speed setting from audioutils
Overrides:
getMinSpeed in class MediaParts
Returns:
minimal speed setting

getMinChannels

public int getMinChannels()
Gets minimal channel setting from audioutil
Overrides:
getMinChannels in class MediaParts
Returns:
minimal channel setting

main

public static void main(java.lang.String[] args)
Test


MMBase 2002