|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.qtunes.ff.TrackReader org.qtunes.ff.TrackWriter org.qtunes.ff.spi.mp3.MP3Handler
public class MP3Handler
Field Summary |
---|
Fields inherited from class org.qtunes.ff.TrackReader |
---|
MP3GENRES |
Constructor Summary | |
---|---|
MP3Handler()
|
Method Summary | |
---|---|
javax.sound.sampled.AudioInputStream |
getAudioInputStream(java.io.File file)
Return the AudioInputStream for the specified File. |
ServiceContext |
getContext()
Return the ServiceContext that was passed into Service.startService(org.qtunes.core.ServiceContext) |
boolean |
getGainStorage(java.lang.String type)
|
java.lang.String |
getType()
Get the type of track read by this reader, eg "mp3". |
static void |
main(java.lang.String[] args)
|
boolean |
matches(java.io.File file)
Return true if this TrackReader matches the File |
FieldMap |
read(java.io.File file)
Load and parse the file and return a FieldMap with its fields |
java.util.Map<java.lang.String,java.lang.Object> |
reportState()
Return a Map describing the state of this Service, for serialization back to any client that needs to know (eg webplayer) - so values should be serializable objects, eg Lists, Maps or simple objects. |
void |
setGainStorage(java.lang.String type,
boolean on)
|
void |
startService(ServiceContext context)
Start the Service |
void |
stopService(ServiceContext context)
Stop the Service |
boolean |
write(java.io.File infile,
FieldMap fields)
Update a file directly - can be used by utility classes (eg tagger package) to update files without a database. |
void |
write(Track track,
FieldMap changes)
Update the track |
Methods inherited from class org.qtunes.ff.TrackReader |
---|
getTrackReader, getTrackReader, getTrackReader, getTrackReader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MP3Handler()
Method Detail |
---|
public java.lang.String getType()
TrackReader
getType
in class TrackReader
public boolean matches(java.io.File file)
TrackReader
matches
in class TrackReader
public void setGainStorage(java.lang.String type, boolean on)
public boolean getGainStorage(java.lang.String type)
public FieldMap read(java.io.File file) throws java.io.IOException
TrackReader
FieldMap
with its fields
read
in class TrackReader
java.io.IOException
public void write(Track track, FieldMap changes) throws java.io.IOException
TrackWriter
write
in class TrackWriter
track
- the Track with the existing fieldschanges
- the Changes to those fields - a value of null
in this Map means the field is deleted, and a key of
Field.LastModified
means the File modification time will not be updated.
java.io.IOException
public boolean write(java.io.File infile, FieldMap fields) throws java.io.IOException
TrackWriter
write
in class TrackWriter
infile
- the audio File to updatefields
- the Changes to those fields - a value of null
in this Map means the field is deleted, and a key of
Field.LastModified
means the File modification time will not be updated.
java.io.IOException
public void startService(ServiceContext context)
Service
context
- the ServiceContext for this Servicepublic void stopService(ServiceContext context)
Service
context
- the ServiceContext for this Service (same as was passed into start)public ServiceContext getContext()
Service
Service.startService(org.qtunes.core.ServiceContext)
public java.util.Map<java.lang.String,java.lang.Object> reportState()
Service
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public javax.sound.sampled.AudioInputStream getAudioInputStream(java.io.File file) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
TrackReader
AudioInputStream
for the specified File. We
use this approach because it's more reliable than relying on
the AudioSystem
to correctly identify
the file.
getAudioInputStream
in class TrackReader
javax.sound.sampled.UnsupportedAudioFileException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |