#include <qapp.h> #include <amplifier/amplifier.h> #include <devices/genericPlayer.h> #include <devices/audioDevice.h> #include <unistd.h> int main(int nargs,char** args) { QApplication a( nargs, args); AudioDevice* audioDevice= new AudioDevice("/dev/dsp"); GenericPlayer* player; audioDevice->open(); player=Amplifier::createPlayer(_MP3_DECODER); player->open("my.mp3"); player->addListener(audioDevice); a.exec(); delete player; delete audioDevice; return 0; }
Hello world opens a file and plays a song. Then it enters the qt event loop. A GUI can control the player by calling methods on the player instance.
See the genericPlayer class for more options for a GUI
This is the multimedia graph which is created.