Next: , Previous: Including and linking to libmarsyasqt, Up: Writing Qt4 applications


9.3.2 MarSystemQtWrapper

The actual interaction between Qt and Marsyas is performed with a MarSystemQtWrapper object. Add the following lines to your header file that deals with Marsyas:

     #include "MarSystemQtWrapper.h"
     using namespace MarsyasQt;

You may now create a pointer to a MarSystemQtWrapper in your object:

     MarSystemQtWrapper *mrsWrapper;

To use this object in your source file, create a MarSystem like normal, then pass it to a new MarSystemQtWrapper object:

     MarSystemManager mng;
     playbacknet = mng.create("Series", "playbacknet");
     ... set up playbacknet...
     
     // wrap it up to make it pretend to be a Qt object:
     mrsWrapper = new MarSystemQtWrapper(playbacknet);
     mrsWrapper->start();
     mrsWrapper->play();
     
     ... do something for a while...
     mrsWrapper->stop();
     delete mrsWrapper;