sdl.test
Class TestMpegVideo
java.lang.Object
|
+--sdl.test.TestMpegVideo
- All Implemented Interfaces:
- sdl.event.EventListener
- public class TestMpegVideo
- extends java.lang.Object
- implements sdl.event.EventListener
Demonstrates playing of an MP3 file using SMPEG for SDL
public class TestMpegAudio implements EventListener{
// so we can handle an SDLQuit event
public boolean incomingEvents(SDLCustomEvent event) throws SDLEventException
{
}
public static void main(String args[])
{
...
TestMpegAudio test = new TestMpegAudio();
...
// event stuff so we can stop playing with a SDLQuit
EventDispatcher dispatch = new EventDispatcher(true);
dispatch.registerEventListener(test);
// load and play the MP3 file
test.m_Mpeg = new SDLMpeg(args[0],true);
test.m_Mpeg.enableAudio(true);
test.m_Mpeg.play();
// start main event loop
dispatch.startAndWait();
}
}
Method Summary |
boolean |
incomingEvents(sdl.event.SDLCustomEvent event)
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TestMpegVideo
public TestMpegVideo()
incomingEvents
public boolean incomingEvents(sdl.event.SDLCustomEvent event)
throws sdl.event.SDLEventException
- Specified by:
incomingEvents
in interface sdl.event.EventListener
sdl.event.SDLEventException
main
public static void main(java.lang.String[] args)