|
||||||||||
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.spi.mp4.MP4Handler
public class MP4Handler
A parser to load MP4 objects. Doesn't decode audio, but can extract metadata from the MP4 object. Uses NIO and skips over blocks that aren't required so should be very quick and memory efficient.
Field Summary |
---|
Fields inherited from class org.qtunes.ff.TrackReader |
---|
MP3GENRES |
Constructor Summary | |
---|---|
MP4Handler()
|
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) |
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 |
startService(ServiceContext context)
Start the Service |
void |
stopService(ServiceContext context)
Stop the Service |
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 MP4Handler()
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 FieldMap read(java.io.File file) throws java.io.IOException
TrackReader
FieldMap
with its fields
read
in class TrackReader
java.io.IOException
public java.util.Map<java.lang.String,java.lang.Object> reportState()
Service
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 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 |